@nx/workspace 0.0.0-pr-28808-ae8ea8d → 0.0.0-pr-28808-41aa4e0
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/package.json +3 -3
- package/src/generators/new/generate-preset.js +1 -0
- package/src/generators/new/generate-workspace-files.js +5 -4
- package/src/generators/new/new.d.ts +1 -0
- package/src/generators/new/schema.json +5 -0
- package/src/generators/preset/preset.js +5 -5
- package/src/generators/preset/schema.d.ts +1 -0
- package/src/generators/preset/schema.json +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "0.0.0-pr-28808-
|
|
3
|
+
"version": "0.0.0-pr-28808-41aa4e0",
|
|
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": "0.0.0-pr-28808-
|
|
41
|
+
"@nx/devkit": "0.0.0-pr-28808-41aa4e0",
|
|
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": "0.0.0-pr-28808-
|
|
46
|
+
"nx": "0.0.0-pr-28808-41aa4e0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
@@ -71,6 +71,7 @@ function generatePreset(host, opts) {
|
|
|
71
71
|
opts.prefix !== undefined ? `--prefix=${opts.prefix}` : null,
|
|
72
72
|
opts.nxCloudToken ? `--nxCloudToken=${opts.nxCloudToken}` : null,
|
|
73
73
|
opts.formatter ? `--formatter=${opts.formatter}` : null,
|
|
74
|
+
opts.workspaces ? `--workspaces` : null,
|
|
74
75
|
].filter((e) => !!e);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -323,14 +323,15 @@ function normalizeOptions(options) {
|
|
|
323
323
|
}
|
|
324
324
|
function setUpWorkspacesInPackageJson(tree, options) {
|
|
325
325
|
if (options.preset === presets_1.Preset.NPM ||
|
|
326
|
-
(
|
|
327
|
-
|
|
326
|
+
(options.preset === presets_1.Preset.TS &&
|
|
327
|
+
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
328
|
+
process.env.NX_ADD_TS_PLUGIN !== 'false') ||
|
|
329
|
+
((options.preset === presets_1.Preset.Expo ||
|
|
328
330
|
options.preset === presets_1.Preset.NextJs ||
|
|
329
331
|
options.preset === presets_1.Preset.ReactMonorepo ||
|
|
330
332
|
options.preset === presets_1.Preset.ReactNative ||
|
|
331
333
|
options.preset === presets_1.Preset.RemixMonorepo) &&
|
|
332
|
-
|
|
333
|
-
process.env.NX_ADD_TS_PLUGIN !== 'false')) {
|
|
334
|
+
options.workspaces)) {
|
|
334
335
|
const workspaces = options.workspaceGlobs ?? ['packages/*'];
|
|
335
336
|
if (options.packageManager === 'pnpm') {
|
|
336
337
|
tree.write((0, path_1.join)(options.directory, 'pnpm-workspace.yaml'), `packages:
|
|
@@ -65,7 +65,7 @@ async function createPreset(tree, options) {
|
|
|
65
65
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
66
66
|
addPlugin,
|
|
67
67
|
nxCloudToken: options.nxCloudToken,
|
|
68
|
-
useTsSolution:
|
|
68
|
+
useTsSolution: options.workspaces,
|
|
69
69
|
formatter: options.formatter,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
@@ -97,7 +97,7 @@ async function createPreset(tree, options) {
|
|
|
97
97
|
unitTestRunner: 'vitest',
|
|
98
98
|
addPlugin,
|
|
99
99
|
nxCloudToken: options.nxCloudToken,
|
|
100
|
-
useTsSolution:
|
|
100
|
+
useTsSolution: options.workspaces,
|
|
101
101
|
formatter: options.formatter,
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -184,7 +184,7 @@ async function createPreset(tree, options) {
|
|
|
184
184
|
src: options.nextSrcDir,
|
|
185
185
|
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
186
186
|
addPlugin,
|
|
187
|
-
useTsSolution:
|
|
187
|
+
useTsSolution: options.workspaces,
|
|
188
188
|
formatter: options.formatter,
|
|
189
189
|
});
|
|
190
190
|
}
|
|
@@ -250,7 +250,7 @@ async function createPreset(tree, options) {
|
|
|
250
250
|
addPlugin,
|
|
251
251
|
nxCloudToken: options.nxCloudToken,
|
|
252
252
|
bundler: options.bundler ?? 'webpack',
|
|
253
|
-
useTsSolution:
|
|
253
|
+
useTsSolution: options.workspaces,
|
|
254
254
|
formatter: options.formatter,
|
|
255
255
|
});
|
|
256
256
|
}
|
|
@@ -263,7 +263,7 @@ async function createPreset(tree, options) {
|
|
|
263
263
|
e2eTestRunner: options.e2eTestRunner ?? 'detox',
|
|
264
264
|
addPlugin,
|
|
265
265
|
nxCloudToken: options.nxCloudToken,
|
|
266
|
-
useTsSolution:
|
|
266
|
+
useTsSolution: options.workspaces,
|
|
267
267
|
formatter: options.formatter,
|
|
268
268
|
});
|
|
269
269
|
}
|
|
@@ -103,6 +103,17 @@
|
|
|
103
103
|
"prefix": {
|
|
104
104
|
"description": "The prefix to use for Angular component and directive selectors.",
|
|
105
105
|
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"formatter": {
|
|
108
|
+
"description": "The tool to use for code formatting.",
|
|
109
|
+
"type": "string",
|
|
110
|
+
"enum": ["none", "prettier"],
|
|
111
|
+
"default": "none"
|
|
112
|
+
},
|
|
113
|
+
"workspaces": {
|
|
114
|
+
"description": "Whether to use package manager workspaces.",
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": false
|
|
106
117
|
}
|
|
107
118
|
},
|
|
108
119
|
"required": ["preset", "name"]
|