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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/bin/init-local.js +11 -20
  2. package/dist/bin/nx.d.ts +1 -0
  3. package/dist/bin/nx.js +28 -2
  4. package/dist/plugins/package-json.js +4 -2
  5. package/dist/src/adapter/ngcli-adapter.d.ts +2 -1
  6. package/dist/src/adapter/ngcli-adapter.js +25 -2
  7. package/dist/src/ai/clone-ai-config-repo.js +20 -3
  8. package/dist/src/analytics/analytics.js +10 -1
  9. package/dist/src/command-line/add/completion.d.ts +1 -0
  10. package/dist/src/command-line/add/completion.js +15 -0
  11. package/dist/src/command-line/affected/completion.d.ts +1 -0
  12. package/dist/src/command-line/affected/completion.js +15 -0
  13. package/dist/src/command-line/completion/argv-layout.d.ts +6 -0
  14. package/dist/src/command-line/completion/argv-layout.js +19 -0
  15. package/dist/src/command-line/completion/command-completions.d.ts +19 -0
  16. package/dist/src/command-line/completion/command-completions.js +120 -0
  17. package/dist/src/command-line/completion/command-handlers.d.ts +30 -0
  18. package/dist/src/command-line/completion/command-handlers.js +69 -0
  19. package/dist/src/command-line/completion/command-object.d.ts +10 -0
  20. package/dist/src/command-line/completion/command-object.js +95 -0
  21. package/dist/src/command-line/completion/completion-providers.d.ts +21 -0
  22. package/dist/src/command-line/completion/completion-providers.js +194 -0
  23. package/dist/src/command-line/completion/infix-targets.d.ts +1 -0
  24. package/dist/src/command-line/completion/infix-targets.js +48 -0
  25. package/dist/src/command-line/completion/metadata.d.ts +22 -0
  26. package/dist/src/command-line/completion/metadata.js +71 -0
  27. package/dist/src/command-line/completion/registrations.d.ts +9 -0
  28. package/dist/src/command-line/completion/registrations.js +16 -0
  29. package/dist/src/command-line/completion/scripts/bash.sh +51 -0
  30. package/dist/src/command-line/completion/scripts/fish.fish +47 -0
  31. package/dist/src/command-line/completion/scripts/powershell.ps1 +52 -0
  32. package/dist/src/command-line/completion/scripts/zsh.zsh +69 -0
  33. package/dist/src/command-line/completion/scripts.d.ts +18 -0
  34. package/dist/src/command-line/completion/scripts.js +140 -0
  35. package/dist/src/command-line/completion/trigger.d.ts +3 -0
  36. package/dist/src/command-line/completion/trigger.js +21 -0
  37. package/dist/src/command-line/completion/value-completions.d.ts +3 -0
  38. package/dist/src/command-line/completion/value-completions.js +21 -0
  39. package/dist/src/command-line/examples.js +1 -1
  40. package/dist/src/command-line/format/format.js +15 -5
  41. package/dist/src/command-line/generate/completion.d.ts +1 -0
  42. package/dist/src/command-line/generate/completion.js +9 -0
  43. package/dist/src/command-line/graph/completion.d.ts +1 -0
  44. package/dist/src/command-line/graph/completion.js +13 -0
  45. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +14 -18
  46. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +1 -0
  47. package/dist/src/command-line/init/implementation/utils.d.ts +7 -1
  48. package/dist/src/command-line/init/implementation/utils.js +51 -14
  49. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +22 -0
  50. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +100 -0
  51. package/dist/src/command-line/migrate/agentic/cli-args.d.ts +12 -0
  52. package/dist/src/command-line/migrate/agentic/cli-args.js +38 -0
  53. package/dist/src/command-line/migrate/agentic/definitions.d.ts +6 -0
  54. package/dist/src/command-line/migrate/agentic/definitions.js +98 -0
  55. package/dist/src/command-line/migrate/agentic/detect-installed.d.ts +10 -0
  56. package/dist/src/command-line/migrate/agentic/detect-installed.js +68 -0
  57. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +46 -0
  58. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +87 -0
  59. package/dist/src/command-line/migrate/agentic/handoff.d.ts +63 -0
  60. package/dist/src/command-line/migrate/agentic/handoff.js +183 -0
  61. package/dist/src/command-line/migrate/agentic/inception.d.ts +9 -0
  62. package/dist/src/command-line/migrate/agentic/inception.js +15 -0
  63. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +22 -0
  64. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +50 -0
  65. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +51 -0
  66. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +65 -0
  67. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +44 -0
  68. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +52 -0
  69. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +21 -0
  70. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +26 -0
  71. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +18 -0
  72. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +130 -0
  73. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +46 -0
  74. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +88 -0
  75. package/dist/src/command-line/migrate/agentic/run-step.d.ts +51 -0
  76. package/dist/src/command-line/migrate/agentic/run-step.js +121 -0
  77. package/dist/src/command-line/migrate/agentic/runner.d.ts +33 -0
  78. package/dist/src/command-line/migrate/agentic/runner.js +442 -0
  79. package/dist/src/command-line/migrate/agentic/select.d.ts +14 -0
  80. package/dist/src/command-line/migrate/agentic/select.js +150 -0
  81. package/dist/src/command-line/migrate/agentic/types.d.ts +102 -0
  82. package/dist/src/command-line/migrate/agentic/types.js +2 -0
  83. package/dist/src/command-line/migrate/command-object.d.ts +1 -0
  84. package/dist/src/command-line/migrate/command-object.js +32 -7
  85. package/dist/src/command-line/migrate/migrate-commits.d.ts +50 -0
  86. package/dist/src/command-line/migrate/migrate-commits.js +102 -0
  87. package/dist/src/command-line/migrate/migrate-output.d.ts +180 -0
  88. package/dist/src/command-line/migrate/migrate-output.js +258 -0
  89. package/dist/src/command-line/migrate/migrate.d.ts +122 -12
  90. package/dist/src/command-line/migrate/migrate.js +1036 -217
  91. package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
  92. package/dist/src/command-line/migrate/migration-shape.js +13 -0
  93. package/dist/src/command-line/migrate/multi-major.d.ts +30 -0
  94. package/dist/src/command-line/migrate/multi-major.js +185 -0
  95. package/dist/src/command-line/migrate/prompt-files.d.ts +31 -0
  96. package/dist/src/command-line/migrate/prompt-files.js +141 -0
  97. package/dist/src/command-line/migrate/run-migration-process.js +28 -6
  98. package/dist/src/command-line/migrate/safe-prompt.d.ts +28 -0
  99. package/dist/src/command-line/migrate/safe-prompt.js +49 -0
  100. package/dist/src/command-line/migrate/update-filters.d.ts +11 -0
  101. package/dist/src/command-line/migrate/update-filters.js +44 -0
  102. package/dist/src/command-line/migrate/version-utils.d.ts +6 -0
  103. package/dist/src/command-line/migrate/version-utils.js +59 -0
  104. package/dist/src/command-line/nx-commands.js +9 -0
  105. package/dist/src/command-line/release/config/config.d.ts +3 -6
  106. package/dist/src/command-line/release/config/config.js +77 -45
  107. package/dist/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  108. package/dist/src/command-line/release/config/use-legacy-versioning.js +8 -0
  109. package/dist/src/command-line/release/utils/release-graph.js +2 -3
  110. package/dist/src/command-line/release/utils/repository-git-tags.js +1 -1
  111. package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +7 -19
  112. package/dist/src/command-line/release/version/resolve-current-version.js +1 -1
  113. package/dist/src/command-line/release/version/version-actions.js +3 -7
  114. package/dist/src/command-line/report/report.js +2 -2
  115. package/dist/src/command-line/run/completion.d.ts +1 -0
  116. package/dist/src/command-line/run/completion.js +7 -0
  117. package/dist/src/command-line/run-many/completion.d.ts +1 -0
  118. package/dist/src/command-line/run-many/completion.js +13 -0
  119. package/dist/src/command-line/show/completion.d.ts +1 -0
  120. package/dist/src/command-line/show/completion.js +27 -0
  121. package/dist/src/command-line/show/show-target/info.d.ts +1 -0
  122. package/dist/src/command-line/show/show-target/info.js +100 -19
  123. package/dist/src/command-line/watch/command-object.js +24 -4
  124. package/dist/src/command-line/watch/completion.d.ts +1 -0
  125. package/dist/src/command-line/watch/completion.js +10 -0
  126. package/dist/src/command-line/watch/watch.d.ts +7 -0
  127. package/dist/src/command-line/watch/watch.js +1 -1
  128. package/dist/src/config/misc-interfaces.d.ts +25 -2
  129. package/dist/src/config/nx-json.d.ts +43 -56
  130. package/dist/src/config/schema-utils.d.ts +21 -0
  131. package/dist/src/config/schema-utils.js +92 -18
  132. package/dist/src/config/task-graph.d.ts +4 -107
  133. package/dist/src/core/graph/main.js +1 -1
  134. package/dist/src/core/graph/styles.css +2 -3
  135. package/dist/src/core/graph/styles.js +1 -1
  136. package/dist/src/daemon/client/client.d.ts +1 -1
  137. package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +1 -1
  138. package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +1 -1
  139. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +9 -0
  140. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +76 -0
  141. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +45 -11
  142. package/dist/src/daemon/server/server.js +4 -43
  143. package/dist/src/daemon/server/start.d.ts +1 -1
  144. package/dist/src/daemon/server/start.js +2 -0
  145. package/dist/src/devkit-exports.d.ts +2 -2
  146. package/dist/src/devkit-internals.d.ts +5 -1
  147. package/dist/src/devkit-internals.js +17 -1
  148. package/dist/src/executors/run-commands/running-tasks.d.ts +7 -0
  149. package/dist/src/executors/run-commands/running-tasks.js +178 -105
  150. package/dist/src/executors/run-script/run-script.impl.js +3 -10
  151. package/dist/src/executors/utils/convert-nx-executor.js +1 -1
  152. package/dist/src/hasher/hash-plan-inspector.d.ts +1 -1
  153. package/dist/src/hasher/task-hasher.js +6 -4
  154. package/dist/src/index.d.ts +1 -1
  155. package/dist/src/index.js +0 -3
  156. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +6 -2
  157. package/dist/src/migrations/update-17-0-0/move-cache-directory.md +31 -0
  158. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +20 -4
  159. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.md +27 -0
  160. package/dist/src/migrations/update-20-0-1/use-legacy-cache.md +24 -0
  161. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.md +49 -0
  162. package/dist/src/migrations/update-21-0-0/release-version-config-changes.md +54 -0
  163. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.md +28 -0
  164. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.md +22 -0
  165. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.md +11 -0
  166. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.d.ts +2 -0
  167. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +16 -0
  168. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +9 -0
  169. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +18 -0
  170. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.d.ts +35 -0
  171. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.js +139 -0
  172. package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.md +66 -0
  173. package/dist/src/native/index.d.ts +79 -2
  174. package/dist/src/native/native-bindings.js +3 -0
  175. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  176. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  177. package/dist/src/plugins/js/lock-file/npm-parser.js +37 -19
  178. package/dist/src/plugins/js/lock-file/pnpm-parser.js +51 -4
  179. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +12 -4
  180. package/dist/src/plugins/js/utils/packages.js +1 -1
  181. package/dist/src/plugins/js/utils/register.d.ts +103 -14
  182. package/dist/src/plugins/js/utils/register.js +434 -39
  183. package/dist/src/plugins/js/utils/typescript.d.ts +7 -0
  184. package/dist/src/plugins/js/utils/typescript.js +39 -0
  185. package/dist/src/plugins/package-json/create-nodes.d.ts +3 -2
  186. package/dist/src/plugins/package-json/create-nodes.js +7 -5
  187. package/dist/src/project-graph/affected/locators/project-glob-changes.js +2 -1
  188. package/dist/src/project-graph/build-project-graph.d.ts +5 -0
  189. package/dist/src/project-graph/build-project-graph.js +6 -2
  190. package/dist/src/project-graph/file-map-utils.d.ts +5 -0
  191. package/dist/src/project-graph/file-map-utils.js +10 -1
  192. package/dist/src/project-graph/plugins/get-plugins.d.ts +7 -2
  193. package/dist/src/project-graph/plugins/get-plugins.js +8 -5
  194. package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
  195. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +2 -0
  196. package/dist/src/project-graph/plugins/resolve-plugin.d.ts +7 -4
  197. package/dist/src/project-graph/plugins/resolve-plugin.js +152 -33
  198. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +4 -2
  199. package/dist/src/project-graph/plugins/transpiler.d.ts +12 -0
  200. package/dist/src/project-graph/plugins/transpiler.js +37 -0
  201. package/dist/src/project-graph/plugins/utils.js +13 -7
  202. package/dist/src/project-graph/project-graph.js +1 -1
  203. package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +95 -4
  204. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +515 -68
  205. package/dist/src/project-graph/utils/project-configuration-utils.d.ts +13 -5
  206. package/dist/src/project-graph/utils/project-configuration-utils.js +14 -6
  207. package/dist/src/project-graph/utils/retrieve-workspace-files.js +1 -1
  208. package/dist/src/tasks-runner/create-task-graph.d.ts +4 -4
  209. package/dist/src/tasks-runner/create-task-graph.js +1 -1
  210. package/dist/src/tasks-runner/default-tasks-runner.d.ts +0 -2
  211. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
  212. package/dist/src/tasks-runner/forked-process-task-runner.js +11 -6
  213. package/dist/src/tasks-runner/init-tasks-runner.d.ts +0 -15
  214. package/dist/src/tasks-runner/init-tasks-runner.js +0 -63
  215. package/dist/src/tasks-runner/legacy-depends-on-warning.d.ts +18 -0
  216. package/dist/src/tasks-runner/legacy-depends-on-warning.js +109 -0
  217. package/dist/src/tasks-runner/life-cycle.d.ts +7 -8
  218. package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +6 -6
  219. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +13 -2
  220. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -5
  221. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +11 -2
  222. package/dist/src/tasks-runner/pseudo-terminal.d.ts +1 -1
  223. package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
  224. package/dist/src/tasks-runner/run-command.js +8 -11
  225. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +1 -1
  226. package/dist/src/tasks-runner/running-tasks/batch-process.js +3 -5
  227. package/dist/src/tasks-runner/running-tasks/node-child-process.d.ts +2 -2
  228. package/dist/src/tasks-runner/running-tasks/node-child-process.js +5 -7
  229. package/dist/src/tasks-runner/task-env.d.ts +1 -1
  230. package/dist/src/tasks-runner/task-env.js +6 -1
  231. package/dist/src/tasks-runner/task-orchestrator.d.ts +11 -1
  232. package/dist/src/tasks-runner/task-orchestrator.js +112 -38
  233. package/dist/src/tasks-runner/tasks-schedule.js +3 -3
  234. package/dist/src/tasks-runner/utils.d.ts +7 -8
  235. package/dist/src/tasks-runner/utils.js +23 -27
  236. package/dist/src/utils/child-process.js +2 -2
  237. package/dist/src/utils/compile-cache.d.ts +24 -0
  238. package/dist/src/utils/compile-cache.js +49 -0
  239. package/dist/src/utils/enable-compile-cache.d.ts +1 -0
  240. package/dist/src/utils/enable-compile-cache.js +7 -0
  241. package/dist/src/utils/fileutils.d.ts +0 -8
  242. package/dist/src/utils/fileutils.js +0 -40
  243. package/dist/src/utils/git-utils.d.ts +15 -0
  244. package/dist/src/utils/git-utils.js +138 -0
  245. package/dist/src/utils/handle-import.d.ts +4 -1
  246. package/dist/src/utils/handle-import.js +56 -2
  247. package/dist/src/utils/has-nx-js-plugin.d.ts +9 -0
  248. package/dist/src/utils/has-nx-js-plugin.js +24 -0
  249. package/dist/src/utils/installed-nx-version.d.ts +14 -4
  250. package/dist/src/utils/installed-nx-version.js +54 -7
  251. package/dist/src/utils/logger.d.ts +12 -1
  252. package/dist/src/utils/logger.js +57 -36
  253. package/dist/src/utils/nx-key.d.ts +0 -1
  254. package/dist/src/utils/nx-key.js +20 -23
  255. package/dist/src/utils/nx-package-group.d.ts +8 -0
  256. package/dist/src/utils/nx-package-group.js +15 -0
  257. package/dist/src/utils/output.d.ts +3 -2
  258. package/dist/src/utils/output.js +29 -28
  259. package/dist/src/utils/package-json.d.ts +14 -1
  260. package/dist/src/utils/package-json.js +20 -21
  261. package/dist/src/utils/perf-logging.js +3 -1
  262. package/dist/src/utils/plugin-cache-utils.d.ts +13 -4
  263. package/dist/src/utils/plugin-cache-utils.js +23 -13
  264. package/dist/src/utils/plugins/local-plugins.d.ts +18 -0
  265. package/dist/src/utils/plugins/local-plugins.js +30 -0
  266. package/dist/src/utils/tar.d.ts +8 -0
  267. package/dist/src/utils/tar.js +44 -0
  268. package/migrations.json +16 -0
  269. package/package.json +28 -28
  270. package/schemas/nx-schema.json +114 -80
  271. package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +0 -7
  272. package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +0 -155
  273. package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +0 -16
  274. package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +0 -121
@@ -0,0 +1,69 @@
1
+ ###-begin-nx-completions-###
2
+ #
3
+ # nx command completion script
4
+ #
5
+ # Installation: nx completion zsh >> ~/.zshrc
6
+ # or: nx completion zsh > /usr/local/share/zsh/site-functions/_nx
7
+ #
8
+ if type compdef &>/dev/null; then
9
+ _nx_completions () {
10
+ local reply nx_cmd dir
11
+ local si=$IFS
12
+
13
+ # Walk up for a workspace-local nx; fall back to PATH outside a workspace.
14
+ nx_cmd="nx"
15
+ dir="$PWD"
16
+ while [[ "$dir" != "/" ]]; do
17
+ if [[ -x "$dir/node_modules/.bin/nx" ]]; then
18
+ nx_cmd="$dir/node_modules/.bin/nx"
19
+ break
20
+ fi
21
+ if [[ -x "$dir/.nx/installation/node_modules/.bin/nx" ]]; then
22
+ nx_cmd="$dir/.nx/installation/node_modules/.bin/nx"
23
+ break
24
+ fi
25
+ dir="${dir:h}"
26
+ done
27
+
28
+ # Hide stderr so stray warnings don't land in the buffer; NX_VERBOSE_LOGGING surfaces it.
29
+ if [[ -n "$NX_VERBOSE_LOGGING" ]]; then
30
+ IFS=$'\n' reply=($(NX_COMPLETE=zsh "$nx_cmd" "${words[@]}"))
31
+ else
32
+ IFS=$'\n' reply=($(NX_COMPLETE=zsh "$nx_cmd" "${words[@]}" 2>/dev/null))
33
+ fi
34
+ IFS=$si
35
+
36
+ # Split `value\tdescription` into parallel arrays for compadd -d. Don't
37
+ # use _describe: it splits on ':', mangling values like `my-app:build`.
38
+ local -a values displays
39
+ local r value nospace=0
40
+ for r in $reply; do
41
+ value="${r%%$'\t'*}"
42
+ values+=("$value")
43
+ if [[ "$r" == *$'\t'* ]]; then
44
+ displays+=("$value -- ${r#*$'\t'}")
45
+ else
46
+ displays+=("$value")
47
+ fi
48
+ [[ "$value" == *: ]] && nospace=1 # trailing ':' → nospace
49
+ done
50
+
51
+ if (( ${#values} == 0 )); then
52
+ # Nothing to suggest — fall back to filename completion (covers
53
+ # `nx g app --directory <TAB>` and similar unknown-flag values).
54
+ _files
55
+ return
56
+ fi
57
+ if (( nospace )); then
58
+ compadd -S '' -d displays -a values
59
+ else
60
+ compadd -d displays -a values
61
+ fi
62
+ }
63
+ compdef _nx_completions nx
64
+ else
65
+ echo "nx: shell completion requires zsh's completion system to be loaded." >&2
66
+ echo " Add the following line to your ~/.zshrc above this block:" >&2
67
+ echo " autoload -U compinit && compinit" >&2
68
+ fi
69
+ ###-end-nx-completions-###
@@ -0,0 +1,18 @@
1
+ export type Shell = 'bash' | 'zsh' | 'fish' | 'powershell';
2
+ export declare const SHELLS: readonly Shell[];
3
+ /** Print the raw wrapper script to stdout — for scripting / custom rc paths. */
4
+ export declare function printCompletionScript(shell: Shell): void;
5
+ /**
6
+ * Write the wrapper to the shell's default rc location, replacing any prior
7
+ * nx-completion block (idempotent via the begin/end markers). Logs the
8
+ * resolved path and a one-line "open a new shell" hint.
9
+ */
10
+ export declare function installCompletionScript(shell: Shell): void;
11
+ /**
12
+ * Stderr advisory when `nx` is not on PATH — the wrappers walk up for a
13
+ * workspace-local nx, but the outside-workspace fallback needs `nx`
14
+ * reachable by name. Callers fire this ONCE per invocation even when
15
+ * installing for multiple shells.
16
+ */
17
+ export declare function maybeWarnNxNotOnPath(): void;
18
+ export declare function generateScript(shell: Shell): string;
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SHELLS = void 0;
4
+ exports.printCompletionScript = printCompletionScript;
5
+ exports.installCompletionScript = installCompletionScript;
6
+ exports.maybeWarnNxNotOnPath = maybeWarnNxNotOnPath;
7
+ exports.generateScript = generateScript;
8
+ const child_process_1 = require("child_process");
9
+ const fs_1 = require("fs");
10
+ const os_1 = require("os");
11
+ const path_1 = require("path");
12
+ exports.SHELLS = ['bash', 'zsh', 'fish', 'powershell'];
13
+ /** Print the raw wrapper script to stdout — for scripting / custom rc paths. */
14
+ function printCompletionScript(shell) {
15
+ process.stdout.write(generateScript(shell));
16
+ }
17
+ /**
18
+ * Write the wrapper to the shell's default rc location, replacing any prior
19
+ * nx-completion block (idempotent via the begin/end markers). Logs the
20
+ * resolved path and a one-line "open a new shell" hint.
21
+ */
22
+ function installCompletionScript(shell) {
23
+ writeScriptToRcFile(shell);
24
+ }
25
+ /**
26
+ * Stderr advisory when `nx` is not on PATH — the wrappers walk up for a
27
+ * workspace-local nx, but the outside-workspace fallback needs `nx`
28
+ * reachable by name. Callers fire this ONCE per invocation even when
29
+ * installing for multiple shells.
30
+ */
31
+ function maybeWarnNxNotOnPath() {
32
+ if (isNxOnPath())
33
+ return;
34
+ console.warn([
35
+ `nx: \`nx\` is not on your PATH.`,
36
+ ` The generated wrappers resolve a workspace-local nx when you`,
37
+ ` tab-complete inside a project, but outside any workspace they`,
38
+ ` fall back to a bare \`nx\`. Install nx globally so completion`,
39
+ ` works everywhere (e.g. \`pnpm add -g nx\` or \`npm i -g nx\`).`,
40
+ ` Continuing — pass --force to skip this notice.`,
41
+ ].join('\n'));
42
+ }
43
+ function writeScriptToRcFile(shell) {
44
+ const script = generateScript(shell);
45
+ const paths = installPathsFor(shell);
46
+ if (paths.length === 0) {
47
+ console.warn(`nx: automatic install isn't supported for ${shell} yet — run with --stdout and redirect manually.`);
48
+ return;
49
+ }
50
+ for (const path of paths) {
51
+ writeOneRcFile(shell, path, script);
52
+ }
53
+ }
54
+ function writeOneRcFile(shell, path, script) {
55
+ (0, fs_1.mkdirSync)((0, path_1.dirname)(path), { recursive: true });
56
+ // Fish keeps each completion in its own file (a full overwrite is correct).
57
+ // bash/zsh/powershell append to a shared rc file: skip if an nx-completion
58
+ // block is already present so re-runs are no-ops, and never modify
59
+ // existing content — the user may have customized around the block.
60
+ if (shell === 'fish') {
61
+ (0, fs_1.writeFileSync)(path, script);
62
+ }
63
+ else {
64
+ const existing = (0, fs_1.existsSync)(path) ? (0, fs_1.readFileSync)(path, 'utf8') : '';
65
+ if (existing.includes('###-begin-nx-completions-###')) {
66
+ console.warn(`nx: ${shell} completion already present in ${path} — skipping.\n` +
67
+ ` Remove the existing block manually if you need to reinstall.`);
68
+ return;
69
+ }
70
+ const sep = existing && !existing.endsWith('\n') ? '\n' : '';
71
+ (0, fs_1.writeFileSync)(path, existing + sep + script);
72
+ }
73
+ console.warn(`nx: ${shell} completion installed at ${path}.\n` +
74
+ ` Open a new shell (or re-source the rc file) to activate.`);
75
+ }
76
+ function installPathsFor(shell) {
77
+ const home = (0, os_1.homedir)();
78
+ switch (shell) {
79
+ case 'bash':
80
+ return [(0, path_1.join)(home, '.bashrc')];
81
+ case 'zsh':
82
+ return [(0, path_1.join)(home, '.zshrc')];
83
+ case 'fish':
84
+ return [(0, path_1.join)(home, '.config', 'fish', 'completions', 'nx.fish')];
85
+ case 'powershell':
86
+ return resolvePowerShellProfiles();
87
+ }
88
+ }
89
+ /**
90
+ * Shell out to each available PowerShell to expand $PROFILE. The variable's
91
+ * resolution depends on the PS version (5.1 vs 7), $PSVersionTable, and
92
+ * Windows Documents-folder redirection (OneDrive etc.), so asking PS itself
93
+ * is the only reliable way. Returns every distinct profile path we find —
94
+ * PS 5.1 and PS 7 keep separate profile files, so a user with both
95
+ * installed needs the wrapper written to both.
96
+ */
97
+ function resolvePowerShellProfiles() {
98
+ const candidates = process.platform === 'win32' ? ['pwsh.exe', 'powershell.exe'] : ['pwsh'];
99
+ const paths = [];
100
+ for (const exe of candidates) {
101
+ const result = (0, child_process_1.spawnSync)(exe, ['-NoProfile', '-Command', '$PROFILE'], {
102
+ encoding: 'utf8',
103
+ stdio: ['ignore', 'pipe', 'ignore'],
104
+ windowsHide: true,
105
+ });
106
+ if (result.status !== 0 || !result.stdout)
107
+ continue;
108
+ const path = result.stdout.trim();
109
+ if (path && !paths.includes(path))
110
+ paths.push(path);
111
+ }
112
+ return paths;
113
+ }
114
+ function isNxOnPath() {
115
+ const pathEnv = process.env.PATH;
116
+ if (!pathEnv)
117
+ return false;
118
+ const names = process.platform === 'win32' ? ['nx.cmd', 'nx.exe', 'nx'] : ['nx'];
119
+ for (const dir of pathEnv.split(path_1.delimiter)) {
120
+ if (!dir)
121
+ continue;
122
+ for (const name of names) {
123
+ if ((0, fs_1.existsSync)((0, path_1.join)(dir, name)))
124
+ return true;
125
+ }
126
+ }
127
+ return false;
128
+ }
129
+ // Wrappers live as plain files in ./scripts/ for syntax highlighting and
130
+ // shellcheck. Read at call time — each invocation needs each shell's
131
+ // wrapper at most once.
132
+ const WRAPPER_FILES = {
133
+ bash: 'bash.sh',
134
+ zsh: 'zsh.zsh',
135
+ fish: 'fish.fish',
136
+ powershell: 'powershell.ps1',
137
+ };
138
+ function generateScript(shell) {
139
+ return (0, fs_1.readFileSync)((0, path_1.join)(__dirname, 'scripts', WRAPPER_FILES[shell]), 'utf-8');
140
+ }
@@ -0,0 +1,3 @@
1
+ export type CompletionShell = 'bash' | 'zsh' | 'fish' | 'powershell';
2
+ export declare function isCompletionRequest(): boolean;
3
+ export declare function getCompletionShell(): CompletionShell | null;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Shell detection via NX_COMPLETE env var (set by the wrappers).
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.isCompletionRequest = isCompletionRequest;
5
+ exports.getCompletionShell = getCompletionShell;
6
+ const KNOWN_SHELLS = new Set([
7
+ 'bash',
8
+ 'zsh',
9
+ 'fish',
10
+ 'powershell',
11
+ ]);
12
+ function isCompletionRequest() {
13
+ return Boolean(process.env.NX_COMPLETE);
14
+ }
15
+ function getCompletionShell() {
16
+ const raw = process.env.NX_COMPLETE;
17
+ if (raw && KNOWN_SHELLS.has(raw)) {
18
+ return raw;
19
+ }
20
+ return null;
21
+ }
@@ -0,0 +1,3 @@
1
+ import './registrations';
2
+ /** Returns true if handled — caller should not fall through. */
3
+ export declare function tryValueCompletion(argv?: readonly string[]): boolean;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Fast-path completion: project/target/generator/flag values, served from
3
+ // registered metadata without loading the yargs command surface.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.tryValueCompletion = tryValueCompletion;
6
+ require("./registrations");
7
+ const metadata_1 = require("./metadata");
8
+ const argv_layout_1 = require("./argv-layout");
9
+ /** Returns true if handled — caller should not fall through. */
10
+ function tryValueCompletion(argv = process.argv) {
11
+ const parsed = (0, argv_layout_1.parseCompletionArgs)(argv);
12
+ if (parsed === null)
13
+ return false;
14
+ const completions = (0, metadata_1.resolveCompletion)(parsed.tokens, parsed.current, parsed.previousToken);
15
+ if (completions === null)
16
+ return false;
17
+ for (const line of completions) {
18
+ console.log(line);
19
+ }
20
+ return true;
21
+ }
@@ -378,7 +378,7 @@ exports.examples = {
378
378
  description: 'Watch the "app" project and echo the project name and the files that changed',
379
379
  },
380
380
  {
381
- command: 'watch --projects=app1,app2 --includeDependentProjects -- echo \\$NX_PROJECT_NAME',
381
+ command: 'watch --projects=app1,app2 --includeDependencies -- echo \\$NX_PROJECT_NAME',
382
382
  description: 'Watch "app1" and "app2" and echo the project name whenever a specified project or its dependencies change',
383
383
  },
384
384
  {
@@ -34,10 +34,15 @@ async function format(command, args) {
34
34
  process.exit(1);
35
35
  }
36
36
  const { nxArgs } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: false }, (0, configuration_1.readNxJson)());
37
- const patterns = (await getPatterns(prettier, { ...args, ...nxArgs })).map(
38
- // prettier removes one of the \
39
- // prettier-ignore
40
- (p) => `"${p.replace(/\$/g, '\\\$')}"`);
37
+ const patterns = (await getPatterns(prettier, { ...args, ...nxArgs })).map((p) => {
38
+ // On non-Windows, escape $ to prevent shell variable interpolation
39
+ // (the shell consumes one \, so \\$ becomes \$ which the shell treats as literal $)
40
+ // On Windows (cmd.exe), $ is not a special character, so escaping it would
41
+ // cause prettier to look for a file with a literal \$ in the name
42
+ // prettier-ignore
43
+ const escaped = process.platform !== 'win32' ? p.replace(/\$/g, '\\\$') : p;
44
+ return `"${escaped}"`;
45
+ });
41
46
  // Chunkify the patterns array to prevent crashing the windows terminal
42
47
  const chunkList = (0, chunkify_1.chunkify)(patterns);
43
48
  switch (command) {
@@ -204,7 +209,12 @@ function getPrettierPath() {
204
209
  return prettierPath;
205
210
  }
206
211
  const { packageJson, path: packageJsonPath } = (0, package_json_1.readModulePackageJson)('prettier');
207
- prettierPath = path.resolve(path.dirname(packageJsonPath), packageJson.bin);
212
+ const bin = packageJson.bin;
213
+ const binPath = typeof bin === 'string' ? bin : bin?.['prettier'];
214
+ if (!binPath) {
215
+ throw new Error(`Could not find prettier binary in ${packageJsonPath}`);
216
+ }
217
+ prettierPath = path.resolve(path.dirname(packageJsonPath), binPath);
208
218
  return prettierPath;
209
219
  }
210
220
  let useListDifferent;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const metadata_1 = require("../completion/metadata");
4
+ const completion_providers_1 = require("../completion/completion-providers");
5
+ const generateCompletion = {
6
+ positionals: [{ complete: completion_providers_1.completeGenerator }],
7
+ };
8
+ (0, metadata_1.registerCompletion)('generate', generateCompletion);
9
+ (0, metadata_1.registerCompletion)('g', generateCompletion); // alias
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const metadata_1 = require("../completion/metadata");
4
+ const completion_providers_1 = require("../completion/completion-providers");
5
+ (0, metadata_1.registerCompletion)('graph', {
6
+ flags: {
7
+ focus: completion_providers_1.getProjectNameCompletions,
8
+ exclude: completion_providers_1.getProjectNameCompletions,
9
+ targets: completion_providers_1.getTargetNameCompletions,
10
+ target: completion_providers_1.getTargetNameCompletions,
11
+ t: completion_providers_1.getTargetNameCompletions,
12
+ },
13
+ });
@@ -54,29 +54,26 @@ function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjec
54
54
  : []),
55
55
  ].filter(Boolean),
56
56
  };
57
- nxJson.targetDefaults ??= {};
57
+ const defaults = Array.isArray(nxJson.targetDefaults)
58
+ ? [...nxJson.targetDefaults]
59
+ : [];
58
60
  if (workspaceTargets.includes('build')) {
59
- nxJson.targetDefaults.build = {
60
- ...nxJson.targetDefaults.build,
61
+ (0, utils_1.upsertTargetDefaultEntry)(defaults, 'build', {
61
62
  dependsOn: ['^build'],
62
63
  inputs: ['production', '^production'],
63
- };
64
+ });
64
65
  }
65
66
  if (workspaceTargets.includes('server')) {
66
- nxJson.targetDefaults.server = {
67
- ...nxJson.targetDefaults.server,
67
+ (0, utils_1.upsertTargetDefaultEntry)(defaults, 'server', {
68
68
  inputs: ['production', '^production'],
69
- };
69
+ });
70
70
  }
71
71
  if (workspaceTargets.includes('test')) {
72
72
  const inputs = ['default', '^production'];
73
73
  if ((0, fileutils_1.fileExists)((0, node_path_1.join)(repoRoot, 'karma.conf.js'))) {
74
74
  inputs.push('{workspaceRoot}/karma.conf.js');
75
75
  }
76
- nxJson.targetDefaults.test = {
77
- ...nxJson.targetDefaults.test,
78
- inputs,
79
- };
76
+ (0, utils_1.upsertTargetDefaultEntry)(defaults, 'test', { inputs });
80
77
  }
81
78
  if (workspaceTargets.includes('lint')) {
82
79
  const inputs = ['default'];
@@ -86,16 +83,15 @@ function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjec
86
83
  if ((0, fileutils_1.fileExists)((0, node_path_1.join)(repoRoot, 'eslint.config.cjs'))) {
87
84
  inputs.push('{workspaceRoot}/eslint.config.cjs');
88
85
  }
89
- nxJson.targetDefaults.lint = {
90
- ...nxJson.targetDefaults.lint,
91
- inputs,
92
- };
86
+ (0, utils_1.upsertTargetDefaultEntry)(defaults, 'lint', { inputs });
93
87
  }
94
88
  if (workspaceTargets.includes('e2e')) {
95
- nxJson.targetDefaults.e2e = {
96
- ...nxJson.targetDefaults.e2e,
89
+ (0, utils_1.upsertTargetDefaultEntry)(defaults, 'e2e', {
97
90
  inputs: ['default', '^production'],
98
- };
91
+ });
92
+ }
93
+ if (defaults.length > 0) {
94
+ nxJson.targetDefaults = defaults;
99
95
  }
100
96
  (0, fileutils_1.writeJsonFile)((0, node_path_1.join)(repoRoot, 'nx.json'), nxJson);
101
97
  }
@@ -102,6 +102,7 @@ function updateGitIgnore(host) {
102
102
  '.nx/cache',
103
103
  '.nx/workspace-data',
104
104
  '.nx/self-healing',
105
+ '.nx/migrate-runs',
105
106
  ].forEach((file) => {
106
107
  if (!contents.includes(file)) {
107
108
  contents = [contents, file].join('\n');
@@ -1,9 +1,15 @@
1
- import { NxJsonConfiguration } from '../../../config/nx-json';
1
+ import { NxJsonConfiguration, TargetDefaultEntry } from '../../../config/nx-json';
2
2
  import { PackageJson } from '../../../utils/package-json';
3
3
  import { PackageManagerCommands } from '../../../utils/package-manager';
4
4
  export declare function createNxJsonFile(repoRoot: string, topologicalTargets: string[], cacheableOperations: string[], scriptOutputs: {
5
5
  [name: string]: string;
6
6
  }): void;
7
+ /**
8
+ * Locate-by-target upsert against an in-memory `targetDefaults` array.
9
+ * Used by `nx init` code paths that operate on raw JSON before a Tree
10
+ * exists — generators should use `upsertTargetDefault` from devkit instead.
11
+ */
12
+ export declare function upsertTargetDefaultEntry(entries: TargetDefaultEntry[], target: string, patch: Partial<TargetDefaultEntry>): void;
7
13
  export declare function createNxJsonFromTurboJson(turboJson: Record<string, any>): NxJsonConfiguration;
8
14
  export declare function addDepsToPackageJson(repoRoot: string, additionalPackages?: string[]): void;
9
15
  export declare function updateGitIgnore(root: string): void;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNxJsonFile = createNxJsonFile;
4
+ exports.upsertTargetDefaultEntry = upsertTargetDefaultEntry;
4
5
  exports.createNxJsonFromTurboJson = createNxJsonFromTurboJson;
5
6
  exports.addDepsToPackageJson = addDepsToPackageJson;
6
7
  exports.updateGitIgnore = updateGitIgnore;
@@ -34,27 +35,37 @@ function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scr
34
35
  }
35
36
  catch { }
36
37
  nxJson.$schema = './node_modules/nx/schemas/nx-schema.json';
37
- nxJson.targetDefaults ??= {};
38
+ const entries = Array.isArray(nxJson.targetDefaults)
39
+ ? [...nxJson.targetDefaults]
40
+ : [];
38
41
  if (topologicalTargets.length > 0) {
39
42
  for (const scriptName of topologicalTargets) {
40
- nxJson.targetDefaults[scriptName] ??= {};
41
- nxJson.targetDefaults[scriptName] = { dependsOn: [`^${scriptName}`] };
43
+ upsertTargetDefaultEntry(entries, scriptName, {
44
+ dependsOn: [`^${scriptName}`],
45
+ });
42
46
  }
43
47
  }
44
48
  for (const [scriptName, output] of Object.entries(scriptOutputs)) {
45
49
  if (!output) {
46
50
  continue;
47
51
  }
48
- nxJson.targetDefaults[scriptName] ??= {};
49
- nxJson.targetDefaults[scriptName].outputs = [`{projectRoot}/${output}`];
52
+ upsertTargetDefaultEntry(entries, scriptName, {
53
+ outputs: [`{projectRoot}/${output}`],
54
+ });
50
55
  }
51
56
  for (const target of cacheableOperations) {
52
- nxJson.targetDefaults[target] ??= {};
53
- nxJson.targetDefaults[target].cache ??= true;
57
+ const existing = findUnfilteredTargetEntry(entries, target);
58
+ if (existing)
59
+ existing.cache ??= true;
60
+ else
61
+ entries.push({ target, cache: true });
54
62
  }
55
- if (Object.keys(nxJson.targetDefaults).length === 0) {
63
+ if (entries.length === 0) {
56
64
  delete nxJson.targetDefaults;
57
65
  }
66
+ else {
67
+ nxJson.targetDefaults = entries;
68
+ }
58
69
  const defaultBase = (0, deduce_default_base_1.deduceDefaultBase)();
59
70
  // Do not add defaultBase if it is inferred to be the Nx default value of main
60
71
  if (defaultBase !== 'main') {
@@ -62,6 +73,21 @@ function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scr
62
73
  }
63
74
  (0, fileutils_1.writeJsonFile)(nxJsonPath, nxJson);
64
75
  }
76
+ /**
77
+ * Locate-by-target upsert against an in-memory `targetDefaults` array.
78
+ * Used by `nx init` code paths that operate on raw JSON before a Tree
79
+ * exists — generators should use `upsertTargetDefault` from devkit instead.
80
+ */
81
+ function upsertTargetDefaultEntry(entries, target, patch) {
82
+ const existing = findUnfilteredTargetEntry(entries, target);
83
+ if (existing)
84
+ Object.assign(existing, patch, { target });
85
+ else
86
+ entries.push({ ...patch, target });
87
+ }
88
+ function findUnfilteredTargetEntry(entries, target) {
89
+ return entries.find((e) => e.target === target && e.projects === undefined && e.plugin === undefined);
90
+ }
65
91
  function createNxJsonFromTurboJson(turboJson) {
66
92
  const nxJson = {
67
93
  $schema: './node_modules/nx/schemas/nx-schema.json',
@@ -88,20 +114,20 @@ function createNxJsonFromTurboJson(turboJson) {
88
114
  }
89
115
  // Handle task configurations
90
116
  if (turboJson.tasks) {
91
- nxJson.targetDefaults = {};
117
+ const entries = [];
92
118
  for (const [taskName, taskConfig] of Object.entries(turboJson.tasks)) {
93
119
  // Skip project-specific tasks (containing #)
94
120
  if (taskName.includes('#'))
95
121
  continue;
96
122
  const config = taskConfig;
97
- nxJson.targetDefaults[taskName] = {};
123
+ const entry = { target: taskName };
98
124
  // Handle dependsOn
99
125
  if (config.dependsOn?.length > 0) {
100
- nxJson.targetDefaults[taskName].dependsOn = config.dependsOn;
126
+ entry.dependsOn = config.dependsOn;
101
127
  }
102
128
  // Handle inputs
103
129
  if (config.inputs?.length > 0) {
104
- nxJson.targetDefaults[taskName].inputs = config.inputs
130
+ entry.inputs = config.inputs
105
131
  .map((input) => {
106
132
  if (input === '$TURBO_DEFAULT$') {
107
133
  return '{projectRoot}/**/*';
@@ -124,7 +150,7 @@ function createNxJsonFromTurboJson(turboJson) {
124
150
  }
125
151
  // Handle outputs
126
152
  if (config.outputs?.length > 0) {
127
- nxJson.targetDefaults[taskName].outputs = config.outputs.map((output) => {
153
+ entry.outputs = config.outputs.map((output) => {
128
154
  // Don't add projectRoot if it's already there
129
155
  if (output.startsWith('{projectRoot}/'))
130
156
  return output;
@@ -136,7 +162,11 @@ function createNxJsonFromTurboJson(turboJson) {
136
162
  });
137
163
  }
138
164
  // Handle cache setting - true by default in Turbo
139
- nxJson.targetDefaults[taskName].cache = config.cache !== false;
165
+ entry.cache = config.cache !== false;
166
+ entries.push(entry);
167
+ }
168
+ if (entries.length > 0) {
169
+ nxJson.targetDefaults = entries;
140
170
  }
141
171
  }
142
172
  /**
@@ -187,6 +217,13 @@ function updateGitIgnore(root) {
187
217
  }
188
218
  lines.push('.nx/workspace-data');
189
219
  }
220
+ if (!contents.includes('.nx/migrate-runs')) {
221
+ if (!sepIncluded) {
222
+ lines.push('\n');
223
+ sepIncluded = true;
224
+ }
225
+ lines.push('.nx/migrate-runs');
226
+ }
190
227
  (0, fs_1.writeFileSync)(ignorePath, lines.join('\n'), 'utf-8');
191
228
  }
192
229
  catch { }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tees `console.{log,warn,error,info,debug}` into an internal buffer while
3
+ * preserving the original behavior. Does not intercept
4
+ * `process.{stdout,stderr}.write` — those bypass `console` and would also
5
+ * pick up unrelated framework output. Restoration is idempotent.
6
+ */
7
+ export interface GeneratorOutputCapture {
8
+ flush(): string;
9
+ restore(): void;
10
+ }
11
+ export declare function installGeneratorOutputCapture(): GeneratorOutputCapture;
12
+ /**
13
+ * Convenience wrapper that installs the capture, runs `fn`, restores on
14
+ * completion or throw, and returns the captured logs alongside `fn`'s value.
15
+ * Throws from `fn` propagate with the captured logs attached as
16
+ * `(err as any).capturedLogs` — the most useful diagnostic when a generator
17
+ * crashes mid-output.
18
+ */
19
+ export declare function withGeneratorOutputCapture<T>(fn: () => Promise<T> | T): Promise<{
20
+ result: T;
21
+ logs: string;
22
+ }>;