initial commit
This commit is contained in:
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Editor configuration, see http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
32
.eslintrc.json
Normal file
32
.eslintrc.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"ignorePatterns": ["**/*"],
|
||||||
|
"plugins": ["@nrwl/nx"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
"rules": {
|
||||||
|
"@nrwl/nx/enforce-module-boundaries": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"enforceBuildableLibDependency": true,
|
||||||
|
"allow": [],
|
||||||
|
"depConstraints": [
|
||||||
|
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
"extends": ["plugin:@nrwl/nx/typescript"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.js", "*.jsx"],
|
||||||
|
"extends": ["plugin:@nrwl/nx/javascript"],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
39
.gitignore
vendored
Normal file
39
.gitignore
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# compiled output
|
||||||
|
/dist
|
||||||
|
/tmp
|
||||||
|
/out-tsc
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
/.idea
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.c9/
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
|
# IDE - VSCode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
|
||||||
|
# misc
|
||||||
|
/.sass-cache
|
||||||
|
/connect.lock
|
||||||
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
testem.log
|
||||||
|
/typings
|
||||||
|
|
||||||
|
# System Files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
4
.prettierignore
Normal file
4
.prettierignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Add files here to ignore them from prettier formatting
|
||||||
|
|
||||||
|
/dist
|
||||||
|
/coverage
|
||||||
3
.prettierrc
Normal file
3
.prettierrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true
|
||||||
|
}
|
||||||
105
README.md
Normal file
105
README.md
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AppsJsMonorepoVision
|
||||||
|
|
||||||
|
This project was generated using [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="450"></p>
|
||||||
|
|
||||||
|
🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**
|
||||||
|
|
||||||
|
## Quick Start & Documentation
|
||||||
|
|
||||||
|
[Nx Documentation](https://nx.dev/angular)
|
||||||
|
|
||||||
|
[10-minute video showing all Nx features](https://nx.dev/angular/getting-started/what-is-nx)
|
||||||
|
|
||||||
|
[Interactive Tutorial](https://nx.dev/angular/tutorial/01-create-application)
|
||||||
|
|
||||||
|
## Adding capabilities to your workspace
|
||||||
|
|
||||||
|
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
|
||||||
|
|
||||||
|
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
|
||||||
|
|
||||||
|
Below are our core plugins:
|
||||||
|
|
||||||
|
- [Angular](https://angular.io)
|
||||||
|
- `ng add @nrwl/angular`
|
||||||
|
- [React](https://reactjs.org)
|
||||||
|
- `ng add @nrwl/react`
|
||||||
|
- Web (no framework frontends)
|
||||||
|
- `ng add @nrwl/web`
|
||||||
|
- [Nest](https://nestjs.com)
|
||||||
|
- `ng add @nrwl/nest`
|
||||||
|
- [Express](https://expressjs.com)
|
||||||
|
- `ng add @nrwl/express`
|
||||||
|
- [Node](https://nodejs.org)
|
||||||
|
- `ng add @nrwl/node`
|
||||||
|
|
||||||
|
There are also many [community plugins](https://nx.dev/nx-community) you could add.
|
||||||
|
|
||||||
|
## Generate an application
|
||||||
|
|
||||||
|
Run `ng g @nrwl/angular:app my-app` to generate an application.
|
||||||
|
|
||||||
|
> You can use any of the plugins above to generate applications as well.
|
||||||
|
|
||||||
|
When using Nx, you can create multiple applications and libraries in the same workspace.
|
||||||
|
|
||||||
|
## Generate a library
|
||||||
|
|
||||||
|
Run `ng g @nrwl/angular:lib my-lib` to generate a library.
|
||||||
|
|
||||||
|
> You can also use any of the plugins above to generate libraries as well.
|
||||||
|
|
||||||
|
Libraries are shareable across libraries and applications. They can be imported from `@dafa-web-monorepo/mylib`.
|
||||||
|
|
||||||
|
## Development server
|
||||||
|
|
||||||
|
Run `ng serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Run `ng g component my-component --project=my-app` to generate a new component.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Run `ng build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io).
|
||||||
|
|
||||||
|
Run `nx affected:test` to execute the unit tests affected by a change.
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
|
||||||
|
|
||||||
|
Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
|
||||||
|
|
||||||
|
## Understand your workspace
|
||||||
|
|
||||||
|
Run `nx dep-graph` to see a diagram of the dependencies of your projects.
|
||||||
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
Visit the [Nx Documentation](https://nx.dev/angular) to learn more.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## ☁ Nx Cloud
|
||||||
|
|
||||||
|
### Computation Memoization in the Cloud
|
||||||
|
|
||||||
|
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-cloud-card.png"></p>
|
||||||
|
|
||||||
|
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly.
|
||||||
|
|
||||||
|
Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers.
|
||||||
|
|
||||||
|
Visit [Nx Cloud](https://nx.app/) to learn more.
|
||||||
150
angular.json
Normal file
150
angular.json
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"cli": {
|
||||||
|
"defaultCollection": "@nrwl/angular"
|
||||||
|
},
|
||||||
|
"defaultProject": "dafa-web",
|
||||||
|
"schematics": {
|
||||||
|
"@nrwl/angular": {
|
||||||
|
"application": {
|
||||||
|
"linter": "eslint"
|
||||||
|
},
|
||||||
|
"library": {
|
||||||
|
"linter": "eslint"
|
||||||
|
},
|
||||||
|
"storybook-configuration": {
|
||||||
|
"linter": "eslint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@nrwl/angular:application": {
|
||||||
|
"style": "scss",
|
||||||
|
"linter": "eslint",
|
||||||
|
"unitTestRunner": "jest",
|
||||||
|
"e2eTestRunner": "cypress"
|
||||||
|
},
|
||||||
|
"@nrwl/angular:library": {
|
||||||
|
"style": "scss",
|
||||||
|
"linter": "eslint",
|
||||||
|
"unitTestRunner": "jest"
|
||||||
|
},
|
||||||
|
"@nrwl/angular:component": {
|
||||||
|
"style": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"dafa-web": {
|
||||||
|
"projectType": "application",
|
||||||
|
"root": "apps/dafa-web",
|
||||||
|
"sourceRoot": "apps/dafa-web/src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/apps/dafa-web",
|
||||||
|
"index": "apps/dafa-web/src/index.html",
|
||||||
|
"main": "apps/dafa-web/src/main.ts",
|
||||||
|
"polyfills": "apps/dafa-web/src/polyfills.ts",
|
||||||
|
"tsConfig": "apps/dafa-web/tsconfig.app.json",
|
||||||
|
"aot": true,
|
||||||
|
"assets": [
|
||||||
|
"apps/dafa-web/src/favicon.ico",
|
||||||
|
"apps/dafa-web/src/assets"
|
||||||
|
],
|
||||||
|
"styles": ["apps/dafa-web/src/styles.scss"],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "apps/dafa-web/src/environments/environment.ts",
|
||||||
|
"with": "apps/dafa-web/src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "2mb",
|
||||||
|
"maximumError": "5mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "6kb",
|
||||||
|
"maximumError": "10kb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "dafa-web:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "dafa-web:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "dafa-web:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@nrwl/linter:eslint",
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": [
|
||||||
|
"apps/dafa-web/src/**/*.ts",
|
||||||
|
"apps/dafa-web/src/**/*.html"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@nrwl/jest:jest",
|
||||||
|
"outputs": ["coverage/apps/dafa-web"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "apps/dafa-web/jest.config.js",
|
||||||
|
"passWithNoTests": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dafa-web-e2e": {
|
||||||
|
"root": "apps/dafa-web-e2e",
|
||||||
|
"sourceRoot": "apps/dafa-web-e2e/src",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@nrwl/cypress:cypress",
|
||||||
|
"options": {
|
||||||
|
"cypressConfig": "apps/dafa-web-e2e/cypress.json",
|
||||||
|
"tsConfig": "apps/dafa-web-e2e/tsconfig.e2e.json",
|
||||||
|
"devServerTarget": "dafa-web:serve"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"devServerTarget": "dafa-web:serve:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@nrwl/linter:eslint",
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["apps/dafa-web-e2e/**/*.{js,ts}"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
apps/dafa-web-e2e/.eslintrc.json
Normal file
20
apps/dafa-web-e2e/.eslintrc.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "apps/dafa-web-e2e/tsconfig.*?.json"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["src/plugins/index.js"],
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
"no-undef": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
12
apps/dafa-web-e2e/cypress.json
Normal file
12
apps/dafa-web-e2e/cypress.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"fileServerFolder": ".",
|
||||||
|
"fixturesFolder": "./src/fixtures",
|
||||||
|
"integrationFolder": "./src/integration",
|
||||||
|
"modifyObstructiveCode": false,
|
||||||
|
"pluginsFile": "./src/plugins/index",
|
||||||
|
"supportFile": "./src/support/index.ts",
|
||||||
|
"video": true,
|
||||||
|
"videosFolder": "../../dist/cypress/apps/dafa-web-e2e/videos",
|
||||||
|
"screenshotsFolder": "../../dist/cypress/apps/dafa-web-e2e/screenshots",
|
||||||
|
"chromeWebSecurity": false
|
||||||
|
}
|
||||||
4
apps/dafa-web-e2e/src/fixtures/example.json
Normal file
4
apps/dafa-web-e2e/src/fixtures/example.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "Using fixtures to represent data",
|
||||||
|
"email": "hello@cypress.io"
|
||||||
|
}
|
||||||
13
apps/dafa-web-e2e/src/integration/app.spec.ts
Normal file
13
apps/dafa-web-e2e/src/integration/app.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { getGreeting } from '../support/app.po';
|
||||||
|
|
||||||
|
describe('dafa-web', () => {
|
||||||
|
beforeEach(() => cy.visit('/'));
|
||||||
|
|
||||||
|
it('should display welcome message', () => {
|
||||||
|
// Custom command example, see `../support/commands.ts` file
|
||||||
|
cy.login('my-email@something.com', 'myPassword');
|
||||||
|
|
||||||
|
// Function helper example, see `../support/app.po.ts` file
|
||||||
|
getGreeting().contains('Welcome to dafa-web!');
|
||||||
|
});
|
||||||
|
});
|
||||||
22
apps/dafa-web-e2e/src/plugins/index.js
Normal file
22
apps/dafa-web-e2e/src/plugins/index.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// ***********************************************************
|
||||||
|
// This example plugins/index.js can be used to load plugins
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off loading
|
||||||
|
// the plugins file with the 'pluginsFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/plugins-guide
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// This function is called when a project is opened or re-opened (e.g. due to
|
||||||
|
// the project's config changing)
|
||||||
|
|
||||||
|
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
|
||||||
|
|
||||||
|
module.exports = (on, config) => {
|
||||||
|
// `on` is used to hook into various events Cypress emits
|
||||||
|
// `config` is the resolved Cypress config
|
||||||
|
|
||||||
|
// Preprocess Typescript file using Nx helper
|
||||||
|
on('file:preprocessor', preprocessTypescript(config));
|
||||||
|
};
|
||||||
1
apps/dafa-web-e2e/src/support/app.po.ts
Normal file
1
apps/dafa-web-e2e/src/support/app.po.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const getGreeting = () => cy.get('h1');
|
||||||
33
apps/dafa-web-e2e/src/support/commands.ts
Normal file
33
apps/dafa-web-e2e/src/support/commands.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// ***********************************************
|
||||||
|
// This example commands.js shows you how to
|
||||||
|
// create various custom commands and overwrite
|
||||||
|
// existing commands.
|
||||||
|
//
|
||||||
|
// For more comprehensive examples of custom
|
||||||
|
// commands please read more here:
|
||||||
|
// https://on.cypress.io/custom-commands
|
||||||
|
// ***********************************************
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
|
declare namespace Cypress {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
interface Chainable<Subject> {
|
||||||
|
login(email: string, password: string): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// -- This is a parent command --
|
||||||
|
Cypress.Commands.add('login', (email, password) => {
|
||||||
|
console.log('Custom command example: Login', email, password);
|
||||||
|
});
|
||||||
|
//
|
||||||
|
// -- This is a child command --
|
||||||
|
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This is a dual command --
|
||||||
|
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This will overwrite an existing command --
|
||||||
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
17
apps/dafa-web-e2e/src/support/index.ts
Normal file
17
apps/dafa-web-e2e/src/support/index.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// ***********************************************************
|
||||||
|
// This example support/index.js is processed and
|
||||||
|
// loaded automatically before your test files.
|
||||||
|
//
|
||||||
|
// This is a great place to put global configuration and
|
||||||
|
// behavior that modifies Cypress.
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off
|
||||||
|
// automatically serving support files with the
|
||||||
|
// 'supportFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/configuration
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// Import commands.js using ES2015 syntax:
|
||||||
|
import './commands';
|
||||||
10
apps/dafa-web-e2e/tsconfig.e2e.json
Normal file
10
apps/dafa-web-e2e/tsconfig.e2e.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"sourceMap": false,
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"allowJs": true,
|
||||||
|
"types": ["cypress", "node"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||||
|
}
|
||||||
10
apps/dafa-web-e2e/tsconfig.json
Normal file
10
apps/dafa-web-e2e/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.e2e.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
17
apps/dafa-web/.browserslistrc
Normal file
17
apps/dafa-web/.browserslistrc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||||
|
# For additional information regarding the format and rule options, please see:
|
||||||
|
# https://github.com/browserslist/browserslist#queries
|
||||||
|
|
||||||
|
# For the full list of supported browsers by the Angular framework, please see:
|
||||||
|
# https://angular.io/guide/browser-support
|
||||||
|
|
||||||
|
# You can see what browsers were selected by your queries by running:
|
||||||
|
# npx browserslist
|
||||||
|
|
||||||
|
last 1 Chrome version
|
||||||
|
last 1 Firefox version
|
||||||
|
last 2 Edge major versions
|
||||||
|
last 2 Safari major versions
|
||||||
|
last 2 iOS major versions
|
||||||
|
Firefox ESR
|
||||||
|
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
||||||
37
apps/dafa-web/.eslintrc.json
Normal file
37
apps/dafa-web/.eslintrc.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"extends": ["../../.eslintrc.json"],
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts"],
|
||||||
|
"extends": [
|
||||||
|
"plugin:@nrwl/nx/angular",
|
||||||
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
|
],
|
||||||
|
"parserOptions": { "project": ["apps/dafa-web/tsconfig.*?.json"] },
|
||||||
|
"rules": {
|
||||||
|
"@angular-eslint/directive-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"prefix": "app",
|
||||||
|
"style": "camelCase"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@angular-eslint/component-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"type": "element",
|
||||||
|
"prefix": "app",
|
||||||
|
"style": "kebab-case"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.html"],
|
||||||
|
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
23
apps/dafa-web/jest.config.js
Normal file
23
apps/dafa-web/jest.config.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
displayName: 'dafa-web',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
|
globals: {
|
||||||
|
'ts-jest': {
|
||||||
|
tsConfig: '<rootDir>/tsconfig.spec.json',
|
||||||
|
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||||
|
astTransformers: {
|
||||||
|
before: [
|
||||||
|
'jest-preset-angular/build/InlineFilesTransformer',
|
||||||
|
'jest-preset-angular/build/StripStylesTransformer',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
coverageDirectory: '../../coverage/apps/dafa-web',
|
||||||
|
snapshotSerializers: [
|
||||||
|
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
|
||||||
|
'jest-preset-angular/build/AngularSnapshotSerializer.js',
|
||||||
|
'jest-preset-angular/build/HTMLCommentSerializer.js',
|
||||||
|
],
|
||||||
|
};
|
||||||
111
apps/dafa-web/src/app/app.component.html
Normal file
111
apps/dafa-web/src/app/app.component.html
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<header class="flex">
|
||||||
|
<img
|
||||||
|
alt="Nx logo"
|
||||||
|
width="75"
|
||||||
|
src="https://nx.dev/assets/images/nx-logo-white.svg"
|
||||||
|
/>
|
||||||
|
<h1>Welcome to {{ title }}!</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<h2>Resources & Tools</h2>
|
||||||
|
<p>Thank you for using and showing some ♥ for Nx.</p>
|
||||||
|
<div class="flex github-star-container">
|
||||||
|
<a
|
||||||
|
href="https://github.com/nrwl/nx"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
If you like Nx, please give it a star:
|
||||||
|
<div class="github-star-badge">
|
||||||
|
<svg
|
||||||
|
class="material-icons"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path d="M0 0h24v24H0z" fill="none" />
|
||||||
|
<path
|
||||||
|
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
Star
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<p>Here are some links to help you get started.</p>
|
||||||
|
<ul class="resources">
|
||||||
|
<li class="col-span-2">
|
||||||
|
<a class="resource flex" href="https://nxplaybook.com/p/nx-workspaces">
|
||||||
|
Nx video course
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="col-span-2">
|
||||||
|
<a
|
||||||
|
class="resource flex"
|
||||||
|
href="https://nx.dev/latest/angular/getting-started/getting-started"
|
||||||
|
>
|
||||||
|
Nx video tutorial
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="col-span-2">
|
||||||
|
<a
|
||||||
|
class="resource flex"
|
||||||
|
href="https://nx.dev/latest/angular/tutorial/01-create-application"
|
||||||
|
>
|
||||||
|
Interactive tutorial
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="col-span-2">
|
||||||
|
<a class="resource flex" href="https://nx.app/">
|
||||||
|
<svg
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
viewBox="0 0 120 120"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M120 15V30C103.44 30 90 43.44 90 60C90 76.56 76.56 90 60 90C43.44 90 30 103.44 30 120H15C6.72 120 0 113.28 0 105V15C0 6.72 6.72 0 15 0H105C113.28 0 120 6.72 120 15Z"
|
||||||
|
fill="#0E2039"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M120 30V105C120 113.28 113.28 120 105 120H30C30 103.44 43.44 90 60 90C76.56 90 90 76.56 90 60C90 43.44 103.44 30 120 30Z"
|
||||||
|
fill="white"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span class="gutter-left">Nx Cloud</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2>Next Steps</h2>
|
||||||
|
<p>Here are some things you can do with Nx.</p>
|
||||||
|
<details open>
|
||||||
|
<summary>Add UI library</summary>
|
||||||
|
<pre>
|
||||||
|
# Generate UI lib
|
||||||
|
ng g @nrwl/angular:lib ui
|
||||||
|
|
||||||
|
# Add a component
|
||||||
|
ng g @nrwl/angular:component xyz --project ui</pre
|
||||||
|
>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>View dependency graph</summary>
|
||||||
|
<pre>nx dep-graph</pre>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>Run affected commands</summary>
|
||||||
|
<pre>
|
||||||
|
# see what's been affected by changes
|
||||||
|
ng affected:dep-graph
|
||||||
|
|
||||||
|
# run tests for current changes
|
||||||
|
ng affected:test
|
||||||
|
|
||||||
|
# run e2e tests for current changes
|
||||||
|
ng affected:e2e
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
</details>
|
||||||
|
</main>
|
||||||
133
apps/dafa-web/src/app/app.component.scss
Normal file
133
apps/dafa-web/src/app/app.component.scss
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/*
|
||||||
|
* Remove template code below
|
||||||
|
*/
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
font-family: sans-serif;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 50px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gutter-left {
|
||||||
|
margin-left: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-span-2 {
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
background-color: #143055;
|
||||||
|
color: white;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
padding: 0 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 18px;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 40px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resources {
|
||||||
|
text-align: center;
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 9px;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resource {
|
||||||
|
color: #0094ba;
|
||||||
|
height: 36px;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 3px 9px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resource:hover {
|
||||||
|
background-color: rgba(68, 138, 255, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
padding: 9px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: black;
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
details {
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #333;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
padding: 3px 9px;
|
||||||
|
margin-bottom: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-star-container {
|
||||||
|
margin-top: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-star-container a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-star-badge {
|
||||||
|
color: #24292e;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 3px 10px;
|
||||||
|
border: 1px solid rgba(27, 31, 35, 0.2);
|
||||||
|
border-radius: 3px;
|
||||||
|
background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%);
|
||||||
|
margin-left: 4px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-star-badge:hover {
|
||||||
|
background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%);
|
||||||
|
border-color: rgba(27, 31, 35, 0.35);
|
||||||
|
background-position: -0.5em;
|
||||||
|
}
|
||||||
|
.github-star-badge .material-icons {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
31
apps/dafa-web/src/app/app.component.spec.ts
Normal file
31
apps/dafa-web/src/app/app.component.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [AppComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should have as title 'dafa-web'`, () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app.title).toEqual('dafa-web');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement;
|
||||||
|
expect(compiled.querySelector('h1').textContent).toContain(
|
||||||
|
'Welcome to dafa-web!'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
10
apps/dafa-web/src/app/app.component.ts
Normal file
10
apps/dafa-web/src/app/app.component.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: ['./app.component.scss'],
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
title = 'dafa-web';
|
||||||
|
}
|
||||||
12
apps/dafa-web/src/app/app.module.ts
Normal file
12
apps/dafa-web/src/app/app.module.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [AppComponent],
|
||||||
|
imports: [BrowserModule],
|
||||||
|
providers: [],
|
||||||
|
bootstrap: [AppComponent],
|
||||||
|
})
|
||||||
|
export class AppModule {}
|
||||||
0
apps/dafa-web/src/assets/.gitkeep
Normal file
0
apps/dafa-web/src/assets/.gitkeep
Normal file
3
apps/dafa-web/src/environments/environment.prod.ts
Normal file
3
apps/dafa-web/src/environments/environment.prod.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const environment = {
|
||||||
|
production: true,
|
||||||
|
};
|
||||||
16
apps/dafa-web/src/environments/environment.ts
Normal file
16
apps/dafa-web/src/environments/environment.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
// This file can be replaced during build by using the `fileReplacements` array.
|
||||||
|
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
||||||
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
|
export const environment = {
|
||||||
|
production: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For easier debugging in development mode, you can import the following file
|
||||||
|
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||||
|
*
|
||||||
|
* This import should be commented out in production mode because it will have a negative impact
|
||||||
|
* on performance if an error is thrown.
|
||||||
|
*/
|
||||||
|
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
||||||
BIN
apps/dafa-web/src/favicon.ico
Normal file
BIN
apps/dafa-web/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
apps/dafa-web/src/index.html
Normal file
13
apps/dafa-web/src/index.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>DafaWeb</title>
|
||||||
|
<base href="/" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
apps/dafa-web/src/main.ts
Normal file
13
apps/dafa-web/src/main.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic()
|
||||||
|
.bootstrapModule(AppModule)
|
||||||
|
.catch((err) => console.error(err));
|
||||||
64
apps/dafa-web/src/polyfills.ts
Normal file
64
apps/dafa-web/src/polyfills.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/**
|
||||||
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||||
|
* You can add your own extra polyfills to this file.
|
||||||
|
*
|
||||||
|
* This file is divided into 2 sections:
|
||||||
|
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||||
|
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||||
|
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||||
|
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||||
|
*
|
||||||
|
* Learn more in https://angular.io/guide/browser-support
|
||||||
|
*/
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* BROWSER POLYFILLS
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IE11 requires the following for NgClass support on SVG elements
|
||||||
|
*/
|
||||||
|
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web Animations `@angular/platform-browser/animations`
|
||||||
|
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||||
|
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||||
|
*/
|
||||||
|
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||||
|
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||||
|
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||||
|
* will put import in the top of bundle, so user need to create a separate file
|
||||||
|
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||||
|
* into that file, and then add the following code before importing zone.js.
|
||||||
|
* import './zone-flags';
|
||||||
|
*
|
||||||
|
* The flags allowed in zone-flags.ts are listed here.
|
||||||
|
*
|
||||||
|
* The following flags will work for all browsers.
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||||
|
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||||
|
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||||
|
*
|
||||||
|
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||||
|
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_enable_cross_context_check = true;
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* Zone JS is required by default for Angular itself.
|
||||||
|
*/
|
||||||
|
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* APPLICATION IMPORTS
|
||||||
|
*/
|
||||||
1
apps/dafa-web/src/styles.scss
Normal file
1
apps/dafa-web/src/styles.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
1
apps/dafa-web/src/test-setup.ts
Normal file
1
apps/dafa-web/src/test-setup.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import 'jest-preset-angular';
|
||||||
8
apps/dafa-web/tsconfig.app.json
Normal file
8
apps/dafa-web/tsconfig.app.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"files": ["src/main.ts", "src/polyfills.ts"]
|
||||||
|
}
|
||||||
7
apps/dafa-web/tsconfig.editor.json
Normal file
7
apps/dafa-web/tsconfig.editor.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"include": ["**/*.ts"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
}
|
||||||
|
}
|
||||||
16
apps/dafa-web/tsconfig.json
Normal file
16
apps/dafa-web/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.editor.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
10
apps/dafa-web/tsconfig.spec.json
Normal file
10
apps/dafa-web/tsconfig.spec.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"files": ["src/test-setup.ts"],
|
||||||
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||||
|
}
|
||||||
69
decorate-angular-cli.js
Normal file
69
decorate-angular-cli.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching
|
||||||
|
* and faster execution of tasks.
|
||||||
|
*
|
||||||
|
* It does this by:
|
||||||
|
*
|
||||||
|
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command.
|
||||||
|
* - Symlinking the ng to nx command, so all commands run through the Nx CLI
|
||||||
|
* - Updating the package.json postinstall script to give you control over this script
|
||||||
|
*
|
||||||
|
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it.
|
||||||
|
* Every command you run should work the same when using the Nx CLI, except faster.
|
||||||
|
*
|
||||||
|
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case,
|
||||||
|
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked.
|
||||||
|
* The Nx CLI simply does some optimizations before invoking the Angular CLI.
|
||||||
|
*
|
||||||
|
* To opt out of this patch:
|
||||||
|
* - Replace occurrences of nx with ng in your package.json
|
||||||
|
* - Remove the script from your postinstall script in your package.json
|
||||||
|
* - Delete and reinstall your node_modules
|
||||||
|
*/
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const os = require('os');
|
||||||
|
const cp = require('child_process');
|
||||||
|
const isWindows = os.platform() === 'win32';
|
||||||
|
let output;
|
||||||
|
try {
|
||||||
|
output = require('@nrwl/workspace').output;
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.');
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
|
||||||
|
* invoke the Nx CLI and get the benefits of computation caching.
|
||||||
|
*/
|
||||||
|
function symlinkNgCLItoNxCLI() {
|
||||||
|
try {
|
||||||
|
const ngPath = './node_modules/.bin/ng';
|
||||||
|
const nxPath = './node_modules/.bin/nx';
|
||||||
|
if (isWindows) {
|
||||||
|
/**
|
||||||
|
* This is the most reliable way to create symlink-like behavior on Windows.
|
||||||
|
* Such that it works in all shells and works with npx.
|
||||||
|
*/
|
||||||
|
['', '.cmd', '.ps1'].forEach(ext => {
|
||||||
|
if (fs.existsSync(nxPath + ext)) fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// If unix-based, symlink
|
||||||
|
cp.execSync(`ln -sf ./nx ${ngPath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
output.error({ title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message });
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
symlinkNgCLItoNxCLI();
|
||||||
|
require('@nrwl/cli/lib/decorate-cli').decorateCli();
|
||||||
|
output.log({ title: 'Angular CLI has been decorated to enable computation caching.' });
|
||||||
|
} catch(e) {
|
||||||
|
output.error({ title: 'Decoration of the Angular CLI did not complete successfully' });
|
||||||
|
}
|
||||||
3
jest.config.js
Normal file
3
jest.config.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
projects: ['<rootDir>/apps/dafa-web'],
|
||||||
|
};
|
||||||
3
jest.preset.js
Normal file
3
jest.preset.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
const nxPreset = require('@nrwl/jest/preset');
|
||||||
|
|
||||||
|
module.exports = { ...nxPreset };
|
||||||
0
libs/.gitkeep
Normal file
0
libs/.gitkeep
Normal file
34
nx.json
Normal file
34
nx.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"implicitDependencies": {
|
||||||
|
"angular.json": "*",
|
||||||
|
"package.json": {
|
||||||
|
"dependencies": "*",
|
||||||
|
"devDependencies": "*"
|
||||||
|
},
|
||||||
|
"tsconfig.base.json": "*",
|
||||||
|
"tslint.json": "*",
|
||||||
|
".eslintrc.json": "*",
|
||||||
|
"nx.json": "*"
|
||||||
|
},
|
||||||
|
"affected": {
|
||||||
|
"defaultBase": "master"
|
||||||
|
},
|
||||||
|
"npmScope": "dafa-web-monorepo",
|
||||||
|
"tasksRunnerOptions": {
|
||||||
|
"default": {
|
||||||
|
"runner": "@nrwl/workspace/tasks-runners/default",
|
||||||
|
"options": {
|
||||||
|
"cacheableOperations": ["build", "lint", "test", "e2e"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"dafa-web": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"dafa-web-e2e": {
|
||||||
|
"tags": [],
|
||||||
|
"implicitDependencies": ["dafa-web"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45497
package-lock.json
generated
Normal file
45497
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
76
package.json
Normal file
76
package.json
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"name": "dafa-web-monorepo",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "nx",
|
||||||
|
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
|
||||||
|
"nx": "nx",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"test": "ng test",
|
||||||
|
"lint": "nx workspace-lint && ng lint",
|
||||||
|
"e2e": "ng e2e",
|
||||||
|
"affected:apps": "nx affected:apps",
|
||||||
|
"affected:libs": "nx affected:libs",
|
||||||
|
"affected:build": "nx affected:build",
|
||||||
|
"affected:e2e": "nx affected:e2e",
|
||||||
|
"affected:test": "nx affected:test",
|
||||||
|
"affected:lint": "nx affected:lint",
|
||||||
|
"affected:dep-graph": "nx affected:dep-graph",
|
||||||
|
"affected": "nx affected",
|
||||||
|
"format": "nx format:write",
|
||||||
|
"format:write": "nx format:write",
|
||||||
|
"format:check": "nx format:check",
|
||||||
|
"update": "nx migrate latest",
|
||||||
|
"workspace-generator": "nx workspace-generator",
|
||||||
|
"dep-graph": "nx dep-graph",
|
||||||
|
"help": "nx help"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^11.2.0",
|
||||||
|
"@angular/common": "^11.2.0",
|
||||||
|
"@angular/compiler": "^11.2.0",
|
||||||
|
"@angular/core": "^11.2.0",
|
||||||
|
"@angular/forms": "^11.2.0",
|
||||||
|
"@angular/platform-browser": "^11.2.0",
|
||||||
|
"@angular/platform-browser-dynamic": "^11.2.0",
|
||||||
|
"@angular/router": "^11.2.0",
|
||||||
|
"@nrwl/angular": "11.5.1",
|
||||||
|
"rxjs": "~6.6.3",
|
||||||
|
"tslib": "^2.0.0",
|
||||||
|
"zone.js": "^0.10.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "~0.1102.0",
|
||||||
|
"@angular-eslint/eslint-plugin": "~1.0.0",
|
||||||
|
"@angular-eslint/eslint-plugin-template": "~1.0.0",
|
||||||
|
"@angular-eslint/template-parser": "~1.0.0",
|
||||||
|
"@angular/cli": "~11.0.0",
|
||||||
|
"@angular/compiler-cli": "^11.2.0",
|
||||||
|
"@angular/language-service": "^11.2.0",
|
||||||
|
"@nrwl/cli": "11.5.1",
|
||||||
|
"@nrwl/cypress": "11.5.1",
|
||||||
|
"@nrwl/eslint-plugin-nx": "11.5.1",
|
||||||
|
"@nrwl/jest": "11.5.1",
|
||||||
|
"@nrwl/linter": "11.5.1",
|
||||||
|
"@nrwl/tao": "11.5.1",
|
||||||
|
"@nrwl/workspace": "11.5.1",
|
||||||
|
"@types/jest": "26.0.8",
|
||||||
|
"@types/node": "12.12.38",
|
||||||
|
"@typescript-eslint/eslint-plugin": "4.3.0",
|
||||||
|
"@typescript-eslint/parser": "4.3.0",
|
||||||
|
"cypress": "^6.0.1",
|
||||||
|
"dotenv": "6.2.0",
|
||||||
|
"eslint": "7.10.0",
|
||||||
|
"eslint-config-prettier": "8.1.0",
|
||||||
|
"eslint-plugin-cypress": "^2.10.3",
|
||||||
|
"jest": "26.2.2",
|
||||||
|
"jest-preset-angular": "8.3.2",
|
||||||
|
"prettier": "2.2.1",
|
||||||
|
"ts-jest": "26.4.0",
|
||||||
|
"ts-node": "~9.1.1",
|
||||||
|
"typescript": "~4.0.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
tools/generators/.gitkeep
Normal file
0
tools/generators/.gitkeep
Normal file
12
tools/tsconfig.tools.json
Normal file
12
tools/tsconfig.tools.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../dist/out-tsc/tools",
|
||||||
|
"rootDir": ".",
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es5",
|
||||||
|
"types": ["node"],
|
||||||
|
"importHelpers": false
|
||||||
|
},
|
||||||
|
"include": ["**/*.ts"]
|
||||||
|
}
|
||||||
20
tsconfig.base.json
Normal file
20
tsconfig.base.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": ".",
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": false,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "es2015",
|
||||||
|
"module": "esnext",
|
||||||
|
"lib": ["es2017", "dom"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"skipDefaultLibCheck": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {}
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules", "tmp"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user