nx 19.0.0-canary.20240430-458f2cc → 19.0.0-canary.20240503-dbad02a
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 +0 -24
- package/package.json +12 -12
- package/src/command-line/add/add.js +17 -16
- package/src/command-line/affected/affected.js +1 -1
- package/src/command-line/graph/graph.d.ts +11 -1
- package/src/command-line/graph/graph.js +97 -13
- package/src/command-line/release/changelog.js +1 -1
- package/src/command-line/release/command-object.js +2 -2
- package/src/command-line/release/publish.js +1 -1
- package/src/command-line/report/report.js +1 -1
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run-many/run-many.js +1 -1
- package/src/command-line/yargs-utils/shared-options.js +1 -1
- package/src/config/to-project-name.d.ts +5 -0
- package/src/config/to-project-name.js +13 -0
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/daemon/client/client.d.ts +1 -0
- package/src/daemon/client/client.js +11 -1
- package/src/daemon/server/project-graph-incremental-recomputation.js +1 -1
- package/src/devkit-exports.d.ts +0 -4
- package/src/devkit-exports.js +1 -7
- package/src/generators/utils/project-configuration.js +1 -6
- package/src/hasher/task-hasher.d.ts +4 -4
- package/src/plugins/package-json-workspaces/create-nodes.d.ts +1 -0
- package/src/plugins/package-json-workspaces/create-nodes.js +25 -20
- package/src/plugins/project-json/build-nodes/project-json.js +2 -2
- package/src/project-graph/build-project-graph.js +29 -4
- package/src/project-graph/error-types.d.ts +27 -8
- package/src/project-graph/error-types.js +66 -10
- package/src/project-graph/file-utils.d.ts +2 -3
- package/src/project-graph/file-utils.js +4 -8
- package/src/project-graph/plugins/loader.js +1 -1
- package/src/project-graph/plugins/utils.js +6 -5
- package/src/project-graph/project-graph.d.ts +3 -0
- package/src/project-graph/project-graph.js +2 -1
- package/src/project-graph/utils/normalize-project-nodes.js +0 -6
- package/src/project-graph/utils/project-configuration-utils.d.ts +3 -1
- package/src/project-graph/utils/project-configuration-utils.js +109 -34
- package/src/tasks-runner/create-task-graph.js +0 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +1 -1
- package/src/tasks-runner/run-command.js +4 -4
- package/src/tasks-runner/utils.js +17 -0
- package/src/utils/assert-workspace-validity.js +2 -1
- package/src/utils/nx-plugin.deprecated.d.ts +1 -1
- package/src/utils/nx-plugin.deprecated.js +1 -1
- package/src/command-line/repair.d.ts +0 -4
- package/src/command-line/repair.js +0 -7
- package/src/command-line/run-many.d.ts +0 -4
- package/src/command-line/run-many.js +0 -7
- package/src/command-line/run-one.d.ts +0 -4
- package/src/command-line/run-one.js +0 -7
- package/src/command-line/run.d.ts +0 -4
- package/src/command-line/run.js +0 -7
- package/src/command-line/watch.d.ts +0 -4
- package/src/command-line/watch.js +0 -7
- package/src/config/workspaces.d.ts +0 -18
- package/src/config/workspaces.js +0 -35
- package/src/migrations/update-15-1-0/set-project-names.d.ts +0 -2
- package/src/migrations/update-15-1-0/set-project-names.js +0 -34
- package/src/migrations/update-15-8-2/update-nxw.d.ts +0 -2
- package/src/migrations/update-15-8-2/update-nxw.js +0 -7
- package/src/utils/typescript.d.ts +0 -1
- package/src/utils/typescript.js +0 -5
package/migrations.json
CHANGED
@@ -1,29 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"generators": {
|
3
|
-
"15.0.0-migrate-to-inputs": {
|
4
|
-
"cli": "nx",
|
5
|
-
"version": "15.0.0-beta.1",
|
6
|
-
"description": "Replace implicitDependencies with namedInputs + target inputs",
|
7
|
-
"implementation": "./src/migrations/update-15-0-0/migrate-to-inputs"
|
8
|
-
},
|
9
|
-
"15.0.0-prefix-outputs": {
|
10
|
-
"cli": "nx",
|
11
|
-
"version": "15.0.0-beta.1",
|
12
|
-
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
|
13
|
-
"implementation": "./src/migrations/update-15-0-0/prefix-outputs"
|
14
|
-
},
|
15
|
-
"15.1.0-set-project-names": {
|
16
|
-
"cli": "nx",
|
17
|
-
"version": "15.0.12-beta.1",
|
18
|
-
"description": "Set project names in project.json files",
|
19
|
-
"implementation": "./src/migrations/update-15-1-0/set-project-names"
|
20
|
-
},
|
21
|
-
"15.8.2-update-nx-wrapper": {
|
22
|
-
"cli": "nx",
|
23
|
-
"version": "15.8.2-beta.0",
|
24
|
-
"description": "Updates the nx wrapper.",
|
25
|
-
"implementation": "./src/migrations/update-15-8-2/update-nxw"
|
26
|
-
},
|
27
3
|
"16.0.0-remove-nrwl-cli": {
|
28
4
|
"cli": "nx",
|
29
5
|
"version": "16.0.0-beta.0",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.0.0-canary.
|
3
|
+
"version": "19.0.0-canary.20240503-dbad02a",
|
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": {
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"yargs-parser": "21.1.1",
|
67
67
|
"node-machine-id": "1.1.12",
|
68
68
|
"ora": "5.3.0",
|
69
|
-
"@nrwl/tao": "19.0.0-canary.
|
69
|
+
"@nrwl/tao": "19.0.0-canary.20240503-dbad02a"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
72
|
"@swc-node/register": "^1.8.0",
|
@@ -81,16 +81,16 @@
|
|
81
81
|
}
|
82
82
|
},
|
83
83
|
"optionalDependencies": {
|
84
|
-
"@nx/nx-darwin-x64": "19.0.0-canary.
|
85
|
-
"@nx/nx-darwin-arm64": "19.0.0-canary.
|
86
|
-
"@nx/nx-linux-x64-gnu": "19.0.0-canary.
|
87
|
-
"@nx/nx-linux-x64-musl": "19.0.0-canary.
|
88
|
-
"@nx/nx-win32-x64-msvc": "19.0.0-canary.
|
89
|
-
"@nx/nx-linux-arm64-gnu": "19.0.0-canary.
|
90
|
-
"@nx/nx-linux-arm64-musl": "19.0.0-canary.
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "19.0.0-canary.
|
92
|
-
"@nx/nx-win32-arm64-msvc": "19.0.0-canary.
|
93
|
-
"@nx/nx-freebsd-x64": "19.0.0-canary.
|
84
|
+
"@nx/nx-darwin-x64": "19.0.0-canary.20240503-dbad02a",
|
85
|
+
"@nx/nx-darwin-arm64": "19.0.0-canary.20240503-dbad02a",
|
86
|
+
"@nx/nx-linux-x64-gnu": "19.0.0-canary.20240503-dbad02a",
|
87
|
+
"@nx/nx-linux-x64-musl": "19.0.0-canary.20240503-dbad02a",
|
88
|
+
"@nx/nx-win32-x64-msvc": "19.0.0-canary.20240503-dbad02a",
|
89
|
+
"@nx/nx-linux-arm64-gnu": "19.0.0-canary.20240503-dbad02a",
|
90
|
+
"@nx/nx-linux-arm64-musl": "19.0.0-canary.20240503-dbad02a",
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "19.0.0-canary.20240503-dbad02a",
|
92
|
+
"@nx/nx-win32-arm64-msvc": "19.0.0-canary.20240503-dbad02a",
|
93
|
+
"@nx/nx-freebsd-x64": "19.0.0-canary.20240503-dbad02a"
|
94
94
|
},
|
95
95
|
"nx-migrations": {
|
96
96
|
"migrations": "./migrations.json",
|
@@ -23,15 +23,16 @@ function addHandler(options) {
|
|
23
23
|
return (0, params_1.handleErrors)(isVerbose, async () => {
|
24
24
|
output_1.output.addNewline();
|
25
25
|
const [pkgName, version] = parsePackageSpecifier(options.packageSpecifier);
|
26
|
-
|
27
|
-
await
|
26
|
+
const nxJson = (0, nx_json_1.readNxJson)();
|
27
|
+
await installPackage(pkgName, version, nxJson);
|
28
|
+
await initializePlugin(pkgName, options, nxJson);
|
28
29
|
output_1.output.success({
|
29
30
|
title: `Package ${pkgName} added successfully.`,
|
30
31
|
});
|
31
32
|
});
|
32
33
|
}
|
33
34
|
exports.addHandler = addHandler;
|
34
|
-
async function installPackage(pkgName, version) {
|
35
|
+
async function installPackage(pkgName, version, nxJson) {
|
35
36
|
const spinner = ora(`Installing ${pkgName}@${version}...`);
|
36
37
|
spinner.start();
|
37
38
|
if ((0, fs_1.existsSync)('package.json')) {
|
@@ -50,7 +51,6 @@ async function installPackage(pkgName, version) {
|
|
50
51
|
}));
|
51
52
|
}
|
52
53
|
else {
|
53
|
-
const nxJson = (0, nx_json_1.readNxJson)();
|
54
54
|
nxJson.installation.plugins ??= {};
|
55
55
|
nxJson.installation.plugins[pkgName] = version;
|
56
56
|
(0, fileutils_1.writeJsonFile)('nx.json', nxJson);
|
@@ -72,7 +72,7 @@ async function installPackage(pkgName, version) {
|
|
72
72
|
}
|
73
73
|
spinner.succeed();
|
74
74
|
}
|
75
|
-
async function initializePlugin(pkgName, options) {
|
75
|
+
async function initializePlugin(pkgName, options, nxJson) {
|
76
76
|
const capabilities = await (0, plugins_1.getPluginCapabilities)(workspace_root_1.workspaceRoot, pkgName, {});
|
77
77
|
const generators = capabilities?.generators;
|
78
78
|
if (!generators) {
|
@@ -91,19 +91,20 @@ async function initializePlugin(pkgName, options) {
|
|
91
91
|
const spinner = ora(`Initializing ${pkgName}...`);
|
92
92
|
spinner.start();
|
93
93
|
try {
|
94
|
-
|
95
|
-
if (
|
96
|
-
|
94
|
+
const args = [];
|
95
|
+
if (coreNxPlugins.includes(pkgName)) {
|
96
|
+
args.push(`--keepExistingVersions`);
|
97
|
+
if (options.updatePackageScripts ||
|
98
|
+
(options.updatePackageScripts === undefined &&
|
99
|
+
nxJson.useInferencePlugins !== false &&
|
100
|
+
process.env.NX_ADD_PLUGINS !== 'false')) {
|
101
|
+
args.push(`--updatePackageScripts`);
|
102
|
+
}
|
97
103
|
}
|
98
|
-
|
99
|
-
|
100
|
-
(0, nx_json_1.readNxJson)().useInferencePlugins !== false &&
|
101
|
-
process.env.NX_ADD_PLUGINS !== 'false' &&
|
102
|
-
coreNxPlugins.includes(pkgName);
|
104
|
+
if (options.__overrides_unparsed__.length) {
|
105
|
+
args.push(...options.__overrides_unparsed__);
|
103
106
|
}
|
104
|
-
await (0, child_process_2.runNxAsync)(`g ${pkgName}:${initGenerator}
|
105
|
-
? ' ' + options.__overrides_unparsed__.join(' ')
|
106
|
-
: ''}`, {
|
107
|
+
await (0, child_process_2.runNxAsync)(`g ${pkgName}:${initGenerator} ${args.join(' ')}`, {
|
107
108
|
silent: !options.verbose,
|
108
109
|
});
|
109
110
|
}
|
@@ -53,7 +53,7 @@ async function affected(command, args, extraTargetDependencies = {}) {
|
|
53
53
|
const projectNames = projectsWithTarget.map((t) => t.name);
|
54
54
|
const file = (0, command_line_utils_1.readGraphFileFromGraphArg)(nxArgs);
|
55
55
|
return await (0, graph_1.generateGraph)({
|
56
|
-
watch:
|
56
|
+
watch: true,
|
57
57
|
open: true,
|
58
58
|
view: 'tasks',
|
59
59
|
targets: nxArgs.targets,
|
@@ -1,10 +1,18 @@
|
|
1
1
|
import { ProjectFileMap, ProjectGraphDependency, ProjectGraphProjectNode } from '../../config/project-graph';
|
2
2
|
import { TaskGraph } from '../../config/task-graph';
|
3
|
+
export interface GraphError {
|
4
|
+
message: string;
|
5
|
+
stack: string;
|
6
|
+
cause: unknown;
|
7
|
+
name: string;
|
8
|
+
pluginName: string;
|
9
|
+
fileName?: string;
|
10
|
+
}
|
3
11
|
export interface ProjectGraphClientResponse {
|
4
12
|
hash: string;
|
5
13
|
projects: ProjectGraphProjectNode[];
|
6
14
|
dependencies: Record<string, ProjectGraphDependency[]>;
|
7
|
-
fileMap
|
15
|
+
fileMap?: ProjectFileMap;
|
8
16
|
layout: {
|
9
17
|
appsDir: string;
|
10
18
|
libsDir: string;
|
@@ -13,6 +21,8 @@ export interface ProjectGraphClientResponse {
|
|
13
21
|
focus: string;
|
14
22
|
groupByFolder: boolean;
|
15
23
|
exclude: string[];
|
24
|
+
isPartial: boolean;
|
25
|
+
errors?: GraphError[];
|
16
26
|
}
|
17
27
|
export interface TaskGraphClientResponse {
|
18
28
|
taskGraphs: Record<string, TaskGraph>;
|
@@ -25,8 +25,9 @@ const native_1 = require("../../native");
|
|
25
25
|
const transform_objects_1 = require("../../native/transform-objects");
|
26
26
|
const affected_1 = require("../affected/affected");
|
27
27
|
const nx_deps_cache_1 = require("../../project-graph/nx-deps-cache");
|
28
|
-
const task_hasher_1 = require("../../hasher/task-hasher");
|
29
28
|
const create_task_hasher_1 = require("../../hasher/create-task-hasher");
|
29
|
+
const task_hasher_1 = require("../../hasher/task-hasher");
|
30
|
+
const error_types_1 = require("../../project-graph/error-types");
|
30
31
|
// maps file extention to MIME types
|
31
32
|
const mimeType = {
|
32
33
|
'.ico': 'image/x-icon',
|
@@ -156,9 +157,40 @@ async function generateGraph(args, affectedProjects) {
|
|
156
157
|
const target = Array.isArray(args.targets && args.targets.length >= 1)
|
157
158
|
? args.targets[0]
|
158
159
|
: args.targets;
|
159
|
-
|
160
|
-
|
161
|
-
|
160
|
+
let rawGraph;
|
161
|
+
let sourceMaps;
|
162
|
+
let isPartial = false;
|
163
|
+
try {
|
164
|
+
const projectGraphAndSourceMaps = await (0, project_graph_1.createProjectGraphAndSourceMapsAsync)({
|
165
|
+
exitOnError: false,
|
166
|
+
});
|
167
|
+
rawGraph = projectGraphAndSourceMaps.projectGraph;
|
168
|
+
sourceMaps = projectGraphAndSourceMaps.sourceMaps;
|
169
|
+
}
|
170
|
+
catch (e) {
|
171
|
+
if (e instanceof error_types_1.ProjectGraphError) {
|
172
|
+
rawGraph = e.getPartialProjectGraph();
|
173
|
+
sourceMaps = e.getPartialSourcemaps();
|
174
|
+
isPartial = true;
|
175
|
+
}
|
176
|
+
if (!rawGraph) {
|
177
|
+
(0, project_graph_1.handleProjectGraphError)({ exitOnError: true }, e);
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
const errors = e.getErrors();
|
181
|
+
if (errors?.length > 0) {
|
182
|
+
errors.forEach((e) => {
|
183
|
+
output_1.output.error({
|
184
|
+
title: e.message,
|
185
|
+
bodyLines: [e.stack],
|
186
|
+
});
|
187
|
+
});
|
188
|
+
}
|
189
|
+
output_1.output.warn({
|
190
|
+
title: `${errors?.length > 1 ? `${errors.length} errors` : `An error`} occured while processing the project graph. Showing partial graph.`,
|
191
|
+
});
|
192
|
+
}
|
193
|
+
}
|
162
194
|
let prunedGraph = (0, operators_1.pruneExternalNodes)(rawGraph);
|
163
195
|
const projects = Object.values(prunedGraph.nodes);
|
164
196
|
projects.sort((a, b) => {
|
@@ -295,7 +327,7 @@ async function generateGraph(args, affectedProjects) {
|
|
295
327
|
}
|
296
328
|
}
|
297
329
|
exports.generateGraph = generateGraph;
|
298
|
-
async function startServer(html, environmentJs, host, port = 4211, watchForchanges =
|
330
|
+
async function startServer(html, environmentJs, host, port = 4211, watchForchanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
|
299
331
|
let unregisterFileWatcher;
|
300
332
|
if (watchForchanges) {
|
301
333
|
unregisterFileWatcher = await createFileWatcher();
|
@@ -395,6 +427,8 @@ let currentProjectGraphClientResponse = {
|
|
395
427
|
focus: null,
|
396
428
|
groupByFolder: false,
|
397
429
|
exclude: [],
|
430
|
+
isPartial: false,
|
431
|
+
errors: [],
|
398
432
|
};
|
399
433
|
let currentSourceMapsClientResponse = {};
|
400
434
|
function debounce(fn, time) {
|
@@ -407,7 +441,11 @@ function debounce(fn, time) {
|
|
407
441
|
};
|
408
442
|
}
|
409
443
|
function createFileWatcher() {
|
410
|
-
return client_1.daemonClient.registerFileWatcher({
|
444
|
+
return client_1.daemonClient.registerFileWatcher({
|
445
|
+
watchProjects: 'all',
|
446
|
+
includeGlobalWorkspaceFiles: true,
|
447
|
+
allowPartialGraph: true,
|
448
|
+
}, debounce(async (error, changes) => {
|
411
449
|
if (error === 'closed') {
|
412
450
|
output_1.output.error({ title: `Watch error: Daemon closed the connection` });
|
413
451
|
process.exit(1);
|
@@ -421,6 +459,19 @@ function createFileWatcher() {
|
|
421
459
|
if (projectGraphClientResponse.hash !==
|
422
460
|
currentProjectGraphClientResponse.hash &&
|
423
461
|
sourceMapResponse) {
|
462
|
+
if (projectGraphClientResponse.errors?.length > 0) {
|
463
|
+
projectGraphClientResponse.errors.forEach((e) => {
|
464
|
+
output_1.output.error({
|
465
|
+
title: e.message,
|
466
|
+
bodyLines: [e.stack],
|
467
|
+
});
|
468
|
+
});
|
469
|
+
output_1.output.warn({
|
470
|
+
title: `${projectGraphClientResponse.errors.length > 1
|
471
|
+
? `${projectGraphClientResponse.errors.length} errors`
|
472
|
+
: `An error`} occured while processing the project graph. Showing partial graph.`,
|
473
|
+
});
|
474
|
+
}
|
424
475
|
output_1.output.note({ title: 'Graph changes updated.' });
|
425
476
|
currentProjectGraphClientResponse = projectGraphClientResponse;
|
426
477
|
currentSourceMapsClientResponse = sourceMapResponse;
|
@@ -433,16 +484,42 @@ function createFileWatcher() {
|
|
433
484
|
}
|
434
485
|
async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
435
486
|
perf_hooks_1.performance.mark('project graph watch calculation:start');
|
436
|
-
|
487
|
+
let projectGraph;
|
488
|
+
let sourceMaps;
|
489
|
+
let isPartial = false;
|
490
|
+
let errors;
|
491
|
+
try {
|
492
|
+
const projectGraphAndSourceMaps = await (0, project_graph_1.createProjectGraphAndSourceMapsAsync)({ exitOnError: false });
|
493
|
+
projectGraph = projectGraphAndSourceMaps.projectGraph;
|
494
|
+
sourceMaps = projectGraphAndSourceMaps.sourceMaps;
|
495
|
+
}
|
496
|
+
catch (e) {
|
497
|
+
if (e instanceof error_types_1.ProjectGraphError) {
|
498
|
+
projectGraph = e.getPartialProjectGraph();
|
499
|
+
sourceMaps = e.getPartialSourcemaps();
|
500
|
+
errors = e.getErrors().map((e) => ({
|
501
|
+
message: e.message,
|
502
|
+
stack: e.stack,
|
503
|
+
cause: e.cause,
|
504
|
+
name: e.name,
|
505
|
+
pluginName: e.pluginName,
|
506
|
+
fileName: e.file ?? e.cause?.errors?.[0]?.location?.file,
|
507
|
+
}));
|
508
|
+
isPartial = true;
|
509
|
+
}
|
510
|
+
if (!projectGraph) {
|
511
|
+
(0, project_graph_1.handleProjectGraphError)({ exitOnError: true }, e);
|
512
|
+
}
|
513
|
+
}
|
437
514
|
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
438
|
-
let fileMap = (0, nx_deps_cache_1.readFileMapCache)()
|
515
|
+
let fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap;
|
439
516
|
perf_hooks_1.performance.mark('project graph watch calculation:end');
|
440
517
|
perf_hooks_1.performance.mark('project graph response generation:start');
|
441
518
|
const layout = (0, configuration_1.workspaceLayout)();
|
442
519
|
const projects = Object.values(graph.nodes);
|
443
520
|
const dependencies = graph.dependencies;
|
444
521
|
const hasher = (0, crypto_1.createHash)('sha256');
|
445
|
-
hasher.update(JSON.stringify({ layout, projects, dependencies, sourceMaps }));
|
522
|
+
hasher.update(JSON.stringify({ layout, projects, dependencies, sourceMaps, errors }));
|
446
523
|
const hash = hasher.digest('hex');
|
447
524
|
perf_hooks_1.performance.mark('project graph response generation:end');
|
448
525
|
perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
|
@@ -456,17 +533,24 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
456
533
|
dependencies,
|
457
534
|
affected,
|
458
535
|
fileMap,
|
536
|
+
isPartial,
|
537
|
+
errors,
|
459
538
|
},
|
460
539
|
sourceMapResponse: sourceMaps,
|
461
540
|
};
|
462
541
|
}
|
463
542
|
async function createTaskGraphClientResponse(pruneExternal = false) {
|
464
543
|
let graph;
|
465
|
-
|
466
|
-
graph =
|
544
|
+
try {
|
545
|
+
graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: false });
|
467
546
|
}
|
468
|
-
|
469
|
-
|
547
|
+
catch (e) {
|
548
|
+
if (e instanceof error_types_1.ProjectGraphError) {
|
549
|
+
graph = e.getPartialProjectGraph();
|
550
|
+
}
|
551
|
+
}
|
552
|
+
if (pruneExternal) {
|
553
|
+
graph = (0, operators_1.pruneExternalNodes)(graph);
|
470
554
|
}
|
471
555
|
const nxJson = (0, configuration_1.readNxJson)();
|
472
556
|
perf_hooks_1.performance.mark('task graph generation:start');
|
@@ -16,7 +16,6 @@ const is_ci_1 = require("../../utils/is-ci");
|
|
16
16
|
const output_1 = require("../../utils/output");
|
17
17
|
const params_1 = require("../../utils/params");
|
18
18
|
const path_1 = require("../../utils/path");
|
19
|
-
const typescript_1 = require("../../utils/typescript");
|
20
19
|
const workspace_root_1 = require("../../utils/workspace-root");
|
21
20
|
const config_1 = require("./config/config");
|
22
21
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
@@ -27,6 +26,7 @@ const markdown_1 = require("./utils/markdown");
|
|
27
26
|
const print_changes_1 = require("./utils/print-changes");
|
28
27
|
const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
|
29
28
|
const shared_1 = require("./utils/shared");
|
29
|
+
const typescript_1 = require("../../plugins/js/utils/typescript");
|
30
30
|
const releaseChangelogCLIHandler = (args) => (0, params_1.handleErrors)(args.verbose, () => releaseChangelog(args));
|
31
31
|
exports.releaseChangelogCLIHandler = releaseChangelogCLIHandler;
|
32
32
|
/**
|
@@ -2,9 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsReleaseCommand = void 0;
|
4
4
|
const yargs_1 = require("yargs");
|
5
|
-
const file_utils_1 = require("../../project-graph/file-utils");
|
6
5
|
const logger_1 = require("../../utils/logger");
|
7
6
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
7
|
+
const nx_json_1 = require("../../config/nx-json");
|
8
8
|
exports.yargsReleaseCommand = {
|
9
9
|
command: 'release',
|
10
10
|
describe: 'Orchestrate versioning and publishing of applications and libraries',
|
@@ -46,7 +46,7 @@ exports.yargsReleaseCommand = {
|
|
46
46
|
if (argv.groups && argv.projects) {
|
47
47
|
throw new Error('The --projects and --groups options are mutually exclusive, please use one or the other.');
|
48
48
|
}
|
49
|
-
const nxJson = (0,
|
49
|
+
const nxJson = (0, nx_json_1.readNxJson)();
|
50
50
|
if (argv.groups?.length) {
|
51
51
|
for (const group of argv.groups) {
|
52
52
|
if (!nxJson.release?.groups?.[group]) {
|
@@ -106,7 +106,7 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, sh
|
|
106
106
|
.map((t) => t.name)
|
107
107
|
.filter((projectName) => (0, project_graph_utils_1.projectHasTarget)(projectGraph.nodes[projectName], requiredTargetName));
|
108
108
|
await (0, graph_1.generateGraph)({
|
109
|
-
watch:
|
109
|
+
watch: true,
|
110
110
|
all: false,
|
111
111
|
open: true,
|
112
112
|
view: 'tasks',
|
@@ -197,7 +197,7 @@ function findRegisteredPluginsBeingUsed(nxJson) {
|
|
197
197
|
exports.findRegisteredPluginsBeingUsed = findRegisteredPluginsBeingUsed;
|
198
198
|
function findInstalledPackagesWeCareAbout() {
|
199
199
|
const packagesWeMayCareAbout = {};
|
200
|
-
// TODO (
|
200
|
+
// TODO (v20): Remove workaround for hiding @nrwl packages when matching @nx package is found.
|
201
201
|
const packageChangeMap = {
|
202
202
|
'@nrwl/nx-plugin': '@nx/plugin',
|
203
203
|
'@nx/plugin': '@nrwl/nx-plugin',
|
@@ -38,7 +38,7 @@ async function runOne(cwd, args, extraTargetDependencies = {}, extraOptions = {
|
|
38
38
|
const projectNames = projects.map((t) => t.name);
|
39
39
|
const file = (0, command_line_utils_1.readGraphFileFromGraphArg)(nxArgs);
|
40
40
|
return await (0, graph_1.generateGraph)({
|
41
|
-
watch:
|
41
|
+
watch: true,
|
42
42
|
open: true,
|
43
43
|
view: 'tasks',
|
44
44
|
targets: nxArgs.targets,
|
@@ -29,7 +29,7 @@ async function runMany(args, extraTargetDependencies = {}, extraOptions = { excl
|
|
29
29
|
const file = (0, command_line_utils_1.readGraphFileFromGraphArg)(nxArgs);
|
30
30
|
const projectNames = projects.map((t) => t.name);
|
31
31
|
return await (0, graph_1.generateGraph)({
|
32
|
-
watch:
|
32
|
+
watch: true,
|
33
33
|
open: true,
|
34
34
|
view: 'tasks',
|
35
35
|
all: nxArgs.all,
|
@@ -249,7 +249,7 @@ function withDepGraphOptions(yargs) {
|
|
249
249
|
.option('watch', {
|
250
250
|
describe: 'Watch for changes to project graph and update in-browser',
|
251
251
|
type: 'boolean',
|
252
|
-
default:
|
252
|
+
default: true,
|
253
253
|
})
|
254
254
|
.option('open', {
|
255
255
|
describe: 'Open the project graph in the browser.',
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.toProjectName = void 0;
|
4
|
+
const path_1 = require("path");
|
5
|
+
/**
|
6
|
+
* Pulled from toFileName in names from @nx/devkit.
|
7
|
+
* Todo: Should refactor, not duplicate.
|
8
|
+
*/
|
9
|
+
function toProjectName(fileName) {
|
10
|
+
const parts = (0, path_1.dirname)(fileName).split(/[\/\\]/g);
|
11
|
+
return parts[parts.length - 1].toLowerCase();
|
12
|
+
}
|
13
|
+
exports.toProjectName = toProjectName;
|