@angular/cli 22.2.0 → 22.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +210 -6
  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 -85
  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 -211
  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
@@ -1,104 +0,0 @@
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.discover = discover;
11
- /**
12
- * @fileoverview This file contains the logic for discovering the package manager
13
- * used in a project by searching for lockfiles. It is designed to be efficient
14
- * and to correctly handle monorepo structures.
15
- */
16
- const node_path_1 = require("node:path");
17
- const package_manager_descriptor_1 = require("./package-manager-descriptor");
18
- /**
19
- * Searches a directory for lockfiles and returns a set of package managers that correspond to them.
20
- * @param host A `Host` instance for interacting with the file system.
21
- * @param directory The directory to search.
22
- * @param logger An optional logger instance.
23
- * @returns A promise that resolves to a set of package manager names.
24
- */
25
- async function findLockfiles(host, directory, logger) {
26
- logger?.debug(`Searching for lockfiles in '${directory}'...`);
27
- const foundPackageManagers = new Set();
28
- const checks = [];
29
- for (const [name, descriptor] of Object.entries(package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS)) {
30
- const manager = name;
31
- for (const lockfile of descriptor.lockfiles) {
32
- checks.push((async () => {
33
- try {
34
- const path = (0, node_path_1.join)(directory, lockfile);
35
- const stats = await host.stat(path);
36
- if (stats.isFile()) {
37
- logger?.debug(` Found '${lockfile}'.`);
38
- foundPackageManagers.add(manager);
39
- }
40
- }
41
- catch {
42
- // File does not exist or cannot be accessed.
43
- }
44
- })());
45
- }
46
- }
47
- await Promise.all(checks);
48
- return foundPackageManagers;
49
- }
50
- /**
51
- * Checks if a given path is a directory.
52
- * @param host A `Host` instance for interacting with the file system.
53
- * @param path The path to check.
54
- * @returns A promise that resolves to true if the path is a directory, false otherwise.
55
- */
56
- async function isDirectory(host, path) {
57
- try {
58
- return (await host.stat(path)).isDirectory();
59
- }
60
- catch {
61
- return false;
62
- }
63
- }
64
- /**
65
- * Discovers the package manager used in a project by searching for lockfiles.
66
- *
67
- * This function searches for lockfiles in the given directory and its ancestors.
68
- * If multiple lockfiles are found, it uses the precedence array to determine
69
- * which package manager to use. The search is bounded by the git repository root.
70
- *
71
- * @param host A `Host` instance for interacting with the file system.
72
- * @param startDir The directory to start the search from.
73
- * @param logger An optional logger instance.
74
- * @returns A promise that resolves to the name of the discovered package manager, or null if none is found.
75
- */
76
- async function discover(host, startDir, logger) {
77
- logger?.debug(`Starting package manager discovery in '${startDir}'...`);
78
- let currentDir = startDir;
79
- while (true) {
80
- const found = await findLockfiles(host, currentDir, logger);
81
- if (found.size > 0) {
82
- logger?.debug(`Found lockfile(s): [${[...found].join(', ')}]. Applying precedence...`);
83
- for (const packageManager of package_manager_descriptor_1.PACKAGE_MANAGER_PRECEDENCE) {
84
- if (found.has(packageManager)) {
85
- logger?.debug(`Selected '${packageManager}' based on precedence.`);
86
- return packageManager;
87
- }
88
- }
89
- }
90
- // Stop searching if we reach the git repository root.
91
- if (await isDirectory(host, (0, node_path_1.join)(currentDir, '.git'))) {
92
- logger?.debug(`Reached repository root at '${currentDir}'. Stopping search.`);
93
- return null;
94
- }
95
- const parentDir = (0, node_path_1.dirname)(currentDir);
96
- if (parentDir === currentDir) {
97
- // We have reached the filesystem root.
98
- logger?.debug('Reached filesystem root. No lockfile found.');
99
- return null;
100
- }
101
- currentDir = parentDir;
102
- }
103
- }
104
- //# sourceMappingURL=discovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discovery.js","sourceRoot":"","sources":["discovery.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAqFH,4BAuCC;AA1HD;;;;GAIG;AAEH,yCAA0C;AAG1C,6EAIsC;AAEtC;;;;;;GAMG;AACH,KAAK,UAAU,aAAa,CAC1B,IAAU,EACV,SAAiB,EACjB,MAAe;IAEf,MAAM,EAAE,KAAK,CAAC,+BAA+B,SAAS,MAAM,CAAC,CAAC;IAE9D,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC3D,MAAM,MAAM,GAAoB,EAAE,CAAC;IAEnC,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uDAA0B,CAAC,EAAE,CAAC;QAC5E,MAAM,OAAO,GAAG,IAA0B,CAAC;QAC3C,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CACT,CAAC,KAAK,IAAI,EAAE;gBACV,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;oBACvC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpC,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;wBACnB,MAAM,EAAE,KAAK,CAAC,YAAY,QAAQ,IAAI,CAAC,CAAC;wBACxC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;oBACpC,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,6CAA6C;gBAC/C,CAAC;YACH,CAAC,CAAC,EAAE,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAA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AAG,IAAA,mBAAO,EAAC,UAAU,CAAC,CAAC;QACtC,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC7B,uCAAuC;YACvC,MAAM,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAE7D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- /**
9
- * @fileoverview This file defines a custom error class for the package manager
10
- * abstraction. This allows for structured error handling and provides consumers
11
- * with detailed information about the process failure.
12
- */
13
- /**
14
- * A custom error class for package manager-related errors.
15
- *
16
- * This error class provides structured data about the failed process,
17
- * including stdout, stderr, and the exit code.
18
- */
19
- export declare class PackageManagerError extends Error {
20
- readonly stdout: string;
21
- readonly stderr: string;
22
- readonly exitCode: number | null;
23
- /**
24
- * Creates a new `PackageManagerError` instance.
25
- * @param message The error message.
26
- * @param stdout The standard output of the failed process.
27
- * @param stderr The standard error of the failed process.
28
- * @param exitCode The exit code of the failed process.
29
- */
30
- constructor(message: string, stdout: string, stderr: string, exitCode: number | null);
31
- }
32
- /**
33
- * Represents structured information about an error returned by a package manager command.
34
- * This is a data interface, not an `Error` subclass.
35
- */
36
- export interface ErrorInfo {
37
- /** A specific error code (e.g. 'E404', 'EACCES'). */
38
- readonly code: string;
39
- /** A short, human-readable summary of the error. */
40
- readonly summary: string;
41
- /** An optional, detailed description of the error. */
42
- readonly detail?: string;
43
- }
@@ -1,41 +0,0 @@
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.PackageManagerError = void 0;
11
- /**
12
- * @fileoverview This file defines a custom error class for the package manager
13
- * abstraction. This allows for structured error handling and provides consumers
14
- * with detailed information about the process failure.
15
- */
16
- /**
17
- * A custom error class for package manager-related errors.
18
- *
19
- * This error class provides structured data about the failed process,
20
- * including stdout, stderr, and the exit code.
21
- */
22
- class PackageManagerError extends Error {
23
- stdout;
24
- stderr;
25
- exitCode;
26
- /**
27
- * Creates a new `PackageManagerError` instance.
28
- * @param message The error message.
29
- * @param stdout The standard output of the failed process.
30
- * @param stderr The standard error of the failed process.
31
- * @param exitCode The exit code of the failed process.
32
- */
33
- constructor(message, stdout, stderr, exitCode) {
34
- super(message);
35
- this.stdout = stdout;
36
- this.stderr = stderr;
37
- this.exitCode = exitCode;
38
- }
39
- }
40
- exports.PackageManagerError = PackageManagerError;
41
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["error.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,KAAK;IAU1B;IACA;IACA;IAXlB;;;;;;OAMG;IACH,YACE,OAAe,EACC,MAAc,EACd,MAAc,EACd,QAAuB;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAe;IAGzC,CAAC;CACF;AAhBD,kDAgBC"}
@@ -1,30 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { Logger } from './logger';
9
- import { PackageManager } from './package-manager';
10
- import { PackageManagerName } from './package-manager-descriptor';
11
- /**
12
- * Information about the package manager to use for a given project.
13
- */
14
- export type ConfiguredPackageManagerInfo = [name?: PackageManagerName, version?: string];
15
- /**
16
- * Creates a new `PackageManager` instance for a given project.
17
- *
18
- * This function is the main entry point for the package manager abstraction.
19
- * It will determine, verify, and instantiate the correct package manager.
20
- *
21
- * @param options An object containing the options for creating the package manager.
22
- * @returns A promise that resolves to a new `PackageManager` instance.
23
- */
24
- export declare function createPackageManager(options: {
25
- cwd: string;
26
- configuredPackageManager?: ConfiguredPackageManagerInfo;
27
- logger?: Logger;
28
- dryRun?: boolean;
29
- tempDirectory?: string;
30
- }): Promise<PackageManager>;
@@ -1,137 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.createPackageManager = createPackageManager;
14
- const strict_1 = __importDefault(require("node:assert/strict"));
15
- const semver_1 = require("semver");
16
- const discovery_1 = require("./discovery");
17
- const host_1 = require("./host");
18
- const package_manager_1 = require("./package-manager");
19
- const package_manager_descriptor_1 = require("./package-manager-descriptor");
20
- /**
21
- * The default package manager to use when none is discovered or configured.
22
- */
23
- const DEFAULT_PACKAGE_MANAGER = 'npm';
24
- /**
25
- * Gets the version of the package manager.
26
- * @param host A `Host` instance for running commands.
27
- * @param cwd The absolute path to the working directory.
28
- * @param name The name of the package manager.
29
- * @param logger An optional logger instance.
30
- * @returns A promise that resolves to the version string.
31
- */
32
- async function getPackageManagerVersion(host, cwd, name, logger) {
33
- const descriptor = package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS[name];
34
- logger?.debug(`Getting ${name} version...`);
35
- const { stdout } = await host.runCommand(descriptor.binary, descriptor.versionCommand, { cwd });
36
- const version = stdout.trim();
37
- logger?.debug(`${name} version is '${version}'.`);
38
- return version;
39
- }
40
- /**
41
- * Determines the package manager to use for a given project.
42
- *
43
- * This function will determine the package manager by checking for a configured
44
- * package manager, discovering the package manager from lockfiles, or falling
45
- * back to a default. It also handles differentiation between yarn classic and modern.
46
- *
47
- * @param host A `Host` instance for interacting with the file system and running commands.
48
- * @param cwd The directory to start the search from.
49
- * @param configured An optional, explicitly configured package manager.
50
- * @param logger An optional logger instance.
51
- * @returns A promise that resolves to an object containing the name and source of the package manager.
52
- */
53
- async function determinePackageManager(host, cwd, configured = [], logger, dryRun) {
54
- let [name, version] = configured;
55
- let source;
56
- if (name) {
57
- source = 'configured';
58
- logger?.debug(`Using configured package manager: '${name}'.`);
59
- }
60
- else {
61
- const discovered = await (0, discovery_1.discover)(host, cwd, logger);
62
- if (discovered) {
63
- name = discovered;
64
- source = 'discovered';
65
- logger?.debug(`Discovered package manager: '${name}'.`);
66
- }
67
- else {
68
- name = DEFAULT_PACKAGE_MANAGER;
69
- source = 'default';
70
- logger?.debug(`No lockfile found. Using default package manager: '${DEFAULT_PACKAGE_MANAGER}'.`);
71
- }
72
- }
73
- if (name === 'yarn' && !dryRun) {
74
- strict_1.default.deepStrictEqual(package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS.yarn.versionCommand, package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS['yarn-classic'].versionCommand, 'Yarn and Yarn Classic version commands must match for detection logic to be valid.');
75
- try {
76
- version ??= await getPackageManagerVersion(host, cwd, name, logger);
77
- if (version && (0, semver_1.major)(version) < 2) {
78
- name = 'yarn-classic';
79
- logger?.debug(`Detected yarn classic. Using 'yarn-classic'.`);
80
- }
81
- }
82
- catch {
83
- logger?.debug('Failed to get yarn version.');
84
- }
85
- }
86
- else if (name === 'yarn') {
87
- logger?.debug('Skipping yarn version check due to dry run. Assuming modern yarn.');
88
- }
89
- return { name, source, version };
90
- }
91
- /**
92
- * Creates a new `PackageManager` instance for a given project.
93
- *
94
- * This function is the main entry point for the package manager abstraction.
95
- * It will determine, verify, and instantiate the correct package manager.
96
- *
97
- * @param options An object containing the options for creating the package manager.
98
- * @returns A promise that resolves to a new `PackageManager` instance.
99
- */
100
- async function createPackageManager(options) {
101
- const { cwd, configuredPackageManager, logger, dryRun, tempDirectory } = options;
102
- const host = host_1.NodeJS_HOST;
103
- const result = await determinePackageManager(host, cwd, configuredPackageManager, logger, dryRun);
104
- const { name, source } = result;
105
- let { version } = result;
106
- const descriptor = package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS[name];
107
- if (!descriptor) {
108
- throw new Error(`Unsupported package manager: "${name}"`);
109
- }
110
- // Do not verify if the package manager is installed during a dry run.
111
- let initializationError;
112
- if (!dryRun && !version) {
113
- try {
114
- version = await getPackageManagerVersion(host, cwd, name, logger);
115
- }
116
- catch {
117
- if (source === 'default') {
118
- initializationError = new Error(`'${DEFAULT_PACKAGE_MANAGER}' was selected as the default package manager, but it is not installed or` +
119
- ` cannot be found in the PATH. Please install '${DEFAULT_PACKAGE_MANAGER}' to continue.`);
120
- }
121
- else {
122
- initializationError = new Error(`The project is configured to use '${name}', but it is not installed or cannot be` +
123
- ` found in the PATH. Please install '${name}' to continue.`);
124
- }
125
- }
126
- }
127
- const packageManager = new package_manager_1.PackageManager(host, cwd, descriptor, {
128
- dryRun,
129
- logger,
130
- tempDirectory,
131
- version,
132
- initializationError,
133
- });
134
- logger?.debug(`Successfully created PackageManager for '${name}'.`);
135
- return packageManager;
136
- }
137
- //# sourceMappingURL=factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["factory.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAyHH,oDAkDC;AAzKD,gEAAwC;AACxC,mCAA+B;AAC/B,2CAAuC;AACvC,iCAA2C;AAE3C,uDAAmD;AACnD,6EAA8F;AAO9F;;GAEG;AACH,MAAM,uBAAuB,GAAuB,KAAK,CAAC;AAE1D;;;;;;;GAOG;AACH,KAAK,UAAU,wBAAwB,CACrC,IAAU,EACV,GAAW,EACX,IAAwB,EACxB,MAAe;IAEf,MAAM,UAAU,GAAG,uDAA0B,CAAC,I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I,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,sEAAsE;IACtE,IAAI,mBAAsC,CAAC;IAC3C,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACpE,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,mBAAmB,GAAG,IAAI,KAAK,CAC7B,IAAI,uBAAuB,2EAA2E;oBACpG,iDAAiD,uBAAuB,gBAAgB,CAC3F,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,mBAAmB,GAAG,IAAI,KAAK,CAC7B,qCAAqC,IAAI,yCAAyC;oBAChF,uCAAuC,IAAI,gBAAgB,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE;QAC/D,MAAM;QACN,MAAM;QACN,aAAa;QACb,OAAO;QACP,mBAAmB;KACpB,CAAC,CAAC;IAEH,MAAM,EAAE,KAAK,CAAC,4CAA4C,IAAI,IAAI,CAAC,CAAC;IAEpE,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -1,86 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { Stats } from 'node:fs';
9
- /**
10
- * An abstraction layer for side-effectful operations.
11
- */
12
- export interface Host {
13
- /**
14
- * Whether shell quoting is required for package manager specifiers.
15
- * This is typically true on Windows, where commands are executed in a shell.
16
- */
17
- readonly requiresQuoting?: boolean;
18
- /**
19
- * Creates a directory.
20
- * @param path The path to the directory.
21
- * @param options Options for the directory creation.
22
- * @returns A promise that resolves when the directory is created.
23
- */
24
- mkdir(path: string, options?: {
25
- recursive?: boolean;
26
- }): Promise<string | undefined>;
27
- /**
28
- * Gets the stats of a file or directory.
29
- * @param path The path to the file or directory.
30
- * @returns A promise that resolves to the stats.
31
- */
32
- stat(path: string): Promise<Stats>;
33
- /**
34
- * Reads the content of a file.
35
- * @param path The path to the file.
36
- * @returns A promise that resolves to the file content as a string.
37
- */
38
- readFile(path: string): Promise<string>;
39
- /**
40
- * Copies a file from the source path to the destination path.
41
- * @param src The path to the source file.
42
- * @param dest The path to the destination file.
43
- * @returns A promise that resolves when the copy is complete.
44
- */
45
- copyFile(src: string, dest: string): Promise<void>;
46
- /**
47
- * Creates a new, unique temporary directory.
48
- * @param baseDir The base directory in which to create the temporary directory.
49
- * @returns A promise that resolves to the absolute path of the created directory.
50
- */
51
- createTempDirectory(baseDir?: string): Promise<string>;
52
- /**
53
- * Deletes a directory recursively.
54
- * @param path The path to the directory to delete.
55
- * @returns A promise that resolves when the deletion is complete.
56
- */
57
- deleteDirectory(path: string): Promise<void>;
58
- /**
59
- * Writes content to a file.
60
- * @param path The path to the file.
61
- * @param content The content to write.
62
- * @returns A promise that resolves when the write is complete.
63
- */
64
- writeFile(path: string, content: string): Promise<void>;
65
- /**
66
- * Spawns a child process and returns a promise that resolves with the process's
67
- * output or rejects with a structured error.
68
- * @param command The command to run.
69
- * @param args The arguments to pass to the command.
70
- * @param options Options for the child process.
71
- * @returns A promise that resolves with the standard output and standard error of the command.
72
- */
73
- runCommand(command: string, args: readonly string[], options?: {
74
- timeout?: number;
75
- stdio?: 'pipe' | 'ignore';
76
- cwd?: string;
77
- env?: Record<string, string>;
78
- }): Promise<{
79
- stdout: string;
80
- stderr: string;
81
- }>;
82
- }
83
- /**
84
- * A concrete implementation of the `Host` interface that uses the Node.js APIs.
85
- */
86
- export declare const NodeJS_HOST: Host;
@@ -1,91 +0,0 @@
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.NodeJS_HOST = void 0;
11
- /**
12
- * @fileoverview
13
- * This file defines an abstraction layer for side-effectful operations, such as
14
- * file system access and command execution. This allows for easier testing by
15
- * enabling the injection of mock or test-specific implementations.
16
- */
17
- const node_child_process_1 = require("node:child_process");
18
- const node_fs_1 = require("node:fs");
19
- const promises_1 = require("node:fs/promises");
20
- const node_os_1 = require("node:os");
21
- const node_path_1 = require("node:path");
22
- const error_1 = require("./error");
23
- /**
24
- * A concrete implementation of the `Host` interface that uses the Node.js APIs.
25
- */
26
- exports.NodeJS_HOST = {
27
- stat: promises_1.stat,
28
- requiresQuoting: (0, node_os_1.platform)() === 'win32',
29
- mkdir: promises_1.mkdir,
30
- readFile: (path) => (0, promises_1.readFile)(path, { encoding: 'utf8' }),
31
- copyFile: (src, dest) => (0, promises_1.copyFile)(src, dest, node_fs_1.constants.COPYFILE_FICLONE),
32
- writeFile: promises_1.writeFile,
33
- createTempDirectory: (baseDir) => (0, promises_1.mkdtemp)((0, node_path_1.join)(baseDir ?? (0, node_os_1.tmpdir)(), 'angular-cli-tmp-packages-')),
34
- deleteDirectory: (path) => (0, promises_1.rm)(path, { recursive: true, force: true }),
35
- runCommand: async (command, args, options = {}) => {
36
- const signal = options.timeout ? AbortSignal.timeout(options.timeout) : undefined;
37
- const isWin32 = (0, node_os_1.platform)() === 'win32';
38
- return new Promise((resolve, reject) => {
39
- const env = {
40
- ...process.env,
41
- ...options.env,
42
- // NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.
43
- NO_UPDATE_NOTIFIER: '1',
44
- NPM_CONFIG_UPDATE_NOTIFIER: 'false',
45
- };
46
- // When running via Yarn Classic (`yarn run <script>`), Yarn automatically injects
47
- // `npm_config_registry=https://registry.yarnpkg.com` into the environment.
48
- // Strip this fallback so that spawned child processes correctly respect local `.npmrc`/`.yarnrc` files.
49
- if ((env['npm_config_registry'] === 'https://registry.yarnpkg.com' ||
50
- env['NPM_CONFIG_REGISTRY'] === 'https://registry.yarnpkg.com') &&
51
- (env['npm_config_user_agent']?.includes('yarn') ||
52
- env['NPM_CONFIG_USER_AGENT']?.includes('yarn'))) {
53
- delete env['npm_config_registry'];
54
- delete env['NPM_CONFIG_REGISTRY'];
55
- }
56
- const spawnOptions = {
57
- shell: isWin32,
58
- stdio: options.stdio ?? 'pipe',
59
- signal,
60
- cwd: options.cwd,
61
- env,
62
- };
63
- const childProcess = isWin32
64
- ? (0, node_child_process_1.spawn)(`${command} ${args.join(' ')}`, spawnOptions)
65
- : (0, node_child_process_1.spawn)(command, args, spawnOptions);
66
- let stdout = '';
67
- childProcess.stdout?.on('data', (data) => (stdout += data.toString()));
68
- let stderr = '';
69
- childProcess.stderr?.on('data', (data) => (stderr += data.toString()));
70
- childProcess.on('close', (code) => {
71
- if (code === 0) {
72
- resolve({ stdout, stderr });
73
- }
74
- else {
75
- const message = `Process exited with code ${code}.`;
76
- reject(new error_1.PackageManagerError(message, stdout, stderr, code));
77
- }
78
- });
79
- childProcess.on('error', (err) => {
80
- if (err.name === 'AbortError') {
81
- const message = `Process timed out.`;
82
- reject(new error_1.PackageManagerError(message, stdout, stderr, null));
83
- return;
84
- }
85
- const message = `Process failed with error: ${err.message}`;
86
- reject(new error_1.PackageManagerError(message, stdout, stderr, null));
87
- });
88
- });
89
- },
90
- };
91
- //# sourceMappingURL=host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;GAKG;AAEH,2DAA8D;AAC9D,qCAA2C;AAC3C,+CAAoG;AACpG,qCAA2C;AAC3C,yCAAiC;AACjC,mCAA8C;AAoF9C;;GAEG;AACU,QAAA,WAAW,GAAS;IAC/B,IAAI,EAAJ,eAAI;IACJ,eAAe,EAAE,IAAA,kBAAQ,GAAE,KAAK,OAAO;IACvC,KAA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AAM,CAAC;oBACN,MAAM,OAAO,GAAG,4BAA4B,IAAI,GAAG,CAAC;oBACpD,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC9B,MAAM,OAAO,GAAG,oBAAoB,CAAC;oBACrC,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;oBAE/D,OAAO;gBACT,CAAC;gBACD,MAAM,OAAO,GAAG,8BAA8B,GAAG,CAAC,OAAO,EAAE,CAAC;gBAC5D,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- export { createPackageManager } from './factory';
9
- export type { PackageManagerName } from './package-manager-descriptor';
10
- export { PackageManager } from './package-manager';
11
- export { PackageManagerError } from './error';
12
- export type * from './package-metadata';
13
- export type { InstalledPackage } from './package-tree';
@@ -1,17 +0,0 @@
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.PackageManagerError = exports.PackageManager = exports.createPackageManager = void 0;
11
- var factory_1 = require("./factory");
12
- Object.defineProperty(exports, "createPackageManager", { enumerable: true, get: function () { return factory_1.createPackageManager; } });
13
- var package_manager_1 = require("./package-manager");
14
- Object.defineProperty(exports, "PackageManager", { enumerable: true, get: function () { return package_manager_1.PackageManager; } });
15
- var error_1 = require("./error");
16
- Object.defineProperty(exports, "PackageManagerError", { enumerable: true, get: function () { return error_1.PackageManagerError; } });
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qCAAiD;AAAxC,+GAAA,oBAAoB,OAAA;AAE7B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- /**
9
- * @fileoverview This file defines a basic logger interface that is used by
10
- * the package manager abstraction. This allows the abstraction to be decoupled
11
- * from any specific logging implementation.
12
- */
13
- /**
14
- * A basic logger interface for the package manager abstraction.
15
- */
16
- export interface Logger {
17
- /**
18
- * Logs a debug message.
19
- * @param message The message to log.
20
- */
21
- debug(message: string): void;
22
- /**
23
- * Logs an informational message.
24
- * @param message The message to log.
25
- */
26
- info(message: string): void;
27
- }
@@ -1,10 +0,0 @@
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
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["logger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}