nx 23.0.0-beta.2 → 23.0.0-beta.21

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 (274) hide show
  1. package/dist/bin/init-local.js +11 -20
  2. package/dist/bin/nx.d.ts +1 -0
  3. package/dist/bin/nx.js +28 -2
  4. package/dist/plugins/package-json.js +4 -2
  5. package/dist/src/adapter/ngcli-adapter.d.ts +2 -1
  6. package/dist/src/adapter/ngcli-adapter.js +25 -2
  7. package/dist/src/ai/clone-ai-config-repo.js +20 -3
  8. package/dist/src/analytics/analytics.js +10 -1
  9. package/dist/src/command-line/add/completion.d.ts +1 -0
  10. package/dist/src/command-line/add/completion.js +15 -0
  11. package/dist/src/command-line/affected/completion.d.ts +1 -0
  12. package/dist/src/command-line/affected/completion.js +15 -0
  13. package/dist/src/command-line/completion/argv-layout.d.ts +6 -0
  14. package/dist/src/command-line/completion/argv-layout.js +19 -0
  15. package/dist/src/command-line/completion/command-completions.d.ts +19 -0
  16. package/dist/src/command-line/completion/command-completions.js +120 -0
  17. package/dist/src/command-line/completion/command-handlers.d.ts +30 -0
  18. package/dist/src/command-line/completion/command-handlers.js +69 -0
  19. package/dist/src/command-line/completion/command-object.d.ts +10 -0
  20. package/dist/src/command-line/completion/command-object.js +95 -0
  21. package/dist/src/command-line/completion/completion-providers.d.ts +21 -0
  22. package/dist/src/command-line/completion/completion-providers.js +194 -0
  23. package/dist/src/command-line/completion/infix-targets.d.ts +1 -0
  24. package/dist/src/command-line/completion/infix-targets.js +48 -0
  25. package/dist/src/command-line/completion/metadata.d.ts +22 -0
  26. package/dist/src/command-line/completion/metadata.js +71 -0
  27. package/dist/src/command-line/completion/registrations.d.ts +9 -0
  28. package/dist/src/command-line/completion/registrations.js +16 -0
  29. package/dist/src/command-line/completion/scripts/bash.sh +51 -0
  30. package/dist/src/command-line/completion/scripts/fish.fish +47 -0
  31. package/dist/src/command-line/completion/scripts/powershell.ps1 +52 -0
  32. package/dist/src/command-line/completion/scripts/zsh.zsh +69 -0
  33. package/dist/src/command-line/completion/scripts.d.ts +18 -0
  34. package/dist/src/command-line/completion/scripts.js +140 -0
  35. package/dist/src/command-line/completion/trigger.d.ts +3 -0
  36. package/dist/src/command-line/completion/trigger.js +21 -0
  37. package/dist/src/command-line/completion/value-completions.d.ts +3 -0
  38. package/dist/src/command-line/completion/value-completions.js +21 -0
  39. package/dist/src/command-line/examples.js +1 -1
  40. package/dist/src/command-line/format/format.js +15 -5
  41. package/dist/src/command-line/generate/completion.d.ts +1 -0
  42. package/dist/src/command-line/generate/completion.js +9 -0
  43. package/dist/src/command-line/graph/completion.d.ts +1 -0
  44. package/dist/src/command-line/graph/completion.js +13 -0
  45. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +14 -18
  46. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +1 -0
  47. package/dist/src/command-line/init/implementation/utils.d.ts +7 -1
  48. package/dist/src/command-line/init/implementation/utils.js +51 -14
  49. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +22 -0
  50. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +100 -0
  51. package/dist/src/command-line/migrate/agentic/cli-args.d.ts +12 -0
  52. package/dist/src/command-line/migrate/agentic/cli-args.js +38 -0
  53. package/dist/src/command-line/migrate/agentic/definitions.d.ts +6 -0
  54. package/dist/src/command-line/migrate/agentic/definitions.js +98 -0
  55. package/dist/src/command-line/migrate/agentic/detect-installed.d.ts +10 -0
  56. package/dist/src/command-line/migrate/agentic/detect-installed.js +68 -0
  57. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +46 -0
  58. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +87 -0
  59. package/dist/src/command-line/migrate/agentic/handoff.d.ts +63 -0
  60. package/dist/src/command-line/migrate/agentic/handoff.js +183 -0
  61. package/dist/src/command-line/migrate/agentic/inception.d.ts +9 -0
  62. package/dist/src/command-line/migrate/agentic/inception.js +15 -0
  63. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +22 -0
  64. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +50 -0
  65. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +51 -0
  66. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +65 -0
  67. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +44 -0
  68. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +52 -0
  69. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +21 -0
  70. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +26 -0
  71. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +18 -0
  72. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +130 -0
  73. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +46 -0
  74. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +88 -0
  75. package/dist/src/command-line/migrate/agentic/run-step.d.ts +51 -0
  76. package/dist/src/command-line/migrate/agentic/run-step.js +121 -0
  77. package/dist/src/command-line/migrate/agentic/runner.d.ts +33 -0
  78. package/dist/src/command-line/migrate/agentic/runner.js +442 -0
  79. package/dist/src/command-line/migrate/agentic/select.d.ts +14 -0
  80. package/dist/src/command-line/migrate/agentic/select.js +150 -0
  81. package/dist/src/command-line/migrate/agentic/types.d.ts +102 -0
  82. package/dist/src/command-line/migrate/agentic/types.js +2 -0
  83. package/dist/src/command-line/migrate/command-object.d.ts +1 -0
  84. package/dist/src/command-line/migrate/command-object.js +32 -7
  85. package/dist/src/command-line/migrate/migrate-commits.d.ts +50 -0
  86. package/dist/src/command-line/migrate/migrate-commits.js +102 -0
  87. package/dist/src/command-line/migrate/migrate-output.d.ts +180 -0
  88. package/dist/src/command-line/migrate/migrate-output.js +258 -0
  89. package/dist/src/command-line/migrate/migrate.d.ts +122 -12
  90. package/dist/src/command-line/migrate/migrate.js +1036 -217
  91. package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
  92. package/dist/src/command-line/migrate/migration-shape.js +13 -0
  93. package/dist/src/command-line/migrate/multi-major.d.ts +30 -0
  94. package/dist/src/command-line/migrate/multi-major.js +185 -0
  95. package/dist/src/command-line/migrate/prompt-files.d.ts +31 -0
  96. package/dist/src/command-line/migrate/prompt-files.js +141 -0
  97. package/dist/src/command-line/migrate/run-migration-process.js +28 -6
  98. package/dist/src/command-line/migrate/safe-prompt.d.ts +28 -0
  99. package/dist/src/command-line/migrate/safe-prompt.js +49 -0
  100. package/dist/src/command-line/migrate/update-filters.d.ts +11 -0
  101. package/dist/src/command-line/migrate/update-filters.js +44 -0
  102. package/dist/src/command-line/migrate/version-utils.d.ts +6 -0
  103. package/dist/src/command-line/migrate/version-utils.js +59 -0
  104. package/dist/src/command-line/nx-commands.js +9 -0
  105. package/dist/src/command-line/release/config/config.d.ts +3 -6
  106. package/dist/src/command-line/release/config/config.js +77 -45
  107. package/dist/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  108. package/dist/src/command-line/release/config/use-legacy-versioning.js +8 -0
  109. package/dist/src/command-line/release/utils/release-graph.js +2 -3
  110. package/dist/src/command-line/release/utils/repository-git-tags.js +1 -1
  111. package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +7 -19
  112. package/dist/src/command-line/release/version/resolve-current-version.js +1 -1
  113. package/dist/src/command-line/release/version/version-actions.js +3 -7
  114. package/dist/src/command-line/report/report.js +2 -2
  115. package/dist/src/command-line/run/completion.d.ts +1 -0
  116. package/dist/src/command-line/run/completion.js +7 -0
  117. package/dist/src/command-line/run-many/completion.d.ts +1 -0
  118. package/dist/src/command-line/run-many/completion.js +13 -0
  119. package/dist/src/command-line/show/completion.d.ts +1 -0
  120. package/dist/src/command-line/show/completion.js +27 -0
  121. package/dist/src/command-line/show/show-target/info.d.ts +1 -0
  122. package/dist/src/command-line/show/show-target/info.js +100 -19
  123. package/dist/src/command-line/watch/command-object.js +24 -4
  124. package/dist/src/command-line/watch/completion.d.ts +1 -0
  125. package/dist/src/command-line/watch/completion.js +10 -0
  126. package/dist/src/command-line/watch/watch.d.ts +7 -0
  127. package/dist/src/command-line/watch/watch.js +1 -1
  128. package/dist/src/config/misc-interfaces.d.ts +25 -2
  129. package/dist/src/config/nx-json.d.ts +43 -56
  130. package/dist/src/config/schema-utils.d.ts +21 -0
  131. package/dist/src/config/schema-utils.js +92 -18
  132. package/dist/src/config/task-graph.d.ts +4 -107
  133. package/dist/src/core/graph/main.js +1 -1
  134. package/dist/src/core/graph/styles.css +2 -3
  135. package/dist/src/core/graph/styles.js +1 -1
  136. package/dist/src/daemon/client/client.d.ts +1 -1
  137. package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +1 -1
  138. package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +1 -1
  139. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +9 -0
  140. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +76 -0
  141. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +45 -11
  142. package/dist/src/daemon/server/server.js +4 -43
  143. package/dist/src/daemon/server/start.d.ts +1 -1
  144. package/dist/src/daemon/server/start.js +2 -0
  145. package/dist/src/devkit-exports.d.ts +2 -2
  146. package/dist/src/devkit-internals.d.ts +5 -1
  147. package/dist/src/devkit-internals.js +17 -1
  148. package/dist/src/executors/run-commands/running-tasks.d.ts +7 -0
  149. package/dist/src/executors/run-commands/running-tasks.js +178 -105
  150. package/dist/src/executors/run-script/run-script.impl.js +3 -10
  151. package/dist/src/executors/utils/convert-nx-executor.js +1 -1
  152. package/dist/src/hasher/hash-plan-inspector.d.ts +1 -1
  153. package/dist/src/hasher/task-hasher.js +6 -4
  154. package/dist/src/index.d.ts +1 -1
  155. package/dist/src/index.js +0 -3
  156. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +6 -2
  157. package/dist/src/migrations/update-17-0-0/move-cache-directory.md +31 -0
  158. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +20 -4
  159. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.md +27 -0
  160. package/dist/src/migrations/update-20-0-1/use-legacy-cache.md +24 -0
  161. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.md +49 -0
  162. package/dist/src/migrations/update-21-0-0/release-version-config-changes.md +54 -0
  163. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.md +28 -0
  164. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.md +22 -0
  165. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.md +11 -0
  166. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.d.ts +2 -0
  167. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +16 -0
  168. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +9 -0
  169. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +18 -0
  170. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.d.ts +35 -0
  171. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.js +139 -0
  172. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.md +66 -0
  173. package/dist/src/native/index.d.ts +79 -2
  174. package/dist/src/native/native-bindings.js +3 -0
  175. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  176. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  177. package/dist/src/plugins/js/lock-file/npm-parser.js +37 -19
  178. package/dist/src/plugins/js/lock-file/pnpm-parser.js +51 -4
  179. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +12 -4
  180. package/dist/src/plugins/js/utils/packages.js +1 -1
  181. package/dist/src/plugins/js/utils/register.d.ts +103 -14
  182. package/dist/src/plugins/js/utils/register.js +434 -39
  183. package/dist/src/plugins/js/utils/typescript.d.ts +7 -0
  184. package/dist/src/plugins/js/utils/typescript.js +39 -0
  185. package/dist/src/plugins/package-json/create-nodes.d.ts +3 -2
  186. package/dist/src/plugins/package-json/create-nodes.js +7 -5
  187. package/dist/src/project-graph/affected/locators/project-glob-changes.js +2 -1
  188. package/dist/src/project-graph/build-project-graph.d.ts +5 -0
  189. package/dist/src/project-graph/build-project-graph.js +6 -2
  190. package/dist/src/project-graph/file-map-utils.d.ts +5 -0
  191. package/dist/src/project-graph/file-map-utils.js +10 -1
  192. package/dist/src/project-graph/plugins/get-plugins.d.ts +7 -2
  193. package/dist/src/project-graph/plugins/get-plugins.js +8 -5
  194. package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
  195. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +2 -0
  196. package/dist/src/project-graph/plugins/resolve-plugin.d.ts +7 -4
  197. package/dist/src/project-graph/plugins/resolve-plugin.js +152 -33
  198. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +4 -2
  199. package/dist/src/project-graph/plugins/transpiler.d.ts +12 -0
  200. package/dist/src/project-graph/plugins/transpiler.js +37 -0
  201. package/dist/src/project-graph/plugins/utils.js +13 -7
  202. package/dist/src/project-graph/project-graph.js +1 -1
  203. package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +95 -4
  204. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +515 -68
  205. package/dist/src/project-graph/utils/project-configuration-utils.d.ts +13 -5
  206. package/dist/src/project-graph/utils/project-configuration-utils.js +14 -6
  207. package/dist/src/project-graph/utils/retrieve-workspace-files.js +1 -1
  208. package/dist/src/tasks-runner/create-task-graph.d.ts +4 -4
  209. package/dist/src/tasks-runner/create-task-graph.js +1 -1
  210. package/dist/src/tasks-runner/default-tasks-runner.d.ts +0 -2
  211. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
  212. package/dist/src/tasks-runner/forked-process-task-runner.js +11 -6
  213. package/dist/src/tasks-runner/init-tasks-runner.d.ts +0 -15
  214. package/dist/src/tasks-runner/init-tasks-runner.js +0 -63
  215. package/dist/src/tasks-runner/legacy-depends-on-warning.d.ts +18 -0
  216. package/dist/src/tasks-runner/legacy-depends-on-warning.js +109 -0
  217. package/dist/src/tasks-runner/life-cycle.d.ts +7 -8
  218. package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +6 -6
  219. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +13 -2
  220. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -5
  221. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +11 -2
  222. package/dist/src/tasks-runner/pseudo-terminal.d.ts +1 -1
  223. package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
  224. package/dist/src/tasks-runner/run-command.js +8 -11
  225. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +1 -1
  226. package/dist/src/tasks-runner/running-tasks/batch-process.js +3 -5
  227. package/dist/src/tasks-runner/running-tasks/node-child-process.d.ts +2 -2
  228. package/dist/src/tasks-runner/running-tasks/node-child-process.js +5 -7
  229. package/dist/src/tasks-runner/task-env.d.ts +1 -1
  230. package/dist/src/tasks-runner/task-env.js +6 -1
  231. package/dist/src/tasks-runner/task-orchestrator.d.ts +11 -1
  232. package/dist/src/tasks-runner/task-orchestrator.js +112 -38
  233. package/dist/src/tasks-runner/tasks-schedule.js +3 -3
  234. package/dist/src/tasks-runner/utils.d.ts +7 -8
  235. package/dist/src/tasks-runner/utils.js +23 -27
  236. package/dist/src/utils/child-process.js +2 -2
  237. package/dist/src/utils/compile-cache.d.ts +24 -0
  238. package/dist/src/utils/compile-cache.js +49 -0
  239. package/dist/src/utils/enable-compile-cache.d.ts +1 -0
  240. package/dist/src/utils/enable-compile-cache.js +7 -0
  241. package/dist/src/utils/fileutils.d.ts +0 -8
  242. package/dist/src/utils/fileutils.js +0 -40
  243. package/dist/src/utils/git-utils.d.ts +15 -0
  244. package/dist/src/utils/git-utils.js +138 -0
  245. package/dist/src/utils/handle-import.d.ts +4 -1
  246. package/dist/src/utils/handle-import.js +56 -2
  247. package/dist/src/utils/has-nx-js-plugin.d.ts +9 -0
  248. package/dist/src/utils/has-nx-js-plugin.js +24 -0
  249. package/dist/src/utils/installed-nx-version.d.ts +14 -4
  250. package/dist/src/utils/installed-nx-version.js +54 -7
  251. package/dist/src/utils/logger.d.ts +12 -1
  252. package/dist/src/utils/logger.js +57 -36
  253. package/dist/src/utils/nx-key.d.ts +0 -1
  254. package/dist/src/utils/nx-key.js +20 -23
  255. package/dist/src/utils/nx-package-group.d.ts +8 -0
  256. package/dist/src/utils/nx-package-group.js +15 -0
  257. package/dist/src/utils/output.d.ts +3 -2
  258. package/dist/src/utils/output.js +29 -28
  259. package/dist/src/utils/package-json.d.ts +14 -1
  260. package/dist/src/utils/package-json.js +20 -21
  261. package/dist/src/utils/perf-logging.js +3 -1
  262. package/dist/src/utils/plugin-cache-utils.d.ts +13 -4
  263. package/dist/src/utils/plugin-cache-utils.js +23 -13
  264. package/dist/src/utils/plugins/local-plugins.d.ts +18 -0
  265. package/dist/src/utils/plugins/local-plugins.js +30 -0
  266. package/dist/src/utils/tar.d.ts +8 -0
  267. package/dist/src/utils/tar.js +44 -0
  268. package/migrations.json +16 -0
  269. package/package.json +28 -28
  270. package/schemas/nx-schema.json +114 -80
  271. package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +0 -7
  272. package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +0 -155
  273. package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +0 -16
  274. package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +0 -121
@@ -169,11 +169,19 @@ function mergeCreateNodesResultsFromSinglePlugin(pluginResults, mergeFn, nodesMa
169
169
  /**
170
170
  * Merges create nodes results into a single rootMap.
171
171
  *
172
- * Default plugin results are merged twice: first into an intermediate
173
- * rootMap with unresolved spread sentinels preserved, so target
174
- * defaults selection sees the real merged shape of defaults; then
175
- * applied as a single layer onto the main rootMap where the preserved
176
- * spreads resolve against the specified + target-defaults base.
172
+ * Specified plugin results are merged once into the manager. Default
173
+ * plugin results are first staged into an intermediate rootMap (with
174
+ * `'...'` spreads deferred) so that synthesis can read each layer's
175
+ * contribution without re-running the merge. The synthetic result from
176
+ * `createTargetDefaultsResults` is then merged into the manager, and
177
+ * the staged intermediate is replayed on top — that replay is where
178
+ * deferred spreads expand against the final (specified + synth) base.
179
+ *
180
+ * Synthesis itself doesn't materialize a second rootMap. Per
181
+ * (root, target) it does an on-the-fly merge of the two layered
182
+ * contributions to learn the eventual executor/command, then matches
183
+ * defaults against that merged shape. This keeps specified-plugin
184
+ * merge work to a single pass.
177
185
  */
178
186
  function mergeCreateNodesResults(specifiedResults, defaultResults, nxJsonConfiguration, workspaceRoot, errors) {
179
187
  perf_hooks_1.performance.mark('createNodes:merge - start');
@@ -194,7 +202,7 @@ function mergeCreateNodesResults(specifiedResults, defaultResults, nxJsonConfigu
194
202
  for (const pluginResults of defaultResults) {
195
203
  mergeCreateNodesResultsFromSinglePlugin(pluginResults, mergeToIntermediate, nodesManager, intermediateDefaultRootMap, externalNodes, errors);
196
204
  }
197
- const targetDefaultsResults = (0, target_defaults_1.createTargetDefaultsResults)(nodesManager.getRootMap(), intermediateDefaultRootMap, nxJsonConfiguration);
205
+ const targetDefaultsResults = (0, target_defaults_1.createTargetDefaultsResults)(nodesManager.getRootMap(), intermediateDefaultRootMap, nxJsonConfiguration, configurationSourceMaps, defaultConfigurationSourceMaps);
198
206
  if (targetDefaultsResults.length > 0) {
199
207
  mergeCreateNodesResultsFromSinglePlugin(targetDefaultsResults, mergeToManager, nodesManager, nodesManager.getRootMap(), externalNodes, errors);
200
208
  }
@@ -65,7 +65,7 @@ async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, n
65
65
  (typeof p === 'object' && p.plugin === angular_json_1.NX_ANGULAR_JSON_PLUGIN_NAME))) {
66
66
  pluginsToLoad.push((0, path_1.join)(__dirname, '../../adapter/angular-json'));
67
67
  }
68
- const separatedPlugins = await (0, get_plugins_1.getPluginsSeparated)(workspaceRoot);
68
+ const separatedPlugins = await (0, get_plugins_1.getPluginsSeparated)(nxJson, workspaceRoot);
69
69
  const res = await retrieveProjectConfigurations(separatedPlugins, workspaceRoot, nxJson);
70
70
  return res;
71
71
  }
@@ -16,16 +16,16 @@ export declare class ProcessTasks {
16
16
  };
17
17
  private readonly allTargetNames;
18
18
  constructor(extraTargetDependencies: TargetDependencies, projectGraph: ProjectGraph);
19
- processTasks(projectNames: string[], targets: string[], configuration: string, overrides: Object, excludeTaskDependencies: boolean): string[];
20
- processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides: Object): void;
19
+ processTasks(projectNames: string[], targets: string[], configuration: string, overrides: Record<string, unknown>, excludeTaskDependencies: boolean): string[];
20
+ processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides: Record<string, unknown>): void;
21
21
  private processTasksForMultipleProjects;
22
22
  private processTasksForSingleProject;
23
23
  private processTasksForDependencies;
24
24
  private createDummyTask;
25
- createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides: Object): Task;
25
+ createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides: Record<string, unknown>): Task;
26
26
  resolveConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string | undefined): string;
27
27
  }
28
- export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Object, excludeTaskDependencies?: boolean): TaskGraph;
28
+ export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Record<string, unknown>, excludeTaskDependencies?: boolean): TaskGraph;
29
29
  export declare function mapTargetDefaultsToDependencies(defaults: TargetDefaults | undefined): TargetDependencies;
30
30
  /**
31
31
  * This function is used to filter out the dummy tasks from the dependencies
@@ -205,7 +205,7 @@ class ProcessTasks {
205
205
  projectRoot: project.data.root,
206
206
  overrides: interpolatedOverrides,
207
207
  outputs: (0, utils_1.getOutputs)(this.projectGraph.nodes, qualifiedTarget, interpolatedOverrides),
208
- cache: project.data.targets[target].cache,
208
+ cache: project.data.targets[target].cache ?? false,
209
209
  parallelism: project.data.targets[target].parallelism ?? true,
210
210
  continuous: project.data.targets[target].continuous ?? false,
211
211
  };
@@ -12,8 +12,6 @@ export declare abstract class RemoteCacheV2 {
12
12
  }
13
13
  export interface DefaultTasksRunnerOptions {
14
14
  parallel?: number;
15
- cacheableOperations?: string[];
16
- cacheableTargets?: string[];
17
15
  runtimeCacheInputs?: string[];
18
16
  cacheDirectory?: string;
19
17
  remoteCache?: RemoteCache;
@@ -37,6 +37,6 @@ export declare class ForkedProcessTaskRunner {
37
37
  private forkProcessWithPrefixAndNotTTY;
38
38
  private forkProcessDirectOutputCapture;
39
39
  private writeTerminalOutput;
40
- cleanup(signal?: NodeJS.Signals): void;
40
+ cleanup(signal?: NodeJS.Signals): Promise<void>;
41
41
  private setupProcessEventListeners;
42
42
  }
@@ -264,10 +264,8 @@ class ForkedProcessTaskRunner {
264
264
  writeTerminalOutput(outputPath, content) {
265
265
  (0, fs_1.writeFileSync)(outputPath, content);
266
266
  }
267
- cleanup(signal) {
268
- this.processes.forEach((p) => {
269
- p.kill(signal);
270
- });
267
+ async cleanup(signal) {
268
+ await Promise.all([...this.processes].map((p) => p.kill(signal)));
271
269
  this.cleanUpBatchProcesses();
272
270
  }
273
271
  setupProcessEventListeners() {
@@ -283,12 +281,19 @@ class ForkedProcessTaskRunner {
283
281
  };
284
282
  // When the nx process gets a message, it will be sent into the task's process
285
283
  process.on('message', messageHandler);
286
- // Terminate any task processes on exit
284
+ // Terminate any task processes on exit (sync, last resort).
285
+ // cleanup() is async but the initial signal dispatch is synchronous
286
+ // (killProcessTreeGraceful snapshots and signals before the async
287
+ // grace period). The grace period won't complete here, but each
288
+ // child also has its own sync exit handler as a final fallback.
287
289
  process.once('exit', () => {
288
290
  this.cleanup();
289
291
  process.off('message', messageHandler);
290
292
  });
291
- // Signal handlers removed - TaskOrchestrator owns signal handling
293
+ // No SIGINT/SIGTERM/SIGHUP handlers here. The orchestrator's
294
+ // setupSignalHandlers() owns signal dispatch and calls FPTR.cleanup()
295
+ // in the direct path; in the forked path the process is detached
296
+ // and never receives these signals from the OS.
292
297
  }
293
298
  }
294
299
  exports.ForkedProcessTaskRunner = ForkedProcessTaskRunner;
@@ -1,22 +1,7 @@
1
1
  import type { NxJsonConfiguration } from '../config/nx-json';
2
- import { NxArgs } from '../utils/command-line-utils';
3
2
  import { Task, TaskGraph } from '../config/task-graph';
4
3
  import { LifeCycle, TaskResult } from './life-cycle';
5
4
  import type { ProjectGraph } from '../config/project-graph';
6
5
  import { RunningTask } from './running-tasks/running-task';
7
- /**
8
- * This function is deprecated. Do not use this
9
- * @deprecated This function is deprecated. Do not use this
10
- */
11
- export declare function initTasksRunner(nxArgs: NxArgs): Promise<{
12
- invoke: (opts: {
13
- tasks: Task[];
14
- parallel: number;
15
- }) => Promise<{
16
- status: NodeJS.Process["exitCode"];
17
- taskGraph: TaskGraph;
18
- taskResults: Record<string, TaskResult>;
19
- }>;
20
- }>;
21
6
  export declare function runDiscreteTasks(tasks: Task[], projectGraph: ProjectGraph, taskGraphForHashing: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle): Promise<Array<Promise<TaskResult[]>>>;
22
7
  export declare function runContinuousTasks(tasks: Task[], projectGraph: ProjectGraph, taskGraphForHashing: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle): Promise<Record<string, Promise<RunningTask>>>;
@@ -1,78 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initTasksRunner = initTasksRunner;
4
3
  exports.runDiscreteTasks = runDiscreteTasks;
5
4
  exports.runContinuousTasks = runContinuousTasks;
6
- const nx_json_1 = require("../config/nx-json");
7
- const project_graph_1 = require("../project-graph/project-graph");
8
5
  const run_command_1 = require("./run-command");
9
6
  const invoke_runner_terminal_output_life_cycle_1 = require("./life-cycles/invoke-runner-terminal-output-life-cycle");
10
- const perf_hooks_1 = require("perf_hooks");
11
- const utils_1 = require("./utils");
12
7
  const dotenv_1 = require("../utils/dotenv");
13
8
  const life_cycle_1 = require("./life-cycle");
14
9
  const task_orchestrator_1 = require("./task-orchestrator");
15
10
  const create_task_hasher_1 = require("../hasher/create-task-hasher");
16
11
  const client_1 = require("../daemon/client/client");
17
12
  const task_results_life_cycle_1 = require("./life-cycles/task-results-life-cycle");
18
- /**
19
- * This function is deprecated. Do not use this
20
- * @deprecated This function is deprecated. Do not use this
21
- */
22
- async function initTasksRunner(nxArgs) {
23
- perf_hooks_1.performance.mark('init-local');
24
- (0, dotenv_1.loadRootEnvFiles)();
25
- const nxJson = (0, nx_json_1.readNxJson)();
26
- if (nxArgs.verbose) {
27
- process.env.NX_VERBOSE_LOGGING = 'true';
28
- }
29
- const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
30
- return {
31
- invoke: async (opts) => {
32
- perf_hooks_1.performance.mark('code-loading:end');
33
- // TODO: This polyfills the outputs if someone doesn't pass a task with outputs. Remove this in Nx 20
34
- opts.tasks.forEach((t) => {
35
- if (!t.outputs) {
36
- t.outputs = (0, utils_1.getOutputs)(projectGraph.nodes, t.target, t.overrides);
37
- }
38
- });
39
- const lifeCycle = new invoke_runner_terminal_output_life_cycle_1.InvokeRunnerTerminalOutputLifeCycle(opts.tasks);
40
- const taskGraph = {
41
- roots: opts.tasks.map((task) => task.id),
42
- tasks: opts.tasks.reduce((acc, task) => {
43
- acc[task.id] = task;
44
- return acc;
45
- }, {}),
46
- dependencies: opts.tasks.reduce((acc, task) => {
47
- acc[task.id] = [];
48
- return acc;
49
- }, {}),
50
- continuousDependencies: opts.tasks.reduce((acc, task) => {
51
- acc[task.id] = [];
52
- return acc;
53
- }, {}),
54
- };
55
- const taskResults = await (0, run_command_1.invokeTasksRunner)({
56
- tasks: opts.tasks,
57
- projectGraph,
58
- taskGraph,
59
- lifeCycle,
60
- nxJson,
61
- nxArgs: { ...nxArgs, parallel: opts.parallel },
62
- loadDotEnvFiles: true,
63
- initiatingProject: null,
64
- initiatingTasks: [],
65
- });
66
- return {
67
- status: Object.values(taskResults).some((taskResult) => taskResult.status === 'failure' || taskResult.status === 'skipped')
68
- ? 1
69
- : 0,
70
- taskGraph,
71
- taskResults,
72
- };
73
- },
74
- };
75
- }
76
13
  async function createOrchestrator(tasks, projectGraph, taskGraphForHashing, nxJson, lifeCycle) {
77
14
  (0, dotenv_1.loadRootEnvFiles)();
78
15
  const invokeRunnerTerminalLifecycle = new invoke_runner_terminal_output_life_cycle_1.InvokeRunnerTerminalOutputLifeCycle(tasks);
@@ -0,0 +1,18 @@
1
+ import { TargetDependencyConfig } from '../config/workspace-json-project-json';
2
+ type LegacyValue = 'self' | 'dependencies';
3
+ type LegacyEntry = TargetDependencyConfig & {
4
+ projects: LegacyValue;
5
+ };
6
+ export interface LegacyDependsOnViolation {
7
+ index: number;
8
+ originalEntry: LegacyEntry;
9
+ }
10
+ export interface LegacyDependsOnLocation {
11
+ ownerTarget?: string;
12
+ index?: number;
13
+ legacyViolations?: LegacyDependsOnViolation[];
14
+ }
15
+ export declare function warnLegacyDependsOnMagicString(currentProject: string | undefined, dependencyConfig: TargetDependencyConfig, location: LegacyDependsOnLocation | undefined): void;
16
+ export declare function flushLegacyDependsOnViolations(project: string, ownerTarget: string, violations: LegacyDependsOnViolation[], projectRoot: string | undefined): void;
17
+ export declare function __resetForTests(): void;
18
+ export {};
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warnLegacyDependsOnMagicString = warnLegacyDependsOnMagicString;
4
+ exports.flushLegacyDependsOnViolations = flushLegacyDependsOnViolations;
5
+ exports.__resetForTests = __resetForTests;
6
+ const nx_deps_cache_1 = require("../project-graph/nx-deps-cache");
7
+ const source_maps_1 = require("../project-graph/utils/project-configuration/source-maps");
8
+ const output_1 = require("../utils/output");
9
+ const warned = new Set();
10
+ const isInternal = (p) => !p || p.startsWith('nx/');
11
+ // Callers gate this on `dependencyConfig.projects` already being a legacy value;
12
+ // the inner cast snapshots that runtime guarantee into the type system.
13
+ function warnLegacyDependsOnMagicString(currentProject, dependencyConfig, location) {
14
+ const violation = {
15
+ index: location?.index ?? -1,
16
+ originalEntry: { ...dependencyConfig },
17
+ };
18
+ // Collector-aware caller (`getDependencyConfigs`) batches violations so the
19
+ // warning can group all offending entries for a single target. External
20
+ // callers fall through to an immediate per-entry warning.
21
+ if (location?.legacyViolations)
22
+ return void location.legacyViolations.push(violation);
23
+ flushLegacyDependsOnViolations(currentProject ?? '<unknown>', location?.ownerTarget ?? '<unknown>', [violation], undefined);
24
+ }
25
+ function flushLegacyDependsOnViolations(project, ownerTarget, violations, projectRoot) {
26
+ if (violations.length === 0)
27
+ return;
28
+ // Read source maps fresh each flush so daemon-cached maps don't go stale;
29
+ // only runs when violations exist, which is rare.
30
+ let sourceMaps = null;
31
+ try {
32
+ sourceMaps = (0, nx_deps_cache_1.readSourceMapsCache)();
33
+ }
34
+ catch { } // best-effort context
35
+ const map = projectRoot && sourceMaps ? sourceMaps[projectRoot] : undefined;
36
+ const arrayKey = `targets.${ownerTarget}.dependsOn`;
37
+ const items = violations.map((v) => {
38
+ const info = map
39
+ ? (0, source_maps_1.readArrayItemSourceInfo)(map, arrayKey, v.index)
40
+ : undefined;
41
+ return {
42
+ ...v,
43
+ value: v.originalEntry.projects,
44
+ plugin: info?.[1],
45
+ file: info?.[0] ?? undefined,
46
+ };
47
+ });
48
+ const shared = (key) => items.every((i) => i[key] === items[0][key]) ? items[0][key] : null;
49
+ const value = shared('value');
50
+ const plugin = shared('plugin');
51
+ const file = shared('file');
52
+ // External-plugin warnings are workspace-wide (the plugin's behavior, not a
53
+ // specific config): dedupe per (plugin, value) so the user sees one warning
54
+ // per offending plugin, not one per affected target.
55
+ const dedupeKey = plugin && !isInternal(plugin) && value
56
+ ? `plugin::${plugin}::${value}`
57
+ : `target::${project}::${ownerTarget}`;
58
+ if (warned.has(dedupeKey))
59
+ return;
60
+ warned.add(dedupeKey);
61
+ const n = items.length;
62
+ const word = n === 1 ? 'entry' : 'entries';
63
+ const deprecation = 'This is deprecated and will be removed in Nx v24 —';
64
+ let phrase;
65
+ if (value) {
66
+ phrase = `projects: '${value}'`;
67
+ }
68
+ else {
69
+ const self = items.filter((i) => i.value === 'self').length;
70
+ phrase = `legacy projects values (${self} 'self', ${n - self} 'dependencies')`;
71
+ }
72
+ let title;
73
+ let suppressBody = false;
74
+ if (plugin && !isInternal(plugin)) {
75
+ // Single external plugin: same plugin emits the same value across projects.
76
+ title = `The ${plugin} plugin infers dependsOn entries using ${phrase}. ${deprecation} please upgrade ${plugin} to a version that doesn't emit this.`;
77
+ suppressBody = true;
78
+ }
79
+ else if (plugin && isInternal(plugin) && file) {
80
+ // Single hand-authored config file — lead with the file path.
81
+ title = `${file} defines ${project}:${ownerTarget} with ${n} dependsOn ${word} using ${phrase}. ${deprecation} run 'nx repair' to fix this.`;
82
+ }
83
+ else {
84
+ // Mixed sources or no source-map info — tailor advice to what's offending.
85
+ const offending = Array.from(new Set(items
86
+ .filter((i) => i.plugin && !isInternal(i.plugin))
87
+ .map((i) => i.plugin)));
88
+ const origin = plugin
89
+ ? ` (set by ${plugin}${file ? ` in ${file}` : ''})`
90
+ : '';
91
+ const advice = offending.length
92
+ ? `run 'nx repair' for hand-authored entries and upgrade ${offending.join(', ')} for plugin-inferred entries`
93
+ : `run 'nx repair' to fix`;
94
+ title = `${project}:${ownerTarget} has ${n} dependsOn ${word} using ${phrase}${origin}. ${deprecation} ${advice}.`;
95
+ }
96
+ const bodyLines = suppressBody
97
+ ? []
98
+ : items.map((i) => {
99
+ const src = i.plugin && !plugin
100
+ ? ` from ${i.plugin}${i.file ? ` in ${i.file}` : ''}`
101
+ : '';
102
+ return ` - ${JSON.stringify(i.originalEntry)} (${i.index}${src})`;
103
+ });
104
+ output_1.output.warn({ title, bodyLines });
105
+ }
106
+ // Test-only: clears the process-wide dedupe set.
107
+ function __resetForTests() {
108
+ warned.clear();
109
+ }
@@ -1,19 +1,18 @@
1
1
  import { Task } from '../config/task-graph';
2
- import { BatchInfo, BatchStatus, ExternalObject, TaskStatus as NativeTaskStatus } from '../native';
2
+ import { BatchInfo, BatchStatus, ExternalObject, TaskResult, TaskStatus as NativeTaskStatus } from '../native';
3
3
  import { TaskStatus } from './tasks-runner';
4
4
  /**
5
- * The result of a completed {@link Task}
5
+ * The result of a completed {@link Task}.
6
+ *
7
+ * Defined as a Rust struct in `packages/nx/src/native/tasks/types.rs` and
8
+ * exposed to TypeScript via NAPI. Re-exported here so existing imports
9
+ * keep working.
6
10
  *
7
11
  * Task timing information (start and end timestamps) is available
8
12
  * on the {@link Task} object itself via {@link Task.startTime} and
9
13
  * {@link Task.endTime}.
10
14
  */
11
- export interface TaskResult {
12
- task: Task;
13
- status: TaskStatus;
14
- code: number;
15
- terminalOutput?: string;
16
- }
15
+ export type { TaskResult };
17
16
  /**
18
17
  * A map of {@link TaskResult} keyed by the ID of the completed {@link Task}s
19
18
  */
@@ -13,9 +13,10 @@ class InvokeRunnerTerminalOutputLifeCycle {
13
13
  output_1.output.log({
14
14
  color: 'cyan',
15
15
  title: `Running ${this.tasks.length} tasks:`,
16
- bodyLines: this.tasks.map((task) => `- Task ${task.id} ${task.overrides.__overrides_unparsed__.length > 0
17
- ? `Overrides: ${task.overrides.__overrides_unparsed__.join(' ')}`
18
- : ''}`),
16
+ bodyLines: this.tasks.map((task) => {
17
+ const unparsed = (0, utils_1.getUnparsedOverrideArgs)(task);
18
+ return `- Task ${task.id} ${unparsed.length > 0 ? `Overrides: ${unparsed.join(' ')}` : ''}`;
19
+ }),
19
20
  });
20
21
  output_1.output.addVerticalSeparatorWithoutNewLines('cyan');
21
22
  }
@@ -24,9 +25,8 @@ class InvokeRunnerTerminalOutputLifeCycle {
24
25
  const taskIds = this.tasks.map((task) => {
25
26
  const cached = this.cachedTasks.indexOf(task) !== -1;
26
27
  const failed = this.failedTasks.indexOf(task) !== -1;
27
- return `- Task ${task.id} ${task.overrides.__overrides_unparsed__.length > 0
28
- ? `Overrides: ${task.overrides.__overrides_unparsed__.join(' ')}`
29
- : ''} ${cached ? 'CACHED' : ''} ${failed ? 'FAILED' : ''}`;
28
+ const unparsed = (0, utils_1.getUnparsedOverrideArgs)(task);
29
+ return `- Task ${task.id} ${unparsed.length > 0 ? `Overrides: ${unparsed.join(' ')}` : ''} ${cached ? 'CACHED' : ''} ${failed ? 'FAILED' : ''}`;
30
30
  });
31
31
  if (this.failedTasks.length === 0) {
32
32
  output_1.output.addVerticalSeparatorWithoutNewLines('green');
@@ -61,11 +61,22 @@ class LegacyTaskHistoryLifeCycle {
61
61
  }
62
62
  printFlakyTasksMessage() {
63
63
  if (this.flakyTasks?.length > 0) {
64
+ const MAX_VISIBLE_FLAKY = 5;
65
+ const visibleFlaky = this.flakyTasks.length > MAX_VISIBLE_FLAKY + 1
66
+ ? this.flakyTasks.slice(0, MAX_VISIBLE_FLAKY)
67
+ : this.flakyTasks;
68
+ const hiddenCount = this.flakyTasks.length - visibleFlaky.length;
69
+ const flakyRows = visibleFlaky.map((t) => ` ${t}`);
70
+ if (hiddenCount > 0) {
71
+ flakyRows.push(` ${hiddenCount} more...`);
72
+ }
64
73
  output_1.output.warn({
65
- title: `Nx detected ${this.flakyTasks.length === 1 ? 'a flaky task' : ' flaky tasks'}`,
74
+ title: `Nx detected ${this.flakyTasks.length === 1
75
+ ? 'a flaky task'
76
+ : `${this.flakyTasks.length} flaky tasks`}`,
66
77
  bodyLines: [
67
78
  ,
68
- ...this.flakyTasks.map((t) => ` ${t}`),
79
+ ...flakyRows,
69
80
  ...((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
70
81
  ? []
71
82
  : [
@@ -79,14 +79,25 @@ class TaskHistoryLifeCycle {
79
79
  }
80
80
  printFlakyTasksMessage() {
81
81
  if (this.flakyTasks?.length > 0) {
82
+ const MAX_VISIBLE_FLAKY = 5;
83
+ const visibleFlaky = this.flakyTasks.length > MAX_VISIBLE_FLAKY + 1
84
+ ? this.flakyTasks.slice(0, MAX_VISIBLE_FLAKY)
85
+ : this.flakyTasks;
86
+ const hiddenCount = this.flakyTasks.length - visibleFlaky.length;
87
+ const flakyRows = visibleFlaky.map((hash) => {
88
+ const taskRun = this.taskRuns.get(hash);
89
+ return ` ${(0, serialize_target_1.serializeTarget)(taskRun.target.project, taskRun.target.target, taskRun.target.configuration)}`;
90
+ });
91
+ if (hiddenCount > 0) {
92
+ flakyRows.push(` ${hiddenCount} more...`);
93
+ }
82
94
  output_1.output.warn({
83
- title: `Nx detected ${this.flakyTasks.length === 1 ? 'a flaky task' : ' flaky tasks'}`,
95
+ title: `Nx detected ${this.flakyTasks.length === 1
96
+ ? 'a flaky task'
97
+ : `${this.flakyTasks.length} flaky tasks`}`,
84
98
  bodyLines: [
85
99
  ,
86
- ...this.flakyTasks.map((hash) => {
87
- const taskRun = this.taskRuns.get(hash);
88
- return ` ${(0, serialize_target_1.serializeTarget)(taskRun.target.project, taskRun.target.target, taskRun.target.configuration)}`;
89
- }),
100
+ ...flakyRows,
90
101
  ...((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
91
102
  ? []
92
103
  : [
@@ -67,6 +67,12 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
67
67
  displayStoppedTasks.add(taskId);
68
68
  inProgressTasks.delete(taskId);
69
69
  }
70
+ else if (taskStatus === 2 /* NativeTaskStatus.Skipped */) {
71
+ // Skipped tasks don't get an endTasks() call; clear them here so the run
72
+ // summary doesn't treat them as still-in-progress and report Cancelled.
73
+ tasksToTaskStatus[taskId] = 'skipped';
74
+ inProgressTasks.delete(taskId);
75
+ }
70
76
  };
71
77
  lifeCycle.endTasks = (taskResults) => {
72
78
  for (const { task, status, terminalOutput } of taskResults) {
@@ -132,10 +138,13 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
132
138
  (0, task_history_life_cycle_1.getTasksHistoryLifeCycle)().printFlakyTasksMessage();
133
139
  };
134
140
  const printRunOneSummary = ({ failure, cancelled, }) => {
135
- // Prints task outputs in the order they were completed
136
- // above the summary, since run-one should print all task results.
141
+ // Print task outputs in completion order above the summary.
137
142
  for (const taskId of taskIdsInTheOrderTheyStart) {
138
143
  const taskStatus = tasksToTaskStatus[taskId];
144
+ // Skipped tasks never ran; don't print a misleading `> nx run` header.
145
+ if (taskStatus === 'skipped') {
146
+ continue;
147
+ }
139
148
  const terminalOutput = getTerminalOutput(taskId);
140
149
  output_1.output.logCommandOutput(taskId, taskStatus, terminalOutput);
141
150
  }
@@ -45,7 +45,7 @@ export declare class PseudoTtyProcess implements RunningTask {
45
45
  onExit(callback: (code: number, terminalOutput: string) => void): void;
46
46
  onOutput(callback: (message: string) => void): void;
47
47
  getPid(): number | undefined;
48
- kill(s?: NodeJS.Signals): void;
48
+ kill(s?: NodeJS.Signals): Promise<void>;
49
49
  getParserAndWriter(): import("../native").ExternalObject<[import("../native").ParserArc, import("../native").WriterArc]>;
50
50
  }
51
51
  export declare class PseudoTtyProcessWithSend extends PseudoTtyProcess {
@@ -41,9 +41,14 @@ class PseudoTerminal {
41
41
  this.initialized = true;
42
42
  }
43
43
  shutdown(code) {
44
+ // Called from process.on('exit') — must be synchronous/best-effort.
45
+ // Use fire-and-forget killProcessTree, not the async graceful variant.
44
46
  for (const cp of this.childProcesses) {
45
47
  try {
46
- cp.kill((0, exit_codes_1.codeToSignal)(code));
48
+ const pid = cp.getPid();
49
+ if (pid) {
50
+ (0, native_1.killProcessTree)(pid, (0, exit_codes_1.codeToSignal)(code));
51
+ }
47
52
  }
48
53
  catch { }
49
54
  }
@@ -110,17 +115,24 @@ class PseudoTtyProcess {
110
115
  getPid() {
111
116
  return this.childProcess.getPid();
112
117
  }
113
- kill(s) {
118
+ async kill(s) {
114
119
  if (this.isAlive) {
115
- try {
116
- this.childProcess.kill(s || 'SIGTERM');
117
- }
118
- catch {
119
- // when the child process completes before we explicitly call kill, this will throw
120
- // do nothing
120
+ this.isAlive = false;
121
+ const pid = this.childProcess.getPid();
122
+ // Gracefully kill the entire process tree. This snapshots the tree
123
+ // BEFORE sending signals, so even if the root exits quickly from
124
+ // the signal, all descendants are already tracked and will be
125
+ // cleaned up (including any reparented to init/PID 1).
126
+ if (pid) {
127
+ await (0, native_1.killProcessTreeGraceful)(pid, s || 'SIGTERM');
121
128
  }
122
- finally {
123
- this.isAlive = false;
129
+ else {
130
+ try {
131
+ this.childProcess.kill(s || 'SIGTERM');
132
+ }
133
+ catch {
134
+ // child may have already exited
135
+ }
124
136
  }
125
137
  }
126
138
  }
@@ -22,6 +22,7 @@ const project_graph_1 = require("../project-graph/project-graph");
22
22
  const handle_errors_1 = require("../utils/handle-errors");
23
23
  const is_ci_1 = require("../utils/is-ci");
24
24
  const nx_cloud_utils_1 = require("../utils/nx-cloud-utils");
25
+ const logger_1 = require("../utils/logger");
25
26
  const nx_key_1 = require("../utils/nx-key");
26
27
  const output_1 = require("../utils/output");
27
28
  const sync_generators_1 = require("../utils/sync-generators");
@@ -324,6 +325,10 @@ async function runCommand(projectsToRun, currentProjectGraph, { nxJson }, nxArgs
324
325
  return status;
325
326
  }
326
327
  async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
328
+ // Kick off the license lookup in the background so it overlaps with task
329
+ // execution. The log itself is deferred to the print site below so it
330
+ // never lands in the middle of task output.
331
+ const nxKeyPromise = (0, nx_key_1.getNxKeyInformation)().catch(() => null);
327
332
  const projectNames = projectsToRun.map((t) => t.name);
328
333
  const projectNameSet = new Set(projectNames);
329
334
  const { projectGraph, taskGraph } = await ensureWorkspaceIsInSyncAndGetGraphs(currentProjectGraph, nxJson, projectNames, nxArgs, overrides, extraTargetDependencies, extraOptions);
@@ -348,7 +353,9 @@ async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }
348
353
  printSummary();
349
354
  }
350
355
  await printConfigureAiAgentsDisclaimer();
351
- await (0, nx_key_1.printNxKey)();
356
+ const nxKey = await nxKeyPromise;
357
+ if (nxKey)
358
+ logger_1.logger.log((0, nx_key_1.createNxKeyLicenseeInformation)(nxKey));
352
359
  return {
353
360
  taskResults,
354
361
  completed: didCommandComplete(tasks, taskResults),
@@ -826,12 +833,6 @@ function getTasksRunnerPath(runner, nxJson) {
826
833
  : defaultTasksRunnerPath;
827
834
  }
828
835
  function getRunnerOptions(runner, nxJson, nxArgs, isCloudDefault) {
829
- const defaultCacheableOperations = [];
830
- for (const key in nxJson.targetDefaults) {
831
- if (nxJson.targetDefaults[key].cache) {
832
- defaultCacheableOperations.push(key);
833
- }
834
- }
835
836
  const result = {
836
837
  ...nxJson.tasksRunnerOptions?.[runner]?.options,
837
838
  ...nxArgs,
@@ -858,10 +859,6 @@ function getRunnerOptions(runner, nxJson, nxArgs, isCloudDefault) {
858
859
  if (nxJson.cacheDirectory) {
859
860
  result.cacheDirectory ??= nxJson.cacheDirectory;
860
861
  }
861
- if (defaultCacheableOperations.length) {
862
- result.cacheableOperations ??= [];
863
- result.cacheableOperations = result.cacheableOperations.concat(defaultCacheableOperations);
864
- }
865
862
  if (nxJson.useDaemonProcess !== undefined) {
866
863
  result.useDaemonProcess ??= nxJson.useDaemonProcess;
867
864
  }
@@ -15,5 +15,5 @@ export declare class BatchProcess {
15
15
  onOutput(cb: (output: string) => void): void;
16
16
  getResults(): Promise<BatchResults>;
17
17
  send(message: Serializable): void;
18
- kill(signal?: NodeJS.Signals): void;
18
+ kill(signal?: NodeJS.Signals): Promise<void>;
19
19
  }