@ng-doc/builder 22.0.0-beta.2 → 22.1.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 (441) hide show
  1. package/README.md +19 -28
  2. package/application/index.js +2 -2
  3. package/application/index.js.map +1 -1
  4. package/application/schema.json +1 -2
  5. package/builders.json +23 -13
  6. package/classes/observable-map.d.ts +1 -0
  7. package/classes/observable-map.js +14 -3
  8. package/classes/observable-map.js.map +1 -1
  9. package/classes/observable-set.js +2 -1
  10. package/classes/observable-set.js.map +1 -1
  11. package/dev-server/index.js +5 -3
  12. package/dev-server/index.js.map +1 -1
  13. package/engine/builders/api-list/api-list-component.builder.js +4 -4
  14. package/engine/builders/api-list/api-list-component.builder.js.map +1 -1
  15. package/engine/builders/api-list/api-page-template.builder.js +2 -2
  16. package/engine/builders/api-list/api-page-template.builder.js.map +1 -1
  17. package/engine/builders/global/keywords.builder.d.ts +1 -4
  18. package/engine/builders/global/keywords.builder.js +5 -9
  19. package/engine/builders/global/keywords.builder.js.map +1 -1
  20. package/engine/builders/global/search-indexes.builder.js +1 -1
  21. package/engine/builders/global/search-indexes.builder.js.map +1 -1
  22. package/engine/builders/helpers/create-entry-metadata.js +2 -1
  23. package/engine/builders/helpers/create-entry-metadata.js.map +1 -1
  24. package/engine/builders/helpers/create-import-path.js.map +1 -1
  25. package/engine/builders/helpers/get-entry-relative-path.js.map +1 -1
  26. package/engine/builders/helpers/get-playground-metadata.js +7 -1
  27. package/engine/builders/helpers/get-playground-metadata.js.map +1 -1
  28. package/engine/builders/page/demo-assets.builder.js +10 -5
  29. package/engine/builders/page/demo-assets.builder.js.map +1 -1
  30. package/engine/builders/page/playground.builder.js +1 -0
  31. package/engine/builders/page/playground.builder.js.map +1 -1
  32. package/engine/builders/shared/content.builder.js +5 -3
  33. package/engine/builders/shared/content.builder.js.map +1 -1
  34. package/engine/builders/shared/page-component.builder.js +16 -6
  35. package/engine/builders/shared/page-component.builder.js.map +1 -1
  36. package/engine/builders/shared/page-wrapper.builder.js +10 -5
  37. package/engine/builders/shared/page-wrapper.builder.js.map +1 -1
  38. package/engine/core/operators/distinct-pending.js.map +1 -1
  39. package/engine/core/operators/factory.js +1 -4
  40. package/engine/core/operators/factory.js.map +1 -1
  41. package/engine/core/operators/merge-factory.js +19 -17
  42. package/engine/core/operators/merge-factory.js.map +1 -1
  43. package/engine/core/operators/when-builders-done.js.map +1 -1
  44. package/engine/core/triggers/on-dependencies-change.d.ts +1 -1
  45. package/engine/core/triggers/on-dependencies-change.js +2 -2
  46. package/engine/core/triggers/on-dependencies-change.js.map +1 -1
  47. package/generator/artifacts/index.d.ts +317 -0
  48. package/generator/bootstrap/bin.d.ts +18 -0
  49. package/generator/bootstrap/bin.js +7298 -0
  50. package/generator/bootstrap/candidate-output-committer.d.ts +12 -0
  51. package/generator/bootstrap/cli.d.ts +42 -0
  52. package/generator/bootstrap/cli.js +7147 -0
  53. package/generator/bootstrap/constants.d.ts +4 -0
  54. package/generator/bootstrap/index.d.ts +111 -0
  55. package/generator/bootstrap/index.js +5034 -0
  56. package/generator/bootstrap/prerender-command.d.ts +31 -0
  57. package/generator/bootstrap/process-tree.d.ts +49 -0
  58. package/generator/build-metafile.json +12009 -0
  59. package/generator/build-provenance.json +121 -0
  60. package/generator/compiler/assemble.d.ts +41 -0
  61. package/generator/compiler/classify.d.ts +161 -0
  62. package/generator/compiler/closure-store.d.ts +55 -0
  63. package/generator/compiler/common.d.ts +32 -0
  64. package/generator/compiler/describe.d.ts +21 -0
  65. package/generator/compiler/dry-run.d.ts +108 -0
  66. package/generator/compiler/fast-start.d.ts +104 -0
  67. package/generator/compiler/fold.d.ts +116 -0
  68. package/generator/compiler/index.d.ts +131 -0
  69. package/generator/compiler/index.js +19009 -0
  70. package/generator/compiler/link.d.ts +38 -0
  71. package/generator/compiler/memo.d.ts +44 -0
  72. package/generator/compiler/plan.d.ts +116 -0
  73. package/generator/compiler/progress.d.ts +54 -0
  74. package/generator/compiler/render.d.ts +27 -0
  75. package/generator/compiler/retention.d.ts +181 -0
  76. package/generator/compiler/semantic-closure.d.ts +46 -0
  77. package/generator/compiler/targeted.d.ts +280 -0
  78. package/generator/content/code-snippet.d.ts +20 -0
  79. package/generator/content/content-compiler.d.ts +122 -0
  80. package/generator/content/format-cache.d.ts +108 -0
  81. package/generator/content/highlight-cache.d.ts +115 -0
  82. package/generator/content/html-pipeline.d.ts +179 -0
  83. package/generator/content/html-pool.d.ts +245 -0
  84. package/generator/content/html-worker.js +2181 -0
  85. package/generator/content-module-ids.d.ts +8 -0
  86. package/generator/contracts.d.ts +1102 -0
  87. package/generator/contracts.js +15 -0
  88. package/generator/discovery/index.d.ts +79 -0
  89. package/generator/graph/index.d.ts +211 -0
  90. package/generator/graph/unit-index.d.ts +216 -0
  91. package/generator/kernel/canonical.d.ts +57 -0
  92. package/generator/kernel/flags.d.ts +51 -0
  93. package/generator/kernel/footprint.d.ts +88 -0
  94. package/generator/kernel/observations.d.ts +68 -0
  95. package/generator/kernel/paths.d.ts +22 -0
  96. package/generator/kernel/runtime-identity.d.ts +11 -0
  97. package/generator/outputs/index.d.ts +80 -0
  98. package/generator/package.json +3 -0
  99. package/generator/progress/ci.d.ts +22 -0
  100. package/generator/progress/detect.d.ts +60 -0
  101. package/generator/progress/events.d.ts +126 -0
  102. package/generator/progress/format.d.ts +83 -0
  103. package/generator/progress/gate.d.ts +49 -0
  104. package/generator/progress/host.d.ts +29 -0
  105. package/generator/progress/lines.d.ts +42 -0
  106. package/generator/progress/live.d.ts +115 -0
  107. package/generator/progress/model.d.ts +85 -0
  108. package/generator/progress/reporter.d.ts +87 -0
  109. package/generator/progress/settings.d.ts +60 -0
  110. package/generator/semantic/angular.d.ts +29 -0
  111. package/generator/semantic/api-enumeration.d.ts +19 -0
  112. package/generator/semantic/api-summary.d.ts +33 -0
  113. package/generator/semantic/dependencies.d.ts +20 -0
  114. package/generator/semantic/derived-classes.d.ts +58 -0
  115. package/generator/semantic/documentation-cache.d.ts +23 -0
  116. package/generator/semantic/formatting.d.ts +27 -0
  117. package/generator/semantic/fragments.d.ts +37 -0
  118. package/generator/semantic/owned-roots.d.ts +59 -0
  119. package/generator/semantic/program-builder.d.ts +55 -0
  120. package/generator/semantic/program-index.d.ts +124 -0
  121. package/generator/semantic/program-inputs.d.ts +26 -0
  122. package/generator/semantic/program-observations.d.ts +158 -0
  123. package/generator/semantic/program-retention.d.ts +147 -0
  124. package/generator/semantic/program-state.d.ts +196 -0
  125. package/generator/semantic/program-verify.d.ts +22 -0
  126. package/generator/semantic/recorder.d.ts +89 -0
  127. package/generator/semantic/rendering.d.ts +34 -0
  128. package/generator/semantic/semantic-closure.d.ts +129 -0
  129. package/generator/semantic/semantic-service.d.ts +186 -0
  130. package/generator/semantic/type-text.d.ts +5 -0
  131. package/generator/session/build-session.d.ts +206 -0
  132. package/generator/session/input-verification.d.ts +38 -0
  133. package/generator/session/parcel-event-source.d.ts +22 -0
  134. package/generator/session/progress.d.ts +72 -0
  135. package/generator/session/unchanged-saves.d.ts +63 -0
  136. package/generator/session/watch-inputs.d.ts +6 -0
  137. package/generator/session/watch-signals.d.ts +10 -0
  138. package/generator/templates/api/base.html.nunj +26 -0
  139. package/generator/templates/api/class-declaration.html.nunj +59 -0
  140. package/generator/templates/api/details/class-declaration.html.nunj +47 -0
  141. package/generator/templates/api/details/enum-declaration.html.nunj +0 -0
  142. package/generator/templates/api/details/function-declaration.html.nunj +14 -0
  143. package/generator/templates/api/details/helpers/decorators.html.nunj +14 -0
  144. package/generator/templates/api/details/helpers/extends.html.nunj +6 -0
  145. package/generator/templates/api/details/helpers/selectors.html.nunj +12 -0
  146. package/generator/templates/api/details/helpers/type-parameters.html.nunj +14 -0
  147. package/generator/templates/api/details/interface-declaration.html.nunj +27 -0
  148. package/generator/templates/api/details/type-alias-declaration.html.nunj +14 -0
  149. package/generator/templates/api/details/variable-declaration.html.nunj +0 -0
  150. package/generator/templates/api/details.html.nunj +9 -0
  151. package/generator/templates/api/enum-declaration.html.nunj +12 -0
  152. package/generator/templates/api/function-declaration.html.nunj +35 -0
  153. package/generator/templates/api/interface-declaration.html.nunj +37 -0
  154. package/generator/templates/api/type-alias-declaration.html.nunj +16 -0
  155. package/generator/templates/api/variable-declaration.html.nunj +8 -0
  156. package/generator/templates/api-header.html.nunj +11 -0
  157. package/generator/templates/api-list.ts.nunj +22 -0
  158. package/generator/templates/api-page-content.html.nunj +1 -0
  159. package/generator/templates/api-scope.ts.nunj +22 -0
  160. package/generator/templates/category.ts.nunj +22 -0
  161. package/generator/templates/code.html.nunj +3 -0
  162. package/generator/templates/context.ts.nunj +55 -0
  163. package/generator/templates/demo-app.ts.nunj +37 -0
  164. package/generator/templates/demo-assets.ts.nunj +25 -0
  165. package/generator/templates/demo-routes.ts.nunj +23 -0
  166. package/generator/templates/helpers/accessor.html.nunj +76 -0
  167. package/generator/templates/helpers/accessors.html.nunj +7 -0
  168. package/generator/templates/helpers/badge.html.nunj +4 -0
  169. package/generator/templates/helpers/call-signature.html.nunj +70 -0
  170. package/generator/templates/helpers/code.html.nunj +3 -0
  171. package/generator/templates/helpers/constructor.html.nunj +32 -0
  172. package/generator/templates/helpers/declaration-modifiers.html.nunj +45 -0
  173. package/generator/templates/helpers/decorators.html.nunj +11 -0
  174. package/generator/templates/helpers/members.html.nunj +29 -0
  175. package/generator/templates/helpers/method.html.nunj +89 -0
  176. package/generator/templates/helpers/methods.html.nunj +7 -0
  177. package/generator/templates/helpers/modifier.html.nunj +4 -0
  178. package/generator/templates/helpers/no-content.html.nunj +3 -0
  179. package/generator/templates/helpers/overload.html.nunj +57 -0
  180. package/generator/templates/helpers/parameters.html.nunj +44 -0
  181. package/generator/templates/helpers/properties.html.nunj +61 -0
  182. package/generator/templates/helpers/status.html.nunj +33 -0
  183. package/generator/templates/helpers/tag.html.nunj +4 -0
  184. package/generator/templates/helpers/type.html.nunj +11 -0
  185. package/generator/templates/index.ts.nunj +7 -0
  186. package/generator/templates/page-header.html.nunj +5 -0
  187. package/generator/templates/page-wrapper.ts.nunj +69 -0
  188. package/generator/templates/page.ts.nunj +104 -0
  189. package/generator/templates/parts/examples.html.nunj +11 -0
  190. package/generator/templates/parts/member-examples.html.nunj +12 -0
  191. package/generator/templates/parts/member-remarks.html.nunj +8 -0
  192. package/generator/templates/parts/page-tags.html.nunj +10 -0
  193. package/generator/templates/parts/remarks.html.nunj +10 -0
  194. package/generator/templates/parts/see-also.html.nunj +23 -0
  195. package/generator/templates/parts/usage-notes.html.nunj +8 -0
  196. package/generator/templates/playgrounds.ts.nunj +63 -0
  197. package/generator/templates/routes.ts.nunj +53 -0
  198. package/generator/templates/symbol/decorators.html.nunj +12 -0
  199. package/generator/templates/symbol/details.html.nunj +62 -0
  200. package/generator/templates/symbol/extended-by.html.nunj +17 -0
  201. package/generator/templates/symbol/header.html.nunj +22 -0
  202. package/generator/templates/symbol/members.html.nunj +303 -0
  203. package/generator/templates/symbol/page.html.nunj +76 -0
  204. package/generator/templates/symbol/see-also.html.nunj +16 -0
  205. package/generator/vite/angular/ANALOG-LICENSE +21 -0
  206. package/generator/vite/angular/analog-provenance.json +880 -0
  207. package/generator/vite/angular/index.d.ts +14 -0
  208. package/generator/vite/angular/index.js +7300 -0
  209. package/generator/vite/angular-compatibility.d.ts +6 -0
  210. package/generator/vite/angular-composition.d.ts +68 -0
  211. package/generator/vite/angular-version.d.ts +38 -0
  212. package/generator/vite/application-builder.js +336 -0
  213. package/generator/vite/application-builder.schema.json +46 -0
  214. package/generator/vite/application.d.ts +105 -0
  215. package/generator/vite/assets.d.ts +11 -0
  216. package/generator/vite/bounded-close.d.ts +33 -0
  217. package/generator/vite/component-updates.d.ts +21 -0
  218. package/generator/vite/configuration.d.ts +3 -0
  219. package/generator/vite/demo-application.d.ts +34 -0
  220. package/generator/vite/dev-server-builder.js +339 -0
  221. package/generator/vite/dev-server-builder.schema.json +27 -0
  222. package/generator/vite/dev-styles.d.ts +65 -0
  223. package/generator/vite/diagnostics.d.ts +4 -0
  224. package/generator/vite/external-probes.d.ts +40 -0
  225. package/generator/vite/host-updates.d.ts +212 -0
  226. package/generator/vite/index.d.ts +13 -0
  227. package/generator/vite/index.js +11949 -0
  228. package/generator/vite/lease.d.ts +6 -0
  229. package/generator/vite/lifecycle.d.ts +120 -0
  230. package/generator/vite/mime.d.ts +2 -0
  231. package/generator/vite/missing-paths.d.ts +44 -0
  232. package/generator/vite/options.d.ts +87 -0
  233. package/generator/vite/output-watch.d.ts +41 -0
  234. package/generator/vite/paths.d.ts +7 -0
  235. package/generator/vite/plugin.d.ts +3 -0
  236. package/generator/vite/prerender-entry.js +465 -0
  237. package/generator/vite/prerender-runtime.d.ts +79 -0
  238. package/generator/vite/prerender.d.ts +29 -0
  239. package/generator/vite/production.d.ts +66 -0
  240. package/generator/vite/progress.d.ts +33 -0
  241. package/generator/vite/restore-theme.js +13 -0
  242. package/generator/vite/route-inventory.d.ts +24 -0
  243. package/generator/vite/ssr-renderer-control.d.ts +1 -0
  244. package/generator/vite/ssr-renderer-entry.js +444 -0
  245. package/generator/vite/ssr-renderer-protocol.d.ts +101 -0
  246. package/generator/vite/ssr-renderer.d.ts +74 -0
  247. package/generator/vite/theme-index.d.ts +13 -0
  248. package/generator/vite/tsconfig-paths.d.ts +64 -0
  249. package/generator/vite/vite-event-source.d.ts +198 -0
  250. package/generator/vite/vite-version.d.ts +26 -0
  251. package/generator/vite/watch-inputs.d.ts +39 -0
  252. package/generator/worker/entry.d.ts +1 -0
  253. package/generator/worker/entry.js +614 -0
  254. package/generator/worker/index.d.ts +156 -0
  255. package/generator/worker/index.js +1030 -0
  256. package/generator/worker/protocol.d.ts +160 -0
  257. package/helpers/angular/get-component-decorator.js +6 -6
  258. package/helpers/angular/get-component-decorator.js.map +1 -1
  259. package/helpers/angular/get-directive-decorator.js +3 -3
  260. package/helpers/angular/get-directive-decorator.js.map +1 -1
  261. package/helpers/angular/get-pipe-decorator.js +3 -3
  262. package/helpers/angular/get-pipe-decorator.js.map +1 -1
  263. package/helpers/build-indexes.js +5 -2
  264. package/helpers/build-indexes.js.map +1 -1
  265. package/helpers/construct-page-keyword.js +2 -1
  266. package/helpers/construct-page-keyword.js.map +1 -1
  267. package/helpers/extract-selectors.d.ts +1 -1
  268. package/helpers/extract-selectors.js +5 -3
  269. package/helpers/extract-selectors.js.map +1 -1
  270. package/helpers/filter-useless-members.d.ts +1 -1
  271. package/helpers/format-cache.d.ts +34 -0
  272. package/helpers/format-cache.js +26 -0
  273. package/helpers/format-cache.js.map +1 -0
  274. package/helpers/format-code.d.ts +2 -1
  275. package/helpers/format-code.js +20 -4
  276. package/helpers/format-code.js.map +1 -1
  277. package/helpers/import-fresh-esm.js.map +1 -1
  278. package/helpers/index.d.ts +2 -0
  279. package/helpers/index.js +2 -0
  280. package/helpers/index.js.map +1 -1
  281. package/helpers/keyword-heading-title.d.ts +7 -0
  282. package/helpers/keyword-heading-title.js +21 -0
  283. package/helpers/keyword-heading-title.js.map +1 -0
  284. package/helpers/markdown-to-html.js +3 -3
  285. package/helpers/markdown-to-html.js.map +1 -1
  286. package/helpers/navigation-title-order.d.ts +8 -0
  287. package/helpers/navigation-title-order.js +15 -0
  288. package/helpers/navigation-title-order.js.map +1 -0
  289. package/helpers/playground/get-playground-inputs.js +8 -4
  290. package/helpers/playground/get-playground-inputs.js.map +1 -1
  291. package/helpers/playground/get-playground-template-inputs.js +2 -1
  292. package/helpers/playground/get-playground-template-inputs.js.map +1 -1
  293. package/helpers/presentation.d.ts +7 -7
  294. package/helpers/presentation.js +23 -23
  295. package/helpers/presentation.js.map +1 -1
  296. package/helpers/print.js +32 -5
  297. package/helpers/print.js.map +1 -1
  298. package/helpers/process-snippets.d.ts +1 -1
  299. package/helpers/process-snippets.js +3 -3
  300. package/helpers/process-snippets.js.map +1 -1
  301. package/helpers/snippets-from-asset.d.ts +1 -1
  302. package/helpers/snippets-from-asset.js +2 -2
  303. package/helpers/snippets-from-asset.js.map +1 -1
  304. package/helpers/sort-navigation-entities.js +2 -1
  305. package/helpers/sort-navigation-entities.js.map +1 -1
  306. package/helpers/stable-generated-id.d.ts +2 -0
  307. package/helpers/stable-generated-id.js +12 -0
  308. package/helpers/stable-generated-id.js.map +1 -0
  309. package/helpers/text-order.d.ts +8 -0
  310. package/helpers/text-order.js +26 -0
  311. package/helpers/text-order.js.map +1 -0
  312. package/helpers/to-template-string.d.ts +5 -1
  313. package/helpers/to-template-string.js +7 -2
  314. package/helpers/to-template-string.js.map +1 -1
  315. package/helpers/typescript/member/get-inherited-parent.d.ts +1 -1
  316. package/helpers/typescript/member/get-inherited-parent.js +2 -2
  317. package/helpers/typescript/member/get-inherited-parent.js.map +1 -1
  318. package/helpers/typescript/node/sort-by-nodes-name.d.ts +4 -2
  319. package/helpers/typescript/node/sort-by-nodes-name.js +6 -3
  320. package/helpers/typescript/node/sort-by-nodes-name.js.map +1 -1
  321. package/helpers/typescript/property/get-property-assignment.js.map +1 -1
  322. package/interfaces/code-block-options.d.ts +5 -0
  323. package/interfaces/configuration.d.ts +84 -1
  324. package/package.json +87 -29
  325. package/parsers/helpers/number.d.ts +1 -1
  326. package/parsers/helpers/number.js +2 -2
  327. package/parsers/helpers/number.js.map +1 -1
  328. package/parsers/helpers/param-value.d.ts +1 -1
  329. package/parsers/helpers/param-value.js +2 -2
  330. package/parsers/helpers/param-value.js.map +1 -1
  331. package/parsers/helpers/param.js +3 -3
  332. package/parsers/helpers/param.js.map +1 -1
  333. package/parsers/parse-code-block-params.d.ts +11 -2
  334. package/parsers/parse-code-block-params.js +50 -18
  335. package/parsers/parse-code-block-params.js.map +1 -1
  336. package/parsers/parse-snippet.js +10 -10
  337. package/parsers/parse-snippet.js.map +1 -1
  338. package/schematics/collection.json +34 -23
  339. package/schematics/migrate-to-vite/analyze.d.ts +76 -0
  340. package/schematics/migrate-to-vite/analyze.js +859 -0
  341. package/schematics/migrate-to-vite/analyze.js.map +1 -0
  342. package/schematics/migrate-to-vite/index.d.ts +9 -0
  343. package/schematics/migrate-to-vite/index.js +585 -0
  344. package/schematics/migrate-to-vite/index.js.map +1 -0
  345. package/schematics/migrate-to-vite/legacy-folder.d.ts +84 -0
  346. package/schematics/migrate-to-vite/legacy-folder.js +340 -0
  347. package/schematics/migrate-to-vite/legacy-folder.js.map +1 -0
  348. package/schematics/migrate-to-vite/report.d.ts +32 -0
  349. package/schematics/migrate-to-vite/report.js +97 -0
  350. package/schematics/migrate-to-vite/report.js.map +1 -0
  351. package/schematics/migrate-to-vite/schema.d.ts +13 -0
  352. package/schematics/migrate-to-vite/schema.js +3 -0
  353. package/schematics/migrate-to-vite/schema.js.map +1 -0
  354. package/schematics/migrate-to-vite/schema.json +31 -0
  355. package/schematics/migrate-to-vite/setup/dependencies.d.ts +64 -0
  356. package/schematics/migrate-to-vite/setup/dependencies.js +183 -0
  357. package/schematics/migrate-to-vite/setup/dependencies.js.map +1 -0
  358. package/schematics/migrate-to-vite/setup/index.d.ts +6 -0
  359. package/schematics/migrate-to-vite/setup/index.js +13 -0
  360. package/schematics/migrate-to-vite/setup/index.js.map +1 -0
  361. package/schematics/migrate-to-vite/setup/json-file.d.ts +51 -0
  362. package/schematics/migrate-to-vite/setup/json-file.js +115 -0
  363. package/schematics/migrate-to-vite/setup/json-file.js.map +1 -0
  364. package/schematics/migrate-to-vite/setup/source.d.ts +30 -0
  365. package/schematics/migrate-to-vite/setup/source.js +202 -0
  366. package/schematics/migrate-to-vite/setup/source.js.map +1 -0
  367. package/schematics/migrate-to-vite/setup/targets.d.ts +51 -0
  368. package/schematics/migrate-to-vite/setup/targets.js +48 -0
  369. package/schematics/migrate-to-vite/setup/targets.js.map +1 -0
  370. package/schematics/migrate-to-vite/setup/vite-config.d.ts +100 -0
  371. package/schematics/migrate-to-vite/setup/vite-config.js +175 -0
  372. package/schematics/migrate-to-vite/setup/vite-config.js.map +1 -0
  373. package/schematics/migrate-to-vite/setup/workspace.d.ts +105 -0
  374. package/schematics/migrate-to-vite/setup/workspace.js +245 -0
  375. package/schematics/migrate-to-vite/setup/workspace.js.map +1 -0
  376. package/schematics/migrate-to-vite/state.d.ts +65 -0
  377. package/schematics/migrate-to-vite/state.js +92 -0
  378. package/schematics/migrate-to-vite/state.js.map +1 -0
  379. package/schematics/migrate-to-vite/testing/fixtures.d.ts +30 -0
  380. package/schematics/migrate-to-vite/testing/fixtures.js +306 -0
  381. package/schematics/migrate-to-vite/testing/fixtures.js.map +1 -0
  382. package/schematics/migrate-to-vite/update-note.d.ts +6 -0
  383. package/schematics/migrate-to-vite/update-note.js +23 -0
  384. package/schematics/migrate-to-vite/update-note.js.map +1 -0
  385. package/schematics/migration.json +5 -0
  386. package/schematics/migrations/standalone-pages/index.js +7 -6
  387. package/schematics/migrations/standalone-pages/index.js.map +1 -1
  388. package/schematics/vite-setup/index.d.ts +24 -0
  389. package/schematics/vite-setup/index.js +212 -0
  390. package/schematics/vite-setup/index.js.map +1 -0
  391. package/schematics/vite-setup/schema.d.ts +7 -0
  392. package/schematics/vite-setup/schema.js +3 -0
  393. package/schematics/vite-setup/schema.js.map +1 -0
  394. package/schematics/vite-setup/schema.json +19 -0
  395. package/scripts/restore-theme.js +9 -2
  396. package/templates/api/class-declaration.html.nunj +5 -3
  397. package/templates/context.ts.nunj +3 -0
  398. package/templates/demo-app.ts.nunj +37 -0
  399. package/templates/demo-routes.ts.nunj +23 -0
  400. package/templates/helpers/badge.html.nunj +1 -1
  401. package/templates/helpers/status.html.nunj +4 -8
  402. package/templates/index.ts.nunj +5 -0
  403. package/templates/page-wrapper.ts.nunj +30 -2
  404. package/templates/page.ts.nunj +33 -1
  405. package/templates/parts/page-tags.html.nunj +1 -1
  406. package/templates/playgrounds.ts.nunj +8 -9
  407. package/templates/routes.ts.nunj +10 -1
  408. package/templates/symbol/decorators.html.nunj +12 -0
  409. package/templates/symbol/details.html.nunj +62 -0
  410. package/templates/symbol/extended-by.html.nunj +17 -0
  411. package/templates/symbol/header.html.nunj +22 -0
  412. package/templates/symbol/members.html.nunj +303 -0
  413. package/templates/symbol/page.html.nunj +76 -0
  414. package/templates/symbol/see-also.html.nunj +16 -0
  415. package/engine/.cache/apps/ng-doc/docs/api-documentation/auto-generation/ng-doc.page.mjs +0 -20
  416. package/engine/.cache/apps/ng-doc/docs/api-documentation/documenting-declarations/ng-doc.page.mjs +0 -20
  417. package/engine/.cache/apps/ng-doc/docs/api-documentation/rendering-api/ng-doc.page.mjs +0 -19
  418. package/engine/.cache/apps/ng-doc/docs/customization/icons/ng-doc.page.mjs +0 -19
  419. package/engine/.cache/apps/ng-doc/docs/customization/layout/ng-doc.page.mjs +0 -19
  420. package/engine/.cache/apps/ng-doc/docs/customization/page-processors/ng-doc.page.mjs +0 -19
  421. package/engine/.cache/apps/ng-doc/docs/customization/page-skeleton/ng-doc.page.mjs +0 -19
  422. package/engine/.cache/apps/ng-doc/docs/customization/search/ng-doc.page.mjs +0 -19
  423. package/engine/.cache/apps/ng-doc/docs/customization/themes/ng-doc.page.mjs +0 -19
  424. package/engine/.cache/apps/ng-doc/docs/develop/ng-doc.page.mjs +0 -36
  425. package/engine/.cache/apps/ng-doc/docs/getting-started/configuration/ng-doc.page.mjs +0 -19
  426. package/engine/.cache/apps/ng-doc/docs/getting-started/installation/ng-doc.page.mjs +0 -19
  427. package/engine/.cache/apps/ng-doc/docs/getting-started/migrations/ng-doc.page.mjs +0 -18
  428. package/engine/.cache/apps/ng-doc/docs/getting-started/ssr/ng-doc.page.mjs +0 -19
  429. package/engine/.cache/apps/ng-doc/docs/getting-started/what-is-ng-doc/ng-doc.page.mjs +0 -19
  430. package/engine/.cache/apps/ng-doc/docs/ng-doc.api.mjs +0 -42
  431. package/engine/.cache/apps/ng-doc/docs/recipes/ignoring-file-lines/ng-doc.page.mjs +0 -18
  432. package/engine/.cache/apps/ng-doc/docs/recipes/performance/ng-doc.page.mjs +0 -19
  433. package/engine/.cache/apps/ng-doc/docs/writing-content/blockquotes/ng-doc.page.mjs +0 -18
  434. package/engine/.cache/apps/ng-doc/docs/writing-content/code-blocks/ng-doc.page.mjs +0 -18
  435. package/engine/.cache/apps/ng-doc/docs/writing-content/demo-and-demo-pane/ng-doc.page.mjs +0 -19
  436. package/engine/.cache/apps/ng-doc/docs/writing-content/images-videos-and-embeds/ng-doc.page.mjs +0 -18
  437. package/engine/.cache/apps/ng-doc/docs/writing-content/keywords/ng-doc.page.mjs +0 -17
  438. package/engine/.cache/apps/ng-doc/docs/writing-content/mermaid-diagrams/ng-doc.page.mjs +0 -18
  439. package/engine/.cache/apps/ng-doc/docs/writing-content/nunjucks/ng-doc.page.mjs +0 -18
  440. package/engine/.cache/apps/ng-doc/docs/writing-content/pages-and-categories/ng-doc.page.mjs +0 -18
  441. package/engine/.cache/apps/ng-doc/docs/writing-content/playground/ng-doc.page.mjs +0 -33
@@ -0,0 +1,64 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ /**
3
+ * The packages the Vite engine needs next to `@ng-doc/builder`, with the version ranges it is
4
+ * released and tested with (`ng-doc.viteEngine` in the package's own manifest), so the schematic of
5
+ * a release always installs that release's ranges. Each is a caret range (`^8.3.0`): npm installs
6
+ * the newest matching release, and nothing is pinned.
7
+ */
8
+ export declare function ngDocViteDependencies(): {
9
+ [name: string]: string;
10
+ };
11
+ /** Whether the Vite engine refuses to start with a version of this package outside its range. */
12
+ export declare function isEnforced(name: string): boolean;
13
+ /** A dependency the workspace has at a version outside the Vite engine's range. */
14
+ export interface DependencyMismatch {
15
+ name: string;
16
+ expected: string;
17
+ /** The specifier in `package.json`. */
18
+ found: string;
19
+ /** The installed version, when it is what lies outside the range. */
20
+ installed?: string;
21
+ }
22
+ /** The report line of a dependency mismatch, with the command that fixes an enforced one. */
23
+ export declare function dependencyMismatchText({ name, expected, found, installed, }: DependencyMismatch): string;
24
+ /**
25
+ * Whether a declared dependency specifier can resolve to a version inside `required` (a caret
26
+ * range): true when it does, false when it cannot, and undefined when the specifier is not a plain
27
+ * version, caret or tilde range (a tag, a URL, `>=`, `||`, `x`), which this check cannot tell.
28
+ * @param declared - The specifier in the workspace's `package.json`.
29
+ * @param required - The engine's range, such as `^8.3.0`.
30
+ */
31
+ export declare function admitsRange(declared: string, required: string): boolean | undefined;
32
+ /**
33
+ * Adds the missing Vite engine dependencies to the `devDependencies` of `package.json`. A package
34
+ * the workspace already declares is left as it is: nothing is added when its installed version
35
+ * (or, before an install, its specifier) satisfies the engine's range, and it is returned as a
36
+ * mismatch when it cannot.
37
+ */
38
+ export declare function addNgDocViteDependencies(tree: Tree, dependencies?: {
39
+ [name: string]: string;
40
+ }): {
41
+ added: {
42
+ [name: string]: string;
43
+ };
44
+ mismatches: DependencyMismatch[];
45
+ };
46
+ /**
47
+ * The SHA-256 of a file's content without its layout, as recorded in the migration state. The
48
+ * Angular CLI formats the files a schematic wrote with the workspace's Prettier configuration, so
49
+ * whitespace and trailing commas are left out: a formatted file still counts as the one the
50
+ * migration wrote, and any other change counts as the user's.
51
+ */
52
+ export declare function hashContent(content: string): string;
53
+ /**
54
+ * Adds a line to `.gitignore` when no existing line already ignores it. Returns whether the file
55
+ * changed; false also when the workspace has no `.gitignore`.
56
+ * @param tree - The workspace tree.
57
+ * @param line - The line, such as `/.cache/ng-doc`.
58
+ * @param comment - The comment written above it.
59
+ */
60
+ export declare function addGitIgnoreLine(tree: Tree, line: string, comment?: string): boolean;
61
+ /** Reads `compilerOptions.paths` of a tsconfig and of the files it extends, nearest first. */
62
+ export declare function readTsconfigPaths(tree: Tree, file: string): {
63
+ [alias: string]: string[];
64
+ } | undefined;
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngDocViteDependencies = ngDocViteDependencies;
4
+ exports.isEnforced = isEnforced;
5
+ exports.dependencyMismatchText = dependencyMismatchText;
6
+ exports.admitsRange = admitsRange;
7
+ exports.addNgDocViteDependencies = addNgDocViteDependencies;
8
+ exports.hashContent = hashContent;
9
+ exports.addGitIgnoreLine = addGitIgnoreLine;
10
+ exports.readTsconfigPaths = readTsconfigPaths;
11
+ const crypto_1 = require("crypto");
12
+ const fs_1 = require("fs");
13
+ const path_1 = require("path");
14
+ const json_file_1 = require("./json-file");
15
+ /**
16
+ * The packages the Vite engine needs next to `@ng-doc/builder`, with the version ranges it is
17
+ * released and tested with (`ng-doc.viteEngine` in the package's own manifest), so the schematic of
18
+ * a release always installs that release's ranges. Each is a caret range (`^8.3.0`): npm installs
19
+ * the newest matching release, and nothing is pinned.
20
+ */
21
+ function ngDocViteDependencies() {
22
+ const manifest = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../../package.json'), 'utf8'));
23
+ return Object.fromEntries(Object.entries(manifest['ng-doc']?.viteEngine ?? {}).sort());
24
+ }
25
+ /**
26
+ * The packages whose version the Vite engine checks when it starts: it refuses any version outside
27
+ * the range, while the others only differ from what it is tested with.
28
+ */
29
+ const ENFORCED = new Set(['vite']);
30
+ /** Whether the Vite engine refuses to start with a version of this package outside its range. */
31
+ function isEnforced(name) {
32
+ return ENFORCED.has(name);
33
+ }
34
+ /** The report line of a dependency mismatch, with the command that fixes an enforced one. */
35
+ function dependencyMismatchText({ name, expected, found, installed, }) {
36
+ const is = `\`${name}\` is \`${found}\`${installed ? ` (installed \`${installed}\`)` : ''}`;
37
+ return isEnforced(name)
38
+ ? `${is}; the Vite engine requires \`${expected}\` and does not start ` +
39
+ `with another version. Update it: \`npm i -D ${name}@${expected}\`.`
40
+ : `${is}; the Vite engine is tested with \`${expected}\`.`;
41
+ }
42
+ const VERSION = /^v?(\d+)\.(\d+)\.(\d+)(?:[-+][0-9A-Za-z.+-]*)?$/;
43
+ function parseVersion(text) {
44
+ const match = VERSION.exec(text.trim());
45
+ return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : undefined;
46
+ }
47
+ function compare(left, right) {
48
+ for (let index = 0; index < 3; index++) {
49
+ if (left[index] !== right[index])
50
+ return left[index] - right[index];
51
+ }
52
+ return 0;
53
+ }
54
+ /** The lower bound and the exclusive upper bound a caret range (`^8.3.0`, major ≥ 1) admits. */
55
+ function caretBounds(range) {
56
+ const version = range.startsWith('^') ? parseVersion(range.slice(1)) : undefined;
57
+ return version && version[0] > 0 ? [version, [version[0] + 1, 0, 0]] : undefined;
58
+ }
59
+ /**
60
+ * Whether a declared dependency specifier can resolve to a version inside `required` (a caret
61
+ * range): true when it does, false when it cannot, and undefined when the specifier is not a plain
62
+ * version, caret or tilde range (a tag, a URL, `>=`, `||`, `x`), which this check cannot tell.
63
+ * @param declared - The specifier in the workspace's `package.json`.
64
+ * @param required - The engine's range, such as `^8.3.0`.
65
+ */
66
+ function admitsRange(declared, required) {
67
+ const bounds = caretBounds(required);
68
+ if (!bounds)
69
+ return undefined;
70
+ const [low, high] = bounds;
71
+ const text = declared.trim();
72
+ const operator = /^[\^~=]/.exec(text)?.[0];
73
+ const version = parseVersion(operator ? text.slice(1) : text);
74
+ if (!version)
75
+ return undefined;
76
+ if (!operator || operator === '=')
77
+ return compare(version, low) >= 0 && compare(version, high) < 0;
78
+ // `^0.y.z` and `~x.y.z` stay below the next minor; `^x.y.z` below the next major.
79
+ const upper = operator === '~' || version[0] === 0 ? [version[0], version[1] + 1, 0] : [version[0] + 1, 0, 0];
80
+ return compare(version, high) < 0 && compare(upper, low) > 0;
81
+ }
82
+ /**
83
+ * The version of a package installed in the workspace's `node_modules`, when the tree can read
84
+ * it (a real workspace; schematic test trees have none).
85
+ */
86
+ function installedVersion(tree, name) {
87
+ const file = `node_modules/${name}/package.json`;
88
+ if (!tree.exists(file))
89
+ return undefined;
90
+ try {
91
+ const version = JSON.parse(tree.readText(file)).version;
92
+ return typeof version === 'string' ? version : undefined;
93
+ }
94
+ catch {
95
+ return undefined;
96
+ }
97
+ }
98
+ /**
99
+ * Adds the missing Vite engine dependencies to the `devDependencies` of `package.json`. A package
100
+ * the workspace already declares is left as it is: nothing is added when its installed version
101
+ * (or, before an install, its specifier) satisfies the engine's range, and it is returned as a
102
+ * mismatch when it cannot.
103
+ */
104
+ function addNgDocViteDependencies(tree, dependencies = ngDocViteDependencies()) {
105
+ const added = {};
106
+ const mismatches = [];
107
+ if (!tree.exists('package.json'))
108
+ return { added, mismatches };
109
+ const json = new json_file_1.JsonFile(tree, 'package.json');
110
+ for (const [name, expected] of Object.entries(dependencies)) {
111
+ const found = json.get(['dependencies', name]) ??
112
+ json.get(['devDependencies', name]);
113
+ if (found === undefined) {
114
+ json.modify(['devDependencies', name], expected);
115
+ added[name] = expected;
116
+ continue;
117
+ }
118
+ const installed = installedVersion(tree, name);
119
+ if (installed !== undefined) {
120
+ if (admitsRange(installed, expected) === false) {
121
+ mismatches.push({ name, expected, found, installed });
122
+ }
123
+ }
124
+ else if (admitsRange(found, expected) === false) {
125
+ mismatches.push({ name, expected, found });
126
+ }
127
+ }
128
+ return { added, mismatches };
129
+ }
130
+ /**
131
+ * The SHA-256 of a file's content without its layout, as recorded in the migration state. The
132
+ * Angular CLI formats the files a schematic wrote with the workspace's Prettier configuration, so
133
+ * whitespace and trailing commas are left out: a formatted file still counts as the one the
134
+ * migration wrote, and any other change counts as the user's.
135
+ */
136
+ function hashContent(content) {
137
+ const normalized = content.replace(/\s+/g, '').replace(/,(?=[)\]}])/g, '');
138
+ return (0, crypto_1.createHash)('sha256').update(normalized).digest('hex');
139
+ }
140
+ const CACHE_LINES = new Set(['.cache', '.cache/', '.cache/ng-doc', '.cache/ng-doc/']);
141
+ /**
142
+ * Adds a line to `.gitignore` when no existing line already ignores it. Returns whether the file
143
+ * changed; false also when the workspace has no `.gitignore`.
144
+ * @param tree - The workspace tree.
145
+ * @param line - The line, such as `/.cache/ng-doc`.
146
+ * @param comment - The comment written above it.
147
+ */
148
+ function addGitIgnoreLine(tree, line, comment = 'NgDoc cache') {
149
+ if (!tree.exists('.gitignore'))
150
+ return false;
151
+ const text = tree.readText('.gitignore');
152
+ const wanted = line.replace(/^\//, '');
153
+ const covered = text
154
+ .split(/\r?\n/)
155
+ .map((entry) => entry.trim().replace(/^\//, ''))
156
+ .some((entry) => entry === wanted ||
157
+ entry === `${wanted}/` ||
158
+ (CACHE_LINES.has(entry) && CACHE_LINES.has(wanted)));
159
+ if (covered)
160
+ return false;
161
+ const separator = text === '' || text.endsWith('\n') ? '' : '\n';
162
+ tree.overwrite('.gitignore', `${text}${separator}\n# ${comment}\n${line}\n`);
163
+ return true;
164
+ }
165
+ /** Reads `compilerOptions.paths` of a tsconfig and of the files it extends, nearest first. */
166
+ function readTsconfigPaths(tree, file) {
167
+ const seen = new Set();
168
+ let current = file;
169
+ while (current && tree.exists(current) && !seen.has(current)) {
170
+ seen.add(current);
171
+ const json = new json_file_1.JsonFile(tree, current);
172
+ const paths = json.get(['compilerOptions', 'paths']);
173
+ if (paths && typeof paths === 'object')
174
+ return paths;
175
+ const extended = json.get(['extends']);
176
+ current =
177
+ typeof extended === 'string' && extended.startsWith('.')
178
+ ? path_1.posix.join(path_1.posix.dirname(current), extended)
179
+ : undefined;
180
+ }
181
+ return undefined;
182
+ }
183
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../../../libs/builder/schematics/migrate-to-vite/setup/dependencies.ts"],"names":[],"mappings":";;AAaA,sDAKC;AASD,gCAEC;AAaD,wDAWC;AA+BD,kCAcC;AAuBD,4DA2BC;AAQD,kCAGC;AAWD,4CAqBC;AAGD,8CAkBC;AAnND,mCAAoC;AACpC,2BAAkC;AAClC,+BAAmC;AAEnC,2CAAuC;AAEvC;;;;;GAKG;AACH,SAAgB,qBAAqB;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,uBAAuB,CAAC,EAAE,MAAM,CAAC,CAEzF,CAAC;IACF,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACzF,CAAC;AAED;;;GAGG;AAC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AC;AAED,8FAA8F;AAC9F,SAAgB,iBAAiB,CAC/B,IAAU,EACV,IAAY;IAEZ,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,IAAI,OAAO,GAAuB,IAAI,CAAC;IACvC,OAAO,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClB,MAAM,IAAI,GAAa,IAAI,oBAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAY,CAAC;QAChE,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAsC,CAAC;QACtF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAY,CAAC;QAClD,OAAO;YACL,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;gBACtD,CAAC,CAAC,YAAK,CAAC,IAAI,CAAC,YAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;gBAC9C,CAAC,CAAC,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './dependencies';
2
+ export * from './json-file';
3
+ export * from './source';
4
+ export * from './targets';
5
+ export * from './vite-config';
6
+ export * from './workspace';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // The building blocks of an NgDoc project on the Vite engine: the Vite configuration, the Angular
5
+ // CLI targets, the dependencies and the workspace files. The migration schematic assembles them
6
+ // from a legacy build target; a new project can assemble them from its own options.
7
+ tslib_1.__exportStar(require("./dependencies"), exports);
8
+ tslib_1.__exportStar(require("./json-file"), exports);
9
+ tslib_1.__exportStar(require("./source"), exports);
10
+ tslib_1.__exportStar(require("./targets"), exports);
11
+ tslib_1.__exportStar(require("./vite-config"), exports);
12
+ tslib_1.__exportStar(require("./workspace"), exports);
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/schematics/migrate-to-vite/setup/index.ts"],"names":[],"mappings":";;;AAAA,kGAAkG;AAClG,gGAAgG;AAChG,oFAAoF;AACpF,yDAA+B;AAC/B,sDAA4B;AAC5B,mDAAyB;AACzB,oDAA0B;AAC1B,wDAA8B;AAC9B,sDAA4B"}
@@ -0,0 +1,51 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ /** A path into a JSON document: property names and array indexes. */
3
+ export type JsonPath = Array<string | number>;
4
+ /**
5
+ * Where `modify` inserts a new property: `undefined` keeps the properties sorted by name (as
6
+ * ng-morph's `JSONFile` does), `false` appends, a function returns the index among the existing
7
+ * property names.
8
+ */
9
+ export type JsonInsertion = ((properties: string[]) => number) | false | undefined;
10
+ /**
11
+ * A JSON file of the tree, read as JSONC the way the Angular CLI reads `angular.json`, Nx
12
+ * `project.json` and tsconfig files: comments and trailing commas are accepted. Edits are applied
13
+ * as text edits, so comments, key order and layout outside the edited value stay as they were.
14
+ */
15
+ export declare class JsonFile {
16
+ private readonly tree;
17
+ readonly path: string;
18
+ private content;
19
+ private ast;
20
+ /**
21
+ * Reads the file.
22
+ * @param tree - The workspace tree.
23
+ * @param path - The file, workspace-relative.
24
+ */
25
+ constructor(tree: Tree, path: string);
26
+ private root;
27
+ /**
28
+ * The value at a path, or undefined.
29
+ * @param path - The path; empty for the whole document.
30
+ */
31
+ get(path: JsonPath): unknown;
32
+ /**
33
+ * Sets the value at a path (`undefined` removes it) and writes the file.
34
+ * @param path - The path.
35
+ * @param value - The new value.
36
+ * @param insertion - Where a new property goes.
37
+ */
38
+ modify(path: JsonPath, value: unknown, insertion?: JsonInsertion): void;
39
+ /**
40
+ * Removes the value at a path, if there is one.
41
+ * @param path - The path.
42
+ */
43
+ remove(path: JsonPath): void;
44
+ /**
45
+ * Renames the property at a path by rewriting its key only, so its value keeps its text, its
46
+ * comments and its place among its siblings. Does nothing when there is no such property.
47
+ * @param path - The path of the property.
48
+ * @param name - The new name, which no sibling may have.
49
+ */
50
+ rename(path: JsonPath, name: string): void;
51
+ }
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonFile = void 0;
4
+ const jsonc_parser_1 = require("jsonc-parser");
5
+ const text_order_1 = require("../../../helpers/text-order");
6
+ /**
7
+ * The indentation and line ending the file already uses, so an edit keeps its layout. Files
8
+ * without an indented line get two spaces.
9
+ * @param content - The file's text.
10
+ */
11
+ function formattingOf(content) {
12
+ const indented = /^([ \t]+)\S/m.exec(content)?.[1];
13
+ const eol = content.includes('\r\n') ? '\r\n' : '\n';
14
+ if (indented?.startsWith('\t'))
15
+ return { insertSpaces: false, tabSize: 1, eol };
16
+ return { insertSpaces: true, tabSize: indented?.length ?? 2, eol };
17
+ }
18
+ /**
19
+ * A JSON file of the tree, read as JSONC the way the Angular CLI reads `angular.json`, Nx
20
+ * `project.json` and tsconfig files: comments and trailing commas are accepted. Edits are applied
21
+ * as text edits, so comments, key order and layout outside the edited value stay as they were.
22
+ */
23
+ class JsonFile {
24
+ /**
25
+ * Reads the file.
26
+ * @param tree - The workspace tree.
27
+ * @param path - The file, workspace-relative.
28
+ */
29
+ constructor(tree, path) {
30
+ this.tree = tree;
31
+ this.path = path;
32
+ if (!tree.exists(path))
33
+ throw new Error(`Could not read '${path}'.`);
34
+ this.content = tree.readText(path);
35
+ }
36
+ root() {
37
+ if (this.ast)
38
+ return this.ast;
39
+ const errors = [];
40
+ this.ast = (0, jsonc_parser_1.parseTree)(this.content, errors, {
41
+ allowTrailingComma: true,
42
+ disallowComments: false,
43
+ });
44
+ if (errors.length) {
45
+ const { error, offset } = errors[0];
46
+ throw new Error(`[${this.path}] ${(0, jsonc_parser_1.printParseErrorCode)(error)} at offset ${offset}.`);
47
+ }
48
+ return this.ast;
49
+ }
50
+ /**
51
+ * The value at a path, or undefined.
52
+ * @param path - The path; empty for the whole document.
53
+ */
54
+ get(path) {
55
+ const root = this.root();
56
+ if (!root)
57
+ return undefined;
58
+ const node = path.length ? (0, jsonc_parser_1.findNodeAtLocation)(root, path) : root;
59
+ return node ? (0, jsonc_parser_1.getNodeValue)(node) : undefined;
60
+ }
61
+ /**
62
+ * Sets the value at a path (`undefined` removes it) and writes the file.
63
+ * @param path - The path.
64
+ * @param value - The new value.
65
+ * @param insertion - Where a new property goes.
66
+ */
67
+ modify(path, value, insertion) {
68
+ const property = path[path.length - 1];
69
+ const getInsertionIndex = insertion === undefined
70
+ ? (properties) => [...properties, String(property)].sort(text_order_1.compareText).indexOf(String(property))
71
+ : insertion === false
72
+ ? undefined
73
+ : insertion;
74
+ const edits = (0, jsonc_parser_1.modify)(this.content, path, value, {
75
+ getInsertionIndex,
76
+ formattingOptions: formattingOf(this.content),
77
+ });
78
+ this.content = (0, jsonc_parser_1.applyEdits)(this.content, edits);
79
+ this.ast = undefined;
80
+ this.tree.overwrite(this.path, this.content);
81
+ }
82
+ /**
83
+ * Removes the value at a path, if there is one.
84
+ * @param path - The path.
85
+ */
86
+ remove(path) {
87
+ if (this.get(path) !== undefined)
88
+ this.modify(path, undefined);
89
+ }
90
+ /**
91
+ * Renames the property at a path by rewriting its key only, so its value keeps its text, its
92
+ * comments and its place among its siblings. Does nothing when there is no such property.
93
+ * @param path - The path of the property.
94
+ * @param name - The new name, which no sibling may have.
95
+ */
96
+ rename(path, name) {
97
+ const root = this.root();
98
+ const value = root && path.length ? (0, jsonc_parser_1.findNodeAtLocation)(root, path) : undefined;
99
+ const property = value?.parent;
100
+ const key = property?.type === 'property' ? property.children?.[0] : undefined;
101
+ if (!key)
102
+ return;
103
+ if (this.get([...path.slice(0, -1), name]) !== undefined) {
104
+ throw new Error(`[${this.path}] Cannot rename to '${name}': the property exists.`);
105
+ }
106
+ this.content =
107
+ this.content.slice(0, key.offset) +
108
+ JSON.stringify(name) +
109
+ this.content.slice(key.offset + key.length);
110
+ this.ast = undefined;
111
+ this.tree.overwrite(this.path, this.content);
112
+ }
113
+ }
114
+ exports.JsonFile = JsonFile;
115
+ //# sourceMappingURL=json-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-file.js","sourceRoot":"","sources":["../../../../../../libs/builder/schematics/migrate-to-vite/setup/json-file.ts"],"names":[],"mappings":";;;AACA,+CAUsB;AAEtB,4DAA0D;AAY1D;;;;GAIG;AACH,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,IAAI,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAChF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAa,QAAQ;IAInB;;;;OAIG;IACH,YACmB,IAAU,EAClB,IAAY;QADJ,SAAI,GAAJ,IAAI,CAAM;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAErB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,OAA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,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/E,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,uBAAuB,IAAI,yBAAyB,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,OAAO;YACV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;gBACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBACpB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF;AAhGD,4BAgGC"}
@@ -0,0 +1,30 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ /**
3
+ * Finds the root component of an application from its browser entry: the first argument of
4
+ * `bootstrapApplication(...)`, or the `bootstrap` component of the module passed to
5
+ * `bootstrapModule(...)`. Returns its workspace-relative file, or undefined when the entry does not
6
+ * follow either pattern.
7
+ */
8
+ export declare function findRootComponent(tree: Tree, browserEntry: string): string | undefined;
9
+ /**
10
+ * The name of the NgModule that a server entry exports as its default export
11
+ * (`export { AppServerModule as default } from './app/app.module.server'`, as `ng new
12
+ * --no-standalone --ssr` writes it, `export default AppServerModule`, or an exported decorated
13
+ * class), or undefined when the default export is anything else, such as a bootstrap function.
14
+ * @param tree - The workspace tree.
15
+ * @param file - The server entry, workspace-relative.
16
+ */
17
+ export declare function serverEntryNgModule(tree: Tree, file: string): string | undefined;
18
+ /** The import that provides `withNgDocContentReady`. */
19
+ export declare const CONTENT_READY_IMPORT = "import { withNgDocContentReady } from '@ng-doc/app/helpers';";
20
+ /**
21
+ * Wraps the default export of a server entry (`main.server.ts`) with `withNgDocContentReady`, so a
22
+ * prerendered page waits for its NgDoc content and a content failure fails the route. Returns the
23
+ * new text, the same text when it is already wrapped, or undefined when the default export is not
24
+ * an expression (`export { AppServerModule as default }`) and the entry needs a manual change.
25
+ *
26
+ * The change is two insertions: the import after the last import, in that import's quotes and
27
+ * semicolon style and the file's line ending, and the call around the exported expression. The
28
+ * rest of the file keeps its bytes, so the diff a user reviews is exactly what the migration does.
29
+ */
30
+ export declare function wrapServerEntry(file: string, text: string): string | undefined;