Skip to content

Commit fca0298

Browse files
authored
feat: Nx 15 support (#60)
1 parent 1ce6401 commit fca0298

File tree

11 files changed

+1199
-1707
lines changed

11 files changed

+1199
-1707
lines changed

e2e/nx-e2e/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "nx-e2e",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"projectType": "application",
45
"sourceRoot": "e2e/nx-e2e/src",

migrations.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"migrations": [
3+
{
4+
"cli": "nx",
5+
"version": "15.0.0-beta.1",
6+
"description": "Replace implicitDependencies with namedInputs + target inputs",
7+
"implementation": "./src/migrations/update-15-0-0/migrate-to-inputs",
8+
"package": "nx",
9+
"name": "15.0.0-migrate-to-inputs"
10+
},
11+
{
12+
"cli": "nx",
13+
"version": "15.0.0-beta.1",
14+
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
15+
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
16+
"package": "nx",
17+
"name": "15.0.0-prefix-outputs"
18+
},
19+
{
20+
"cli": "nx",
21+
"version": "15.0.12-beta.1",
22+
"description": "Set project names in project.json files",
23+
"implementation": "./src/migrations/update-15-1-0/set-project-names",
24+
"package": "nx",
25+
"name": "15.1.0-set-project-names"
26+
},
27+
{
28+
"cli": "nx",
29+
"version": "14.6.0-beta.0",
30+
"description": "Update the @angular/cli package version to ~14.2.0.",
31+
"factory": "./src/migrations/update-14-6-0/update-angular-cli",
32+
"package": "@nrwl/angular",
33+
"name": "update-angular-cli-version-14-2-0"
34+
},
35+
{
36+
"cli": "nx",
37+
"version": "15.0.0-beta.0",
38+
"description": "Rename @nrwl/angular:webpack-server executor to @nrwl/angular:webpack-dev-server",
39+
"factory": "./src/migrations/update-14-8-0/rename-webpack-server",
40+
"package": "@nrwl/angular",
41+
"name": "rename-webpack-server-executor"
42+
},
43+
{
44+
"cli": "nx",
45+
"version": "15.0.0-beta.0",
46+
"description": "Update the usages of @nrwl/angular/testing to import jasmine-marbles symbols from jasmine-marbles itself.",
47+
"factory": "./src/migrations/update-15-0-0/switch-to-jasmine-marbles",
48+
"package": "@nrwl/angular",
49+
"name": "switch-to-jasmine-marbles"
50+
},
51+
{
52+
"cli": "nx",
53+
"version": "15.0.0-beta.1",
54+
"description": "Stop hashing karma spec files and config files for build targets and dependent tasks",
55+
"factory": "./src/migrations/update-15-0-0/add-karma-inputs",
56+
"package": "@nrwl/angular",
57+
"name": "add-karma-inputs"
58+
},
59+
{
60+
"version": "14.6.0-beta.0",
61+
"cli": "nx",
62+
"description": "Update jest configs to support jest 28 changes (https://jestjs.io/docs/upgrading-to-jest28#configuration-options)",
63+
"factory": "./src/migrations/update-14-6-0/update-configs-jest-28",
64+
"package": "@nrwl/jest",
65+
"name": "update-configs-jest-28"
66+
},
67+
{
68+
"version": "14.6.0-beta.0",
69+
"cli": "nx",
70+
"description": "Update jest test files to support jest 28 changes (https://jestjs.io/docs/upgrading-to-jest28)",
71+
"factory": "./src/migrations/update-14-6-0/update-tests-jest-28",
72+
"package": "@nrwl/jest",
73+
"name": "update-tests-jest-28"
74+
},
75+
{
76+
"version": "15.0.0-beta.0",
77+
"cli": "nx",
78+
"description": "Stop hashing jest spec files and config files for build targets and dependent tasks",
79+
"factory": "./src/migrations/update-15-0-0/add-jest-inputs",
80+
"package": "@nrwl/jest",
81+
"name": "add-jest-inputs"
82+
},
83+
{
84+
"cli": "nx",
85+
"version": "15.0.0-beta.0",
86+
"description": "Migrates executor schema files to v2",
87+
"factory": "./src/migrations/update-15-0-0/specify-output-capture",
88+
"package": "@nrwl/nx-plugin",
89+
"name": "update-15-0-0"
90+
},
91+
{
92+
"version": "14.8.0-beta.0",
93+
"description": "Migrates from @nrwl/workspace:run-commands to nx:run-commands",
94+
"cli": "nx",
95+
"implementation": "./src/migrations/update-14-8-0/change-run-commands-executor",
96+
"package": "@nrwl/workspace",
97+
"name": "14-8-0-change-run-commands-executor"
98+
}
99+
]
100+
}

nx.json

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,11 @@
33
"affected": {
44
"defaultBase": "master"
55
},
6-
"implicitDependencies": {
7-
"workspace.json": "*",
8-
"package.json": {
9-
"dependencies": "*",
10-
"devDependencies": "*"
11-
},
12-
"tsconfig.base.json": "*",
13-
"tslint.json": "*",
14-
".eslintrc.json": "*",
15-
"nx.json": "*"
16-
},
176
"tasksRunnerOptions": {
187
"default": {
198
"runner": "nx/tasks-runners/default",
209
"options": {
21-
"cacheableOperations": [
22-
"build",
23-
"lint",
24-
"test",
25-
"e2e"
26-
],
10+
"cacheableOperations": ["build", "lint", "test", "e2e"],
2711
"parallel": 1
2812
}
2913
}
@@ -35,9 +19,16 @@
3519
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3620
"targetDefaults": {
3721
"build": {
38-
"dependsOn": [
39-
"^build"
40-
]
22+
"dependsOn": ["^build"],
23+
"inputs": ["production", "^production"]
24+
},
25+
"test": {
26+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
4127
}
28+
},
29+
"namedInputs": {
30+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
31+
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.base.json", "{workspaceRoot}/tslint.json", "{workspaceRoot}/nx.json"],
32+
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s"]
4233
}
4334
}

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
},
3232
"private": true,
3333
"devDependencies": {
34-
"@angular/core": "14.1.3",
35-
"@nrwl/angular": "14.5.10",
36-
"@nrwl/cli": "14.5.10",
37-
"@nrwl/eslint-plugin-nx": "14.5.10",
38-
"@nrwl/jest": "14.5.10",
39-
"@nrwl/nx-plugin": "14.5.10",
40-
"@nrwl/workspace": "14.5.10",
34+
"@angular/core": "~14.2.0",
35+
"@nrwl/angular": "15.1.1",
36+
"@nrwl/cli": "15.1.1",
37+
"@nrwl/eslint-plugin-nx": "15.1.1",
38+
"@nrwl/jest": "15.1.1",
39+
"@nrwl/nx-plugin": "15.1.1",
40+
"@nrwl/workspace": "15.1.1",
4141
"@swc-node/register": "^1.4.2",
4242
"@swc/core": "^1.2.173",
4343
"@types/fs-extra": "^9.0.11",
44-
"@types/jest": "27.4.1",
44+
"@types/jest": "28.1.8",
4545
"@types/node": "^18.0.0",
4646
"@types/plist": "^3.0.2",
4747
"@types/xml2js": "^0.4.9",
@@ -54,16 +54,15 @@
5454
"eslint": "7.22.0",
5555
"eslint-config-prettier": "8.1.0",
5656
"fs-extra": "^10.1.0",
57-
"jest": "27.5.1",
57+
"jest": "28.1.3",
5858
"jsonc-parser": "3.0.0",
59-
"nx": "14.5.10",
59+
"nx": "15.1.1",
6060
"plist": "^3.0.4",
6161
"prettier": "^2.7.0",
62-
"ts-jest": "27.1.4",
62+
"ts-jest": "28.0.8",
6363
"ts-node": "10.9.1",
6464
"tslib": "^2.4.0",
65-
"typescript": "~4.7.3",
65+
"typescript": "4.8.4",
6666
"xml2js": "^0.4.23"
6767
}
6868
}
69-

packages/nx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/nx",
3-
"version": "4.0.2",
3+
"version": "4.1.0",
44
"description": "NativeScript Plugin for Nx",
55
"repository": {
66
"type": "git",

packages/nx/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "nx",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "packages/nx/src",
45
"projectType": "library",
@@ -13,7 +14,7 @@
1314
},
1415
"test": {
1516
"executor": "@nrwl/jest:jest",
16-
"outputs": ["coverage/packages/nx"],
17+
"outputs": ["{workspaceRoot}/coverage/packages/nx"],
1718
"options": {
1819
"jestConfig": "packages/nx/jest.config.ts",
1920
"passWithNoTests": true

packages/nx/src/executors/build/schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"version": 2,
3+
"outputCapture": "direct-nodejs",
24
"$schema": "http://json-schema.org/schema",
35
"title": "NativeScript builder",
46
"description": "",

packages/nx/src/executors/test/schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"version": 2,
3+
"outputCapture": "direct-nodejs",
24
"$schema": "http://json-schema.org/schema",
35
"title": "Start the NativeScript unit test runner",
46
"description": "",

packages/nx/src/generators/application/application.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('app', () => {
1515
await applicationGenerator(appTree, { name: 'myApp' });
1616
const config = readProjectConfiguration(appTree, 'nativescript-my-app');
1717

18-
expect(config.root).toEqual('apps/nativescript-my-app/');
18+
expect(config.root).toEqual('apps/nativescript-my-app');
1919
});
2020

2121
it('should generate files', async () => {

packages/nx/src/utils/versions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
export const nxVersion = '^14.0.0';
1+
export const nxVersion = '^15.0.0';
22

33
export const nsNxPluginVersion = '~4.0.0';
4-
export const nsCoreVersion = '~8.2.0';
5-
export const nsTypesVersion = '~8.2.0';
4+
export const nsCoreVersion = '~8.3.0';
5+
export const nsTypesVersion = '~8.3.0';
66
export const nsThemeVersion = '~1.0.4';
77
export const nsWebpackVersion = '~5.0.0';
88
export const sassVersion = '^1.32.0';
9-
export const nsIOSRuntimeVersion = '~8.2.0';
10-
export const nsAndroidRuntimeVersion = '~8.2.1';
9+
export const nsIOSRuntimeVersion = '~8.3.0';
10+
export const nsAndroidRuntimeVersion = '~8.3.0';
1111

1212

1313
// Frontend frameworks

0 commit comments

Comments
 (0)