Skip to content

Commit 5019eba

Browse files
authored
feat: Support Nx 17+ (#72)
1 parent f013233 commit 5019eba

File tree

17 files changed

+1657
-1605
lines changed

17 files changed

+1657
-1605
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ testem.log
3838
# System Files
3939
.DS_Store
4040
Thumbs.db
41+
42+
.nx/cache

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
/dist
44
/coverage
5+
6+
/.nx/cache

migrations.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

nx.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
{
2-
"npmScope": "nativescript",
32
"affected": {
43
"defaultBase": "master"
54
},
6-
"tasksRunnerOptions": {
7-
"default": {
8-
"runner": "nx/tasks-runners/default",
9-
"options": {
10-
"cacheableOperations": ["build", "lint", "test", "e2e"],
11-
"parallel": 1
12-
}
13-
}
14-
},
155
"workspaceLayout": {
166
"appsDir": "e2e",
177
"libsDir": "packages"
@@ -20,15 +10,24 @@
2010
"targetDefaults": {
2111
"build": {
2212
"dependsOn": ["^build"],
23-
"inputs": ["production", "^production"]
13+
"inputs": ["production", "^production"],
14+
"cache": true
2415
},
2516
"test": {
26-
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
17+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
18+
"cache": true
19+
},
20+
"lint": {
21+
"cache": true
22+
},
23+
"e2e": {
24+
"cache": true
2725
}
2826
},
2927
"namedInputs": {
3028
"default": ["{projectRoot}/**/*", "sharedGlobals"],
3129
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.base.json", "{workspaceRoot}/tslint.json", "{workspaceRoot}/nx.json"],
3230
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
33-
}
31+
},
32+
"parallel": 1
3433
}

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,44 @@
3131
},
3232
"private": true,
3333
"devDependencies": {
34-
"@angular-devkit/schematics": "16.1.3",
35-
"@angular/core": "16.1.3",
36-
"@swc-node/register": "^1.4.2",
37-
"@swc/core": "^1.2.173",
38-
"@types/fs-extra": "^9.0.11",
39-
"@types/jest": "29.5.2",
40-
"@types/node": "^18.0.0",
34+
"@angular-devkit/schematics": "16.2.7",
35+
"@angular/core": "16.2.10",
36+
"@swc-node/register": "1.6.8",
37+
"@swc/core": "1.3.94",
38+
"@types/fs-extra": "^11.0.3",
39+
"@types/jest": "29.5.6",
40+
"@types/node": "^20.0.0",
4141
"@types/plist": "^3.0.2",
4242
"@types/xml2js": "^0.4.9",
43-
"@typescript-eslint/eslint-plugin": "5.61.0",
44-
"@typescript-eslint/parser": "5.61.0",
45-
"conventional-changelog-cli": "^2.1.1",
43+
"@typescript-eslint/eslint-plugin": "~6.8.0",
44+
"@typescript-eslint/parser": "~6.8.0",
45+
"conventional-changelog-cli": "^4.1.0",
4646
"cz-conventional-changelog": "^3.3.0",
4747
"doctoc": "^2.0.0",
48-
"dotenv": "10.0.0",
49-
"eslint": "7.22.0",
50-
"eslint-config-prettier": "8.1.0",
48+
"dotenv": "~16.3.1",
49+
"eslint": "8.46.0",
50+
"eslint-config-prettier": "9.0.0",
5151
"fs-extra": "^11.1.0",
5252
"jest": "29.6.0",
53-
"jsonc-parser": "3.0.0",
54-
"nx": "16.5.0",
55-
"plist": "^3.0.4",
53+
"jsonc-parser": "3.2.0",
54+
"nx": "17.0.1",
55+
"plist": "^3.1.0",
5656
"prettier": "^2.7.0",
5757
"ts-jest": "29.1.1",
5858
"ts-node": "10.9.1",
59-
"tslib": "^2.4.0",
60-
"typescript": "5.1.6",
61-
"xml2js": "^0.4.23",
62-
"nx-cloud": "16.0.5",
63-
"@nx/devkit": "16.5.0",
64-
"@nx/workspace": "16.5.0",
65-
"@nx/plugin": "16.5.0",
66-
"@nx/web": "16.5.0",
67-
"@nx/js": "16.5.0",
68-
"@nx/eslint-plugin": "16.5.0",
69-
"@nx/jest": "16.5.0",
70-
"@nx/linter": "16.5.0",
71-
"@nx/express": "16.5.0",
72-
"@nx/angular": "16.5.0"
59+
"tslib": "^2.6.2",
60+
"typescript": "~5.2.0",
61+
"xml2js": "^0.6.2",
62+
"nx-cloud": "16.5.2",
63+
"@nx/devkit": "17.0.1",
64+
"@nx/workspace": "17.0.1",
65+
"@nx/plugin": "17.0.1",
66+
"@nx/web": "17.0.1",
67+
"@nx/js": "17.0.1",
68+
"@nx/eslint-plugin": "17.0.1",
69+
"@nx/jest": "17.0.1",
70+
"@nx/express": "17.0.1",
71+
"@nx/angular": "17.0.1",
72+
"@nx/eslint": "17.0.1"
7373
}
7474
}

packages/nx/README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
</div>
1111

12-
> Requires at least NativeScript CLI v8.x.x or higher. You can confirm your CLI version by running `ns --version`.
12+
> Requires at least NativeScript CLI v8.x.x or higher. You can confirm your CLI version by running `ns -v`.
1313
1414
## Table of Contents
1515

@@ -64,23 +64,13 @@ None: Configures a minimal structure without specific frameworks or tec
6464

6565
# Choose "Integrated"
6666

67-
? Package-based or integrated?
68-
Integrated: Nx creates a workspace structure most suitable for building apps.
67+
? Package-based monorepo, integrated monorepo, or standalone project?
68+
Integrated Monorepo: Nx creates a monorepo that contains multiple projects.
6969
```
7070

7171
### Init workspace
7272

73-
Install the @nx/js plugin.
74-
75-
```sh
76-
# Using npm
77-
npm install --save-dev @nx/js
78-
79-
# Using yarn
80-
yarn add -D @nx/js
81-
```
82-
83-
Now initialize -- This will ensure a `tsconfig.base.json` is created to begin building your workspace.
73+
Initialize a TypeScript project -- This will ensure a `tsconfig.base.json` is created to begin building your workspace.
8474

8575
```sh
8676
npx nx g @nx/js:init

packages/nx/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/nx",
3-
"version": "16.6.0",
3+
"version": "17.0.0",
44
"description": "NativeScript Plugin for Nx",
55
"repository": {
66
"type": "git",
@@ -33,10 +33,10 @@
3333
"@angular-devkit/schematics": "^16.0.0",
3434
"fs-extra": "^11.1.0",
3535
"ignore": "^5.2.4",
36-
"plist": "^3.0.1",
36+
"plist": "^3.1.0",
3737
"xml2js": "~0.6.0",
38-
"@nx/devkit": "^16.0.0",
39-
"@nx/js": "^16.0.0",
40-
"@nx/jest": "^16.0.0"
38+
"@nx/devkit": "^17.0.0",
39+
"@nx/js": "^17.0.0",
40+
"@nx/jest": "^17.0.0"
4141
}
4242
}

packages/nx/project.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"generators": {},
77
"targets": {
88
"lint": {
9-
"executor": "@nx/linter:eslint",
9+
"executor": "@nx/eslint:lint",
1010
"outputs": ["{options.outputFile}"],
1111
"options": {
1212
"lintFilePatterns": ["packages/nx/**/*.ts"]
@@ -56,7 +56,8 @@
5656
"glob": "migrations.json",
5757
"output": "."
5858
}
59-
]
59+
],
60+
"updateBuildableProjectDepsInPackageJson": true
6061
}
6162
}
6263
},

packages/nx/src/generators/app-resources/app-resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Schema as AppResourcesSchema } from './schema';
55

66
export function appResources(tree: Tree, options: AppResourcesSchema) {
77
generateFiles(tree, joinPathFragments(__dirname, 'files'), options.path, {
8-
...getDefaultTemplateOptions(),
8+
...getDefaultTemplateOptions(tree),
99
name: options.name || 'App_Resources',
1010
libFolderName: PluginHelpers.getLibFoldername('nativescript'),
1111
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export async function applicationGenerator(tree: Tree, options: Schema) {
9999
},
100100
},
101101
lint: {
102-
executor: '@nx/linter:eslint',
102+
executor: '@nx/eslint:eslint',
103103
options: {
104104
lintFilePatterns: [`${appPath}/**/*.ts`, `${appPath}/src/**/*.html`],
105105
},
@@ -122,7 +122,7 @@ function addAppFiles(tree: Tree, options: Schema, appName: string, extra: string
122122
}
123123
generateFiles(tree, joinPathFragments(__dirname, `files${framework ? '_' + framework : ''}${extra ? '_' + extra : ''}`), `apps/${directory}${appName}`, {
124124
...(options as any),
125-
...getDefaultTemplateOptions(),
125+
...getDefaultTemplateOptions(tree),
126126
appname,
127127
directoryAppPath: `${directory}${options.name}`,
128128
pathOffset: directory ? '../../../' : '../../',

0 commit comments

Comments
 (0)