Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b340d99

Browse files
committed
chore: migrate to Nx v16
1 parent cac56ab commit b340d99

37 files changed

+1450
-686
lines changed

.eslintrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nrwl/nx"],
4+
"plugins": ["@nx"],
55
"overrides": [
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
88
"rules": {
9-
"@nrwl/nx/enforce-module-boundaries": [
9+
"@nx/enforce-module-boundaries": [
1010
"error",
1111
{
1212
"enforceBuildableLibDependency": true,
@@ -38,7 +38,7 @@
3838
"extends": [
3939
"prettier",
4040
"eslint:recommended",
41-
"plugin:@nrwl/nx/typescript",
41+
"plugin:@nx/typescript",
4242
"plugin:@angular-eslint/recommended",
4343
"plugin:@typescript-eslint/recommended"
4444
],
@@ -61,7 +61,7 @@
6161
"extends": [
6262
"prettier",
6363
"plugin:@angular-eslint/template/recommended",
64-
"plugin:@nrwl/nx/javascript"
64+
"plugin:@nx/javascript"
6565
],
6666
"rules": {
6767
"@typescript-eslint/no-non-null-assertion": "off"

apps/demos/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
}
113113
},
114114
"test": {
115-
"executor": "@nrwl/jest:jest",
115+
"executor": "@nx/jest:jest",
116116
"options": {
117117
"jestConfig": "apps/demos/jest.config.ts",
118118
"passWithNoTests": true

apps/docs/project.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"outputs": ["{options.outputPath}"],
1313
"dependsOn": [
1414
{
15-
"projects": "self",
1615
"target": "check-links"
1716
}
1817
]
@@ -30,7 +29,6 @@
3029
},
3130
"dependsOn": [
3231
{
33-
"projects": "self",
3432
"target": "build"
3533
}
3634
]

apps/ssr-e2e/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
1+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
22
import { defineConfig } from 'cypress';
33

44
export default defineConfig({

apps/ssr-e2e/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"projectType": "application",
66
"targets": {
77
"e2e": {
8-
"executor": "@nrwl/cypress:cypress",
8+
"executor": "@nx/cypress:cypress",
99
"options": {
1010
"cypressConfig": "apps/ssr-e2e/cypress.config.ts",
1111
"devServerTarget": "ssr:serve-ssr",

apps/ssr/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
}
7272
},
7373
"test": {
74-
"executor": "@nrwl/jest:jest",
74+
"executor": "@nx/jest:jest",
7575
"outputs": ["{workspaceRoot}/coverage/apps/ssr"],
7676
"options": {
7777
"jestConfig": "apps/ssr/jest.config.ts",

apps/ssr/src/main.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if (environment.production) {
77
}
88

99
export { AppServerModule } from './app/app.server.module';
10-
export { renderModule, renderModuleFactory } from '@angular/platform-server';
10+
export { renderModuleFactory } from '@angular/platform-server';

apps/tour-of-heroes-ngxs/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"projectType": "application",
55
"generators": {
6-
"@nrwl/angular:component": {
6+
"@nx/angular:component": {
77
"style": "scss"
88
}
99
},
@@ -92,7 +92,7 @@
9292
}
9393
},
9494
"test": {
95-
"executor": "@nrwl/jest:jest",
95+
"executor": "@nx/jest:jest",
9696
"options": {
9797
"jestConfig": "apps/tour-of-heroes-ngxs/jest.config.ts",
9898
"passWithNoTests": true

apps/vanilla-case-studies/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
}
7878
},
7979
"test": {
80-
"executor": "@nrwl/jest:jest",
80+
"executor": "@nx/jest:jest",
8181
"options": {
8282
"jestConfig": "apps/vanilla-case-studies/jest.config.ts",
8383
"passWithNoTests": true

decorate-angular-cli.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ const cp = require('child_process');
2727
const isWindows = os.platform() === 'win32';
2828
let output;
2929
try {
30-
output = require('@nrwl/workspace').output;
30+
output = require('@nx/workspace').output;
3131
} catch (e) {
32-
console.warn('Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.');
32+
console.warn(
33+
'Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed.'
34+
);
3335
process.exit(0);
3436
}
3537

@@ -46,24 +48,32 @@ function symlinkNgCLItoNxCLI() {
4648
* This is the most reliable way to create symlink-like behavior on Windows.
4749
* Such that it works in all shells and works with npx.
4850
*/
49-
['', '.cmd', '.ps1'].forEach(ext => {
50-
if (fs.existsSync(nxPath + ext)) fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
51+
['', '.cmd', '.ps1'].forEach((ext) => {
52+
if (fs.existsSync(nxPath + ext))
53+
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
5154
});
5255
} else {
5356
// If unix-based, symlink
5457
cp.execSync(`ln -sf ./nx ${ngPath}`);
5558
}
56-
}
57-
catch(e) {
58-
output.error({ title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message });
59+
} catch (e) {
60+
output.error({
61+
title:
62+
'Unable to create a symlink from the Angular CLI to the Nx CLI:' +
63+
e.message,
64+
});
5965
throw e;
6066
}
6167
}
6268

6369
try {
6470
symlinkNgCLItoNxCLI();
6571
require('@nrwl/cli/lib/decorate-cli').decorateCli();
66-
output.log({ title: 'Angular CLI has been decorated to enable computation caching.' });
67-
} catch(e) {
68-
output.error({ title: 'Decoration of the Angular CLI did not complete successfully' });
72+
output.log({
73+
title: 'Angular CLI has been decorated to enable computation caching.',
74+
});
75+
} catch (e) {
76+
output.error({
77+
title: 'Decoration of the Angular CLI did not complete successfully',
78+
});
6979
}

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getJestProjects } = require('@nrwl/jest');
1+
const { getJestProjects } = require('@nx/jest');
22

33
export default {
44
projects: [...getJestProjects()],

jest.preset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const nxPreset = require('@nrwl/jest/preset').default;
1+
const nxPreset = require('@nx/jest/preset').default;
22
module.exports = {
33
...nxPreset,
44
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
55
transform: {
66
'^.+\\.(ts|js|html)$': 'ts-jest',
77
},
8-
resolver: '@nrwl/jest/plugins/resolver',
8+
resolver: '@nx/jest/plugins/resolver',
99
moduleFileExtensions: ['ts', 'js', 'html'],
1010
coverageReporters: ['html', 'lcov'],
1111
};

libs/cdk/.eslintrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
{
66
"files": ["*.ts"],
77
"extends": [
8-
"plugin:@nrwl/nx/angular",
8+
"plugin:@nx/angular",
99
"plugin:@angular-eslint/template/process-inline-templates"
1010
],
1111
"rules": {
1212
/**
1313
* @Notice: overwrite root enforce-module-boundaries to allow deep imports of secondary entry-points.
1414
*/
15-
"@nrwl/nx/enforce-module-boundaries": [
15+
"@nx/enforce-module-boundaries": [
1616
"error",
1717
{
1818
"enforceBuildableLibDependency": false,
@@ -46,7 +46,7 @@
4646
},
4747
{
4848
"files": ["*.html"],
49-
"extends": ["plugin:@nrwl/nx/angular-template"],
49+
"extends": ["plugin:@nx/angular-template"],
5050
"rules": {
5151
"@angular-eslint/template/eqeqeq": "warn"
5252
}

libs/cdk/project.json

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"executor": "nx:run-commands",
1010
"dependsOn": [
1111
{
12-
"target": "build-lib",
13-
"projects": "self"
12+
"target": "build-lib"
1413
}
1514
],
1615
"options": {
@@ -36,7 +35,7 @@
3635
"outputs": ["{workspaceRoot}/dist/libs/cdk/schematics"]
3736
},
3837
"build-lib": {
39-
"executor": "@nrwl/angular:package",
38+
"executor": "@nx/angular:package",
4039
"options": {
4140
"tsConfig": "libs/cdk/tsconfig.lib.json",
4241
"project": "libs/cdk/ng-package.json",
@@ -45,7 +44,7 @@
4544
"outputs": ["{workspaceRoot}/dist/libs/cdk"]
4645
},
4746
"test": {
48-
"executor": "@nrwl/jest:jest",
47+
"executor": "@nx/jest:jest",
4948
"options": {
5049
"jestConfig": "libs/cdk/jest.config.ts",
5150
"passWithNoTests": true,
@@ -64,20 +63,16 @@
6463
},
6564
"dependsOn": [
6665
{
67-
"target": "lint",
68-
"projects": "self"
66+
"target": "lint"
6967
},
7068
{
71-
"target": "test",
72-
"projects": "self"
69+
"target": "test"
7370
},
7471
{
75-
"target": "version",
76-
"projects": "self"
72+
"target": "version"
7773
},
7874
{
79-
"target": "build",
80-
"projects": "self"
75+
"target": "build"
8176
}
8277
]
8378
},
@@ -100,14 +95,14 @@
10095
}
10196
},
10297
"lint": {
103-
"executor": "@nrwl/linter:eslint",
98+
"executor": "@nx/linter:eslint",
10499
"options": {
105100
"lintFilePatterns": ["libs/cdk/**/*.ts"]
106101
}
107102
}
108103
},
109104
"generators": {
110-
"@nrwl/angular:component": {
105+
"@nx/angular:component": {
111106
"style": "scss"
112107
}
113108
},

libs/eslint-plugin/.babelrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
{
2-
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
2+
"presets": [
3+
[
4+
"@nx/js/babel",
5+
{
6+
"useBuiltIns": "usage"
7+
}
8+
]
9+
]
310
}

libs/eslint-plugin/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
"projectType": "library",
66
"targets": {
77
"lint": {
8-
"executor": "@nrwl/linter:eslint",
8+
"executor": "@nx/linter:eslint",
99
"outputs": ["{options.outputFile}"],
1010
"options": {
1111
"lintFilePatterns": ["libs/eslint-plugin/**/*.ts"]
1212
}
1313
},
1414
"test": {
15-
"executor": "@nrwl/jest:jest",
15+
"executor": "@nx/jest:jest",
1616
"outputs": ["{workspaceRoot}/coverage/libs/eslint-plugin"],
1717
"options": {
1818
"jestConfig": "libs/eslint-plugin/jest.config.ts",
1919
"passWithNoTests": true
2020
}
2121
},
2222
"build": {
23-
"executor": "@nrwl/js:tsc",
23+
"executor": "@nx/js:tsc",
2424
"outputs": ["{options.outputPath}"],
2525
"options": {
2626
"outputPath": "dist/libs/eslint-plugin",

libs/state/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"files": ["*.ts"],
77
"extends": [
8-
"plugin:@nrwl/nx/angular",
8+
"plugin:@nx/angular",
99
"plugin:@angular-eslint/template/process-inline-templates"
1010
],
1111
"rules": {
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"files": ["*.html"],
32-
"extends": ["plugin:@nrwl/nx/angular-template"],
32+
"extends": ["plugin:@nx/angular-template"],
3333
"rules": {
3434
"@angular-eslint/template/eqeqeq": "warn"
3535
}

0 commit comments

Comments
 (0)