@depup/angular__cli 21.2.1-depup.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 (364) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/bin/bootstrap.js +33 -0
  4. package/bin/ng.js +71 -0
  5. package/bin/package.json +3 -0
  6. package/changes.json +30 -0
  7. package/lib/cli/index.d.ts +11 -0
  8. package/lib/cli/index.js +109 -0
  9. package/lib/cli/index.js.map +1 -0
  10. package/lib/code-examples.db +0 -0
  11. package/lib/config/schema.json +6150 -0
  12. package/lib/config/workspace-schema.d.ts +1025 -0
  13. package/lib/config/workspace-schema.js +133 -0
  14. package/lib/config/workspace-schema.js.map +1 -0
  15. package/lib/init.d.ts +8 -0
  16. package/lib/init.js +162 -0
  17. package/lib/init.js.map +1 -0
  18. package/package.json +103 -0
  19. package/src/analytics/analytics-collector.d.ts +35 -0
  20. package/src/analytics/analytics-collector.js +195 -0
  21. package/src/analytics/analytics-collector.js.map +1 -0
  22. package/src/analytics/analytics-parameters.d.ts +101 -0
  23. package/src/analytics/analytics-parameters.js +107 -0
  24. package/src/analytics/analytics-parameters.js.map +1 -0
  25. package/src/analytics/analytics.d.ts +27 -0
  26. package/src/analytics/analytics.js +183 -0
  27. package/src/analytics/analytics.js.map +1 -0
  28. package/src/command-builder/architect-base-command-module.d.ts +30 -0
  29. package/src/command-builder/architect-base-command-module.js +244 -0
  30. package/src/command-builder/architect-base-command-module.js.map +1 -0
  31. package/src/command-builder/architect-command-module.d.ts +28 -0
  32. package/src/command-builder/architect-command-module.js +218 -0
  33. package/src/command-builder/architect-command-module.js.map +1 -0
  34. package/src/command-builder/command-module.d.ts +73 -0
  35. package/src/command-builder/command-module.js +245 -0
  36. package/src/command-builder/command-module.js.map +1 -0
  37. package/src/command-builder/command-runner.d.ts +9 -0
  38. package/src/command-builder/command-runner.js +195 -0
  39. package/src/command-builder/command-runner.js.map +1 -0
  40. package/src/command-builder/definitions.d.ts +41 -0
  41. package/src/command-builder/definitions.js +20 -0
  42. package/src/command-builder/definitions.js.map +1 -0
  43. package/src/command-builder/schematics-command-module.d.ts +41 -0
  44. package/src/command-builder/schematics-command-module.js +408 -0
  45. package/src/command-builder/schematics-command-module.js.map +1 -0
  46. package/src/command-builder/utilities/command.d.ts +13 -0
  47. package/src/command-builder/utilities/command.js +39 -0
  48. package/src/command-builder/utilities/command.js.map +1 -0
  49. package/src/command-builder/utilities/json-help.d.ts +37 -0
  50. package/src/command-builder/utilities/json-help.js +92 -0
  51. package/src/command-builder/utilities/json-help.js.map +1 -0
  52. package/src/command-builder/utilities/json-schema.d.ts +64 -0
  53. package/src/command-builder/utilities/json-schema.js +349 -0
  54. package/src/command-builder/utilities/json-schema.js.map +1 -0
  55. package/src/command-builder/utilities/normalize-options-middleware.d.ts +18 -0
  56. package/src/command-builder/utilities/normalize-options-middleware.js +37 -0
  57. package/src/command-builder/utilities/normalize-options-middleware.js.map +1 -0
  58. package/src/command-builder/utilities/schematic-engine-host.d.ts +15 -0
  59. package/src/command-builder/utilities/schematic-engine-host.js +179 -0
  60. package/src/command-builder/utilities/schematic-engine-host.js.map +1 -0
  61. package/src/command-builder/utilities/schematic-workflow.d.ts +14 -0
  62. package/src/command-builder/utilities/schematic-workflow.js +70 -0
  63. package/src/command-builder/utilities/schematic-workflow.js.map +1 -0
  64. package/src/commands/add/cli.d.ts +38 -0
  65. package/src/commands/add/cli.js +623 -0
  66. package/src/commands/add/cli.js.map +1 -0
  67. package/src/commands/add/long-description.md +7 -0
  68. package/src/commands/analytics/cli.d.ts +16 -0
  69. package/src/commands/analytics/cli.js +34 -0
  70. package/src/commands/analytics/cli.js.map +1 -0
  71. package/src/commands/analytics/info/cli.d.ts +16 -0
  72. package/src/commands/analytics/info/cli.js +25 -0
  73. package/src/commands/analytics/info/cli.js.map +1 -0
  74. package/src/commands/analytics/long-description.md +20 -0
  75. package/src/commands/analytics/settings/cli.d.ts +35 -0
  76. package/src/commands/analytics/settings/cli.js +54 -0
  77. package/src/commands/analytics/settings/cli.js.map +1 -0
  78. package/src/commands/build/cli.d.ts +16 -0
  79. package/src/commands/build/cli.js +21 -0
  80. package/src/commands/build/cli.js.map +1 -0
  81. package/src/commands/build/long-description.md +18 -0
  82. package/src/commands/cache/clean/cli.d.ts +17 -0
  83. package/src/commands/cache/clean/cli.js +32 -0
  84. package/src/commands/cache/clean/cli.js.map +1 -0
  85. package/src/commands/cache/cli.d.ts +17 -0
  86. package/src/commands/cache/cli.js +36 -0
  87. package/src/commands/cache/cli.js.map +1 -0
  88. package/src/commands/cache/info/cli.d.ts +20 -0
  89. package/src/commands/cache/info/cli.js +139 -0
  90. package/src/commands/cache/info/cli.js.map +1 -0
  91. package/src/commands/cache/long-description.md +53 -0
  92. package/src/commands/cache/settings/cli.d.ts +27 -0
  93. package/src/commands/cache/settings/cli.js +41 -0
  94. package/src/commands/cache/settings/cli.js.map +1 -0
  95. package/src/commands/cache/utilities.d.ts +11 -0
  96. package/src/commands/cache/utilities.js +47 -0
  97. package/src/commands/cache/utilities.js.map +1 -0
  98. package/src/commands/command-config.d.ts +17 -0
  99. package/src/commands/command-config.js +116 -0
  100. package/src/commands/command-config.js.map +1 -0
  101. package/src/commands/completion/cli.d.ts +16 -0
  102. package/src/commands/completion/cli.js +61 -0
  103. package/src/commands/completion/cli.js.map +1 -0
  104. package/src/commands/completion/long-description.md +67 -0
  105. package/src/commands/config/cli.d.ts +24 -0
  106. package/src/commands/config/cli.js +150 -0
  107. package/src/commands/config/cli.js.map +1 -0
  108. package/src/commands/config/long-description.md +13 -0
  109. package/src/commands/deploy/cli.d.ts +17 -0
  110. package/src/commands/deploy/cli.js +38 -0
  111. package/src/commands/deploy/cli.js.map +1 -0
  112. package/src/commands/deploy/long-description.md +22 -0
  113. package/src/commands/e2e/cli.d.ts +18 -0
  114. package/src/commands/e2e/cli.js +42 -0
  115. package/src/commands/e2e/cli.js.map +1 -0
  116. package/src/commands/extract-i18n/cli.d.ts +17 -0
  117. package/src/commands/extract-i18n/cli.js +48 -0
  118. package/src/commands/extract-i18n/cli.js.map +1 -0
  119. package/src/commands/generate/cli.d.ts +47 -0
  120. package/src/commands/generate/cli.js +189 -0
  121. package/src/commands/generate/cli.js.map +1 -0
  122. package/src/commands/lint/cli.d.ts +17 -0
  123. package/src/commands/lint/cli.js +25 -0
  124. package/src/commands/lint/cli.js.map +1 -0
  125. package/src/commands/lint/long-description.md +20 -0
  126. package/src/commands/make-this-awesome/cli.d.ts +17 -0
  127. package/src/commands/make-this-awesome/cli.js +36 -0
  128. package/src/commands/make-this-awesome/cli.js.map +1 -0
  129. package/src/commands/mcp/cli.d.ts +20 -0
  130. package/src/commands/mcp/cli.js +74 -0
  131. package/src/commands/mcp/cli.js.map +1 -0
  132. package/src/commands/mcp/constants.d.ts +10 -0
  133. package/src/commands/mcp/constants.js +16 -0
  134. package/src/commands/mcp/constants.js.map +1 -0
  135. package/src/commands/mcp/devserver.d.ts +85 -0
  136. package/src/commands/mcp/devserver.js +112 -0
  137. package/src/commands/mcp/devserver.js.map +1 -0
  138. package/src/commands/mcp/host.d.ts +97 -0
  139. package/src/commands/mcp/host.js +118 -0
  140. package/src/commands/mcp/host.js.map +1 -0
  141. package/src/commands/mcp/mcp-server.d.ts +192 -0
  142. package/src/commands/mcp/mcp-server.js +155 -0
  143. package/src/commands/mcp/mcp-server.js.map +1 -0
  144. package/src/commands/mcp/resources/ai-tutor.md +824 -0
  145. package/src/commands/mcp/resources/best-practices.md +54 -0
  146. package/src/commands/mcp/resources/instructions.d.ts +9 -0
  147. package/src/commands/mcp/resources/instructions.js +26 -0
  148. package/src/commands/mcp/resources/instructions.js.map +1 -0
  149. package/src/commands/mcp/shared-options.d.ts +12 -0
  150. package/src/commands/mcp/shared-options.js +22 -0
  151. package/src/commands/mcp/shared-options.js.map +1 -0
  152. package/src/commands/mcp/tools/ai-tutor.d.ts +12 -0
  153. package/src/commands/mcp/tools/ai-tutor.js +59 -0
  154. package/src/commands/mcp/tools/ai-tutor.js.map +1 -0
  155. package/src/commands/mcp/tools/best-practices.d.ts +13 -0
  156. package/src/commands/mcp/tools/best-practices.js +187 -0
  157. package/src/commands/mcp/tools/best-practices.js.map +1 -0
  158. package/src/commands/mcp/tools/build.d.ts +37 -0
  159. package/src/commands/mcp/tools/build.js +89 -0
  160. package/src/commands/mcp/tools/build.js.map +1 -0
  161. package/src/commands/mcp/tools/devserver/devserver-start.d.ts +31 -0
  162. package/src/commands/mcp/tools/devserver/devserver-start.js +91 -0
  163. package/src/commands/mcp/tools/devserver/devserver-start.js.map +1 -0
  164. package/src/commands/mcp/tools/devserver/devserver-stop.d.ts +31 -0
  165. package/src/commands/mcp/tools/devserver/devserver-stop.js +68 -0
  166. package/src/commands/mcp/tools/devserver/devserver-stop.js.map +1 -0
  167. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.d.ts +41 -0
  168. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js +104 -0
  169. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js.map +1 -0
  170. package/src/commands/mcp/tools/doc-search.d.ts +21 -0
  171. package/src/commands/mcp/tools/doc-search.js +324 -0
  172. package/src/commands/mcp/tools/doc-search.js.map +1 -0
  173. package/src/commands/mcp/tools/e2e.d.ts +44 -0
  174. package/src/commands/mcp/tools/e2e.js +87 -0
  175. package/src/commands/mcp/tools/e2e.js.map +1 -0
  176. package/src/commands/mcp/tools/examples/database-discovery.d.ts +34 -0
  177. package/src/commands/mcp/tools/examples/database-discovery.js +87 -0
  178. package/src/commands/mcp/tools/examples/database-discovery.js.map +1 -0
  179. package/src/commands/mcp/tools/examples/database.d.ts +35 -0
  180. package/src/commands/mcp/tools/examples/database.js +125 -0
  181. package/src/commands/mcp/tools/examples/database.js.map +1 -0
  182. package/src/commands/mcp/tools/examples/index.d.ts +26 -0
  183. package/src/commands/mcp/tools/examples/index.js +149 -0
  184. package/src/commands/mcp/tools/examples/index.js.map +1 -0
  185. package/src/commands/mcp/tools/examples/query-escaper.d.ts +20 -0
  186. package/src/commands/mcp/tools/examples/query-escaper.js +68 -0
  187. package/src/commands/mcp/tools/examples/query-escaper.js.map +1 -0
  188. package/src/commands/mcp/tools/examples/runtime-database.d.ts +10 -0
  189. package/src/commands/mcp/tools/examples/runtime-database.js +192 -0
  190. package/src/commands/mcp/tools/examples/runtime-database.js.map +1 -0
  191. package/src/commands/mcp/tools/examples/schemas.d.ts +29 -0
  192. package/src/commands/mcp/tools/examples/schemas.js +101 -0
  193. package/src/commands/mcp/tools/examples/schemas.js.map +1 -0
  194. package/src/commands/mcp/tools/examples/utils.d.ts +14 -0
  195. package/src/commands/mcp/tools/examples/utils.js +31 -0
  196. package/src/commands/mcp/tools/examples/utils.js.map +1 -0
  197. package/src/commands/mcp/tools/modernize.d.ts +43 -0
  198. package/src/commands/mcp/tools/modernize.js +165 -0
  199. package/src/commands/mcp/tools/modernize.js.map +1 -0
  200. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.d.ts +17 -0
  201. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js +62 -0
  202. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js.map +1 -0
  203. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.d.ts +12 -0
  204. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js +73 -0
  205. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js.map +1 -0
  206. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.d.ts +11 -0
  207. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js +60 -0
  208. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +1 -0
  209. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +15 -0
  210. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +238 -0
  211. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js.map +1 -0
  212. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.d.ts +10 -0
  213. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js +20 -0
  214. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js.map +1 -0
  215. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.d.ts +35 -0
  216. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js +136 -0
  217. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js.map +1 -0
  218. package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +13 -0
  219. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +10 -0
  220. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js.map +1 -0
  221. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +16 -0
  222. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +224 -0
  223. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -0
  224. package/src/commands/mcp/tools/projects.d.ts +47 -0
  225. package/src/commands/mcp/tools/projects.js +523 -0
  226. package/src/commands/mcp/tools/projects.js.map +1 -0
  227. package/src/commands/mcp/tools/test.d.ts +35 -0
  228. package/src/commands/mcp/tools/test.js +79 -0
  229. package/src/commands/mcp/tools/test.js.map +1 -0
  230. package/src/commands/mcp/tools/tool-registry.d.ts +39 -0
  231. package/src/commands/mcp/tools/tool-registry.js +35 -0
  232. package/src/commands/mcp/tools/tool-registry.js.map +1 -0
  233. package/src/commands/mcp/utils.d.ts +25 -0
  234. package/src/commands/mcp/utils.js +44 -0
  235. package/src/commands/mcp/utils.js.map +1 -0
  236. package/src/commands/mcp/workspace-utils.d.ts +53 -0
  237. package/src/commands/mcp/workspace-utils.js +138 -0
  238. package/src/commands/mcp/workspace-utils.js.map +1 -0
  239. package/src/commands/new/cli.d.ts +27 -0
  240. package/src/commands/new/cli.js +76 -0
  241. package/src/commands/new/cli.js.map +1 -0
  242. package/src/commands/new/long-description.md +15 -0
  243. package/src/commands/run/cli.d.ts +25 -0
  244. package/src/commands/run/cli.js +89 -0
  245. package/src/commands/run/cli.js.map +1 -0
  246. package/src/commands/run/long-description.md +10 -0
  247. package/src/commands/serve/cli.d.ts +16 -0
  248. package/src/commands/serve/cli.js +20 -0
  249. package/src/commands/serve/cli.js.map +1 -0
  250. package/src/commands/test/cli.d.ts +16 -0
  251. package/src/commands/test/cli.js +21 -0
  252. package/src/commands/test/cli.js.map +1 -0
  253. package/src/commands/test/long-description.md +2 -0
  254. package/src/commands/update/cli.d.ts +34 -0
  255. package/src/commands/update/cli.js +531 -0
  256. package/src/commands/update/cli.js.map +1 -0
  257. package/src/commands/update/long-description.md +22 -0
  258. package/src/commands/update/schematic/collection.json +9 -0
  259. package/src/commands/update/schematic/index.d.ts +11 -0
  260. package/src/commands/update/schematic/index.js +715 -0
  261. package/src/commands/update/schematic/index.js.map +1 -0
  262. package/src/commands/update/schematic/schema.d.ts +51 -0
  263. package/src/commands/update/schematic/schema.js +16 -0
  264. package/src/commands/update/schematic/schema.js.map +1 -0
  265. package/src/commands/update/schematic/schema.json +64 -0
  266. package/src/commands/update/utilities/cli-version.d.ts +48 -0
  267. package/src/commands/update/utilities/cli-version.js +196 -0
  268. package/src/commands/update/utilities/cli-version.js.map +1 -0
  269. package/src/commands/update/utilities/constants.d.ts +12 -0
  270. package/src/commands/update/utilities/constants.js +16 -0
  271. package/src/commands/update/utilities/constants.js.map +1 -0
  272. package/src/commands/update/utilities/git.d.ts +36 -0
  273. package/src/commands/update/utilities/git.js +148 -0
  274. package/src/commands/update/utilities/git.js.map +1 -0
  275. package/src/commands/update/utilities/migration.d.ts +32 -0
  276. package/src/commands/update/utilities/migration.js +267 -0
  277. package/src/commands/update/utilities/migration.js.map +1 -0
  278. package/src/commands/version/cli.d.ts +36 -0
  279. package/src/commands/version/cli.js +117 -0
  280. package/src/commands/version/cli.js.map +1 -0
  281. package/src/commands/version/version-info.d.ts +46 -0
  282. package/src/commands/version/version-info.js +107 -0
  283. package/src/commands/version/version-info.js.map +1 -0
  284. package/src/package-managers/discovery.d.ts +23 -0
  285. package/src/package-managers/discovery.js +104 -0
  286. package/src/package-managers/discovery.js.map +1 -0
  287. package/src/package-managers/error.d.ts +43 -0
  288. package/src/package-managers/error.js +41 -0
  289. package/src/package-managers/error.js.map +1 -0
  290. package/src/package-managers/factory.d.ts +30 -0
  291. package/src/package-managers/factory.js +137 -0
  292. package/src/package-managers/factory.js.map +1 -0
  293. package/src/package-managers/host.d.ts +86 -0
  294. package/src/package-managers/host.js +80 -0
  295. package/src/package-managers/host.js.map +1 -0
  296. package/src/package-managers/index.d.ts +13 -0
  297. package/src/package-managers/index.js +17 -0
  298. package/src/package-managers/index.js.map +1 -0
  299. package/src/package-managers/logger.d.ts +27 -0
  300. package/src/package-managers/logger.js +10 -0
  301. package/src/package-managers/logger.js.map +1 -0
  302. package/src/package-managers/package-manager-descriptor.d.ts +245 -0
  303. package/src/package-managers/package-manager-descriptor.js +175 -0
  304. package/src/package-managers/package-manager-descriptor.js.map +1 -0
  305. package/src/package-managers/package-manager.d.ts +191 -0
  306. package/src/package-managers/package-manager.js +496 -0
  307. package/src/package-managers/package-manager.js.map +1 -0
  308. package/src/package-managers/package-metadata.d.ts +91 -0
  309. package/src/package-managers/package-metadata.js +10 -0
  310. package/src/package-managers/package-metadata.js.map +1 -0
  311. package/src/package-managers/package-tree.d.ts +23 -0
  312. package/src/package-managers/package-tree.js +10 -0
  313. package/src/package-managers/package-tree.js.map +1 -0
  314. package/src/package-managers/parsers.d.ts +170 -0
  315. package/src/package-managers/parsers.js +467 -0
  316. package/src/package-managers/parsers.js.map +1 -0
  317. package/src/utilities/color.d.ts +9 -0
  318. package/src/utilities/color.js +28 -0
  319. package/src/utilities/color.js.map +1 -0
  320. package/src/utilities/completion.d.ts +30 -0
  321. package/src/utilities/completion.js +270 -0
  322. package/src/utilities/completion.js.map +1 -0
  323. package/src/utilities/config.d.ts +38 -0
  324. package/src/utilities/config.js +369 -0
  325. package/src/utilities/config.js.map +1 -0
  326. package/src/utilities/environment-options.d.ts +25 -0
  327. package/src/utilities/environment-options.js +60 -0
  328. package/src/utilities/environment-options.js.map +1 -0
  329. package/src/utilities/eol.d.ts +20 -0
  330. package/src/utilities/eol.js +35 -0
  331. package/src/utilities/eol.js.map +1 -0
  332. package/src/utilities/error.d.ts +18 -0
  333. package/src/utilities/error.js +41 -0
  334. package/src/utilities/error.js.map +1 -0
  335. package/src/utilities/find-up.d.ts +21 -0
  336. package/src/utilities/find-up.js +67 -0
  337. package/src/utilities/find-up.js.map +1 -0
  338. package/src/utilities/json-file.d.ts +24 -0
  339. package/src/utilities/json-file.js +179 -0
  340. package/src/utilities/json-file.js.map +1 -0
  341. package/src/utilities/log-file.d.ts +13 -0
  342. package/src/utilities/log-file.js +28 -0
  343. package/src/utilities/log-file.js.map +1 -0
  344. package/src/utilities/memoize.d.ts +15 -0
  345. package/src/utilities/memoize.js +64 -0
  346. package/src/utilities/memoize.js.map +1 -0
  347. package/src/utilities/package-metadata.d.ts +58 -0
  348. package/src/utilities/package-metadata.js +265 -0
  349. package/src/utilities/package-metadata.js.map +1 -0
  350. package/src/utilities/prettier.d.ts +13 -0
  351. package/src/utilities/prettier.js +46 -0
  352. package/src/utilities/prettier.js.map +1 -0
  353. package/src/utilities/project.d.ts +8 -0
  354. package/src/utilities/project.js +81 -0
  355. package/src/utilities/project.js.map +1 -0
  356. package/src/utilities/prompt.d.ts +17 -0
  357. package/src/utilities/prompt.js +90 -0
  358. package/src/utilities/prompt.js.map +1 -0
  359. package/src/utilities/tty.d.ts +16 -0
  360. package/src/utilities/tty.js +23 -0
  361. package/src/utilities/tty.js.map +1 -0
  362. package/src/utilities/version.d.ts +16 -0
  363. package/src/utilities/version.js +26 -0
  364. package/src/utilities/version.js.map +1 -0
@@ -0,0 +1,64 @@
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 { json } from '@angular-devkit/core';
9
+ import type { Argv, Options as YargsOptions } from 'yargs';
10
+ import { EventCustomDimension } from '../../analytics/analytics-parameters';
11
+ /**
12
+ * An option description that can be used by yargs to create a command.
13
+ * See: https://github.com/yargs/yargs/blob/main/docs/options.mjs
14
+ */
15
+ export interface Option extends YargsOptions {
16
+ /**
17
+ * The name of the option.
18
+ */
19
+ name: string;
20
+ /**
21
+ * Whether this option is required or not.
22
+ */
23
+ required?: boolean;
24
+ /**
25
+ * Format field of this option.
26
+ */
27
+ format?: string;
28
+ /**
29
+ * Whether this option should be hidden from the help output. It will still show up in JSON help.
30
+ */
31
+ hidden?: boolean;
32
+ /**
33
+ * If this option can be used as an argument, the position of the argument. Otherwise omitted.
34
+ */
35
+ positional?: number;
36
+ /**
37
+ * Whether or not to report this option to the Angular Team, and which custom field to use.
38
+ * If this is falsey, do not report this option.
39
+ */
40
+ userAnalytics?: string;
41
+ /**
42
+ * Type of the values in a key/value pair field.
43
+ */
44
+ itemValueType?: 'string';
45
+ }
46
+ /**
47
+ * Parses a JSON schema to a list of options that can be used by yargs.
48
+ *
49
+ * @param registry A schema registry to use for flattening the schema.
50
+ * @param schema The JSON schema to parse.
51
+ * @param interactive Whether to prompt the user for missing options.
52
+ * @returns A list of options.
53
+ *
54
+ * @note The schema definition are not resolved at this stage. This means that `$ref` will not be resolved,
55
+ * and custom keywords like `x-prompt` will not be processed.
56
+ */
57
+ export declare function parseJsonSchemaToOptions(registry: json.schema.SchemaRegistry, schema: json.JsonObject, interactive?: boolean): Promise<Option[]>;
58
+ /**
59
+ * Adds schema options to a command also this keeps track of options that are required for analytics.
60
+ * **Note:** This method should be called from the command bundler method.
61
+ *
62
+ * @returns A map from option name to analytics configuration.
63
+ */
64
+ export declare function addSchemaOptionsToCommand<T>(localYargs: Argv<T>, options: Option[], includeDefaultValues: boolean): Map<string, EventCustomDimension>;
@@ -0,0 +1,349 @@
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.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
11
+ exports.addSchemaOptionsToCommand = addSchemaOptionsToCommand;
12
+ const core_1 = require("@angular-devkit/core");
13
+ /**
14
+ * A Yargs check function that validates that the given options are in the form of `key=value`.
15
+ * @param keyValuePairOptions A set of options that should be in the form of `key=value`.
16
+ * @param args The parsed arguments.
17
+ * @returns `true` if the options are valid, otherwise an error is thrown.
18
+ */
19
+ function checkStringMap(keyValuePairOptions, args) {
20
+ for (const key of keyValuePairOptions) {
21
+ const value = args[key];
22
+ if (!Array.isArray(value)) {
23
+ // Value has been parsed.
24
+ continue;
25
+ }
26
+ for (const pair of value) {
27
+ if (pair === undefined) {
28
+ continue;
29
+ }
30
+ if (!pair.includes('=')) {
31
+ throw new Error(`Invalid value for argument: ${key}, Given: '${pair}', Expected key=value pair`);
32
+ }
33
+ }
34
+ }
35
+ return true;
36
+ }
37
+ /**
38
+ * A Yargs coerce function that converts an array of `key=value` strings to an object.
39
+ * @param value An array of `key=value` strings.
40
+ * @returns An object with the keys and values from the input array.
41
+ */
42
+ function coerceToStringMap(value) {
43
+ const stringMap = {};
44
+ for (const pair of value) {
45
+ // This happens when the flag isn't passed at all.
46
+ if (pair === undefined) {
47
+ continue;
48
+ }
49
+ const eqIdx = pair.indexOf('=');
50
+ if (eqIdx === -1) {
51
+ // In the case it is not valid skip processing this option and handle the error in `checkStringMap`
52
+ return value;
53
+ }
54
+ const key = pair.slice(0, eqIdx);
55
+ stringMap[key] = pair.slice(eqIdx + 1);
56
+ }
57
+ return stringMap;
58
+ }
59
+ /**
60
+ * Checks if a JSON schema node represents a string map.
61
+ * A string map is an object with `additionalProperties` of type `string`.
62
+ * @param node The JSON schema node to check.
63
+ * @returns `true` if the node represents a string map, otherwise `false`.
64
+ */
65
+ function isStringMap(node) {
66
+ // Exclude fields with more specific kinds of properties.
67
+ if (node.properties || node.patternProperties) {
68
+ return false;
69
+ }
70
+ // Restrict to additionalProperties with string values.
71
+ return (core_1.json.isJsonObject(node.additionalProperties) &&
72
+ !node.additionalProperties.enum &&
73
+ node.additionalProperties.type === 'string');
74
+ }
75
+ const SUPPORTED_PRIMITIVE_TYPES = new Set(['boolean', 'number', 'string']);
76
+ /**
77
+ * Checks if a string is a supported primitive type.
78
+ * @param value The string to check.
79
+ * @returns `true` if the string is a supported primitive type, otherwise `false`.
80
+ */
81
+ function isSupportedPrimitiveType(value) {
82
+ return SUPPORTED_PRIMITIVE_TYPES.has(value);
83
+ }
84
+ /**
85
+ * Recursively checks if a JSON schema for an array's items is a supported primitive type.
86
+ * It supports `oneOf` and `anyOf` keywords.
87
+ * @param schema The JSON schema for the array's items.
88
+ * @returns `true` if the schema is a supported primitive type, otherwise `false`.
89
+ */
90
+ function isSupportedArrayItemSchema(schema) {
91
+ if (typeof schema.type === 'string' && isSupportedPrimitiveType(schema.type)) {
92
+ return true;
93
+ }
94
+ if (core_1.json.isJsonArray(schema.enum)) {
95
+ return true;
96
+ }
97
+ if (core_1.json.isJsonArray(schema.items)) {
98
+ return schema.items.some((item) => (0, core_1.isJsonObject)(item) && isSupportedArrayItemSchema(item));
99
+ }
100
+ if (core_1.json.isJsonArray(schema.oneOf) &&
101
+ schema.oneOf.some((item) => (0, core_1.isJsonObject)(item) && isSupportedArrayItemSchema(item))) {
102
+ return true;
103
+ }
104
+ if (core_1.json.isJsonArray(schema.anyOf) &&
105
+ schema.anyOf.some((item) => (0, core_1.isJsonObject)(item) && isSupportedArrayItemSchema(item))) {
106
+ return true;
107
+ }
108
+ return false;
109
+ }
110
+ /**
111
+ * Gets the supported types for a JSON schema node.
112
+ * @param current The JSON schema node to get the supported types for.
113
+ * @returns An array of supported types.
114
+ */
115
+ function getSupportedTypes(current) {
116
+ const typeSet = core_1.json.schema.getTypesOfSchema(current);
117
+ if (typeSet.size === 0) {
118
+ return [];
119
+ }
120
+ return [...typeSet].filter((type) => {
121
+ switch (type) {
122
+ case 'boolean':
123
+ case 'number':
124
+ case 'string':
125
+ return true;
126
+ case 'array':
127
+ return (0, core_1.isJsonObject)(current.items) && isSupportedArrayItemSchema(current.items);
128
+ case 'object':
129
+ return isStringMap(current);
130
+ default:
131
+ return false;
132
+ }
133
+ });
134
+ }
135
+ /**
136
+ * Gets the enum values for a JSON schema node.
137
+ * @param current The JSON schema node to get the enum values for.
138
+ * @returns An array of enum values.
139
+ */
140
+ function getEnumValues(current) {
141
+ if (core_1.json.isJsonArray(current.enum)) {
142
+ return current.enum.sort();
143
+ }
144
+ if ((0, core_1.isJsonObject)(current.items)) {
145
+ const enumValues = getEnumValues(current.items);
146
+ if (enumValues?.length) {
147
+ return enumValues;
148
+ }
149
+ }
150
+ if (typeof current.type === 'string' && isSupportedPrimitiveType(current.type)) {
151
+ return [];
152
+ }
153
+ const subSchemas = (core_1.json.isJsonArray(current.oneOf) && current.oneOf) ||
154
+ (core_1.json.isJsonArray(current.anyOf) && current.anyOf);
155
+ if (subSchemas) {
156
+ // Find the first enum.
157
+ for (const subSchema of subSchemas) {
158
+ if ((0, core_1.isJsonObject)(subSchema)) {
159
+ const enumValues = getEnumValues(subSchema);
160
+ if (enumValues) {
161
+ return enumValues;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ return [];
167
+ }
168
+ /**
169
+ * Gets the default value for a JSON schema node.
170
+ * @param current The JSON schema node to get the default value for.
171
+ * @param type The type of the JSON schema node.
172
+ * @returns The default value, or `undefined` if there is no default value.
173
+ */
174
+ function getDefaultValue(current, type) {
175
+ const defaultValue = current.default;
176
+ if (defaultValue === undefined) {
177
+ return undefined;
178
+ }
179
+ if (type === 'array') {
180
+ return Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue : undefined;
181
+ }
182
+ if (typeof defaultValue === type) {
183
+ return defaultValue;
184
+ }
185
+ return undefined;
186
+ }
187
+ /**
188
+ * Gets the aliases for a JSON schema node.
189
+ * @param current The JSON schema node to get the aliases for.
190
+ * @returns An array of aliases.
191
+ */
192
+ function getAliases(current) {
193
+ if (core_1.json.isJsonArray(current.aliases)) {
194
+ return [...current.aliases].map(String);
195
+ }
196
+ if (current.alias) {
197
+ return [String(current.alias)];
198
+ }
199
+ return [];
200
+ }
201
+ /**
202
+ * Parses a JSON schema to a list of options that can be used by yargs.
203
+ *
204
+ * @param registry A schema registry to use for flattening the schema.
205
+ * @param schema The JSON schema to parse.
206
+ * @param interactive Whether to prompt the user for missing options.
207
+ * @returns A list of options.
208
+ *
209
+ * @note The schema definition are not resolved at this stage. This means that `$ref` will not be resolved,
210
+ * and custom keywords like `x-prompt` will not be processed.
211
+ */
212
+ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
213
+ const options = [];
214
+ function visitor(current, pointer, parentSchema) {
215
+ if (!parentSchema ||
216
+ core_1.json.isJsonArray(current) ||
217
+ pointer.split(/\/(?:properties|items|definitions)\//g).length > 2) {
218
+ // Ignore root, arrays, and subitems.
219
+ return;
220
+ }
221
+ if (pointer.includes('/not/')) {
222
+ // We don't support anyOf/not.
223
+ throw new Error('The "not" keyword is not supported in JSON Schema.');
224
+ }
225
+ const ptr = core_1.json.schema.parseJsonPointer(pointer);
226
+ if (ptr[ptr.length - 2] !== 'properties') {
227
+ // Skip any non-property items.
228
+ return;
229
+ }
230
+ const name = ptr.at(-1);
231
+ const types = getSupportedTypes(current);
232
+ if (types.length === 0) {
233
+ // This means it's not usable on the command line. e.g. an Object.
234
+ return;
235
+ }
236
+ const [type] = types;
237
+ const $default = current.$default;
238
+ const $defaultIndex = (0, core_1.isJsonObject)($default) && $default['$source'] === 'argv' ? $default['index'] : undefined;
239
+ const positional = typeof $defaultIndex === 'number' ? $defaultIndex : undefined;
240
+ let required = core_1.json.isJsonArray(schema.required) && schema.required.includes(name);
241
+ if (required && interactive && current['x-prompt']) {
242
+ required = false;
243
+ }
244
+ const visible = current.visible !== false;
245
+ const xDeprecated = current['x-deprecated'];
246
+ const enumValues = getEnumValues(current);
247
+ const option = {
248
+ name,
249
+ description: String(current.description ?? ''),
250
+ default: getDefaultValue(current, type),
251
+ choices: enumValues?.length ? enumValues : undefined,
252
+ required,
253
+ alias: getAliases(current),
254
+ format: typeof current.format === 'string' ? current.format : undefined,
255
+ hidden: !!current.hidden || !visible,
256
+ userAnalytics: typeof current['x-user-analytics'] === 'string' ? current['x-user-analytics'] : undefined,
257
+ deprecated: xDeprecated === true || typeof xDeprecated === 'string' ? xDeprecated : undefined,
258
+ positional,
259
+ ...(type === 'object'
260
+ ? {
261
+ type: 'array',
262
+ itemValueType: 'string',
263
+ }
264
+ : {
265
+ type,
266
+ }),
267
+ };
268
+ options.push(option);
269
+ }
270
+ const flattenedSchema = await registry.ɵflatten(schema);
271
+ core_1.json.schema.visitJsonSchema(flattenedSchema, visitor);
272
+ // Sort by positional and name.
273
+ return options.sort((a, b) => {
274
+ if (a.positional) {
275
+ return b.positional ? a.positional - b.positional : a.name.localeCompare(b.name);
276
+ }
277
+ else if (b.positional) {
278
+ return -1;
279
+ }
280
+ return a.name.localeCompare(b.name);
281
+ });
282
+ }
283
+ /**
284
+ * Adds schema options to a command also this keeps track of options that are required for analytics.
285
+ * **Note:** This method should be called from the command bundler method.
286
+ *
287
+ * @returns A map from option name to analytics configuration.
288
+ */
289
+ function addSchemaOptionsToCommand(localYargs, options, includeDefaultValues) {
290
+ const booleanOptionsWithNoPrefix = new Set();
291
+ const keyValuePairOptions = new Set();
292
+ const optionsWithAnalytics = new Map();
293
+ for (const option of options) {
294
+ const { default: defaultVal, positional, deprecated, description, alias, userAnalytics, type, itemValueType, hidden, name, choices, } = option;
295
+ let dashedName = core_1.strings.dasherize(name);
296
+ // Handle options which have been defined in the schema with `no` prefix.
297
+ if (type === 'boolean' && dashedName.startsWith('no-')) {
298
+ dashedName = dashedName.slice(3);
299
+ booleanOptionsWithNoPrefix.add(dashedName);
300
+ }
301
+ if (itemValueType) {
302
+ keyValuePairOptions.add(dashedName);
303
+ }
304
+ const sharedOptions = {
305
+ alias,
306
+ hidden,
307
+ description,
308
+ deprecated,
309
+ choices,
310
+ coerce: itemValueType ? coerceToStringMap : undefined,
311
+ // This should only be done when `--help` is used otherwise default will override options set in angular.json.
312
+ ...(includeDefaultValues ? { default: defaultVal } : {}),
313
+ };
314
+ if (positional === undefined) {
315
+ localYargs = localYargs.option(dashedName, {
316
+ array: itemValueType ? true : undefined,
317
+ type: itemValueType ?? type,
318
+ ...sharedOptions,
319
+ });
320
+ }
321
+ else {
322
+ localYargs = localYargs.positional(dashedName, {
323
+ type: type === 'array' || type === 'count' ? 'string' : type,
324
+ ...sharedOptions,
325
+ });
326
+ }
327
+ // Record option of analytics.
328
+ if (userAnalytics !== undefined) {
329
+ optionsWithAnalytics.set(name, userAnalytics);
330
+ }
331
+ }
332
+ // Valid key/value options
333
+ if (keyValuePairOptions.size) {
334
+ localYargs.check(checkStringMap.bind(null, keyValuePairOptions), false);
335
+ }
336
+ // Handle options which have been defined in the schema with `no` prefix.
337
+ if (booleanOptionsWithNoPrefix.size) {
338
+ localYargs.middleware((options) => {
339
+ for (const key of booleanOptionsWithNoPrefix) {
340
+ if (key in options) {
341
+ options[`no-${key}`] = !options[key];
342
+ delete options[key];
343
+ }
344
+ }
345
+ }, false);
346
+ }
347
+ return optionsWithAnalytics;
348
+ }
349
+ //# sourceMappingURL=json-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.js","sourceRoot":"","sources":["json-schema.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA2SH,4DA+FC;AAQD,8DAoFC;AApeD,+CAAmE;AA8CnE;;;;;GAKG;AACH,SAAS,cAAc,CAAC,mBAAgC,EAAE,IAAe;IACvE,KAAK,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,IA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
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 type { Arguments, Argv } from 'yargs';
9
+ /**
10
+ * A Yargs middleware that normalizes non Array options when the argument has been provided multiple times.
11
+ *
12
+ * By default, when an option is non array and it is provided multiple times in the command line, yargs
13
+ * will not override it's value but instead it will be changed to an array unless `duplicate-arguments-array` is disabled.
14
+ * But this option also have an effect on real array options which isn't desired.
15
+ *
16
+ * See: https://github.com/yargs/yargs-parser/pull/163#issuecomment-516566614
17
+ */
18
+ export declare function createNormalizeOptionsMiddleware(localeYargs: Argv): (args: Arguments) => void;
@@ -0,0 +1,37 @@
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.createNormalizeOptionsMiddleware = createNormalizeOptionsMiddleware;
11
+ /**
12
+ * A Yargs middleware that normalizes non Array options when the argument has been provided multiple times.
13
+ *
14
+ * By default, when an option is non array and it is provided multiple times in the command line, yargs
15
+ * will not override it's value but instead it will be changed to an array unless `duplicate-arguments-array` is disabled.
16
+ * But this option also have an effect on real array options which isn't desired.
17
+ *
18
+ * See: https://github.com/yargs/yargs-parser/pull/163#issuecomment-516566614
19
+ */
20
+ function createNormalizeOptionsMiddleware(localeYargs) {
21
+ return (args) => {
22
+ // `getOptions` is not included in the types even though it's public API.
23
+ // https://github.com/yargs/yargs/issues/2098
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ const { array } = localeYargs.getOptions();
26
+ const arrayOptions = new Set(array);
27
+ for (const [key, value] of Object.entries(args)) {
28
+ if (key !== '_' && Array.isArray(value) && !arrayOptions.has(key)) {
29
+ const newValue = value.pop();
30
+ // eslint-disable-next-line no-console
31
+ console.warn(`Option '${key}' has been specified multiple times. The value '${newValue}' will be used.`);
32
+ args[key] = newValue;
33
+ }
34
+ }
35
+ };
36
+ }
37
+ //# sourceMappingURL=normalize-options-middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-options-middleware.js","sourceRoot":"","sources":["normalize-options-middleware.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAaH,4EAmBC;AA5BD;;;;;;;;GAQG;AACH,SAAgB,gCAAgC,CAAC,WAAiB;IAChE,OAAO,CAAC,IAAe,EAAE,EAAE;QACzB,yEAAyE;QACzE,6CAA6C;QAC7C,8DAA8D;QAC9D,MAAM,EAAE,KAAK,EAAE,GAAI,WAAmB,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAEpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,IAAI,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClE,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;gBAC7B,sCAAsC;gBACtC,OAAO,CAAC,IAAI,CACV,WAAW,GAAG,mDAAmD,QAAQ,iBAAiB,CAC3F,CAAC;gBACF,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
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 { RuleFactory } from '@angular-devkit/schematics';
9
+ import { FileSystemCollectionDesc, NodeModulesEngineHost } from '@angular-devkit/schematics/tools';
10
+ export declare class SchematicEngineHost extends NodeModulesEngineHost {
11
+ protected _resolveReferenceString(refString: string, parentPath: string, collectionDescription?: FileSystemCollectionDesc): {
12
+ ref: RuleFactory<{}>;
13
+ path: string;
14
+ } | null;
15
+ }