@nx/workspace 18.0.0-beta.0 → 18.0.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/workspace",
3
- "version": "18.0.0-beta.0",
3
+ "version": "18.0.0-beta.2",
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": {
@@ -61,13 +61,13 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@nx/devkit": "18.0.0-beta.0",
64
+ "@nx/devkit": "18.0.0-beta.2",
65
65
  "chalk": "^4.1.0",
66
66
  "enquirer": "~2.3.6",
67
67
  "tslib": "^2.3.0",
68
68
  "yargs-parser": "21.1.1",
69
- "nx": "18.0.0-beta.0",
70
- "@nrwl/workspace": "18.0.0-beta.0"
69
+ "nx": "18.0.0-beta.2",
70
+ "@nrwl/workspace": "18.0.0-beta.2"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceCIWorkflow",
4
4
  "title": "Generate a CI workflow.",
5
5
  "description": "Generate a CI workflow.",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceConvertToMonorepo",
4
4
  "cli": "nx",
5
5
  "title": "Nx Convert to Monorepo",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "SchematicsConvertToNxProject",
4
4
  "title": "@nx/workspace:fix-configuration",
5
5
  "description": "Migrates v1 config to v2 standalone configuration.",
@@ -133,7 +133,7 @@ function logDeprecationMessage(formats, options) {
133
133
  ? '@nx/angular:move'
134
134
  : '@nx/workspace:move';
135
135
  devkit_1.logger.warn((0, devkit_1.stripIndents) `
136
- In Nx 18, the project name and destination will no longer be derived.
136
+ In Nx 19, the project name and destination will no longer be derived.
137
137
  Please provide the exact new project name and destination in the future.
138
138
  Example: nx g ${callingGenerator} --projectName ${options.projectName} --destination ${formats['derived'].destination}` +
139
139
  (options.projectName !== formats['derived'].newProjectName
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceMove",
4
4
  "cli": "nx",
5
5
  "title": "Nx Move",
@@ -48,7 +48,7 @@ function createNxJson(tree, { directory, defaultBase, preset }) {
48
48
  affected: {
49
49
  defaultBase,
50
50
  },
51
- targetDefaults: process.env.NX_PCV3 !== 'true'
51
+ targetDefaults: process.env.NX_ADD_PLUGINS === 'false'
52
52
  ? {
53
53
  build: {
54
54
  cache: true,
@@ -69,7 +69,7 @@ function createNxJson(tree, { directory, defaultBase, preset }) {
69
69
  production: ['default'],
70
70
  sharedGlobals: [],
71
71
  };
72
- if (process.env.NX_PCV3 !== 'true') {
72
+ if (process.env.NX_ADD_PLUGINS === 'false') {
73
73
  nxJson.targetDefaults.build.inputs = ['production', '^production'];
74
74
  }
75
75
  }
@@ -13,14 +13,16 @@ async function newGenerator(tree, opts) {
13
13
  await (0, generate_workspace_files_1.generateWorkspaceFiles)(tree, { ...options, nxCloud: undefined });
14
14
  (0, generate_preset_1.addPresetDependencies)(tree, options);
15
15
  return async () => {
16
- const pmc = (0, devkit_1.getPackageManagerCommand)(options.packageManager);
17
- if (pmc.preInstall) {
18
- (0, child_process_1.execSync)(pmc.preInstall, {
19
- cwd: (0, devkit_1.joinPathFragments)(tree.root, options.directory),
20
- stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
21
- });
16
+ if (!options.skipInstall) {
17
+ const pmc = (0, devkit_1.getPackageManagerCommand)(options.packageManager);
18
+ if (pmc.preInstall) {
19
+ (0, child_process_1.execSync)(pmc.preInstall, {
20
+ cwd: (0, devkit_1.joinPathFragments)(tree.root, options.directory),
21
+ stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
22
+ });
23
+ }
24
+ (0, devkit_1.installPackagesTask)(tree, false, options.directory, options.packageManager);
22
25
  }
23
- (0, devkit_1.installPackagesTask)(tree, false, options.directory, options.packageManager);
24
26
  // TODO: move all of these into create-nx-workspace
25
27
  if (options.preset !== presets_1.Preset.NPM && !options.isCustomPreset) {
26
28
  await (0, generate_preset_1.generatePreset)(tree, options);
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceNew",
4
4
  "title": "Create an empty workspace",
5
5
  "description": "Create an empty workspace.",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceNpmPackage",
4
4
  "title": "Add a minimal npm package",
5
5
  "description": "Add a minimal npm package.",
@@ -16,6 +16,7 @@ async function presetGenerator(tree, options) {
16
16
  exports.presetGenerator = presetGenerator;
17
17
  exports.default = presetGenerator;
18
18
  async function createPreset(tree, options) {
19
+ const addPlugin = process.env.NX_ADD_PLUGINS !== 'false';
19
20
  if (options.preset === presets_1.Preset.Apps) {
20
21
  return;
21
22
  }
@@ -32,6 +33,7 @@ async function createPreset(tree, options) {
32
33
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
33
34
  bundler: options.bundler,
34
35
  ssr: options.ssr,
36
+ addPlugin,
35
37
  });
36
38
  }
37
39
  else if (options.preset === presets_1.Preset.AngularStandalone) {
@@ -48,6 +50,7 @@ async function createPreset(tree, options) {
48
50
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
49
51
  bundler: options.bundler,
50
52
  ssr: options.ssr,
53
+ addPlugin,
51
54
  });
52
55
  }
53
56
  else if (options.preset === presets_1.Preset.ReactMonorepo) {
@@ -61,6 +64,7 @@ async function createPreset(tree, options) {
61
64
  linter: options.linter,
62
65
  bundler: options.bundler ?? 'webpack',
63
66
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
67
+ addPlugin,
64
68
  });
65
69
  }
66
70
  else if (options.preset === presets_1.Preset.ReactStandalone) {
@@ -76,6 +80,7 @@ async function createPreset(tree, options) {
76
80
  bundler: options.bundler ?? 'vite',
77
81
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
78
82
  unitTestRunner: options.bundler === 'vite' ? 'vitest' : 'jest',
83
+ addPlugin,
79
84
  });
80
85
  }
81
86
  else if (options.preset === presets_1.Preset.VueMonorepo) {
@@ -88,6 +93,7 @@ async function createPreset(tree, options) {
88
93
  style: options.style,
89
94
  linter: options.linter,
90
95
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
96
+ addPlugin,
91
97
  });
92
98
  }
93
99
  else if (options.preset === presets_1.Preset.VueStandalone) {
@@ -102,6 +108,7 @@ async function createPreset(tree, options) {
102
108
  rootProject: true,
103
109
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
104
110
  unitTestRunner: 'vitest',
111
+ addPlugin,
105
112
  });
106
113
  }
107
114
  else if (options.preset === presets_1.Preset.Nuxt) {
@@ -114,6 +121,7 @@ async function createPreset(tree, options) {
114
121
  style: options.style,
115
122
  linter: options.linter,
116
123
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
124
+ addPlugin,
117
125
  });
118
126
  }
119
127
  else if (options.preset === presets_1.Preset.NuxtStandalone) {
@@ -128,6 +136,7 @@ async function createPreset(tree, options) {
128
136
  rootProject: true,
129
137
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
130
138
  unitTestRunner: 'vitest',
139
+ addPlugin,
131
140
  });
132
141
  }
133
142
  else if (options.preset === presets_1.Preset.NextJs) {
@@ -142,6 +151,7 @@ async function createPreset(tree, options) {
142
151
  appDir: options.nextAppDir,
143
152
  src: options.nextSrcDir,
144
153
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
154
+ addPlugin,
145
155
  });
146
156
  }
147
157
  else if (options.preset === presets_1.Preset.NextJsStandalone) {
@@ -157,6 +167,7 @@ async function createPreset(tree, options) {
157
167
  src: options.nextSrcDir,
158
168
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
159
169
  rootProject: true,
170
+ addPlugin,
160
171
  });
161
172
  }
162
173
  else if (options.preset === presets_1.Preset.WebComponents) {
@@ -170,6 +181,7 @@ async function createPreset(tree, options) {
170
181
  linter: options.linter,
171
182
  bundler: 'vite',
172
183
  e2eTestRunner: options.e2eTestRunner ?? 'cypress',
184
+ addPlugin,
173
185
  });
174
186
  }
175
187
  else if (options.preset === presets_1.Preset.Nest) {
@@ -181,6 +193,7 @@ async function createPreset(tree, options) {
181
193
  projectNameAndRootFormat: 'as-provided',
182
194
  linter: options.linter,
183
195
  e2eTestRunner: options.e2eTestRunner ?? 'jest',
196
+ addPlugin,
184
197
  });
185
198
  }
186
199
  else if (options.preset === presets_1.Preset.Express) {
@@ -191,6 +204,7 @@ async function createPreset(tree, options) {
191
204
  projectNameAndRootFormat: 'as-provided',
192
205
  linter: options.linter,
193
206
  e2eTestRunner: options.e2eTestRunner ?? 'jest',
207
+ addPlugin,
194
208
  });
195
209
  }
196
210
  else if (options.preset === presets_1.Preset.ReactNative) {
@@ -202,6 +216,7 @@ async function createPreset(tree, options) {
202
216
  projectNameAndRootFormat: 'as-provided',
203
217
  linter: options.linter,
204
218
  e2eTestRunner: options.e2eTestRunner ?? 'detox',
219
+ addPlugin,
205
220
  });
206
221
  }
207
222
  else if (options.preset === presets_1.Preset.Expo) {
@@ -212,6 +227,7 @@ async function createPreset(tree, options) {
212
227
  projectNameAndRootFormat: 'as-provided',
213
228
  linter: options.linter,
214
229
  e2eTestRunner: options.e2eTestRunner ?? 'detox',
230
+ addPlugin,
215
231
  });
216
232
  }
217
233
  else if (options.preset === presets_1.Preset.TS) {
@@ -229,6 +245,7 @@ async function createPreset(tree, options) {
229
245
  testEnvironment: 'node',
230
246
  js: options.js,
231
247
  rootProject: true,
248
+ addPlugin,
232
249
  });
233
250
  }
234
251
  else if (options.preset === presets_1.Preset.NodeStandalone) {
@@ -246,6 +263,7 @@ async function createPreset(tree, options) {
246
263
  docker: options.docker,
247
264
  rootProject: true,
248
265
  e2eTestRunner: options.e2eTestRunner ?? 'jest',
266
+ addPlugin,
249
267
  });
250
268
  }
251
269
  else if (options.preset === presets_1.Preset.NodeMonorepo) {
@@ -262,6 +280,7 @@ async function createPreset(tree, options) {
262
280
  docker: options.docker,
263
281
  rootProject: false,
264
282
  e2eTestRunner: options.e2eTestRunner ?? 'jest',
283
+ addPlugin,
265
284
  });
266
285
  }
267
286
  else {
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspacePreset",
4
4
  "cli": "nx",
5
5
  "title": "Creates applications in a new workspace",
@@ -39,11 +39,11 @@
39
39
  },
40
40
  {
41
41
  "value": "scss",
42
- "label": "SASS(.scss) [ http://sass-lang.com ]"
42
+ "label": "SASS(.scss) [ https://sass-lang.com ]"
43
43
  },
44
44
  {
45
45
  "value": "less",
46
- "label": "LESS [ http://lesscss.org ]"
46
+ "label": "LESS [ https://lesscss.org ]"
47
47
  }
48
48
  ]
49
49
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWorkspaceRemove",
4
4
  "cli": "nx",
5
5
  "title": "Nx Remove",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "SchematicsRunCommands",
4
4
  "title": "Create a custom target to run any command",
5
5
  "description": "Create a custom target to run any command.",
@@ -4,7 +4,7 @@ exports.Preset = void 0;
4
4
  var Preset;
5
5
  (function (Preset) {
6
6
  Preset["Apps"] = "apps";
7
- // TODO(v18): Remove Empty and Core presets
7
+ // TODO(v19): Remove Empty and Core presets
8
8
  /** @deprecated Use Apps instead
9
9
  */
10
10
  Preset["Empty"] = "empty";