nx 21.4.0-canary.20250809-014e775 → 21.4.0-canary.20250812-d2a0593

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "21.4.0-canary.20250809-014e775",
3
+ "version": "21.4.0-canary.20250812-d2a0593",
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.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"
86
+ "@nx/nx-darwin-arm64": "21.4.0-canary.20250812-d2a0593",
87
+ "@nx/nx-darwin-x64": "21.4.0-canary.20250812-d2a0593",
88
+ "@nx/nx-freebsd-x64": "21.4.0-canary.20250812-d2a0593",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.4.0-canary.20250812-d2a0593",
90
+ "@nx/nx-linux-arm64-gnu": "21.4.0-canary.20250812-d2a0593",
91
+ "@nx/nx-linux-arm64-musl": "21.4.0-canary.20250812-d2a0593",
92
+ "@nx/nx-linux-x64-gnu": "21.4.0-canary.20250812-d2a0593",
93
+ "@nx/nx-linux-x64-musl": "21.4.0-canary.20250812-d2a0593",
94
+ "@nx/nx-win32-arm64-msvc": "21.4.0-canary.20250812-d2a0593",
95
+ "@nx/nx-win32-x64-msvc": "21.4.0-canary.20250812-d2a0593"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -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;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,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,EAA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MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC5C;AAiJD,wBAAsB,aAAa,CACjC,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,iBAAiB,CAAC;IAC/C,QAAQ,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"}
@@ -385,28 +385,20 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
385
385
  }
386
386
  if (sanitizePath === 'task-graph.json') {
387
387
  const projectsParam = parsedUrl.searchParams.get('projects'); // Multiple projects
388
- const projectParam = parsedUrl.searchParams.get('project'); // Single project (for CLI)
389
388
  const targetName = parsedUrl.searchParams.get('target');
390
389
  const configuration = parsedUrl.searchParams.get('configuration');
391
390
  res.writeHead(200, { 'Content-Type': 'application/json' });
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)
391
+ if (projectsParam && targetName) {
392
+ // Multiple projects + target (UI: selected specific projects)
398
393
  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)));
394
+ return res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName, projectNames, configuration)));
404
395
  }
405
- else {
406
- // Case 4: Legacy - load all task graphs
407
- res.end(JSON.stringify(await createTaskGraphClientResponse()));
396
+ if (targetName) {
397
+ // Target only (UI: all projects with this target)
398
+ return res.end(JSON.stringify(await createTaskGraphsForTargetAndProjects(targetName)));
408
399
  }
409
- return;
400
+ // Legacy - load all task graphs
401
+ return res.end(JSON.stringify(await createTaskGraphClientResponse()));
410
402
  }
411
403
  if (sanitizePath === 'task-inputs.json') {
412
404
  node_perf_hooks_1.performance.mark('task input generation:start');
@@ -742,7 +734,7 @@ function clearTaskGraphCache() {
742
734
  * Creates task graphs for multiple projects with a specific target
743
735
  * If no projects specified, returns graphs for all projects with the target
744
736
  */
745
- async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
737
+ async function createTaskGraphsForTargetAndProjects(targetName, projectNames, configuration) {
746
738
  // Get project graph
747
739
  let graph;
748
740
  try {
@@ -771,7 +763,7 @@ async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
771
763
  const taskGraphs = {};
772
764
  const taskGraphErrors = {};
773
765
  for (const projectName of projectsToProcess) {
774
- const taskId = createTaskId(projectName, targetName);
766
+ const taskId = createTaskId(projectName, targetName, configuration);
775
767
  // Check cache first
776
768
  const cached = taskGraphCache.get(taskId);
777
769
  if (cached) {
@@ -781,7 +773,7 @@ async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
781
773
  }
782
774
  // Create task graph
783
775
  try {
784
- taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(graph, {}, [projectName], [targetName], undefined, {});
776
+ taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(graph, {}, [projectName], [targetName], configuration, {});
785
777
  }
786
778
  catch (err) {
787
779
  taskGraphs[taskId] = {
@@ -808,7 +800,7 @@ async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
808
800
  node_perf_hooks_1.performance.mark('target task hash plan generation:end');
809
801
  // Cache individual results for future requests
810
802
  for (const projectName of projectsToProcess) {
811
- const taskId = createTaskId(projectName, targetName);
803
+ const taskId = createTaskId(projectName, targetName, configuration);
812
804
  if (!taskGraphCache.has(taskId)) {
813
805
  taskGraphCache.set(taskId, {
814
806
  taskGraphs: { [taskId]: taskGraphs[taskId] },
@@ -823,69 +815,10 @@ async function createTaskGraphsForTargetAndProjects(targetName, projectNames) {
823
815
  node_perf_hooks_1.performance.measure('target task hash plan generation', 'target task hash plan generation:start', 'target task hash plan generation:end');
824
816
  return { taskGraphs, plans, errors: taskGraphErrors };
825
817
  }
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
- }
885
818
  async function getExpandedTaskInputs(taskId) {
886
819
  // Use the optimized version that only creates the specific task graph needed
887
820
  const [projectName, targetName, configuration] = taskId.split(':');
888
- const taskGraphResponse = await createSpecificTaskGraphResponse(projectName, targetName, configuration);
821
+ const taskGraphResponse = await createTaskGraphsForTargetAndProjects(targetName, [projectName], configuration);
889
822
  const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
890
823
  const inputs = taskGraphResponse.plans[taskId];
891
824
  if (inputs) {