nx 22.6.0 → 22.7.0-beta.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.
- package/bin/nx.js +11 -6
- package/migrations.json +6 -0
- package/package.json +11 -11
- package/src/adapter/ngcli-adapter.d.ts +8 -5
- package/src/adapter/ngcli-adapter.d.ts.map +1 -1
- package/src/adapter/ngcli-adapter.js +29 -15
- package/src/command-line/examples.d.ts +7 -0
- package/src/command-line/examples.d.ts.map +1 -1
- package/src/command-line/examples.js +29 -1
- package/src/command-line/generate/generate.d.ts.map +1 -1
- package/src/command-line/generate/generate.js +1 -1
- package/src/command-line/init/command-object.js +1 -21
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts.map +1 -1
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +6 -1
- package/src/command-line/init/implementation/utils.d.ts +1 -2
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +0 -14
- package/src/command-line/init/init-v1.d.ts +0 -3
- package/src/command-line/init/init-v1.d.ts.map +1 -1
- package/src/command-line/init/init-v1.js +0 -26
- package/src/command-line/init/init-v2.d.ts +0 -1
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +7 -35
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +11 -9
- package/src/command-line/nx-commands.js +65 -65
- package/src/command-line/run/run.d.ts.map +1 -1
- package/src/command-line/run/run.js +1 -1
- package/src/daemon/client/client.d.ts +1 -1
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +2 -1
- package/src/daemon/server/handle-hash-tasks.d.ts +1 -0
- package/src/daemon/server/handle-hash-tasks.d.ts.map +1 -1
- package/src/daemon/server/handle-hash-tasks.js +1 -1
- package/src/executors/run-commands/run-commands.impl.d.ts.map +1 -1
- package/src/executors/run-commands/run-commands.impl.js +60 -7
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +0 -4
- package/src/hasher/native-task-hasher-impl.d.ts +2 -2
- package/src/hasher/native-task-hasher-impl.d.ts.map +1 -1
- package/src/hasher/native-task-hasher-impl.js +6 -6
- package/src/hasher/task-hasher.d.ts +4 -4
- package/src/hasher/task-hasher.d.ts.map +1 -1
- package/src/hasher/task-hasher.js +9 -6
- package/src/migrations/update-22-2-0/add-self-healing-to-gitignore.d.ts +3 -0
- package/src/migrations/update-22-2-0/add-self-healing-to-gitignore.d.ts.map +1 -0
- package/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +19 -0
- package/src/tasks-runner/task-orchestrator.d.ts +4 -2
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +59 -32
- package/src/utils/package-manager.d.ts.map +1 -1
- package/src/utils/package-manager.js +8 -13
- package/src/utils/serialize-overrides-into-command-line.d.ts.map +1 -1
- package/src/utils/serialize-overrides-into-command-line.js +3 -4
- package/src/utils/shell-quoting.d.ts +11 -0
- package/src/utils/shell-quoting.d.ts.map +1 -0
- package/src/utils/shell-quoting.js +41 -0
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +0 -21
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +0 -20
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +0 -17
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +0 -20
- package/src/command-line/init/implementation/react/clean-up-files.d.ts +0 -2
- package/src/command-line/init/implementation/react/clean-up-files.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/clean-up-files.js +0 -30
- package/src/command-line/init/implementation/react/index.d.ts +0 -5
- package/src/command-line/init/implementation/react/index.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/index.js +0 -77
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts +0 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +0 -16
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts +0 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +0 -22
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/tsconfig-setup.js +0 -108
- package/src/command-line/init/implementation/react/write-vite-config.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-config.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-config.js +0 -53
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-index-html.js +0 -24
package/bin/nx.js
CHANGED
|
@@ -76,23 +76,21 @@ async function main() {
|
|
|
76
76
|
if (!localNx && !isNxCloudCommand(process.argv[2])) {
|
|
77
77
|
handleMissingLocalInstallation(workspace ? workspace.dir : null);
|
|
78
78
|
}
|
|
79
|
-
// Prompt for analytics preference if not set
|
|
80
|
-
try {
|
|
81
|
-
await (0, analytics_prompt_1.ensureAnalyticsPreferenceSet)();
|
|
82
|
-
}
|
|
83
|
-
catch { }
|
|
84
|
-
await (0, analytics_1.startAnalytics)();
|
|
85
79
|
// this file is already in the local workspace
|
|
86
80
|
if (isNxCloudCommand(process.argv[2])) {
|
|
81
|
+
await initAnalytics();
|
|
87
82
|
// nx-cloud commands can run without local Nx installation
|
|
88
83
|
process.env.NX_DAEMON = 'false';
|
|
89
84
|
require('nx/src/command-line/nx-commands').commandsObject.argv;
|
|
90
85
|
}
|
|
91
86
|
else if (isLocalInstall) {
|
|
87
|
+
await initAnalytics();
|
|
92
88
|
await (0, init_local_1.initLocal)(workspace);
|
|
93
89
|
}
|
|
94
90
|
else if (localNx) {
|
|
95
91
|
// Nx is being run from globally installed CLI - hand off to the local
|
|
92
|
+
// Don't start analytics or connect to the DB here — the local Nx
|
|
93
|
+
// will handle it when it runs its own bin/nx.ts
|
|
96
94
|
warnIfUsingOutdatedGlobalInstall(GLOBAL_NX_VERSION, LOCAL_NX_VERSION);
|
|
97
95
|
if (localNx.includes('.nx')) {
|
|
98
96
|
const nxWrapperPath = localNx.replace(/\.nx.*/, '.nx/') + 'nxw.js';
|
|
@@ -169,6 +167,13 @@ function isNxCloudCommand(command) {
|
|
|
169
167
|
];
|
|
170
168
|
return nxCloudCommands.includes(command);
|
|
171
169
|
}
|
|
170
|
+
async function initAnalytics() {
|
|
171
|
+
try {
|
|
172
|
+
await (0, analytics_prompt_1.ensureAnalyticsPreferenceSet)();
|
|
173
|
+
}
|
|
174
|
+
catch { }
|
|
175
|
+
await (0, analytics_1.startAnalytics)();
|
|
176
|
+
}
|
|
172
177
|
function handleMissingLocalInstallation(detectedWorkspaceRoot) {
|
|
173
178
|
output_1.output.error({
|
|
174
179
|
title: detectedWorkspaceRoot
|
package/migrations.json
CHANGED
|
@@ -160,6 +160,12 @@
|
|
|
160
160
|
"version": "22.6.0-beta.11",
|
|
161
161
|
"description": "Prompts to enable usage analytics",
|
|
162
162
|
"implementation": "./src/migrations/update-22-6-0/enable-analytics-prompt"
|
|
163
|
+
},
|
|
164
|
+
"22-7-0-add-self-healing-to-gitignore": {
|
|
165
|
+
"cli": "nx",
|
|
166
|
+
"version": "22.7.0-beta.0",
|
|
167
|
+
"description": "Adds .nx/self-healing to .gitignore",
|
|
168
|
+
"implementation": "./src/migrations/update-22-2-0/add-self-healing-to-gitignore"
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
171
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.7.0-beta.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
6
6
|
"repository": {
|
|
@@ -85,16 +85,16 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"optionalDependencies": {
|
|
88
|
-
"@nx/nx-darwin-arm64": "22.
|
|
89
|
-
"@nx/nx-darwin-x64": "22.
|
|
90
|
-
"@nx/nx-freebsd-x64": "22.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "22.
|
|
92
|
-
"@nx/nx-linux-arm64-gnu": "22.
|
|
93
|
-
"@nx/nx-linux-arm64-musl": "22.
|
|
94
|
-
"@nx/nx-linux-x64-gnu": "22.
|
|
95
|
-
"@nx/nx-linux-x64-musl": "22.
|
|
96
|
-
"@nx/nx-win32-arm64-msvc": "22.
|
|
97
|
-
"@nx/nx-win32-x64-msvc": "22.
|
|
88
|
+
"@nx/nx-darwin-arm64": "22.7.0-beta.0",
|
|
89
|
+
"@nx/nx-darwin-x64": "22.7.0-beta.0",
|
|
90
|
+
"@nx/nx-freebsd-x64": "22.7.0-beta.0",
|
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "22.7.0-beta.0",
|
|
92
|
+
"@nx/nx-linux-arm64-gnu": "22.7.0-beta.0",
|
|
93
|
+
"@nx/nx-linux-arm64-musl": "22.7.0-beta.0",
|
|
94
|
+
"@nx/nx-linux-x64-gnu": "22.7.0-beta.0",
|
|
95
|
+
"@nx/nx-linux-x64-musl": "22.7.0-beta.0",
|
|
96
|
+
"@nx/nx-win32-arm64-msvc": "22.7.0-beta.0",
|
|
97
|
+
"@nx/nx-win32-x64-msvc": "22.7.0-beta.0"
|
|
98
98
|
},
|
|
99
99
|
"nx-migrations": {
|
|
100
100
|
"migrations": "./migrations.json",
|
|
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import type { GenerateOptions } from '../command-line/generate/generate';
|
|
5
5
|
import { ProjectConfiguration } from '../config/workspace-json-project-json';
|
|
6
6
|
import { Tree } from '../generators/tree';
|
|
7
|
+
import type { ProjectGraph } from '../config/project-graph';
|
|
7
8
|
import { ExecutorContext, GeneratorCallback } from '../config/misc-interfaces';
|
|
8
9
|
export declare function createBuilderContext(builderInfo: {
|
|
9
10
|
builderName: string;
|
|
@@ -16,13 +17,14 @@ export declare function scheduleTarget(root: string, opts: {
|
|
|
16
17
|
configuration: string;
|
|
17
18
|
runOptions: any;
|
|
18
19
|
projects: Record<string, ProjectConfiguration>;
|
|
19
|
-
}, verbose: boolean): Promise<Observable<import('@angular-devkit/architect').BuilderOutput>>;
|
|
20
|
+
}, verbose: boolean, projectGraph: ProjectGraph): Promise<Observable<import('@angular-devkit/architect').BuilderOutput>>;
|
|
20
21
|
type AngularProjectConfiguration = ProjectConfiguration & {
|
|
21
22
|
prefix?: string;
|
|
22
23
|
};
|
|
23
24
|
export declare class NxScopedHost extends virtualFs.ScopedHost<any> {
|
|
24
25
|
private root;
|
|
25
|
-
|
|
26
|
+
protected _projectGraph?: ProjectGraph;
|
|
27
|
+
constructor(root: string, _projectGraph?: ProjectGraph);
|
|
26
28
|
read(path: Path): Observable<FileBuffer>;
|
|
27
29
|
protected readMergedWorkspaceConfiguration(): Observable<any>;
|
|
28
30
|
write(path: Path, content: FileBuffer): Observable<void>;
|
|
@@ -37,6 +39,7 @@ export declare class NxScopedHost extends virtualFs.ScopedHost<any> {
|
|
|
37
39
|
* the project graph to access the expanded targets.
|
|
38
40
|
*/
|
|
39
41
|
export declare class NxScopedHostForBuilders extends NxScopedHost {
|
|
42
|
+
constructor(root: string, projectGraph: ProjectGraph);
|
|
40
43
|
protected readMergedWorkspaceConfiguration(): Observable<any>;
|
|
41
44
|
}
|
|
42
45
|
export declare function arrayBufferToString(buffer: any): string;
|
|
@@ -46,15 +49,15 @@ export declare function arrayBufferToString(buffer: any): string;
|
|
|
46
49
|
*/
|
|
47
50
|
export declare class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
|
|
48
51
|
private readonly host;
|
|
49
|
-
constructor(root: string, host: Tree);
|
|
52
|
+
constructor(root: string, host: Tree, projectGraph: ProjectGraph);
|
|
50
53
|
read(path: Path): Observable<FileBuffer>;
|
|
51
54
|
exists(path: Path): Observable<boolean>;
|
|
52
55
|
isDirectory(path: Path): Observable<boolean>;
|
|
53
56
|
isFile(path: Path): Observable<boolean>;
|
|
54
57
|
list(path: Path): Observable<PathFragment[]>;
|
|
55
58
|
}
|
|
56
|
-
export declare function generate(root: string, opts: GenerateOptions, projects: Record<string, ProjectConfiguration>, verbose: boolean): Promise<number>;
|
|
57
|
-
export declare function runMigration(root: string, packageName: string, migrationName: string, projects: Record<string, ProjectConfiguration>, isVerbose: boolean): Promise<{
|
|
59
|
+
export declare function generate(root: string, opts: GenerateOptions, projects: Record<string, ProjectConfiguration>, verbose: boolean, projectGraph: ProjectGraph): Promise<number>;
|
|
60
|
+
export declare function runMigration(root: string, packageName: string, migrationName: string, projects: Record<string, ProjectConfiguration>, isVerbose: boolean, projectGraph: ProjectGraph): Promise<{
|
|
58
61
|
loggingQueue: string[];
|
|
59
62
|
madeChanges: boolean;
|
|
60
63
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngcli-adapter.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/adapter/ngcli-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,E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AAM,IAcnB,MAAM,IAAI,EACV,kBAAkB;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,KACrC,OAAO,CAAC,iBAAiB,CAAC,CAwG9B;AAID,eAAO,MAAM,SAAS,GAAI,mBAAiB,KAAG,OAAO,CAAC,MAqBrD,CAAC;AA2MF;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,EACxE,UAAU,EAAE,CAAC,EACb,eAAe,EAAE,CAAC,EAClB,OAAO,EAAE,oBAAoB,GAC5B,CAAC,CAkDH"}
|
|
@@ -30,9 +30,17 @@ const executor_utils_1 = require("../command-line/run/executor-utils");
|
|
|
30
30
|
const plugins_1 = require("../project-graph/plugins");
|
|
31
31
|
const schema_utils_1 = require("../config/schema-utils");
|
|
32
32
|
const project_configuration_utils_1 = require("../project-graph/utils/project-configuration-utils");
|
|
33
|
+
function getProjectGraph() {
|
|
34
|
+
try {
|
|
35
|
+
return Promise.resolve((0, project_graph_1.readCachedProjectGraph)());
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return (0, project_graph_1.createProjectGraphAsync)();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
33
41
|
async function createBuilderContext(builderInfo, context) {
|
|
34
42
|
require('./compat');
|
|
35
|
-
const fsHost = new NxScopedHostForBuilders(context.root);
|
|
43
|
+
const fsHost = new NxScopedHostForBuilders(context.root, context.projectGraph);
|
|
36
44
|
// the top level import is not patched because it is imported before the
|
|
37
45
|
// patching happens so we require it here to use the patched version below
|
|
38
46
|
const { workspaces } = require('@angular-devkit/core');
|
|
@@ -120,10 +128,10 @@ async function createBuilderContext(builderInfo, context) {
|
|
|
120
128
|
};
|
|
121
129
|
return builderContext;
|
|
122
130
|
}
|
|
123
|
-
async function scheduleTarget(root, opts, verbose) {
|
|
131
|
+
async function scheduleTarget(root, opts, verbose, projectGraph) {
|
|
124
132
|
const { Architect } = require('@angular-devkit/architect');
|
|
125
133
|
const logger = (0, exports.getLogger)(verbose);
|
|
126
|
-
const fsHost = new NxScopedHostForBuilders(root);
|
|
134
|
+
const fsHost = new NxScopedHostForBuilders(root, projectGraph);
|
|
127
135
|
const { workspace } = await core_1.workspaces.readWorkspace('angular.json', core_1.workspaces.createWorkspaceHost(fsHost));
|
|
128
136
|
const architectHost = await getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, opts.projects);
|
|
129
137
|
const project = workspace.projects.get(opts.project);
|
|
@@ -269,21 +277,24 @@ async function runSchematic(host, root, workflow, logger, opts, schematic, print
|
|
|
269
277
|
return { status: 0, loggingQueue: record.loggingQueue };
|
|
270
278
|
}
|
|
271
279
|
class NxScopedHost extends core_1.virtualFs.ScopedHost {
|
|
272
|
-
constructor(root) {
|
|
280
|
+
constructor(root, _projectGraph) {
|
|
273
281
|
super(new node_1.NodeJsSyncHost(), (0, core_1.normalize)(root));
|
|
274
282
|
this.root = root;
|
|
283
|
+
this._projectGraph = _projectGraph;
|
|
275
284
|
}
|
|
276
285
|
read(path) {
|
|
277
286
|
if ((path === 'angular.json' || path === '/angular.json') &&
|
|
278
287
|
(0, angular_json_1.isAngularPluginInstalled)()) {
|
|
279
|
-
return this.readMergedWorkspaceConfiguration().pipe(
|
|
288
|
+
return this.readMergedWorkspaceConfiguration().pipe(
|
|
289
|
+
// structuredClone to avoid toOldFormat mutating shared graph objects
|
|
290
|
+
(0, operators_1.map)((r) => stringToArrayBuffer(JSON.stringify((0, angular_json_1.toOldFormat)(structuredClone(r))))));
|
|
280
291
|
}
|
|
281
292
|
else {
|
|
282
293
|
return super.read(path);
|
|
283
294
|
}
|
|
284
295
|
}
|
|
285
296
|
readMergedWorkspaceConfiguration() {
|
|
286
|
-
return (0, rxjs_1.zip)((0, rxjs_1.
|
|
297
|
+
return (0, rxjs_1.zip)(this._projectGraph ? (0, rxjs_1.of)(this._projectGraph) : (0, rxjs_1.from)(getProjectGraph()), this.readExistingAngularJson(), this.readJson('nx.json')).pipe((0, operators_1.concatMap)(([graph, angularJson, nxJson]) => {
|
|
287
298
|
const workspaceConfig = (angularJson || { projects: {} });
|
|
288
299
|
workspaceConfig.cli ??= nxJson.cli;
|
|
289
300
|
workspaceConfig.schematics ??= nxJson.generators;
|
|
@@ -437,8 +448,11 @@ exports.NxScopedHost = NxScopedHost;
|
|
|
437
448
|
* the project graph to access the expanded targets.
|
|
438
449
|
*/
|
|
439
450
|
class NxScopedHostForBuilders extends NxScopedHost {
|
|
451
|
+
constructor(root, projectGraph) {
|
|
452
|
+
super(root, projectGraph);
|
|
453
|
+
}
|
|
440
454
|
readMergedWorkspaceConfiguration() {
|
|
441
|
-
return (0, rxjs_1.zip)((0, rxjs_1.
|
|
455
|
+
return (0, rxjs_1.zip)((0, rxjs_1.of)(this._projectGraph), this.readExistingAngularJson(), this.readJson('nx.json')).pipe((0, operators_1.map)(([graph, angularJson, nxJson]) => {
|
|
442
456
|
const workspaceConfig = (angularJson || { projects: {} });
|
|
443
457
|
workspaceConfig.cli ??= nxJson.cli;
|
|
444
458
|
workspaceConfig.schematics ??= nxJson.generators;
|
|
@@ -472,8 +486,8 @@ function arrayBufferToString(buffer) {
|
|
|
472
486
|
* the project configuration files.
|
|
473
487
|
*/
|
|
474
488
|
class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
|
|
475
|
-
constructor(root, host) {
|
|
476
|
-
super(root);
|
|
489
|
+
constructor(root, host, projectGraph) {
|
|
490
|
+
super(root, projectGraph);
|
|
477
491
|
this.host = host;
|
|
478
492
|
}
|
|
479
493
|
read(path) {
|
|
@@ -566,9 +580,9 @@ function findMatchingFileChange(host, path) {
|
|
|
566
580
|
.listChanges()
|
|
567
581
|
.find((f) => f.type !== 'DELETE' && (0, core_1.normalize)(f.path) === targetPath);
|
|
568
582
|
}
|
|
569
|
-
async function generate(root, opts, projects, verbose) {
|
|
583
|
+
async function generate(root, opts, projects, verbose, projectGraph) {
|
|
570
584
|
const logger = (0, exports.getLogger)(verbose);
|
|
571
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, verbose, `ng-cli generator: ${opts.collectionName}:${opts.generatorName}`));
|
|
585
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, verbose, `ng-cli generator: ${opts.collectionName}:${opts.generatorName}`), projectGraph);
|
|
572
586
|
const workflow = createWorkflow(fsHost, root, opts, projects);
|
|
573
587
|
const collection = getCollection(workflow, opts.collectionName);
|
|
574
588
|
const schematic = collection.createSchematic(opts.generatorName, true);
|
|
@@ -623,9 +637,9 @@ function createPromptProvider() {
|
|
|
623
637
|
return require('enquirer').prompt(questions);
|
|
624
638
|
};
|
|
625
639
|
}
|
|
626
|
-
async function runMigration(root, packageName, migrationName, projects, isVerbose) {
|
|
640
|
+
async function runMigration(root, packageName, migrationName, projects, isVerbose, projectGraph) {
|
|
627
641
|
const logger = (0, exports.getLogger)(isVerbose);
|
|
628
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, isVerbose, `ng-cli migration: ${packageName}:${migrationName}`));
|
|
642
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, isVerbose, `ng-cli migration: ${packageName}:${migrationName}`), projectGraph);
|
|
629
643
|
const workflow = createWorkflow(fsHost, root, {}, projects);
|
|
630
644
|
const collection = resolveMigrationsCollection(packageName);
|
|
631
645
|
const record = { loggingQueue: [], error: false };
|
|
@@ -713,7 +727,7 @@ function wrapAngularDevkitSchematic(collectionName, generatorName) {
|
|
|
713
727
|
// were written with Nx in mind, and may care about tags.
|
|
714
728
|
require('./compat');
|
|
715
729
|
return async (host, generatorOptions) => {
|
|
716
|
-
const graph = await (
|
|
730
|
+
const graph = await getProjectGraph();
|
|
717
731
|
const { projects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(graph);
|
|
718
732
|
if (mockedSchematics &&
|
|
719
733
|
mockedSchematics[`${collectionName}:${generatorName}`]) {
|
|
@@ -744,7 +758,7 @@ function wrapAngularDevkitSchematic(collectionName, generatorName) {
|
|
|
744
758
|
host.rename(eventPath, event.to);
|
|
745
759
|
}
|
|
746
760
|
};
|
|
747
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(host.root, host);
|
|
761
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(host.root, host, graph);
|
|
748
762
|
const logger = (0, exports.getLogger)(generatorOptions.verbose);
|
|
749
763
|
const options = {
|
|
750
764
|
generatorOptions,
|
|
@@ -2,5 +2,12 @@ export interface Example {
|
|
|
2
2
|
command: string;
|
|
3
3
|
description: string;
|
|
4
4
|
}
|
|
5
|
+
export interface CliDocsCommandMetadata {
|
|
6
|
+
supportedVersionRange?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Docs-only metadata keyed by the full command name as rendered in the CLI docs.
|
|
10
|
+
*/
|
|
11
|
+
export declare const cliDocsCommandMetadata: Record<string, CliDocsCommandMetadata>;
|
|
5
12
|
export declare const examples: Record<string, Example[]>;
|
|
6
13
|
//# sourceMappingURL=examples.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/examples.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/examples.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAIzE,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CA8d9C,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.examples = void 0;
|
|
3
|
+
exports.examples = exports.cliDocsCommandMetadata = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Docs-only metadata keyed by the full command name as rendered in the CLI docs.
|
|
6
|
+
*/
|
|
7
|
+
exports.cliDocsCommandMetadata = {
|
|
8
|
+
'show target': {
|
|
9
|
+
supportedVersionRange: 'Nx 22.6+',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
4
12
|
exports.examples = {
|
|
5
13
|
affected: [
|
|
6
14
|
{
|
|
@@ -343,6 +351,26 @@ exports.examples = {
|
|
|
343
351
|
command: 'show project my-app --web',
|
|
344
352
|
description: 'Opens a web browser to explore the configuration of "my-app"',
|
|
345
353
|
},
|
|
354
|
+
{
|
|
355
|
+
command: 'show target my-app:build',
|
|
356
|
+
description: 'Prints the specified + inferred configuration for `my-app:build`',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
command: 'show target my-app:build inputs',
|
|
360
|
+
description: 'Prints the resolved inputs for `my-app:build`',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
command: 'show target my-app:build inputs --check packages/my-app/index.html',
|
|
364
|
+
description: 'Checks if `packages/my-app/index.html` is an input for `my-app:build`',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
command: 'show target my-app:build outputs',
|
|
368
|
+
description: 'Prints the outputs detected on disk for `my-app:build`',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
command: 'show target my-app:build outputs --check packages/my-app/dist/index.html',
|
|
372
|
+
description: 'Checks if `packages/my-app/dist/index.html` is an output for `my-app:build`',
|
|
373
|
+
},
|
|
346
374
|
],
|
|
347
375
|
watch: [
|
|
348
376
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/generate/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAMzE,OAAO,EAEL,OAAO,EACP,MAAM,EACP,MAAM,oBAAoB,CAAC;AAW5B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,QAUrD;AAwJD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAaA;AAmED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE,MAAM,EAAE,QAelB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/generate/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAMzE,OAAO,EAEL,OAAO,EACP,MAAM,EACP,MAAM,oBAAoB,CAAC;AAW5B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,QAUrD;AAwJD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAaA;AAmED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE,MAAM,EAAE,QAelB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,mBA2HxD"}
|
|
@@ -260,7 +260,7 @@ async function generate(args) {
|
|
|
260
260
|
return (await Promise.resolve().then(() => require('../../adapter/ngcli-adapter'))).generate(workspace_root_1.workspaceRoot, {
|
|
261
261
|
...opts,
|
|
262
262
|
generatorOptions: combinedOpts,
|
|
263
|
-
}, projectsConfigurations.projects, args.verbose);
|
|
263
|
+
}, projectsConfigurations.projects, args.verbose, projectGraph);
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
}
|
|
@@ -77,11 +77,6 @@ async function withInitOptions(yargs) {
|
|
|
77
77
|
type: 'boolean',
|
|
78
78
|
description: 'Initialize an Nx workspace setup in the .nx directory of the current repository.',
|
|
79
79
|
default: false,
|
|
80
|
-
})
|
|
81
|
-
.option('force', {
|
|
82
|
-
describe: 'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.',
|
|
83
|
-
type: 'boolean',
|
|
84
|
-
default: false,
|
|
85
80
|
})
|
|
86
81
|
.option('aiAgents', {
|
|
87
82
|
type: 'array',
|
|
@@ -112,28 +107,13 @@ async function withInitOptions(yargs) {
|
|
|
112
107
|
})
|
|
113
108
|
.option('integrated', {
|
|
114
109
|
type: 'boolean',
|
|
115
|
-
description: 'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces
|
|
116
|
-
default: false,
|
|
117
|
-
})
|
|
118
|
-
.option('addE2e', {
|
|
119
|
-
describe: 'Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.',
|
|
120
|
-
type: 'boolean',
|
|
110
|
+
description: 'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces.',
|
|
121
111
|
default: false,
|
|
122
112
|
})
|
|
123
113
|
.option('useDotNxInstallation', {
|
|
124
114
|
type: 'boolean',
|
|
125
115
|
description: 'Initialize an Nx workspace setup in the .nx directory of the current repository.',
|
|
126
116
|
default: false,
|
|
127
|
-
})
|
|
128
|
-
.option('force', {
|
|
129
|
-
describe: 'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.',
|
|
130
|
-
type: 'boolean',
|
|
131
|
-
default: false,
|
|
132
|
-
})
|
|
133
|
-
.option('vite', {
|
|
134
|
-
type: 'boolean',
|
|
135
|
-
description: 'Use Vite as the bundler. Only for CRA projects.',
|
|
136
|
-
default: true,
|
|
137
117
|
})
|
|
138
118
|
.option('cacheable', {
|
|
139
119
|
type: 'string',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-nx-scripts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/command-line/init/implementation/dot-nx/add-nx-scripts.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,IAAI,EACL,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,aAAa,GAAI,IAAG,cAAc,MAAM,CAAQ,WACpC,CAAC;AAuC1B,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,QAelD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAOrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAQ7D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"add-nx-scripts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/command-line/init/implementation/dot-nx/add-nx-scripts.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,IAAI,EACL,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,aAAa,GAAI,IAAG,cAAc,MAAM,CAAQ,WACpC,CAAC;AAuC1B,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,QAelD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAOrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAQ7D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,QAazC;AAGD,wBAAgB,oBAAoB,WAInC;AAGD,wBAAgB,sBAAsB,WAErC;AAGD,wBAAgB,sBAAsB,WAErC;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,UAWlD"}
|
|
@@ -84,7 +84,12 @@ function writeMinimalNxJson(host, version) {
|
|
|
84
84
|
}
|
|
85
85
|
function updateGitIgnore(host) {
|
|
86
86
|
let contents = host.read('.gitignore', 'utf-8') ?? '';
|
|
87
|
-
[
|
|
87
|
+
[
|
|
88
|
+
'.nx/installation',
|
|
89
|
+
'.nx/cache',
|
|
90
|
+
'.nx/workspace-data',
|
|
91
|
+
'.nx/self-healing',
|
|
92
|
+
].forEach((file) => {
|
|
88
93
|
if (!contents.includes(file)) {
|
|
89
94
|
contents = [contents, file].join('\n');
|
|
90
95
|
}
|
|
@@ -8,7 +8,7 @@ export declare function createNxJsonFromTurboJson(turboJson: Record<string, any>
|
|
|
8
8
|
export declare function addDepsToPackageJson(repoRoot: string, additionalPackages?: string[]): void;
|
|
9
9
|
export declare function updateGitIgnore(root: string): void;
|
|
10
10
|
export declare function runInstall(repoRoot: string, pmc?: PackageManagerCommands): void;
|
|
11
|
-
export declare function initCloud(installationSource: 'nx-init' | 'nx-init-angular' | 'nx-init-
|
|
11
|
+
export declare function initCloud(installationSource: 'nx-init' | 'nx-init-angular' | 'nx-init-monorepo' | 'nx-init-nest' | 'nx-init-npm-repo' | 'nx-init-turborepo'): Promise<void>;
|
|
12
12
|
export declare function addVsCodeRecommendedExtensions(repoRoot: string, extensions: string[]): void;
|
|
13
13
|
export declare function markRootPackageJsonAsNxProjectLegacy(repoRoot: string, cacheableScripts: string[], pmc: PackageManagerCommands): void;
|
|
14
14
|
export declare function markPackageJsonAsNxProject(packageJsonPath: string): void;
|
|
@@ -17,5 +17,4 @@ export declare function printFinalMessage({ learnMoreLink, appendLines, }: {
|
|
|
17
17
|
appendLines?: string[];
|
|
18
18
|
}): void;
|
|
19
19
|
export declare function isMonorepo(packageJson: PackageJson): boolean;
|
|
20
|
-
export declare function isCRA(packageJson: PackageJson): boolean;
|
|
21
20
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAO9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AASxC,wBAAgB,gBAAgB,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|
|
12
12
|
exports.printFinalMessage = printFinalMessage;
|
|
13
13
|
exports.isMonorepo = isMonorepo;
|
|
14
|
-
exports.isCRA = isCRA;
|
|
15
14
|
const child_process_1 = require("child_process");
|
|
16
15
|
const path_1 = require("path");
|
|
17
16
|
const fileutils_1 = require("../../../utils/fileutils");
|
|
@@ -271,16 +270,3 @@ function isMonorepo(packageJson) {
|
|
|
271
270
|
return true;
|
|
272
271
|
return false;
|
|
273
272
|
}
|
|
274
|
-
function isCRA(packageJson) {
|
|
275
|
-
const combinedDependencies = {
|
|
276
|
-
...packageJson.dependencies,
|
|
277
|
-
...packageJson.devDependencies,
|
|
278
|
-
};
|
|
279
|
-
return (
|
|
280
|
-
// Required dependencies for CRA projects
|
|
281
|
-
combinedDependencies['react'] &&
|
|
282
|
-
combinedDependencies['react-dom'] &&
|
|
283
|
-
combinedDependencies['react-scripts'] &&
|
|
284
|
-
(0, fileutils_1.directoryExists)('src') &&
|
|
285
|
-
(0, fileutils_1.directoryExists)('public'));
|
|
286
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-v1.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v1.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,
|
|
1
|
+
{"version":3,"file":"init-v1.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v1.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,QAAQ,iBAiElD"}
|
|
@@ -10,7 +10,6 @@ const add_nx_to_nest_1 = require("./implementation/add-nx-to-nest");
|
|
|
10
10
|
const add_nx_to_npm_repo_1 = require("./implementation/add-nx-to-npm-repo");
|
|
11
11
|
const angular_1 = require("./implementation/angular");
|
|
12
12
|
const add_nx_scripts_1 = require("./implementation/dot-nx/add-nx-scripts");
|
|
13
|
-
const react_1 = require("./implementation/react");
|
|
14
13
|
const child_process_2 = require("../../utils/child-process");
|
|
15
14
|
const fileutils_1 = require("../../utils/fileutils");
|
|
16
15
|
const versions_1 = require("../../utils/versions");
|
|
@@ -34,15 +33,6 @@ async function initHandler(options) {
|
|
|
34
33
|
});
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
37
|
-
else if (isCRA(packageJson)) {
|
|
38
|
-
await (0, react_1.addNxToCraRepo)(options);
|
|
39
|
-
(0, utils_1.printFinalMessage)({
|
|
40
|
-
learnMoreLink: options.integrated
|
|
41
|
-
? 'https://nx.dev/getting-started/tutorials/react-monorepo-tutorial'
|
|
42
|
-
: 'https://nx.dev/getting-started/tutorials/react-standalone-tutorial',
|
|
43
|
-
});
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
36
|
else if (isNestCLI(packageJson)) {
|
|
47
37
|
await (0, add_nx_to_nest_1.addNxToNest)(options, packageJson);
|
|
48
38
|
(0, utils_1.printFinalMessage)({
|
|
@@ -92,22 +82,6 @@ async function initHandler(options) {
|
|
|
92
82
|
}
|
|
93
83
|
}
|
|
94
84
|
}
|
|
95
|
-
function isCRA(packageJson) {
|
|
96
|
-
const combinedDependencies = {
|
|
97
|
-
...packageJson.dependencies,
|
|
98
|
-
...packageJson.devDependencies,
|
|
99
|
-
};
|
|
100
|
-
return (
|
|
101
|
-
// Required dependencies for CRA projects
|
|
102
|
-
combinedDependencies['react'] &&
|
|
103
|
-
combinedDependencies['react-dom'] &&
|
|
104
|
-
combinedDependencies['react-scripts'] &&
|
|
105
|
-
// // Don't convert customized CRA projects
|
|
106
|
-
!combinedDependencies['react-app-rewired'] &&
|
|
107
|
-
!combinedDependencies['@craco/craco'] &&
|
|
108
|
-
(0, fileutils_1.directoryExists)('src') &&
|
|
109
|
-
(0, fileutils_1.directoryExists)('public'));
|
|
110
|
-
}
|
|
111
85
|
function isNestCLI(packageJson) {
|
|
112
86
|
const combinedDependencies = {
|
|
113
87
|
...packageJson.dependencies,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-v2.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,sBAAsB,CAAC;AAIvE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"init-v2.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,sBAAsB,CAAC;AAIvE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAwBvD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAavC,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,QAAQ,EACjB,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CA2Bf;AA+RD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA0BtD;AAkDD,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,WAAW,GAAG,IAAI,EAC/B,WAAW,EAAE,OAAO,EACpB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC,CAsKD"}
|