@angular/cli 22.2.2 → 22.3.0-next.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 (377) hide show
  1. package/bin/ng.js +7 -10
  2. package/bin/version.js +98 -0
  3. package/index.d.ts +19 -0
  4. package/lib/chunk-5AASRQKS.js +85 -0
  5. package/lib/chunk-A2VIYA2E.js +165 -0
  6. package/lib/chunk-CAZUOCTC.js +225 -0
  7. package/lib/chunk-DHWVZMLH.js +206 -0
  8. package/lib/chunk-FZ5GFCWU.js +483 -0
  9. package/lib/chunk-G7TRU43D.js +42 -0
  10. package/lib/chunk-GHUUJYOY.js +40 -0
  11. package/lib/chunk-JBLF2TH3.js +267 -0
  12. package/lib/chunk-Q67GOPL7.js +380 -0
  13. package/lib/chunk-SN4KY4Z3.js +24 -0
  14. package/lib/chunk-XFL2J3CJ.js +24 -0
  15. package/lib/chunk-XG3HVNIL.js +59 -0
  16. package/lib/chunk-YM7ILCS5.js +2573 -0
  17. package/lib/cli/index.js +353 -105
  18. package/lib/cli-4CMZ6KMR.js +48 -0
  19. package/lib/cli-4Q7DGTBA.js +33 -0
  20. package/lib/cli-6AHY7ADW.js +96 -0
  21. package/lib/cli-A5UAJDO6.js +135 -0
  22. package/lib/cli-ACLGUIBI.js +2531 -0
  23. package/lib/cli-BQRFWIMG.js +35 -0
  24. package/lib/cli-CWICUPZW.js +42 -0
  25. package/lib/cli-DWQUM3M2.js +29 -0
  26. package/lib/cli-L4TM4JH3.js +88 -0
  27. package/lib/cli-LYBZEMDR.js +96 -0
  28. package/lib/cli-PDCEX7HQ.js +605 -0
  29. package/lib/cli-PJVTDBQM.js +51 -0
  30. package/lib/cli-PRIRL3WP.js +185 -0
  31. package/lib/cli-PU5VH7JB.js +189 -0
  32. package/lib/cli-QUH44NUB.js +68 -0
  33. package/lib/cli-VVITNTBC.js +50 -0
  34. package/lib/cli-XM4L4PP4.js +1651 -0
  35. package/lib/cli-Y2ECUR33.js +33 -0
  36. package/lib/cli-YDSMJOSO.js +182 -0
  37. package/lib/color-SJPGXZVA.js +8 -0
  38. package/lib/config/schema.json +204 -0
  39. package/lib/config-QXK7SSVG.js +22 -0
  40. package/lib/init.js +91 -180
  41. package/package.json +20 -15
  42. package/lib/cli/index.d.ts +0 -11
  43. package/lib/cli/index.js.map +0 -1
  44. package/lib/config/workspace-schema.d.ts +0 -1025
  45. package/lib/config/workspace-schema.js +0 -131
  46. package/lib/config/workspace-schema.js.map +0 -1
  47. package/lib/init.d.ts +0 -8
  48. package/lib/init.js.map +0 -1
  49. package/src/analytics/analytics-collector.d.ts +0 -35
  50. package/src/analytics/analytics-collector.js +0 -195
  51. package/src/analytics/analytics-collector.js.map +0 -1
  52. package/src/analytics/analytics-parameters.d.ts +0 -101
  53. package/src/analytics/analytics-parameters.js +0 -107
  54. package/src/analytics/analytics-parameters.js.map +0 -1
  55. package/src/analytics/analytics.d.ts +0 -27
  56. package/src/analytics/analytics.js +0 -183
  57. package/src/analytics/analytics.js.map +0 -1
  58. package/src/command-builder/architect-base-command-module.d.ts +0 -30
  59. package/src/command-builder/architect-base-command-module.js +0 -244
  60. package/src/command-builder/architect-base-command-module.js.map +0 -1
  61. package/src/command-builder/architect-command-module.d.ts +0 -28
  62. package/src/command-builder/architect-command-module.js +0 -218
  63. package/src/command-builder/architect-command-module.js.map +0 -1
  64. package/src/command-builder/command-module.d.ts +0 -73
  65. package/src/command-builder/command-module.js +0 -260
  66. package/src/command-builder/command-module.js.map +0 -1
  67. package/src/command-builder/command-runner.d.ts +0 -9
  68. package/src/command-builder/command-runner.js +0 -202
  69. package/src/command-builder/command-runner.js.map +0 -1
  70. package/src/command-builder/definitions.d.ts +0 -41
  71. package/src/command-builder/definitions.js +0 -20
  72. package/src/command-builder/definitions.js.map +0 -1
  73. package/src/command-builder/schematics-command-module.d.ts +0 -41
  74. package/src/command-builder/schematics-command-module.js +0 -408
  75. package/src/command-builder/schematics-command-module.js.map +0 -1
  76. package/src/command-builder/utilities/command.d.ts +0 -13
  77. package/src/command-builder/utilities/command.js +0 -39
  78. package/src/command-builder/utilities/command.js.map +0 -1
  79. package/src/command-builder/utilities/json-help.d.ts +0 -37
  80. package/src/command-builder/utilities/json-help.js +0 -92
  81. package/src/command-builder/utilities/json-help.js.map +0 -1
  82. package/src/command-builder/utilities/json-schema.d.ts +0 -64
  83. package/src/command-builder/utilities/json-schema.js +0 -349
  84. package/src/command-builder/utilities/json-schema.js.map +0 -1
  85. package/src/command-builder/utilities/normalize-options-middleware.d.ts +0 -18
  86. package/src/command-builder/utilities/normalize-options-middleware.js +0 -37
  87. package/src/command-builder/utilities/normalize-options-middleware.js.map +0 -1
  88. package/src/command-builder/utilities/schematic-engine-host.d.ts +0 -15
  89. package/src/command-builder/utilities/schematic-engine-host.js +0 -179
  90. package/src/command-builder/utilities/schematic-engine-host.js.map +0 -1
  91. package/src/command-builder/utilities/schematic-workflow.d.ts +0 -14
  92. package/src/command-builder/utilities/schematic-workflow.js +0 -70
  93. package/src/command-builder/utilities/schematic-workflow.js.map +0 -1
  94. package/src/commands/add/cli.d.ts +0 -41
  95. package/src/commands/add/cli.js +0 -705
  96. package/src/commands/add/cli.js.map +0 -1
  97. package/src/commands/add/long-description.md +0 -7
  98. package/src/commands/analytics/cli.d.ts +0 -16
  99. package/src/commands/analytics/cli.js +0 -34
  100. package/src/commands/analytics/cli.js.map +0 -1
  101. package/src/commands/analytics/info/cli.d.ts +0 -16
  102. package/src/commands/analytics/info/cli.js +0 -25
  103. package/src/commands/analytics/info/cli.js.map +0 -1
  104. package/src/commands/analytics/long-description.md +0 -20
  105. package/src/commands/analytics/settings/cli.d.ts +0 -35
  106. package/src/commands/analytics/settings/cli.js +0 -54
  107. package/src/commands/analytics/settings/cli.js.map +0 -1
  108. package/src/commands/build/cli.d.ts +0 -16
  109. package/src/commands/build/cli.js +0 -21
  110. package/src/commands/build/cli.js.map +0 -1
  111. package/src/commands/build/long-description.md +0 -18
  112. package/src/commands/cache/clean/cli.d.ts +0 -17
  113. package/src/commands/cache/clean/cli.js +0 -32
  114. package/src/commands/cache/clean/cli.js.map +0 -1
  115. package/src/commands/cache/cli.d.ts +0 -17
  116. package/src/commands/cache/cli.js +0 -36
  117. package/src/commands/cache/cli.js.map +0 -1
  118. package/src/commands/cache/info/cli.d.ts +0 -20
  119. package/src/commands/cache/info/cli.js +0 -139
  120. package/src/commands/cache/info/cli.js.map +0 -1
  121. package/src/commands/cache/long-description.md +0 -53
  122. package/src/commands/cache/settings/cli.d.ts +0 -27
  123. package/src/commands/cache/settings/cli.js +0 -41
  124. package/src/commands/cache/settings/cli.js.map +0 -1
  125. package/src/commands/cache/utilities.d.ts +0 -11
  126. package/src/commands/cache/utilities.js +0 -90
  127. package/src/commands/cache/utilities.js.map +0 -1
  128. package/src/commands/command-config.d.ts +0 -17
  129. package/src/commands/command-config.js +0 -116
  130. package/src/commands/command-config.js.map +0 -1
  131. package/src/commands/completion/cli.d.ts +0 -16
  132. package/src/commands/completion/cli.js +0 -61
  133. package/src/commands/completion/cli.js.map +0 -1
  134. package/src/commands/completion/long-description.md +0 -67
  135. package/src/commands/config/cli.d.ts +0 -24
  136. package/src/commands/config/cli.js +0 -150
  137. package/src/commands/config/cli.js.map +0 -1
  138. package/src/commands/config/long-description.md +0 -13
  139. package/src/commands/deploy/cli.d.ts +0 -17
  140. package/src/commands/deploy/cli.js +0 -38
  141. package/src/commands/deploy/cli.js.map +0 -1
  142. package/src/commands/deploy/long-description.md +0 -22
  143. package/src/commands/e2e/cli.d.ts +0 -18
  144. package/src/commands/e2e/cli.js +0 -42
  145. package/src/commands/e2e/cli.js.map +0 -1
  146. package/src/commands/extract-i18n/cli.d.ts +0 -17
  147. package/src/commands/extract-i18n/cli.js +0 -48
  148. package/src/commands/extract-i18n/cli.js.map +0 -1
  149. package/src/commands/generate/cli.d.ts +0 -47
  150. package/src/commands/generate/cli.js +0 -189
  151. package/src/commands/generate/cli.js.map +0 -1
  152. package/src/commands/lint/cli.d.ts +0 -17
  153. package/src/commands/lint/cli.js +0 -25
  154. package/src/commands/lint/cli.js.map +0 -1
  155. package/src/commands/lint/long-description.md +0 -20
  156. package/src/commands/make-this-awesome/cli.d.ts +0 -17
  157. package/src/commands/make-this-awesome/cli.js +0 -36
  158. package/src/commands/make-this-awesome/cli.js.map +0 -1
  159. package/src/commands/mcp/cli.d.ts +0 -21
  160. package/src/commands/mcp/cli.js +0 -74
  161. package/src/commands/mcp/cli.js.map +0 -1
  162. package/src/commands/mcp/constants.d.ts +0 -10
  163. package/src/commands/mcp/constants.js +0 -16
  164. package/src/commands/mcp/constants.js.map +0 -1
  165. package/src/commands/mcp/devserver.d.ts +0 -85
  166. package/src/commands/mcp/devserver.js +0 -109
  167. package/src/commands/mcp/devserver.js.map +0 -1
  168. package/src/commands/mcp/host.d.ts +0 -103
  169. package/src/commands/mcp/host.js +0 -270
  170. package/src/commands/mcp/host.js.map +0 -1
  171. package/src/commands/mcp/mcp-server.d.ts +0 -38
  172. package/src/commands/mcp/mcp-server.js +0 -176
  173. package/src/commands/mcp/mcp-server.js.map +0 -1
  174. package/src/commands/mcp/resources/ai-tutor.md +0 -822
  175. package/src/commands/mcp/resources/best-practices.md +0 -59
  176. package/src/commands/mcp/resources/instructions.d.ts +0 -9
  177. package/src/commands/mcp/resources/instructions.js +0 -26
  178. package/src/commands/mcp/resources/instructions.js.map +0 -1
  179. package/src/commands/mcp/shared-options.d.ts +0 -12
  180. package/src/commands/mcp/shared-options.js +0 -22
  181. package/src/commands/mcp/shared-options.js.map +0 -1
  182. package/src/commands/mcp/tools/ai-tutor.d.ts +0 -12
  183. package/src/commands/mcp/tools/ai-tutor.js +0 -59
  184. package/src/commands/mcp/tools/ai-tutor.js.map +0 -1
  185. package/src/commands/mcp/tools/best-practices.d.ts +0 -13
  186. package/src/commands/mcp/tools/best-practices.js +0 -196
  187. package/src/commands/mcp/tools/best-practices.js.map +0 -1
  188. package/src/commands/mcp/tools/devserver/devserver-start.d.ts +0 -32
  189. package/src/commands/mcp/tools/devserver/devserver-start.js +0 -110
  190. package/src/commands/mcp/tools/devserver/devserver-start.js.map +0 -1
  191. package/src/commands/mcp/tools/devserver/devserver-stop.d.ts +0 -31
  192. package/src/commands/mcp/tools/devserver/devserver-stop.js +0 -69
  193. package/src/commands/mcp/tools/devserver/devserver-stop.js.map +0 -1
  194. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.d.ts +0 -41
  195. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js +0 -105
  196. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js.map +0 -1
  197. package/src/commands/mcp/tools/doc-search.d.ts +0 -21
  198. package/src/commands/mcp/tools/doc-search.js +0 -307
  199. package/src/commands/mcp/tools/doc-search.js.map +0 -1
  200. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.d.ts +0 -17
  201. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js +0 -62
  202. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js.map +0 -1
  203. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.d.ts +0 -12
  204. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js +0 -70
  205. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js.map +0 -1
  206. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.d.ts +0 -12
  207. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js +0 -60
  208. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +0 -1
  209. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +0 -15
  210. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +0 -238
  211. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js.map +0 -1
  212. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.d.ts +0 -9
  213. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js +0 -14
  214. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js.map +0 -1
  215. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.d.ts +0 -36
  216. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js +0 -135
  217. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js.map +0 -1
  218. package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +0 -13
  219. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +0 -10
  220. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js.map +0 -1
  221. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +0 -16
  222. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +0 -215
  223. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +0 -1
  224. package/src/commands/mcp/tools/projects.d.ts +0 -48
  225. package/src/commands/mcp/tools/projects.js +0 -541
  226. package/src/commands/mcp/tools/projects.js.map +0 -1
  227. package/src/commands/mcp/tools/run-target/build-target-strategy.d.ts +0 -14
  228. package/src/commands/mcp/tools/run-target/build-target-strategy.js +0 -53
  229. package/src/commands/mcp/tools/run-target/build-target-strategy.js.map +0 -1
  230. package/src/commands/mcp/tools/run-target/generic-target-strategy.d.ts +0 -14
  231. package/src/commands/mcp/tools/run-target/generic-target-strategy.js +0 -63
  232. package/src/commands/mcp/tools/run-target/generic-target-strategy.js.map +0 -1
  233. package/src/commands/mcp/tools/run-target/options-serializer.d.ts +0 -13
  234. package/src/commands/mcp/tools/run-target/options-serializer.js +0 -41
  235. package/src/commands/mcp/tools/run-target/options-serializer.js.map +0 -1
  236. package/src/commands/mcp/tools/run-target/run-target.d.ts +0 -34
  237. package/src/commands/mcp/tools/run-target/run-target.js +0 -69
  238. package/src/commands/mcp/tools/run-target/run-target.js.map +0 -1
  239. package/src/commands/mcp/tools/run-target/strategy.d.ts +0 -15
  240. package/src/commands/mcp/tools/run-target/strategy.js +0 -10
  241. package/src/commands/mcp/tools/run-target/strategy.js.map +0 -1
  242. package/src/commands/mcp/tools/run-target/types.d.ts +0 -39
  243. package/src/commands/mcp/tools/run-target/types.js +0 -41
  244. package/src/commands/mcp/tools/run-target/types.js.map +0 -1
  245. package/src/commands/mcp/tools/run-target/unit-test-strategy.d.ts +0 -14
  246. package/src/commands/mcp/tools/run-target/unit-test-strategy.js +0 -56
  247. package/src/commands/mcp/tools/run-target/unit-test-strategy.js.map +0 -1
  248. package/src/commands/mcp/tools/tool-registry.d.ts +0 -40
  249. package/src/commands/mcp/tools/tool-registry.js +0 -40
  250. package/src/commands/mcp/tools/tool-registry.js.map +0 -1
  251. package/src/commands/mcp/utils.d.ts +0 -25
  252. package/src/commands/mcp/utils.js +0 -44
  253. package/src/commands/mcp/utils.js.map +0 -1
  254. package/src/commands/mcp/workspace-utils.d.ts +0 -55
  255. package/src/commands/mcp/workspace-utils.js +0 -181
  256. package/src/commands/mcp/workspace-utils.js.map +0 -1
  257. package/src/commands/new/cli.d.ts +0 -27
  258. package/src/commands/new/cli.js +0 -76
  259. package/src/commands/new/cli.js.map +0 -1
  260. package/src/commands/new/long-description.md +0 -15
  261. package/src/commands/run/cli.d.ts +0 -25
  262. package/src/commands/run/cli.js +0 -89
  263. package/src/commands/run/cli.js.map +0 -1
  264. package/src/commands/run/long-description.md +0 -10
  265. package/src/commands/serve/cli.d.ts +0 -16
  266. package/src/commands/serve/cli.js +0 -20
  267. package/src/commands/serve/cli.js.map +0 -1
  268. package/src/commands/test/cli.d.ts +0 -16
  269. package/src/commands/test/cli.js +0 -21
  270. package/src/commands/test/cli.js.map +0 -1
  271. package/src/commands/test/long-description.md +0 -2
  272. package/src/commands/update/cli.d.ts +0 -50
  273. package/src/commands/update/cli.js +0 -586
  274. package/src/commands/update/cli.js.map +0 -1
  275. package/src/commands/update/long-description.md +0 -22
  276. package/src/commands/update/update-resolver.d.ts +0 -75
  277. package/src/commands/update/update-resolver.js +0 -918
  278. package/src/commands/update/update-resolver.js.map +0 -1
  279. package/src/commands/update/utilities/cli-version.d.ts +0 -48
  280. package/src/commands/update/utilities/cli-version.js +0 -196
  281. package/src/commands/update/utilities/cli-version.js.map +0 -1
  282. package/src/commands/update/utilities/constants.d.ts +0 -12
  283. package/src/commands/update/utilities/constants.js +0 -16
  284. package/src/commands/update/utilities/constants.js.map +0 -1
  285. package/src/commands/update/utilities/git.d.ts +0 -36
  286. package/src/commands/update/utilities/git.js +0 -148
  287. package/src/commands/update/utilities/git.js.map +0 -1
  288. package/src/commands/update/utilities/migration.d.ts +0 -32
  289. package/src/commands/update/utilities/migration.js +0 -271
  290. package/src/commands/update/utilities/migration.js.map +0 -1
  291. package/src/commands/version/cli.d.ts +0 -36
  292. package/src/commands/version/cli.js +0 -117
  293. package/src/commands/version/cli.js.map +0 -1
  294. package/src/commands/version/version-info.d.ts +0 -46
  295. package/src/commands/version/version-info.js +0 -101
  296. package/src/commands/version/version-info.js.map +0 -1
  297. package/src/package-managers/discovery.d.ts +0 -23
  298. package/src/package-managers/discovery.js +0 -104
  299. package/src/package-managers/discovery.js.map +0 -1
  300. package/src/package-managers/error.d.ts +0 -43
  301. package/src/package-managers/error.js +0 -41
  302. package/src/package-managers/error.js.map +0 -1
  303. package/src/package-managers/factory.d.ts +0 -30
  304. package/src/package-managers/factory.js +0 -137
  305. package/src/package-managers/factory.js.map +0 -1
  306. package/src/package-managers/host.d.ts +0 -86
  307. package/src/package-managers/host.js +0 -91
  308. package/src/package-managers/host.js.map +0 -1
  309. package/src/package-managers/index.d.ts +0 -13
  310. package/src/package-managers/index.js +0 -17
  311. package/src/package-managers/index.js.map +0 -1
  312. package/src/package-managers/logger.d.ts +0 -27
  313. package/src/package-managers/logger.js +0 -10
  314. package/src/package-managers/logger.js.map +0 -1
  315. package/src/package-managers/package-manager-descriptor.d.ts +0 -269
  316. package/src/package-managers/package-manager-descriptor.js +0 -210
  317. package/src/package-managers/package-manager-descriptor.js.map +0 -1
  318. package/src/package-managers/package-manager.d.ts +0 -200
  319. package/src/package-managers/package-manager.js +0 -720
  320. package/src/package-managers/package-manager.js.map +0 -1
  321. package/src/package-managers/package-metadata.d.ts +0 -91
  322. package/src/package-managers/package-metadata.js +0 -10
  323. package/src/package-managers/package-metadata.js.map +0 -1
  324. package/src/package-managers/package-tree.d.ts +0 -23
  325. package/src/package-managers/package-tree.js +0 -10
  326. package/src/package-managers/package-tree.js.map +0 -1
  327. package/src/package-managers/parsers.d.ts +0 -167
  328. package/src/package-managers/parsers.js +0 -674
  329. package/src/package-managers/parsers.js.map +0 -1
  330. package/src/utilities/color.d.ts +0 -23
  331. package/src/utilities/color.js +0 -41
  332. package/src/utilities/color.js.map +0 -1
  333. package/src/utilities/completion.d.ts +0 -30
  334. package/src/utilities/completion.js +0 -270
  335. package/src/utilities/completion.js.map +0 -1
  336. package/src/utilities/config.d.ts +0 -38
  337. package/src/utilities/config.js +0 -368
  338. package/src/utilities/config.js.map +0 -1
  339. package/src/utilities/environment-options.d.ts +0 -25
  340. package/src/utilities/environment-options.js +0 -60
  341. package/src/utilities/environment-options.js.map +0 -1
  342. package/src/utilities/eol.d.ts +0 -20
  343. package/src/utilities/eol.js +0 -35
  344. package/src/utilities/eol.js.map +0 -1
  345. package/src/utilities/error.d.ts +0 -18
  346. package/src/utilities/error.js +0 -41
  347. package/src/utilities/error.js.map +0 -1
  348. package/src/utilities/find-up.d.ts +0 -21
  349. package/src/utilities/find-up.js +0 -67
  350. package/src/utilities/find-up.js.map +0 -1
  351. package/src/utilities/json-file.d.ts +0 -24
  352. package/src/utilities/json-file.js +0 -179
  353. package/src/utilities/json-file.js.map +0 -1
  354. package/src/utilities/log-file.d.ts +0 -13
  355. package/src/utilities/log-file.js +0 -28
  356. package/src/utilities/log-file.js.map +0 -1
  357. package/src/utilities/memoize.d.ts +0 -15
  358. package/src/utilities/memoize.js +0 -64
  359. package/src/utilities/memoize.js.map +0 -1
  360. package/src/utilities/node-version.d.ts +0 -21
  361. package/src/utilities/node-version.js +0 -65
  362. package/src/utilities/node-version.js.map +0 -1
  363. package/src/utilities/prettier.d.ts +0 -19
  364. package/src/utilities/prettier.js +0 -105
  365. package/src/utilities/prettier.js.map +0 -1
  366. package/src/utilities/project.d.ts +0 -8
  367. package/src/utilities/project.js +0 -81
  368. package/src/utilities/project.js.map +0 -1
  369. package/src/utilities/prompt.d.ts +0 -17
  370. package/src/utilities/prompt.js +0 -90
  371. package/src/utilities/prompt.js.map +0 -1
  372. package/src/utilities/tty.d.ts +0 -16
  373. package/src/utilities/tty.js +0 -23
  374. package/src/utilities/tty.js.map +0 -1
  375. package/src/utilities/version.d.ts +0 -16
  376. package/src/utilities/version.js +0 -26
  377. package/src/utilities/version.js.map +0 -1
package/lib/cli/index.js CHANGED
@@ -1,113 +1,361 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.VERSION = void 0;
11
- exports.default = default_1;
12
- const core_1 = require("@angular-devkit/core");
13
- const node_util_1 = require("node:util");
14
- const command_module_1 = require("../../src/command-builder/command-module");
15
- const command_runner_1 = require("../../src/command-builder/command-runner");
16
- const color_1 = require("../../src/utilities/color");
17
- const environment_options_1 = require("../../src/utilities/environment-options");
18
- const log_file_1 = require("../../src/utilities/log-file");
19
- const node_version_1 = require("../../src/utilities/node-version");
20
- var version_1 = require("../../src/utilities/version");
21
- Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
22
- /* eslint-disable no-console */
23
- async function default_1(options) {
24
- // This node version check ensures that the requirements of the project instance of the CLI are met
25
- if (!(0, node_version_1.isNodeVersionMinSupported)()) {
26
- process.stderr.write(`Node.js version ${process.version} detected.\n` +
27
- `The Angular CLI requires a minimum of v${node_version_1.supportedNodeVersions[0]}.\n\n` +
28
- 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n');
29
- return 3;
1
+ import {
2
+ writeErrorToLogFile
3
+ } from "../chunk-SN4KY4Z3.js";
4
+ import {
5
+ isNodeVersionMinSupported,
6
+ supportedNodeVersions
7
+ } from "../chunk-XFL2J3CJ.js";
8
+ import {
9
+ RootCommands,
10
+ RootCommandsAliases
11
+ } from "../chunk-5AASRQKS.js";
12
+ import {
13
+ getCacheConfig
14
+ } from "../chunk-A2VIYA2E.js";
15
+ import {
16
+ addCommandModuleToYargs,
17
+ demandCommandFailureMessage
18
+ } from "../chunk-G7TRU43D.js";
19
+ import {
20
+ CommandModuleError,
21
+ createPackageManager
22
+ } from "../chunk-YM7ILCS5.js";
23
+ import {
24
+ VERSION,
25
+ ngDebug
26
+ } from "../chunk-XG3HVNIL.js";
27
+ import {
28
+ colors,
29
+ supportColor
30
+ } from "../chunk-GHUUJYOY.js";
31
+ import {
32
+ assertIsError,
33
+ getProjectByCwd,
34
+ getWorkspace
35
+ } from "../chunk-FZ5GFCWU.js";
36
+
37
+ // packages/angular/cli/lib/cli/index.js
38
+ import { logging } from "@angular-devkit/core";
39
+ import { format, stripVTControlCharacters } from "node:util";
40
+
41
+ // packages/angular/cli/src/command-builder/command-runner.js
42
+ import { isJsonObject } from "@angular-devkit/core";
43
+ import { readFile } from "node:fs/promises";
44
+ import { join } from "node:path";
45
+ import yargs from "yargs";
46
+ import { Parser as yargsParser } from "yargs/helpers";
47
+
48
+ // packages/angular/cli/src/command-builder/utilities/json-help.js
49
+ var yargsDefaultCommandRegExp = /^\$0|\*/;
50
+ function jsonHelpUsage(localYargs) {
51
+ const localYargsInstance = localYargs;
52
+ const { deprecatedOptions, alias: aliases, array, string, boolean, number, choices, demandedOptions, default: defaultVal, hiddenOptions = [] } = localYargsInstance.getOptions();
53
+ const internalMethods = localYargsInstance.getInternalMethods();
54
+ const usageInstance = internalMethods.getUsageInstance();
55
+ const context = internalMethods.getContext();
56
+ const descriptions = usageInstance.getDescriptions();
57
+ const groups = localYargsInstance.getGroups();
58
+ const positional = groups[usageInstance.getPositionalGroupName()];
59
+ const seen = /* @__PURE__ */ new Set();
60
+ const hidden = new Set(hiddenOptions);
61
+ const normalizeOptions = [];
62
+ const allAliases = /* @__PURE__ */ new Set([...Object.values(aliases).flat()]);
63
+ for (const [names, type] of [
64
+ [number, "number"],
65
+ [array, "array"],
66
+ [string, "string"],
67
+ [boolean, "boolean"]
68
+ ]) {
69
+ for (const name of names) {
70
+ if (allAliases.has(name) || hidden.has(name) || seen.has(name)) {
71
+ continue;
72
+ }
73
+ seen.add(name);
74
+ const positionalIndex = positional?.indexOf(name) ?? -1;
75
+ const alias = aliases[name];
76
+ normalizeOptions.push({
77
+ name,
78
+ type,
79
+ deprecated: deprecatedOptions[name],
80
+ aliases: alias?.length > 0 ? alias : void 0,
81
+ default: defaultVal[name],
82
+ required: demandedOptions[name],
83
+ enum: choices[name],
84
+ description: descriptions[name]?.replace("__yargsString__:", ""),
85
+ positional: positionalIndex >= 0 ? positionalIndex : void 0
86
+ });
30
87
  }
31
- const colorLevels = {
32
- info: (s) => s,
33
- debug: (s) => s,
34
- warn: (s) => color_1.colors.bold(color_1.colors.yellow(s)),
35
- error: (s) => color_1.colors.bold(color_1.colors.red(s)),
36
- fatal: (s) => color_1.colors.bold(color_1.colors.red(s)),
37
- };
38
- const logger = new core_1.logging.IndentLogger('cli-main-logger');
39
- const logInfo = console.log;
40
- const logWarn = console.warn;
41
- const logError = console.error;
42
- const useColor = (0, color_1.supportColor)();
43
- const loggerFinished = logger.forEach((entry) => {
44
- if (!environment_options_1.ngDebug && entry.level === 'debug') {
45
- return;
46
- }
47
- const color = useColor ? colorLevels[entry.level] : node_util_1.stripVTControlCharacters;
48
- const message = color(entry.message);
49
- switch (entry.level) {
50
- case 'warn':
51
- case 'fatal':
52
- case 'error':
53
- logError(message);
54
- break;
55
- default:
56
- logInfo(message);
57
- break;
58
- }
59
- });
60
- // Redirect console to logger
61
- console.info = console.log = function (...args) {
62
- logger.info((0, node_util_1.format)(...args));
88
+ }
89
+ const subcommands = usageInstance.getCommands().map(([name, rawDescription2, isDefault, aliases2, deprecated]) => ({
90
+ name: name.split(" ", 1)[0].replace(yargsDefaultCommandRegExp, ""),
91
+ command: name.replace(yargsDefaultCommandRegExp, ""),
92
+ default: isDefault || void 0,
93
+ ...parseDescription(rawDescription2),
94
+ aliases: aliases2,
95
+ deprecated
96
+ })).sort((a, b) => a.name.localeCompare(b.name));
97
+ const [command, rawDescription] = usageInstance.getUsage()[0] ?? [];
98
+ const defaultSubCommand = subcommands.find((x) => x.default)?.command ?? "";
99
+ const otherSubcommands = subcommands.filter((s) => !s.default);
100
+ const output = {
101
+ name: [...context.commands].pop(),
102
+ command: `${command?.replace(yargsDefaultCommandRegExp, localYargsInstance["$0"])}${defaultSubCommand}`,
103
+ ...parseDescription(rawDescription),
104
+ options: normalizeOptions.sort((a, b) => a.name.localeCompare(b.name)),
105
+ subcommands: otherSubcommands.length ? otherSubcommands : void 0
106
+ };
107
+ return JSON.stringify(output, void 0, 2);
108
+ }
109
+ function parseDescription(rawDescription) {
110
+ try {
111
+ const { longDescription, describe: shortDescription, longDescriptionRelativePath } = JSON.parse(rawDescription);
112
+ return {
113
+ shortDescription,
114
+ longDescriptionRelativePath,
115
+ longDescription
63
116
  };
64
- console.warn = function (...args) {
65
- logger.warn((0, node_util_1.format)(...args));
117
+ } catch {
118
+ return {
119
+ shortDescription: rawDescription
66
120
  };
67
- console.error = function (...args) {
68
- logger.error((0, node_util_1.format)(...args));
121
+ }
122
+ }
123
+
124
+ // packages/angular/cli/src/command-builder/utilities/normalize-options-middleware.js
125
+ function createNormalizeOptionsMiddleware(localeYargs) {
126
+ return (args) => {
127
+ const { array } = localeYargs.getOptions();
128
+ const arrayOptions = new Set(array);
129
+ for (const [key, value] of Object.entries(args)) {
130
+ if (key !== "_" && Array.isArray(value) && !arrayOptions.has(key)) {
131
+ const newValue = value.pop();
132
+ console.warn(`Option '${key}' has been specified multiple times. The value '${newValue}' will be used.`);
133
+ args[key] = newValue;
134
+ }
135
+ }
136
+ };
137
+ }
138
+
139
+ // packages/angular/cli/src/command-builder/command-runner.js
140
+ async function runCommand(args, logger) {
141
+ const { $0, _, help = false, dryRun = false, jsonHelp = false, getYargsCompletions = false, ...rest } = yargsParser(args, {
142
+ boolean: ["help", "json-help", "get-yargs-completions", "dry-run"],
143
+ alias: { "collection": "c" }
144
+ });
145
+ const positional = getYargsCompletions ? _.slice(1) : _;
146
+ let workspace;
147
+ let globalConfiguration;
148
+ try {
149
+ [workspace, globalConfiguration] = await Promise.all([
150
+ getWorkspace("local"),
151
+ getWorkspace("global")
152
+ ]);
153
+ } catch (e) {
154
+ assertIsError(e);
155
+ logger.fatal(e.message);
156
+ return 1;
157
+ }
158
+ const root = workspace?.basePath ?? process.cwd();
159
+ const cacheConfig = workspace && getCacheConfig(workspace);
160
+ const packageManager = await createPackageManager({
161
+ cwd: root,
162
+ logger,
163
+ dryRun: dryRun || help || jsonHelp || getYargsCompletions,
164
+ tempDirectory: cacheConfig?.enabled ? cacheConfig.path : void 0,
165
+ configuredPackageManager: await getConfiguredPackageManager(root, workspace, globalConfiguration)
166
+ });
167
+ const localYargs = yargs(args);
168
+ const context = {
169
+ globalConfiguration,
170
+ workspace,
171
+ logger,
172
+ currentDirectory: process.cwd(),
173
+ yargsInstance: localYargs,
174
+ root,
175
+ packageManager,
176
+ args: {
177
+ positional: positional.map((v) => v.toString()),
178
+ options: {
179
+ help,
180
+ jsonHelp,
181
+ getYargsCompletions,
182
+ ...rest
183
+ }
184
+ }
185
+ };
186
+ for (const CommandModule of await getCommandsToRegister(positional[0])) {
187
+ addCommandModuleToYargs(CommandModule, context);
188
+ }
189
+ const usageInstance = localYargs.getInternalMethods().getUsageInstance();
190
+ if (jsonHelp) {
191
+ usageInstance.help = () => jsonHelpUsage(localYargs);
192
+ } else if (!help) {
193
+ usageInstance.cacheHelpMessage = () => {
69
194
  };
70
- try {
71
- return await (0, command_runner_1.runCommand)(options.cliArgs, logger);
195
+ }
196
+ localYargs.command("*", false, (builder) => builder.version("version", "Show Angular CLI version.", VERSION.full));
197
+ await localYargs.scriptName("ng").parserConfiguration({
198
+ "populate--": true,
199
+ "unknown-options-as-args": false,
200
+ "dot-notation": false,
201
+ "boolean-negation": true,
202
+ "strip-aliased": true,
203
+ "strip-dashed": true,
204
+ "camel-case-expansion": false
205
+ }).option("json-help", {
206
+ describe: "Show help in JSON format.",
207
+ implies: ["help"],
208
+ hidden: true,
209
+ type: "boolean"
210
+ }).help("help", "Shows a help message for this command in the console.").updateStrings({
211
+ "Commands:": colors.cyan("Commands:"),
212
+ "Options:": colors.cyan("Options:"),
213
+ "Positionals:": colors.cyan("Arguments:"),
214
+ "deprecated": colors.yellow("deprecated"),
215
+ "deprecated: %s": colors.yellow("deprecated:") + " %s",
216
+ "Did you mean %s?": "Unknown command. Did you mean %s?"
217
+ }).epilogue("For more information, see https://angular.dev/cli/.\n").demandCommand(1, demandCommandFailureMessage).recommendCommands().middleware(createNormalizeOptionsMiddleware(localYargs)).version(false).showHelpOnFail(false).strict().fail((msg, err) => {
218
+ throw msg ? (
219
+ // Validation failed example: `Unknown argument:`
220
+ new CommandModuleError(msg)
221
+ ) : (
222
+ // Unknown exception, re-throw.
223
+ err
224
+ );
225
+ }).wrap(localYargs.terminalWidth()).parseAsync();
226
+ return +(process.exitCode ?? 0);
227
+ }
228
+ async function getCommandsToRegister(commandName) {
229
+ const commands = [];
230
+ if (commandName in RootCommands) {
231
+ commands.push(RootCommands[commandName]);
232
+ } else if (commandName in RootCommandsAliases) {
233
+ commands.push(RootCommandsAliases[commandName]);
234
+ } else {
235
+ Object.values(RootCommands).forEach((c) => commands.push(c));
236
+ }
237
+ return Promise.all(commands.map((command) => command.factory().then((m) => m.default)));
238
+ }
239
+ async function getConfiguredPackageManager(root, localWorkspace, globalWorkspace) {
240
+ let result;
241
+ try {
242
+ const packageJsonPath = join(root, "package.json");
243
+ const pkgJson = JSON.parse(await readFile(packageJsonPath, "utf-8"));
244
+ result = getPackageManager(pkgJson);
245
+ } catch {
246
+ }
247
+ if (result) {
248
+ return result;
249
+ }
250
+ if (localWorkspace) {
251
+ const project = getProjectByCwd(localWorkspace);
252
+ if (project) {
253
+ result = getPackageManager(localWorkspace.projects.get(project)?.extensions["cli"]);
72
254
  }
73
- catch (err) {
74
- if (err instanceof command_module_1.CommandModuleError) {
75
- logger.fatal(`Error: ${err.message}`);
76
- }
77
- else if (err instanceof Error) {
78
- try {
79
- const logPath = (0, log_file_1.writeErrorToLogFile)(err);
80
- logger.fatal(`An unhandled exception occurred: ${err.message}\n` +
81
- `See "${logPath}" for further details.`);
82
- }
83
- catch (e) {
84
- logger.fatal(`An unhandled exception occurred: ${err.message}\n` +
85
- `Fatal error writing debug log file: ${e}`);
86
- if (err.stack) {
87
- logger.fatal(err.stack);
88
- }
89
- }
90
- return 127;
91
- }
92
- else if (typeof err === 'string') {
93
- logger.fatal(err);
94
- }
95
- else if (typeof err === 'number') {
96
- // Log nothing.
97
- }
98
- else {
99
- logger.fatal(`An unexpected error occurred: ${err}`);
100
- }
101
- return 1;
255
+ result ??= getPackageManager(localWorkspace.extensions["cli"]);
256
+ }
257
+ result ??= getPackageManager(globalWorkspace.extensions["cli"]);
258
+ return result;
259
+ }
260
+ function getPackageManager(source) {
261
+ if (source && isJsonObject(source)) {
262
+ const value = source["packageManager"];
263
+ if (typeof value === "string") {
264
+ return value.split("@", 2);
265
+ }
266
+ }
267
+ return void 0;
268
+ }
269
+
270
+ // packages/angular/cli/lib/cli/index.js
271
+ async function execute(options) {
272
+ if (!isNodeVersionMinSupported()) {
273
+ process.stderr.write(`Node.js version ${process.version} detected.
274
+ The Angular CLI requires a minimum of v${supportedNodeVersions[0]}.
275
+
276
+ Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
277
+ `);
278
+ return 3;
279
+ }
280
+ const colorLevels = {
281
+ info: (s) => s,
282
+ debug: (s) => s,
283
+ warn: (s) => colors.bold(colors.yellow(s)),
284
+ error: (s) => colors.bold(colors.red(s)),
285
+ fatal: (s) => colors.bold(colors.red(s))
286
+ };
287
+ const logger = new logging.IndentLogger("cli-main-logger");
288
+ const logInfo = console.log;
289
+ const logWarn = console.warn;
290
+ const logError = console.error;
291
+ const useColor = supportColor();
292
+ const loggerFinished = logger.forEach((entry) => {
293
+ if (!ngDebug && entry.level === "debug") {
294
+ return;
102
295
  }
103
- finally {
104
- logger.complete();
105
- await loggerFinished;
106
- // Restore original console methods so that late consumers
107
- // (e.g. process.on('exit') handlers) still produce output.
108
- console.log = console.info = logInfo;
109
- console.warn = logWarn;
110
- console.error = logError;
296
+ const color = useColor ? colorLevels[entry.level] : stripVTControlCharacters;
297
+ const message = color(entry.message);
298
+ switch (entry.level) {
299
+ case "warn":
300
+ case "fatal":
301
+ case "error":
302
+ logError(message);
303
+ break;
304
+ default:
305
+ logInfo(message);
306
+ break;
111
307
  }
308
+ });
309
+ console.info = console.log = function(...args) {
310
+ logger.info(format(...args));
311
+ };
312
+ console.warn = function(...args) {
313
+ logger.warn(format(...args));
314
+ };
315
+ console.error = function(...args) {
316
+ logger.error(format(...args));
317
+ };
318
+ try {
319
+ return await runCommand(options.cliArgs, logger);
320
+ } catch (err) {
321
+ if (err instanceof CommandModuleError) {
322
+ logger.fatal(`Error: ${err.message}`);
323
+ } else if (err instanceof Error) {
324
+ try {
325
+ const logPath = writeErrorToLogFile(err);
326
+ logger.fatal(`An unhandled exception occurred: ${err.message}
327
+ See "${logPath}" for further details.`);
328
+ } catch (e) {
329
+ logger.fatal(`An unhandled exception occurred: ${err.message}
330
+ Fatal error writing debug log file: ${e}`);
331
+ if (err.stack) {
332
+ logger.fatal(err.stack);
333
+ }
334
+ }
335
+ return 127;
336
+ } else if (typeof err === "string") {
337
+ logger.fatal(err);
338
+ } else if (typeof err === "number") {
339
+ } else {
340
+ logger.fatal(`An unexpected error occurred: ${err}`);
341
+ }
342
+ return 1;
343
+ } finally {
344
+ logger.complete();
345
+ await loggerFinished;
346
+ console.log = console.info = logInfo;
347
+ console.warn = logWarn;
348
+ console.error = logError;
349
+ }
112
350
  }
113
- //# sourceMappingURL=index.js.map
351
+ export {
352
+ VERSION,
353
+ execute as default
354
+ };
355
+ /**
356
+ * @license
357
+ * Copyright Google LLC All Rights Reserved.
358
+ *
359
+ * Use of this source code is governed by an MIT-style license that can be
360
+ * found in the LICENSE file at https://angular.dev/license
361
+ */
@@ -0,0 +1,48 @@
1
+ import {
2
+ ArchitectCommandModule
3
+ } from "./chunk-CAZUOCTC.js";
4
+ import "./chunk-DHWVZMLH.js";
5
+ import "./chunk-YM7ILCS5.js";
6
+ import "./chunk-XG3HVNIL.js";
7
+ import "./chunk-GHUUJYOY.js";
8
+ import "./chunk-FZ5GFCWU.js";
9
+
10
+ // packages/angular/cli/src/commands/deploy/long-description.md
11
+ var long_description_default = 'The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.\nWhen a project name is not supplied, executes the `deploy` builder for the default project.\n\nTo use the `ng deploy` command, use `ng add` to add a package that implements deployment capabilities to your favorite platform.\nAdding the package automatically updates your workspace configuration, adding a deployment\n[CLI builder](tools/cli/cli-builder).\nFor example:\n\n```json\n"projects": {\n "my-project": {\n ...\n "architect": {\n ...\n "deploy": {\n "builder": "@angular/fire:deploy",\n "options": {}\n }\n }\n }\n}\n```\n';
12
+
13
+ // packages/angular/cli/src/commands/deploy/cli.js
14
+ var DeployCommandModule = class extends ArchitectCommandModule {
15
+ // The below choices should be kept in sync with the list in https://angular.dev/tools/cli/deployment
16
+ missingTargetChoices = [
17
+ {
18
+ name: "Amazon S3",
19
+ value: "@jefiozie/ngx-aws-deploy"
20
+ },
21
+ {
22
+ name: "Firebase",
23
+ value: "@angular/fire"
24
+ },
25
+ {
26
+ name: "Netlify",
27
+ value: "@netlify-builder/deploy"
28
+ },
29
+ {
30
+ name: "GitHub Pages",
31
+ value: "angular-cli-ghpages"
32
+ }
33
+ ];
34
+ multiTarget = false;
35
+ command = "deploy [project]";
36
+ longDescription = long_description_default;
37
+ describe = "Invokes the deploy builder for a specified project or for the default project in the workspace.";
38
+ };
39
+ export {
40
+ DeployCommandModule as default
41
+ };
42
+ /**
43
+ * @license
44
+ * Copyright Google LLC All Rights Reserved.
45
+ *
46
+ * Use of this source code is governed by an MIT-style license that can be
47
+ * found in the LICENSE file at https://angular.dev/license
48
+ */
@@ -0,0 +1,33 @@
1
+ import {
2
+ ArchitectCommandModule
3
+ } from "./chunk-CAZUOCTC.js";
4
+ import "./chunk-DHWVZMLH.js";
5
+ import {
6
+ RootCommands
7
+ } from "./chunk-5AASRQKS.js";
8
+ import "./chunk-YM7ILCS5.js";
9
+ import "./chunk-XG3HVNIL.js";
10
+ import "./chunk-GHUUJYOY.js";
11
+ import "./chunk-FZ5GFCWU.js";
12
+
13
+ // packages/angular/cli/src/commands/test/long-description.md
14
+ var long_description_default = "Takes the name of the project, as specified in the `projects` section of the `angular.json` workspace configuration file.\nWhen a project name is not supplied, it will execute for all projects.\n";
15
+
16
+ // packages/angular/cli/src/commands/test/cli.js
17
+ var TestCommandModule = class extends ArchitectCommandModule {
18
+ multiTarget = true;
19
+ command = "test [project]";
20
+ aliases = RootCommands["test"].aliases;
21
+ describe = "Runs unit tests in a project.";
22
+ longDescription = long_description_default;
23
+ };
24
+ export {
25
+ TestCommandModule as default
26
+ };
27
+ /**
28
+ * @license
29
+ * Copyright Google LLC All Rights Reserved.
30
+ *
31
+ * Use of this source code is governed by an MIT-style license that can be
32
+ * found in the LICENSE file at https://angular.dev/license
33
+ */
@@ -0,0 +1,96 @@
1
+ import {
2
+ ArchitectBaseCommandModule
3
+ } from "./chunk-DHWVZMLH.js";
4
+ import {
5
+ CommandModuleError,
6
+ CommandScope
7
+ } from "./chunk-YM7ILCS5.js";
8
+ import "./chunk-XG3HVNIL.js";
9
+ import "./chunk-GHUUJYOY.js";
10
+ import "./chunk-FZ5GFCWU.js";
11
+
12
+ // packages/angular/cli/src/commands/run/long-description.md
13
+ var long_description_default = "Architect is the tool that the CLI uses to perform complex tasks such as compilation, according to provided configurations.\nThe CLI commands run Architect targets such as `build`, `serve`, `test`, and `lint`.\nEach named target has a default configuration, specified by an `options` object,\nand an optional set of named alternate configurations in the `configurations` object.\n\nFor example, the `serve` target for a newly generated app has a predefined\nalternate configuration named `production`.\n\nYou can define new targets and their configuration options in the `architect` section\nof the `angular.json` file which you can run them from the command line using the `ng run` command.\n";
14
+
15
+ // packages/angular/cli/src/commands/run/cli.js
16
+ var RunCommandModule = class extends ArchitectBaseCommandModule {
17
+ scope = CommandScope.In;
18
+ command = "run <target>";
19
+ describe = "Runs an Architect target with an optional custom builder configuration defined in your project.";
20
+ longDescription = long_description_default;
21
+ async builder(argv) {
22
+ const { jsonHelp, getYargsCompletions, help } = this.context.args.options;
23
+ const localYargs = argv.positional("target", {
24
+ describe: "The Architect target to run provided in the following format `project:target[:configuration]`.",
25
+ type: "string",
26
+ demandOption: true,
27
+ // Show only in when using --help and auto completion because otherwise comma seperated configuration values will be invalid.
28
+ // Also, hide choices from JSON help so that we don't display them in AIO.
29
+ choices: (getYargsCompletions || help) && !jsonHelp ? this.getTargetChoices() : void 0
30
+ }).middleware((args) => {
31
+ const { configuration, target: target2 } = args;
32
+ if (typeof configuration === "string" && target2) {
33
+ const targetWithConfig = target2.split(":", 2);
34
+ targetWithConfig.push(configuration);
35
+ throw new CommandModuleError(`Unknown argument: configuration.
36
+ Provide the configuration as part of the target 'ng run ${targetWithConfig.join(":")}'.`);
37
+ }
38
+ }, true).strict();
39
+ const target = this.makeTargetSpecifier();
40
+ if (!target) {
41
+ return localYargs;
42
+ }
43
+ const schemaOptions = await this.getArchitectTargetOptions(target);
44
+ return this.addSchemaOptionsToCommand(localYargs, schemaOptions);
45
+ }
46
+ async run(options) {
47
+ const target = this.makeTargetSpecifier(options);
48
+ const { target: _target, ...extraOptions } = options;
49
+ if (!target) {
50
+ throw new CommandModuleError("Cannot determine project or target.");
51
+ }
52
+ return this.runSingleTarget(target, extraOptions);
53
+ }
54
+ makeTargetSpecifier(options) {
55
+ const architectTarget = options?.target ?? this.context.args.positional[1];
56
+ if (!architectTarget) {
57
+ return void 0;
58
+ }
59
+ const [project = "", target = "", configuration] = architectTarget.split(":");
60
+ return {
61
+ project,
62
+ target,
63
+ configuration
64
+ };
65
+ }
66
+ /** @returns a sorted list of target specifiers to be used for auto completion. */
67
+ getTargetChoices() {
68
+ if (!this.context.workspace) {
69
+ return;
70
+ }
71
+ const targets = [];
72
+ for (const [projectName, project] of this.context.workspace.projects) {
73
+ for (const [targetName, target] of project.targets) {
74
+ const currentTarget = `${projectName}:${targetName}`;
75
+ targets.push(currentTarget);
76
+ if (!target.configurations) {
77
+ continue;
78
+ }
79
+ for (const configName of Object.keys(target.configurations)) {
80
+ targets.push(`${currentTarget}:${configName}`);
81
+ }
82
+ }
83
+ }
84
+ return targets.sort();
85
+ }
86
+ };
87
+ export {
88
+ RunCommandModule as default
89
+ };
90
+ /**
91
+ * @license
92
+ * Copyright Google LLC All Rights Reserved.
93
+ *
94
+ * Use of this source code is governed by an MIT-style license that can be
95
+ * found in the LICENSE file at https://angular.dev/license
96
+ */