nx 24.0.5 → 24.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/bin/nx.js +2 -8
  2. package/dist/bin/workspace-env.d.ts +7 -0
  3. package/dist/bin/workspace-env.js +20 -0
  4. package/dist/src/adapter/ngcli-adapter.js +7 -20
  5. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +0 -1
  6. package/dist/src/command-line/generate/generate.js +12 -23
  7. package/dist/src/command-line/graph/graph.js +1 -7
  8. package/dist/src/command-line/import/utils/prepare-source-repo.js +0 -3
  9. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +2 -2
  10. package/dist/src/command-line/init/init-v2.js +2 -2
  11. package/dist/src/command-line/migrate/migrate.js +4 -6
  12. package/dist/src/command-line/migrate/prompt-files.js +5 -5
  13. package/dist/src/command-line/migrate/run/orchestrator.js +2 -3
  14. package/dist/src/command-line/migrate/run/worker.js +7 -5
  15. package/dist/src/command-line/migrate/run-migration-process.js +3 -2
  16. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +1 -1
  17. package/dist/src/command-line/release/changelog.js +8 -39
  18. package/dist/src/command-line/release/config/use-legacy-versioning.js +1 -1
  19. package/dist/src/command-line/release/utils/diff.js +0 -14
  20. package/dist/src/command-line/release/utils/git.js +1 -1
  21. package/dist/src/command-line/reset/reset.js +13 -1
  22. package/dist/src/command-line/run/executor-utils.js +1 -1
  23. package/dist/src/command-line/show/show-target/utils.js +1 -1
  24. package/dist/src/command-line/watch/watch.js +1 -1
  25. package/dist/src/commands-runner/get-command-projects.js +0 -3
  26. package/dist/src/config/misc-interfaces.d.ts +0 -1
  27. package/dist/src/core/graph/main.js +1 -1
  28. package/dist/src/core/graph/styles.css +1 -1
  29. package/dist/src/core/graph/styles.js +1 -1
  30. package/dist/src/daemon/client/daemon-environment.d.ts +5 -3
  31. package/dist/src/daemon/client/daemon-environment.js +15 -3
  32. package/dist/src/devkit-internals.js +1 -1
  33. package/dist/src/executors/run-commands/running-tasks.d.ts +1 -0
  34. package/dist/src/executors/run-commands/running-tasks.js +69 -17
  35. package/dist/src/executors/run-script/run-script.impl.js +11 -3
  36. package/dist/src/hasher/hash-task.js +4 -4
  37. package/dist/src/hasher/task-hasher.js +2 -2
  38. package/dist/src/native/index.js +31 -3
  39. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  40. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  41. package/dist/src/native/transform-objects.js +5 -1
  42. package/dist/src/nx-cloud/update-manager.d.ts +6 -1
  43. package/dist/src/nx-cloud/update-manager.js +39 -12
  44. package/dist/src/nx-cloud/utilities/environment.js +0 -17
  45. package/dist/src/plugins/js/lock-file/bun-parser.js +0 -2
  46. package/dist/src/plugins/js/lock-file/npm-parser.js +1 -2
  47. package/dist/src/plugins/js/package-json/create-package-json.d.ts +1 -1
  48. package/dist/src/plugins/js/package-json/create-package-json.js +31 -13
  49. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +7 -1
  50. package/dist/src/plugins/js/utils/get-workspace-packages-from-graph.js +1 -1
  51. package/dist/src/plugins/js/utils/register.js +1 -1
  52. package/dist/src/project-graph/affected/affected-tasks.js +1 -1
  53. package/dist/src/tasks-runner/run-command.js +6 -7
  54. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +3 -2
  55. package/dist/src/tasks-runner/running-tasks/batch-process.js +7 -3
  56. package/dist/src/tasks-runner/task-orchestrator.js +1 -1
  57. package/dist/src/tasks-runner/utils.js +1 -12
  58. package/dist/src/ultracache/overrides.js +1 -1
  59. package/dist/src/utils/cache-directory.d.ts +3 -0
  60. package/dist/src/utils/cache-directory.js +105 -25
  61. package/dist/src/utils/child-process.d.ts +8 -1
  62. package/dist/src/utils/child-process.js +24 -0
  63. package/dist/src/utils/code-frames.js +0 -1
  64. package/dist/src/utils/compile-cache.d.ts +6 -8
  65. package/dist/src/utils/compile-cache.js +23 -16
  66. package/dist/src/utils/db-connection.js +6 -4
  67. package/dist/src/utils/min-release-age/behavior/pnpm.js +9 -9
  68. package/dist/src/utils/min-release-age/behavior/yarn.js +2 -2
  69. package/dist/src/utils/nx-tmp-dir.d.ts +14 -2
  70. package/dist/src/utils/nx-tmp-dir.js +26 -2
  71. package/dist/src/utils/package-json.js +40 -20
  72. package/dist/src/utils/package-manager.d.ts +15 -0
  73. package/dist/src/utils/package-manager.js +184 -2
  74. package/dist/src/utils/plugins/output.js +0 -2
  75. package/package.json +12 -12
@@ -15,6 +15,7 @@ const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
15
15
  const configuration_1 = require("../../config/configuration");
16
16
  const db_connection_1 = require("../../utils/db-connection");
17
17
  const update_manager_1 = require("../../nx-cloud/update-manager");
18
+ const package_manager_1 = require("../../utils/package-manager");
18
19
  // Wait at max 5 seconds before giving up on a failing operation.
19
20
  const INCREMENTAL_BACKOFF_MAX_DURATION = 5000;
20
21
  // If an operation fails, wait 100ms before first retry.
@@ -64,6 +65,14 @@ async function resetHandler(args) {
64
65
  },
65
66
  });
66
67
  }
68
+ if (all) {
69
+ await runResetStep(errors, {
70
+ start: 'Removing stale temporary package installs',
71
+ success: 'Removed stale temporary package installs',
72
+ failure: 'Failed to remove stale temporary package installs.',
73
+ run: async () => (0, package_manager_1.removeStaleTempInstallDirectories)(),
74
+ });
75
+ }
67
76
  if ((cloudEnabled && all) || args.onlyCloud) {
68
77
  await runResetStep(errors, {
69
78
  start: 'Cleaning up the Nx Cloud client',
@@ -124,7 +133,10 @@ async function resetCloudClient() {
124
133
  }
125
134
  function removeInstalledNxCloudClient() {
126
135
  return incrementalBackoff(INCREMENTAL_BACKOFF_FIRST_DELAY, INCREMENTAL_BACKOFF_MAX_DURATION, () => {
127
- (0, node_fs_1.rmSync)((0, update_manager_1.getBundleInstallDefaultLocation)(), { recursive: true, force: true });
136
+ const location = (0, update_manager_1.getBundleInstallDefaultLocation)();
137
+ if (location) {
138
+ (0, node_fs_1.rmSync)(location, { recursive: true, force: true });
139
+ }
128
140
  });
129
141
  }
130
142
  function cleanupCacheEntries() {
@@ -44,7 +44,7 @@ projects) {
44
44
  const batchImplementationFactory = executorConfig.batchImplementation
45
45
  ? (0, schema_utils_1.getImplementationFactory)(executorConfig.batchImplementation, executorsDir, nodeModule, projects)
46
46
  : null;
47
- // TODO(v25): remove custom hasher support.
47
+ // TODO(v25): remove custom hasher support (NXC-5052).
48
48
  const hasherFactory = executorConfig.hasher
49
49
  ? (0, schema_utils_1.getImplementationFactory)(executorConfig.hasher, executorsDir, nodeModule, projects)
50
50
  : null;
@@ -142,7 +142,7 @@ function validateConfiguration(projectName, targetName, configuration, targetCon
142
142
  }
143
143
  }
144
144
  // ── Custom hasher detection ──────────────────────────────────────────
145
- // TODO(v25): remove custom hasher support.
145
+ // TODO(v25): remove custom hasher support (NXC-5052).
146
146
  /**
147
147
  * Checks whether a target's executor defines a custom hasher.
148
148
  * Returns true if the executor has a hasherFactory — meaning the
@@ -88,7 +88,7 @@ class BatchCommandRunner extends BatchFunctionRunner {
88
88
  this._verbose &&
89
89
  output_1.output.logSingleLine('about to run commands with these environments: ' + JSON.stringify(envs));
90
90
  return Promise.all(envs.map((env) => {
91
- return new Promise((resolve, reject) => {
91
+ return new Promise((resolve) => {
92
92
  const commandExec = (0, child_process_1.spawn)(this.command, {
93
93
  stdio: 'inherit',
94
94
  shell: true,
@@ -16,17 +16,14 @@ function getSortedProjects(commandGraph, sortedProjects = []) {
16
16
  return getSortedProjects(newGraph, sortedProjects);
17
17
  }
18
18
  function removeIdsFromGraph(graph, ids, mapWithIds) {
19
- const filteredMapWithIds = {};
20
19
  const dependencies = {};
21
20
  const removedSet = new Set(ids);
22
21
  for (let id of Object.keys(mapWithIds)) {
23
22
  if (!removedSet.has(id)) {
24
- filteredMapWithIds[id] = mapWithIds[id];
25
23
  dependencies[id] = graph.dependencies[id].filter((depId) => !removedSet.has(depId));
26
24
  }
27
25
  }
28
26
  return {
29
- mapWithIds: filteredMapWithIds,
30
27
  dependencies: dependencies,
31
28
  roots: Object.keys(dependencies).filter((k) => dependencies[k].length === 0),
32
29
  };
@@ -23,7 +23,6 @@ export interface GeneratorsJsonEntry {
23
23
  cli?: 'nx';
24
24
  'x-type'?: 'library' | 'application';
25
25
  'x-deprecated'?: string;
26
- 'x-use-standalone-layout'?: boolean;
27
26
  }
28
27
  export type OutputCaptureMethod = 'direct-nodejs' | 'pipe';
29
28
  export interface ExecutorJsonEntryConfig {