Skip to content

Commit

Permalink
feat!: migrate to Nx 15.1, Angular 14.0, and Angular CLI 14.2 (#55)
Browse files Browse the repository at this point in the history
Merge pull request #55 from ngworker/feat/migrate-to-nx-15_1
  • Loading branch information
LayZeeDK committed Jul 16, 2023
2 parents 7f1d147 + 669752f commit f800d81
Show file tree
Hide file tree
Showing 50 changed files with 7,231 additions and 2,812 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
"allowCircularSelfDependency": false,
"banTransitiveDependencies": true,
"checkNestedExternalImports": true,
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
Expand Down Expand Up @@ -55,6 +56,13 @@
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
42 changes: 26 additions & 16 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
"affected": {
"defaultBase": "main"
},
"implicitDependencies": {
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*"
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
Expand All @@ -27,16 +20,7 @@
"appsDir": "e2e",
"libsDir": "packages"
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
},
"cli": {
"defaultCollection": "@nrwl/angular",
"packageManager": "yarn"
},
"generators": {
Expand All @@ -61,5 +45,31 @@
"@nrwl/angular:storybook-configuration": {
"linter": "eslint"
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"e2e": {
"inputs": ["default", "^production"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json"
]
}
}
85 changes: 43 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main",
"nx": "nx",
"start": "nx serve",
"build": "nx run-many --target=build --configuration=production --all",
Expand Down Expand Up @@ -31,73 +31,74 @@
},
"private": true,
"dependencies": {
"@angular/animations": "13.0.3",
"@angular/common": "13.0.3",
"@angular/compiler": "13.0.3",
"@angular/core": "13.0.3",
"@angular/forms": "13.0.3",
"@angular/platform-browser": "13.0.3",
"@angular/platform-browser-dynamic": "13.0.3",
"@angular/router": "13.0.3",
"@nrwl/angular": "14.1.9",
"@angular/animations": "14.0.7",
"@angular/common": "14.0.7",
"@angular/compiler": "14.0.7",
"@angular/core": "14.0.7",
"@angular/forms": "14.0.7",
"@angular/platform-browser": "14.0.7",
"@angular/platform-browser-dynamic": "14.0.7",
"@angular/router": "14.0.7",
"@nrwl/angular": "15.1.1",
"rxjs": "6.6.7",
"tslib": "2.4.1",
"zone.js": "0.11.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "13.3.11",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "13.3.11",
"@angular/compiler-cli": "13.0.3",
"@angular/language-service": "13.0.3",
"@angular-devkit/build-angular": "14.2.12",
"@angular-eslint/eslint-plugin": "14.0.4",
"@angular-eslint/eslint-plugin-template": "14.0.4",
"@angular-eslint/template-parser": "14.0.4",
"@angular/cli": "14.2.12",
"@angular/compiler-cli": "14.0.7",
"@angular/language-service": "14.0.7",
"@docusaurus/core": "2.4.1",
"@docusaurus/module-type-aliases": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@docusaurus/theme-common": "2.4.1",
"@mdx-js/react": "1.6.22",
"@nrwl/cli": "14.1.9",
"@nrwl/eslint-plugin-nx": "14.1.9",
"@nrwl/jest": "14.1.9",
"@nrwl/linter": "14.1.9",
"@nrwl/node": "14.1.9",
"@nrwl/nx-cloud": "14.0.8",
"@nrwl/workspace": "14.1.9",
"@nx-plus/docusaurus": "14.0.0",
"@testing-library/angular": "11.0.4",
"@nrwl/cli": "15.1.1",
"@nrwl/eslint-plugin-nx": "15.1.1",
"@nrwl/jest": "15.1.1",
"@nrwl/linter": "15.1.1",
"@nrwl/node": "15.1.1",
"@nrwl/nx-cloud": "15.3.5",
"@nrwl/workspace": "15.1.1",
"@nx-plus/docusaurus": "15.0.0-rc.0",
"@testing-library/angular": "12.3.0",
"@testing-library/dom": "9.3.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/user-event": "14.4.3",
"@tsconfig/docusaurus": "1.0.7",
"@types/jest": "27.4.1",
"@types/node": "16.11.7",
"@types/jest": "28.1.8",
"@types/node": "18.7.1",
"@types/react": "17.0.47",
"@typescript-eslint/eslint-plugin": "5.18.0",
"@typescript-eslint/parser": "5.18.0",
"@typescript-eslint/eslint-plugin": "5.36.1",
"@typescript-eslint/parser": "5.36.1",
"all-contributors-cli": "^6.19.0",
"clsx": "1.2.1",
"docusaurus-plugin-typedoc": "0.17.5",
"docusaurus-plugin-typedoc": "0.19.2",
"dotenv": "10.0.0",
"eslint": "8.12.0",
"eslint": "8.15.0",
"eslint-config-prettier": "8.1.0",
"jest": "27.5.1",
"jest-preset-angular": "11.1.1",
"ng-packagr": "13.3.1",
"nx": "14.1.9",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.1",
"jest-preset-angular": "12.2.6",
"ng-packagr": "14.2.2",
"nx": "15.1.1",
"postcss": "^8.3.9",
"postcss-import": "14.1.0",
"postcss-preset-env": "7.5.0",
"postcss-url": "10.1.3",
"prettier": "2.5.1",
"prettier": "2.6.2",
"prism-react-renderer": "1.3.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"ts-jest": "27.1.4",
"ts-node": "9.1.1",
"typedoc": "0.22.18",
"typedoc-plugin-markdown": "3.12.1",
"typescript": "4.4.4"
"ts-jest": "28.0.8",
"ts-node": "10.9.1",
"typedoc": "0.24.8",
"typedoc-plugin-markdown": "3.15.3",
"typescript": "4.6.4"
},
"volta": {
"node": "16.20.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export default {
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
};
6 changes: 4 additions & 2 deletions packages/examples/tour-of-heroes/crisis-center/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "crisis-center",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/examples/tour-of-heroes/crisis-center/src",
"prefix": "app-crisis",
"targets": {
"build": {
"executor": "@nrwl/angular:ng-packagr-lite",
"outputs": ["dist/packages/examples/tour-of-heroes/crisis-center"],
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "packages/examples/tour-of-heroes/crisis-center/ng-package.json"
},
Expand All @@ -30,7 +32,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/packages/examples/tour-of-heroes/crisis-center"],
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/examples/tour-of-heroes/crisis-center/jest.config.ts",
"passWithNoTests": true
Expand Down
4 changes: 3 additions & 1 deletion packages/examples/tour-of-heroes/crisis-center/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"strict": true
"strict": true,
"target": "es2020"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../dist/out-tsc",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/test-util/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export default {
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
};
6 changes: 4 additions & 2 deletions packages/internal/test-util/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "test-util",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/internal/test-util/src",
"prefix": "ngworker",
"targets": {
"build": {
"executor": "@nrwl/angular:ng-packagr-lite",
"outputs": ["dist/packages/internal/test-util"],
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "packages/internal/test-util/ng-package.json"
},
Expand All @@ -30,7 +32,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/packages/internal/test-util"],
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/internal/test-util/jest.config.ts",
"passWithNoTests": true
Expand Down
4 changes: 3 additions & 1 deletion packages/internal/test-util/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"strict": true
"strict": true,
"target": "es2020"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
Expand Down

0 comments on commit f800d81

Please sign in to comment.