@nx/workspace 20.2.0-canary.20241129-2cb58b9 → 20.2.0-canary.20241203-6b87005
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +13 -0
- package/package.json +3 -3
- package/src/generators/new/generate-preset.js +2 -0
- package/src/generators/new/generate-workspace-files.js +11 -4
- package/src/generators/new/new.d.ts +4 -0
- package/src/generators/new/new.js +5 -0
- package/src/generators/new/schema.json +10 -1
- package/src/generators/preset/preset.js +15 -0
- package/src/generators/preset/schema.d.ts +2 -0
- package/src/generators/preset/schema.json +16 -1
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
package/migrations.json
CHANGED
|
@@ -50,6 +50,19 @@
|
|
|
50
50
|
"alwaysAddToPackageJson": false
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
},
|
|
54
|
+
"20.2.0": {
|
|
55
|
+
"version": "20.2.0-beta.5",
|
|
56
|
+
"x-prompt": "Do you want to update to TypeScript v5.6?",
|
|
57
|
+
"requires": {
|
|
58
|
+
"typescript": ">=5.5.0 <5.6.0"
|
|
59
|
+
},
|
|
60
|
+
"packages": {
|
|
61
|
+
"typescript": {
|
|
62
|
+
"version": "~5.6.2",
|
|
63
|
+
"alwaysAddToPackageJson": false
|
|
64
|
+
}
|
|
65
|
+
}
|
|
53
66
|
}
|
|
54
67
|
}
|
|
55
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "20.2.0-canary.
|
|
3
|
+
"version": "20.2.0-canary.20241203-6b87005",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
|
|
6
6
|
"repository": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@nx/devkit": "20.2.0-canary.
|
|
41
|
+
"@nx/devkit": "20.2.0-canary.20241203-6b87005",
|
|
42
42
|
"chalk": "^4.1.0",
|
|
43
43
|
"enquirer": "~2.3.6",
|
|
44
44
|
"tslib": "^2.3.0",
|
|
45
45
|
"yargs-parser": "21.1.1",
|
|
46
|
-
"nx": "20.2.0-canary.
|
|
46
|
+
"nx": "20.2.0-canary.20241203-6b87005"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
@@ -68,9 +68,11 @@ function generatePreset(host, opts) {
|
|
|
68
68
|
? `--e2eTestRunner=${opts.e2eTestRunner}`
|
|
69
69
|
: null,
|
|
70
70
|
opts.ssr ? `--ssr` : null,
|
|
71
|
+
opts.serverRouting ? `--server-routing` : null,
|
|
71
72
|
opts.prefix !== undefined ? `--prefix=${opts.prefix}` : null,
|
|
72
73
|
opts.nxCloudToken ? `--nxCloudToken=${opts.nxCloudToken}` : null,
|
|
73
74
|
opts.formatter ? `--formatter=${opts.formatter}` : null,
|
|
75
|
+
opts.workspaces ? `--workspaces` : null,
|
|
74
76
|
].filter((e) => !!e);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -325,15 +325,22 @@ function setUpWorkspacesInPackageJson(tree, options) {
|
|
|
325
325
|
if (options.preset === presets_1.Preset.NPM ||
|
|
326
326
|
(options.preset === presets_1.Preset.TS &&
|
|
327
327
|
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
328
|
-
process.env.NX_ADD_TS_PLUGIN !== 'false')
|
|
328
|
+
process.env.NX_ADD_TS_PLUGIN !== 'false') ||
|
|
329
|
+
((options.preset === presets_1.Preset.Expo ||
|
|
330
|
+
options.preset === presets_1.Preset.NextJs ||
|
|
331
|
+
options.preset === presets_1.Preset.ReactMonorepo ||
|
|
332
|
+
options.preset === presets_1.Preset.ReactNative ||
|
|
333
|
+
options.preset === presets_1.Preset.RemixMonorepo) &&
|
|
334
|
+
options.workspaces)) {
|
|
335
|
+
const workspaces = options.workspaceGlobs ?? ['packages/**'];
|
|
329
336
|
if (options.packageManager === 'pnpm') {
|
|
330
|
-
tree.write((0, path_1.join)(options.directory, 'pnpm-workspace.yaml'), `packages:
|
|
331
|
-
- '
|
|
337
|
+
tree.write((0, path_1.join)(options.directory, 'pnpm-workspace.yaml'), `packages:
|
|
338
|
+
- ${workspaces.join('\n - ')}
|
|
332
339
|
`);
|
|
333
340
|
}
|
|
334
341
|
else {
|
|
335
342
|
(0, devkit_1.updateJson)(tree, (0, path_1.join)(options.directory, 'package.json'), (json) => {
|
|
336
|
-
json.workspaces =
|
|
343
|
+
json.workspaces = workspaces;
|
|
337
344
|
return json;
|
|
338
345
|
});
|
|
339
346
|
}
|
|
@@ -20,15 +20,19 @@ interface Schema {
|
|
|
20
20
|
packageManager?: PackageManager;
|
|
21
21
|
e2eTestRunner?: 'cypress' | 'playwright' | 'detox' | 'jest' | 'none';
|
|
22
22
|
ssr?: boolean;
|
|
23
|
+
serverRouting?: boolean;
|
|
23
24
|
prefix?: string;
|
|
24
25
|
useGitHub?: boolean;
|
|
25
26
|
nxCloud?: 'yes' | 'skip' | 'circleci' | 'github';
|
|
26
27
|
formatter?: 'none' | 'prettier';
|
|
28
|
+
workspaces?: boolean;
|
|
29
|
+
workspaceGlobs?: string | string[];
|
|
27
30
|
}
|
|
28
31
|
export interface NormalizedSchema extends Schema {
|
|
29
32
|
presetVersion?: string;
|
|
30
33
|
isCustomPreset: boolean;
|
|
31
34
|
nxCloudToken?: string;
|
|
35
|
+
workspaceGlobs?: string[];
|
|
32
36
|
}
|
|
33
37
|
export declare function newGenerator(tree: Tree, opts: Schema): Promise<() => Promise<void>>;
|
|
34
38
|
export default newGenerator;
|
|
@@ -71,6 +71,11 @@ function parsePresetName(input) {
|
|
|
71
71
|
function normalizeOptions(options) {
|
|
72
72
|
const normalized = {
|
|
73
73
|
...options,
|
|
74
|
+
workspaceGlobs: Array.isArray(options.workspaceGlobs)
|
|
75
|
+
? options.workspaceGlobs
|
|
76
|
+
: options.workspaceGlobs
|
|
77
|
+
? [options.workspaceGlobs]
|
|
78
|
+
: undefined,
|
|
74
79
|
};
|
|
75
80
|
if (!options.directory) {
|
|
76
81
|
normalized.directory = normalized.name;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"linter": {
|
|
51
51
|
"description": "The tool to use for running lint checks.",
|
|
52
52
|
"type": "string",
|
|
53
|
-
"enum": ["eslint"],
|
|
53
|
+
"enum": ["eslint", "none"],
|
|
54
54
|
"default": "eslint"
|
|
55
55
|
},
|
|
56
56
|
"packageManager": {
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"type": "boolean",
|
|
84
84
|
"default": false
|
|
85
85
|
},
|
|
86
|
+
"serverRouting": {
|
|
87
|
+
"description": "Use the Angular Server Routing and App Engine APIs (Developer Preview).",
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
86
90
|
"prefix": {
|
|
87
91
|
"description": "The prefix to use for Angular component and directive selectors.",
|
|
88
92
|
"type": "string"
|
|
@@ -92,6 +96,11 @@
|
|
|
92
96
|
"type": "string",
|
|
93
97
|
"enum": ["none", "prettier"],
|
|
94
98
|
"default": "none"
|
|
99
|
+
},
|
|
100
|
+
"workspaces": {
|
|
101
|
+
"description": "Whether to use package manager workspaces.",
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"default": false
|
|
95
104
|
}
|
|
96
105
|
},
|
|
97
106
|
"additionalProperties": true
|
|
@@ -32,6 +32,7 @@ async function createPreset(tree, options) {
|
|
|
32
32
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
33
33
|
bundler: options.bundler,
|
|
34
34
|
ssr: options.ssr,
|
|
35
|
+
serverRouting: options.serverRouting,
|
|
35
36
|
prefix: options.prefix,
|
|
36
37
|
nxCloudToken: options.nxCloudToken,
|
|
37
38
|
});
|
|
@@ -49,6 +50,7 @@ async function createPreset(tree, options) {
|
|
|
49
50
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
50
51
|
bundler: options.bundler,
|
|
51
52
|
ssr: options.ssr,
|
|
53
|
+
serverRouting: options.serverRouting,
|
|
52
54
|
prefix: options.prefix,
|
|
53
55
|
nxCloudToken: options.nxCloudToken,
|
|
54
56
|
});
|
|
@@ -65,6 +67,8 @@ async function createPreset(tree, options) {
|
|
|
65
67
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
66
68
|
addPlugin,
|
|
67
69
|
nxCloudToken: options.nxCloudToken,
|
|
70
|
+
useTsSolution: options.workspaces,
|
|
71
|
+
formatter: options.formatter,
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
else if (options.preset === presets_1.Preset.ReactStandalone) {
|
|
@@ -81,6 +85,7 @@ async function createPreset(tree, options) {
|
|
|
81
85
|
unitTestRunner: options.bundler === 'vite' ? 'vitest' : 'jest',
|
|
82
86
|
addPlugin,
|
|
83
87
|
nxCloudToken: options.nxCloudToken,
|
|
88
|
+
formatter: options.formatter,
|
|
84
89
|
});
|
|
85
90
|
}
|
|
86
91
|
else if (options.preset === presets_1.Preset.RemixMonorepo) {
|
|
@@ -94,6 +99,8 @@ async function createPreset(tree, options) {
|
|
|
94
99
|
unitTestRunner: 'vitest',
|
|
95
100
|
addPlugin,
|
|
96
101
|
nxCloudToken: options.nxCloudToken,
|
|
102
|
+
useTsSolution: options.workspaces,
|
|
103
|
+
formatter: options.formatter,
|
|
97
104
|
});
|
|
98
105
|
}
|
|
99
106
|
else if (options.preset === presets_1.Preset.RemixStandalone) {
|
|
@@ -108,6 +115,7 @@ async function createPreset(tree, options) {
|
|
|
108
115
|
unitTestRunner: 'vitest',
|
|
109
116
|
addPlugin,
|
|
110
117
|
nxCloudToken: options.nxCloudToken,
|
|
118
|
+
formatter: options.formatter,
|
|
111
119
|
});
|
|
112
120
|
}
|
|
113
121
|
else if (options.preset === presets_1.Preset.VueMonorepo) {
|
|
@@ -178,6 +186,8 @@ async function createPreset(tree, options) {
|
|
|
178
186
|
src: options.nextSrcDir,
|
|
179
187
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
180
188
|
addPlugin,
|
|
189
|
+
useTsSolution: options.workspaces,
|
|
190
|
+
formatter: options.formatter,
|
|
181
191
|
});
|
|
182
192
|
}
|
|
183
193
|
else if (options.preset === presets_1.Preset.NextJsStandalone) {
|
|
@@ -193,6 +203,7 @@ async function createPreset(tree, options) {
|
|
|
193
203
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
194
204
|
rootProject: true,
|
|
195
205
|
addPlugin,
|
|
206
|
+
formatter: options.formatter,
|
|
196
207
|
});
|
|
197
208
|
}
|
|
198
209
|
else if (options.preset === presets_1.Preset.WebComponents) {
|
|
@@ -241,6 +252,8 @@ async function createPreset(tree, options) {
|
|
|
241
252
|
addPlugin,
|
|
242
253
|
nxCloudToken: options.nxCloudToken,
|
|
243
254
|
bundler: options.bundler ?? 'webpack',
|
|
255
|
+
useTsSolution: options.workspaces,
|
|
256
|
+
formatter: options.formatter,
|
|
244
257
|
});
|
|
245
258
|
}
|
|
246
259
|
else if (options.preset === presets_1.Preset.Expo) {
|
|
@@ -252,6 +265,8 @@ async function createPreset(tree, options) {
|
|
|
252
265
|
e2eTestRunner: options.e2eTestRunner ?? 'detox',
|
|
253
266
|
addPlugin,
|
|
254
267
|
nxCloudToken: options.nxCloudToken,
|
|
268
|
+
useTsSolution: options.workspaces,
|
|
269
|
+
formatter: options.formatter,
|
|
255
270
|
});
|
|
256
271
|
}
|
|
257
272
|
else if (options.preset === presets_1.Preset.TS) {
|
|
@@ -7,6 +7,7 @@ export interface Schema {
|
|
|
7
7
|
style?: string;
|
|
8
8
|
linter?: string;
|
|
9
9
|
formatter?: 'none' | 'prettier';
|
|
10
|
+
workspaces?: boolean;
|
|
10
11
|
standaloneConfig?: boolean;
|
|
11
12
|
framework?: string;
|
|
12
13
|
packageManager?: PackageManager;
|
|
@@ -19,6 +20,7 @@ export interface Schema {
|
|
|
19
20
|
e2eTestRunner?: 'cypress' | 'playwright' | 'jest' | 'detox' | 'none';
|
|
20
21
|
js?: boolean;
|
|
21
22
|
ssr?: boolean;
|
|
23
|
+
serverRouting?: boolean;
|
|
22
24
|
prefix?: string;
|
|
23
25
|
nxCloudToken?: string;
|
|
24
26
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"linter": {
|
|
18
18
|
"description": "The tool to use for running lint checks.",
|
|
19
19
|
"type": "string",
|
|
20
|
-
"enum": ["eslint"],
|
|
20
|
+
"enum": ["eslint", "none"],
|
|
21
21
|
"default": "eslint"
|
|
22
22
|
},
|
|
23
23
|
"routing": {
|
|
@@ -100,9 +100,24 @@
|
|
|
100
100
|
"type": "boolean",
|
|
101
101
|
"default": false
|
|
102
102
|
},
|
|
103
|
+
"serverRouting": {
|
|
104
|
+
"description": "Use the Angular Server Routing and App Engine APIs (Developer Preview).",
|
|
105
|
+
"type": "boolean"
|
|
106
|
+
},
|
|
103
107
|
"prefix": {
|
|
104
108
|
"description": "The prefix to use for Angular component and directive selectors.",
|
|
105
109
|
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
"formatter": {
|
|
112
|
+
"description": "The tool to use for code formatting.",
|
|
113
|
+
"type": "string",
|
|
114
|
+
"enum": ["none", "prettier"],
|
|
115
|
+
"default": "none"
|
|
116
|
+
},
|
|
117
|
+
"workspaces": {
|
|
118
|
+
"description": "Whether to use package manager workspaces.",
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"default": false
|
|
106
121
|
}
|
|
107
122
|
},
|
|
108
123
|
"required": ["preset", "name"]
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const typescriptVersion = "~5.
|
|
3
|
-
export declare const angularCliVersion = "~
|
|
2
|
+
export declare const typescriptVersion = "~5.6.2";
|
|
3
|
+
export declare const angularCliVersion = "~19.0.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularCliVersion = exports.typescriptVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.typescriptVersion = '~5.
|
|
5
|
+
exports.typescriptVersion = '~5.6.2';
|
|
6
6
|
// TODO: remove when preset generation is reworked and
|
|
7
7
|
// deps are not installed from workspace
|
|
8
|
-
exports.angularCliVersion = '~
|
|
8
|
+
exports.angularCliVersion = '~19.0.0';
|