@ohos-npm-ports/nx 23.1.1-1

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 (1257) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +65 -0
  3. package/dist/bin/init-local.d.ts +8 -0
  4. package/dist/bin/init-local.js +188 -0
  5. package/dist/bin/nx-cloud.d.ts +3 -0
  6. package/dist/bin/nx-cloud.js +47 -0
  7. package/dist/bin/nx.d.ts +3 -0
  8. package/dist/bin/nx.js +340 -0
  9. package/dist/bin/post-install.d.ts +1 -0
  10. package/dist/bin/post-install.js +52 -0
  11. package/dist/bin/run-executor.d.ts +1 -0
  12. package/dist/bin/run-executor.js +66 -0
  13. package/dist/plugins/package-json.d.ts +4 -0
  14. package/dist/plugins/package-json.js +40 -0
  15. package/dist/presets/core.json +1 -0
  16. package/dist/presets/npm.json +7 -0
  17. package/dist/release/changelog-renderer/index.d.ts +110 -0
  18. package/dist/release/changelog-renderer/index.js +382 -0
  19. package/dist/release/index.d.ts +4 -0
  20. package/dist/release/index.js +13 -0
  21. package/dist/src/adapter/angular-json.d.ts +10 -0
  22. package/dist/src/adapter/angular-json.js +129 -0
  23. package/dist/src/adapter/compat.d.ts +2 -0
  24. package/dist/src/adapter/compat.js +154 -0
  25. package/dist/src/adapter/ngcli-adapter.d.ts +105 -0
  26. package/dist/src/adapter/ngcli-adapter.js +1024 -0
  27. package/dist/src/adapter/rxjs-for-await.d.ts +109 -0
  28. package/dist/src/adapter/rxjs-for-await.js +362 -0
  29. package/dist/src/ai/clone-ai-config-repo.d.ts +11 -0
  30. package/dist/src/ai/clone-ai-config-repo.js +155 -0
  31. package/dist/src/ai/configure-ai-agents-disclaimer.d.ts +5 -0
  32. package/dist/src/ai/configure-ai-agents-disclaimer.js +31 -0
  33. package/dist/src/ai/constants.d.ts +31 -0
  34. package/dist/src/ai/constants.js +76 -0
  35. package/dist/src/ai/detect-ai-agent.d.ts +2 -0
  36. package/dist/src/ai/detect-ai-agent.js +12 -0
  37. package/dist/src/ai/set-up-ai-agents/get-agent-rules.d.ts +5 -0
  38. package/dist/src/ai/set-up-ai-agents/get-agent-rules.js +26 -0
  39. package/dist/src/ai/set-up-ai-agents/schema.d.ts +11 -0
  40. package/dist/src/ai/set-up-ai-agents/schema.json +34 -0
  41. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.d.ts +10 -0
  42. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +530 -0
  43. package/dist/src/ai/utils.d.ts +20 -0
  44. package/dist/src/ai/utils.js +217 -0
  45. package/dist/src/analytics/analytics.d.ts +16 -0
  46. package/dist/src/analytics/analytics.js +248 -0
  47. package/dist/src/analytics/index.d.ts +1 -0
  48. package/dist/src/analytics/index.js +12 -0
  49. package/dist/src/command-line/add/add.d.ts +3 -0
  50. package/dist/src/command-line/add/add.js +133 -0
  51. package/dist/src/command-line/add/command-object.d.ts +8 -0
  52. package/dist/src/command-line/add/command-object.js +28 -0
  53. package/dist/src/command-line/add/completion.d.ts +1 -0
  54. package/dist/src/command-line/add/completion.js +15 -0
  55. package/dist/src/command-line/affected/affected.d.ts +10 -0
  56. package/dist/src/command-line/affected/affected.js +89 -0
  57. package/dist/src/command-line/affected/command-object.d.ts +6 -0
  58. package/dist/src/command-line/affected/command-object.js +83 -0
  59. package/dist/src/command-line/affected/completion.d.ts +1 -0
  60. package/dist/src/command-line/affected/completion.js +15 -0
  61. package/dist/src/command-line/ai/ai-output.d.ts +46 -0
  62. package/dist/src/command-line/ai/ai-output.js +86 -0
  63. package/dist/src/command-line/completion/argv-layout.d.ts +6 -0
  64. package/dist/src/command-line/completion/argv-layout.js +19 -0
  65. package/dist/src/command-line/completion/command-completions.d.ts +19 -0
  66. package/dist/src/command-line/completion/command-completions.js +120 -0
  67. package/dist/src/command-line/completion/command-handlers.d.ts +30 -0
  68. package/dist/src/command-line/completion/command-handlers.js +69 -0
  69. package/dist/src/command-line/completion/command-object.d.ts +10 -0
  70. package/dist/src/command-line/completion/command-object.js +107 -0
  71. package/dist/src/command-line/completion/completion-providers.d.ts +21 -0
  72. package/dist/src/command-line/completion/completion-providers.js +194 -0
  73. package/dist/src/command-line/completion/infix-targets.d.ts +1 -0
  74. package/dist/src/command-line/completion/infix-targets.js +48 -0
  75. package/dist/src/command-line/completion/metadata.d.ts +22 -0
  76. package/dist/src/command-line/completion/metadata.js +71 -0
  77. package/dist/src/command-line/completion/registrations.d.ts +9 -0
  78. package/dist/src/command-line/completion/registrations.js +16 -0
  79. package/dist/src/command-line/completion/scripts/bash.sh +51 -0
  80. package/dist/src/command-line/completion/scripts/fish.fish +47 -0
  81. package/dist/src/command-line/completion/scripts/powershell.ps1 +52 -0
  82. package/dist/src/command-line/completion/scripts/zsh.zsh +69 -0
  83. package/dist/src/command-line/completion/scripts.d.ts +18 -0
  84. package/dist/src/command-line/completion/scripts.js +140 -0
  85. package/dist/src/command-line/completion/trigger.d.ts +3 -0
  86. package/dist/src/command-line/completion/trigger.js +21 -0
  87. package/dist/src/command-line/completion/value-completions.d.ts +3 -0
  88. package/dist/src/command-line/completion/value-completions.js +21 -0
  89. package/dist/src/command-line/configure-ai-agents/command-object.d.ts +8 -0
  90. package/dist/src/command-line/configure-ai-agents/command-object.js +59 -0
  91. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.d.ts +3 -0
  92. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +425 -0
  93. package/dist/src/command-line/daemon/command-object.d.ts +1 -0
  94. package/dist/src/command-line/daemon/command-object.js +29 -0
  95. package/dist/src/command-line/daemon/daemon.d.ts +2 -0
  96. package/dist/src/command-line/daemon/daemon.js +31 -0
  97. package/dist/src/command-line/deprecated/command-objects.d.ts +9 -0
  98. package/dist/src/command-line/deprecated/command-objects.js +48 -0
  99. package/dist/src/command-line/examples.d.ts +12 -0
  100. package/dist/src/command-line/examples.js +403 -0
  101. package/dist/src/command-line/exec/command-object.d.ts +2 -0
  102. package/dist/src/command-line/exec/command-object.js +20 -0
  103. package/dist/src/command-line/exec/exec.d.ts +1 -0
  104. package/dist/src/command-line/exec/exec.js +143 -0
  105. package/dist/src/command-line/format/command-object.d.ts +3 -0
  106. package/dist/src/command-line/format/command-object.js +58 -0
  107. package/dist/src/command-line/format/format.d.ts +2 -0
  108. package/dist/src/command-line/format/format.js +233 -0
  109. package/dist/src/command-line/generate/command-object.d.ts +2 -0
  110. package/dist/src/command-line/generate/command-object.js +67 -0
  111. package/dist/src/command-line/generate/completion.d.ts +1 -0
  112. package/dist/src/command-line/generate/completion.js +9 -0
  113. package/dist/src/command-line/generate/generate.d.ts +21 -0
  114. package/dist/src/command-line/generate/generate.js +281 -0
  115. package/dist/src/command-line/generate/generator-utils.d.ts +18 -0
  116. package/dist/src/command-line/generate/generator-utils.js +91 -0
  117. package/dist/src/command-line/graph/command-object.d.ts +3 -0
  118. package/dist/src/command-line/graph/command-object.js +76 -0
  119. package/dist/src/command-line/graph/completion.d.ts +1 -0
  120. package/dist/src/command-line/graph/completion.js +13 -0
  121. package/dist/src/command-line/graph/graph.d.ts +70 -0
  122. package/dist/src/command-line/graph/graph.js +987 -0
  123. package/dist/src/command-line/import/command-object.d.ts +2 -0
  124. package/dist/src/command-line/import/command-object.js +63 -0
  125. package/dist/src/command-line/import/import.d.ts +26 -0
  126. package/dist/src/command-line/import/import.js +600 -0
  127. package/dist/src/command-line/import/utils/ai-output.d.ts +93 -0
  128. package/dist/src/command-line/import/utils/ai-output.js +209 -0
  129. package/dist/src/command-line/import/utils/merge-remote-source.d.ts +2 -0
  130. package/dist/src/command-line/import/utils/merge-remote-source.js +14 -0
  131. package/dist/src/command-line/import/utils/prepare-source-repo.d.ts +2 -0
  132. package/dist/src/command-line/import/utils/prepare-source-repo.js +27 -0
  133. package/dist/src/command-line/index.d.ts +22 -0
  134. package/dist/src/command-line/index.js +26 -0
  135. package/dist/src/command-line/init/ai-agent-prompts.d.ts +2 -0
  136. package/dist/src/command-line/init/ai-agent-prompts.js +36 -0
  137. package/dist/src/command-line/init/command-object.d.ts +2 -0
  138. package/dist/src/command-line/init/command-object.js +116 -0
  139. package/dist/src/command-line/init/configure-plugins.d.ts +34 -0
  140. package/dist/src/command-line/init/configure-plugins.js +211 -0
  141. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +6 -0
  142. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +142 -0
  143. package/dist/src/command-line/init/implementation/add-nx-to-nest.d.ts +5 -0
  144. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +357 -0
  145. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +6 -0
  146. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +83 -0
  147. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
  148. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +51 -0
  149. package/dist/src/command-line/init/implementation/angular/index.d.ts +2 -0
  150. package/dist/src/command-line/init/implementation/angular/index.js +135 -0
  151. package/dist/src/command-line/init/implementation/angular/integrated-workspace.d.ts +1 -0
  152. package/dist/src/command-line/init/implementation/angular/integrated-workspace.js +9 -0
  153. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.d.ts +2 -0
  154. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +153 -0
  155. package/dist/src/command-line/init/implementation/angular/standalone-workspace.d.ts +1 -0
  156. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +198 -0
  157. package/dist/src/command-line/init/implementation/angular/types.d.ts +20 -0
  158. package/dist/src/command-line/init/implementation/angular/types.js +2 -0
  159. package/dist/src/command-line/init/implementation/check-compatible-with-plugins.d.ts +15 -0
  160. package/dist/src/command-line/init/implementation/check-compatible-with-plugins.js +134 -0
  161. package/dist/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
  162. package/dist/src/command-line/init/implementation/deduce-default-base.js +53 -0
  163. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +11 -0
  164. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +146 -0
  165. package/dist/src/command-line/init/implementation/dot-nx/nxw.d.ts +1 -0
  166. package/dist/src/command-line/init/implementation/dot-nx/nxw.js +123 -0
  167. package/dist/src/command-line/init/implementation/utils.d.ts +35 -0
  168. package/dist/src/command-line/init/implementation/utils.js +422 -0
  169. package/dist/src/command-line/init/init-v1.d.ts +8 -0
  170. package/dist/src/command-line/init/init-v1.js +104 -0
  171. package/dist/src/command-line/init/init-v2.d.ts +23 -0
  172. package/dist/src/command-line/init/init-v2.js +612 -0
  173. package/dist/src/command-line/init/utils/ai-output.d.ts +72 -0
  174. package/dist/src/command-line/init/utils/ai-output.js +180 -0
  175. package/dist/src/command-line/list/command-object.d.ts +2 -0
  176. package/dist/src/command-line/list/command-object.js +21 -0
  177. package/dist/src/command-line/list/list.d.ts +15 -0
  178. package/dist/src/command-line/list/list.js +48 -0
  179. package/dist/src/command-line/mcp/command-object.d.ts +2 -0
  180. package/dist/src/command-line/mcp/command-object.js +29 -0
  181. package/dist/src/command-line/mcp/mcp.d.ts +2 -0
  182. package/dist/src/command-line/mcp/mcp.js +60 -0
  183. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +22 -0
  184. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +100 -0
  185. package/dist/src/command-line/migrate/agentic/cli-args.d.ts +12 -0
  186. package/dist/src/command-line/migrate/agentic/cli-args.js +38 -0
  187. package/dist/src/command-line/migrate/agentic/definitions.d.ts +6 -0
  188. package/dist/src/command-line/migrate/agentic/definitions.js +121 -0
  189. package/dist/src/command-line/migrate/agentic/detect-installed.d.ts +10 -0
  190. package/dist/src/command-line/migrate/agentic/detect-installed.js +68 -0
  191. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +46 -0
  192. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +87 -0
  193. package/dist/src/command-line/migrate/agentic/handoff.d.ts +69 -0
  194. package/dist/src/command-line/migrate/agentic/handoff.js +190 -0
  195. package/dist/src/command-line/migrate/agentic/inception.d.ts +9 -0
  196. package/dist/src/command-line/migrate/agentic/inception.js +15 -0
  197. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +22 -0
  198. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +50 -0
  199. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +56 -0
  200. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +66 -0
  201. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +49 -0
  202. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +53 -0
  203. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +26 -0
  204. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +27 -0
  205. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +19 -0
  206. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +145 -0
  207. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +46 -0
  208. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +90 -0
  209. package/dist/src/command-line/migrate/agentic/run-step.d.ts +58 -0
  210. package/dist/src/command-line/migrate/agentic/run-step.js +123 -0
  211. package/dist/src/command-line/migrate/agentic/runner.d.ts +33 -0
  212. package/dist/src/command-line/migrate/agentic/runner.js +444 -0
  213. package/dist/src/command-line/migrate/agentic/select.d.ts +16 -0
  214. package/dist/src/command-line/migrate/agentic/select.js +253 -0
  215. package/dist/src/command-line/migrate/agentic/types.d.ts +102 -0
  216. package/dist/src/command-line/migrate/agentic/types.js +2 -0
  217. package/dist/src/command-line/migrate/command-object.d.ts +47 -0
  218. package/dist/src/command-line/migrate/command-object.js +134 -0
  219. package/dist/src/command-line/migrate/execute-migration.d.ts +72 -0
  220. package/dist/src/command-line/migrate/execute-migration.js +389 -0
  221. package/dist/src/command-line/migrate/migrate-analytics.d.ts +71 -0
  222. package/dist/src/command-line/migrate/migrate-analytics.js +253 -0
  223. package/dist/src/command-line/migrate/migrate-commits.d.ts +50 -0
  224. package/dist/src/command-line/migrate/migrate-commits.js +102 -0
  225. package/dist/src/command-line/migrate/migrate-config.d.ts +28 -0
  226. package/dist/src/command-line/migrate/migrate-config.js +104 -0
  227. package/dist/src/command-line/migrate/migrate-output.d.ts +180 -0
  228. package/dist/src/command-line/migrate/migrate-output.js +258 -0
  229. package/dist/src/command-line/migrate/migrate-ui-api.d.ts +88 -0
  230. package/dist/src/command-line/migrate/migrate-ui-api.js +428 -0
  231. package/dist/src/command-line/migrate/migrate.d.ts +269 -0
  232. package/dist/src/command-line/migrate/migrate.js +2417 -0
  233. package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
  234. package/dist/src/command-line/migrate/migration-shape.js +13 -0
  235. package/dist/src/command-line/migrate/multi-major.d.ts +37 -0
  236. package/dist/src/command-line/migrate/multi-major.js +218 -0
  237. package/dist/src/command-line/migrate/prompt-files.d.ts +31 -0
  238. package/dist/src/command-line/migrate/prompt-files.js +141 -0
  239. package/dist/src/command-line/migrate/resolve-package-version.d.ts +24 -0
  240. package/dist/src/command-line/migrate/resolve-package-version.js +249 -0
  241. package/dist/src/command-line/migrate/run-migration-process.js +109 -0
  242. package/dist/src/command-line/migrate/safe-prompt.d.ts +33 -0
  243. package/dist/src/command-line/migrate/safe-prompt.js +58 -0
  244. package/dist/src/command-line/migrate/update-filters.d.ts +11 -0
  245. package/dist/src/command-line/migrate/update-filters.js +45 -0
  246. package/dist/src/command-line/migrate/version-utils.d.ts +5 -0
  247. package/dist/src/command-line/migrate/version-utils.js +52 -0
  248. package/dist/src/command-line/new/command-object.d.ts +2 -0
  249. package/dist/src/command-line/new/command-object.js +26 -0
  250. package/dist/src/command-line/new/new.d.ts +3 -0
  251. package/dist/src/command-line/new/new.js +30 -0
  252. package/dist/src/command-line/nx-cloud/apply-locally/apply-locally.d.ts +4 -0
  253. package/dist/src/command-line/nx-cloud/apply-locally/apply-locally.js +13 -0
  254. package/dist/src/command-line/nx-cloud/apply-locally/command-object.d.ts +2 -0
  255. package/dist/src/command-line/nx-cloud/apply-locally/command-object.js +16 -0
  256. package/dist/src/command-line/nx-cloud/complete-run/command-object.d.ts +2 -0
  257. package/dist/src/command-line/nx-cloud/complete-run/command-object.js +17 -0
  258. package/dist/src/command-line/nx-cloud/complete-run/stop-all-agents.d.ts +4 -0
  259. package/dist/src/command-line/nx-cloud/complete-run/stop-all-agents.js +13 -0
  260. package/dist/src/command-line/nx-cloud/connect/command-object.d.ts +3 -0
  261. package/dist/src/command-line/nx-cloud/connect/command-object.js +28 -0
  262. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +13 -0
  263. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +270 -0
  264. package/dist/src/command-line/nx-cloud/connect/view-logs.d.ts +1 -0
  265. package/dist/src/command-line/nx-cloud/connect/view-logs.js +55 -0
  266. package/dist/src/command-line/nx-cloud/download-cloud-client/command-object.d.ts +2 -0
  267. package/dist/src/command-line/nx-cloud/download-cloud-client/command-object.js +13 -0
  268. package/dist/src/command-line/nx-cloud/download-cloud-client/download-cloud-client.d.ts +4 -0
  269. package/dist/src/command-line/nx-cloud/download-cloud-client/download-cloud-client.js +32 -0
  270. package/dist/src/command-line/nx-cloud/fix-ci/command-object.d.ts +2 -0
  271. package/dist/src/command-line/nx-cloud/fix-ci/command-object.js +16 -0
  272. package/dist/src/command-line/nx-cloud/fix-ci/fix-ci.d.ts +4 -0
  273. package/dist/src/command-line/nx-cloud/fix-ci/fix-ci.js +13 -0
  274. package/dist/src/command-line/nx-cloud/login/command-object.d.ts +2 -0
  275. package/dist/src/command-line/nx-cloud/login/command-object.js +20 -0
  276. package/dist/src/command-line/nx-cloud/login/login.d.ts +5 -0
  277. package/dist/src/command-line/nx-cloud/login/login.js +10 -0
  278. package/dist/src/command-line/nx-cloud/logout/command-object.d.ts +2 -0
  279. package/dist/src/command-line/nx-cloud/logout/command-object.js +16 -0
  280. package/dist/src/command-line/nx-cloud/logout/logout.d.ts +4 -0
  281. package/dist/src/command-line/nx-cloud/logout/logout.js +7 -0
  282. package/dist/src/command-line/nx-cloud/record/command-object.d.ts +2 -0
  283. package/dist/src/command-line/nx-cloud/record/command-object.js +19 -0
  284. package/dist/src/command-line/nx-cloud/record/record.d.ts +5 -0
  285. package/dist/src/command-line/nx-cloud/record/record.js +33 -0
  286. package/dist/src/command-line/nx-cloud/start-agent/command-object.d.ts +2 -0
  287. package/dist/src/command-line/nx-cloud/start-agent/command-object.js +16 -0
  288. package/dist/src/command-line/nx-cloud/start-agent/start-agent.d.ts +4 -0
  289. package/dist/src/command-line/nx-cloud/start-agent/start-agent.js +13 -0
  290. package/dist/src/command-line/nx-cloud/start-ci-run/command-object.d.ts +2 -0
  291. package/dist/src/command-line/nx-cloud/start-ci-run/command-object.js +16 -0
  292. package/dist/src/command-line/nx-cloud/start-ci-run/start-ci-run.d.ts +4 -0
  293. package/dist/src/command-line/nx-cloud/start-ci-run/start-ci-run.js +13 -0
  294. package/dist/src/command-line/nx-cloud/utils.d.ts +2 -0
  295. package/dist/src/command-line/nx-cloud/utils.js +34 -0
  296. package/dist/src/command-line/nx-commands.d.ts +10 -0
  297. package/dist/src/command-line/nx-commands.js +181 -0
  298. package/dist/src/command-line/register/command-object.d.ts +6 -0
  299. package/dist/src/command-line/register/command-object.js +27 -0
  300. package/dist/src/command-line/register/register.d.ts +2 -0
  301. package/dist/src/command-line/register/register.js +9 -0
  302. package/dist/src/command-line/release/changelog/commit-utils.d.ts +13 -0
  303. package/dist/src/command-line/release/changelog/commit-utils.js +63 -0
  304. package/dist/src/command-line/release/changelog/version-plan-filtering.d.ts +43 -0
  305. package/dist/src/command-line/release/changelog/version-plan-filtering.js +156 -0
  306. package/dist/src/command-line/release/changelog/version-plan-utils.d.ts +31 -0
  307. package/dist/src/command-line/release/changelog/version-plan-utils.js +92 -0
  308. package/dist/src/command-line/release/changelog.d.ts +28 -0
  309. package/dist/src/command-line/release/changelog.js +911 -0
  310. package/dist/src/command-line/release/command-object.d.ts +96 -0
  311. package/dist/src/command-line/release/command-object.js +342 -0
  312. package/dist/src/command-line/release/config/config.d.ts +70 -0
  313. package/dist/src/command-line/release/config/config.js +1204 -0
  314. package/dist/src/command-line/release/config/conventional-commits.d.ts +2 -0
  315. package/dist/src/command-line/release/config/conventional-commits.js +106 -0
  316. package/dist/src/command-line/release/config/deep-merge-json.d.ts +1 -0
  317. package/dist/src/command-line/release/config/deep-merge-json.js +28 -0
  318. package/dist/src/command-line/release/config/filter-release-groups.d.ts +23 -0
  319. package/dist/src/command-line/release/config/filter-release-groups.js +157 -0
  320. package/dist/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  321. package/dist/src/command-line/release/config/use-legacy-versioning.js +8 -0
  322. package/dist/src/command-line/release/config/version-plans.d.ts +42 -0
  323. package/dist/src/command-line/release/config/version-plans.js +278 -0
  324. package/dist/src/command-line/release/index.d.ts +49 -0
  325. package/dist/src/command-line/release/index.js +49 -0
  326. package/dist/src/command-line/release/plan-check.d.ts +4 -0
  327. package/dist/src/command-line/release/plan-check.js +170 -0
  328. package/dist/src/command-line/release/plan.d.ts +4 -0
  329. package/dist/src/command-line/release/plan.js +261 -0
  330. package/dist/src/command-line/release/publish.d.ts +9 -0
  331. package/dist/src/command-line/release/publish.js +290 -0
  332. package/dist/src/command-line/release/release.d.ts +5 -0
  333. package/dist/src/command-line/release/release.js +310 -0
  334. package/dist/src/command-line/release/utils/diff.d.ts +21 -0
  335. package/dist/src/command-line/release/utils/diff.js +168 -0
  336. package/dist/src/command-line/release/utils/exec-command.d.ts +1 -0
  337. package/dist/src/command-line/release/utils/exec-command.js +34 -0
  338. package/dist/src/command-line/release/utils/generate-version-plan-content.d.ts +1 -0
  339. package/dist/src/command-line/release/utils/generate-version-plan-content.js +20 -0
  340. package/dist/src/command-line/release/utils/get-touched-projects-for-group.d.ts +7 -0
  341. package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +78 -0
  342. package/dist/src/command-line/release/utils/git.d.ts +126 -0
  343. package/dist/src/command-line/release/utils/git.js +597 -0
  344. package/dist/src/command-line/release/utils/launch-editor.d.ts +1 -0
  345. package/dist/src/command-line/release/utils/launch-editor.js +46 -0
  346. package/dist/src/command-line/release/utils/markdown.d.ts +6 -0
  347. package/dist/src/command-line/release/utils/markdown.js +28 -0
  348. package/dist/src/command-line/release/utils/print-changes.d.ts +6 -0
  349. package/dist/src/command-line/release/utils/print-changes.js +63 -0
  350. package/dist/src/command-line/release/utils/print-config.d.ts +7 -0
  351. package/dist/src/command-line/release/utils/print-config.js +36 -0
  352. package/dist/src/command-line/release/utils/release-graph.d.ts +230 -0
  353. package/dist/src/command-line/release/utils/release-graph.js +709 -0
  354. package/dist/src/command-line/release/utils/remote-release-clients/extract-repo-slug.d.ts +9 -0
  355. package/dist/src/command-line/release/utils/remote-release-clients/extract-repo-slug.js +61 -0
  356. package/dist/src/command-line/release/utils/remote-release-clients/github.d.ts +58 -0
  357. package/dist/src/command-line/release/utils/remote-release-clients/github.js +342 -0
  358. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.d.ts +62 -0
  359. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +268 -0
  360. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +111 -0
  361. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +138 -0
  362. package/dist/src/command-line/release/utils/repository-git-tags.d.ts +25 -0
  363. package/dist/src/command-line/release/utils/repository-git-tags.js +125 -0
  364. package/dist/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -0
  365. package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +22 -0
  366. package/dist/src/command-line/release/utils/resolve-nx-json-error-message.d.ts +1 -0
  367. package/dist/src/command-line/release/utils/resolve-nx-json-error-message.js +53 -0
  368. package/dist/src/command-line/release/utils/resolve-semver-specifier.d.ts +7 -0
  369. package/dist/src/command-line/release/utils/resolve-semver-specifier.js +63 -0
  370. package/dist/src/command-line/release/utils/semver.d.ts +26 -0
  371. package/dist/src/command-line/release/utils/semver.js +111 -0
  372. package/dist/src/command-line/release/utils/shared-legacy.d.ts +25 -0
  373. package/dist/src/command-line/release/utils/shared-legacy.js +2 -0
  374. package/dist/src/command-line/release/utils/shared.d.ts +64 -0
  375. package/dist/src/command-line/release/utils/shared.js +379 -0
  376. package/dist/src/command-line/release/utils/version-plan-utils.d.ts +40 -0
  377. package/dist/src/command-line/release/utils/version-plan-utils.js +111 -0
  378. package/dist/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +8 -0
  379. package/dist/src/command-line/release/version/derive-specifier-from-conventional-commits.js +61 -0
  380. package/dist/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
  381. package/dist/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
  382. package/dist/src/command-line/release/version/project-logger.d.ts +8 -0
  383. package/dist/src/command-line/release/version/project-logger.js +47 -0
  384. package/dist/src/command-line/release/version/release-group-processor.d.ts +115 -0
  385. package/dist/src/command-line/release/version/release-group-processor.js +632 -0
  386. package/dist/src/command-line/release/version/resolve-current-version.d.ts +32 -0
  387. package/dist/src/command-line/release/version/resolve-current-version.js +243 -0
  388. package/dist/src/command-line/release/version/topological-sort.d.ts +9 -0
  389. package/dist/src/command-line/release/version/topological-sort.js +41 -0
  390. package/dist/src/command-line/release/version/version-actions.d.ts +199 -0
  391. package/dist/src/command-line/release/version/version-actions.js +247 -0
  392. package/dist/src/command-line/release/version.d.ts +28 -0
  393. package/dist/src/command-line/release/version.js +378 -0
  394. package/dist/src/command-line/repair/command-object.d.ts +2 -0
  395. package/dist/src/command-line/repair/command-object.js +21 -0
  396. package/dist/src/command-line/repair/repair.d.ts +3 -0
  397. package/dist/src/command-line/repair/repair.js +41 -0
  398. package/dist/src/command-line/report/command-object.d.ts +2 -0
  399. package/dist/src/command-line/report/command-object.js +12 -0
  400. package/dist/src/command-line/report/report.d.ts +71 -0
  401. package/dist/src/command-line/report/report.js +405 -0
  402. package/dist/src/command-line/reset/command-object.d.ts +8 -0
  403. package/dist/src/command-line/reset/command-object.js +27 -0
  404. package/dist/src/command-line/reset/reset.d.ts +2 -0
  405. package/dist/src/command-line/reset/reset.js +178 -0
  406. package/dist/src/command-line/run/command-object.d.ts +6 -0
  407. package/dist/src/command-line/run/command-object.js +43 -0
  408. package/dist/src/command-line/run/completion.d.ts +1 -0
  409. package/dist/src/command-line/run/completion.js +7 -0
  410. package/dist/src/command-line/run/executor-utils.d.ts +12 -0
  411. package/dist/src/command-line/run/executor-utils.js +96 -0
  412. package/dist/src/command-line/run/run-one.d.ts +17 -0
  413. package/dist/src/command-line/run/run-one.js +154 -0
  414. package/dist/src/command-line/run/run.d.ts +51 -0
  415. package/dist/src/command-line/run/run.js +179 -0
  416. package/dist/src/command-line/run-many/command-object.d.ts +2 -0
  417. package/dist/src/command-line/run-many/command-object.js +18 -0
  418. package/dist/src/command-line/run-many/completion.d.ts +1 -0
  419. package/dist/src/command-line/run-many/completion.js +13 -0
  420. package/dist/src/command-line/run-many/run-many.d.ts +10 -0
  421. package/dist/src/command-line/run-many/run-many.js +89 -0
  422. package/dist/src/command-line/show/command-object.d.ts +40 -0
  423. package/dist/src/command-line/show/command-object.js +237 -0
  424. package/dist/src/command-line/show/completion.d.ts +1 -0
  425. package/dist/src/command-line/show/completion.js +27 -0
  426. package/dist/src/command-line/show/project.d.ts +2 -0
  427. package/dist/src/command-line/show/project.js +103 -0
  428. package/dist/src/command-line/show/projects.d.ts +2 -0
  429. package/dist/src/command-line/show/projects.js +80 -0
  430. package/dist/src/command-line/show/show-target/index.d.ts +3 -0
  431. package/dist/src/command-line/show/show-target/index.js +9 -0
  432. package/dist/src/command-line/show/show-target/info.d.ts +28 -0
  433. package/dist/src/command-line/show/show-target/info.js +389 -0
  434. package/dist/src/command-line/show/show-target/inputs.d.ts +2 -0
  435. package/dist/src/command-line/show/show-target/inputs.js +83 -0
  436. package/dist/src/command-line/show/show-target/outputs.d.ts +2 -0
  437. package/dist/src/command-line/show/show-target/outputs.js +70 -0
  438. package/dist/src/command-line/show/show-target/utils.d.ts +54 -0
  439. package/dist/src/command-line/show/show-target/utils.js +265 -0
  440. package/dist/src/command-line/sync/command-object.d.ts +6 -0
  441. package/dist/src/command-line/sync/command-object.js +21 -0
  442. package/dist/src/command-line/sync/sync.d.ts +6 -0
  443. package/dist/src/command-line/sync/sync.js +120 -0
  444. package/dist/src/command-line/watch/command-object.d.ts +2 -0
  445. package/dist/src/command-line/watch/command-object.js +91 -0
  446. package/dist/src/command-line/watch/completion.d.ts +1 -0
  447. package/dist/src/command-line/watch/completion.js +10 -0
  448. package/dist/src/command-line/watch/watch.d.ts +31 -0
  449. package/dist/src/command-line/watch/watch.js +198 -0
  450. package/dist/src/command-line/yargs-utils/arguments-of.d.ts +11 -0
  451. package/dist/src/command-line/yargs-utils/arguments-of.js +9 -0
  452. package/dist/src/command-line/yargs-utils/documentation.d.ts +2 -0
  453. package/dist/src/command-line/yargs-utils/documentation.js +12 -0
  454. package/dist/src/command-line/yargs-utils/shared-options.d.ts +61 -0
  455. package/dist/src/command-line/yargs-utils/shared-options.js +395 -0
  456. package/dist/src/commands-runner/command-graph.d.ts +13 -0
  457. package/dist/src/commands-runner/command-graph.js +2 -0
  458. package/dist/src/commands-runner/create-command-graph.d.ts +4 -0
  459. package/dist/src/commands-runner/create-command-graph.js +72 -0
  460. package/dist/src/commands-runner/get-command-projects.d.ts +3 -0
  461. package/dist/src/commands-runner/get-command-projects.js +33 -0
  462. package/dist/src/config/calculate-default-project-name.d.ts +4 -0
  463. package/dist/src/config/calculate-default-project-name.js +41 -0
  464. package/dist/src/config/configuration.d.ts +8 -0
  465. package/dist/src/config/configuration.js +17 -0
  466. package/dist/src/config/misc-interfaces.d.ts +254 -0
  467. package/dist/src/config/misc-interfaces.js +2 -0
  468. package/dist/src/config/nx-json.d.ts +963 -0
  469. package/dist/src/config/nx-json.js +40 -0
  470. package/dist/src/config/project-graph.d.ts +137 -0
  471. package/dist/src/config/project-graph.js +45 -0
  472. package/dist/src/config/schema-utils.d.ts +37 -0
  473. package/dist/src/config/schema-utils.js +199 -0
  474. package/dist/src/config/task-graph.d.ts +6 -0
  475. package/dist/src/config/task-graph.js +2 -0
  476. package/dist/src/config/to-project-name.d.ts +5 -0
  477. package/dist/src/config/to-project-name.js +12 -0
  478. package/dist/src/config/workspace-json-project-json.d.ts +273 -0
  479. package/dist/src/config/workspace-json-project-json.js +2 -0
  480. package/dist/src/core/graph/environment.js +1 -0
  481. package/dist/src/core/graph/favicon.ico +0 -0
  482. package/dist/src/core/graph/index.html +32 -0
  483. package/dist/src/core/graph/main.js +1 -0
  484. package/dist/src/core/graph/runtime.js +1 -0
  485. package/dist/src/core/graph/styles.css +2 -0
  486. package/dist/src/core/graph/styles.js +1 -0
  487. package/dist/src/daemon/cache.d.ts +10 -0
  488. package/dist/src/daemon/cache.js +58 -0
  489. package/dist/src/daemon/client/client.d.ts +115 -0
  490. package/dist/src/daemon/client/client.js +1046 -0
  491. package/dist/src/daemon/client/daemon-environment.d.ts +12 -0
  492. package/dist/src/daemon/client/daemon-environment.js +170 -0
  493. package/dist/src/daemon/client/daemon-socket-messenger.d.ts +12 -0
  494. package/dist/src/daemon/client/daemon-socket-messenger.js +54 -0
  495. package/dist/src/daemon/is-nx-version-mismatch.d.ts +1 -0
  496. package/dist/src/daemon/is-nx-version-mismatch.js +8 -0
  497. package/dist/src/daemon/is-on-daemon.d.ts +1 -0
  498. package/dist/src/daemon/is-on-daemon.js +6 -0
  499. package/dist/src/daemon/is-v8-serializer-enabled.d.ts +5 -0
  500. package/dist/src/daemon/is-v8-serializer-enabled.js +10 -0
  501. package/dist/src/daemon/logger.d.ts +39 -0
  502. package/dist/src/daemon/logger.js +80 -0
  503. package/dist/src/daemon/message-types/configure-ai-agents.d.ts +20 -0
  504. package/dist/src/daemon/message-types/configure-ai-agents.js +19 -0
  505. package/dist/src/daemon/message-types/daemon-message.d.ts +6 -0
  506. package/dist/src/daemon/message-types/daemon-message.js +6 -0
  507. package/dist/src/daemon/message-types/flush-sync-generator-changes-to-disk.d.ts +6 -0
  508. package/dist/src/daemon/message-types/flush-sync-generator-changes-to-disk.js +11 -0
  509. package/dist/src/daemon/message-types/force-shutdown.d.ts +5 -0
  510. package/dist/src/daemon/message-types/force-shutdown.js +11 -0
  511. package/dist/src/daemon/message-types/get-context-file-data.d.ts +5 -0
  512. package/dist/src/daemon/message-types/get-context-file-data.js +11 -0
  513. package/dist/src/daemon/message-types/get-files-in-directory.d.ts +6 -0
  514. package/dist/src/daemon/message-types/get-files-in-directory.js +11 -0
  515. package/dist/src/daemon/message-types/get-nx-workspace-files.d.ts +6 -0
  516. package/dist/src/daemon/message-types/get-nx-workspace-files.js +11 -0
  517. package/dist/src/daemon/message-types/get-registered-sync-generators.d.ts +5 -0
  518. package/dist/src/daemon/message-types/get-registered-sync-generators.js +11 -0
  519. package/dist/src/daemon/message-types/get-sync-generator-changes.d.ts +6 -0
  520. package/dist/src/daemon/message-types/get-sync-generator-changes.js +11 -0
  521. package/dist/src/daemon/message-types/glob.d.ts +14 -0
  522. package/dist/src/daemon/message-types/glob.js +19 -0
  523. package/dist/src/daemon/message-types/hash-glob.d.ts +13 -0
  524. package/dist/src/daemon/message-types/hash-glob.js +19 -0
  525. package/dist/src/daemon/message-types/nx-console.d.ts +17 -0
  526. package/dist/src/daemon/message-types/nx-console.js +19 -0
  527. package/dist/src/daemon/message-types/register-project-graph-listener.d.ts +5 -0
  528. package/dist/src/daemon/message-types/register-project-graph-listener.js +11 -0
  529. package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +13 -0
  530. package/dist/src/daemon/message-types/run-tasks-execution-hooks.js +19 -0
  531. package/dist/src/daemon/message-types/streaming-messages.d.ts +14 -0
  532. package/dist/src/daemon/message-types/streaming-messages.js +19 -0
  533. package/dist/src/daemon/message-types/task-history.d.ts +19 -0
  534. package/dist/src/daemon/message-types/task-history.js +27 -0
  535. package/dist/src/daemon/message-types/update-workspace-context.d.ts +8 -0
  536. package/dist/src/daemon/message-types/update-workspace-context.js +11 -0
  537. package/dist/src/daemon/server/client-socket-context.d.ts +23 -0
  538. package/dist/src/daemon/server/client-socket-context.js +89 -0
  539. package/dist/src/daemon/server/file-watching/changed-projects.d.ts +10 -0
  540. package/dist/src/daemon/server/file-watching/changed-projects.js +53 -0
  541. package/dist/src/daemon/server/file-watching/file-change-events.d.ts +7 -0
  542. package/dist/src/daemon/server/file-watching/file-change-events.js +19 -0
  543. package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +12 -0
  544. package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +66 -0
  545. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +9 -0
  546. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +76 -0
  547. package/dist/src/daemon/server/handle-configure-ai-agents.d.ts +3 -0
  548. package/dist/src/daemon/server/handle-configure-ai-agents.js +101 -0
  549. package/dist/src/daemon/server/handle-context-file-data.d.ts +2 -0
  550. package/dist/src/daemon/server/handle-context-file-data.js +12 -0
  551. package/dist/src/daemon/server/handle-flush-sync-generator-changes-to-disk.d.ts +2 -0
  552. package/dist/src/daemon/server/handle-flush-sync-generator-changes-to-disk.js +11 -0
  553. package/dist/src/daemon/server/handle-force-shutdown.d.ts +5 -0
  554. package/dist/src/daemon/server/handle-force-shutdown.js +18 -0
  555. package/dist/src/daemon/server/handle-get-files-in-directory.d.ts +2 -0
  556. package/dist/src/daemon/server/handle-get-files-in-directory.js +12 -0
  557. package/dist/src/daemon/server/handle-get-registered-sync-generators.d.ts +2 -0
  558. package/dist/src/daemon/server/handle-get-registered-sync-generators.js +11 -0
  559. package/dist/src/daemon/server/handle-get-sync-generator-changes.d.ts +2 -0
  560. package/dist/src/daemon/server/handle-get-sync-generator-changes.js +20 -0
  561. package/dist/src/daemon/server/handle-glob.d.ts +3 -0
  562. package/dist/src/daemon/server/handle-glob.js +20 -0
  563. package/dist/src/daemon/server/handle-hash-glob.d.ts +3 -0
  564. package/dist/src/daemon/server/handle-hash-glob.js +20 -0
  565. package/dist/src/daemon/server/handle-hash-tasks.d.ts +12 -0
  566. package/dist/src/daemon/server/handle-hash-tasks.js +28 -0
  567. package/dist/src/daemon/server/handle-nx-console.d.ts +3 -0
  568. package/dist/src/daemon/server/handle-nx-console.js +54 -0
  569. package/dist/src/daemon/server/handle-nx-workspace-files.d.ts +2 -0
  570. package/dist/src/daemon/server/handle-nx-workspace-files.js +12 -0
  571. package/dist/src/daemon/server/handle-outputs-tracking.d.ts +15 -0
  572. package/dist/src/daemon/server/handle-outputs-tracking.js +35 -0
  573. package/dist/src/daemon/server/handle-process-in-background.d.ts +6 -0
  574. package/dist/src/daemon/server/handle-process-in-background.js +32 -0
  575. package/dist/src/daemon/server/handle-request-project-graph.d.ts +3 -0
  576. package/dist/src/daemon/server/handle-request-project-graph.js +36 -0
  577. package/dist/src/daemon/server/handle-request-shutdown.d.ts +5 -0
  578. package/dist/src/daemon/server/handle-request-shutdown.js +27 -0
  579. package/dist/src/daemon/server/handle-task-history.d.ts +13 -0
  580. package/dist/src/daemon/server/handle-task-history.js +30 -0
  581. package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +19 -0
  582. package/dist/src/daemon/server/handle-tasks-execution-hooks.js +35 -0
  583. package/dist/src/daemon/server/handle-update-workspace-context.d.ts +2 -0
  584. package/dist/src/daemon/server/handle-update-workspace-context.js +11 -0
  585. package/dist/src/daemon/server/latest-nx.d.ts +10 -0
  586. package/dist/src/daemon/server/latest-nx.js +53 -0
  587. package/dist/src/daemon/server/nx-console-operations.d.ts +26 -0
  588. package/dist/src/daemon/server/nx-console-operations.js +97 -0
  589. package/dist/src/daemon/server/outputs-tracking.d.ts +23 -0
  590. package/dist/src/daemon/server/outputs-tracking.js +120 -0
  591. package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +26 -0
  592. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +507 -0
  593. package/dist/src/daemon/server/project-graph-listener-sockets.d.ts +7 -0
  594. package/dist/src/daemon/server/project-graph-listener-sockets.js +25 -0
  595. package/dist/src/daemon/server/server.d.ts +10 -0
  596. package/dist/src/daemon/server/server.js +477 -0
  597. package/dist/src/daemon/server/shutdown-utils.d.ts +18 -0
  598. package/dist/src/daemon/server/shutdown-utils.js +152 -0
  599. package/dist/src/daemon/server/start.d.ts +1 -0
  600. package/dist/src/daemon/server/start.js +20 -0
  601. package/dist/src/daemon/server/sync-generators.d.ts +14 -0
  602. package/dist/src/daemon/server/sync-generators.js +368 -0
  603. package/dist/src/daemon/server/watcher.d.ts +18 -0
  604. package/dist/src/daemon/server/watcher.js +126 -0
  605. package/dist/src/daemon/socket-utils.d.ts +23 -0
  606. package/dist/src/daemon/socket-utils.js +96 -0
  607. package/dist/src/daemon/tmp-dir.d.ts +12 -0
  608. package/dist/src/daemon/tmp-dir.js +71 -0
  609. package/dist/src/devkit-exports.d.ts +139 -0
  610. package/dist/src/devkit-exports.js +143 -0
  611. package/dist/src/devkit-internals.d.ts +43 -0
  612. package/dist/src/devkit-internals.js +101 -0
  613. package/dist/src/devkit-testing-exports.d.ts +2 -0
  614. package/dist/src/devkit-testing-exports.js +8 -0
  615. package/dist/src/executors/noop/noop.impl.d.ts +3 -0
  616. package/dist/src/executors/noop/noop.impl.js +6 -0
  617. package/dist/src/executors/noop/schema.json +10 -0
  618. package/dist/src/executors/run-commands/run-commands.impl.d.ts +59 -0
  619. package/dist/src/executors/run-commands/run-commands.impl.js +301 -0
  620. package/dist/src/executors/run-commands/running-tasks.d.ts +52 -0
  621. package/dist/src/executors/run-commands/running-tasks.js +586 -0
  622. package/dist/src/executors/run-commands/schema.json +198 -0
  623. package/dist/src/executors/run-script/run-script.impl.d.ts +8 -0
  624. package/dist/src/executors/run-script/run-script.impl.js +86 -0
  625. package/dist/src/executors/run-script/schema.json +28 -0
  626. package/dist/src/executors/utils/convert-nx-executor.d.ts +10 -0
  627. package/dist/src/executors/utils/convert-nx-executor.js +83 -0
  628. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +19 -0
  629. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +81 -0
  630. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +11 -0
  631. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.js +52 -0
  632. package/dist/src/generators/testing-utils/create-tree.d.ts +5 -0
  633. package/dist/src/generators/testing-utils/create-tree.js +14 -0
  634. package/dist/src/generators/tree.d.ts +125 -0
  635. package/dist/src/generators/tree.js +310 -0
  636. package/dist/src/generators/utils/generate-files.d.ts +44 -0
  637. package/dist/src/generators/utils/generate-files.js +114 -0
  638. package/dist/src/generators/utils/glob.d.ts +22 -0
  639. package/dist/src/generators/utils/glob.js +51 -0
  640. package/dist/src/generators/utils/json.d.ts +28 -0
  641. package/dist/src/generators/utils/json.js +48 -0
  642. package/dist/src/generators/utils/nx-json.d.ts +10 -0
  643. package/dist/src/generators/utils/nx-json.js +62 -0
  644. package/dist/src/generators/utils/project-configuration.d.ts +51 -0
  645. package/dist/src/generators/utils/project-configuration.js +299 -0
  646. package/dist/src/hasher/check-task-files.d.ts +86 -0
  647. package/dist/src/hasher/check-task-files.js +378 -0
  648. package/dist/src/hasher/create-task-hasher.d.ts +4 -0
  649. package/dist/src/hasher/create-task-hasher.js +15 -0
  650. package/dist/src/hasher/file-hasher.d.ts +3 -0
  651. package/dist/src/hasher/file-hasher.js +23 -0
  652. package/dist/src/hasher/hash-plan-inspector.d.ts +33 -0
  653. package/dist/src/hasher/hash-plan-inspector.js +70 -0
  654. package/dist/src/hasher/hash-task.d.ts +17 -0
  655. package/dist/src/hasher/hash-task.js +191 -0
  656. package/dist/src/hasher/native-task-hasher-impl.d.ts +18 -0
  657. package/dist/src/hasher/native-task-hasher-impl.js +38 -0
  658. package/dist/src/hasher/task-hasher.d.ts +160 -0
  659. package/dist/src/hasher/task-hasher.js +301 -0
  660. package/dist/src/index.d.ts +1 -0
  661. package/dist/src/index.js +2 -0
  662. package/dist/src/migrations/update-15-0-0/prefix-outputs.d.ts +2 -0
  663. package/dist/src/migrations/update-15-0-0/prefix-outputs.js +54 -0
  664. package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +2 -0
  665. package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.js +16 -0
  666. package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +2 -0
  667. package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +82 -0
  668. package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +2 -0
  669. package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.js +29 -0
  670. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +2 -0
  671. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +50 -0
  672. package/dist/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +12 -0
  673. package/dist/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +67 -0
  674. package/dist/src/migrations/update-17-0-0/move-cache-directory.d.ts +2 -0
  675. package/dist/src/migrations/update-17-0-0/move-cache-directory.js +35 -0
  676. package/dist/src/migrations/update-17-0-0/move-cache-directory.md +31 -0
  677. package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.d.ts +2 -0
  678. package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +72 -0
  679. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.d.ts +2 -0
  680. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +126 -0
  681. package/dist/src/migrations/update-17-2-0/move-default-base.d.ts +5 -0
  682. package/dist/src/migrations/update-17-2-0/move-default-base.js +20 -0
  683. package/dist/src/migrations/update-17-3-0/update-nxw.d.ts +2 -0
  684. package/dist/src/migrations/update-17-3-0/update-nxw.js +7 -0
  685. package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +2 -0
  686. package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +11 -0
  687. package/dist/src/migrations/update-19-2-0/move-workspace-data-directory.d.ts +4 -0
  688. package/dist/src/migrations/update-19-2-0/move-workspace-data-directory.js +33 -0
  689. package/dist/src/migrations/update-19-2-4/set-project-name.d.ts +2 -0
  690. package/dist/src/migrations/update-19-2-4/set-project-name.js +34 -0
  691. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.d.ts +2 -0
  692. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.js +25 -0
  693. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.md +27 -0
  694. package/dist/src/migrations/update-20-0-1/use-legacy-cache.d.ts +2 -0
  695. package/dist/src/migrations/update-20-0-1/use-legacy-cache.js +20 -0
  696. package/dist/src/migrations/update-20-0-1/use-legacy-cache.md +24 -0
  697. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.d.ts +2 -0
  698. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.js +38 -0
  699. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.md +49 -0
  700. package/dist/src/migrations/update-21-0-0/release-version-config-changes.d.ts +2 -0
  701. package/dist/src/migrations/update-21-0-0/release-version-config-changes.js +101 -0
  702. package/dist/src/migrations/update-21-0-0/release-version-config-changes.md +54 -0
  703. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.d.ts +2 -0
  704. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +38 -0
  705. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.md +28 -0
  706. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.d.ts +2 -0
  707. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.js +17 -0
  708. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.md +22 -0
  709. package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.d.ts +2 -0
  710. package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.js +100 -0
  711. package/dist/src/migrations/update-22-0-0/release-version-config-changes.d.ts +2 -0
  712. package/dist/src/migrations/update-22-0-0/release-version-config-changes.js +101 -0
  713. package/dist/src/migrations/update-22-1-0/update-nx-wrapper.d.ts +2 -0
  714. package/dist/src/migrations/update-22-1-0/update-nx-wrapper.js +7 -0
  715. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.d.ts +2 -0
  716. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +19 -0
  717. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.md +11 -0
  718. package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.d.ts +2 -0
  719. package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.js +16 -0
  720. package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.d.ts +2 -0
  721. package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.js +16 -0
  722. package/dist/src/migrations/update-22-6-0/enable-analytics-prompt.d.ts +2 -0
  723. package/dist/src/migrations/update-22-6-0/enable-analytics-prompt.js +23 -0
  724. package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.d.ts +2 -0
  725. package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.js +16 -0
  726. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.d.ts +2 -0
  727. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +16 -0
  728. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +9 -0
  729. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +18 -0
  730. package/dist/src/migrations/utils/target-defaults.d.ts +28 -0
  731. package/dist/src/migrations/utils/target-defaults.js +46 -0
  732. package/dist/src/native/assert-supported-platform.d.ts +1 -0
  733. package/dist/src/native/assert-supported-platform.js +39 -0
  734. package/dist/src/native/browser.js +1 -0
  735. package/dist/src/native/index.d.ts +844 -0
  736. package/dist/src/native/index.js +173 -0
  737. package/dist/src/native/native-bindings.js +641 -0
  738. package/dist/src/native/native-file-cache-location.d.ts +1 -0
  739. package/dist/src/native/native-file-cache-location.js +23 -0
  740. package/dist/src/native/nx.openharmony-arm64.node +0 -0
  741. package/dist/src/native/nx.wasi-browser.js +131 -0
  742. package/dist/src/native/nx.wasi.cjs +161 -0
  743. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  744. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  745. package/dist/src/native/transform-objects.d.ts +3 -0
  746. package/dist/src/native/transform-objects.js +51 -0
  747. package/dist/src/native/wasi-worker-browser.mjs +30 -0
  748. package/dist/src/native/wasi-worker.mjs +63 -0
  749. package/dist/src/nx-cloud/debug-logger.d.ts +1 -0
  750. package/dist/src/nx-cloud/debug-logger.js +8 -0
  751. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +14 -0
  752. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +159 -0
  753. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +41 -0
  754. package/dist/src/nx-cloud/models/onboarding-status.d.ts +1 -0
  755. package/dist/src/nx-cloud/models/onboarding-status.js +2 -0
  756. package/dist/src/nx-cloud/nx-cloud-tasks-runner-shell.d.ts +16 -0
  757. package/dist/src/nx-cloud/nx-cloud-tasks-runner-shell.js +41 -0
  758. package/dist/src/nx-cloud/resolution-helpers.d.ts +1 -0
  759. package/dist/src/nx-cloud/resolution-helpers.js +19 -0
  760. package/dist/src/nx-cloud/update-manager.d.ts +23 -0
  761. package/dist/src/nx-cloud/update-manager.js +267 -0
  762. package/dist/src/nx-cloud/utilities/axios.d.ts +4 -0
  763. package/dist/src/nx-cloud/utilities/axios.js +17 -0
  764. package/dist/src/nx-cloud/utilities/client.d.ts +10 -0
  765. package/dist/src/nx-cloud/utilities/client.js +42 -0
  766. package/dist/src/nx-cloud/utilities/environment.d.ts +3 -0
  767. package/dist/src/nx-cloud/utilities/environment.js +48 -0
  768. package/dist/src/nx-cloud/utilities/get-cloud-options.d.ts +5 -0
  769. package/dist/src/nx-cloud/utilities/get-cloud-options.js +23 -0
  770. package/dist/src/nx-cloud/utilities/is-workspace-claimed.d.ts +1 -0
  771. package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +25 -0
  772. package/dist/src/nx-cloud/utilities/onboarding.d.ts +5 -0
  773. package/dist/src/nx-cloud/utilities/onboarding.js +28 -0
  774. package/dist/src/nx-cloud/utilities/url-shorten.d.ts +5 -0
  775. package/dist/src/nx-cloud/utilities/url-shorten.js +84 -0
  776. package/dist/src/plugins/js/hasher/hasher.d.ts +5 -0
  777. package/dist/src/plugins/js/hasher/hasher.js +51 -0
  778. package/dist/src/plugins/js/index.d.ts +4 -0
  779. package/dist/src/plugins/js/index.js +201 -0
  780. package/dist/src/plugins/js/lock-file/bun-parser.d.ts +14 -0
  781. package/dist/src/plugins/js/lock-file/bun-parser.js +959 -0
  782. package/dist/src/plugins/js/lock-file/lock-file.d.ts +43 -0
  783. package/dist/src/plugins/js/lock-file/lock-file.js +265 -0
  784. package/dist/src/plugins/js/lock-file/npm-parser.d.ts +10 -0
  785. package/dist/src/plugins/js/lock-file/npm-parser.js +588 -0
  786. package/dist/src/plugins/js/lock-file/pnpm-parser.d.ts +10 -0
  787. package/dist/src/plugins/js/lock-file/pnpm-parser.js +693 -0
  788. package/dist/src/plugins/js/lock-file/project-graph-pruning.d.ts +11 -0
  789. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +210 -0
  790. package/dist/src/plugins/js/lock-file/utils/package-json.d.ts +10 -0
  791. package/dist/src/plugins/js/lock-file/utils/package-json.js +38 -0
  792. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +20 -0
  793. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +874 -0
  794. package/dist/src/plugins/js/lock-file/yarn-parser.d.ts +10 -0
  795. package/dist/src/plugins/js/lock-file/yarn-parser.js +536 -0
  796. package/dist/src/plugins/js/package-json/create-package-json.d.ts +29 -0
  797. package/dist/src/plugins/js/package-json/create-package-json.js +312 -0
  798. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +3 -0
  799. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +150 -0
  800. package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +4 -0
  801. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +93 -0
  802. package/dist/src/plugins/js/project-graph/affected/touched-projects.d.ts +2 -0
  803. package/dist/src/plugins/js/project-graph/affected/touched-projects.js +18 -0
  804. package/dist/src/plugins/js/project-graph/affected/tsconfig-json-changes.d.ts +4 -0
  805. package/dist/src/plugins/js/project-graph/affected/tsconfig-json-changes.js +63 -0
  806. package/dist/src/plugins/js/project-graph/build-dependencies/build-dependencies.d.ts +6 -0
  807. package/dist/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +45 -0
  808. package/dist/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +4 -0
  809. package/dist/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +88 -0
  810. package/dist/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.d.ts +4 -0
  811. package/dist/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +75 -0
  812. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +81 -0
  813. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +462 -0
  814. package/dist/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.d.ts +2 -0
  815. package/dist/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +31 -0
  816. package/dist/src/plugins/js/utils/config.d.ts +2 -0
  817. package/dist/src/plugins/js/utils/config.js +61 -0
  818. package/dist/src/plugins/js/utils/get-workspace-packages-from-graph.d.ts +2 -0
  819. package/dist/src/plugins/js/utils/get-workspace-packages-from-graph.js +13 -0
  820. package/dist/src/plugins/js/utils/packages.d.ts +8 -0
  821. package/dist/src/plugins/js/utils/packages.js +91 -0
  822. package/dist/src/plugins/js/utils/register.d.ts +339 -0
  823. package/dist/src/plugins/js/utils/register.js +1236 -0
  824. package/dist/src/plugins/js/utils/resolve-relative-to-dir.d.ts +5 -0
  825. package/dist/src/plugins/js/utils/resolve-relative-to-dir.js +17 -0
  826. package/dist/src/plugins/js/utils/typescript.d.ts +32 -0
  827. package/dist/src/plugins/js/utils/typescript.js +157 -0
  828. package/dist/src/plugins/js/versions.d.ts +1 -0
  829. package/dist/src/plugins/js/versions.js +4 -0
  830. package/dist/src/plugins/package-json/create-nodes.d.ts +28 -0
  831. package/dist/src/plugins/package-json/create-nodes.js +243 -0
  832. package/dist/src/plugins/package-json/index.d.ts +2 -0
  833. package/dist/src/plugins/package-json/index.js +6 -0
  834. package/dist/src/plugins/project-json/build-nodes/project-json.d.ts +5 -0
  835. package/dist/src/plugins/project-json/build-nodes/project-json.js +33 -0
  836. package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +11 -0
  837. package/dist/src/project-graph/affected/affected-project-graph-models.js +2 -0
  838. package/dist/src/project-graph/affected/affected-project-graph.d.ts +4 -0
  839. package/dist/src/project-graph/affected/affected-project-graph.js +90 -0
  840. package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +2 -0
  841. package/dist/src/project-graph/affected/locators/project-glob-changes.js +44 -0
  842. package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +4 -0
  843. package/dist/src/project-graph/affected/locators/workspace-json-changes.js +47 -0
  844. package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +3 -0
  845. package/dist/src/project-graph/affected/locators/workspace-projects.js +74 -0
  846. package/dist/src/project-graph/build-project-graph.d.ts +26 -0
  847. package/dist/src/project-graph/build-project-graph.js +309 -0
  848. package/dist/src/project-graph/error-types.d.ts +140 -0
  849. package/dist/src/project-graph/error-types.js +459 -0
  850. package/dist/src/project-graph/file-map-utils.d.ts +18 -0
  851. package/dist/src/project-graph/file-map-utils.js +61 -0
  852. package/dist/src/project-graph/file-utils.d.ts +31 -0
  853. package/dist/src/project-graph/file-utils.js +187 -0
  854. package/dist/src/project-graph/nx-deps-cache.d.ts +62 -0
  855. package/dist/src/project-graph/nx-deps-cache.js +345 -0
  856. package/dist/src/project-graph/operators.d.ts +11 -0
  857. package/dist/src/project-graph/operators.js +70 -0
  858. package/dist/src/project-graph/plugins/get-plugins.d.ts +25 -0
  859. package/dist/src/project-graph/plugins/get-plugins.js +296 -0
  860. package/dist/src/project-graph/plugins/in-process-loader.d.ts +10 -0
  861. package/dist/src/project-graph/plugins/in-process-loader.js +61 -0
  862. package/dist/src/project-graph/plugins/index.d.ts +4 -0
  863. package/dist/src/project-graph/plugins/index.js +12 -0
  864. package/dist/src/project-graph/plugins/isolation/enabled.d.ts +1 -0
  865. package/dist/src/project-graph/plugins/isolation/enabled.js +22 -0
  866. package/dist/src/project-graph/plugins/isolation/index.d.ts +1 -0
  867. package/dist/src/project-graph/plugins/isolation/index.js +5 -0
  868. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +62 -0
  869. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +478 -0
  870. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.d.ts +3 -0
  871. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.js +24 -0
  872. package/dist/src/project-graph/plugins/isolation/message-types.d.ts +59 -0
  873. package/dist/src/project-graph/plugins/isolation/message-types.js +9 -0
  874. package/dist/src/project-graph/plugins/isolation/messaging.d.ts +142 -0
  875. package/dist/src/project-graph/plugins/isolation/messaging.js +86 -0
  876. package/dist/src/project-graph/plugins/isolation/plugin-lifecycle-manager.d.ts +82 -0
  877. package/dist/src/project-graph/plugins/isolation/plugin-lifecycle-manager.js +188 -0
  878. package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +2 -0
  879. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +150 -0
  880. package/dist/src/project-graph/plugins/isolation/worker-streaming.d.ts +14 -0
  881. package/dist/src/project-graph/plugins/isolation/worker-streaming.js +39 -0
  882. package/dist/src/project-graph/plugins/load-resolved-plugin.d.ts +3 -0
  883. package/dist/src/project-graph/plugins/load-resolved-plugin.js +24 -0
  884. package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +41 -0
  885. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +104 -0
  886. package/dist/src/project-graph/plugins/public-api.d.ts +139 -0
  887. package/dist/src/project-graph/plugins/public-api.js +4 -0
  888. package/dist/src/project-graph/plugins/resolve-plugin.d.ts +25 -0
  889. package/dist/src/project-graph/plugins/resolve-plugin.js +277 -0
  890. package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -0
  891. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +67 -0
  892. package/dist/src/project-graph/plugins/transpiler.d.ts +20 -0
  893. package/dist/src/project-graph/plugins/transpiler.js +99 -0
  894. package/dist/src/project-graph/plugins/utils.d.ts +4 -0
  895. package/dist/src/project-graph/plugins/utils.js +32 -0
  896. package/dist/src/project-graph/project-graph-builder.d.ts +133 -0
  897. package/dist/src/project-graph/project-graph-builder.js +395 -0
  898. package/dist/src/project-graph/project-graph.d.ts +54 -0
  899. package/dist/src/project-graph/project-graph.js +415 -0
  900. package/dist/src/project-graph/utils/build-all-workspace-files.d.ts +2 -0
  901. package/dist/src/project-graph/utils/build-all-workspace-files.js +14 -0
  902. package/dist/src/project-graph/utils/find-project-for-path.d.ts +20 -0
  903. package/dist/src/project-graph/utils/find-project-for-path.js +55 -0
  904. package/dist/src/project-graph/utils/implicit-project-dependencies.d.ts +3 -0
  905. package/dist/src/project-graph/utils/implicit-project-dependencies.js +18 -0
  906. package/dist/src/project-graph/utils/normalize-project-nodes.d.ts +6 -0
  907. package/dist/src/project-graph/utils/normalize-project-nodes.js +117 -0
  908. package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts +48 -0
  909. package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.js +270 -0
  910. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +42 -0
  911. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +284 -0
  912. package/dist/src/project-graph/utils/project-configuration/source-maps.d.ts +34 -0
  913. package/dist/src/project-graph/utils/project-configuration/source-maps.js +85 -0
  914. package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +50 -0
  915. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +440 -0
  916. package/dist/src/project-graph/utils/project-configuration/target-merging.d.ts +32 -0
  917. package/dist/src/project-graph/utils/project-configuration/target-merging.js +507 -0
  918. package/dist/src/project-graph/utils/project-configuration/target-normalization.d.ts +12 -0
  919. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +183 -0
  920. package/dist/src/project-graph/utils/project-configuration/utils.d.ts +38 -0
  921. package/dist/src/project-graph/utils/project-configuration/utils.js +215 -0
  922. package/dist/src/project-graph/utils/project-configuration-utils.d.ts +86 -0
  923. package/dist/src/project-graph/utils/project-configuration-utils.js +325 -0
  924. package/dist/src/project-graph/utils/retrieve-workspace-files.d.ts +35 -0
  925. package/dist/src/project-graph/utils/retrieve-workspace-files.js +110 -0
  926. package/dist/src/tasks-runner/batch/batch-messages.d.ts +35 -0
  927. package/dist/src/tasks-runner/batch/batch-messages.js +9 -0
  928. package/dist/src/tasks-runner/batch/run-batch.d.ts +1 -0
  929. package/dist/src/tasks-runner/batch/run-batch.js +78 -0
  930. package/dist/src/tasks-runner/cache.d.ts +94 -0
  931. package/dist/src/tasks-runner/cache.js +604 -0
  932. package/dist/src/tasks-runner/create-task-graph.d.ts +41 -0
  933. package/dist/src/tasks-runner/create-task-graph.js +305 -0
  934. package/dist/src/tasks-runner/default-tasks-runner.d.ts +25 -0
  935. package/dist/src/tasks-runner/default-tasks-runner.js +74 -0
  936. package/dist/src/tasks-runner/fork.d.ts +1 -0
  937. package/dist/src/tasks-runner/fork.js +73 -0
  938. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +42 -0
  939. package/dist/src/tasks-runner/forked-process-task-runner.js +299 -0
  940. package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -0
  941. package/dist/src/tasks-runner/init-tasks-runner.js +86 -0
  942. package/dist/src/tasks-runner/is-tui-enabled.d.ts +18 -0
  943. package/dist/src/tasks-runner/is-tui-enabled.js +91 -0
  944. package/dist/src/tasks-runner/legacy-depends-on-warning.d.ts +18 -0
  945. package/dist/src/tasks-runner/legacy-depends-on-warning.js +109 -0
  946. package/dist/src/tasks-runner/life-cycle.d.ts +86 -0
  947. package/dist/src/tasks-runner/life-cycle.js +148 -0
  948. package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts +25 -0
  949. package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +366 -0
  950. package/dist/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts +24 -0
  951. package/dist/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +238 -0
  952. package/dist/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.d.ts +5 -0
  953. package/dist/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +16 -0
  954. package/dist/src/tasks-runner/life-cycles/formatting-utils.d.ts +3 -0
  955. package/dist/src/tasks-runner/life-cycles/formatting-utils.js +55 -0
  956. package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +13 -0
  957. package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +67 -0
  958. package/dist/src/tasks-runner/life-cycles/performance-analysis.d.ts +173 -0
  959. package/dist/src/tasks-runner/life-cycles/performance-analysis.js +508 -0
  960. package/dist/src/tasks-runner/life-cycles/performance-life-cycle.d.ts +59 -0
  961. package/dist/src/tasks-runner/life-cycles/performance-life-cycle.js +193 -0
  962. package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +65 -0
  963. package/dist/src/tasks-runner/life-cycles/performance-report.js +369 -0
  964. package/dist/src/tasks-runner/life-cycles/pretty-time.d.ts +4 -0
  965. package/dist/src/tasks-runner/life-cycles/pretty-time.js +73 -0
  966. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +29 -0
  967. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +109 -0
  968. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +28 -0
  969. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +97 -0
  970. package/dist/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +17 -0
  971. package/dist/src/tasks-runner/life-cycles/store-run-information-life-cycle.js +87 -0
  972. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +11 -0
  973. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +91 -0
  974. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +16 -0
  975. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +112 -0
  976. package/dist/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +14 -0
  977. package/dist/src/tasks-runner/life-cycles/task-profiling-life-cycle.js +73 -0
  978. package/dist/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
  979. package/dist/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
  980. package/dist/src/tasks-runner/life-cycles/task-telemetry-life-cycle.d.ts +9 -0
  981. package/dist/src/tasks-runner/life-cycles/task-telemetry-life-cycle.js +42 -0
  982. package/dist/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +8 -0
  983. package/dist/src/tasks-runner/life-cycles/task-timings-life-cycle.js +39 -0
  984. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +19 -0
  985. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +339 -0
  986. package/dist/src/tasks-runner/life-cycles/view-logs-utils.d.ts +1 -0
  987. package/dist/src/tasks-runner/life-cycles/view-logs-utils.js +15 -0
  988. package/dist/src/tasks-runner/process-metrics-service.d.ts +53 -0
  989. package/dist/src/tasks-runner/process-metrics-service.js +161 -0
  990. package/dist/src/tasks-runner/pseudo-ipc.d.ts +48 -0
  991. package/dist/src/tasks-runner/pseudo-ipc.js +156 -0
  992. package/dist/src/tasks-runner/pseudo-terminal.d.ts +58 -0
  993. package/dist/src/tasks-runner/pseudo-terminal.js +197 -0
  994. package/dist/src/tasks-runner/remove-old-cache-records.d.ts +1 -0
  995. package/dist/src/tasks-runner/remove-old-cache-records.js +60 -0
  996. package/dist/src/tasks-runner/run-command.d.ts +42 -0
  997. package/dist/src/tasks-runner/run-command.js +902 -0
  998. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +19 -0
  999. package/dist/src/tasks-runner/running-tasks/batch-process.js +110 -0
  1000. package/dist/src/tasks-runner/running-tasks/node-child-process.d.ts +40 -0
  1001. package/dist/src/tasks-runner/running-tasks/node-child-process.js +175 -0
  1002. package/dist/src/tasks-runner/running-tasks/noop-child-process.d.ts +16 -0
  1003. package/dist/src/tasks-runner/running-tasks/noop-child-process.js +22 -0
  1004. package/dist/src/tasks-runner/running-tasks/output-prefix.d.ts +13 -0
  1005. package/dist/src/tasks-runner/running-tasks/output-prefix.js +63 -0
  1006. package/dist/src/tasks-runner/running-tasks/running-task.d.ts +11 -0
  1007. package/dist/src/tasks-runner/running-tasks/running-task.js +6 -0
  1008. package/dist/src/tasks-runner/running-tasks/shared-running-task.d.ts +14 -0
  1009. package/dist/src/tasks-runner/running-tasks/shared-running-task.js +30 -0
  1010. package/dist/src/tasks-runner/task-env-paths.d.ts +1 -0
  1011. package/dist/src/tasks-runner/task-env-paths.js +45 -0
  1012. package/dist/src/tasks-runner/task-env.d.ts +31 -0
  1013. package/dist/src/tasks-runner/task-env.js +195 -0
  1014. package/dist/src/tasks-runner/task-graph-utils.d.ts +30 -0
  1015. package/dist/src/tasks-runner/task-graph-utils.js +225 -0
  1016. package/dist/src/tasks-runner/task-io-service.d.ts +96 -0
  1017. package/dist/src/tasks-runner/task-io-service.js +122 -0
  1018. package/dist/src/tasks-runner/task-orchestrator.d.ts +192 -0
  1019. package/dist/src/tasks-runner/task-orchestrator.js +1370 -0
  1020. package/dist/src/tasks-runner/tasks-runner.d.ts +24 -0
  1021. package/dist/src/tasks-runner/tasks-runner.js +2 -0
  1022. package/dist/src/tasks-runner/tasks-schedule.d.ts +48 -0
  1023. package/dist/src/tasks-runner/tasks-schedule.js +258 -0
  1024. package/dist/src/tasks-runner/utils.d.ts +61 -0
  1025. package/dist/src/tasks-runner/utils.js +451 -0
  1026. package/dist/src/utils/ab-testing.d.ts +59 -0
  1027. package/dist/src/utils/ab-testing.js +142 -0
  1028. package/dist/src/utils/acknowledge-build-scripts.d.ts +13 -0
  1029. package/dist/src/utils/acknowledge-build-scripts.js +102 -0
  1030. package/dist/src/utils/all-file-data.d.ts +2 -0
  1031. package/dist/src/utils/all-file-data.js +8 -0
  1032. package/dist/src/utils/analytics-prompt.d.ts +9 -0
  1033. package/dist/src/utils/analytics-prompt.js +84 -0
  1034. package/dist/src/utils/assert-workspace-validity.d.ts +3 -0
  1035. package/dist/src/utils/assert-workspace-validity.js +85 -0
  1036. package/dist/src/utils/async-iterator.d.ts +2 -0
  1037. package/dist/src/utils/async-iterator.js +18 -0
  1038. package/dist/src/utils/binary-extensions.d.ts +1 -0
  1039. package/dist/src/utils/binary-extensions.js +279 -0
  1040. package/dist/src/utils/cache-directory.d.ts +9 -0
  1041. package/dist/src/utils/cache-directory.js +86 -0
  1042. package/dist/src/utils/call-sites.d.ts +14 -0
  1043. package/dist/src/utils/call-sites.js +28 -0
  1044. package/dist/src/utils/catalog/index.d.ts +22 -0
  1045. package/dist/src/utils/catalog/index.js +87 -0
  1046. package/dist/src/utils/catalog/manager-factory.d.ts +5 -0
  1047. package/dist/src/utils/catalog/manager-factory.js +20 -0
  1048. package/dist/src/utils/catalog/manager-utils.d.ts +8 -0
  1049. package/dist/src/utils/catalog/manager-utils.js +232 -0
  1050. package/dist/src/utils/catalog/manager.d.ts +40 -0
  1051. package/dist/src/utils/catalog/manager.js +13 -0
  1052. package/dist/src/utils/catalog/pnpm-manager.d.ts +22 -0
  1053. package/dist/src/utils/catalog/pnpm-manager.js +139 -0
  1054. package/dist/src/utils/catalog/types.d.ts +11 -0
  1055. package/dist/src/utils/catalog/types.js +2 -0
  1056. package/dist/src/utils/catalog/yarn-manager.d.ts +22 -0
  1057. package/dist/src/utils/catalog/yarn-manager.js +139 -0
  1058. package/dist/src/utils/child-process.d.ts +22 -0
  1059. package/dist/src/utils/child-process.js +91 -0
  1060. package/dist/src/utils/chunkify.d.ts +11 -0
  1061. package/dist/src/utils/chunkify.js +44 -0
  1062. package/dist/src/utils/code-frames.d.ts +14 -0
  1063. package/dist/src/utils/code-frames.js +116 -0
  1064. package/dist/src/utils/collapse-expanded-outputs.d.ts +10 -0
  1065. package/dist/src/utils/collapse-expanded-outputs.js +72 -0
  1066. package/dist/src/utils/command-line-utils.d.ts +57 -0
  1067. package/dist/src/utils/command-line-utils.js +259 -0
  1068. package/dist/src/utils/compile-cache.d.ts +24 -0
  1069. package/dist/src/utils/compile-cache.js +49 -0
  1070. package/dist/src/utils/consume-messages-from-socket.d.ts +9 -0
  1071. package/dist/src/utils/consume-messages-from-socket.js +56 -0
  1072. package/dist/src/utils/db-connection.d.ts +14 -0
  1073. package/dist/src/utils/db-connection.js +64 -0
  1074. package/dist/src/utils/default-base.d.ts +1 -0
  1075. package/dist/src/utils/default-base.js +17 -0
  1076. package/dist/src/utils/delayed-spinner.d.ts +51 -0
  1077. package/dist/src/utils/delayed-spinner.js +88 -0
  1078. package/dist/src/utils/dotenv.d.ts +7 -0
  1079. package/dist/src/utils/dotenv.js +19 -0
  1080. package/dist/src/utils/enable-compile-cache.d.ts +1 -0
  1081. package/dist/src/utils/enable-compile-cache.js +7 -0
  1082. package/dist/src/utils/exit-codes.d.ts +15 -0
  1083. package/dist/src/utils/exit-codes.js +75 -0
  1084. package/dist/src/utils/fileutils.d.ts +67 -0
  1085. package/dist/src/utils/fileutils.js +112 -0
  1086. package/dist/src/utils/find-matching-projects.d.ts +18 -0
  1087. package/dist/src/utils/find-matching-projects.js +222 -0
  1088. package/dist/src/utils/find-workspace-root.d.ts +11 -0
  1089. package/dist/src/utils/find-workspace-root.js +33 -0
  1090. package/dist/src/utils/get-package-name-from-import-path.d.ts +1 -0
  1091. package/dist/src/utils/get-package-name-from-import-path.js +17 -0
  1092. package/dist/src/utils/git-revision.d.ts +12 -0
  1093. package/dist/src/utils/git-revision.js +25 -0
  1094. package/dist/src/utils/git-utils.d.ts +70 -0
  1095. package/dist/src/utils/git-utils.index-filter.d.ts +1 -0
  1096. package/dist/src/utils/git-utils.index-filter.js +23 -0
  1097. package/dist/src/utils/git-utils.js +530 -0
  1098. package/dist/src/utils/git-utils.tree-filter.d.ts +1 -0
  1099. package/dist/src/utils/git-utils.tree-filter.js +47 -0
  1100. package/dist/src/utils/globs.d.ts +3 -0
  1101. package/dist/src/utils/globs.js +18 -0
  1102. package/dist/src/utils/handle-errors.d.ts +1 -0
  1103. package/dist/src/utils/handle-errors.js +91 -0
  1104. package/dist/src/utils/handle-import.d.ts +15 -0
  1105. package/dist/src/utils/handle-import.js +86 -0
  1106. package/dist/src/utils/has-nx-js-plugin.d.ts +9 -0
  1107. package/dist/src/utils/has-nx-js-plugin.js +24 -0
  1108. package/dist/src/utils/ignore.d.ts +9 -0
  1109. package/dist/src/utils/ignore.js +42 -0
  1110. package/dist/src/utils/installation-directory.d.ts +2 -0
  1111. package/dist/src/utils/installation-directory.js +12 -0
  1112. package/dist/src/utils/installed-nx-version.d.ts +23 -0
  1113. package/dist/src/utils/installed-nx-version.js +113 -0
  1114. package/dist/src/utils/is-ci.d.ts +1 -0
  1115. package/dist/src/utils/is-ci.js +26 -0
  1116. package/dist/src/utils/is-sandbox.d.ts +1 -0
  1117. package/dist/src/utils/is-sandbox.js +11 -0
  1118. package/dist/src/utils/is-using-prettier.d.ts +3 -0
  1119. package/dist/src/utils/is-using-prettier.js +62 -0
  1120. package/dist/src/utils/json-diff.d.ts +18 -0
  1121. package/dist/src/utils/json-diff.js +112 -0
  1122. package/dist/src/utils/json.d.ts +44 -0
  1123. package/dist/src/utils/json.js +62 -0
  1124. package/dist/src/utils/legacy-task-history.d.ts +8 -0
  1125. package/dist/src/utils/legacy-task-history.js +87 -0
  1126. package/dist/src/utils/logger.d.ts +23 -0
  1127. package/dist/src/utils/logger.js +74 -0
  1128. package/dist/src/utils/machine-id-cache.d.ts +5 -0
  1129. package/dist/src/utils/machine-id-cache.js +93 -0
  1130. package/dist/src/utils/min-release-age/behavior/bun.d.ts +30 -0
  1131. package/dist/src/utils/min-release-age/behavior/bun.js +278 -0
  1132. package/dist/src/utils/min-release-age/behavior/npm.d.ts +21 -0
  1133. package/dist/src/utils/min-release-age/behavior/npm.js +293 -0
  1134. package/dist/src/utils/min-release-age/behavior/pnpm.d.ts +23 -0
  1135. package/dist/src/utils/min-release-age/behavior/pnpm.js +527 -0
  1136. package/dist/src/utils/min-release-age/behavior/yarn.d.ts +22 -0
  1137. package/dist/src/utils/min-release-age/behavior/yarn.js +314 -0
  1138. package/dist/src/utils/min-release-age/constants.d.ts +3 -0
  1139. package/dist/src/utils/min-release-age/constants.js +8 -0
  1140. package/dist/src/utils/min-release-age/errors.d.ts +28 -0
  1141. package/dist/src/utils/min-release-age/errors.js +22 -0
  1142. package/dist/src/utils/min-release-age/npmrc.d.ts +15 -0
  1143. package/dist/src/utils/min-release-age/npmrc.js +45 -0
  1144. package/dist/src/utils/min-release-age/packument.d.ts +13 -0
  1145. package/dist/src/utils/min-release-age/packument.js +34 -0
  1146. package/dist/src/utils/min-release-age/pick.d.ts +72 -0
  1147. package/dist/src/utils/min-release-age/pick.js +206 -0
  1148. package/dist/src/utils/min-release-age/pnpm-exclude-writer.d.ts +12 -0
  1149. package/dist/src/utils/min-release-age/pnpm-exclude-writer.js +58 -0
  1150. package/dist/src/utils/min-release-age/policy.d.ts +38 -0
  1151. package/dist/src/utils/min-release-age/policy.js +59 -0
  1152. package/dist/src/utils/min-release-age/resolve.d.ts +8 -0
  1153. package/dist/src/utils/min-release-age/resolve.js +14 -0
  1154. package/dist/src/utils/nx-cloud-utils.d.ts +4 -0
  1155. package/dist/src/utils/nx-cloud-utils.js +28 -0
  1156. package/dist/src/utils/nx-console-prompt.d.ts +1 -0
  1157. package/dist/src/utils/nx-console-prompt.js +64 -0
  1158. package/dist/src/utils/nx-key.d.ts +6 -0
  1159. package/dist/src/utils/nx-key.js +50 -0
  1160. package/dist/src/utils/nx-package-group.d.ts +8 -0
  1161. package/dist/src/utils/nx-package-group.js +15 -0
  1162. package/dist/src/utils/object-sort.d.ts +1 -0
  1163. package/dist/src/utils/object-sort.js +9 -0
  1164. package/dist/src/utils/output.d.ts +79 -0
  1165. package/dist/src/utils/output.js +264 -0
  1166. package/dist/src/utils/package-json.d.ts +229 -0
  1167. package/dist/src/utils/package-json.js +387 -0
  1168. package/dist/src/utils/package-manager.d.ts +142 -0
  1169. package/dist/src/utils/package-manager.js +643 -0
  1170. package/dist/src/utils/params.d.ts +140 -0
  1171. package/dist/src/utils/params.js +710 -0
  1172. package/dist/src/utils/path.d.ts +19 -0
  1173. package/dist/src/utils/path.js +38 -0
  1174. package/dist/src/utils/perf-hooks.d.ts +19 -0
  1175. package/dist/src/utils/perf-logging.d.ts +1 -0
  1176. package/dist/src/utils/perf-logging.js +46 -0
  1177. package/dist/src/utils/plugin-cache-utils.d.ts +82 -0
  1178. package/dist/src/utils/plugin-cache-utils.js +212 -0
  1179. package/dist/src/utils/plugin-progress-text.d.ts +1 -0
  1180. package/dist/src/utils/plugin-progress-text.js +15 -0
  1181. package/dist/src/utils/plugins/atomizer-utils.d.ts +11 -0
  1182. package/dist/src/utils/plugins/atomizer-utils.js +23 -0
  1183. package/dist/src/utils/plugins/core-plugins.d.ts +6 -0
  1184. package/dist/src/utils/plugins/core-plugins.js +113 -0
  1185. package/dist/src/utils/plugins/index.d.ts +5 -0
  1186. package/dist/src/utils/plugins/index.js +15 -0
  1187. package/dist/src/utils/plugins/installed-plugins.d.ts +5 -0
  1188. package/dist/src/utils/plugins/installed-plugins.js +76 -0
  1189. package/dist/src/utils/plugins/local-plugins.d.ts +22 -0
  1190. package/dist/src/utils/plugins/local-plugins.js +60 -0
  1191. package/dist/src/utils/plugins/output.d.ts +34 -0
  1192. package/dist/src/utils/plugins/output.js +201 -0
  1193. package/dist/src/utils/plugins/plugin-capabilities.d.ts +15 -0
  1194. package/dist/src/utils/plugins/plugin-capabilities.js +78 -0
  1195. package/dist/src/utils/pnpm-workspace.d.ts +8 -0
  1196. package/dist/src/utils/pnpm-workspace.js +2 -0
  1197. package/dist/src/utils/print-help.d.ts +11 -0
  1198. package/dist/src/utils/print-help.js +259 -0
  1199. package/dist/src/utils/progress-topics.d.ts +19 -0
  1200. package/dist/src/utils/progress-topics.js +21 -0
  1201. package/dist/src/utils/project-graph-utils.d.ts +18 -0
  1202. package/dist/src/utils/project-graph-utils.js +78 -0
  1203. package/dist/src/utils/promised-based-queue.d.ts +6 -0
  1204. package/dist/src/utils/promised-based-queue.js +43 -0
  1205. package/dist/src/utils/provenance.d.ts +47 -0
  1206. package/dist/src/utils/provenance.js +115 -0
  1207. package/dist/src/utils/require-nx-key.d.ts +1 -0
  1208. package/dist/src/utils/require-nx-key.js +23 -0
  1209. package/dist/src/utils/serializable-error.d.ts +4 -0
  1210. package/dist/src/utils/serializable-error.js +33 -0
  1211. package/dist/src/utils/serialize-overrides-into-command-line.d.ts +3 -0
  1212. package/dist/src/utils/serialize-overrides-into-command-line.js +41 -0
  1213. package/dist/src/utils/serialize-target.d.ts +1 -0
  1214. package/dist/src/utils/serialize-target.js +6 -0
  1215. package/dist/src/utils/shell-quoting.d.ts +10 -0
  1216. package/dist/src/utils/shell-quoting.js +41 -0
  1217. package/dist/src/utils/spinner.d.ts +24 -0
  1218. package/dist/src/utils/spinner.js +77 -0
  1219. package/dist/src/utils/split-target.d.ts +15 -0
  1220. package/dist/src/utils/split-target.js +239 -0
  1221. package/dist/src/utils/strip-indents.d.ts +14 -0
  1222. package/dist/src/utils/strip-indents.js +23 -0
  1223. package/dist/src/utils/sync-generators.d.ts +66 -0
  1224. package/dist/src/utils/sync-generators.js +355 -0
  1225. package/dist/src/utils/tar.d.ts +8 -0
  1226. package/dist/src/utils/tar.js +44 -0
  1227. package/dist/src/utils/task-history.d.ts +17 -0
  1228. package/dist/src/utils/task-history.js +51 -0
  1229. package/dist/src/utils/terminal-link.d.ts +20 -0
  1230. package/dist/src/utils/terminal-link.js +85 -0
  1231. package/dist/src/utils/update-nxw.d.ts +2 -0
  1232. package/dist/src/utils/update-nxw.js +22 -0
  1233. package/dist/src/utils/versions.d.ts +1 -0
  1234. package/dist/src/utils/versions.js +4 -0
  1235. package/dist/src/utils/wait-for-socket-connection.d.ts +15 -0
  1236. package/dist/src/utils/wait-for-socket-connection.js +53 -0
  1237. package/dist/src/utils/workspace-context.d.ts +21 -0
  1238. package/dist/src/utils/workspace-context.js +120 -0
  1239. package/dist/src/utils/workspace-id.d.ts +20 -0
  1240. package/dist/src/utils/workspace-id.js +54 -0
  1241. package/dist/src/utils/workspace-root.d.ts +6 -0
  1242. package/dist/src/utils/workspace-root.js +40 -0
  1243. package/dist/src/utils/write-formatted-json-file.d.ts +6 -0
  1244. package/dist/src/utils/write-formatted-json-file.js +23 -0
  1245. package/dist/src/utils/yarn-syml/index.d.ts +23 -0
  1246. package/dist/src/utils/yarn-syml/index.js +151 -0
  1247. package/dist/src/utils/yarn-syml/syml-grammar.js +1911 -0
  1248. package/dist/tasks-runners/default.d.ts +1 -0
  1249. package/dist/tasks-runners/default.js +5 -0
  1250. package/executors.json +19 -0
  1251. package/generators.json +16 -0
  1252. package/migrations.json +189 -0
  1253. package/package.json +542 -0
  1254. package/schemas/migrations-schema.json +186 -0
  1255. package/schemas/nx-schema.json +1615 -0
  1256. package/schemas/project-schema.json +426 -0
  1257. package/schemas/workspace-schema.json +185 -0
@@ -0,0 +1,1236 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NODENEXT_ESM_RESOLVER_SOURCE = void 0;
4
+ exports.forceRegisterEsmLoader = forceRegisterEsmLoader;
5
+ exports.nodeNextEsmResolveHook = nodeNextEsmResolveHook;
6
+ exports.ensureNodeNextEsmResolverRegistered = ensureNodeNextEsmResolverRegistered;
7
+ exports.ensureCjsResolverPatched = ensureCjsResolverPatched;
8
+ exports.ensureResolveConditionsInjected = ensureResolveConditionsInjected;
9
+ exports.isNativeStripPreferred = isNativeStripPreferred;
10
+ exports.registerTsProject = registerTsProject;
11
+ exports.getSwcTranspiler = getSwcTranspiler;
12
+ exports.getTsNodeTranspiler = getTsNodeTranspiler;
13
+ exports.getTranspiler = getTranspiler;
14
+ exports.isNativeTypeStripError = isNativeTypeStripError;
15
+ exports.isCjsSyntaxError = isCjsSyntaxError;
16
+ exports.isRequireInEsmScopeError = isRequireInEsmScopeError;
17
+ exports.isTsEsmSyntaxError = isTsEsmSyntaxError;
18
+ exports.isTsEsmNamedExportLinkageError = isTsEsmNamedExportLinkageError;
19
+ exports.loadTsFile = loadTsFile;
20
+ exports.requireWithTsconfigFallback = requireWithTsconfigFallback;
21
+ exports.registerTranspiler = registerTranspiler;
22
+ exports.registerTsConfigPaths = registerTsConfigPaths;
23
+ exports.getTsNodeCompilerOptions = getTsNodeCompilerOptions;
24
+ const path_1 = require("path");
25
+ const fs_1 = require("fs");
26
+ const logger_1 = require("../../../utils/logger");
27
+ const workspace_root_1 = require("../../../utils/workspace-root");
28
+ const typescript_1 = require("./typescript");
29
+ const swcNodeInstalled = packageIsInstalled('@swc-node/register');
30
+ const tsNodeInstalled = packageIsInstalled('ts-node/register');
31
+ let ts;
32
+ let isTsEsmLoaderRegistered = false;
33
+ /**
34
+ * Force-register an ESM loader (`@swc-node/register/esm` if available, else
35
+ * `ts-node/esm`) via `Module.register` so dynamic `import()` of TS files
36
+ * goes through a transpiler.
37
+ *
38
+ * **IMPORTANT — global side effect:** `Module.register` is one-shot per
39
+ * process and applies to *every* subsequent ESM resolution in the process.
40
+ * Calling this trades native Node.js TypeScript stripping for transpiled
41
+ * loading on the dynamic-import path for the rest of the run. CJS
42
+ * `require()` is unaffected (different hook), so `.cts` files via require
43
+ * keep using native strip + swc-node's `Module._extensions` hook.
44
+ *
45
+ * Required for the niche case where an ESM config (`.mts` or `.ts` resolved
46
+ * as ESM) combines top-level await with TypeScript syntax that native strip
47
+ * can't handle (`enum`, runtime `namespace`, etc.). TLA forces dynamic
48
+ * `import()`, which bypasses the CJS hook chain - the only way to intercept
49
+ * is `Module.register`.
50
+ *
51
+ * Idempotent: subsequent calls are no-ops.
52
+ *
53
+ * Throws if neither `@swc-node/register` nor `ts-node` is installed.
54
+ */
55
+ function forceRegisterEsmLoader() {
56
+ ensureEsmLoaderRegistered({ required: true });
57
+ }
58
+ function ensureEsmLoaderRegistered(opts) {
59
+ if (isTsEsmLoaderRegistered)
60
+ return;
61
+ const module = require('node:module');
62
+ if (typeof module.register !== 'function') {
63
+ if (opts.required) {
64
+ throw new Error(`${logger_1.NX_PREFIX} Module.register is not available in this Node.js version - cannot register an ESM loader for the TypeScript fallback. ${STRIP_TYPES_OPT_OUT_HINT}`);
65
+ }
66
+ return;
67
+ }
68
+ // ts-node reads compilerOptions from this env var. Setting nodenext
69
+ // module/resolution avoids surprises when ts-node is the chosen loader.
70
+ process.env.TS_NODE_COMPILER_OPTIONS ??= JSON.stringify({
71
+ moduleResolution: 'nodenext',
72
+ module: 'nodenext',
73
+ });
74
+ // Prefer @swc-node/register/esm (faster) over ts-node/esm.
75
+ const swcEsm = tryResolveLoader('@swc-node/register/esm');
76
+ const tsNodeEsm = tryResolveLoader('ts-node/esm');
77
+ const loaderPath = swcEsm ?? tsNodeEsm;
78
+ if (!loaderPath) {
79
+ if (opts.required) {
80
+ throw new Error(`${logger_1.NX_PREFIX} Cannot register an ESM TypeScript loader to fall back from native stripping. Install @swc-node/register or ts-node, or ${STRIP_TYPES_OPT_OUT_HINT}`);
81
+ }
82
+ isTsEsmLoaderRegistered = true;
83
+ return;
84
+ }
85
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
86
+ const loaderName = swcEsm ? '@swc-node/register/esm' : 'ts-node/esm';
87
+ logger_1.logger.warn((0, logger_1.stripIndent)(`${logger_1.NX_PREFIX} Registering ESM TypeScript loader ${loaderName}. All subsequent ESM imports in this process will go through it - native Node.js TypeScript stripping is forfeited for the dynamic-import path.`));
88
+ }
89
+ const url = require('node:url');
90
+ module.register(url.pathToFileURL(loaderPath));
91
+ isTsEsmLoaderRegistered = true;
92
+ }
93
+ /**
94
+ * Source of a minimal ESM resolution hook that rewrites TypeScript NodeNext
95
+ * `.js`/`.mjs`/`.cjs` relative specifiers to their `.ts`/`.mts`/`.cts` sources.
96
+ * Inlined as a string so it can be registered as a self-contained `data:`
97
+ * module - it relies only on Node's default resolver (no ts-node/swc-node) and
98
+ * defers loading to Node's native TypeScript stripping. The ESM counterpart to
99
+ * the CJS `ensureCjsResolverPatched`.
100
+ *
101
+ * Only rewrites when the default resolution fails with ERR_MODULE_NOT_FOUND,
102
+ * the importing module is itself TypeScript, and the specifier is relative, so
103
+ * it never hijacks resolution that would otherwise succeed.
104
+ *
105
+ * Used only as the fallback for runtimes without `module.registerHooks()`
106
+ * (Node < 22.15 / < 23.5); newer runtimes register the in-thread synchronous
107
+ * twin `nodeNextEsmResolveHook` instead. Keep the two in sync.
108
+ *
109
+ * Exported so the hook can be exercised directly in unit tests.
110
+ */
111
+ exports.NODENEXT_ESM_RESOLVER_SOURCE = `
112
+ const EXT_FALLBACK = { '.js': ['.ts', '.tsx'], '.mjs': ['.mts'], '.cjs': ['.cts'] };
113
+ const TS_PARENT_RE = /\\.(?:ts|tsx|mts|cts)(?:$|\\?)/;
114
+ export async function resolve(specifier, context, nextResolve) {
115
+ try {
116
+ return await nextResolve(specifier, context);
117
+ } catch (err) {
118
+ if (err?.code !== 'ERR_MODULE_NOT_FOUND') throw err;
119
+ const parent = context.parentURL;
120
+ if (!parent || !TS_PARENT_RE.test(parent)) throw err;
121
+ if (!(specifier.startsWith('./') || specifier.startsWith('../') || specifier.startsWith('file:'))) throw err;
122
+ const m = specifier.match(/(\\.(?:js|mjs|cjs))($|\\?)/);
123
+ if (!m) throw err;
124
+ const fallbacks = EXT_FALLBACK[m[1]];
125
+ if (!fallbacks) throw err;
126
+ const base = specifier.slice(0, m.index);
127
+ const suffix = specifier.slice(m.index + m[1].length);
128
+ for (const ext of fallbacks) {
129
+ try { return await nextResolve(base + ext + suffix, context); } catch {}
130
+ }
131
+ throw err;
132
+ }
133
+ }
134
+ `;
135
+ const NODENEXT_EXT_FALLBACK = {
136
+ '.js': ['.ts', '.tsx'],
137
+ '.mjs': ['.mts'],
138
+ '.cjs': ['.cts'],
139
+ };
140
+ const NODENEXT_TS_PARENT_RE = /\.(?:ts|tsx|mts|cts)(?:$|\?)/;
141
+ /**
142
+ * Synchronous in-thread twin of `NODENEXT_ESM_RESOLVER_SOURCE` for
143
+ * `module.registerHooks()`: `nextResolve` throws synchronously rather than
144
+ * rejecting, so this uses try/catch instead of `await`. Keep the two in sync.
145
+ * Exported for unit tests.
146
+ */
147
+ function nodeNextEsmResolveHook(specifier, context, nextResolve) {
148
+ try {
149
+ return nextResolve(specifier, context);
150
+ }
151
+ catch (err) {
152
+ if (err?.code !== 'ERR_MODULE_NOT_FOUND')
153
+ throw err;
154
+ const parent = context.parentURL;
155
+ if (!parent || !NODENEXT_TS_PARENT_RE.test(parent))
156
+ throw err;
157
+ if (!(specifier.startsWith('./') ||
158
+ specifier.startsWith('../') ||
159
+ specifier.startsWith('file:'))) {
160
+ throw err;
161
+ }
162
+ const m = specifier.match(/(\.(?:js|mjs|cjs))($|\?)/);
163
+ if (!m)
164
+ throw err;
165
+ const fallbacks = NODENEXT_EXT_FALLBACK[m[1]];
166
+ if (!fallbacks)
167
+ throw err;
168
+ const base = specifier.slice(0, m.index);
169
+ const suffix = specifier.slice(m.index + m[1].length);
170
+ for (const ext of fallbacks) {
171
+ try {
172
+ return nextResolve(base + ext + suffix, context);
173
+ }
174
+ catch {
175
+ // try the next fallback
176
+ }
177
+ }
178
+ throw err;
179
+ }
180
+ }
181
+ let nodeNextEsmResolverRegistered = false;
182
+ /**
183
+ * Register an ESM resolution hook that rewrites TypeScript NodeNext-style
184
+ * `.js`/`.mjs`/`.cjs` relative specifiers to their `.ts`/`.mts`/`.cts` sources.
185
+ * This is the ESM counterpart to `ensureCjsResolverPatched`: Node's native type
186
+ * stripping loads the `.ts` file, but neither native strip nor Node's ESM
187
+ * resolver rewrites the extension, so `import './foo.js'` from a `.ts` source
188
+ * where only `foo.ts` exists fails with ERR_MODULE_NOT_FOUND without it.
189
+ *
190
+ * Prefers `module.registerHooks()` (Node 22.15+ / 23.5+), passing the in-thread
191
+ * `nodeNextEsmResolveHook`. Falls back to `module.register()` with the inlined
192
+ * `data:` module (`NODENEXT_ESM_RESOLVER_SOURCE`) on older runtimes that lack
193
+ * `registerHooks` - `module.register()` emits a runtime DeprecationWarning
194
+ * (DEP0205) on Node 25.9+/26+, so it is only used when nothing better exists.
195
+ * Either way the hook relies only on Node's default resolver - no
196
+ * ts-node/swc-node.
197
+ *
198
+ * Idempotent and best-effort: a no-op when no registration API is available,
199
+ * when a TypeScript transpiler is already preloaded (see
200
+ * `isTsTranspilerPreloaded`), or if registration fails.
201
+ */
202
+ function ensureNodeNextEsmResolverRegistered() {
203
+ if (nodeNextEsmResolverRegistered)
204
+ return;
205
+ nodeNextEsmResolverRegistered = true;
206
+ const module = require('node:module');
207
+ // Skip when a transpiler was preloaded via `--require`/`--import` (e.g.
208
+ // `--require ts-node/register`, which Nx uses only when it runs from `.ts`
209
+ // source). The `module.register()` fallback below spins up a loader-hook
210
+ // worker thread on which Node re-runs those preloads, resolved relative to
211
+ // the *current* working directory - and Nx plugin workers `chdir()` into the
212
+ // analyzed workspace first. If that workspace can't resolve the preloaded
213
+ // module, the loader worker throws and can leave module resolution in a bad
214
+ // state, so we must avoid the call entirely; catching it is not a clean
215
+ // recovery. `module.registerHooks()` runs in-thread with no such worker, but
216
+ // we keep the skip uniform so resolver coverage doesn't vary by Node version.
217
+ //
218
+ // Consequence: in that from-`.ts`-source invocation a `type: module` plugin
219
+ // using NodeNext `.js` specifiers won't get this resolver (a preloaded
220
+ // `ts-node` does NOT rewrite `.js` -> `.ts` for ESM). Published Nx is
221
+ // unaffected - its workers run compiled `.js` with no preload.
222
+ if (isTsTranspilerPreloaded())
223
+ return;
224
+ // Synchronous in-thread hooks (Node 22.15+ / 23.5+). Preferred because
225
+ // `module.register()` is deprecated (DEP0205) from Node 25.9+/26+.
226
+ const registerHooks = module.registerHooks;
227
+ if (typeof registerHooks === 'function') {
228
+ try {
229
+ registerHooks.call(module, { resolve: nodeNextEsmResolveHook });
230
+ }
231
+ catch {
232
+ // Best-effort: leave Node's native handling in place rather than failing.
233
+ }
234
+ return;
235
+ }
236
+ if (typeof module.register !== 'function')
237
+ return;
238
+ try {
239
+ module.register('data:text/javascript,' + encodeURIComponent(exports.NODENEXT_ESM_RESOLVER_SOURCE));
240
+ }
241
+ catch {
242
+ // Best-effort: leave Node's native handling in place for the
243
+ // dynamic-import path rather than failing the load.
244
+ }
245
+ }
246
+ /**
247
+ * Whether this process was started with a TypeScript transpiler preloaded via
248
+ * a `--require`/`--import`/`--loader` flag (e.g. `--require ts-node/register`),
249
+ * either directly in `process.execArgv` or through `NODE_OPTIONS`. Used to skip
250
+ * a redundant ESM loader registration that would otherwise crash a loader-hook
251
+ * worker re-running the preload from a `chdir()`'d cwd - see
252
+ * `ensureNodeNextEsmResolverRegistered`.
253
+ */
254
+ function isTsTranspilerPreloaded() {
255
+ const PRELOAD_FLAGS = [
256
+ '-r',
257
+ '--require',
258
+ '--import',
259
+ '--loader',
260
+ '--experimental-loader',
261
+ ];
262
+ const TRANSPILER_RE = /(?:ts-node|@?swc-node)/;
263
+ // Flags passed directly (e.g. spawn(..., ['--require', 'ts-node/register'])).
264
+ const execArgv = process.execArgv ?? [];
265
+ for (let i = 0; i < execArgv.length; i++) {
266
+ const arg = execArgv[i];
267
+ const eqIdx = arg.indexOf('=');
268
+ if (eqIdx !== -1) {
269
+ if (PRELOAD_FLAGS.includes(arg.slice(0, eqIdx)) &&
270
+ TRANSPILER_RE.test(arg.slice(eqIdx + 1))) {
271
+ return true;
272
+ }
273
+ }
274
+ else if (PRELOAD_FLAGS.includes(arg) &&
275
+ TRANSPILER_RE.test(execArgv[i + 1] ?? '')) {
276
+ return true;
277
+ }
278
+ }
279
+ // Preloads passed via NODE_OPTIONS don't surface in execArgv.
280
+ const nodeOptions = process.env.NODE_OPTIONS;
281
+ if (nodeOptions &&
282
+ TRANSPILER_RE.test(nodeOptions) &&
283
+ PRELOAD_FLAGS.some((flag) => nodeOptions.includes(flag))) {
284
+ return true;
285
+ }
286
+ return false;
287
+ }
288
+ let cjsResolverPatched = false;
289
+ /**
290
+ * Patches Node's CJS resolver to fall back from `.js`/`.mjs`/`.cjs` to the
291
+ * corresponding TypeScript source extension (`.ts`/`.tsx`, `.mts`, `.cts`)
292
+ * when the requesting file is itself a `.ts`/`.tsx`/`.mts`/`.cts` source.
293
+ *
294
+ * Required for TypeScript NodeNext-style relative imports: `import './foo.js'`
295
+ * inside a `.ts` file resolves to `./foo.ts` at compile time, but the `.js`
296
+ * specifier survives transpilation to CJS. Node's native CJS resolver doesn't
297
+ * rewrite extensions and there is no officially-supported Node API for this —
298
+ * Node's native strip-types deliberately doesn't either — so a resolver patch
299
+ * is the prevailing solution in the ecosystem (used by `tsx` and ts-node's
300
+ * `experimentalResolver`).
301
+ *
302
+ * Patches `Module._resolveFilename` (not `_findPath`, matching tsx's narrower
303
+ * surface). Gates on the requesting file being TS so vanilla `.js` code
304
+ * requesting missing `.js` files keeps failing — no silent hijack. Only fires
305
+ * the fallback on `MODULE_NOT_FOUND` so existing `.js` resolution is
306
+ * unaffected when both files exist. Idempotent on repeat calls.
307
+ */
308
+ function ensureCjsResolverPatched() {
309
+ if (cjsResolverPatched)
310
+ return;
311
+ cjsResolverPatched = true;
312
+ const Module = require('node:module');
313
+ const original = Module._resolveFilename;
314
+ if (typeof original !== 'function')
315
+ return;
316
+ const TS_PARENT_RE = /\.(?:ts|tsx|mts|cts)$/;
317
+ const EXT_FALLBACK = {
318
+ '.js': ['.ts', '.tsx'],
319
+ '.mjs': ['.mts'],
320
+ '.cjs': ['.cts'],
321
+ };
322
+ Module._resolveFilename = function (request, parent, ...rest) {
323
+ try {
324
+ return original.call(this, request, parent, ...rest);
325
+ }
326
+ catch (err) {
327
+ if (err?.code !== 'MODULE_NOT_FOUND')
328
+ throw err;
329
+ if (!parent?.filename || !TS_PARENT_RE.test(parent.filename))
330
+ throw err;
331
+ const match = request.match(/(\.(?:js|mjs|cjs))$/);
332
+ if (!match)
333
+ throw err;
334
+ const fallbacks = EXT_FALLBACK[match[1]];
335
+ if (!fallbacks)
336
+ throw err;
337
+ const base = request.slice(0, -match[1].length);
338
+ for (const ext of fallbacks) {
339
+ try {
340
+ return original.call(this, base + ext, parent, ...rest);
341
+ }
342
+ catch {
343
+ // try the next fallback
344
+ }
345
+ }
346
+ throw err;
347
+ }
348
+ };
349
+ }
350
+ function tryResolveLoader(specifier) {
351
+ try {
352
+ return require.resolve(specifier);
353
+ }
354
+ catch {
355
+ return null;
356
+ }
357
+ }
358
+ /**
359
+ * tsx is a utility to run TypeScript files in node which is growing in popularity:
360
+ * https://tsx.is
361
+ *
362
+ * Behind the scenes it is invoking node with relevant --require and --import flags.
363
+ *
364
+ * If the user is invoking Nx via a script which is being invoked via tsx, then we
365
+ * do not need to register any transpiler at all as the environment will have already
366
+ * been configured by tsx. In fact, registering a transpiler such as ts-node or swc
367
+ * in this case causes issues.
368
+ *
369
+ * Because node is being invoked by tsx, the tsx binary does not end up in the final
370
+ * process.argv and so we need to check a few possible things to account for usage
371
+ * via different package managers (e.g. pnpm does not set process._ to tsx, but rather
372
+ * pnpm itself, modern yarn does not set process._ at all etc.).
373
+ */
374
+ const isInvokedByTsx = (() => {
375
+ if (process.env._?.endsWith(`${path_1.sep}tsx`)) {
376
+ return true;
377
+ }
378
+ const requireArgs = [];
379
+ const importArgs = [];
380
+ (process.execArgv ?? []).forEach((arg, i) => {
381
+ if (arg === '-r' || arg === '--require') {
382
+ requireArgs.push(process.execArgv[i + 1]);
383
+ }
384
+ if (arg === '--import') {
385
+ importArgs.push(process.execArgv[i + 1]);
386
+ }
387
+ });
388
+ const isTsxPath = (p) => p.includes(`${path_1.sep}tsx${path_1.sep}`);
389
+ return (requireArgs.some((a) => isTsxPath(a)) ||
390
+ importArgs.some((a) => isTsxPath(a)));
391
+ })();
392
+ let resolveConditionsInjected = false;
393
+ /**
394
+ * Make Node's module resolver honor the given export conditions for the rest of
395
+ * the process, via `module.registerHooks()`. Used when a local plugin is loaded
396
+ * from source in-process (no child process to pass `--conditions` to at spawn):
397
+ * the hook appends the conditions to every resolution so the plugin's transitive
398
+ * workspace imports resolve to source the same way the plugin entry did.
399
+ *
400
+ * No-op when:
401
+ * - `conditions` is empty (nothing to inject);
402
+ * - every target condition is already active at startup (a spawned plugin
403
+ * worker or daemon was launched with the full `--conditions` set, so Node's
404
+ * resolver already honors them and the per-resolve hook would be redundant);
405
+ * - `module.registerHooks` is unavailable (Node < 22.15 / < 23.5). Those
406
+ * runtimes keep the `NODE_OPTIONS=--conditions` escape hatch.
407
+ *
408
+ * Idempotent and best-effort.
409
+ */
410
+ function ensureResolveConditionsInjected(conditions) {
411
+ if (resolveConditionsInjected)
412
+ return;
413
+ resolveConditionsInjected = true;
414
+ if (!conditions.length)
415
+ return;
416
+ // Skip only when Node already honors every target condition (e.g. a worker or
417
+ // daemon spawned with the full `--conditions` set); a partial overlap still
418
+ // needs the hook to add the missing ones.
419
+ const activeConditions = getConditionsActiveAtStartup();
420
+ if (conditions.every((condition) => activeConditions.has(condition)))
421
+ return;
422
+ const module = require('node:module');
423
+ const registerHooks = module.registerHooks;
424
+ if (typeof registerHooks !== 'function')
425
+ return;
426
+ try {
427
+ registerHooks.call(module, {
428
+ resolve(specifier, context, nextResolve) {
429
+ const merged = context.conditions
430
+ ? [...context.conditions, ...conditions]
431
+ : conditions;
432
+ return nextResolve(specifier, { ...context, conditions: merged });
433
+ },
434
+ });
435
+ }
436
+ catch {
437
+ // Best-effort: leave Node's native resolution in place rather than failing.
438
+ }
439
+ }
440
+ /**
441
+ * Export conditions this process was started with, parsed from `--conditions`
442
+ * (or its `-C` alias) in `process.execArgv` and `NODE_OPTIONS`. Node's resolver
443
+ * already honors these, so the injected hook only needs to cover target
444
+ * conditions not present here.
445
+ */
446
+ function getConditionsActiveAtStartup() {
447
+ const active = new Set();
448
+ const collect = (tokens) => {
449
+ for (let i = 0; i < tokens.length; i++) {
450
+ const token = tokens[i];
451
+ if (token === '--conditions' || token === '-C') {
452
+ const value = tokens[i + 1];
453
+ if (value) {
454
+ active.add(value);
455
+ i++;
456
+ }
457
+ }
458
+ else if (token.startsWith('--conditions=')) {
459
+ active.add(token.slice('--conditions='.length));
460
+ }
461
+ else if (token.startsWith('-C=')) {
462
+ active.add(token.slice('-C='.length));
463
+ }
464
+ }
465
+ };
466
+ collect(process.execArgv ?? []);
467
+ const nodeOptions = process.env.NODE_OPTIONS;
468
+ if (nodeOptions)
469
+ collect(nodeOptions.split(/\s+/).filter(Boolean));
470
+ return active;
471
+ }
472
+ /**
473
+ * Whether the current Node.js runtime exposes native TypeScript type
474
+ * stripping. This is the authoritative gate - it correctly handles every
475
+ * way Node ships TS support:
476
+ * - Node 23.6+: unflagged, on by default
477
+ * - Node 22.18+ LTS: backported unflagged
478
+ * - Node 22.6-22.17 + `--experimental-strip-types` (or `--experimental-transform-types`)
479
+ *
480
+ * `process.features.typescript` is `'strip' | 'transform' | false`.
481
+ */
482
+ const nodeSupportsNativeTypescript = !!process.features
483
+ ?.typescript;
484
+ /**
485
+ * When process.features.typescript is truthy, default to letting Node.js
486
+ * handle TypeScript natively via type stripping and skip registering swc-node
487
+ * or ts-node. Users can opt out by setting NX_PREFER_NODE_STRIP_TYPES=false.
488
+ *
489
+ * Some constructs (enum, runtime namespace, legacy decorators,
490
+ * import = require, parameter properties, etc.) aren't supported by native
491
+ * type stripping. `loadTsFile` catches these failures and falls back to
492
+ * registering swc/ts-node + tsconfig-paths automatically.
493
+ *
494
+ * Setting NX_PREFER_TS_NODE=true also opts out, since that flag explicitly
495
+ * requests ts-node for transpilation.
496
+ *
497
+ * See: https://nodejs.org/api/typescript.html#full-typescript-support
498
+ */
499
+ const preferNodeStripTypes = (() => {
500
+ if (!nodeSupportsNativeTypescript) {
501
+ return false;
502
+ }
503
+ if (process.env.NX_PREFER_TS_NODE === 'true') {
504
+ return false;
505
+ }
506
+ return process.env.NX_PREFER_NODE_STRIP_TYPES !== 'false';
507
+ })();
508
+ /**
509
+ * Skip tsconfig-paths registration on the swc/ts-node fallback path. Useful
510
+ * for workspaces relying on package manager workspaces (pnpm, yarn, npm) for
511
+ * project linking, where tsconfig path aliases aren't needed.
512
+ */
513
+ const disableTsConfigPaths = process.env.NX_DISABLE_TSCONFIG_PATHS === 'true';
514
+ /**
515
+ * Whether Nx will defer to Node's native TypeScript stripping for the next
516
+ * `.ts` load. Mirrors the gate used by `loadTsFile`/`registerTsProject` so
517
+ * other registration sites (e.g. plugin transpiler) can stay aligned.
518
+ */
519
+ function isNativeStripPreferred() {
520
+ return preferNodeStripTypes;
521
+ }
522
+ /**
523
+ * This function registers either ts-node or swc-node to transpile TypeScript files on the fly.
524
+ * It also registers tsconfig-paths to handle path mapping based on the provided tsconfig.
525
+ *
526
+ * The TypeScript transpiler registration is done regardless of NX_PREFER_NODE_STRIP_TYPES.
527
+ * If you want to skip transpiler registration, it is recommended that you check `process.features.typescript`.
528
+ *
529
+ * @returns cleanup function
530
+ */
531
+ function registerTsProject(tsConfigPath) {
532
+ // See explanation alongside isInvokedByTsx declaration
533
+ if (isInvokedByTsx) {
534
+ return () => { };
535
+ }
536
+ const { compilerOptions, tsConfigRaw } = readCompilerOptions(tsConfigPath);
537
+ const cleanupFunctions = [
538
+ registerTsConfigPaths(tsConfigPath),
539
+ registerTranspiler(compilerOptions, tsConfigRaw),
540
+ ];
541
+ // Best-effort ESM loader registration so dynamic import() of .ts/.mts
542
+ // files goes through a transpiler. No-op if no ESM loader package is
543
+ // installed.
544
+ ensureEsmLoaderRegistered({ required: false });
545
+ // CJS-side fallback so NodeNext `.js` specifiers in `.ts` sources resolve
546
+ // to the matching `.ts` file when require()'d.
547
+ ensureCjsResolverPatched();
548
+ return () => {
549
+ for (const fn of cleanupFunctions) {
550
+ fn();
551
+ }
552
+ };
553
+ }
554
+ function getSwcTranspiler(compilerOptions) {
555
+ // These are requires to prevent it from registering when it shouldn't
556
+ const register = require('@swc-node/register/register')
557
+ .register;
558
+ const cleanupFn = register({
559
+ ...compilerOptions,
560
+ baseUrl: compilerOptions.baseUrl ?? './',
561
+ });
562
+ return typeof cleanupFn === 'function' ? cleanupFn : () => { };
563
+ }
564
+ function getTsNodeTranspiler(compilerOptions, tsNodeOptions, preferTsNode) {
565
+ const { register } = require('ts-node');
566
+ // ts-node doesn't provide a cleanup method
567
+ const service = register({
568
+ ...tsNodeOptions,
569
+ transpileOnly: true,
570
+ compilerOptions: getTsNodeCompilerOptions({
571
+ ...tsNodeOptions?.compilerOptions,
572
+ ...compilerOptions,
573
+ }),
574
+ // we already read and provide the compiler options, so prevent ts-node from reading them again
575
+ skipProject: true,
576
+ });
577
+ const { transpiler, swc } = service.options;
578
+ // Don't warn if a faster transpiler is enabled
579
+ if (!transpiler && !swc && !preferTsNode) {
580
+ warnTsNodeUsage();
581
+ }
582
+ return () => {
583
+ // Do not cleanup ts-node service since other consumers may need it
584
+ };
585
+ }
586
+ /**
587
+ * Given the raw "ts-node" sub-object from a tsconfig, return an object with only the properties
588
+ * recognized by "ts-node"
589
+ *
590
+ * Adapted from the function of the same name in ts-node
591
+ */
592
+ function filterRecognizedTsConfigTsNodeOptions(jsonObject) {
593
+ if (typeof jsonObject !== 'object' || jsonObject === null) {
594
+ return { recognized: {}, unrecognized: {} };
595
+ }
596
+ const { compiler, compilerHost, compilerOptions, emit, files, ignore, ignoreDiagnostics, logError, preferTsExts, pretty, require, skipIgnore, transpileOnly, typeCheck, transpiler, scope, scopeDir, moduleTypes, experimentalReplAwait, swc, experimentalResolver, esm, experimentalSpecifierResolution, experimentalTsImportSpecifiers, ...unrecognized } = jsonObject;
597
+ const filteredTsConfigOptions = {
598
+ compiler,
599
+ compilerHost,
600
+ compilerOptions,
601
+ emit,
602
+ experimentalReplAwait,
603
+ files,
604
+ ignore,
605
+ ignoreDiagnostics,
606
+ logError,
607
+ preferTsExts,
608
+ pretty,
609
+ require,
610
+ skipIgnore,
611
+ transpileOnly,
612
+ typeCheck,
613
+ transpiler,
614
+ scope,
615
+ scopeDir,
616
+ moduleTypes,
617
+ swc,
618
+ experimentalResolver,
619
+ esm,
620
+ experimentalSpecifierResolution,
621
+ experimentalTsImportSpecifiers,
622
+ };
623
+ // Use the typechecker to make sure this implementation has the correct set of properties
624
+ const catchExtraneousProps = null;
625
+ const catchMissingProps = null;
626
+ return { recognized: filteredTsConfigOptions, unrecognized };
627
+ }
628
+ const registered = new Map();
629
+ function getTranspiler(compilerOptions, tsConfigRaw) {
630
+ const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';
631
+ if (!ts) {
632
+ ts = require('typescript');
633
+ }
634
+ compilerOptions.lib = ['es2021'];
635
+ compilerOptions.module = ts.ModuleKind.CommonJS;
636
+ // use NodeJs module resolution until support for TS 4.x is dropped and then
637
+ // we can switch to Node10
638
+ compilerOptions.moduleResolution = ts.ModuleResolutionKind.NodeJs;
639
+ compilerOptions.customConditions = null;
640
+ compilerOptions.target = ts.ScriptTarget.ES2021;
641
+ compilerOptions.inlineSourceMap = true;
642
+ compilerOptions.skipLibCheck = true;
643
+ // TS 6 hard-errors on deprecated options set above (node10 moduleResolution);
644
+ // ignoreDeprecations exists since TS 5.0 but the value '6.0' is rejected by TS5 (TS5103).
645
+ if (parseInt(ts.versionMajorMinor, 10) >= 6) {
646
+ compilerOptions.ignoreDeprecations = '6.0';
647
+ }
648
+ // These options are different per project, and since they are not needed for transpilation, we can remove them so we have more cache hits.
649
+ compilerOptions.outDir = undefined;
650
+ compilerOptions.outFile = undefined;
651
+ compilerOptions.declaration = undefined;
652
+ compilerOptions.declarationMap = undefined;
653
+ compilerOptions.composite = undefined;
654
+ compilerOptions.tsBuildInfoFile = undefined;
655
+ delete compilerOptions.strict;
656
+ let _getTranspiler;
657
+ let registrationKey = JSON.stringify(compilerOptions);
658
+ let tsNodeOptions;
659
+ if (swcNodeInstalled && !preferTsNode) {
660
+ _getTranspiler = getSwcTranspiler;
661
+ }
662
+ else if (tsNodeInstalled) {
663
+ // We can fall back on ts-node if it's available
664
+ _getTranspiler = getTsNodeTranspiler;
665
+ tsNodeOptions = filterRecognizedTsConfigTsNodeOptions(tsConfigRaw?.['ts-node']).recognized;
666
+ // include ts-node options in the registration key
667
+ registrationKey += JSON.stringify(tsNodeOptions);
668
+ }
669
+ else {
670
+ _getTranspiler = undefined;
671
+ }
672
+ // Just return if transpiler was already registered before.
673
+ const registrationEntry = registered.get(registrationKey);
674
+ if (registered.has(registrationKey)) {
675
+ registrationEntry.refCount++;
676
+ return registrationEntry.cleanup;
677
+ }
678
+ if (_getTranspiler) {
679
+ const transpilerCleanup = _getTranspiler(compilerOptions, tsNodeOptions, preferTsNode);
680
+ const currRegistrationEntry = {
681
+ refCount: 1,
682
+ cleanup: () => {
683
+ return () => {
684
+ currRegistrationEntry.refCount--;
685
+ if (currRegistrationEntry.refCount === 0) {
686
+ registered.delete(registrationKey);
687
+ transpilerCleanup();
688
+ }
689
+ };
690
+ },
691
+ };
692
+ registered.set(registrationKey, currRegistrationEntry);
693
+ return currRegistrationEntry.cleanup;
694
+ }
695
+ }
696
+ /**
697
+ * Node.js throws this code when native type stripping hits an unsupported
698
+ * construct (enum, runtime namespace, legacy decorators, import = require,
699
+ * parameter properties on older Node, etc.).
700
+ *
701
+ * Exported for tests.
702
+ */
703
+ function isNativeTypeStripError(err) {
704
+ if (!err || typeof err !== 'object')
705
+ return false;
706
+ return (err.code === 'ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX');
707
+ }
708
+ /**
709
+ * Module resolution failures - typically a tsconfig path alias that hasn't
710
+ * been registered yet, or a workspace lib not surfaced via package manager
711
+ * symlinks. CJS uses `MODULE_NOT_FOUND`, ESM uses `ERR_MODULE_NOT_FOUND`.
712
+ */
713
+ function isModuleNotFoundError(err) {
714
+ if (!err || typeof err !== 'object')
715
+ return false;
716
+ const code = err.code;
717
+ return code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND';
718
+ }
719
+ /**
720
+ * A SyntaxError thrown while parsing a forced-CJS file (`.cts`/`.cjs`) as
721
+ * CommonJS - typically ESM syntax in a CJS file (e.g. `export default` in
722
+ * `.cts`). Pre-v23 this worked because swc-node's CJS hook compiled away the
723
+ * ESM syntax; under native strip swc-node isn't registered, so the file
724
+ * reaches Node's strict CJS parser. swc-node tolerates ESM syntax in `.cts`
725
+ * (`register()` forces `module: commonjs` regardless of extension), so
726
+ * escalating to the swc/ts-node fallback recovers the legacy behavior.
727
+ */
728
+ function isCjsSyntaxError(err, filePath) {
729
+ if (!(err instanceof SyntaxError))
730
+ return false;
731
+ return filePath.endsWith('.cts') || filePath.endsWith('.cjs');
732
+ }
733
+ /**
734
+ * A ReferenceError from Node treating a `.ts`/`.mts` file as ESM and the file
735
+ * relying on a CJS-only global: `require`, `__dirname`, or `__filename`.
736
+ * Pre-v23 swc-node compiled `.ts` to CJS where these globals exist; under
737
+ * native strip Node detects ESM via `import`/`export` syntax and these globals
738
+ * are undefined. Registering swc/ts-node compiles ESM->CJS and restores the
739
+ * legacy globals.
740
+ */
741
+ function isRequireInEsmScopeError(err, filePath) {
742
+ if (!(err instanceof ReferenceError))
743
+ return false;
744
+ if (!(filePath.endsWith('.ts') || filePath.endsWith('.mts')))
745
+ return false;
746
+ // Node's exact phrasing varies across versions / strip modes. Match the
747
+ // bare-name form too (e.g. `__dirname is not defined`) so the fallback
748
+ // still triggers when the trailing "in ES module scope" is absent.
749
+ const msg = err.message;
750
+ return /(require|__dirname|__filename) is not defined/.test(msg);
751
+ }
752
+ function isTsEsmSyntaxError(err, filePath) {
753
+ if (!(err instanceof SyntaxError))
754
+ return false;
755
+ if (!filePath.endsWith('.ts'))
756
+ return false;
757
+ // Node has multiple phrasings for ESM-in-CJS-scope syntax errors depending
758
+ // on whether the offending token is `import` or `export` and which parser
759
+ // path triggered: "Cannot use import statement outside a module" or
760
+ // "Unexpected token 'export'" / "Unexpected token 'import'". swc-node's
761
+ // CJS hook compiles ESM->CJS regardless of the surface error, so all of
762
+ // these should escalate to the same fallback.
763
+ const msg = err.message;
764
+ return (msg.includes('Cannot use import statement outside a module') ||
765
+ /Unexpected token ['"](export|import)['"]/.test(msg));
766
+ }
767
+ function isTsEsmNamedExportLinkageError(err, filePath) {
768
+ if (!(err instanceof SyntaxError))
769
+ return false;
770
+ return ((filePath.endsWith('.ts') || filePath.endsWith('.mts')) &&
771
+ err.message.includes('does not provide an export named'));
772
+ }
773
+ /**
774
+ * Hint appended to errors that the lazy fallback couldn't recover from.
775
+ * Points users at the env opt-out for cases native strip can't reach (e.g.
776
+ * ESM with top-level await + unsupported TS syntax, where swc-node's CJS
777
+ * Module._extensions hook can't intercept dynamic `import()`).
778
+ */
779
+ const NX_PREFER_NODE_STRIP_TYPES_DOCS_URL = 'https://nx.dev/docs/reference/environment-variables#nx-prefer-node-strip-types';
780
+ const STRIP_TYPES_OPT_OUT_HINT = `Set NX_PREFER_NODE_STRIP_TYPES=false to opt out of Node's native TypeScript stripping and use swc/ts-node instead. See ${NX_PREFER_NODE_STRIP_TYPES_DOCS_URL}`;
781
+ /**
782
+ * Load a TypeScript file via `require()`.
783
+ *
784
+ * When the runtime exposes native TypeScript stripping
785
+ * (`process.features.typescript`) and the user hasn't opted out via
786
+ * `NX_PREFER_NODE_STRIP_TYPES=false`, the file loads directly with no
787
+ * swc/ts-node and no tsconfig-paths registration. If Node throws on an
788
+ * unsupported construct (enum, runtime namespace, legacy decorators, etc.),
789
+ * this registers swc/ts-node + tsconfig-paths and retries - matching the
790
+ * pre-v23 registration. Set `NX_DISABLE_TSCONFIG_PATHS=true` to skip
791
+ * tsconfig-paths even on fallback (useful when relying on package manager
792
+ * workspaces). Set `NX_VERBOSE_LOGGING=true` to log when fallback triggers.
793
+ *
794
+ * When native strip is opted out (`NX_PREFER_NODE_STRIP_TYPES=false` or
795
+ * unsupported Node), uses the legacy `registerTsProject` path.
796
+ *
797
+ * `tsConfigPath` is only consulted on the swc/ts-node fallback path (for
798
+ * compilerOptions) and for tsconfig-paths registration. Native strip ignores
799
+ * it. When omitted, defaults to the workspace root tsconfig.
800
+ *
801
+ * Note on ESM: Node 22.12+ supports `require()` of synchronous ESM by default,
802
+ * so most ESM `.ts` configs load via this function without issue. Modules
803
+ * that use top-level await throw `ERR_REQUIRE_ASYNC_MODULE` and must be
804
+ * loaded with dynamic `import()` instead. `ERR_REQUIRE_ESM` (legacy code)
805
+ * bubbles unchanged for the rare case it still fires, so async-aware callers
806
+ * can dispatch to `import()`.
807
+ *
808
+ * @returns the loaded module
809
+ */
810
+ function loadTsFile(filePath, tsConfigPath) {
811
+ const resolvedTsConfigPath = tsConfigPath ?? (0, typescript_1.getRootTsConfigPath)();
812
+ if (isInvokedByTsx) {
813
+ return require(filePath);
814
+ }
815
+ if (!preferNodeStripTypes) {
816
+ if (!resolvedTsConfigPath) {
817
+ throw new Error(`${logger_1.NX_PREFIX} loadTsFile could not find a workspace tsconfig while loading ${filePath} on the swc/ts-node path. Pass an explicit tsConfigPath or add a tsconfig.base.json/tsconfig.json at the workspace root.`);
818
+ }
819
+ const cleanup = registerTsProject(resolvedTsConfigPath);
820
+ try {
821
+ return require(filePath);
822
+ }
823
+ finally {
824
+ cleanup();
825
+ }
826
+ }
827
+ // Native strip path: no registration up front. pnpm/npm/yarn workspaces
828
+ // resolve aliases without tsconfig-paths. On failure, lazy-register what
829
+ // the specific error code indicates is needed and retry:
830
+ // - MODULE_NOT_FOUND -> first try tsconfig-paths (alias resolution).
831
+ // If that still fails (e.g. extensionless `import './foo'` when
832
+ // `foo.ts` is adjacent - Node's resolver doesn't add `.ts`), escalate
833
+ // to swc/ts-node which handles `.ts` extension resolution.
834
+ // - ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX -> register swc/ts-node + tsconfig-paths
835
+ // Each registration kind runs at most once, so a file recovers in at
836
+ // most three attempts.
837
+ let pathsRegistered = false;
838
+ let transpilerRegistered = false;
839
+ const cleanups = [];
840
+ const registerTranspilerFallback = (err) => {
841
+ if (!swcNodeInstalled && !tsNodeInstalled) {
842
+ const original = err instanceof Error ? err.message : String(err);
843
+ throw new Error(`${logger_1.NX_PREFIX} ${filePath} could not be loaded under Node's native TypeScript stripping (${original}). Install @swc-node/register and @swc/core (or ts-node) to enable the swc/ts-node fallback, or ${STRIP_TYPES_OPT_OUT_HINT}`);
844
+ }
845
+ if (!resolvedTsConfigPath) {
846
+ throw new Error(`${logger_1.NX_PREFIX} ${filePath} requires the swc/ts-node fallback but no workspace tsconfig was found. Pass an explicit tsConfigPath or add a tsconfig.base.json/tsconfig.json at the workspace root. ${STRIP_TYPES_OPT_OUT_HINT}`);
847
+ }
848
+ if (!pathsRegistered && !disableTsConfigPaths) {
849
+ cleanups.push(registerTsConfigPaths(resolvedTsConfigPath));
850
+ pathsRegistered = true;
851
+ }
852
+ const { compilerOptions, tsConfigRaw } = readCompilerOptions(resolvedTsConfigPath);
853
+ cleanups.push(registerTranspiler(compilerOptions, tsConfigRaw));
854
+ transpilerRegistered = true;
855
+ };
856
+ try {
857
+ for (let attempt = 1;; attempt++) {
858
+ try {
859
+ if (attempt > 1) {
860
+ try {
861
+ delete require.cache[require.resolve(filePath)];
862
+ }
863
+ catch {
864
+ // require.resolve may throw if the failed load never reached cache
865
+ }
866
+ }
867
+ return require(filePath);
868
+ }
869
+ catch (err) {
870
+ // Cheap fallback first: register tsconfig-paths and retry.
871
+ if (isModuleNotFoundError(err) &&
872
+ !pathsRegistered &&
873
+ !disableTsConfigPaths &&
874
+ resolvedTsConfigPath) {
875
+ logFallback(filePath, err, 'Module not found; registering tsconfig-paths and retrying.');
876
+ cleanups.push(registerTsConfigPaths(resolvedTsConfigPath));
877
+ pathsRegistered = true;
878
+ continue;
879
+ }
880
+ // Heavy fallback: register swc/ts-node (+ paths) and retry. Triggered
881
+ // by:
882
+ // - strip-types failure (`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`)
883
+ // - module resolution failure that tsconfig-paths alone can't fix
884
+ // (extensionless `./foo` -> `./foo.ts`)
885
+ // - SyntaxError in a `.cts`/`.cjs` file (ESM syntax in a forced-CJS
886
+ // file). swc-node compiles ESM->CJS regardless of extension.
887
+ // - SyntaxError from Node parsing a `.ts` config with ESM syntax as
888
+ // CJS. swc/ts-node preserves the pre-v23 behavior for these files.
889
+ // - ReferenceError from Node treating a `.ts`/`.mts` config as ESM
890
+ // when it contains legacy CJS `require`.
891
+ // - SyntaxError from native ESM linkage when generated TS config
892
+ // imports a type-only symbol as a runtime named export.
893
+ if ((isNativeTypeStripError(err) ||
894
+ isModuleNotFoundError(err) ||
895
+ isCjsSyntaxError(err, filePath) ||
896
+ isTsEsmSyntaxError(err, filePath) ||
897
+ isRequireInEsmScopeError(err, filePath) ||
898
+ isTsEsmNamedExportLinkageError(err, filePath)) &&
899
+ !transpilerRegistered) {
900
+ logFallback(filePath, err, isNativeTypeStripError(err)
901
+ ? 'Native Node.js TypeScript stripping failed; falling back to swc/ts-node + tsconfig-paths.'
902
+ : isCjsSyntaxError(err, filePath)
903
+ ? 'ESM syntax in forced-CJS file; falling back to swc/ts-node + tsconfig-paths.'
904
+ : isTsEsmSyntaxError(err, filePath)
905
+ ? 'ESM syntax in TypeScript file parsed as CommonJS; falling back to swc/ts-node + tsconfig-paths.'
906
+ : isRequireInEsmScopeError(err, filePath)
907
+ ? 'CommonJS require in native ESM TypeScript file; falling back to swc/ts-node + tsconfig-paths.'
908
+ : isTsEsmNamedExportLinkageError(err, filePath)
909
+ ? 'Native ESM named export linkage failed; falling back to swc/ts-node + tsconfig-paths.'
910
+ : 'Module not found after tsconfig-paths; falling back to swc/ts-node + tsconfig-paths.');
911
+ registerTranspilerFallback(err);
912
+ continue;
913
+ }
914
+ throw augmentLoadFailure(filePath, err);
915
+ }
916
+ }
917
+ }
918
+ finally {
919
+ for (const fn of cleanups)
920
+ fn();
921
+ }
922
+ }
923
+ /**
924
+ * Plain `require()` with a lazy `tsconfig-paths` fallback. Use for files that
925
+ * are NOT TypeScript (no transpilation needed) but may still import workspace
926
+ * packages through TS path aliases (e.g. a `.js` changelog renderer that
927
+ * `require`s `@my-org/lib`).
928
+ *
929
+ * `tsconfig-paths` is only registered after the first `require()` fails with
930
+ * a module-resolution error, so workspaces that resolve aliases through
931
+ * package-manager symlinks pay nothing. Set `NX_DISABLE_TSCONFIG_PATHS=true`
932
+ * to skip the fallback entirely.
933
+ *
934
+ * @returns the loaded module
935
+ */
936
+ function requireWithTsconfigFallback(filePath, tsConfigPath) {
937
+ try {
938
+ return require(filePath);
939
+ }
940
+ catch (err) {
941
+ if (!isModuleNotFoundError(err) || disableTsConfigPaths) {
942
+ throw err;
943
+ }
944
+ const resolvedTsConfigPath = tsConfigPath ?? (0, typescript_1.getRootTsConfigPath)();
945
+ if (!resolvedTsConfigPath) {
946
+ throw err;
947
+ }
948
+ const cleanup = registerTsConfigPaths(resolvedTsConfigPath);
949
+ try {
950
+ delete require.cache[require.resolve(filePath)];
951
+ }
952
+ catch {
953
+ // require.resolve may throw if the failed load never reached cache
954
+ }
955
+ try {
956
+ return require(filePath);
957
+ }
958
+ finally {
959
+ cleanup();
960
+ }
961
+ }
962
+ }
963
+ /**
964
+ * Append the `NX_PREFER_NODE_STRIP_TYPES=false` opt-out hint so users know
965
+ * there's an escape hatch for cases native strip can't reach (e.g. ESM with
966
+ * top-level await + unsupported TS syntax). Skipped for:
967
+ * - ESM-redispatch signals callers expect to handle
968
+ * (`ERR_REQUIRE_ESM`, `ERR_REQUIRE_ASYNC_MODULE`)
969
+ * - plain module-resolution failures (`MODULE_NOT_FOUND`,
970
+ * `ERR_MODULE_NOT_FOUND`) - disabling strip-types doesn't fix a missing
971
+ * module, the hint just misleads.
972
+ */
973
+ function augmentLoadFailure(filePath, err) {
974
+ if (!(err instanceof Error))
975
+ return err;
976
+ const code = err.code;
977
+ if (code === 'ERR_REQUIRE_ESM' ||
978
+ code === 'ERR_REQUIRE_ASYNC_MODULE' ||
979
+ code === 'MODULE_NOT_FOUND' ||
980
+ code === 'ERR_MODULE_NOT_FOUND') {
981
+ return err;
982
+ }
983
+ if (err.message.includes(NX_PREFER_NODE_STRIP_TYPES_DOCS_URL)) {
984
+ return err;
985
+ }
986
+ err.message = `${err.message}\n\n${logger_1.NX_PREFIX} Failed to load ${filePath} under Node's native TypeScript stripping. ${STRIP_TYPES_OPT_OUT_HINT}`;
987
+ return err;
988
+ }
989
+ function logFallback(filePath, err, summary) {
990
+ if (process.env.NX_VERBOSE_LOGGING !== 'true') {
991
+ return;
992
+ }
993
+ const message = err instanceof Error ? err.message : String(err);
994
+ logger_1.logger.warn((0, logger_1.stripIndent)(`${logger_1.NX_PREFIX} ${summary} (${filePath})
995
+ ${message}`));
996
+ }
997
+ /**
998
+ * Register ts-node or swc-node given a set of compiler options.
999
+ *
1000
+ * Note: Several options require enums from typescript. To avoid importing typescript,
1001
+ * use import type + raw values
1002
+ *
1003
+ * @returns cleanup method
1004
+ */
1005
+ function registerTranspiler(compilerOptions, tsConfigRaw) {
1006
+ // Function to register transpiler that returns cleanup function
1007
+ const transpiler = getTranspiler(compilerOptions, tsConfigRaw);
1008
+ if (!transpiler) {
1009
+ // If Node.js natively supports TypeScript (22.6+), no transpiler is needed.
1010
+ // Don't warn - Node will handle .ts files via type stripping.
1011
+ if (!nodeSupportsNativeTypescript) {
1012
+ warnNoTranspiler();
1013
+ }
1014
+ return () => { };
1015
+ }
1016
+ return transpiler();
1017
+ }
1018
+ /**
1019
+ * @param tsConfigPath Adds the paths from a tsconfig file into node resolutions
1020
+ * @returns cleanup function
1021
+ */
1022
+ function registerTsConfigPaths(tsConfigPath) {
1023
+ try {
1024
+ /**
1025
+ * Load the ts config from the source project
1026
+ */
1027
+ const tsconfigPaths = loadTsConfigPaths();
1028
+ const tsConfigResult = tsconfigPaths.loadConfig(tsConfigPath);
1029
+ /**
1030
+ * Register the custom workspace path mappings with node so that workspace libraries
1031
+ * can be imported and used within project
1032
+ */
1033
+ if (tsConfigResult.resultType === 'success') {
1034
+ // Short-circuit when the tsconfig has no `paths` entries. Installing
1035
+ // tsconfig-paths' resolver hook adds a per-require cost on every
1036
+ // module load; in package-manager-workspace setups (which resolve via
1037
+ // symlinks instead of TS path mappings), the hook never has anything
1038
+ // to do. Avoid paying that overhead on workspaces that don't use
1039
+ // `paths`.
1040
+ if (!tsConfigResult.paths ||
1041
+ Object.keys(tsConfigResult.paths).length === 0) {
1042
+ return () => { };
1043
+ }
1044
+ return tsconfigPaths.register({
1045
+ baseUrl: resolvePathsBaseUrl(tsConfigPath),
1046
+ paths: tsConfigResult.paths,
1047
+ });
1048
+ }
1049
+ }
1050
+ catch (err) {
1051
+ if (err instanceof Error) {
1052
+ throw new Error(`Unable to load ${tsConfigPath}: ` + err.message);
1053
+ }
1054
+ }
1055
+ throw new Error(`Unable to load ${tsConfigPath}`);
1056
+ }
1057
+ function readCompilerOptions(tsConfigPath) {
1058
+ const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';
1059
+ if (swcNodeInstalled && !preferTsNode) {
1060
+ return {
1061
+ compilerOptions: readCompilerOptionsWithSwc(tsConfigPath),
1062
+ };
1063
+ }
1064
+ else {
1065
+ return readCompilerOptionsWithTypescript(tsConfigPath);
1066
+ }
1067
+ }
1068
+ function readCompilerOptionsWithSwc(tsConfigPath) {
1069
+ const { readDefaultTsConfig, } = require('@swc-node/register/read-default-tsconfig');
1070
+ const compilerOptions = readDefaultTsConfig(tsConfigPath);
1071
+ // This is returned in compiler options for some reason, but not part of the typings.
1072
+ // @swc-node/register filters the files to transpile based on it, but it can be limiting when processing
1073
+ // files not part of the received tsconfig included files (e.g. shared helpers, or config files not in source, etc.).
1074
+ delete compilerOptions.files;
1075
+ // @swc-node/register's readDefaultTsConfig auto-sets baseUrl to the
1076
+ // dirname of the tsconfig when not explicitly configured. This is incorrect
1077
+ // when paths are inherited via "extends" from a parent tsconfig at a
1078
+ // different directory level (e.g., tsconfig.base.json at workspace root),
1079
+ // because SWC will resolve "./"-prefixed paths relative to the wrong
1080
+ // directory. Use the workspace root as baseUrl in that case.
1081
+ // baseUrl will not be configured when using newer versions of TypeScript like `tsgo`.
1082
+ if (compilerOptions.paths) {
1083
+ const { options: tsOptions } = (0, typescript_1.readTsConfigWithoutFiles)(tsConfigPath);
1084
+ if (!tsOptions.baseUrl) {
1085
+ compilerOptions.baseUrl = workspace_root_1.workspaceRoot;
1086
+ }
1087
+ }
1088
+ return compilerOptions;
1089
+ }
1090
+ function readCompilerOptionsWithTypescript(tsConfigPath) {
1091
+ const { options, raw } = (0, typescript_1.readTsConfigWithoutFiles)(tsConfigPath);
1092
+ // This property is returned in compiler options for some reason, but not part of the typings.
1093
+ // ts-node fails on unknown props, so we have to remove it.
1094
+ delete options.configFilePath;
1095
+ return {
1096
+ compilerOptions: options,
1097
+ tsConfigRaw: raw,
1098
+ };
1099
+ }
1100
+ function loadTsConfigPaths() {
1101
+ try {
1102
+ return require('tsconfig-paths');
1103
+ }
1104
+ catch {
1105
+ warnNoTsconfigPaths();
1106
+ }
1107
+ }
1108
+ function warnTsNodeUsage() {
1109
+ logger_1.logger.warn((0, logger_1.stripIndent)(`${logger_1.NX_PREFIX} Falling back to ts-node for local typescript execution. This may be a little slower.
1110
+ - To fix this, ensure @swc-node/register and @swc/core have been installed`));
1111
+ }
1112
+ function warnNoTsconfigPaths() {
1113
+ logger_1.logger.warn((0, logger_1.stripIndent)(`${logger_1.NX_PREFIX} Unable to load tsconfig-paths, workspace libraries may be inaccessible.
1114
+ - To fix this, install tsconfig-paths with npm/yarn/pnpm`));
1115
+ }
1116
+ function warnNoTranspiler() {
1117
+ logger_1.logger.warn((0, logger_1.stripIndent)(`${logger_1.NX_PREFIX} Unable to locate swc-node or ts-node. Nx will be unable to run local ts files without transpiling.
1118
+ - To fix this, ensure @swc-node/register and @swc/core have been installed`));
1119
+ }
1120
+ function packageIsInstalled(m) {
1121
+ try {
1122
+ const p = require.resolve(m);
1123
+ return true;
1124
+ }
1125
+ catch {
1126
+ return false;
1127
+ }
1128
+ }
1129
+ /**
1130
+ * ts-node requires string values for enum based typescript options.
1131
+ * `register`'s signature just types the field as `object`, so we
1132
+ * unfortunately do not get any kind of type safety on this.
1133
+ */
1134
+ function getTsNodeCompilerOptions(compilerOptions) {
1135
+ if (!ts) {
1136
+ ts = require('typescript');
1137
+ }
1138
+ const flagMap = {
1139
+ module: 'ModuleKind',
1140
+ target: 'ScriptTarget',
1141
+ moduleDetection: 'ModuleDetectionKind',
1142
+ newLine: 'NewLineKind',
1143
+ moduleResolution: 'ModuleResolutionKind',
1144
+ importsNotUsedAsValues: 'ImportsNotUsedAsValues',
1145
+ };
1146
+ const result = {
1147
+ ...compilerOptions,
1148
+ };
1149
+ for (const flag in flagMap) {
1150
+ if (compilerOptions[flag]) {
1151
+ result[flag] = ts[flagMap[flag]][compilerOptions[flag]];
1152
+ }
1153
+ }
1154
+ delete result.pathsBasePath;
1155
+ delete result.configFilePath;
1156
+ // instead of mapping to enum value we just remove it as it shouldn't ever need to be set for ts-node
1157
+ delete result.jsx;
1158
+ // lib option is in the format `lib.es2022.d.ts`, so we need to remove the leading `lib.` and trailing `.d.ts` to make it valid
1159
+ result.lib = result.lib?.map((value) => {
1160
+ return value.replace(/^lib\./, '').replace(/\.d\.ts$/, '');
1161
+ });
1162
+ if (result.moduleResolution) {
1163
+ result.moduleResolution =
1164
+ result.moduleResolution === 'NodeJs'
1165
+ ? 'node'
1166
+ : result.moduleResolution.toLowerCase();
1167
+ }
1168
+ return result;
1169
+ }
1170
+ function resolvePathsBaseUrl(tsconfigPath) {
1171
+ const chain = [];
1172
+ const queue = [tsconfigPath];
1173
+ while (queue.length > 0) {
1174
+ const absolute = (0, path_1.resolve)(queue.shift());
1175
+ const dir = (0, path_1.dirname)(absolute);
1176
+ try {
1177
+ const raw = JSON.parse((0, fs_1.readFileSync)(absolute, 'utf-8'));
1178
+ chain.push({ dir, raw });
1179
+ const exts = raw.extends
1180
+ ? Array.isArray(raw.extends)
1181
+ ? raw.extends
1182
+ : [raw.extends]
1183
+ : [];
1184
+ for (const ext of exts) {
1185
+ const resolved = resolveExtendsPath(ext, dir);
1186
+ if (resolved) {
1187
+ queue.push(resolved);
1188
+ }
1189
+ }
1190
+ }
1191
+ catch {
1192
+ // skip unreadable files
1193
+ }
1194
+ }
1195
+ let pathsIndex = -1;
1196
+ for (let i = 0; i < chain.length; i++) {
1197
+ if (chain[i].raw.compilerOptions?.paths &&
1198
+ Object.keys(chain[i].raw.compilerOptions.paths).length > 0) {
1199
+ pathsIndex = i;
1200
+ break;
1201
+ }
1202
+ }
1203
+ const searchStart = pathsIndex >= 0 ? pathsIndex : 0;
1204
+ for (let i = searchStart; i < chain.length; i++) {
1205
+ if (chain[i].raw.compilerOptions?.baseUrl) {
1206
+ return (0, path_1.resolve)(chain[i].dir, chain[i].raw.compilerOptions.baseUrl);
1207
+ }
1208
+ }
1209
+ return pathsIndex >= 0
1210
+ ? chain[pathsIndex].dir
1211
+ : (0, path_1.dirname)((0, path_1.resolve)(tsconfigPath));
1212
+ }
1213
+ function resolveExtendsPath(ext, fromDir) {
1214
+ if (ext.startsWith('.') || (0, path_1.isAbsolute)(ext)) {
1215
+ let resolved = (0, path_1.resolve)(fromDir, ext);
1216
+ if ((0, fs_1.existsSync)(resolved))
1217
+ return resolved;
1218
+ if (!resolved.endsWith('.json')) {
1219
+ resolved += '.json';
1220
+ if ((0, fs_1.existsSync)(resolved))
1221
+ return resolved;
1222
+ }
1223
+ return null;
1224
+ }
1225
+ try {
1226
+ return require.resolve(ext, { paths: [fromDir] });
1227
+ }
1228
+ catch {
1229
+ try {
1230
+ return require.resolve(`${ext}/tsconfig.json`, { paths: [fromDir] });
1231
+ }
1232
+ catch {
1233
+ return null;
1234
+ }
1235
+ }
1236
+ }