@depup/nx 23.1.2-depup.1 → 23.2.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 (296) hide show
  1. package/README.md +7 -6
  2. package/changes.json +12 -8
  3. package/dist/bin/init-local.js +3 -5
  4. package/dist/bin/nx.js +1 -0
  5. package/dist/src/adapter/ngcli-adapter.js +60 -1
  6. package/dist/src/ai/constants.d.ts +15 -0
  7. package/dist/src/ai/constants.js +17 -1
  8. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +57 -9
  9. package/dist/src/ai/utils.d.ts +13 -0
  10. package/dist/src/ai/utils.js +29 -0
  11. package/dist/src/analytics/analytics.js +2 -4
  12. package/dist/src/command-line/completion/command-object.js +7 -12
  13. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +42 -31
  14. package/dist/src/command-line/format/format.js +84 -101
  15. package/dist/src/command-line/generate/generate.js +35 -35
  16. package/dist/src/command-line/import/import.js +29 -38
  17. package/dist/src/command-line/init/ai-agent-prompts.js +5 -11
  18. package/dist/src/command-line/init/command-object.js +4 -2
  19. package/dist/src/command-line/init/configure-plugins.js +4 -1
  20. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +12 -32
  21. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +17 -21
  22. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +8 -21
  23. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +3 -17
  24. package/dist/src/command-line/init/implementation/angular/index.js +10 -15
  25. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -0
  26. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +8 -2
  27. package/dist/src/command-line/init/implementation/check-compatible-with-plugins.js +2 -0
  28. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +5 -0
  29. package/dist/src/command-line/init/implementation/format.d.ts +18 -0
  30. package/dist/src/command-line/init/implementation/format.js +114 -0
  31. package/dist/src/command-line/init/implementation/utils.js +8 -8
  32. package/dist/src/command-line/init/init-v1.js +15 -18
  33. package/dist/src/command-line/init/init-v2.js +77 -66
  34. package/dist/src/command-line/migrate/agentic/definitions.js +36 -9
  35. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +37 -22
  36. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +30 -39
  37. package/dist/src/command-line/migrate/agentic/handoff.d.ts +7 -7
  38. package/dist/src/command-line/migrate/agentic/handoff.js +13 -10
  39. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +7 -12
  40. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +7 -0
  41. package/dist/src/command-line/migrate/agentic/run-step.d.ts +10 -0
  42. package/dist/src/command-line/migrate/agentic/run-step.js +1 -0
  43. package/dist/src/command-line/migrate/agentic/runner.js +24 -24
  44. package/dist/src/command-line/migrate/agentic/select.d.ts +10 -2
  45. package/dist/src/command-line/migrate/agentic/select.js +30 -32
  46. package/dist/src/command-line/migrate/agentic/types.d.ts +33 -3
  47. package/dist/src/command-line/migrate/agentic/types.js +35 -0
  48. package/dist/src/command-line/migrate/command-object.d.ts +6 -0
  49. package/dist/src/command-line/migrate/command-object.js +19 -1
  50. package/dist/src/command-line/migrate/execute-migration.d.ts +28 -9
  51. package/dist/src/command-line/migrate/execute-migration.js +112 -27
  52. package/dist/src/command-line/migrate/migrate-analytics.d.ts +35 -0
  53. package/dist/src/command-line/migrate/migrate-analytics.js +64 -0
  54. package/dist/src/command-line/migrate/migrate-commits.d.ts +38 -8
  55. package/dist/src/command-line/migrate/migrate-commits.js +130 -15
  56. package/dist/src/command-line/migrate/migrate-config.d.ts +13 -12
  57. package/dist/src/command-line/migrate/migrate-config.js +22 -14
  58. package/dist/src/command-line/migrate/migrate-output.d.ts +45 -7
  59. package/dist/src/command-line/migrate/migrate-output.js +52 -8
  60. package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
  61. package/dist/src/command-line/migrate/migrate-ui-api.js +16 -7
  62. package/dist/src/command-line/migrate/migrate.d.ts +24 -55
  63. package/dist/src/command-line/migrate/migrate.js +553 -226
  64. package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
  65. package/dist/src/command-line/migrate/multi-major.js +7 -10
  66. package/dist/src/command-line/migrate/resolve-package-version.js +4 -8
  67. package/dist/src/command-line/migrate/run/agent-output.d.ts +20 -0
  68. package/dist/src/command-line/migrate/run/agent-output.js +65 -0
  69. package/dist/src/command-line/migrate/run/index.d.ts +9 -0
  70. package/dist/src/command-line/migrate/run/index.js +23 -0
  71. package/dist/src/command-line/migrate/run/orchestrator.d.ts +20 -0
  72. package/dist/src/command-line/migrate/run/orchestrator.js +1200 -0
  73. package/dist/src/command-line/migrate/run/run-id.d.ts +16 -0
  74. package/dist/src/command-line/migrate/run/run-id.js +56 -0
  75. package/dist/src/command-line/migrate/run/run-state.d.ts +157 -0
  76. package/dist/src/command-line/migrate/run/run-state.js +438 -0
  77. package/dist/src/command-line/migrate/run/state-lock.d.ts +25 -0
  78. package/dist/src/command-line/migrate/run/state-lock.js +76 -0
  79. package/dist/src/command-line/migrate/run/state-machine.d.ts +84 -0
  80. package/dist/src/command-line/migrate/run/state-machine.js +315 -0
  81. package/dist/src/command-line/migrate/run/util.d.ts +59 -0
  82. package/dist/src/command-line/migrate/run/util.js +148 -0
  83. package/dist/src/command-line/migrate/run/worker.d.ts +16 -0
  84. package/dist/src/command-line/migrate/run/worker.js +682 -0
  85. package/dist/src/command-line/migrate/run-migration-process.js +6 -5
  86. package/dist/src/command-line/migrate/safe-prompt.d.ts +14 -26
  87. package/dist/src/command-line/migrate/safe-prompt.js +32 -43
  88. package/dist/src/command-line/migrate/sort-migrations.d.ts +16 -0
  89. package/dist/src/command-line/migrate/sort-migrations.js +32 -0
  90. package/dist/src/command-line/migrate/step-actions.d.ts +5 -0
  91. package/dist/src/command-line/migrate/step-actions.js +12 -0
  92. package/dist/src/command-line/migrate/text.d.ts +18 -0
  93. package/dist/src/command-line/migrate/text.js +26 -0
  94. package/dist/src/command-line/migrate/version-skew-guard.d.ts +60 -0
  95. package/dist/src/command-line/migrate/version-skew-guard.js +175 -0
  96. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +16 -20
  97. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.d.ts +2 -0
  98. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +16 -0
  99. package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.d.ts +4 -0
  100. package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.js +13 -0
  101. package/dist/src/command-line/nx-commands.js +26 -24
  102. package/dist/src/command-line/release/changelog.js +6 -17
  103. package/dist/src/command-line/release/plan.js +15 -28
  104. package/dist/src/command-line/release/publish.js +5 -0
  105. package/dist/src/command-line/release/release.js +6 -17
  106. package/dist/src/command-line/release/utils/release-graph.d.ts +1 -0
  107. package/dist/src/command-line/release/utils/release-graph.js +10 -2
  108. package/dist/src/command-line/release/utils/remote-release-clients/github.js +10 -22
  109. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +13 -22
  110. package/dist/src/command-line/release/utils/resolve-semver-specifier.js +19 -41
  111. package/dist/src/command-line/release/version/resolve-current-version.js +7 -10
  112. package/dist/src/command-line/release/version.js +2 -2
  113. package/dist/src/command-line/reset/reset.js +17 -15
  114. package/dist/src/command-line/yargs-utils/shared-options.d.ts +1 -1
  115. package/dist/src/command-line/yargs-utils/shared-options.js +3 -1
  116. package/dist/src/config/misc-interfaces.d.ts +19 -7
  117. package/dist/src/core/graph/main.js +1 -1
  118. package/dist/src/core/graph/styles.js +1 -1
  119. package/dist/src/daemon/client/client.d.ts +2 -7
  120. package/dist/src/daemon/client/client.js +113 -28
  121. package/dist/src/daemon/client/daemon-environment.d.ts +35 -0
  122. package/dist/src/daemon/client/daemon-environment.js +106 -6
  123. package/dist/src/daemon/client/daemon-socket-messenger.d.ts +1 -1
  124. package/dist/src/daemon/client/daemon-socket-messenger.js +8 -3
  125. package/dist/src/daemon/is-v8-serializer-enabled.d.ts +2 -2
  126. package/dist/src/daemon/is-v8-serializer-enabled.js +2 -2
  127. package/dist/src/daemon/message-types/daemon-message.d.ts +2 -1
  128. package/dist/src/daemon/message-types/daemon-message.js +25 -2
  129. package/dist/src/daemon/sandbox-socket-hint.d.ts +27 -0
  130. package/dist/src/daemon/sandbox-socket-hint.js +136 -0
  131. package/dist/src/daemon/server/client-socket-context.d.ts +1 -1
  132. package/dist/src/daemon/server/client-socket-context.js +2 -3
  133. package/dist/src/daemon/server/dotenv-graph-changes.d.ts +97 -0
  134. package/dist/src/daemon/server/dotenv-graph-changes.js +284 -0
  135. package/dist/src/daemon/server/handle-client-env.d.ts +8 -0
  136. package/dist/src/daemon/server/handle-client-env.js +92 -0
  137. package/dist/src/daemon/server/handle-outputs-changes.d.ts +10 -0
  138. package/dist/src/daemon/server/handle-outputs-changes.js +86 -0
  139. package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +21 -0
  140. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +159 -6
  141. package/dist/src/daemon/server/server.js +36 -72
  142. package/dist/src/daemon/server/shutdown-utils.d.ts +1 -1
  143. package/dist/src/daemon/server/shutdown-utils.js +2 -2
  144. package/dist/src/daemon/socket-utils.d.ts +26 -7
  145. package/dist/src/daemon/socket-utils.js +45 -31
  146. package/dist/src/daemon/tmp-dir.d.ts +10 -0
  147. package/dist/src/daemon/tmp-dir.js +21 -37
  148. package/dist/src/devkit-internals.d.ts +20 -9
  149. package/dist/src/devkit-internals.js +49 -6
  150. package/dist/src/executors/run-commands/running-tasks.js +46 -29
  151. package/dist/src/generators/internal-utils/{format-changed-files-with-prettier-if-available.d.ts → format-changed-files.d.ts} +6 -6
  152. package/dist/src/generators/internal-utils/format-changed-files.js +163 -0
  153. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +15 -0
  154. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.js +21 -3
  155. package/dist/src/migrations/update-15-0-0/prefix-outputs.js +2 -2
  156. package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.js +2 -2
  157. package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +2 -2
  158. package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.js +2 -2
  159. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +2 -2
  160. package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +2 -2
  161. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +2 -2
  162. package/dist/src/migrations/update-17-2-0/move-default-base.js +2 -2
  163. package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +2 -2
  164. package/dist/src/migrations/update-19-2-4/set-project-name.js +2 -2
  165. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.js +2 -2
  166. package/dist/src/migrations/update-20-0-1/use-legacy-cache.js +2 -2
  167. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.js +2 -2
  168. package/dist/src/migrations/update-21-0-0/release-version-config-changes.js +2 -2
  169. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +2 -2
  170. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.js +2 -2
  171. package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.js +2 -2
  172. package/dist/src/migrations/update-22-0-0/release-version-config-changes.js +2 -2
  173. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +2 -2
  174. package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.js +2 -2
  175. package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.js +2 -2
  176. package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.js +2 -2
  177. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +2 -2
  178. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +2 -2
  179. package/dist/src/native/index.d.ts +7 -3
  180. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  181. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  182. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +3 -3
  183. package/dist/src/nx-cloud/utilities/url-shorten.d.ts +1 -4
  184. package/dist/src/nx-cloud/utilities/url-shorten.js +9 -8
  185. package/dist/src/plugins/js/lock-file/lock-file.d.ts +46 -4
  186. package/dist/src/plugins/js/lock-file/lock-file.js +192 -15
  187. package/dist/src/plugins/js/lock-file/npm-parser.js +10 -3
  188. package/dist/src/plugins/js/lock-file/pnpm-parser.js +356 -62
  189. package/dist/src/plugins/js/lock-file/project-graph-pruning.d.ts +25 -1
  190. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +78 -4
  191. package/dist/src/plugins/js/lock-file/pruned-output.d.ts +330 -0
  192. package/dist/src/plugins/js/lock-file/pruned-output.js +1441 -0
  193. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +1 -0
  194. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +6 -5
  195. package/dist/src/plugins/js/utils/register.d.ts +11 -0
  196. package/dist/src/plugins/js/utils/register.js +40 -6
  197. package/dist/src/project-graph/plugins/get-plugins.d.ts +27 -1
  198. package/dist/src/project-graph/plugins/get-plugins.js +110 -5
  199. package/dist/src/project-graph/plugins/isolation/enabled.js +1 -4
  200. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +16 -0
  201. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +69 -11
  202. package/dist/src/project-graph/plugins/isolation/messaging.js +1 -3
  203. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +23 -2
  204. package/dist/src/project-graph/project-graph.js +27 -2
  205. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +7 -0
  206. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +14 -6
  207. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +47 -21
  208. package/dist/src/tasks-runner/is-tui-enabled.js +3 -1
  209. package/dist/src/tasks-runner/life-cycle.d.ts +2 -2
  210. package/dist/src/tasks-runner/life-cycle.js +2 -2
  211. package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +12 -0
  212. package/dist/src/tasks-runner/life-cycles/performance-report.js +62 -3
  213. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +26 -1
  214. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +99 -5
  215. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +26 -0
  216. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +113 -17
  217. package/dist/src/tasks-runner/pseudo-ipc.js +14 -13
  218. package/dist/src/tasks-runner/pseudo-terminal.d.ts +17 -3
  219. package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
  220. package/dist/src/tasks-runner/run-command.js +32 -39
  221. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +55 -0
  222. package/dist/src/tasks-runner/running-tasks/batch-process.js +161 -8
  223. package/dist/src/tasks-runner/task-env.d.ts +25 -0
  224. package/dist/src/tasks-runner/task-env.js +39 -0
  225. package/dist/src/tasks-runner/task-orchestrator.d.ts +68 -0
  226. package/dist/src/tasks-runner/task-orchestrator.js +159 -8
  227. package/dist/src/utils/analytics-enabled.d.ts +7 -0
  228. package/dist/src/utils/analytics-enabled.js +11 -0
  229. package/dist/src/utils/analytics-prompt.js +4 -7
  230. package/dist/src/utils/cache-directory.d.ts +62 -3
  231. package/dist/src/utils/cache-directory.js +276 -25
  232. package/dist/src/utils/catalog/bun-manager-utils.d.ts +8 -0
  233. package/dist/src/utils/catalog/bun-manager-utils.js +174 -0
  234. package/dist/src/utils/catalog/bun-manager.d.ts +28 -0
  235. package/dist/src/utils/catalog/bun-manager.js +130 -0
  236. package/dist/src/utils/catalog/index.d.ts +1 -1
  237. package/dist/src/utils/catalog/index.js +1 -1
  238. package/dist/src/utils/catalog/manager-factory.js +3 -0
  239. package/dist/src/utils/catalog/manager-utils.d.ts +8 -1
  240. package/dist/src/utils/catalog/manager-utils.js +9 -4
  241. package/dist/src/utils/catalog/manager.d.ts +13 -1
  242. package/dist/src/utils/catalog/manager.js +30 -0
  243. package/dist/src/utils/catalog/pnpm-manager.d.ts +2 -1
  244. package/dist/src/utils/catalog/pnpm-manager.js +3 -0
  245. package/dist/src/utils/catalog/types.d.ts +4 -0
  246. package/dist/src/utils/catalog/yarn-manager.d.ts +6 -2
  247. package/dist/src/utils/catalog/yarn-manager.js +23 -32
  248. package/dist/src/utils/child-process.d.ts +31 -1
  249. package/dist/src/utils/child-process.js +103 -0
  250. package/dist/src/utils/chunkify.d.ts +7 -1
  251. package/dist/src/utils/chunkify.js +10 -3
  252. package/dist/src/utils/consume-messages-from-socket.d.ts +42 -7
  253. package/dist/src/utils/consume-messages-from-socket.js +273 -38
  254. package/dist/src/utils/db-connection.js +8 -16
  255. package/dist/src/utils/exit-codes.d.ts +9 -0
  256. package/dist/src/utils/exit-codes.js +19 -0
  257. package/dist/src/utils/formatters/index.d.ts +13 -0
  258. package/dist/src/utils/formatters/index.js +74 -0
  259. package/dist/src/utils/formatters/oxfmt.d.ts +32 -0
  260. package/dist/src/utils/formatters/oxfmt.js +764 -0
  261. package/dist/src/utils/formatters/prettier.d.ts +26 -0
  262. package/dist/src/utils/formatters/prettier.js +201 -0
  263. package/dist/src/utils/formatters/shared.d.ts +5 -0
  264. package/dist/src/utils/formatters/shared.js +8 -0
  265. package/dist/src/utils/git-utils.d.ts +38 -2
  266. package/dist/src/utils/git-utils.js +422 -19
  267. package/dist/src/utils/has-nx-js-plugin.d.ts +1 -1
  268. package/dist/src/utils/has-nx-js-plugin.js +1 -1
  269. package/dist/src/utils/ignore.d.ts +47 -5
  270. package/dist/src/utils/ignore.js +93 -11
  271. package/dist/src/utils/kill-child-on-host-exit.d.ts +7 -0
  272. package/dist/src/utils/kill-child-on-host-exit.js +42 -0
  273. package/dist/src/utils/nx-console-prompt.js +3 -6
  274. package/dist/src/utils/nx-tmp-dir.d.ts +5 -0
  275. package/dist/src/utils/nx-tmp-dir.js +7 -2
  276. package/dist/src/utils/output.d.ts +153 -0
  277. package/dist/src/utils/output.js +289 -5
  278. package/dist/src/utils/owned-private-dir.d.ts +13 -0
  279. package/dist/src/utils/owned-private-dir.js +39 -0
  280. package/dist/src/utils/package-json.d.ts +2 -0
  281. package/dist/src/utils/package-manager.js +17 -7
  282. package/dist/src/utils/params.d.ts +7 -1
  283. package/dist/src/utils/params.js +64 -6
  284. package/dist/src/utils/permission-errors.d.ts +11 -0
  285. package/dist/src/utils/permission-errors.js +17 -0
  286. package/dist/src/utils/plugins/core-plugins.js +4 -0
  287. package/dist/src/utils/prompt-helpers.d.ts +53 -0
  288. package/dist/src/utils/prompt-helpers.js +111 -0
  289. package/dist/src/utils/socket-refused-exit-code.d.ts +15 -0
  290. package/dist/src/utils/socket-refused-exit-code.js +18 -0
  291. package/dist/src/utils/write-formatted-json-file.d.ts +3 -2
  292. package/dist/src/utils/write-formatted-json-file.js +5 -4
  293. package/package.json +33 -24
  294. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +0 -88
  295. package/dist/src/utils/is-using-prettier.d.ts +0 -3
  296. package/dist/src/utils/is-using-prettier.js +0 -62
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OXFMT_IGNORE_OPTIONS = void 0;
3
4
  exports.getIgnoreObject = getIgnoreObject;
4
5
  exports.createIgnoreChainResolver = createIgnoreChainResolver;
5
6
  exports.isIgnoredByChain = isIgnoredByChain;
7
+ exports.createAncestorAwareIgnoreChecker = createAncestorAwareIgnoreChecker;
6
8
  exports.isAlwaysIgnored = isAlwaysIgnored;
7
9
  exports.createGitIgnoreChecker = createGitIgnoreChecker;
8
10
  exports.createPrettierIgnoreChecker = createPrettierIgnoreChecker;
11
+ exports.createOxfmtIgnoreChecker = createOxfmtIgnoreChecker;
9
12
  exports.posixDirname = posixDirname;
10
13
  exports.addEntryToGitIgnore = addEntryToGitIgnore;
11
14
  const ignore = require("ignore");
@@ -93,7 +96,7 @@ function createIgnoreChainResolver(read, filenames, merge) {
93
96
  * that same note. Here they are simply the entry's matchers: any one excluding
94
97
  * wins, and a negation counts only if none excluded.
95
98
  *
96
- * Two preconditions, both satisfied by a pruning walk and neither enforced:
99
+ * Two preconditions, neither enforced here:
97
100
  *
98
101
  * - `filePath` is workspace-relative POSIX and must sit under every `dir` in the
99
102
  * chain, which holds when the chain came from that file's own directory.
@@ -101,9 +104,10 @@ function createIgnoreChainResolver(read, filenames, merge) {
101
104
  * re-include a file inside an excluded directory, and this does not implement
102
105
  * that rule: asked directly about `dist/keep.ts` with a root `dist/` and a
103
106
  * nested `dist/.gitignore` holding `!keep.ts`, it answers "not ignored" where
104
- * git says ignored (measured). `visitNotIgnoredFiles` never asks, because it
105
- * prunes `dist/` before descending - which is what makes its answers match
106
- * git, and why that pruning is load-bearing for correctness rather than speed.
107
+ * git says ignored (measured). A pruning walk like `visitNotIgnoredFiles`
108
+ * satisfies it by never asking about anything under `dist/`; a per-file
109
+ * caller cannot, so it goes through `createAncestorAwareIgnoreChecker`,
110
+ * which checks the ancestors before asking the chain.
107
111
  */
108
112
  function isIgnoredByChain(chain, filePath) {
109
113
  for (const { dir, matchers } of chain) {
@@ -122,6 +126,45 @@ function isIgnoredByChain(chain, filePath) {
122
126
  }
123
127
  return false;
124
128
  }
129
+ /**
130
+ * The chain's answers plus git's excluded-ancestor rule: nothing inside an
131
+ * ignored directory can be re-included, so a nested negation must not
132
+ * resurrect a file whose ancestor an outer file excluded - the case
133
+ * `isIgnoredByChain` alone gets wrong (see its second precondition). The
134
+ * oxfmt CLI follows the same rule (measured against 0.60.0: a scan skips a
135
+ * nested `!keep.ts` under a root-ignored `dist/`), so every per-file caller -
136
+ * the cascading tree checkers and the disk-backed resolver in
137
+ * `formatters/oxfmt.ts` - goes through here.
138
+ *
139
+ * A directory's own ignore files cannot un-ignore the directory itself, so
140
+ * its verdict comes from its parent's chain - probed with a trailing slash,
141
+ * which is what makes a directory-only pattern like `dist/` match. Verdicts
142
+ * are memoized per directory, so a batch of files shares its ancestor walks.
143
+ */
144
+ function createAncestorAwareIgnoreChecker(resolve) {
145
+ const ignoredDirs = new Map();
146
+ const isIgnoredDirectory = (dir) => {
147
+ if (dir === '') {
148
+ return false;
149
+ }
150
+ const cached = ignoredDirs.get(dir);
151
+ if (cached !== undefined) {
152
+ return cached;
153
+ }
154
+ const parent = posixDirname(dir);
155
+ const ignored = isIgnoredDirectory(parent) ||
156
+ isIgnoredByChain(resolve(parent), `${dir}/`);
157
+ ignoredDirs.set(dir, ignored);
158
+ return ignored;
159
+ };
160
+ return {
161
+ isIgnoredFile: (filePath) => {
162
+ const dir = posixDirname(filePath);
163
+ return (isIgnoredDirectory(dir) || isIgnoredByChain(resolve(dir), filePath));
164
+ },
165
+ isIgnoredDirectory,
166
+ };
167
+ }
125
168
  let alwaysIgnored;
126
169
  /**
127
170
  * Directories that should never be walked, whatever the workspace's own ignore
@@ -174,16 +217,55 @@ function createPrettierIgnoreChecker(tree) {
174
217
  merge: false,
175
218
  });
176
219
  }
220
+ /**
221
+ * What oxfmt ignores: prettier's two files, but resolved from each file's own
222
+ * directory upwards rather than the workspace root - measured against the
223
+ * oxfmt 0.60.0 CLI, which differs from prettier on exactly that axis. Still
224
+ * one matcher per file rather than merged.
225
+ *
226
+ * A config's `ignorePatterns` is not an ignore file and is not read here;
227
+ * `formatFilesWithOxfmt` applies it rooted at that config's directory.
228
+ */
229
+ function createOxfmtIgnoreChecker(tree) {
230
+ return createTreeIgnoreChecker(tree, exports.OXFMT_IGNORE_OPTIONS);
231
+ }
232
+ /**
233
+ * Exported, unlike git's and prettier's, because oxfmt has two consumers:
234
+ * this tree-backed checker and the disk-backed resolver in
235
+ * `formatters/oxfmt.ts`. A shared value is the only thing that keeps them
236
+ * agreeing, so do not restate these three anywhere.
237
+ *
238
+ * `satisfies` rather than an annotation keeps the values literal - an
239
+ * annotation widens `cascade` and `merge` to `boolean` (measured in the
240
+ * declaration emit).
241
+ */
242
+ exports.OXFMT_IGNORE_OPTIONS = {
243
+ filenames: ['.gitignore', '.prettierignore'],
244
+ cascade: true,
245
+ merge: false,
246
+ };
177
247
  function createTreeIgnoreChecker(tree, { filenames, cascade, merge }) {
178
248
  const resolve = createIgnoreChainResolver((path) => tree.read(path, 'utf-8'), filenames, merge);
179
- // `probe` may carry a trailing slash; `path` never does. The chain is keyed by
180
- // real directories, and `posixDirname('dist/')` is `'dist'` rather than the
181
- // parent, so the lookup always uses the slash-less form.
182
- const check = (path, probe) => isAlwaysIgnored(probe) ||
183
- isIgnoredByChain(resolve(cascade ? posixDirname(path) : ''), probe);
249
+ if (cascade) {
250
+ // Cascading resolution and the excluded-ancestor rule travel together:
251
+ // both come from git, and the one cascading tool that is not git - oxfmt -
252
+ // applies both (measured, see `createAncestorAwareIgnoreChecker`).
253
+ const checker = createAncestorAwareIgnoreChecker(resolve);
254
+ return {
255
+ isIgnoredFile: (path) => isAlwaysIgnored(path) || checker.isIgnoredFile(path),
256
+ // The trailing slash is what makes a directory-only pattern like `dist/`
257
+ // match - `ignore` will not match it against the bare `dist`.
258
+ isIgnoredDirectory: (path) => isAlwaysIgnored(`${path}/`) || checker.isIgnoredDirectory(path),
259
+ };
260
+ }
261
+ // Root-only: the whole chain is the root's, so no ancestor holds ignore
262
+ // files of its own, and within one matcher `ignore` itself refuses to
263
+ // re-include under an excluded directory (measured). Nothing is left for an
264
+ // ancestor walk to add.
265
+ const check = (probe) => isAlwaysIgnored(probe) || isIgnoredByChain(resolve(''), probe);
184
266
  return {
185
- isIgnoredFile: (path) => check(path, path),
186
- isIgnoredDirectory: (path) => check(path, `${path}/`),
267
+ isIgnoredFile: (path) => check(path),
268
+ isIgnoredDirectory: (path) => check(`${path}/`),
187
269
  };
188
270
  }
189
271
  /**
@@ -0,0 +1,7 @@
1
+ import type { ChildProcess } from 'node:child_process';
2
+ /**
3
+ * Kill `cp` (and its descendants) when this process exits, unless it has
4
+ * already exited on its own.
5
+ */
6
+ export declare function killChildOnHostExit(cp: ChildProcess): void;
7
+ export declare function killTrackedChildren(): void;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.killChildOnHostExit = killChildOnHostExit;
4
+ exports.killTrackedChildren = killTrackedChildren;
5
+ const native_1 = require("../native");
6
+ // Children spawned by this process that must not outlive it. Plugin workers
7
+ // are torn down with `process.exit`, which leaves spawned build tools (gradle,
8
+ // maven, ...) orphaned and still holding their project locks.
9
+ const trackedChildren = new Set();
10
+ let exitHookRegistered = false;
11
+ /**
12
+ * Kill `cp` (and its descendants) when this process exits, unless it has
13
+ * already exited on its own.
14
+ */
15
+ function killChildOnHostExit(cp) {
16
+ if (!cp.pid)
17
+ return;
18
+ trackedChildren.add(cp.pid);
19
+ const untrack = () => {
20
+ trackedChildren.delete(cp.pid);
21
+ // Whichever fires first, drop both — otherwise the other stays registered
22
+ // on a child that is already gone.
23
+ cp.off('exit', untrack);
24
+ cp.off('error', untrack);
25
+ };
26
+ cp.once('exit', untrack);
27
+ cp.once('error', untrack);
28
+ if (!exitHookRegistered) {
29
+ exitHookRegistered = true;
30
+ process.once('exit', killTrackedChildren);
31
+ }
32
+ }
33
+ function killTrackedChildren() {
34
+ for (const pid of trackedChildren) {
35
+ try {
36
+ // 'exit' handlers must be synchronous, so no graceful variant here.
37
+ (0, native_1.killProcessTree)(pid, 'SIGTERM');
38
+ }
39
+ catch { }
40
+ }
41
+ trackedChildren.clear();
42
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureNxConsoleInstalled = ensureNxConsoleInstalled;
4
- const enquirer_1 = require("enquirer");
4
+ const prompt_helpers_1 = require("./prompt-helpers");
5
5
  const os_1 = require("os");
6
6
  const output_1 = require("./output");
7
7
  const native_1 = require("../native");
@@ -50,13 +50,10 @@ async function promptForNxConsoleInstallation() {
50
50
  '- Explore your workspace visually',
51
51
  ],
52
52
  });
53
- const { shouldInstallNxConsole } = await (0, enquirer_1.prompt)({
54
- type: 'confirm',
55
- name: 'shouldInstallNxConsole',
53
+ return await (0, prompt_helpers_1.confirmationPrompt)({
56
54
  message: 'Install Nx Console? (you can uninstall anytime)',
57
- initial: true,
55
+ onCancel: () => false,
58
56
  });
59
- return shouldInstallNxConsole;
60
57
  }
61
58
  catch (error) {
62
59
  return false;
@@ -8,6 +8,11 @@
8
8
  * Consumed by the native binding loader, so keep this file limited to local
9
9
  * helpers that themselves use Node builtins only.
10
10
  */
11
+ export declare const NX_TMP_DIR_POSIX = "/tmp/.nx";
12
+ /**
13
+ * Windows has no /tmp, named pipes are not subject to filesystem sandboxing,
14
+ * and per-user temp dirs are stable there, so the OS temp dir is fine.
15
+ */
11
16
  export declare const NX_TMP_DIR: string;
12
17
  /**
13
18
  * Owner-only runtime root for the current user. No user segment on Windows —
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NX_HOME_TMP_DIR = exports.NX_USER_TMP_DIR = exports.NX_TMP_DIR = void 0;
3
+ exports.NX_HOME_TMP_DIR = exports.NX_USER_TMP_DIR = exports.NX_TMP_DIR = exports.NX_TMP_DIR_POSIX = void 0;
4
4
  const node_os_1 = require("node:os");
5
5
  const node_path_1 = require("node:path");
6
6
  const owned_private_dir_1 = require("./owned-private-dir");
@@ -14,7 +14,12 @@ const owned_private_dir_1 = require("./owned-private-dir");
14
14
  * Consumed by the native binding loader, so keep this file limited to local
15
15
  * helpers that themselves use Node builtins only.
16
16
  */
17
- exports.NX_TMP_DIR = (0, node_os_1.platform)() === 'win32' ? (0, node_path_1.join)((0, node_os_1.tmpdir)(), '.nx') : '/tmp/.nx';
17
+ exports.NX_TMP_DIR_POSIX = '/tmp/.nx';
18
+ /**
19
+ * Windows has no /tmp, named pipes are not subject to filesystem sandboxing,
20
+ * and per-user temp dirs are stable there, so the OS temp dir is fine.
21
+ */
22
+ exports.NX_TMP_DIR = (0, node_os_1.platform)() === 'win32' ? (0, node_path_1.join)((0, node_os_1.tmpdir)(), '.nx') : exports.NX_TMP_DIR_POSIX;
18
23
  /**
19
24
  * Owner-only runtime root for the current user. No user segment on Windows —
20
25
  * `%TMP%` is already per-account, and the segment would only cost path length.
@@ -1,5 +1,65 @@
1
1
  import { WriteStream } from 'tty';
2
2
  import type { TaskStatus } from '../tasks-runner/tasks-runner';
3
+ /**
4
+ * The statuses whose output can be collapsed to a single line: the task did the
5
+ * work, or the cache stood in for it.
6
+ */
7
+ export type CollapsibleTaskStatus = Extract<TaskStatus, 'success' | 'local-cache' | 'local-cache-kept-existing' | 'remote-cache'>;
8
+ /**
9
+ * `static-failures-only` is `static` with successful tasks collapsed to a single
10
+ * line. They select the same life cycle and differ only in what it prints, so
11
+ * everywhere the life cycle is chosen, the TUI is ruled out, or output is
12
+ * routed, the two behave identically.
13
+ */
14
+ export declare function isStaticOutputStyle(outputStyle: string | undefined): boolean;
15
+ /**
16
+ * Whether a run prints every task's output in full rather than collapsing the
17
+ * ones that succeeded. Both static life cycles and the batch renderer have to
18
+ * agree on this, so they read it from here rather than each deriving it.
19
+ *
20
+ * Exactly one style collapses, and it is also what a run that named no style
21
+ * gets. Every other style prints in full because it was asked for explicitly,
22
+ * so none may quietly withhold output. Note the static life cycles serve more
23
+ * styles than the static-sounding ones: `shouldUseDynamicLifeCycle` bails on
24
+ * `isCI()` before it looks at the style at all, so in CI `dynamic` and `tui`
25
+ * land here too. This is written as a deny-list for that reason — a new style
26
+ * prints in full until someone decides otherwise, rather than silently
27
+ * collapsing because an allow-list did not list it.
28
+ *
29
+ * Resolving the absent case here rather than assigning `outputStyle` upstream is
30
+ * deliberate: the value is also read by the orchestrator to decide whether a
31
+ * task streams, and naming the default there stops `shouldStreamOutput` from
32
+ * ever being consulted — including for the continuous tasks that must stream.
33
+ */
34
+ export declare function printsFullTaskOutput(args: {
35
+ verbose?: boolean;
36
+ outputStyle?: string;
37
+ }): boolean;
38
+ /**
39
+ * Whether task output should be wrapped in collapsible log groups. Grouping
40
+ * requires each task's output to be written as one contiguous block, which is
41
+ * why batch mode's implicit streaming backs off when this is on. It does not
42
+ * govern streaming in general — an explicit `--output-style`, the TUI, and
43
+ * long running tasks all still stream.
44
+ */
45
+ export declare function isLogGroupingEnabled(): boolean;
46
+ /**
47
+ * Whether a batch task's output should be held back from the live stream and
48
+ * rendered inside a fold instead. A batch worker writes to stdout/stderr live,
49
+ * so forwarding that copy would put its bytes outside the group and defeat the
50
+ * fold; what is held back is written to a file and rendered by the orchestrator.
51
+ *
52
+ * Note it is the captured file, not each task's `terminalOutput`, that makes
53
+ * this lossless. A worker is free to write bytes it attributes to no task —
54
+ * `@nx/maven`'s exit-code dump, `@nx/gradle`'s configuration phase — and those
55
+ * appear in no `terminalOutput` at all, so the fold has to be able to fall back
56
+ * to the file. See `TaskOrchestrator.printGroupedBatchOutput` for when it does.
57
+ *
58
+ * This is only worth doing when grouping is on and the user has not asked to
59
+ * stream — an explicit stream style (which sets NX_STREAM_OUTPUT) wants the
60
+ * live copy, folds or not.
61
+ */
62
+ export declare function shouldGroupBatchOutput(): boolean;
3
63
  export interface CLIErrorMessageConfig {
4
64
  title: string;
5
65
  bodyLines?: string[];
@@ -48,7 +108,66 @@ declare class CLIOutput {
48
108
  bold: import("picocolors/types").Formatter;
49
109
  underline: import("picocolors/types").Formatter;
50
110
  dim: import("picocolors/types").Formatter;
111
+ /**
112
+ * Whether the terminal is positioned at the start of a line. Task output does
113
+ * not reliably end in a newline, so writers that must begin on a fresh line
114
+ * ask for one via {@link ensureLineStart} rather than guessing.
115
+ *
116
+ * Holding that true means a writer that can leave the cursor mid-line has to
117
+ * be routed through this class or declared to it. The ones that exist today:
118
+ *
119
+ * - This class's own writes, via {@link writeToStream}.
120
+ * - A batch worker's live output, via {@link writeTaskOutputChunk}.
121
+ * - `nx:run-commands`, which is the only executor that runs in the main
122
+ * process (`task-orchestrator.ts` gates that on the executor name), and
123
+ * whose raw writes go through {@link writeTaskOutputChunk} for this reason.
124
+ * Its `addColorAndPrefix` splits on newlines without ever appending one, so
125
+ * its chunks routinely end mid-line.
126
+ * - A pseudo-terminal task, which cannot be routed: the native side writes to
127
+ * this process's stdout from Rust, at arbitrary PTY read boundaries. It
128
+ * declares itself via {@link noteExternalWrite} instead, which is why that
129
+ * exists.
130
+ *
131
+ * Two bypasses are deliberate and safe, both because they re-emit output a
132
+ * whole line at a time via `formatPrefixedLines`, which appends `EOL` to every
133
+ * line it writes: forked task streaming through
134
+ * `NodeChildProcessWithNonDirectOutput`'s `addPrefixTransformer`, and
135
+ * `writePrefixedLines` for a main-process `nx:run-commands` under
136
+ * `NX_PREFIX_OUTPUT`.
137
+ *
138
+ * One bypass is known and is NOT safe. With `NX_NATIVE_COMMAND_RUNNER=false`,
139
+ * `forkProcessLegacy` forks with inherited stdio and yields
140
+ * `NodeChildProcessWithDirectOutput`, whose child writes straight to this
141
+ * process's fd 1 at arbitrary boundaries — unroutable and undeclarable from
142
+ * here. Line tracking is simply wrong on that path; it degrades to the
143
+ * pre-tracking behavior of a glued marker rather than to anything new. Do not
144
+ * read this list as closed: it is what is known, and the way to tell you are
145
+ * adding to it is that you are writing to stdout during a run without going
146
+ * through {@link writeToStream}, {@link writeTaskOutputChunk} or
147
+ * {@link noteExternalWrite}.
148
+ */
149
+ private atLineStart;
51
150
  private writeToStream;
151
+ /**
152
+ * Forwards a chunk of a task's output live, keeping {@link atLineStart}
153
+ * accurate. Batch workers write raw chunks that routinely end mid-line, and a
154
+ * collapsed summary line must not be glued onto one.
155
+ *
156
+ * @internal Not part of the output API plugins may rely on.
157
+ */
158
+ writeTaskOutputChunk(chunk: string | Buffer, stream?: WriteStream): void;
159
+ /**
160
+ * Declares output this class could not route — a pseudo-terminal task's, which
161
+ * the native side writes straight to our stdout — so the next writer needing a
162
+ * fresh line asks for one instead of trusting a stale position.
163
+ *
164
+ * The chunk is inspected rather than assumed mid-line, so output that did end
165
+ * on a line boundary does not cost a blank line. PTY chunks often end in an
166
+ * escape sequence after the newline, and that reads as mid-line, which is the
167
+ * safe direction to be wrong in: a spare newline, never a glued one.
168
+ */
169
+ noteExternalWrite(chunk?: string | Buffer): void;
170
+ private ensureLineStart;
52
171
  overwriteLine(lineText?: string): void;
53
172
  private writeOutputTitle;
54
173
  private writeOptionalOutputBody;
@@ -66,6 +185,40 @@ declare class CLIOutput {
66
185
  logRawLine(message: string): void;
67
186
  logCommand(message: string, taskStatus?: TaskStatus): void;
68
187
  logCommandOutput(message: string, taskStatus: TaskStatus, output: string): void;
188
+ /**
189
+ * A single line standing in for a task's full output, used when the output
190
+ * itself carries no information worth printing (a success, or a cache hit).
191
+ * Statuses that carry a diagnosable body are deliberately not accepted here.
192
+ */
193
+ logCommandSummary(message: string, taskStatus: CollapsibleTaskStatus): void;
194
+ /**
195
+ * A one-line stand-in for a task whose full output is shown elsewhere — used
196
+ * for the tasks of a batch rendered as a single log group rather than per
197
+ * task. `note` points the reader at that group.
198
+ */
199
+ logCommandRedirect(message: string, taskStatus: Exclude<TaskStatus, 'skipped'>, note: string): void;
200
+ /**
201
+ * Prints a batch's combined output as one log group. A batch runner's
202
+ * diagnostics — a crash, a config-phase error, a runner summary — belong to no
203
+ * single task, so the group is labelled with the batch rather than a task.
204
+ *
205
+ * The batch's own output is copied straight from the file it was captured
206
+ * into, so an arbitrarily long log costs a fixed amount of memory here.
207
+ * Nothing is withheld: this rendering is chosen because the whole log was
208
+ * asked for, because no task claimed any of it, or because a task failed or
209
+ * was stopped — in which case repeating claimed bytes beside the per-task
210
+ * blocks is deliberate (see TaskOrchestrator.printGroupedBatchOutput).
211
+ */
212
+ logBatchGroup(label: string, body: {
213
+ capturedOutputPath?: string;
214
+ trailer?: string;
215
+ }, taskStatus: TaskStatus): void;
216
+ /**
217
+ * Copies a file to stdout a chunk at a time. Reading it into one string would
218
+ * reintroduce the unbounded growth that writing it to disk avoided, and a
219
+ * long batch log can exceed the maximum length of a JS string.
220
+ */
221
+ private copyFileToStream;
69
222
  private getCommandWithStatus;
70
223
  private getStatusIcon;
71
224
  private normalizeMessage;