@nx/node 20.0.0-canary.20241001-8fa7065 → 20.0.0-canary.20241002-1d10a19
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -5
- package/src/generators/application/application.js +2 -4
- package/src/generators/application/schema.d.ts +2 -4
- package/src/generators/application/schema.json +7 -13
- package/src/generators/e2e-project/e2e-project.js +2 -4
- package/src/generators/e2e-project/schema.d.ts +0 -3
- package/src/generators/e2e-project/schema.json +0 -5
- package/src/generators/library/library.js +2 -3
- package/src/generators/library/schema.d.ts +2 -4
- package/src/generators/library/schema.json +9 -14
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/node",
|
3
|
-
"version": "20.0.0-canary.
|
3
|
+
"version": "20.0.0-canary.20241002-1d10a19",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Node Plugin for Nx contains generators to manage Node applications within an Nx workspace.",
|
6
6
|
"repository": {
|
@@ -32,10 +32,10 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"tslib": "^2.3.0",
|
35
|
-
"@nx/devkit": "20.0.0-canary.
|
36
|
-
"@nx/jest": "20.0.0-canary.
|
37
|
-
"@nx/js": "20.0.0-canary.
|
38
|
-
"@nx/eslint": "20.0.0-canary.
|
35
|
+
"@nx/devkit": "20.0.0-canary.20241002-1d10a19",
|
36
|
+
"@nx/jest": "20.0.0-canary.20241002-1d10a19",
|
37
|
+
"@nx/js": "20.0.0-canary.20241002-1d10a19",
|
38
|
+
"@nx/eslint": "20.0.0-canary.20241002-1d10a19"
|
39
39
|
},
|
40
40
|
"publishConfig": {
|
41
41
|
"access": "public"
|
@@ -359,7 +359,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
359
359
|
projectType: options.framework === 'none' ? 'cli' : 'server',
|
360
360
|
name: options.rootProject ? 'e2e' : `${options.name}-e2e`,
|
361
361
|
directory: options.rootProject ? 'e2e' : `${options.appProjectRoot}-e2e`,
|
362
|
-
projectNameAndRootFormat: 'as-provided',
|
363
362
|
project: options.name,
|
364
363
|
port: options.port,
|
365
364
|
isNest: options.isNest,
|
@@ -390,15 +389,14 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
390
389
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
391
390
|
}
|
392
391
|
async function normalizeOptions(host, options) {
|
393
|
-
|
392
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
|
393
|
+
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
394
394
|
name: options.name,
|
395
395
|
projectType: 'application',
|
396
396
|
directory: options.directory,
|
397
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
398
397
|
rootProject: options.rootProject,
|
399
398
|
});
|
400
399
|
options.rootProject = appProjectRoot === '.';
|
401
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
402
400
|
options.bundler = options.bundler ?? 'esbuild';
|
403
401
|
options.e2eTestRunner = options.e2eTestRunner ?? 'jest';
|
404
402
|
const parsedTags = options.tags
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
3
2
|
|
4
3
|
export interface Schema {
|
5
|
-
|
4
|
+
directory: string;
|
5
|
+
name?: string;
|
6
6
|
skipFormat?: boolean;
|
7
7
|
skipPackageJson?: boolean;
|
8
|
-
directory?: string;
|
9
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
10
8
|
unitTestRunner?: 'jest' | 'none';
|
11
9
|
e2eTestRunner?: 'jest' | 'none';
|
12
10
|
linter?: Linter | LinterType;
|
@@ -6,27 +6,21 @@
|
|
6
6
|
"description": "Nx Application Options Schema.",
|
7
7
|
"type": "object",
|
8
8
|
"properties": {
|
9
|
-
"
|
10
|
-
"description": "The
|
9
|
+
"directory": {
|
10
|
+
"description": "The directory of the new application.",
|
11
11
|
"type": "string",
|
12
12
|
"$default": {
|
13
13
|
"$source": "argv",
|
14
14
|
"index": 0
|
15
15
|
},
|
16
|
-
"x-prompt": "
|
17
|
-
"x-priority": "important",
|
18
|
-
"pattern": "^[a-zA-Z][^:]*$"
|
16
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
19
17
|
},
|
20
|
-
"
|
21
|
-
"description": "The
|
18
|
+
"name": {
|
19
|
+
"description": "The name of the application.",
|
22
20
|
"type": "string",
|
21
|
+
"pattern": "^[a-zA-Z][^:]*$",
|
23
22
|
"x-priority": "important"
|
24
23
|
},
|
25
|
-
"projectNameAndRootFormat": {
|
26
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
27
|
-
"type": "string",
|
28
|
-
"enum": ["as-provided", "derived"]
|
29
|
-
},
|
30
24
|
"skipFormat": {
|
31
25
|
"description": "Skip formatting files",
|
32
26
|
"type": "boolean",
|
@@ -126,5 +120,5 @@
|
|
126
120
|
"description": "Add a docker build target"
|
127
121
|
}
|
128
122
|
},
|
129
|
-
"required": ["
|
123
|
+
"required": ["directory"]
|
130
124
|
}
|
@@ -126,13 +126,11 @@ async function e2eProjectGeneratorInternal(host, _options) {
|
|
126
126
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
127
127
|
}
|
128
128
|
async function normalizeOptions(tree, options) {
|
129
|
+
options.directory = options.directory ?? `${options.project}-e2e`;
|
129
130
|
const { projectName: e2eProjectName, projectRoot: e2eProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
|
130
|
-
name: options.name
|
131
|
+
name: options.name,
|
131
132
|
projectType: 'library',
|
132
133
|
directory: options.rootProject ? 'e2e' : options.directory,
|
133
|
-
projectNameAndRootFormat: options.rootProject
|
134
|
-
? 'as-provided'
|
135
|
-
: options.projectNameAndRootFormat,
|
136
134
|
});
|
137
135
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
138
136
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
@@ -1,10 +1,7 @@
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
2
|
-
|
3
1
|
export interface Schema {
|
4
2
|
project: string;
|
5
3
|
projectType: 'server' | 'cli';
|
6
4
|
directory?: string;
|
7
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
8
5
|
name?: string;
|
9
6
|
port?: number;
|
10
7
|
linter?: 'eslint' | 'none';
|
@@ -18,11 +18,6 @@
|
|
18
18
|
"type": "string",
|
19
19
|
"x-priority": "important"
|
20
20
|
},
|
21
|
-
"projectNameAndRootFormat": {
|
22
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
23
|
-
"type": "string",
|
24
|
-
"enum": ["as-provided", "derived"]
|
25
|
-
},
|
26
21
|
"name": {
|
27
22
|
"description": "The name of the e2e project. Defaults to the project name with '-e2e' suffix.",
|
28
23
|
"type": "string"
|
@@ -51,14 +51,13 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
51
51
|
}
|
52
52
|
exports.default = libraryGenerator;
|
53
53
|
async function normalizeOptions(tree, options) {
|
54
|
-
|
54
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'library');
|
55
|
+
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
|
55
56
|
name: options.name,
|
56
57
|
projectType: 'library',
|
57
58
|
directory: options.directory,
|
58
59
|
importPath: options.importPath,
|
59
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
60
60
|
});
|
61
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
62
61
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
63
62
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
64
63
|
nxJson.useInferencePlugins !== false;
|
@@ -1,10 +1,8 @@
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
3
2
|
|
4
3
|
export interface Schema {
|
5
|
-
|
6
|
-
|
7
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
4
|
+
directory: string;
|
5
|
+
name?: string;
|
8
6
|
simpleModuleName?: boolean;
|
9
7
|
skipTsConfig?: boolean;
|
10
8
|
skipFormat?: boolean;
|
@@ -12,29 +12,24 @@
|
|
12
12
|
}
|
13
13
|
],
|
14
14
|
"properties": {
|
15
|
-
"
|
15
|
+
"directory": {
|
16
16
|
"type": "string",
|
17
|
-
"description": "
|
17
|
+
"description": "A directory where the lib is placed",
|
18
|
+
"alias": "dir",
|
18
19
|
"$default": {
|
19
20
|
"$source": "argv",
|
20
21
|
"index": 0
|
21
22
|
},
|
22
|
-
"x-prompt": "
|
23
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
|
23
|
+
"x-prompt": "Which directory do you want to create the library in?"
|
24
24
|
},
|
25
|
-
"
|
25
|
+
"name": {
|
26
26
|
"type": "string",
|
27
|
-
"description": "
|
28
|
-
"
|
27
|
+
"description": "Library name",
|
28
|
+
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$",
|
29
29
|
"x-priority": "important"
|
30
30
|
},
|
31
|
-
"projectNameAndRootFormat": {
|
32
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
33
|
-
"type": "string",
|
34
|
-
"enum": ["as-provided", "derived"]
|
35
|
-
},
|
36
31
|
"simpleModuleName": {
|
37
|
-
"description": "Keep the module name simple
|
32
|
+
"description": "Keep the module name simple.",
|
38
33
|
"type": "boolean",
|
39
34
|
"default": false
|
40
35
|
},
|
@@ -126,5 +121,5 @@
|
|
126
121
|
"default": false
|
127
122
|
}
|
128
123
|
},
|
129
|
-
"required": ["
|
124
|
+
"required": ["directory"]
|
130
125
|
}
|