@depup/nx 23.2.1-depup.7 → 23.3.0-depup.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 (350) hide show
  1. package/README.md +8 -19
  2. package/changes.json +10 -54
  3. package/dist/bin/init-local.js +7 -1
  4. package/dist/nx-cloud-internals.d.ts +1 -0
  5. package/dist/nx-cloud-internals.js +9 -0
  6. package/dist/plugins/package-json.js +1 -1
  7. package/dist/src/command-line/add/add.js +5 -1
  8. package/dist/src/command-line/affected/affected.js +70 -9
  9. package/dist/src/command-line/affected/command-object.js +1 -1
  10. package/dist/src/command-line/format/format.js +2 -18
  11. package/dist/src/command-line/graph/graph.d.ts +31 -0
  12. package/dist/src/command-line/graph/graph.js +113 -20
  13. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +0 -3
  14. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +0 -3
  15. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +0 -3
  16. package/dist/src/command-line/init/implementation/angular/index.js +0 -3
  17. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +0 -3
  18. package/dist/src/command-line/init/implementation/format.js +2 -3
  19. package/dist/src/command-line/init/implementation/utils.d.ts +0 -1
  20. package/dist/src/command-line/init/implementation/utils.js +6 -9
  21. package/dist/src/command-line/init/init-v2.js +0 -3
  22. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +25 -0
  23. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +121 -5
  24. package/dist/src/command-line/migrate/agentic/close-agent-session.d.ts +21 -0
  25. package/dist/src/command-line/migrate/agentic/close-agent-session.js +126 -0
  26. package/dist/src/command-line/migrate/agentic/definitions.d.ts +24 -0
  27. package/dist/src/command-line/migrate/agentic/definitions.js +79 -20
  28. package/dist/src/command-line/migrate/agentic/format-command.d.ts +14 -0
  29. package/dist/src/command-line/migrate/agentic/format-command.js +44 -0
  30. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +3 -3
  31. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +3 -3
  32. package/dist/src/command-line/migrate/agentic/handoff.d.ts +50 -17
  33. package/dist/src/command-line/migrate/agentic/handoff.js +166 -24
  34. package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +23 -0
  35. package/dist/src/command-line/migrate/agentic/instruction-files.js +41 -0
  36. package/dist/src/command-line/migrate/agentic/master/invocations.d.ts +12 -0
  37. package/dist/src/command-line/migrate/agentic/master/invocations.js +54 -0
  38. package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +16 -0
  39. package/dist/src/command-line/migrate/agentic/master/run-master-session.js +175 -0
  40. package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +31 -0
  41. package/dist/src/command-line/migrate/agentic/master/spawn-master.js +222 -0
  42. package/dist/src/command-line/migrate/agentic/prompts/final-validation.d.ts +13 -0
  43. package/dist/src/command-line/migrate/agentic/prompts/final-validation.js +41 -0
  44. package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +17 -0
  45. package/dist/src/command-line/migrate/agentic/prompts/fragments.js +90 -0
  46. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +4 -3
  47. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +25 -1
  48. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +57 -34
  49. package/dist/src/command-line/migrate/agentic/run-step.js +28 -4
  50. package/dist/src/command-line/migrate/agentic/runner.d.ts +3 -15
  51. package/dist/src/command-line/migrate/agentic/runner.js +57 -239
  52. package/dist/src/command-line/migrate/agentic/terminal-repair.d.ts +1 -0
  53. package/dist/src/command-line/migrate/agentic/terminal-repair.js +27 -0
  54. package/dist/src/command-line/migrate/agentic/types.d.ts +23 -8
  55. package/dist/src/command-line/migrate/agentic/types.js +10 -7
  56. package/dist/src/command-line/migrate/agentic/windows-cmd.d.ts +33 -0
  57. package/dist/src/command-line/migrate/agentic/windows-cmd.js +88 -0
  58. package/dist/src/command-line/migrate/command-object.d.ts +2 -0
  59. package/dist/src/command-line/migrate/command-object.js +11 -1
  60. package/dist/src/command-line/migrate/deferred-output.d.ts +44 -0
  61. package/dist/src/command-line/migrate/deferred-output.js +92 -0
  62. package/dist/src/command-line/migrate/execute-migration.d.ts +9 -3
  63. package/dist/src/command-line/migrate/execute-migration.js +53 -16
  64. package/dist/src/command-line/migrate/migrate-analytics.d.ts +34 -9
  65. package/dist/src/command-line/migrate/migrate-analytics.js +71 -10
  66. package/dist/src/command-line/migrate/migrate-commits.d.ts +5 -4
  67. package/dist/src/command-line/migrate/migrate-commits.js +16 -6
  68. package/dist/src/command-line/migrate/migrate-config.d.ts +5 -2
  69. package/dist/src/command-line/migrate/migrate-config.js +19 -11
  70. package/dist/src/command-line/migrate/migrate-output.d.ts +3 -7
  71. package/dist/src/command-line/migrate/migrate-output.js +3 -7
  72. package/dist/src/command-line/migrate/migrate.d.ts +3 -0
  73. package/dist/src/command-line/migrate/migrate.js +183 -46
  74. package/dist/src/command-line/migrate/resolve-package-version.js +2 -19
  75. package/dist/src/command-line/migrate/run/agent-output.d.ts +11 -0
  76. package/dist/src/command-line/migrate/run/agent-output.js +21 -2
  77. package/dist/src/command-line/migrate/run/agent-work-payload.d.ts +37 -0
  78. package/dist/src/command-line/migrate/run/agent-work-payload.js +156 -0
  79. package/dist/src/command-line/migrate/run/atomic-write.d.ts +8 -0
  80. package/dist/src/command-line/migrate/run/atomic-write.js +17 -0
  81. package/dist/src/command-line/migrate/run/broker.d.ts +150 -0
  82. package/dist/src/command-line/migrate/run/broker.js +568 -0
  83. package/dist/src/command-line/migrate/run/clean-retry.d.ts +12 -0
  84. package/dist/src/command-line/migrate/run/clean-retry.js +99 -0
  85. package/dist/src/command-line/migrate/run/existing-run-report.d.ts +55 -0
  86. package/dist/src/command-line/migrate/run/existing-run-report.js +227 -0
  87. package/dist/src/command-line/migrate/run/give-up.d.ts +41 -0
  88. package/dist/src/command-line/migrate/run/give-up.js +148 -0
  89. package/dist/src/command-line/migrate/run/index.d.ts +9 -6
  90. package/dist/src/command-line/migrate/run/index.js +21 -2
  91. package/dist/src/command-line/migrate/run/issues.d.ts +127 -0
  92. package/dist/src/command-line/migrate/run/issues.js +1121 -0
  93. package/dist/src/command-line/migrate/run/orchestrator.d.ts +59 -1
  94. package/dist/src/command-line/migrate/run/orchestrator.js +1529 -457
  95. package/dist/src/command-line/migrate/run/run-id.d.ts +0 -8
  96. package/dist/src/command-line/migrate/run/run-id.js +0 -30
  97. package/dist/src/command-line/migrate/run/run-state.d.ts +77 -17
  98. package/dist/src/command-line/migrate/run/run-state.js +263 -32
  99. package/dist/src/command-line/migrate/run/runbook.d.ts +18 -0
  100. package/dist/src/command-line/migrate/run/runbook.js +118 -0
  101. package/dist/src/command-line/migrate/run/state-lock.d.ts +33 -2
  102. package/dist/src/command-line/migrate/run/state-lock.js +128 -2
  103. package/dist/src/command-line/migrate/run/state-machine.d.ts +50 -1
  104. package/dist/src/command-line/migrate/run/state-machine.js +339 -26
  105. package/dist/src/command-line/migrate/run/util.d.ts +3 -1
  106. package/dist/src/command-line/migrate/run/util.js +24 -3
  107. package/dist/src/command-line/migrate/run/worker.js +290 -129
  108. package/dist/src/command-line/migrate/step-actions.d.ts +1 -1
  109. package/dist/src/command-line/migrate/step-actions.js +7 -1
  110. package/dist/src/command-line/migrate/text.d.ts +6 -0
  111. package/dist/src/command-line/migrate/text.js +25 -0
  112. package/dist/src/command-line/migrate/version-skew-guard.js +2 -0
  113. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +5 -11
  114. package/dist/src/command-line/release/publish.js +11 -8
  115. package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
  116. package/dist/src/command-line/release/utils/release-graph.js +1 -1
  117. package/dist/src/command-line/release/utils/remote-release-clients/github.js +5 -8
  118. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +3 -3
  119. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +4 -2
  120. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +37 -3
  121. package/dist/src/command-line/release/version/version-actions.d.ts +3 -0
  122. package/dist/src/command-line/reset/reset.js +10 -4
  123. package/dist/src/command-line/run/run-one.js +5 -1
  124. package/dist/src/command-line/run-many/run-many.js +6 -12
  125. package/dist/src/command-line/show/command-object.js +1 -1
  126. package/dist/src/command-line/show/projects.js +52 -1
  127. package/dist/src/command-line/yargs-utils/shared-options.d.ts +5 -1
  128. package/dist/src/command-line/yargs-utils/shared-options.js +38 -4
  129. package/dist/src/config/task-graph.d.ts +1 -1
  130. package/dist/src/config/workspace-json-project-json.d.ts +23 -1
  131. package/dist/src/core/graph/main.js +1 -1
  132. package/dist/src/core/graph/runtime.js +1 -1
  133. package/dist/src/core/graph/styles.js +1 -1
  134. package/dist/src/daemon/client/client.d.ts +14 -8
  135. package/dist/src/daemon/client/client.js +41 -12
  136. package/dist/src/daemon/message-types/get-plugin-capabilities.d.ts +5 -0
  137. package/dist/src/daemon/message-types/get-plugin-capabilities.js +11 -0
  138. package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +3 -2
  139. package/dist/src/daemon/message-types/select-affected-tasks.d.ts +21 -0
  140. package/dist/src/daemon/message-types/select-affected-tasks.js +11 -0
  141. package/dist/src/daemon/message-types/ultracache-configuration-version.d.ts +8 -0
  142. package/dist/src/daemon/message-types/ultracache-configuration-version.js +2 -0
  143. package/dist/src/daemon/server/dotenv-graph-changes.d.ts +1 -1
  144. package/dist/src/daemon/server/dotenv-graph-changes.js +2 -2
  145. package/dist/src/daemon/server/handle-get-plugin-capabilities.d.ts +2 -0
  146. package/dist/src/daemon/server/handle-get-plugin-capabilities.js +13 -0
  147. package/dist/src/daemon/server/handle-hash-tasks.d.ts +10 -2
  148. package/dist/src/daemon/server/handle-hash-tasks.js +18 -3
  149. package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +3 -0
  150. package/dist/src/daemon/server/handle-select-affected-tasks.js +26 -0
  151. package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
  152. package/dist/src/daemon/server/{handle-outputs-changes.d.ts → handle-watch-events.d.ts} +4 -4
  153. package/dist/src/daemon/server/{handle-outputs-changes.js → handle-watch-events.js} +36 -37
  154. package/dist/src/daemon/server/outputs-tracking.d.ts +7 -19
  155. package/dist/src/daemon/server/outputs-tracking.js +7 -107
  156. package/dist/src/daemon/server/planning-context.d.ts +8 -0
  157. package/dist/src/daemon/server/planning-context.js +18 -0
  158. package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +22 -7
  159. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +104 -74
  160. package/dist/src/daemon/server/restart-checks.d.ts +22 -0
  161. package/dist/src/daemon/server/restart-checks.js +77 -0
  162. package/dist/src/daemon/server/server.d.ts +1 -0
  163. package/dist/src/daemon/server/server.js +54 -30
  164. package/dist/src/daemon/server/shutdown-utils.d.ts +0 -5
  165. package/dist/src/daemon/server/shutdown-utils.js +3 -26
  166. package/dist/src/daemon/server/ultracache-configuration-state.d.ts +7 -0
  167. package/dist/src/daemon/server/ultracache-configuration-state.js +36 -0
  168. package/dist/src/devkit-internals.d.ts +3 -1
  169. package/dist/src/devkit-internals.js +8 -3
  170. package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -1
  171. package/dist/src/executors/run-commands/run-commands.impl.js +19 -5
  172. package/dist/src/executors/run-commands/running-tasks.d.ts +5 -4
  173. package/dist/src/executors/run-commands/running-tasks.js +13 -13
  174. package/dist/src/hasher/create-task-hasher.d.ts +8 -1
  175. package/dist/src/hasher/create-task-hasher.js +13 -3
  176. package/dist/src/hasher/hash-plan-inspector.js +2 -2
  177. package/dist/src/hasher/hash-task.d.ts +2 -2
  178. package/dist/src/hasher/hash-task.js +28 -17
  179. package/dist/src/hasher/native-task-hasher-impl.d.ts +20 -4
  180. package/dist/src/hasher/native-task-hasher-impl.js +75 -9
  181. package/dist/src/hasher/task-hasher.d.ts +24 -7
  182. package/dist/src/hasher/task-hasher.js +27 -8
  183. package/dist/src/hasher/task-planning-context.d.ts +13 -0
  184. package/dist/src/hasher/task-planning-context.js +12 -0
  185. package/dist/src/native/index.d.ts +582 -21
  186. package/dist/src/native/index.js +3 -3
  187. package/dist/src/native/native-bindings.js +13 -1
  188. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  189. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  190. package/dist/src/native/transform-objects.d.ts +11 -2
  191. package/dist/src/native/transform-objects.js +46 -0
  192. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +15 -8
  193. package/dist/src/nx-cloud/update-manager.d.ts +3 -0
  194. package/dist/src/nx-cloud/update-manager.js +19 -13
  195. package/dist/src/nx-cloud/utilities/client.d.ts +1 -1
  196. package/dist/src/nx-cloud/utilities/client.js +1 -1
  197. package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +2 -1
  198. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.d.ts +5 -0
  199. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.js +16 -0
  200. package/dist/src/nx-cloud/utilities/url-shorten.js +17 -10
  201. package/dist/src/plugins/js/index.js +45 -64
  202. package/dist/src/plugins/js/lock-file/lock-file.d.ts +4 -4
  203. package/dist/src/plugins/js/lock-file/lock-file.js +6 -7
  204. package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -1
  205. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +2 -0
  206. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +22 -0
  207. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +10 -2
  208. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +51 -29
  209. package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +10 -2
  210. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +32 -11
  211. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +22 -18
  212. package/dist/src/plugins/js/utils/register.js +13 -4
  213. package/dist/src/plugins/package-json/create-nodes.d.ts +2 -2
  214. package/dist/src/plugins/package-json/create-nodes.js +13 -13
  215. package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +14 -0
  216. package/dist/src/project-graph/affected/affected-project-graph.js +5 -18
  217. package/dist/src/project-graph/affected/affected-projects.d.ts +7 -0
  218. package/dist/src/project-graph/affected/affected-projects.js +42 -0
  219. package/dist/src/project-graph/affected/affected-reasons.d.ts +116 -0
  220. package/dist/src/project-graph/affected/affected-reasons.js +459 -0
  221. package/dist/src/project-graph/affected/affected-tasks.d.ts +103 -0
  222. package/dist/src/project-graph/affected/affected-tasks.js +386 -0
  223. package/dist/src/project-graph/affected/print-explanation.d.ts +11 -0
  224. package/dist/src/project-graph/affected/print-explanation.js +44 -0
  225. package/dist/src/project-graph/error-types.d.ts +5 -0
  226. package/dist/src/project-graph/error-types.js +44 -5
  227. package/dist/src/project-graph/file-utils.d.ts +2 -0
  228. package/dist/src/project-graph/file-utils.js +12 -3
  229. package/dist/src/project-graph/nx-deps-cache.d.ts +5 -2
  230. package/dist/src/project-graph/nx-deps-cache.js +4 -4
  231. package/dist/src/project-graph/plugins/get-plugins.d.ts +3 -1
  232. package/dist/src/project-graph/plugins/get-plugins.js +60 -82
  233. package/dist/src/project-graph/plugins/in-process-loader.d.ts +1 -1
  234. package/dist/src/project-graph/plugins/in-process-loader.js +1 -4
  235. package/dist/src/project-graph/plugins/isolation/index.d.ts +1 -1
  236. package/dist/src/project-graph/plugins/isolation/index.js +3 -1
  237. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +8 -0
  238. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +42 -6
  239. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.d.ts +10 -1
  240. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.js +67 -17
  241. package/dist/src/project-graph/plugins/isolation/messaging.d.ts +3 -2
  242. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +5 -1
  243. package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -2
  244. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +14 -1
  245. package/dist/src/project-graph/plugins/nx-plugin-capabilities.d.ts +6 -0
  246. package/dist/src/project-graph/plugins/nx-plugin-capabilities.js +28 -0
  247. package/dist/src/project-graph/plugins/task-results-stub.d.ts +50 -0
  248. package/dist/src/project-graph/plugins/task-results-stub.js +111 -0
  249. package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -2
  250. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +14 -1
  251. package/dist/src/project-graph/project-graph.js +43 -42
  252. package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
  253. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +83 -0
  254. package/dist/src/project-graph/utils/project-configuration/utils.d.ts +1 -0
  255. package/dist/src/project-graph/utils/project-configuration/utils.js +1 -0
  256. package/dist/src/tasks-runner/batch/run-batch.js +15 -0
  257. package/dist/src/tasks-runner/cache.d.ts +37 -2
  258. package/dist/src/tasks-runner/cache.js +42 -1
  259. package/dist/src/tasks-runner/create-task-graph.d.ts +24 -1
  260. package/dist/src/tasks-runner/create-task-graph.js +57 -2
  261. package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
  262. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
  263. package/dist/src/tasks-runner/forked-process-task-runner.js +11 -10
  264. package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
  265. package/dist/src/tasks-runner/init-tasks-runner.js +15 -7
  266. package/dist/src/tasks-runner/is-tui-enabled.js +4 -3
  267. package/dist/src/tasks-runner/life-cycle.d.ts +7 -0
  268. package/dist/src/tasks-runner/life-cycle.js +7 -0
  269. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.d.ts +35 -0
  270. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +146 -0
  271. package/dist/src/tasks-runner/prune-task-graph.d.ts +17 -0
  272. package/dist/src/tasks-runner/prune-task-graph.js +45 -0
  273. package/dist/src/tasks-runner/run-command.d.ts +41 -5
  274. package/dist/src/tasks-runner/run-command.js +98 -22
  275. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +93 -19
  276. package/dist/src/tasks-runner/running-tasks/batch-process.js +184 -88
  277. package/dist/src/tasks-runner/task-io-service.d.ts +11 -3
  278. package/dist/src/tasks-runner/task-io-service.js +14 -5
  279. package/dist/src/tasks-runner/task-orchestrator.d.ts +71 -4
  280. package/dist/src/tasks-runner/task-orchestrator.js +266 -66
  281. package/dist/src/tasks-runner/tasks-runner.d.ts +2 -0
  282. package/dist/src/tasks-runner/terminal-output-path.d.ts +11 -0
  283. package/dist/src/tasks-runner/terminal-output-path.js +18 -0
  284. package/dist/src/tasks-runner/utils.d.ts +5 -0
  285. package/dist/src/tasks-runner/utils.js +14 -2
  286. package/dist/src/ultracache/config.d.ts +21 -0
  287. package/dist/src/ultracache/config.js +29 -0
  288. package/dist/src/ultracache/fetch.d.ts +21 -0
  289. package/dist/src/ultracache/fetch.js +43 -0
  290. package/dist/src/ultracache/overrides.d.ts +17 -0
  291. package/dist/src/ultracache/overrides.js +61 -0
  292. package/dist/src/ultracache/report.d.ts +13 -0
  293. package/dist/src/ultracache/report.js +62 -0
  294. package/dist/src/ultracache/store.d.ts +41 -0
  295. package/dist/src/ultracache/store.js +158 -0
  296. package/dist/src/utils/ab-testing.d.ts +4 -1
  297. package/dist/src/utils/ab-testing.js +22 -19
  298. package/dist/src/utils/chunkify.d.ts +1 -7
  299. package/dist/src/utils/chunkify.js +2 -8
  300. package/dist/src/utils/command-line-utils.d.ts +20 -0
  301. package/dist/src/utils/command-line-utils.js +10 -3
  302. package/dist/src/utils/create-cli-options.d.ts +6 -0
  303. package/dist/src/utils/create-cli-options.js +29 -0
  304. package/dist/src/utils/db-connection.d.ts +2 -0
  305. package/dist/src/utils/db-connection.js +2 -0
  306. package/dist/src/utils/formatters/index.d.ts +6 -0
  307. package/dist/src/utils/formatters/index.js +5 -0
  308. package/dist/src/utils/formatters/prettier.d.ts +0 -8
  309. package/dist/src/utils/formatters/prettier.js +4 -26
  310. package/dist/src/utils/git-utils.d.ts +19 -0
  311. package/dist/src/utils/git-utils.js +97 -39
  312. package/dist/src/utils/handle-errors.js +5 -43
  313. package/dist/src/utils/http-client.d.ts +27 -0
  314. package/dist/src/utils/http-client.js +193 -0
  315. package/dist/src/utils/installed-nx-version.js +2 -48
  316. package/dist/src/utils/json-diff.d.ts +4 -2
  317. package/dist/src/utils/json-diff.js +6 -94
  318. package/dist/src/utils/min-release-age/packument.js +1 -1
  319. package/dist/src/utils/nx-cloud-utils.d.ts +2 -0
  320. package/dist/src/utils/nx-cloud-utils.js +6 -1
  321. package/dist/src/utils/output.d.ts +22 -3
  322. package/dist/src/utils/output.js +28 -5
  323. package/dist/src/utils/package-json.d.ts +25 -0
  324. package/dist/src/utils/package-json.js +49 -6
  325. package/dist/src/utils/package-manager.d.ts +6 -0
  326. package/dist/src/utils/package-manager.js +10 -0
  327. package/dist/src/utils/plugins/plugin-capabilities.js +7 -2
  328. package/dist/src/utils/project-graph-utils.d.ts +2 -0
  329. package/dist/src/utils/project-graph-utils.js +12 -0
  330. package/dist/src/utils/provenance.js +20 -4
  331. package/dist/src/utils/serialize-overrides-into-command-line.js +2 -4
  332. package/dist/src/utils/workspace-context.d.ts +51 -3
  333. package/dist/src/utils/workspace-context.js +174 -10
  334. package/package.json +38 -100
  335. package/schemas/nx-schema.json +38 -0
  336. package/schemas/project-schema.json +35 -0
  337. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +0 -9
  338. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +0 -76
  339. package/dist/src/daemon/server/watcher.d.ts +0 -18
  340. package/dist/src/daemon/server/watcher.js +0 -126
  341. package/dist/src/nx-cloud/utilities/axios.d.ts +0 -4
  342. package/dist/src/nx-cloud/utilities/axios.js +0 -17
  343. package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +0 -2
  344. package/dist/src/project-graph/affected/locators/project-glob-changes.js +0 -47
  345. package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +0 -4
  346. package/dist/src/project-graph/affected/locators/workspace-json-changes.js +0 -47
  347. package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +0 -3
  348. package/dist/src/project-graph/affected/locators/workspace-projects.js +0 -74
  349. package/dist/src/utils/collapse-expanded-outputs.d.ts +0 -10
  350. package/dist/src/utils/collapse-expanded-outputs.js +0 -72
@@ -1 +1 @@
1
- (()=>{"use strict";var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,e=[],n.O=(r,t,o,i)=>{if(!t){var a=1/0;for(c=0;c<e.length;c++){for(var[t,o,i]=e[c],l=!0,u=0;u<t.length;u++)(!1&i||a>=i)&&Object.keys(n.O).every(e=>n.O[e](t[u]))?t.splice(u--,1):(l=!1,i<a&&(a=i));if(l){e.splice(c--,1);var f=o();void 0!==f&&(r=f)}}return r}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[t,o,i]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={121:0};n.O.j=r=>0===e[r];var r=(r,t)=>{var o,i,[a,l,u]=t,f=0;if(a.some(r=>0!==e[r])){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)var c=u(n)}for(r&&r(t);f<a.length;f++)i=a[f],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(c)},t=self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
1
+ (()=>{"use strict";var e={};const r={};function t(n){const o=r[n];if(void 0!==o)return o.exports;const i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}t.m=e,(()=>{const e=[];t.O=(r,n,o,i)=>{if(n){i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];return void(e[l]=[n,o,i])}let a=1/0;for(l=0;l<e.length;l++){let[n,o,i]=e[l],u=!0;for(var c=0;c<n.length;c++)(!1&i||a>=i)&&Object.keys(t.O).every(e=>t.O[e](n[c]))?n.splice(c--,1):(u=!1,i<a&&(a=i));if(u){e.splice(l--,1);const t=o();void 0!==t&&(r=t)}}return r}})(),t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var o=r[n++],i=r[n++];t.o(e,o)?0===i&&n++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.dn=e=>{var r=Object.getOwnPropertyDescriptor(e,"name");(!r||!r.writable&&r.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={121:0};t.O.j=r=>0===e[r];const r=(r,n)=>{let[o,i,l]=n;var a,c,u=0;if(o.some(r=>0!==e[r])){for(a in i)t.o(i,a)&&(t.m[a]=i[a]);if(l)var f=l(t)}for(r&&r(n);u<o.length;u++)c=o[u],t.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return t.O(f)},n=self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})()})();
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[]).push([[869],{1296(){}},e=>{var n;n=1296,e(e.s=n)}]);
1
+ "use strict";(self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[]).push([[869],{4091(){}},e=>{var n;n=4091,e(e.s=n)}]);
@@ -1,12 +1,17 @@
1
1
  import { ChildProcess } from 'child_process';
2
2
  import { FileData, ProjectGraph } from '../../config/project-graph';
3
3
  import { Task, TaskGraph } from '../../config/task-graph';
4
+ import type { UltracacheConfigurationVersion } from '../message-types/ultracache-configuration-version';
4
5
  import { Hash } from '../../hasher/task-hasher';
5
- import { NxWorkspaceFiles, TaskRun, TaskTarget } from '../../native';
6
- import { PostTasksExecutionContext, PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
6
+ import { NxWorkspaceFiles, TaskOutputs, TaskRun, TaskTarget } from '../../native';
7
+ import { PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
8
+ import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
7
9
  import { ConfigurationSourceMaps } from '../../project-graph/utils/project-configuration/source-maps';
8
10
  import type { FlushSyncGeneratorChangesResult, SyncGeneratorRunResult } from '../../utils/sync-generators';
9
11
  import { type ConfigureAiAgentsStatusResponse } from '../message-types/configure-ai-agents';
12
+ import { type SelectAffectedTasksResponse } from '../message-types/select-affected-tasks';
13
+ import type { AffectedTasksRequest } from '../../project-graph/affected/affected-tasks';
14
+ import type { NxPluginCapabilities } from '../../project-graph/plugins/nx-plugin-capabilities';
10
15
  import { type NxConsoleStatusResponse, type SetNxConsolePreferenceAndInstallResponse } from '../message-types/nx-console';
11
16
  /** A refused connect: the errno, and the path it was made against. */
12
17
  type ConnectRefusal = {
@@ -56,7 +61,8 @@ export declare class DaemonClient {
56
61
  sourceMaps: ConfigurationSourceMaps;
57
62
  }>;
58
63
  getAllFileData(): Promise<FileData[]>;
59
- hashTasks(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean): Promise<Hash[]>;
64
+ hashTasks(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean, ultracacheConfigurationsVersion?: UltracacheConfigurationVersion): Promise<Hash[]>;
65
+ hashTasksUpfront(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean, ultracacheConfigurationsVersion?: UltracacheConfigurationVersion): Promise<Record<string, Hash>>;
60
66
  registerFileWatcher(config: {
61
67
  watchProjects: string[] | 'all';
62
68
  includeGlobalWorkspaceFiles?: boolean;
@@ -74,10 +80,7 @@ export declare class DaemonClient {
74
80
  } | null) => void): Promise<UnregisterCallback>;
75
81
  private reconnectProjectGraphListener;
76
82
  processInBackground(requirePath: string, data: any): Promise<any>;
77
- recordOutputsHashBatch(entries: {
78
- outputs: string[];
79
- hash: string;
80
- }[]): Promise<any>;
83
+ recordOutputsHashBatch(entries: TaskOutputs[]): Promise<any>;
81
84
  outputsHashesMatchBatch(entries: {
82
85
  outputs: string[];
83
86
  hash: string;
@@ -98,9 +101,12 @@ export declare class DaemonClient {
98
101
  globalGenerators: string[];
99
102
  taskGenerators: string[];
100
103
  }>;
104
+ getPluginCapabilities(): Promise<NxPluginCapabilities[]>;
105
+ /** Selection runs where hashing does, so the plans it builds are reused. */
106
+ selectAffectedTasks(request: AffectedTasksRequest): Promise<SelectAffectedTasksResponse>;
101
107
  updateWorkspaceContext(createdFiles: string[], updatedFiles: string[], deletedFiles: string[]): Promise<void>;
102
108
  runPreTasksExecution(context: PreTasksExecutionContext): Promise<NodeJS.ProcessEnv[]>;
103
- runPostTasksExecution(context: PostTasksExecutionContext): Promise<void>;
109
+ runPostTasksExecution(context: MaybeStubbedPostTasksExecutionContext): Promise<void>;
104
110
  getNxConsoleStatus(): Promise<NxConsoleStatusResponse>;
105
111
  setNxConsolePreferenceAndInstall(preference: boolean): Promise<SetNxConsolePreferenceAndInstallResponse>;
106
112
  getConfigureAiAgentsStatus(): Promise<ConfigureAiAgentsStatusResponse>;
@@ -11,6 +11,7 @@ const path_1 = require("path");
11
11
  const perf_hooks_1 = require("perf_hooks");
12
12
  const configuration_1 = require("../../config/configuration");
13
13
  const nx_json_1 = require("../../config/nx-json");
14
+ const prune_task_graph_1 = require("../../tasks-runner/prune-task-graph");
14
15
  const native_1 = require("../../native");
15
16
  const error_types_1 = require("../../project-graph/error-types");
16
17
  const typescript_1 = require("../../plugins/js/utils/typescript");
@@ -34,6 +35,8 @@ const get_context_file_data_1 = require("../message-types/get-context-file-data"
34
35
  const get_files_in_directory_1 = require("../message-types/get-files-in-directory");
35
36
  const get_nx_workspace_files_1 = require("../message-types/get-nx-workspace-files");
36
37
  const get_registered_sync_generators_1 = require("../message-types/get-registered-sync-generators");
38
+ const get_plugin_capabilities_1 = require("../message-types/get-plugin-capabilities");
39
+ const select_affected_tasks_1 = require("../message-types/select-affected-tasks");
37
40
  const get_sync_generator_changes_1 = require("../message-types/get-sync-generator-changes");
38
41
  const hash_glob_1 = require("../message-types/hash-glob");
39
42
  const nx_console_1 = require("../message-types/nx-console");
@@ -74,6 +77,14 @@ exports.WatcherFailedError = WatcherFailedError;
74
77
  * re-dialing once this many land back to back without a message in between.
75
78
  */
76
79
  const MAX_CONSECUTIVE_FRAMING_FAILURES = 3;
80
+ // Task results get written back onto these task objects as the run
81
+ // progresses — hash/hashDetails/timestamps by hashing and the orchestrator,
82
+ // terminalOutput by the Nx Cloud life cycle (untyped) — so a later message
83
+ // would otherwise re-ship every earlier result.
84
+ function withoutTaskResults(tasks, taskGraph) {
85
+ const pruned = (0, prune_task_graph_1.pruneTaskGraph)(taskGraph);
86
+ return { tasks: tasks.map((t) => pruned.tasks[t.id]), taskGraph: pruned };
87
+ }
77
88
  class DaemonClient {
78
89
  constructor() {
79
90
  // Tracks the spinner owned by the in-flight request so streamed
@@ -200,24 +211,28 @@ class DaemonClient {
200
211
  async getAllFileData() {
201
212
  return await this.sendToDaemonViaQueue({ type: 'REQUEST_FILE_DATA' });
202
213
  }
203
- hashTasks(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs) {
204
- // Task results get written back onto these task objects as the run
205
- // progresses — hash/hashDetails/timestamps by hashing and the
206
- // orchestrator, terminalOutput by the Nx Cloud life cycle (untyped) —
207
- // so a later message would otherwise re-ship every earlier result.
208
- const trimmedTasks = {};
209
- for (const [id, t] of Object.entries(taskGraph.tasks)) {
210
- const { hash, hashDetails, startTime, endTime, terminalOutput, ...strippedTask } = t;
211
- trimmedTasks[id] = strippedTask;
212
- }
214
+ hashTasks(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurationsVersion) {
213
215
  return this.sendToDaemonViaQueue({
214
216
  type: 'HASH_TASKS',
215
217
  runnerOptions,
216
218
  perTaskEnvs,
217
- tasks: tasks.map((t) => trimmedTasks[t.id]),
218
- taskGraph: { ...taskGraph, tasks: trimmedTasks },
219
+ ...withoutTaskResults(tasks, taskGraph),
220
+ cwd,
221
+ collectInputs,
222
+ // An External cannot cross the socket: the version names the stored set
223
+ // to hash from. Absent means native hashing.
224
+ ultracacheConfigurationsVersion,
225
+ });
226
+ }
227
+ hashTasksUpfront(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurationsVersion) {
228
+ return this.sendToDaemonViaQueue({
229
+ type: 'HASH_TASKS_UPFRONT',
230
+ runnerOptions,
231
+ perTaskEnvs,
232
+ ...withoutTaskResults(tasks, taskGraph),
219
233
  cwd,
220
234
  collectInputs,
235
+ ultracacheConfigurationsVersion,
221
236
  });
222
237
  }
223
238
  async registerFileWatcher(config, callback) {
@@ -709,6 +724,20 @@ class DaemonClient {
709
724
  };
710
725
  return this.sendToDaemonViaQueue(message);
711
726
  }
727
+ getPluginCapabilities() {
728
+ const message = {
729
+ type: get_plugin_capabilities_1.GET_PLUGIN_CAPABILITIES,
730
+ };
731
+ return this.sendToDaemonViaQueue(message);
732
+ }
733
+ /** Selection runs where hashing does, so the plans it builds are reused. */
734
+ selectAffectedTasks(request) {
735
+ const message = {
736
+ type: select_affected_tasks_1.SELECT_AFFECTED_TASKS,
737
+ request,
738
+ };
739
+ return this.sendToDaemonViaQueue(message);
740
+ }
712
741
  updateWorkspaceContext(createdFiles, updatedFiles, deletedFiles) {
713
742
  const message = {
714
743
  type: update_workspace_context_1.UPDATE_WORKSPACE_CONTEXT,
@@ -0,0 +1,5 @@
1
+ export declare const GET_PLUGIN_CAPABILITIES: 'GET_PLUGIN_CAPABILITIES';
2
+ export type HandleGetPluginCapabilitiesMessage = {
3
+ type: typeof GET_PLUGIN_CAPABILITIES;
4
+ };
5
+ export declare function isHandleGetPluginCapabilitiesMessage(message: unknown): message is HandleGetPluginCapabilitiesMessage;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_PLUGIN_CAPABILITIES = void 0;
4
+ exports.isHandleGetPluginCapabilitiesMessage = isHandleGetPluginCapabilitiesMessage;
5
+ exports.GET_PLUGIN_CAPABILITIES = 'GET_PLUGIN_CAPABILITIES';
6
+ function isHandleGetPluginCapabilitiesMessage(message) {
7
+ return (typeof message === 'object' &&
8
+ message !== null &&
9
+ 'type' in message &&
10
+ message['type'] === exports.GET_PLUGIN_CAPABILITIES);
11
+ }
@@ -1,4 +1,5 @@
1
- import type { PostTasksExecutionContext, PreTasksExecutionContext } from '../../project-graph/plugins';
1
+ import type { PreTasksExecutionContext } from '../../project-graph/plugins';
2
+ import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
2
3
  export declare const PRE_TASKS_EXECUTION: 'PRE_TASKS_EXECUTION';
3
4
  export declare const POST_TASKS_EXECUTION: 'POST_TASKS_EXECUTION';
4
5
  export type HandlePreTasksExecutionMessage = {
@@ -7,7 +8,7 @@ export type HandlePreTasksExecutionMessage = {
7
8
  };
8
9
  export type HandlePostTasksExecutionMessage = {
9
10
  type: typeof POST_TASKS_EXECUTION;
10
- context: PostTasksExecutionContext;
11
+ context: MaybeStubbedPostTasksExecutionContext;
11
12
  };
12
13
  export declare function isHandlePreTasksExecutionMessage(message: unknown): message is HandlePreTasksExecutionMessage;
13
14
  export declare function isHandlePostTasksExecutionMessage(message: unknown): message is HandlePostTasksExecutionMessage;
@@ -0,0 +1,21 @@
1
+ import type { ProjectGraph } from '../../config/project-graph';
2
+ import type { TaskGraph } from '../../config/task-graph';
3
+ import type { TaskSelection } from '../../tasks-runner/run-command';
4
+ import type { AffectedTasksRequest } from '../../project-graph/affected/affected-tasks';
5
+ import type { InternedExplanation } from '../../project-graph/affected/affected-reasons';
6
+ export declare const SELECT_AFFECTED_TASKS: 'SELECT_AFFECTED_TASKS';
7
+ export type HandleSelectAffectedTasksMessage = {
8
+ type: typeof SELECT_AFFECTED_TASKS;
9
+ request: AffectedTasksRequest;
10
+ };
11
+ export type SelectAffectedTasksResponse = {
12
+ /** The graph selection ran against, for the command to run with. */
13
+ projectGraph: ProjectGraph;
14
+ affectedTaskIds: string[];
15
+ taskGraph: TaskGraph;
16
+ /** Without a planning context: the plans stay in the daemon. */
17
+ taskSelection: TaskSelection;
18
+ /** Interned, so it stays small on the wire; the client hydrates it. */
19
+ explanation?: InternedExplanation;
20
+ };
21
+ export declare function isHandleSelectAffectedTasksMessage(message: unknown): message is HandleSelectAffectedTasksMessage;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SELECT_AFFECTED_TASKS = void 0;
4
+ exports.isHandleSelectAffectedTasksMessage = isHandleSelectAffectedTasksMessage;
5
+ exports.SELECT_AFFECTED_TASKS = 'SELECT_AFFECTED_TASKS';
6
+ function isHandleSelectAffectedTasksMessage(message) {
7
+ return (typeof message === 'object' &&
8
+ message !== null &&
9
+ 'type' in message &&
10
+ message['type'] === exports.SELECT_AFFECTED_TASKS);
11
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * One stored version of a commit's Ultracache configurations: what crosses
3
+ * the socket in place of the handle.
4
+ */
5
+ export interface UltracacheConfigurationVersion {
6
+ commit: string;
7
+ fetchedAt: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -16,7 +16,7 @@ export interface DotEnvChangeClassification {
16
16
  *
17
17
  * Only the workspace root and project roots invalidate: getEnvPathsForTask
18
18
  * loads dotenv files from those, never from an arbitrary subdirectory (e.g. one
19
- * under node_modules), and the outputs watcher spans the whole workspace root.
19
+ * under node_modules), and the raw-event stream spans the whole workspace root.
20
20
  * An unclassified event is not necessarily irrelevant, though: the graph it was
21
21
  * classified against can predate the file's project root (none is committed
22
22
  * during the initial computation, and a replaced graph lacks a project that
@@ -34,7 +34,7 @@ function isDotEnvName(name) {
34
34
  *
35
35
  * Only the workspace root and project roots invalidate: getEnvPathsForTask
36
36
  * loads dotenv files from those, never from an arbitrary subdirectory (e.g. one
37
- * under node_modules), and the outputs watcher spans the whole workspace root.
37
+ * under node_modules), and the raw-event stream spans the whole workspace root.
38
38
  * An unclassified event is not necessarily irrelevant, though: the graph it was
39
39
  * classified against can predate the file's project root (none is committed
40
40
  * during the initial computation, and a replaced graph lacks a project that
@@ -138,7 +138,7 @@ function isDotEnvUnderRoot(path, roots) {
138
138
  }
139
139
  // Paths of dotenv-shaped events whose graph refresh is not provably scheduled:
140
140
  // paths under no known root on arrival (the next graph may know the root) and
141
- // edits to tracked files (the workspace watcher schedules the refresh, but a
141
+ // edits to tracked files (the file-change stream schedules the refresh, but a
142
142
  // computation already in flight may have read the file before the edit). Each
143
143
  // maps to the recomputation generation current at queue time, so the pre-serve
144
144
  // replay can prove whether a computation started before the event arrived.
@@ -0,0 +1,2 @@
1
+ import type { HandlerResult } from './server';
2
+ export declare function handleGetPluginCapabilities(): Promise<HandlerResult>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleGetPluginCapabilities = handleGetPluginCapabilities;
4
+ const nx_json_1 = require("../../config/nx-json");
5
+ const get_plugins_1 = require("../../project-graph/plugins/get-plugins");
6
+ const workspace_root_1 = require("../../utils/workspace-root");
7
+ async function handleGetPluginCapabilities() {
8
+ const plugins = await (0, get_plugins_1.getPlugins)((0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot), workspace_root_1.workspaceRoot);
9
+ return {
10
+ response: plugins.map((plugin) => plugin.capabilities()),
11
+ description: 'handleGetPluginCapabilities',
12
+ };
13
+ }
@@ -1,12 +1,20 @@
1
1
  import { Task, TaskGraph } from '../../config/task-graph';
2
- export declare function handleHashTasks(payload: {
2
+ import type { UltracacheConfigurationVersion } from '../message-types/ultracache-configuration-version';
3
+ interface HashTasksPayload {
3
4
  runnerOptions: any;
4
5
  tasks: Task[];
5
6
  taskGraph: TaskGraph;
6
7
  perTaskEnvs: Record<string, NodeJS.ProcessEnv>;
7
8
  cwd: string;
8
9
  collectInputs?: boolean;
9
- }): Promise<{
10
+ ultracacheConfigurationsVersion?: UltracacheConfigurationVersion;
11
+ }
12
+ export declare function handleHashTasks(payload: HashTasksPayload): Promise<{
10
13
  response: import("../../hasher/task-hasher").Hash[];
11
14
  description: string;
12
15
  }>;
16
+ export declare function handleHashTasksUpfront(payload: HashTasksPayload): Promise<{
17
+ response: Record<string, import("../../hasher/task-hasher").Hash>;
18
+ description: string;
19
+ }>;
20
+ export {};
@@ -1,16 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleHashTasks = handleHashTasks;
4
+ exports.handleHashTasksUpfront = handleHashTasksUpfront;
4
5
  const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
5
6
  const task_hasher_1 = require("../../hasher/task-hasher");
6
7
  const configuration_1 = require("../../config/configuration");
8
+ const ultracache_configuration_state_1 = require("./ultracache-configuration-state");
9
+ const planning_context_1 = require("./planning-context");
7
10
  /**
8
11
  * We use this not to recreated hasher for every hash operation
9
12
  * TaskHasher has a cache inside, so keeping it around results in faster performance
10
13
  */
11
14
  let storedProjectGraph = null;
12
15
  let storedHasher = null;
13
- async function handleHashTasks(payload) {
16
+ async function getHasher(runnerOptions) {
14
17
  const { error, projectGraph, rustReferences } = await (0, project_graph_incremental_recomputation_1.getCachedSerializedProjectGraphPromise)();
15
18
  if (error) {
16
19
  throw error;
@@ -18,11 +21,23 @@ async function handleHashTasks(payload) {
18
21
  const nxJson = (0, configuration_1.readNxJson)();
19
22
  if (projectGraph !== storedProjectGraph) {
20
23
  storedProjectGraph = projectGraph;
21
- storedHasher = new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences, payload.runnerOptions);
24
+ storedHasher = new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences, runnerOptions, (0, planning_context_1.planningContextFor)(projectGraph, nxJson));
22
25
  }
23
- const response = await storedHasher.hashTasks(payload.tasks, payload.taskGraph, payload.perTaskEnvs, payload.cwd, payload.collectInputs);
26
+ return storedHasher;
27
+ }
28
+ async function handleHashTasks(payload) {
29
+ const hasher = await getHasher(payload.runnerOptions);
30
+ const response = await hasher.hashTasks(payload.tasks, payload.taskGraph, payload.perTaskEnvs, payload.cwd, payload.collectInputs, (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(payload.ultracacheConfigurationsVersion));
24
31
  return {
25
32
  response,
26
33
  description: 'handleHashTasks',
27
34
  };
28
35
  }
36
+ async function handleHashTasksUpfront(payload) {
37
+ const hasher = await getHasher(payload.runnerOptions);
38
+ const response = await hasher.hashTasksUpfront(payload.tasks, payload.taskGraph, payload.perTaskEnvs, payload.cwd, payload.collectInputs, (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(payload.ultracacheConfigurationsVersion));
39
+ return {
40
+ response,
41
+ description: 'handleHashTasksUpfront',
42
+ };
43
+ }
@@ -0,0 +1,3 @@
1
+ import { AffectedTasksRequest } from '../../project-graph/affected/affected-tasks';
2
+ import type { HandlerResult } from './server';
3
+ export declare function handleSelectAffectedTasks(request: AffectedTasksRequest): Promise<HandlerResult>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleSelectAffectedTasks = handleSelectAffectedTasks;
4
+ const configuration_1 = require("../../config/configuration");
5
+ const affected_tasks_1 = require("../../project-graph/affected/affected-tasks");
6
+ const ultracache_configuration_state_1 = require("./ultracache-configuration-state");
7
+ const planning_context_1 = require("./planning-context");
8
+ const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
9
+ async function handleSelectAffectedTasks(request) {
10
+ const { error, projectGraph } = await (0, project_graph_incremental_recomputation_1.getCachedSerializedProjectGraphPromise)();
11
+ if (error) {
12
+ throw error;
13
+ }
14
+ const nxJson = (0, configuration_1.readNxJson)();
15
+ const selection = await (0, affected_tasks_1.selectAffectedTasks)(projectGraph, nxJson, (0, planning_context_1.planningContextFor)(projectGraph, nxJson), request, {
16
+ ultracacheConfigurations: (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(request.ultracacheConfigurationsVersion),
17
+ });
18
+ const response = {
19
+ projectGraph,
20
+ affectedTaskIds: [...selection.affectedTaskIds],
21
+ taskGraph: selection.taskGraph,
22
+ taskSelection: selection.taskSelection,
23
+ explanation: selection.explanation,
24
+ };
25
+ return { response, description: 'handleSelectAffectedTasks' };
26
+ }
@@ -1,4 +1,5 @@
1
- import type { PostTasksExecutionContext, PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
1
+ import type { PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
2
+ import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
2
3
  export declare function handleRunPreTasksExecution(context: PreTasksExecutionContext): Promise<{
3
4
  response: NodeJS.ProcessEnv[];
4
5
  description: string;
@@ -8,7 +9,7 @@ export declare function handleRunPreTasksExecution(context: PreTasksExecutionCon
8
9
  error: any;
9
10
  description: string;
10
11
  }>;
11
- export declare function handleRunPostTasksExecution(context: PostTasksExecutionContext): Promise<{
12
+ export declare function handleRunPostTasksExecution(context: MaybeStubbedPostTasksExecutionContext): Promise<{
12
13
  error?: undefined;
13
14
  response: string;
14
15
  description: string;
@@ -1,10 +1,10 @@
1
- import type { FileWatcherCallback } from './watcher';
1
+ import { type WatchEventsListener } from '../../utils/workspace-context';
2
2
  /**
3
- * The error a native outputs watcher failure delivered, if one has. Such an
3
+ * The error a native watch failure delivered, if one has. Such an
4
4
  * error is terminal (the native watch loop exits after delivering it), so the
5
5
  * gitignored dotenv edits only that watcher reports stop arriving and a warm
6
6
  * graph would go stale silently. The server fails requests closed on it, like
7
7
  * a workspace watcher error.
8
8
  */
9
- export declare function getOutputsWatcherTerminalError(): Error | undefined;
10
- export declare const handleOutputsChanges: FileWatcherCallback;
9
+ export declare function getWatchTerminalError(): Error | undefined;
10
+ export declare const handleWatchEvents: WatchEventsListener;
@@ -1,31 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleOutputsChanges = void 0;
4
- exports.getOutputsWatcherTerminalError = getOutputsWatcherTerminalError;
3
+ exports.handleWatchEvents = void 0;
4
+ exports.getWatchTerminalError = getWatchTerminalError;
5
5
  const logger_1 = require("../logger");
6
6
  const dotenv_graph_changes_1 = require("./dotenv-graph-changes");
7
- const outputs_tracking_1 = require("./outputs-tracking");
8
7
  const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
9
- let outputsWatcherError;
10
- let outputsWatcherTerminalError;
8
+ const workspace_root_1 = require("../../utils/workspace-root");
9
+ const workspace_context_1 = require("../../utils/workspace-context");
10
+ let watchTerminalError;
11
11
  /**
12
- * The error a native outputs watcher failure delivered, if one has. Such an
12
+ * The error a native watch failure delivered, if one has. Such an
13
13
  * error is terminal (the native watch loop exits after delivering it), so the
14
14
  * gitignored dotenv edits only that watcher reports stop arriving and a warm
15
15
  * graph would go stale silently. The server fails requests closed on it, like
16
16
  * a workspace watcher error.
17
17
  */
18
- function getOutputsWatcherTerminalError() {
19
- return outputsWatcherTerminalError;
18
+ function getWatchTerminalError() {
19
+ return watchTerminalError;
20
20
  }
21
- const handleOutputsChanges = async (err, changeEvents) => {
21
+ const handleWatchEvents = async (err, changeEvents) => {
22
22
  try {
23
23
  if (err || !changeEvents || !changeEvents.length) {
24
24
  let error = typeof err === 'string' ? new Error(err) : err;
25
- logger_1.serverLogger.watcherLog('Unexpected outputs watcher error', error.message);
25
+ logger_1.serverLogger.watcherLog('Unexpected watch error', error.message);
26
26
  console.error(error);
27
- outputsWatcherError = error;
28
- (0, outputs_tracking_1.disableOutputsTracking)();
29
27
  if (err) {
30
28
  // A native error is terminal: the watch loop has exited, so the
31
29
  // gitignored dotenv edits only this watcher reports stop arriving and
@@ -34,32 +32,40 @@ const handleOutputsChanges = async (err, changeEvents) => {
34
32
  // that silently goes stale. The original error is preserved so an
35
33
  // inotify_add_watch failure still makes the client disable the daemon
36
34
  // and rebuild without it.
37
- outputsWatcherTerminalError = error;
35
+ watchTerminalError = error;
38
36
  }
39
37
  return;
40
38
  }
39
+ if (changeEvents.some((event) => event.type === 'rescan')) {
40
+ // Dropped events cannot be classified: any gitignored dotenv file may
41
+ // have changed unseen. Recorded outputs are compared by stamp, so they
42
+ // need nothing.
43
+ logger_1.serverLogger.watcherLog('The watch reported dropped events; invalidating the graph cache.');
44
+ (0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
45
+ return;
46
+ }
41
47
  // A dotenv change that a task chain loads must refresh the graph so
42
- // createNodes re-resolves config reading process.env. This runs above the
43
- // outputsWatcherError guard: the two concerns are independent, and a
44
- // disabled outputs tracker must not leave the graph stale on a dotenv edit.
45
- // A change to a file the workspace watcher tracks already schedules a
46
- // recomputation that reads the new content; invalidating for it here too
47
- // would discard that recomputation at commit and force a second one. It is
48
- // queued instead of dropped: the two watchers deliver independently, so a
48
+ // createNodes re-resolves config reading process.env. A change to a file
49
+ // the file-change stream covers already schedules a recomputation that
50
+ // reads the new content; invalidating for it here too would discard that
51
+ // recomputation at commit and force a second one. It is
52
+ // queued instead of dropped: the two streams deliver independently, so a
49
53
  // computation already in flight may have read the file before the edit,
50
- // and only the pre-serve replay can prove that. The committed file map
51
- // approximates what the watcher tracks: a file it does not know is either
52
- // gitignored (never reaches the workspace watcher, so it needs the
53
- // invalidation) or created since the last recompute (the watcher handles
54
- // it; the extra invalidation is fail-safe). Its own try/catch so a fault
55
- // here cannot trip the outputs-tracking kill switch below, which belongs
56
- // to an unrelated subsystem, and it fails safe by invalidating: a stale
54
+ // and only the pre-serve replay can prove that. The context answers from
55
+ // the files the watch keeps, so a path it does not hold is gitignored,
56
+ // already deleted, or not yet ingested, and each of those needs the
57
+ // invalidation. A missing context answers with nothing, which invalidates
58
+ // too. Its own try/catch so a fault fails safe by invalidating: a stale
57
59
  // graph on a dotenv edit is the bug this prevents.
58
60
  try {
59
61
  const { invalidating, unclassified } = (0, dotenv_graph_changes_1.classifyDotEnvChanges)(changeEvents, project_graph_incremental_recomputation_1.currentProjectGraph);
60
62
  const generation = (0, project_graph_incremental_recomputation_1.getRecomputationGeneration)();
61
63
  (0, dotenv_graph_changes_1.queuePendingDotEnvEvents)(unclassified.map((event) => event.path), generation);
62
- const knownInvalidating = invalidating.filter((path) => (0, project_graph_incremental_recomputation_1.isKnownWorkspaceFile)(path));
64
+ // Skips the napi call, which takes the files mutex and can wait out a
65
+ // re-walk, for the common batch that classifies nothing.
66
+ const knownInvalidating = invalidating.length
67
+ ? (0, workspace_context_1.trackedFilesInContext)(workspace_root_1.workspaceRoot, invalidating)
68
+ : [];
63
69
  (0, dotenv_graph_changes_1.queuePendingDotEnvEvents)(knownInvalidating, generation);
64
70
  if (knownInvalidating.length < invalidating.length) {
65
71
  (0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
@@ -70,17 +76,10 @@ const handleOutputsChanges = async (err, changeEvents) => {
70
76
  console.error(e);
71
77
  (0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
72
78
  }
73
- if (outputsWatcherError) {
74
- return;
75
- }
76
- logger_1.serverLogger.watcherLog('Processing file changes in outputs');
77
- (0, outputs_tracking_1.processFileChangesInOutputs)(changeEvents);
78
79
  }
79
80
  catch (err) {
80
- logger_1.serverLogger.watcherLog(`Unexpected outputs watcher error`, err.message);
81
+ logger_1.serverLogger.watcherLog(`Unexpected watch error`, err.message);
81
82
  console.error(err);
82
- outputsWatcherError = err;
83
- (0, outputs_tracking_1.disableOutputsTracking)();
84
83
  }
85
84
  };
86
- exports.handleOutputsChanges = handleOutputsChanges;
85
+ exports.handleWatchEvents = handleWatchEvents;
@@ -1,23 +1,11 @@
1
- import { WatchEvent } from '../../native';
2
- export declare function _recordOutputsHash(outputs: string[], hash: string): void;
3
- export declare function _outputsHashesMatch(outputs: string[], hash: string): boolean;
4
- export declare function processFileChangesInOutputs(changeEvents: WatchEvent[], now?: number): void;
1
+ import type { TaskOutputs } from '../../native';
5
2
  /**
6
- * Check whether the on-disk outputs of each entry still match the hash
7
- * the daemon recorded for them. Uses Rayon-parallel filesystem scanning
8
- * for uncached entries.
3
+ * Whether the on-disk outputs of each entry are still what the daemon
4
+ * recorded for its hash, so the cache copy can be skipped.
9
5
  */
10
- export declare function outputsHashesMatchBatch(entries: {
11
- outputs: string[];
12
- hash: string;
13
- }[]): boolean[];
6
+ export declare function outputsHashesMatchBatch(entries: TaskOutputs[]): boolean[];
14
7
  /**
15
- * Record the hash of each entry's on-disk outputs so future
16
- * outputsHashesMatchBatch calls can skip redundant cache copies.
17
- * Uses Rayon-parallel filesystem scanning.
8
+ * Record each entry's outputs (the files it carries, or else what is on disk)
9
+ * so future outputsHashesMatchBatch calls can skip redundant cache copies.
18
10
  */
19
- export declare function recordOutputsHashBatch(entries: {
20
- outputs: string[];
21
- hash: string;
22
- }[]): void;
23
- export declare function disableOutputsTracking(): void;
11
+ export declare function recordOutputsHashBatch(entries: TaskOutputs[]): void;