Skip to content

Commit 15b0f8c

Browse files
authored
feat: update to nx 16.2 (#70)
1 parent c960dc6 commit 15b0f8c

39 files changed

+895
-623
lines changed

.eslintrc.json

+4-4
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,
@@ -23,12 +23,12 @@
2323
},
2424
{
2525
"files": ["*.ts", "*.tsx"],
26-
"extends": ["plugin:@nrwl/nx/typescript"],
26+
"extends": ["plugin:@nx/typescript"],
2727
"rules": {}
2828
},
2929
{
3030
"files": ["*.js", "*.jsx"],
31-
"extends": ["plugin:@nrwl/nx/javascript"],
31+
"extends": ["plugin:@nx/javascript"],
3232
"rules": {}
3333
}
3434
]

e2e/nx-e2e/project.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"sourceRoot": "e2e/nx-e2e/src",
66
"targets": {
77
"e2e": {
8-
"executor": "@nrwl/nx-plugin:e2e",
8+
"executor": "@nx/jest:jest",
99
"options": {
10-
"target": "nx:build",
1110
"npmPackageName": "@nativescript/nx",
1211
"pluginOutputPath": "dist/packages/nx",
13-
"jestConfig": "e2e/nx-e2e/jest.config.js"
14-
}
12+
"jestConfig": "e2e/nx-e2e/jest.config.js",
13+
"runInBand": true
14+
},
15+
"dependsOn": ["nx:build"]
1516
}
1617
},
1718
"tags": [],

e2e/nx-e2e/tests/nx.test.ts

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
checkFilesExist,
3-
ensureNxProject,
4-
readJson,
5-
runNxCommandAsync,
6-
uniq,
7-
} from '@nrwl/nx-plugin/testing';
1+
import { checkFilesExist, ensureNxProject, readJson, runNxCommandAsync, uniq } from '@nx/plugin/testing';
82
describe('nx e2e', () => {
93
it('should create nx', async (done) => {
104
const plugin = uniq('nx');
@@ -21,12 +15,8 @@ describe('nx e2e', () => {
2115
it('should create src in the specified directory', async (done) => {
2216
const plugin = uniq('nx');
2317
ensureNxProject('@nativescript/nx', 'dist/packages/nx');
24-
await runNxCommandAsync(
25-
`generate @nativescript/nx:nx ${plugin} --directory subdir`
26-
);
27-
expect(() =>
28-
checkFilesExist(`libs/subdir/${plugin}/src/index.ts`)
29-
).not.toThrow();
18+
await runNxCommandAsync(`generate @nativescript/nx:nx ${plugin} --directory subdir`);
19+
expect(() => checkFilesExist(`libs/subdir/${plugin}/src/index.ts`)).not.toThrow();
3020
done();
3121
});
3222
});
@@ -35,9 +25,7 @@ describe('nx e2e', () => {
3525
it('should add tags to nx.json', async (done) => {
3626
const plugin = uniq('nx');
3727
ensureNxProject('@nativescript/nx', 'dist/packages/nx');
38-
await runNxCommandAsync(
39-
`generate @nativescript/nx:nx ${plugin} --tags e2etag,e2ePackage`
40-
);
28+
await runNxCommandAsync(`generate @nativescript/nx:nx ${plugin} --tags e2etag,e2ePackage`);
4129
const nxJson = readJson('nx.json');
4230
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
4331
done();

jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const { getJestProjects } = require('@nrwl/jest');
1+
const { getJestProjects } = require('@nx/jest');
22

33
export default { projects: [...getJestProjects(), '<rootDir>/e2e/nx-e2e'] };

jest.preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const nxPreset = require('@nrwl/jest/preset').default;
1+
const nxPreset = require('@nx/jest/preset').default;
22

33
module.exports = { ...nxPreset };

migrations.json

+249
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
{
2+
"migrations": [
3+
{
4+
"cli": "nx",
5+
"version": "16.0.0-beta.0",
6+
"description": "Remove @nrwl/cli.",
7+
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
8+
"package": "nx",
9+
"name": "16.0.0-remove-nrwl-cli"
10+
},
11+
{
12+
"cli": "nx",
13+
"version": "16.0.0-beta.9",
14+
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
15+
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
16+
"package": "nx",
17+
"name": "16.0.0-tokens-for-depends-on"
18+
},
19+
{
20+
"cli": "nx",
21+
"version": "16.0.0-beta.0",
22+
"description": "Replace @nrwl/nx-cloud with nx-cloud",
23+
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
24+
"package": "nx",
25+
"name": "16.0.0-update-nx-cloud-runner"
26+
},
27+
{
28+
"cli": "nx",
29+
"version": "16.2.0-beta.0",
30+
"description": "Remove outputPath from run commands",
31+
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
32+
"package": "nx",
33+
"name": "16.2.0-remove-output-path-from-run-commands"
34+
},
35+
{
36+
"cli": "nx",
37+
"version": "16.0.0-beta.1",
38+
"description": "Replace @nx/devkit with @nx/devkit",
39+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
40+
"package": "@nx/devkit",
41+
"name": "update-16-0-0-add-nx-packages"
42+
},
43+
{
44+
"cli": "nx",
45+
"version": "16.0.0-beta.1",
46+
"description": "Replace @nx/workspace with @nx/workspace",
47+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
48+
"package": "@nx/workspace",
49+
"name": "update-16-0-0-add-nx-packages"
50+
},
51+
{
52+
"version": "16.0.0-beta.4",
53+
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
54+
"cli": "nx",
55+
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
56+
"package": "@nx/workspace",
57+
"name": "16-0-0-move-workspace-generators-into-local-plugin"
58+
},
59+
{
60+
"version": "16.0.0-beta.9",
61+
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
62+
"cli": "nx",
63+
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
64+
"package": "@nx/workspace",
65+
"name": "16-0-0-fix-invalid-babelrc"
66+
},
67+
{
68+
"version": "16.0.0-beta.1",
69+
"cli": "nx",
70+
"description": "Removes CLI property within schema.json files and moves generators and schematics to the proper root node in migrations.json",
71+
"factory": "./src/migrations/update-16-0-0/cli-in-schema-json",
72+
"package": "@nx/plugin",
73+
"name": "update-remove-cli-prop"
74+
},
75+
{
76+
"cli": "nx",
77+
"version": "16.0.0-beta.1",
78+
"description": "Replace @nx/plugin with @nx/plugin",
79+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
80+
"package": "@nx/plugin",
81+
"name": "update-16-0-0-add-nx-packages"
82+
},
83+
{
84+
"cli": "nx",
85+
"version": "16.2.0-beta.0",
86+
"description": "Replace @nx/plugin:e2e with @nx/jest",
87+
"implementation": "./src/migrations/update-16-2-0/replace-e2e-executor",
88+
"package": "@nx/plugin",
89+
"name": "update-16-2-0-replace-e2e-executor"
90+
},
91+
{
92+
"cli": "nx",
93+
"version": "16.0.0-beta.1",
94+
"description": "Replace @nx/web with @nx/web",
95+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
96+
"package": "@nx/web",
97+
"name": "update-16-0-0-add-nx-packages"
98+
},
99+
{
100+
"cli": "nx",
101+
"version": "16.0.0-beta.4",
102+
"description": "Replace @nx/web executors with @nx/webpack and @nx/rollup",
103+
"implementation": "./src/migrations/update-16-0-0-update-executors/update-16-0-0-update-executors",
104+
"package": "@nx/web",
105+
"name": "update-16-0-0-update-executors"
106+
},
107+
{
108+
"cli": "nx",
109+
"version": "16.0.0-beta.1",
110+
"description": "Replace @nx/js with @nx/js",
111+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
112+
"package": "@nx/js",
113+
"name": "update-16-0-0-add-nx-packages"
114+
},
115+
{
116+
"cli": "nx",
117+
"version": "16.0.0-beta.1",
118+
"description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
119+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
120+
"package": "@nx/eslint-plugin",
121+
"name": "update-16-0-0-add-nx-packages"
122+
},
123+
{
124+
"cli": "nx",
125+
"version": "16.0.0-beta.1",
126+
"description": "Replace @nx/jest with @nx/jest",
127+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
128+
"package": "@nx/jest",
129+
"name": "update-16-0-0-add-nx-packages"
130+
},
131+
{
132+
"cli": "nx",
133+
"version": "16.0.0-beta.1",
134+
"description": "Replace @nx/linter with @nx/linter",
135+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
136+
"package": "@nx/linter",
137+
"name": "update-16-0-0-add-nx-packages"
138+
},
139+
{
140+
"cli": "nx",
141+
"version": "16.0.0-beta.1",
142+
"description": "Replace @nx/express with @nx/express",
143+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
144+
"package": "@nx/express",
145+
"name": "update-16-0-0-add-nx-packages"
146+
},
147+
{
148+
"cli": "nx",
149+
"version": "16.0.0-beta.1",
150+
"description": "Replace the deprecated library generator 'simpleModuleName' option from generator defaults with 'simpleName'",
151+
"factory": "./src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option",
152+
"package": "@nx/angular",
153+
"name": "remove-library-generator-simple-module-name-option"
154+
},
155+
{
156+
"cli": "nx",
157+
"version": "16.0.0-beta.1",
158+
"description": "Replace @nx/angular with @nx/angular",
159+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
160+
"package": "@nx/angular",
161+
"name": "update-16-0-0-add-nx-packages"
162+
},
163+
{
164+
"cli": "nx",
165+
"version": "16.0.0-beta.6",
166+
"description": "Remove protractor as default e2eTestRunner from nxJson and project configurations",
167+
"implementation": "./src/migrations/update-16-0-0/remove-protractor-defaults",
168+
"package": "@nx/angular",
169+
"name": "remove-protractor-defaults-from-generators"
170+
},
171+
{
172+
"cli": "nx",
173+
"version": "16.0.0-beta.6",
174+
"description": "Remove karma as default unitTestRunner from nxJson and project configurations",
175+
"implementation": "./src/migrations/update-16-0-0/remove-karma-defaults",
176+
"package": "@nx/angular",
177+
"name": "remove-karma-defaults-from-generators"
178+
},
179+
{
180+
"cli": "nx",
181+
"version": "16.1.0-beta.1",
182+
"requires": {
183+
"@angular/core": ">=15.0.0"
184+
},
185+
"description": "Remove exported `@angular/platform-server` `renderModule` method. The `renderModule` method is now exported by the Angular CLI.",
186+
"factory": "./src/migrations/update-16-1-0/remove-render-module-platform-server-exports",
187+
"package": "@nx/angular",
188+
"name": "remove-render-module-platform-server-exports"
189+
},
190+
{
191+
"cli": "nx",
192+
"version": "16.1.0-beta.1",
193+
"requires": {
194+
"@angular/core": ">=16.0.0-rc.4"
195+
},
196+
"description": "Remove 'ngcc' invocation if exists from the 'postinstall' script in package.json.",
197+
"factory": "./src/migrations/update-16-1-0/remove-ngcc-invocation",
198+
"package": "@nx/angular",
199+
"name": "remove-ngcc-invocation"
200+
},
201+
{
202+
"cli": "nx",
203+
"version": "16.1.0-beta.1",
204+
"requires": {
205+
"@angular/core": ">=16.0.0-rc.4"
206+
},
207+
"description": "Extract the app config for standalone apps",
208+
"factory": "./src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap",
209+
"package": "@nx/angular",
210+
"name": "extract-app-config-for-standalone"
211+
},
212+
{
213+
"cli": "nx",
214+
"version": "16.1.0-beta.1",
215+
"requires": {
216+
"@angular/core": ">=16.0.0-rc.4"
217+
},
218+
"description": "Update server executors' configuration to disable 'buildOptimizer' for non optimized builds.",
219+
"factory": "./src/migrations/update-16-1-0/update-server-executor-config",
220+
"package": "@nx/angular",
221+
"name": "update-server-executor-config"
222+
},
223+
{
224+
"cli": "nx",
225+
"version": "16.1.0-beta.1",
226+
"requires": {
227+
"@angular/core": ">=16.0.0"
228+
},
229+
"description": "Update the @angular/cli package version to ~16.0.0.",
230+
"factory": "./src/migrations/update-16-1-0/update-angular-cli",
231+
"package": "@nx/angular",
232+
"name": "update-angular-cli-version-16-0-0"
233+
},
234+
{
235+
"version": "16.0.0",
236+
"description": "As of Angular v16, the `moduleId` property of `@Component` is deprecated as it no longer has any effect.",
237+
"factory": "./migrations/remove-module-id/bundle",
238+
"package": "@angular/core",
239+
"name": "migration-v16-remove-module-id"
240+
},
241+
{
242+
"version": "16.0.0",
243+
"description": "In Angular version 15.2, the guard and resolver interfaces (CanActivate, Resolve, etc) were deprecated. This migration removes imports and 'implements' clauses that contain them.",
244+
"factory": "./migrations/guard-and-resolve-interfaces/bundle",
245+
"package": "@angular/core",
246+
"name": "migration-v16-guard-and-resolve-interfaces"
247+
}
248+
]
249+
}

0 commit comments

Comments
 (0)