@nx/workspace 23.1.0-pr.36127.e594f53 → 23.1.0-rc.0

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.
@@ -178,13 +178,8 @@ function createNxJson(tree, { directory, defaultBase, preset, analytics }) {
178
178
  defaultBase,
179
179
  targetDefaults: process.env.NX_ADD_PLUGINS === 'false'
180
180
  ? {
181
- build: {
182
- cache: true,
183
- dependsOn: ['^build'],
184
- },
185
- lint: {
186
- cache: true,
187
- },
181
+ build: { cache: true, dependsOn: ['^build'] },
182
+ lint: { cache: true },
188
183
  }
189
184
  : undefined,
190
185
  analytics,
@@ -199,7 +194,10 @@ function createNxJson(tree, { directory, defaultBase, preset, analytics }) {
199
194
  sharedGlobals: [],
200
195
  };
201
196
  if (process.env.NX_ADD_PLUGINS === 'false') {
202
- nxJson.targetDefaults.build.inputs = ['production', '^production'];
197
+ const build = nxJson.targetDefaults?.build;
198
+ if (build && !Array.isArray(build)) {
199
+ build.inputs = ['production', '^production'];
200
+ }
203
201
  nxJson.useInferencePlugins = false;
204
202
  }
205
203
  }
@@ -33,6 +33,7 @@ interface Schema {
33
33
  workspaceGlobs?: string | string[];
34
34
  useProjectJson?: boolean;
35
35
  aiAgents?: Agent[] | Agent;
36
+ skipEmptyDirCheck?: boolean;
36
37
  }
37
38
  export interface NormalizedSchema extends Schema {
38
39
  presetVersion?: string;
@@ -49,7 +49,8 @@ function validateOptions(options, host) {
49
49
  !options.framework) {
50
50
  throw new Error(`Cannot generate ${options.preset} without selecting a framework`);
51
51
  }
52
- if (host.exists(options.name) &&
52
+ if (!options.skipEmptyDirCheck &&
53
+ host.exists(options.name) &&
53
54
  !host.isFile(options.name) &&
54
55
  host.children(options.name).length > 0) {
55
56
  throw new Error(`${(0, path_1.join)(host.root, options.name)} is not an empty directory.`);
@@ -109,6 +109,12 @@
109
109
  "useProjectJson": {
110
110
  "type": "boolean",
111
111
  "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
112
+ },
113
+ "skipEmptyDirCheck": {
114
+ "type": "boolean",
115
+ "description": "Skip the check that the target directory is empty. Used internally by create-nx-workspace when scaffolding into the current directory.",
116
+ "default": false,
117
+ "x-priority": "internal"
112
118
  }
113
119
  },
114
120
  "additionalProperties": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/workspace",
3
- "version": "23.1.0-pr.36127.e594f53",
3
+ "version": "23.1.0-rc.0",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -85,11 +85,11 @@
85
85
  "semver": "^7.6.3",
86
86
  "tslib": "^2.3.0",
87
87
  "yargs-parser": "21.1.1",
88
- "nx": "23.1.0-pr.36127.e594f53",
89
- "@nx/devkit": "23.1.0-pr.36127.e594f53"
88
+ "nx": "23.1.0-rc.0",
89
+ "@nx/devkit": "23.1.0-rc.0"
90
90
  },
91
91
  "devDependencies": {
92
- "nx": "23.1.0-pr.36127.e594f53"
92
+ "nx": "23.1.0-rc.0"
93
93
  },
94
94
  "publishConfig": {
95
95
  "access": "public"