nx 21.4.0-canary.20250807-166a050 → 21.4.0-canary.20250809-014e775

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.
Files changed (31) hide show
  1. package/package.json +11 -11
  2. package/schemas/nx-schema.json +22 -1
  3. package/src/command-line/graph/graph.d.ts.map +1 -1
  4. package/src/command-line/graph/graph.js +218 -44
  5. package/src/command-line/mcp/command-object.d.ts.map +1 -1
  6. package/src/command-line/mcp/command-object.js +17 -13
  7. package/src/command-line/mcp/mcp.d.ts.map +1 -1
  8. package/src/command-line/mcp/mcp.js +2 -1
  9. package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
  10. package/src/command-line/migrate/migrate-ui-api.js +18 -8
  11. package/src/command-line/release/command-object.d.ts +1 -0
  12. package/src/command-line/release/command-object.d.ts.map +1 -1
  13. package/src/command-line/release/command-object.js +13 -1
  14. package/src/command-line/release/config/config.js +2 -2
  15. package/src/command-line/release/publish.js +5 -1
  16. package/src/command-line/release/version/release-group-processor.d.ts +1 -1
  17. package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
  18. package/src/command-line/release/version/release-group-processor.js +2 -2
  19. package/src/command-line/release/version.d.ts.map +1 -1
  20. package/src/command-line/release/version.js +1 -1
  21. package/src/core/graph/main.js +1 -1
  22. package/src/native/nx.wasm32-wasi.wasm +0 -0
  23. package/src/project-graph/plugins/public-api.d.ts +2 -0
  24. package/src/project-graph/plugins/public-api.d.ts.map +1 -1
  25. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +1 -1
  26. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -1
  27. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
  28. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +7 -12
  29. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +1 -1
  30. package/src/tasks-runner/run-command.d.ts.map +1 -1
  31. package/src/tasks-runner/run-command.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "21.4.0-canary.20250807-166a050",
3
+ "version": "21.4.0-canary.20250809-014e775",
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-canary.20250807-166a050",
87
- "@nx/nx-darwin-x64": "21.4.0-canary.20250807-166a050",
88
- "@nx/nx-freebsd-x64": "21.4.0-canary.20250807-166a050",
89
- "@nx/nx-linux-arm-gnueabihf": "21.4.0-canary.20250807-166a050",
90
- "@nx/nx-linux-arm64-gnu": "21.4.0-canary.20250807-166a050",
91
- "@nx/nx-linux-arm64-musl": "21.4.0-canary.20250807-166a050",
92
- "@nx/nx-linux-x64-gnu": "21.4.0-canary.20250807-166a050",
93
- "@nx/nx-linux-x64-musl": "21.4.0-canary.20250807-166a050",
94
- "@nx/nx-win32-arm64-msvc": "21.4.0-canary.20250807-166a050",
95
- "@nx/nx-win32-x64-msvc": "21.4.0-canary.20250807-166a050"
86
+ "@nx/nx-darwin-arm64": "21.4.0-canary.20250809-014e775",
87
+ "@nx/nx-darwin-x64": "21.4.0-canary.20250809-014e775",
88
+ "@nx/nx-freebsd-x64": "21.4.0-canary.20250809-014e775",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.4.0-canary.20250809-014e775",
90
+ "@nx/nx-linux-arm64-gnu": "21.4.0-canary.20250809-014e775",
91
+ "@nx/nx-linux-arm64-musl": "21.4.0-canary.20250809-014e775",
92
+ "@nx/nx-linux-x64-gnu": "21.4.0-canary.20250809-014e775",
93
+ "@nx/nx-linux-x64-musl": "21.4.0-canary.20250809-014e775",
94
+ "@nx/nx-win32-arm64-msvc": "21.4.0-canary.20250809-014e775",
95
+ "@nx/nx-win32-x64-msvc": "21.4.0-canary.20250809-014e775"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -783,7 +783,28 @@
783
783
  "manifestRootsToUpdate": {
784
784
  "type": "array",
785
785
  "items": {
786
- "type": "string"
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;AAMpC,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,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,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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;AAwoBD;;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"}
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,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ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M,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAuSf;AAm5BD;;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('open');
11
- const path_1 = require("path");
12
- const net = require("net");
13
- const perf_hooks_1 = require("perf_hooks");
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, path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
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, path_1.extname)(args.file);
238
- const fullFilePath = (0, path_1.isAbsolute)(args.file)
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, path_1.join)(workspaceFolder, args.file);
241
- const fileFolderPath = (0, path_1.dirname)(fullFilePath);
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, path_1.join)(fileFolderPath, 'static');
243
+ const assetsFolder = (0, node_path_1.join)(fileFolderPath, 'static');
244
244
  const assets = [];
245
- (0, node_fs_1.cpSync)((0, path_1.join)(__dirname, '../../core/graph'), assetsFolder, {
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, path_1.join)(assetsFolder, 'environment.js'), environmentJs);
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, path_1.dirname)(fullFilePath), { recursive: true });
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.all) {
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,45 @@ 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, path_1.basename)(parsedUrl.pathname);
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 projectParam = parsedUrl.searchParams.get('project'); // Single project (for CLI)
389
+ const targetName = parsedUrl.searchParams.get('target');
390
+ const configuration = parsedUrl.searchParams.get('configuration');
387
391
  res.writeHead(200, { 'Content-Type': 'application/json' });
388
- res.end(JSON.stringify(await createTaskGraphClientResponse()));
392
+ if (projectParam && targetName) {
393
+ // Case 1: Single project + target (CLI: nx build myapp --graph)
394
+ res.end(JSON.stringify(await createSpecificTaskGraphResponse(projectParam, targetName, configuration)));
395
+ }
396
+ else if (projectsParam && targetName) {
397
+ // Case 2: Multiple projects + target (UI: selected specific projects)
398
+ const projectNames = projectsParam.split(' ').filter(Boolean);
399
+ res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName, projectNames)));
400
+ }
401
+ else if (targetName) {
402
+ // Case 3: Target only (UI: all projects with this target)
403
+ res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName)));
404
+ }
405
+ else {
406
+ // Case 4: Legacy - load all task graphs
407
+ res.end(JSON.stringify(await createTaskGraphClientResponse()));
408
+ }
389
409
  return;
390
410
  }
391
411
  if (sanitizePath === 'task-inputs.json') {
392
- perf_hooks_1.performance.mark('task input generation:start');
412
+ node_perf_hooks_1.performance.mark('task input generation:start');
393
413
  const taskId = parsedUrl.searchParams.get('taskId');
394
414
  res.writeHead(200, { 'Content-Type': 'application/json' });
395
415
  const inputs = await getExpandedTaskInputs(taskId);
396
- perf_hooks_1.performance.mark('task input generation:end');
416
+ node_perf_hooks_1.performance.mark('task input generation:end');
397
417
  res.end(JSON.stringify({ [taskId]: inputs }));
398
- perf_hooks_1.performance.measure('task input generation', 'task input generation:start', 'task input generation:end');
418
+ node_perf_hooks_1.performance.measure('task input generation', 'task input generation:start', 'task input generation:end');
399
419
  return;
400
420
  }
401
421
  if (sanitizePath === 'source-maps.json') {
@@ -427,7 +447,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
427
447
  }
428
448
  return;
429
449
  }
430
- let pathname = (0, path_1.join)(__dirname, '../../core/graph/', sanitizePath);
450
+ let pathname = (0, node_path_1.join)(__dirname, '../../core/graph/', sanitizePath);
431
451
  // if the file is not found or is a directory, return index.html
432
452
  if (!(0, node_fs_1.existsSync)(pathname) || (0, node_fs_1.statSync)(pathname).isDirectory()) {
433
453
  res.writeHead(200, { 'Content-Type': 'text/html' });
@@ -436,7 +456,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
436
456
  }
437
457
  try {
438
458
  const data = (0, node_fs_1.readFileSync)(pathname);
439
- const ext = (0, path_1.parse)(pathname).ext;
459
+ const ext = (0, node_path_1.parse)(pathname).ext;
440
460
  res.setHeader('Content-type', mimeType[ext] || 'text/plain');
441
461
  res.end(data);
442
462
  }
@@ -530,6 +550,8 @@ function createFileWatcher() {
530
550
  output_1.output.note({ title: 'Graph changes updated.' });
531
551
  currentProjectGraphClientResponse = projectGraphClientResponse;
532
552
  currentSourceMapsClientResponse = sourceMapResponse;
553
+ // Clear task graph cache when project graph changes
554
+ clearTaskGraphCache();
533
555
  }
534
556
  else {
535
557
  output_1.output.note({ title: 'No graph changes found.' });
@@ -538,7 +560,7 @@ function createFileWatcher() {
538
560
  }, 500));
539
561
  }
540
562
  async function createProjectGraphAndSourceMapClientResponse(affected = []) {
541
- perf_hooks_1.performance.mark('project graph watch calculation:start');
563
+ node_perf_hooks_1.performance.mark('project graph watch calculation:start');
542
564
  let projectGraph;
543
565
  let sourceMaps;
544
566
  let isPartial = false;
@@ -573,8 +595,8 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
573
595
  }
574
596
  let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
575
597
  let fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap;
576
- perf_hooks_1.performance.mark('project graph watch calculation:end');
577
- perf_hooks_1.performance.mark('project graph response generation:start');
598
+ node_perf_hooks_1.performance.mark('project graph watch calculation:end');
599
+ node_perf_hooks_1.performance.mark('project graph response generation:start');
578
600
  const layout = (0, configuration_1.workspaceLayout)();
579
601
  const projects = Object.values(graph.nodes);
580
602
  const dependencies = graph.dependencies;
@@ -589,9 +611,9 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
589
611
  disabledTaskSyncGenerators,
590
612
  }));
591
613
  const hash = hasher.digest('hex');
592
- perf_hooks_1.performance.mark('project graph response generation:end');
593
- perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
594
- perf_hooks_1.performance.measure('project graph response generation', 'project graph response generation:start', 'project graph response generation:end');
614
+ node_perf_hooks_1.performance.mark('project graph response generation:end');
615
+ node_perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
616
+ node_perf_hooks_1.performance.measure('project graph response generation', 'project graph response generation:start', 'project graph response generation:end');
595
617
  return {
596
618
  projectGraphClientResponse: {
597
619
  ...currentProjectGraphClientResponse,
@@ -623,11 +645,11 @@ async function createTaskGraphClientResponse(pruneExternal = false) {
623
645
  graph = (0, operators_1.pruneExternalNodes)(graph);
624
646
  }
625
647
  const nxJson = (0, configuration_1.readNxJson)();
626
- perf_hooks_1.performance.mark('task graph generation:start');
648
+ node_perf_hooks_1.performance.mark('task graph generation:start');
627
649
  const taskGraphs = getAllTaskGraphsForWorkspace(graph);
628
- perf_hooks_1.performance.mark('task graph generation:end');
650
+ node_perf_hooks_1.performance.mark('task graph generation:end');
629
651
  const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
630
- perf_hooks_1.performance.mark('task hash plan generation:start');
652
+ node_perf_hooks_1.performance.mark('task hash plan generation:start');
631
653
  const plans = {};
632
654
  for (const individualTaskGraph of Object.values(taskGraphs.taskGraphs)) {
633
655
  for (const task of Object.values(individualTaskGraph.tasks)) {
@@ -637,16 +659,16 @@ async function createTaskGraphClientResponse(pruneExternal = false) {
637
659
  plans[task.id] = planner.getPlans([task.id], individualTaskGraph)[task.id];
638
660
  }
639
661
  }
640
- perf_hooks_1.performance.mark('task hash plan generation:end');
641
- perf_hooks_1.performance.measure('task graph generation', 'task graph generation:start', 'task graph generation:end');
642
- perf_hooks_1.performance.measure('task hash plan generation', 'task hash plan generation:start', 'task hash plan generation:end');
662
+ node_perf_hooks_1.performance.mark('task hash plan generation:end');
663
+ node_perf_hooks_1.performance.measure('task graph generation', 'task graph generation:start', 'task graph generation:end');
664
+ node_perf_hooks_1.performance.measure('task hash plan generation', 'task hash plan generation:start', 'task hash plan generation:end');
643
665
  return {
644
666
  ...taskGraphs,
645
667
  plans,
646
668
  };
647
669
  }
648
670
  async function createExpandedTaskInputResponse(taskGraphClientResponse, depGraphClientResponse) {
649
- perf_hooks_1.performance.mark('task input static generation:start');
671
+ node_perf_hooks_1.performance.mark('task input static generation:start');
650
672
  const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
651
673
  const response = {};
652
674
  Object.entries(taskGraphClientResponse.plans).forEach(([key, inputs]) => {
@@ -654,8 +676,8 @@ async function createExpandedTaskInputResponse(taskGraphClientResponse, depGraph
654
676
  const expandedInputs = expandInputs(inputs, depGraphClientResponse.projects.find((p) => p.name === project), allWorkspaceFiles, depGraphClientResponse);
655
677
  response[key] = expandedInputs;
656
678
  });
657
- perf_hooks_1.performance.mark('task input static generation:end');
658
- perf_hooks_1.performance.measure('task input static generation', 'task input static generation:start', 'task input static generation:end');
679
+ node_perf_hooks_1.performance.mark('task input static generation:end');
680
+ node_perf_hooks_1.performance.measure('task input static generation', 'task input static generation:start', 'task input static generation:end');
659
681
  return response;
660
682
  }
661
683
  function getAllTaskGraphsForWorkspace(projectGraph) {
@@ -709,13 +731,165 @@ function createTaskId(projectId, targetId, configurationId) {
709
731
  return `${projectId}:${targetId}`;
710
732
  }
711
733
  }
734
+ // Performance optimized functions for lazy loading task graphs
735
+ // In-memory cache for task graphs to avoid regeneration
736
+ const taskGraphCache = new Map();
737
+ // Clear cache when project graph changes
738
+ function clearTaskGraphCache() {
739
+ taskGraphCache.clear();
740
+ }
741
+ /**
742
+ * Creates task graphs for multiple projects with a specific target
743
+ * If no projects specified, returns graphs for all projects with the target
744
+ */
745
+ async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
746
+ // Get project graph
747
+ let graph;
748
+ try {
749
+ graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: false });
750
+ }
751
+ catch (e) {
752
+ if (e instanceof error_types_1.ProjectGraphError) {
753
+ graph = e.getPartialProjectGraph();
754
+ }
755
+ }
756
+ const nxJson = (0, configuration_1.readNxJson)();
757
+ // Determine which projects to process
758
+ let projectsToProcess;
759
+ if (projectNames && projectNames.length > 0) {
760
+ // Use specified projects (filter to only those that have the target)
761
+ projectsToProcess = projectNames.filter((projectName) => graph.nodes[projectName]?.data.targets?.[targetName]);
762
+ }
763
+ else {
764
+ // Get all projects with the target
765
+ projectsToProcess = Object.entries(graph.nodes)
766
+ .filter(([_, project]) => project.data.targets?.[targetName])
767
+ .map(([projectName]) => projectName);
768
+ }
769
+ node_perf_hooks_1.performance.mark(`target task graphs generation:start`);
770
+ // Create task graphs for each project
771
+ const taskGraphs = {};
772
+ const taskGraphErrors = {};
773
+ for (const projectName of projectsToProcess) {
774
+ const taskId = createTaskId(projectName, targetName);
775
+ // Check cache first
776
+ const cached = taskGraphCache.get(taskId);
777
+ if (cached) {
778
+ Object.assign(taskGraphs, cached.taskGraphs);
779
+ Object.assign(taskGraphErrors, cached.errors);
780
+ continue;
781
+ }
782
+ // Create task graph
783
+ try {
784
+ taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(graph, {}, [projectName], [targetName], undefined, {});
785
+ }
786
+ catch (err) {
787
+ taskGraphs[taskId] = {
788
+ tasks: {},
789
+ dependencies: {},
790
+ continuousDependencies: {},
791
+ roots: [],
792
+ };
793
+ taskGraphErrors[taskId] = err.message;
794
+ }
795
+ }
796
+ node_perf_hooks_1.performance.mark(`target task graphs generation:end`);
797
+ // Generate hash plans
798
+ const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
799
+ node_perf_hooks_1.performance.mark('target task hash plan generation:start');
800
+ const plans = {};
801
+ for (const taskGraph of Object.values(taskGraphs)) {
802
+ const taskIds = Object.keys(taskGraph.tasks);
803
+ if (taskIds.length > 0) {
804
+ const taskPlans = planner.getPlans(taskIds, taskGraph);
805
+ Object.assign(plans, taskPlans);
806
+ }
807
+ }
808
+ node_perf_hooks_1.performance.mark('target task hash plan generation:end');
809
+ // Cache individual results for future requests
810
+ for (const projectName of projectsToProcess) {
811
+ const taskId = createTaskId(projectName, targetName);
812
+ if (!taskGraphCache.has(taskId)) {
813
+ taskGraphCache.set(taskId, {
814
+ taskGraphs: { [taskId]: taskGraphs[taskId] },
815
+ plans: Object.fromEntries(Object.entries(plans).filter(([key]) => key.startsWith(projectName))),
816
+ errors: taskGraphErrors[taskId]
817
+ ? { [taskId]: taskGraphErrors[taskId] }
818
+ : {},
819
+ });
820
+ }
821
+ }
822
+ node_perf_hooks_1.performance.measure(`target task graphs generation for ${targetName}`, `target task graphs generation:start`, `target task graphs generation:end`);
823
+ node_perf_hooks_1.performance.measure('target task hash plan generation', 'target task hash plan generation:start', 'target task hash plan generation:end');
824
+ return { taskGraphs, plans, errors: taskGraphErrors };
825
+ }
826
+ /**
827
+ * Creates a task graph response for a specific project and target
828
+ * This is much faster than generating all task graphs upfront
829
+ */
830
+ async function createSpecificTaskGraphResponse(projectName, targetName, configuration) {
831
+ const taskId = createTaskId(projectName, targetName, configuration);
832
+ // Check cache first
833
+ const cached = taskGraphCache.get(taskId);
834
+ if (cached) {
835
+ return cached;
836
+ }
837
+ let graph;
838
+ try {
839
+ graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: false });
840
+ }
841
+ catch (e) {
842
+ if (e instanceof error_types_1.ProjectGraphError) {
843
+ graph = e.getPartialProjectGraph();
844
+ }
845
+ }
846
+ const nxJson = (0, configuration_1.readNxJson)();
847
+ node_perf_hooks_1.performance.mark(`specific task graph generation:start`);
848
+ // Create only the specific task graph requested
849
+ const taskGraphs = {};
850
+ const taskGraphErrors = {};
851
+ try {
852
+ taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(graph, {}, [projectName], [targetName], configuration, {});
853
+ }
854
+ catch (err) {
855
+ taskGraphs[taskId] = {
856
+ tasks: {},
857
+ dependencies: {},
858
+ continuousDependencies: {},
859
+ roots: [],
860
+ };
861
+ taskGraphErrors[taskId] = err.message;
862
+ }
863
+ node_perf_hooks_1.performance.mark(`specific task graph generation:end`);
864
+ const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
865
+ node_perf_hooks_1.performance.mark('specific task hash plan generation:start');
866
+ const plans = {};
867
+ // Get plans for all tasks in the task graph
868
+ const taskIds = Object.keys(taskGraphs[taskId].tasks);
869
+ if (taskIds.length > 0) {
870
+ const taskPlans = planner.getPlans(taskIds, taskGraphs[taskId]);
871
+ Object.assign(plans, taskPlans);
872
+ }
873
+ node_perf_hooks_1.performance.mark('specific task hash plan generation:end');
874
+ const result = {
875
+ taskGraphs,
876
+ plans,
877
+ errors: taskGraphErrors,
878
+ };
879
+ // Cache the result
880
+ taskGraphCache.set(taskId, result);
881
+ node_perf_hooks_1.performance.measure(`specific task graph generation for ${taskId}`, `specific task graph generation:start`, `specific task graph generation:end`);
882
+ node_perf_hooks_1.performance.measure('specific task hash plan generation', 'specific task hash plan generation:start', 'specific task hash plan generation:end');
883
+ return result;
884
+ }
712
885
  async function getExpandedTaskInputs(taskId) {
713
- const [project] = taskId.split(':');
714
- const taskGraphResponse = await createTaskGraphClientResponse(false);
886
+ // Use the optimized version that only creates the specific task graph needed
887
+ const [projectName, targetName, configuration] = taskId.split(':');
888
+ const taskGraphResponse = await createSpecificTaskGraphResponse(projectName, targetName, configuration);
715
889
  const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
716
890
  const inputs = taskGraphResponse.plans[taskId];
717
891
  if (inputs) {
718
- return expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name === project), allWorkspaceFiles, currentProjectGraphClientResponse);
892
+ return expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name === projectName), allWorkspaceFiles, currentProjectGraphClientResponse);
719
893
  }
720
894
  return {};
721
895
  }
@@ -752,7 +926,7 @@ function expandInputs(inputs, project, allWorkspaceFiles, depGraphClientResponse
752
926
  const workspaceRootsExpanded = getExpandedWorkspaceRoots(workspaceRootInputs, allWorkspaceFiles);
753
927
  const otherInputsExpanded = otherInputs.map((input) => {
754
928
  if (input === 'TsConfig') {
755
- return (0, path_1.relative)(workspace_root_1.workspaceRoot, (0, typescript_1.getRootTsConfigPath)());
929
+ return (0, node_path_1.relative)(workspace_root_1.workspaceRoot, (0, typescript_1.getRootTsConfigPath)());
756
930
  }
757
931
  if (input === 'ProjectConfiguration') {
758
932
  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,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,eAAe,EAAE,aAqB7B,CAAC"}
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
- builder: (y) => y
8
- .version(false)
9
- .strict(false)
10
- .parserConfiguration({
11
- 'unknown-options-as-args': true,
12
- 'populate--': true,
13
- })
14
- .usage('')
15
- .help(false)
16
- .showHelp(async () => {
17
- await (await Promise.resolve().then(() => require('./mcp'))).showHelp();
18
- process.exit(0);
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,iBAOzC;AAED,wBAAsB,QAAQ,kBAa7B"}
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
- (0, child_process_1.spawnSync)(packageManagerCommands.dlx, ['-y', 'nx-mcp@latest', ...args['_']], {
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,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;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,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"}
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;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wB,sBAAsB;0BAxVhC,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;EA6VvB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,IACpC,wBAAwB,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
- (0, child_process_1.execSync)('git add migrations.json', {
134
- cwd: workspacePath,
135
- encoding: 'utf-8',
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
- (0, child_process_1.execSync)('git add migrations.json', {
167
- cwd: workspacePath,
168
- encoding: 'utf-8',
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;AAG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,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAC7C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,aAAa,CA0Ed,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,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,M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