nx 21.4.0-beta.7 → 21.4.0-beta.9
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 +11 -11
- package/schemas/nx-schema.json +22 -1
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +152 -45
- package/src/command-line/mcp/command-object.d.ts.map +1 -1
- package/src/command-line/mcp/command-object.js +17 -13
- package/src/command-line/mcp/mcp.d.ts.map +1 -1
- package/src/command-line/mcp/mcp.js +2 -1
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +18 -8
- package/src/command-line/release/command-object.d.ts +1 -0
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/command-object.js +13 -1
- package/src/command-line/release/config/config.js +2 -2
- package/src/command-line/release/publish.js +5 -1
- package/src/command-line/release/version/release-group-processor.d.ts +1 -1
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +2 -2
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/native/nx.wasi-browser.js +39 -42
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/project-graph/plugins/public-api.d.ts +2 -0
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/run-command.js +2 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.4.0-beta.
|
3
|
+
"version": "21.4.0-beta.9",
|
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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.4.0-beta.
|
87
|
-
"@nx/nx-darwin-x64": "21.4.0-beta.
|
88
|
-
"@nx/nx-freebsd-x64": "21.4.0-beta.
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.4.0-beta.
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.4.0-beta.
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.4.0-beta.
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.4.0-beta.
|
93
|
-
"@nx/nx-linux-x64-musl": "21.4.0-beta.
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.4.0-beta.
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.4.0-beta.
|
86
|
+
"@nx/nx-darwin-arm64": "21.4.0-beta.9",
|
87
|
+
"@nx/nx-darwin-x64": "21.4.0-beta.9",
|
88
|
+
"@nx/nx-freebsd-x64": "21.4.0-beta.9",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.4.0-beta.9",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.4.0-beta.9",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.4.0-beta.9",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.4.0-beta.9",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.4.0-beta.9",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.4.0-beta.9",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.4.0-beta.9"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
package/schemas/nx-schema.json
CHANGED
@@ -783,7 +783,28 @@
|
|
783
783
|
"manifestRootsToUpdate": {
|
784
784
|
"type": "array",
|
785
785
|
"items": {
|
786
|
-
"
|
786
|
+
"oneOf": [
|
787
|
+
{
|
788
|
+
"type": "string",
|
789
|
+
"description": "Path to the directory containing a manifest file to update. Supports placeholders like {projectRoot} and {projectName}."
|
790
|
+
},
|
791
|
+
{
|
792
|
+
"type": "object",
|
793
|
+
"properties": {
|
794
|
+
"path": {
|
795
|
+
"type": "string",
|
796
|
+
"description": "Path to the directory containing a manifest file to update. Supports placeholders like {projectRoot} and {projectName}."
|
797
|
+
},
|
798
|
+
"preserveLocalDependencyProtocols": {
|
799
|
+
"type": "boolean",
|
800
|
+
"description": "Whether to preserve local dependency references using protocols like 'workspace:' or 'file:'. Set this to false for dist files that need to be published if not using a package manager that swaps references at publish time like pnpm or bun.",
|
801
|
+
"default": true
|
802
|
+
}
|
803
|
+
},
|
804
|
+
"required": ["path"],
|
805
|
+
"additionalProperties": false
|
806
|
+
}
|
807
|
+
]
|
787
808
|
},
|
788
809
|
"description": "A list of directories containing manifest files (such as package.json) to apply updates to when versioning. By default, only the project root will be used, but you could customize this to only version a manifest in a dist directory, or even version multiple manifests in different directories, such as both source and dist."
|
789
810
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAuBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CA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CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAuSf;AA6yBD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
|
@@ -4,13 +4,13 @@ exports.generateGraph = generateGraph;
|
|
4
4
|
const crypto_1 = require("crypto");
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
6
6
|
const node_fs_1 = require("node:fs");
|
7
|
-
const http = require("http");
|
7
|
+
const http = require("node:http");
|
8
8
|
const minimatch_1 = require("minimatch");
|
9
9
|
const node_url_1 = require("node:url");
|
10
|
-
const open = require(
|
11
|
-
const
|
12
|
-
const net = require("net");
|
13
|
-
const
|
10
|
+
const open = require("open");
|
11
|
+
const node_path_1 = require("node:path");
|
12
|
+
const net = require("node:net");
|
13
|
+
const node_perf_hooks_1 = require("node:perf_hooks");
|
14
14
|
const configuration_1 = require("../../config/configuration");
|
15
15
|
const fileutils_1 = require("../../utils/fileutils");
|
16
16
|
const output_1 = require("../../utils/output");
|
@@ -225,7 +225,7 @@ async function generateGraph(args, affectedProjects) {
|
|
225
225
|
process.exit(1);
|
226
226
|
}
|
227
227
|
}
|
228
|
-
let html = (0, node_fs_1.readFileSync)((0,
|
228
|
+
let html = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
|
229
229
|
prunedGraph = filterGraph(prunedGraph, args.focus || null, args.exclude || []);
|
230
230
|
if (args.print || args.file === 'stdout') {
|
231
231
|
console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
|
@@ -234,15 +234,15 @@ async function generateGraph(args, affectedProjects) {
|
|
234
234
|
}
|
235
235
|
if (args.file) {
|
236
236
|
const workspaceFolder = workspace_root_1.workspaceRoot;
|
237
|
-
const ext = (0,
|
238
|
-
const fullFilePath = (0,
|
237
|
+
const ext = (0, node_path_1.extname)(args.file);
|
238
|
+
const fullFilePath = (0, node_path_1.isAbsolute)(args.file)
|
239
239
|
? args.file
|
240
|
-
: (0,
|
241
|
-
const fileFolderPath = (0,
|
240
|
+
: (0, node_path_1.join)(workspaceFolder, args.file);
|
241
|
+
const fileFolderPath = (0, node_path_1.dirname)(fullFilePath);
|
242
242
|
if (ext === '.html') {
|
243
|
-
const assetsFolder = (0,
|
243
|
+
const assetsFolder = (0, node_path_1.join)(fileFolderPath, 'static');
|
244
244
|
const assets = [];
|
245
|
-
(0, node_fs_1.cpSync)((0,
|
245
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(__dirname, '../../core/graph'), assetsFolder, {
|
246
246
|
filter: (_src, dest) => {
|
247
247
|
const isntHtml = !/index\.html/.test(dest);
|
248
248
|
if (isntHtml && dest.includes('.')) {
|
@@ -261,14 +261,14 @@ async function generateGraph(args, affectedProjects) {
|
|
261
261
|
html = html.replace(/<base href="\/".*>/g, '');
|
262
262
|
html = html.replace(/type="module"/g, '');
|
263
263
|
(0, node_fs_1.writeFileSync)(fullFilePath, html);
|
264
|
-
(0, node_fs_1.writeFileSync)((0,
|
264
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(assetsFolder, 'environment.js'), environmentJs);
|
265
265
|
output_1.output.success({
|
266
266
|
title: `HTML output created in ${fileFolderPath}`,
|
267
267
|
bodyLines: [fileFolderPath, ...assets],
|
268
268
|
});
|
269
269
|
}
|
270
270
|
else if (ext === '.json') {
|
271
|
-
(0, node_fs_1.mkdirSync)((0,
|
271
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(fullFilePath), { recursive: true });
|
272
272
|
const json = await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets);
|
273
273
|
(0, fileutils_1.writeJsonFile)(fullFilePath, json);
|
274
274
|
output_1.output.success({
|
@@ -308,12 +308,12 @@ async function generateGraph(args, affectedProjects) {
|
|
308
308
|
if (target) {
|
309
309
|
url.pathname += '/' + target;
|
310
310
|
}
|
311
|
-
if (args.
|
312
|
-
url.pathname += '/all';
|
313
|
-
}
|
314
|
-
else if (args.projects) {
|
311
|
+
if (args.projects) {
|
315
312
|
url.searchParams.append('projects', args.projects.map((projectName) => projectName).join(' '));
|
316
313
|
}
|
314
|
+
else if (args.all) {
|
315
|
+
url.pathname += '/all';
|
316
|
+
}
|
317
317
|
else if (args.affected) {
|
318
318
|
url.pathname += '/affected';
|
319
319
|
}
|
@@ -377,25 +377,37 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
377
377
|
// e.g curl --path-as-is http://localhost:9000/../fileInDanger.txt
|
378
378
|
// by limiting the path to current directory only
|
379
379
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
380
|
-
const sanitizePath = (0,
|
380
|
+
const sanitizePath = (0, node_path_1.basename)(parsedUrl.pathname);
|
381
381
|
if (sanitizePath === 'project-graph.json') {
|
382
382
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
383
383
|
res.end(JSON.stringify(currentProjectGraphClientResponse));
|
384
384
|
return;
|
385
385
|
}
|
386
386
|
if (sanitizePath === 'task-graph.json') {
|
387
|
+
const projectsParam = parsedUrl.searchParams.get('projects'); // Multiple projects
|
388
|
+
const targetName = parsedUrl.searchParams.get('target');
|
389
|
+
const configuration = parsedUrl.searchParams.get('configuration');
|
387
390
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
388
|
-
|
389
|
-
|
391
|
+
if (projectsParam && targetName) {
|
392
|
+
// Multiple projects + target (UI: selected specific projects)
|
393
|
+
const projectNames = projectsParam.split(' ').filter(Boolean);
|
394
|
+
return res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName, projectNames, configuration)));
|
395
|
+
}
|
396
|
+
if (targetName) {
|
397
|
+
// Target only (UI: all projects with this target)
|
398
|
+
return res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName)));
|
399
|
+
}
|
400
|
+
// Legacy - load all task graphs
|
401
|
+
return res.end(JSON.stringify(await createTaskGraphClientResponse()));
|
390
402
|
}
|
391
403
|
if (sanitizePath === 'task-inputs.json') {
|
392
|
-
|
404
|
+
node_perf_hooks_1.performance.mark('task input generation:start');
|
393
405
|
const taskId = parsedUrl.searchParams.get('taskId');
|
394
406
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
395
407
|
const inputs = await getExpandedTaskInputs(taskId);
|
396
|
-
|
408
|
+
node_perf_hooks_1.performance.mark('task input generation:end');
|
397
409
|
res.end(JSON.stringify({ [taskId]: inputs }));
|
398
|
-
|
410
|
+
node_perf_hooks_1.performance.measure('task input generation', 'task input generation:start', 'task input generation:end');
|
399
411
|
return;
|
400
412
|
}
|
401
413
|
if (sanitizePath === 'source-maps.json') {
|
@@ -427,7 +439,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
427
439
|
}
|
428
440
|
return;
|
429
441
|
}
|
430
|
-
let pathname = (0,
|
442
|
+
let pathname = (0, node_path_1.join)(__dirname, '../../core/graph/', sanitizePath);
|
431
443
|
// if the file is not found or is a directory, return index.html
|
432
444
|
if (!(0, node_fs_1.existsSync)(pathname) || (0, node_fs_1.statSync)(pathname).isDirectory()) {
|
433
445
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
@@ -436,7 +448,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
436
448
|
}
|
437
449
|
try {
|
438
450
|
const data = (0, node_fs_1.readFileSync)(pathname);
|
439
|
-
const ext = (0,
|
451
|
+
const ext = (0, node_path_1.parse)(pathname).ext;
|
440
452
|
res.setHeader('Content-type', mimeType[ext] || 'text/plain');
|
441
453
|
res.end(data);
|
442
454
|
}
|
@@ -530,6 +542,8 @@ function createFileWatcher() {
|
|
530
542
|
output_1.output.note({ title: 'Graph changes updated.' });
|
531
543
|
currentProjectGraphClientResponse = projectGraphClientResponse;
|
532
544
|
currentSourceMapsClientResponse = sourceMapResponse;
|
545
|
+
// Clear task graph cache when project graph changes
|
546
|
+
clearTaskGraphCache();
|
533
547
|
}
|
534
548
|
else {
|
535
549
|
output_1.output.note({ title: 'No graph changes found.' });
|
@@ -538,7 +552,7 @@ function createFileWatcher() {
|
|
538
552
|
}, 500));
|
539
553
|
}
|
540
554
|
async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
541
|
-
|
555
|
+
node_perf_hooks_1.performance.mark('project graph watch calculation:start');
|
542
556
|
let projectGraph;
|
543
557
|
let sourceMaps;
|
544
558
|
let isPartial = false;
|
@@ -573,8 +587,8 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
573
587
|
}
|
574
588
|
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
575
589
|
let fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap;
|
576
|
-
|
577
|
-
|
590
|
+
node_perf_hooks_1.performance.mark('project graph watch calculation:end');
|
591
|
+
node_perf_hooks_1.performance.mark('project graph response generation:start');
|
578
592
|
const layout = (0, configuration_1.workspaceLayout)();
|
579
593
|
const projects = Object.values(graph.nodes);
|
580
594
|
const dependencies = graph.dependencies;
|
@@ -589,9 +603,9 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
589
603
|
disabledTaskSyncGenerators,
|
590
604
|
}));
|
591
605
|
const hash = hasher.digest('hex');
|
592
|
-
|
593
|
-
|
594
|
-
|
606
|
+
node_perf_hooks_1.performance.mark('project graph response generation:end');
|
607
|
+
node_perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
|
608
|
+
node_perf_hooks_1.performance.measure('project graph response generation', 'project graph response generation:start', 'project graph response generation:end');
|
595
609
|
return {
|
596
610
|
projectGraphClientResponse: {
|
597
611
|
...currentProjectGraphClientResponse,
|
@@ -623,11 +637,11 @@ async function createTaskGraphClientResponse(pruneExternal = false) {
|
|
623
637
|
graph = (0, operators_1.pruneExternalNodes)(graph);
|
624
638
|
}
|
625
639
|
const nxJson = (0, configuration_1.readNxJson)();
|
626
|
-
|
640
|
+
node_perf_hooks_1.performance.mark('task graph generation:start');
|
627
641
|
const taskGraphs = getAllTaskGraphsForWorkspace(graph);
|
628
|
-
|
642
|
+
node_perf_hooks_1.performance.mark('task graph generation:end');
|
629
643
|
const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
|
630
|
-
|
644
|
+
node_perf_hooks_1.performance.mark('task hash plan generation:start');
|
631
645
|
const plans = {};
|
632
646
|
for (const individualTaskGraph of Object.values(taskGraphs.taskGraphs)) {
|
633
647
|
for (const task of Object.values(individualTaskGraph.tasks)) {
|
@@ -637,16 +651,16 @@ async function createTaskGraphClientResponse(pruneExternal = false) {
|
|
637
651
|
plans[task.id] = planner.getPlans([task.id], individualTaskGraph)[task.id];
|
638
652
|
}
|
639
653
|
}
|
640
|
-
|
641
|
-
|
642
|
-
|
654
|
+
node_perf_hooks_1.performance.mark('task hash plan generation:end');
|
655
|
+
node_perf_hooks_1.performance.measure('task graph generation', 'task graph generation:start', 'task graph generation:end');
|
656
|
+
node_perf_hooks_1.performance.measure('task hash plan generation', 'task hash plan generation:start', 'task hash plan generation:end');
|
643
657
|
return {
|
644
658
|
...taskGraphs,
|
645
659
|
plans,
|
646
660
|
};
|
647
661
|
}
|
648
662
|
async function createExpandedTaskInputResponse(taskGraphClientResponse, depGraphClientResponse) {
|
649
|
-
|
663
|
+
node_perf_hooks_1.performance.mark('task input static generation:start');
|
650
664
|
const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
|
651
665
|
const response = {};
|
652
666
|
Object.entries(taskGraphClientResponse.plans).forEach(([key, inputs]) => {
|
@@ -654,8 +668,8 @@ async function createExpandedTaskInputResponse(taskGraphClientResponse, depGraph
|
|
654
668
|
const expandedInputs = expandInputs(inputs, depGraphClientResponse.projects.find((p) => p.name === project), allWorkspaceFiles, depGraphClientResponse);
|
655
669
|
response[key] = expandedInputs;
|
656
670
|
});
|
657
|
-
|
658
|
-
|
671
|
+
node_perf_hooks_1.performance.mark('task input static generation:end');
|
672
|
+
node_perf_hooks_1.performance.measure('task input static generation', 'task input static generation:start', 'task input static generation:end');
|
659
673
|
return response;
|
660
674
|
}
|
661
675
|
function getAllTaskGraphsForWorkspace(projectGraph) {
|
@@ -709,13 +723,106 @@ function createTaskId(projectId, targetId, configurationId) {
|
|
709
723
|
return `${projectId}:${targetId}`;
|
710
724
|
}
|
711
725
|
}
|
726
|
+
// Performance optimized functions for lazy loading task graphs
|
727
|
+
// In-memory cache for task graphs to avoid regeneration
|
728
|
+
const taskGraphCache = new Map();
|
729
|
+
// Clear cache when project graph changes
|
730
|
+
function clearTaskGraphCache() {
|
731
|
+
taskGraphCache.clear();
|
732
|
+
}
|
733
|
+
/**
|
734
|
+
* Creates task graphs for multiple projects with a specific target
|
735
|
+
* If no projects specified, returns graphs for all projects with the target
|
736
|
+
*/
|
737
|
+
async function createTaskGraphsForTargetAndProjects(targetName, projectNames, configuration) {
|
738
|
+
// Get project graph
|
739
|
+
let graph;
|
740
|
+
try {
|
741
|
+
graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: false });
|
742
|
+
}
|
743
|
+
catch (e) {
|
744
|
+
if (e instanceof error_types_1.ProjectGraphError) {
|
745
|
+
graph = e.getPartialProjectGraph();
|
746
|
+
}
|
747
|
+
}
|
748
|
+
const nxJson = (0, configuration_1.readNxJson)();
|
749
|
+
// Determine which projects to process
|
750
|
+
let projectsToProcess;
|
751
|
+
if (projectNames && projectNames.length > 0) {
|
752
|
+
// Use specified projects (filter to only those that have the target)
|
753
|
+
projectsToProcess = projectNames.filter((projectName) => graph.nodes[projectName]?.data.targets?.[targetName]);
|
754
|
+
}
|
755
|
+
else {
|
756
|
+
// Get all projects with the target
|
757
|
+
projectsToProcess = Object.entries(graph.nodes)
|
758
|
+
.filter(([_, project]) => project.data.targets?.[targetName])
|
759
|
+
.map(([projectName]) => projectName);
|
760
|
+
}
|
761
|
+
node_perf_hooks_1.performance.mark(`target task graphs generation:start`);
|
762
|
+
// Create task graphs for each project
|
763
|
+
const taskGraphs = {};
|
764
|
+
const taskGraphErrors = {};
|
765
|
+
for (const projectName of projectsToProcess) {
|
766
|
+
const taskId = createTaskId(projectName, targetName, configuration);
|
767
|
+
// Check cache first
|
768
|
+
const cached = taskGraphCache.get(taskId);
|
769
|
+
if (cached) {
|
770
|
+
Object.assign(taskGraphs, cached.taskGraphs);
|
771
|
+
Object.assign(taskGraphErrors, cached.errors);
|
772
|
+
continue;
|
773
|
+
}
|
774
|
+
// Create task graph
|
775
|
+
try {
|
776
|
+
taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(graph, {}, [projectName], [targetName], configuration, {});
|
777
|
+
}
|
778
|
+
catch (err) {
|
779
|
+
taskGraphs[taskId] = {
|
780
|
+
tasks: {},
|
781
|
+
dependencies: {},
|
782
|
+
continuousDependencies: {},
|
783
|
+
roots: [],
|
784
|
+
};
|
785
|
+
taskGraphErrors[taskId] = err.message;
|
786
|
+
}
|
787
|
+
}
|
788
|
+
node_perf_hooks_1.performance.mark(`target task graphs generation:end`);
|
789
|
+
// Generate hash plans
|
790
|
+
const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
|
791
|
+
node_perf_hooks_1.performance.mark('target task hash plan generation:start');
|
792
|
+
const plans = {};
|
793
|
+
for (const taskGraph of Object.values(taskGraphs)) {
|
794
|
+
const taskIds = Object.keys(taskGraph.tasks);
|
795
|
+
if (taskIds.length > 0) {
|
796
|
+
const taskPlans = planner.getPlans(taskIds, taskGraph);
|
797
|
+
Object.assign(plans, taskPlans);
|
798
|
+
}
|
799
|
+
}
|
800
|
+
node_perf_hooks_1.performance.mark('target task hash plan generation:end');
|
801
|
+
// Cache individual results for future requests
|
802
|
+
for (const projectName of projectsToProcess) {
|
803
|
+
const taskId = createTaskId(projectName, targetName, configuration);
|
804
|
+
if (!taskGraphCache.has(taskId)) {
|
805
|
+
taskGraphCache.set(taskId, {
|
806
|
+
taskGraphs: { [taskId]: taskGraphs[taskId] },
|
807
|
+
plans: Object.fromEntries(Object.entries(plans).filter(([key]) => key.startsWith(projectName))),
|
808
|
+
errors: taskGraphErrors[taskId]
|
809
|
+
? { [taskId]: taskGraphErrors[taskId] }
|
810
|
+
: {},
|
811
|
+
});
|
812
|
+
}
|
813
|
+
}
|
814
|
+
node_perf_hooks_1.performance.measure(`target task graphs generation for ${targetName}`, `target task graphs generation:start`, `target task graphs generation:end`);
|
815
|
+
node_perf_hooks_1.performance.measure('target task hash plan generation', 'target task hash plan generation:start', 'target task hash plan generation:end');
|
816
|
+
return { taskGraphs, plans, errors: taskGraphErrors };
|
817
|
+
}
|
712
818
|
async function getExpandedTaskInputs(taskId) {
|
713
|
-
|
714
|
-
const
|
819
|
+
// Use the optimized version that only creates the specific task graph needed
|
820
|
+
const [projectName, targetName, configuration] = taskId.split(':');
|
821
|
+
const taskGraphResponse = await createTaskGraphsForTargetAndProjects(targetName, [projectName], configuration);
|
715
822
|
const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
|
716
823
|
const inputs = taskGraphResponse.plans[taskId];
|
717
824
|
if (inputs) {
|
718
|
-
return expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name ===
|
825
|
+
return expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name === projectName), allWorkspaceFiles, currentProjectGraphClientResponse);
|
719
826
|
}
|
720
827
|
return {};
|
721
828
|
}
|
@@ -752,7 +859,7 @@ function expandInputs(inputs, project, allWorkspaceFiles, depGraphClientResponse
|
|
752
859
|
const workspaceRootsExpanded = getExpandedWorkspaceRoots(workspaceRootInputs, allWorkspaceFiles);
|
753
860
|
const otherInputsExpanded = otherInputs.map((input) => {
|
754
861
|
if (input === 'TsConfig') {
|
755
|
-
return (0,
|
862
|
+
return (0, node_path_1.relative)(workspace_root_1.workspaceRoot, (0, typescript_1.getRootTsConfigPath)());
|
756
863
|
}
|
757
864
|
if (input === 'ProjectConfiguration') {
|
758
865
|
return depGraphClientResponse.fileMap[project.name].find((file) => file.file === `${project.data.root}/project.json` ||
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/mcp/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/mcp/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,aAwB7B,CAAC"}
|
@@ -4,19 +4,23 @@ exports.yargsMcpCommand = void 0;
|
|
4
4
|
exports.yargsMcpCommand = {
|
5
5
|
command: 'mcp',
|
6
6
|
describe: 'Starts the Nx MCP server.',
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
// @ts-expect-error - yargs types are outdated, refer to docs - https://github.com/yargs/yargs/blob/main/docs/api.md#commandmodule
|
8
|
+
builder: async (y, helpOrVersionSet) => {
|
9
|
+
if (helpOrVersionSet) {
|
10
|
+
(await Promise.resolve().then(() => require('./mcp'))).showHelp();
|
11
|
+
process.exit(0);
|
12
|
+
}
|
13
|
+
return y
|
14
|
+
.version(false)
|
15
|
+
.strict(false)
|
16
|
+
.parserConfiguration({
|
17
|
+
'unknown-options-as-args': true,
|
18
|
+
'populate--': true,
|
19
|
+
})
|
20
|
+
.usage('')
|
21
|
+
.help(false)
|
22
|
+
.showHelpOnFail(false);
|
23
|
+
},
|
20
24
|
handler: async (args) => {
|
21
25
|
await (await Promise.resolve().then(() => require('./mcp'))).mcpHandler(args);
|
22
26
|
process.exit(0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/mcp/mcp.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,IAAI,EAAE,GAAG,
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/mcp/mcp.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,IAAI,EAAE,GAAG,iBAazC;AAED,wBAAsB,QAAQ,kBAa7B"}
|
@@ -7,7 +7,8 @@ const package_manager_1 = require("../../utils/package-manager");
|
|
7
7
|
const workspace_root_1 = require("../../utils/workspace-root");
|
8
8
|
async function mcpHandler(args) {
|
9
9
|
const packageManagerCommands = (0, package_manager_1.getPackageManagerCommand)();
|
10
|
-
|
10
|
+
const passthroughArgs = args['_'][0] === 'mcp' ? args['_'].slice(1) : args['_'];
|
11
|
+
(0, child_process_1.spawnSync)(packageManagerCommands.dlx, ['-y', 'nx-mcp@latest', ...passthroughArgs], {
|
11
12
|
stdio: 'inherit',
|
12
13
|
cwd: workspace_root_1.workspaceRoot,
|
13
14
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migrate-ui-api.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/migrate/migrate-ui-api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUxD,MAAM,MAAM,sBAAs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C;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,
|
1
|
+
{"version":3,"file":"migrate-ui-api.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/migrate/migrate-ui-api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUxD,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB,CAAC,EAAE,MAAM,CAC1B,MAAM,EACN,mBAAmB,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAC5E,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF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AAwB,sBAAsB;0BA1WhC,MAAM,CAC1B,MAAM,EACN,mBAAmB,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAC5E;wBACmB,MAAM,EAAE;oBACZ;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB;8BACyB,OAAO;oBACjB,MAAM;EA6WvB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IACnD,wBAAwB,sBAAsB;0BA1XhC,MAAM,CAC1B,MAAM,EACN,mBAAmB,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAC5E;wBACmB,MAAM,EAAE;oBACZ;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB;8BACyB,OAAO;oBACjB,MAAM;EA+XvB;AAoBD,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,MAAM,GACpB,sBAAsB,CAIxB;AAED,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IACrD,wBAAwB,sBAAsB,4BAavD;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAuBT;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,IACvC,wBAAwB,sBAAsB,4BAOvD"}
|
@@ -130,10 +130,15 @@ async function runSingleMigration(workspacePath, migration, configuration) {
|
|
130
130
|
type: change.type,
|
131
131
|
})), gitRefAfter, nextSteps));
|
132
132
|
if (gitRefBefore !== gitRefAfter) {
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
try {
|
134
|
+
(0, child_process_1.execSync)('git add migrations.json', {
|
135
|
+
cwd: workspacePath,
|
136
|
+
encoding: 'utf-8',
|
137
|
+
});
|
138
|
+
}
|
139
|
+
catch (e) {
|
140
|
+
// do nothing, this will fail if it's gitignored
|
141
|
+
}
|
137
142
|
(0, child_process_1.execSync)('git commit --amend --no-verify --no-edit', {
|
138
143
|
cwd: workspacePath,
|
139
144
|
encoding: 'utf-8',
|
@@ -163,10 +168,15 @@ async function runSingleMigration(workspacePath, migration, configuration) {
|
|
163
168
|
currentMigrationId = null;
|
164
169
|
migrationCancelled = false;
|
165
170
|
modifyMigrationsJsonMetadata(workspacePath, removeRunningMigration(migration.id));
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
171
|
+
try {
|
172
|
+
(0, child_process_1.execSync)('git add migrations.json', {
|
173
|
+
cwd: workspacePath,
|
174
|
+
encoding: 'utf-8',
|
175
|
+
});
|
176
|
+
}
|
177
|
+
catch (e) {
|
178
|
+
// do nothing, this will fail if it's gitignored
|
179
|
+
}
|
170
180
|
}
|
171
181
|
}
|
172
182
|
async function getImplementationPath(workspacePath, migration) {
|
@@ -24,6 +24,7 @@ interface GitOptions {
|
|
24
24
|
}
|
25
25
|
export type DockerVersionSchemeArgs = {
|
26
26
|
dockerVersionScheme?: string;
|
27
|
+
dockerVersion?: string;
|
27
28
|
};
|
28
29
|
export type VersionOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & FirstReleaseArgs & DockerVersionSchemeArgs & {
|
29
30
|
specifier?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,UAAU;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,UAAU;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAA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{
|
|
307
307
|
});
|
308
308
|
}
|
309
309
|
function withDockerVersionSchemeOptions(yargs) {
|
310
|
-
return yargs
|
310
|
+
return yargs
|
311
|
+
.option('dockerVersionScheme', {
|
311
312
|
type: 'string',
|
312
313
|
describe: 'Exact docker version scheme to apply to the selected release group. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.',
|
314
|
+
})
|
315
|
+
.option('dockerVersion', {
|
316
|
+
type: 'string',
|
317
|
+
describe: 'Exact docker version to use, bypassing the version scheme logic. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.',
|
318
|
+
})
|
319
|
+
.check((argv) => {
|
320
|
+
if (argv.dockerVersionScheme !== undefined &&
|
321
|
+
argv.dockerVersion !== undefined) {
|
322
|
+
throw new Error('The --dockerVersionScheme and --dockerVersion options are mutually exclusive, please use one or the other.');
|
323
|
+
}
|
324
|
+
return true;
|
313
325
|
});
|
314
326
|
}
|
@@ -372,8 +372,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
372
372
|
}
|
373
373
|
if (userConfig.version?.conventionalCommits === false) {
|
374
374
|
delete rootVersionWithoutGlobalOptions.generatorOptions
|
375
|
-
|
376
|
-
delete rootVersionWithoutGlobalOptions.generatorOptions
|
375
|
+
?.currentVersionResolver;
|
376
|
+
delete rootVersionWithoutGlobalOptions.generatorOptions?.specifierSource;
|
377
377
|
delete rootVersionWithoutGlobalOptions
|
378
378
|
.currentVersionResolver;
|
379
379
|
delete rootVersionWithoutGlobalOptions
|
@@ -155,12 +155,15 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
155
155
|
throw new Error(`Based on your config, the following projects were matched for publishing but do not have the "${requiredTargetName}" target specified:\n${[
|
156
156
|
...projectsToRun.map((p) => `- ${p.name}`),
|
157
157
|
'',
|
158
|
-
`This is usually caused by
|
158
|
+
`This is usually caused by either`,
|
159
|
+
`- not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "${requiredTargetName}" target for you automatically`,
|
160
|
+
`- having "private": true set in your package.json, which prevents the target from being created`,
|
159
161
|
].join('\n')}\n`);
|
160
162
|
}
|
161
163
|
await (0, tasks_execution_hooks_1.runPreTasksExecution)({
|
162
164
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
163
165
|
nxJsonConfiguration: nxJson,
|
166
|
+
argv: process.argv,
|
164
167
|
});
|
165
168
|
/**
|
166
169
|
* Run the relevant nx-release-publish executor on each of the selected projects.
|
@@ -184,6 +187,7 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
184
187
|
taskResults,
|
185
188
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
186
189
|
nxJsonConfiguration: nxJson,
|
190
|
+
argv: process.argv,
|
187
191
|
});
|
188
192
|
return publishProjectsResult;
|
189
193
|
}
|