@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,59 @@
1
+ import { type FileSystemHost, ts } from 'ts-morph';
2
+ /**
3
+ * Generator-owned roots hold this generator's own output and cache. They are never semantic
4
+ * inputs: the TypeScript program must not resolve into them and dependency tracking must not
5
+ * record them, otherwise a generation's own commit would change the next generation's
6
+ * semantic scope. Every other path resolves exactly as through the real file system.
7
+ */
8
+ export declare class OwnedRoots {
9
+ private readonly roots;
10
+ /** The raw reads that began with a byte order mark, which the program's text omits. */
11
+ private readonly marked;
12
+ constructor(roots: readonly string[]);
13
+ has(file: string): boolean;
14
+ /** The owned root containing a path, if any. */
15
+ describe(file: string): string | undefined;
16
+ /**
17
+ * A non-owned path that is a symlink into an owned root stays unresolved: it is read through
18
+ * its own path like any other input instead of resolving to a hidden owned file.
19
+ */
20
+ realpath(path: string, resolve: (path: string) => string): string;
21
+ /** Notes a raw text read of the program's file system (see {@link contentDigest}). */
22
+ recordRead(file: string, text: string): void;
23
+ /**
24
+ * The content digest of a program file whose text is `text`. TypeScript drops a leading byte
25
+ * order mark from the text it compiles, while every other reader (and the refresher) digests the
26
+ * file's bytes; so a file read with one is digested from its raw read, and the recorded digest
27
+ * matches theirs.
28
+ */
29
+ contentDigest(file: string, text: string): string;
30
+ /** A module resolution host view without owned paths; owned probes are neither made nor recorded. */
31
+ resolutionHost(host: ts.ModuleResolutionHost): ts.ModuleResolutionHost;
32
+ /** The real ts-morph file system with owned paths absent. Writes are never issued by semantic. */
33
+ fileSystem(): FileSystemHost;
34
+ }
35
+ type NotFoundError = new (path: string) => Error;
36
+ /**
37
+ * Returns the error class a real ts-morph file system throws for a missing file. ts-morph's
38
+ * transactional file system recognises "does not exist" only by that class (for example in
39
+ * readFileIfExistsSync), and the class is not part of its public declarations. It is therefore
40
+ * observed from the real host itself. If a ts-morph upgrade stops reporting a missing file this
41
+ * way, owned-root hiding cannot be enforced and synchronization fails loudly instead of silently
42
+ * treating owned files as unreadable.
43
+ */
44
+ export declare function missingFileError(fileSystem: FileSystemHost): NotFoundError;
45
+ /**
46
+ * The first owned root an API scope pattern can reach, judged from the patterns and the file
47
+ * shapes the generator writes, not from files that exist now: a scope that can match generated
48
+ * output would otherwise start failing only after the first commit. A generated path is excluded
49
+ * when a scope exclude matches it or one of its directories, as the scope scan's ignore does.
50
+ * Matches that exist anyway are still rejected by the caller's actual-match check.
51
+ */
52
+ export declare function ownedRootReach(workspaceRoot: string, include: readonly string[], exclude: readonly string[], roots: {
53
+ outputRoot: string;
54
+ cacheRoot: string;
55
+ }): {
56
+ root: string;
57
+ pattern: string;
58
+ } | undefined;
59
+ export {};
@@ -0,0 +1,55 @@
1
+ import { Project, ts } from 'ts-morph';
2
+ import type { DiscoverySnapshot } from '../contracts.js';
3
+ import { type TrackedFiles, SemanticFailure } from './dependencies.js';
4
+ import { OwnedRoots } from './owned-roots.js';
5
+ import type { ProgramObservations } from './program-observations.js';
6
+ /**
7
+ * The program lifecycle: builds the TypeScript Project of a discovery snapshot and records every
8
+ * observation it depends on. Per-importer tracking lives in `program-observations.ts`, retention
9
+ * in `program-retention.ts`.
10
+ */
11
+ export declare function ownedOverlap(kind: string, path: string, owned: OwnedRoots): SemanticFailure;
12
+ /**
13
+ * The formatter configuration files probed in the workspace root and each of its ancestors:
14
+ * formatting helpers receive the workspace explicitly, so their configuration is a program input.
15
+ */
16
+ export declare const FORMATTER_CONFIGURATION_FILES: readonly string[];
17
+ /** Records the existence (and the content, when present) of every formatter configuration file. */
18
+ export declare function trackFormatterConfiguration(workspaceRoot: string, files: TrackedFiles): void;
19
+ /** A built program: its Project, the members of each API scope, and the owned-root view. */
20
+ export interface BuiltProgram {
21
+ project: Project;
22
+ /** `${entryId}:${scopeId}` → the sorted scope matches. */
23
+ scopes: Map<string, string[]>;
24
+ owned: OwnedRoots;
25
+ /** The root names of the built program (see `ProgramMirror.roots`). */
26
+ roots: readonly string[];
27
+ }
28
+ /** The root membership of a discovery snapshot's program (see {@link programMembers}). */
29
+ export interface ProgramMembers {
30
+ parsed: ts.ParsedCommandLine;
31
+ owned: OwnedRoots;
32
+ /** `${entryId}:${scopeId}` → the sorted scope matches. */
33
+ scopes: Map<string, string[]>;
34
+ /** The files the Project is built from, in the order they are handed to ts-morph. */
35
+ members: string[];
36
+ }
37
+ /**
38
+ * The root membership of a discovery snapshot's program, recorded into `files` exactly as a FULL
39
+ * synchronization records it: the tsconfig reads, each entry's module and API scope glob, and the
40
+ * tsconfig membership. A root change of a retained program (`program-retention.ts`) records the
41
+ * same observations again with this function. Throws a `SemanticFailure`.
42
+ */
43
+ export declare function programMembers(discovery: DiscoverySnapshot, files: TrackedFiles): Promise<ProgramMembers>;
44
+ /**
45
+ * Builds the program of a discovery snapshot into `observations`: the tsconfig, the entries and API
46
+ * scopes (global), every program file (per importer), the formatter configuration (global), and
47
+ * last the aggregate `semantic` definition. Throws a `SemanticFailure`; what was observed until
48
+ * then stays in `observations`.
49
+ */
50
+ export declare function buildProgram(discovery: DiscoverySnapshot, observations: ProgramObservations): Promise<BuiltProgram>;
51
+ /**
52
+ * The failure a synchronization reports for a program with syntax errors, or undefined. A patched
53
+ * program is checked with the same function, so its diagnostic is the cold one.
54
+ */
55
+ export declare function syntaxFailure(program: ts.Program): SemanticFailure | undefined;
@@ -0,0 +1,124 @@
1
+ import { type Project, ts } from 'ts-morph';
2
+ /**
3
+ * The program index behind the recorded semantic closure: per-file facts of one TypeScript
4
+ * program, each a pure function of that program, so a cold and an incremental generation compute
5
+ * the same digests.
6
+ *
7
+ * - `content(F)`: the digest of F's text as the program read it.
8
+ * - `token(F)`: F without comments and formatting (the printed AST, plus its triple-slash
9
+ * directives) for TypeScript sources; the content for everything else (declaration, JavaScript,
10
+ * JSX and JSON files, whose comments or pragmas can carry types).
11
+ * - `exportSurface(B)`: `token(B)`, the export map of B (each exported name to the files and name
12
+ * of its resolved declaration) and the export map of every `export *` target of B, recursively,
13
+ * including targets that export nothing. It holds no target's type information.
14
+ * - `typeClosure(F)`: `token(F)` and, per imported name, the export surfaces of the modules on the
15
+ * name's alias chain and the `typeClosure` of the declaring files; any other module reference
16
+ * (a namespace or side-effect import, an import type, a dynamic import or `require`, an import
17
+ * equals, a triple-slash path reference) contributes that module's surface and the closures of
18
+ * the module and of every declaration it exports. Cycles are condensed: every file of a strongly
19
+ * connected component gets the component's digest. Declaration files under `node_modules` are
20
+ * leaves: their content is in `env`.
21
+ * - `env`: the TypeScript version, the compiler options, the caller's global program observations
22
+ * (tsconfig reads, formatter probes, type directives) and the content of every global-effect
23
+ * file: declaration files, scripts, and modules with `declare global` or an ambient
24
+ * `declare module`.
25
+ * - the derived-class list of a class, as the API template renders it.
26
+ *
27
+ * - `dtsShape(F)`: F's declaration shape, the isolated declaration emit of a TypeScript source
28
+ * (`ts.transpileDeclaration`, comments removed) plus its enum declarations; the `token` of every
29
+ * other file, and of a source the isolated emit reports a diagnostic for (a type it cannot state
30
+ * without the checker, such as an inferred return type). The emit is given the program's
31
+ * type-affecting options (strictness included: TypeScript's defaults are not the program's), so
32
+ * it is a function of F's name, text and those options, and is memoized across programs.
33
+ * - `shapeClosure(F)`: `typeClosure(F)` over declaration shapes: `dtsShape(F)` and, per imported
34
+ * name, the shape surfaces (`exportSurface` with `dtsShape` in place of `token`) of the modules
35
+ * on its chain and the `shapeClosure` of the declaring files. A body edit that keeps the
36
+ * declaration shapes keeps every `shapeClosure`.
37
+ *
38
+ * A unit's closure digest is `H(env, [(f, content(f), typeClosure(f)) for f in R], [(class,
39
+ * derived list)])`. With shape closures (`NGDOC_SHAPE_CLOSURE`), every file of `R` takes
40
+ * `shapeClosure(f)` in place of `typeClosure(f)`. `content(f)` stays, so whatever a query read of a
41
+ * file itself (its initializers, parameter defaults, bodies, comments) is covered by its content;
42
+ * only what it did not read, the files it merely depends on, is followed by shape. That is sound
43
+ * as long as the recorder puts every file a query reads into `R` and a declaration shape states
44
+ * everything an importer's types take from its file.
45
+ * Everything is computed with recording suspended: the index is shared by every scope and must not
46
+ * land in the footprint of whichever query asks first.
47
+ */
48
+ export declare class ProgramIndex {
49
+ private readonly program;
50
+ private readonly project;
51
+ private readonly observations;
52
+ private readonly checker;
53
+ private environment?;
54
+ private readonly contents;
55
+ private readonly tokens;
56
+ private readonly exportMaps;
57
+ private readonly surfaces;
58
+ private readonly stars;
59
+ private readonly providers;
60
+ private readonly facts;
61
+ private readonly closures;
62
+ private readonly shapes;
63
+ private readonly shapeSurfaces;
64
+ private readonly shapeClosures;
65
+ private shapeOptions?;
66
+ private readonly derivedLists;
67
+ private readonly digests;
68
+ constructor(program: ts.Program, project: Project, observations: string);
69
+ /**
70
+ * The closure digest of a scope that read `files` and the derived lists of `derived`: with
71
+ * `shape` (shape closures on), each file's `shapeClosure` in place of its `typeClosure`.
72
+ */
73
+ closure(files: readonly string[], derived: readonly string[], shape?: boolean): string;
74
+ env(): string;
75
+ content(file: string): string;
76
+ token(file: string): string;
77
+ typeClosure(file: string): string;
78
+ /** `typeClosure` over declaration shapes (see the class comment). */
79
+ shapeClosure(file: string): string;
80
+ /** The declaration shape of a file (see the class comment). */
81
+ dtsShape(file: string): string;
82
+ /** The program's options the isolated declaration emit depends on, and their memo key. */
83
+ private declarationOptions;
84
+ /** `exportSurface` with `dtsShape` in place of `token`. */
85
+ shapeSurface(file: string): string;
86
+ exportSurface(file: string): string;
87
+ private derivedList;
88
+ /** Each exported name of a module, with the files and name of its resolved declaration. */
89
+ private exportMap;
90
+ /** The resolved files of every `export *` target of `file`, recursively, sorted. */
91
+ private starTargets;
92
+ /** The files a module specifier resolves to: the resolved module, or an ambient module's files. */
93
+ private moduleFiles;
94
+ /**
95
+ * The files declaring what a module exports (its export surface names any export that does not
96
+ * resolve, so it needs no provider).
97
+ */
98
+ private exportProviders;
99
+ private resolveAlias;
100
+ /** The references and the successors of one file in the closure graphs. */
101
+ private factsOf;
102
+ /** A file's local contribution to `typeClosure`: its token and its references' surfaces. */
103
+ private readonly typeLocal;
104
+ /** A file's local contribution to `shapeClosure`: its shape and its references' shape surfaces. */
105
+ private readonly shapeLocal;
106
+ private edges;
107
+ /**
108
+ * One imported name: every module on its alias chain (whose surfaces it depends on), and the
109
+ * files that declare the symbol the chain ends at. Undefined when the chain does not resolve.
110
+ */
111
+ private namedEdge;
112
+ /**
113
+ * Tarjan's algorithm from `root` over the files not condensed yet in `closures`; every component
114
+ * gets `H(tag, its members and their local contributions, the digests of the components it
115
+ * reaches)`.
116
+ */
117
+ private condense;
118
+ }
119
+ /**
120
+ * The index of the project's current program; a changed program (a FULL synchronization, or a
121
+ * query that added a source file) gets a new one. `observations` digests the program's global
122
+ * observations that `env` includes.
123
+ */
124
+ export declare function programIndex(project: Project, observations: string): ProgramIndex;
@@ -0,0 +1,26 @@
1
+ import { ts } from 'ts-morph';
2
+ import type { Dependency } from '../contracts.js';
3
+ import type { OwnedRoots } from './owned-roots.js';
4
+ /** Present only while the recorded membership cannot be trusted: never exists, never verifies. */
5
+ export declare const UNVERIFIABLE_MEMBERSHIP = ".ng-doc-unverifiable-tsconfig-membership";
6
+ export interface TsconfigSpecs {
7
+ files: string[];
8
+ include: string[];
9
+ exclude: string[];
10
+ }
11
+ /** TypeScript's validated specs with `${configDir}` substituted, from the configuration it used. */
12
+ export declare function tsconfigSpecs(parsed: ts.ParsedCommandLine, configFile: string): TsconfigSpecs;
13
+ /**
14
+ * Filesystem observations that let the session re-verify how the tsconfig selected its program
15
+ * root files after watcher subscription:
16
+ * - every `files` entry as an existence observation (program bytes are recorded separately);
17
+ * - one glob per static include directory, recorded through the same dependency refresher the
18
+ * session re-verifies with, so an unchanged tree reproduces the recorded members exactly.
19
+ *
20
+ * Include patterns may over-include relative to TypeScript (supported-extension groups, dot
21
+ * folders); excludes are applied only where fast-glob provably excludes no more than TypeScript.
22
+ * As a backstop, if any TypeScript root file is not reproduced by the recorded observations, an
23
+ * input that can never verify is recorded, so a translation gap always regenerates instead of
24
+ * reusing a result that may be stale. Owned roots are never observed.
25
+ */
26
+ export declare function tsconfigMembershipDependencies(parsed: ts.ParsedCommandLine, configFile: string, owned: OwnedRoots, specs?: TsconfigSpecs): Promise<Dependency[]>;
@@ -0,0 +1,158 @@
1
+ import { type Project, ts } from 'ts-morph';
2
+ import type { Dependency } from '../contracts.js';
3
+ import { TrackedFiles } from './dependencies.js';
4
+ import type { OwnedRoots } from './owned-roots.js';
5
+ import type { ResolutionProbes, SemanticDefinition } from './program-state.js';
6
+ /**
7
+ * Per-importer program tracking.
8
+ *
9
+ * A synchronization observes the program in two parts:
10
+ * - **global** observations: the tsconfig reads, the entries, the API scope globs, the tsconfig
11
+ * membership, the formatter configuration probes, and the private probes of the `types`
12
+ * directives;
13
+ * - **per importer**: for every program file, its own existence and content, and every probe the
14
+ * resolution of its imports, type references and referenced files made, with what each resolved
15
+ * to.
16
+ *
17
+ * The published dependency set is their aggregate, built exactly as one flat set would be (the
18
+ * same additions in the same order into one {@link TrackedFiles}). The attribution is an ordered
19
+ * log beside it, so one importer can be re-tracked after a patch and the aggregate re-derived from
20
+ * the log, and the resolved edges give the importers of a file (the reverse graph).
21
+ */
22
+ /** Resolution facts reported by a tracking host (see `ProgramWatch`). */
23
+ export interface ProbeSink {
24
+ missing(directory: string): void;
25
+ realpath(from: string, to: string): void;
26
+ }
27
+ /** One reference of a program file and the file it resolved to (normalized), if any. */
28
+ export interface ImportResolution {
29
+ readonly kind: 'module' | 'type-reference' | 'reference';
30
+ readonly specifier: string;
31
+ readonly resolved?: string;
32
+ }
33
+ /** What tracking one program file observed, in observation order. */
34
+ export interface ImporterObservations {
35
+ readonly path: string;
36
+ readonly dependencies: readonly Dependency[];
37
+ readonly missing: readonly string[];
38
+ readonly realpaths: ReadonlyArray<readonly [string, string]>;
39
+ readonly imports: readonly ImportResolution[];
40
+ }
41
+ /** What the aggregate `semantic` definition is derived from, besides the observations. */
42
+ export interface SemanticConfiguration {
43
+ readonly projectId: string;
44
+ readonly digest: string;
45
+ }
46
+ /** `ts.sys.realpath` (what module resolution uses), or undefined when the path cannot be resolved. */
47
+ export declare function realpathOf(path: string): string | undefined;
48
+ /**
49
+ * A module resolution host that records every file probe and read in `files` and, when given,
50
+ * every directory reported missing and every symlinked path resolved in `probes`. The same
51
+ * owned-root view as the program: owned probes are neither followed nor recorded.
52
+ */
53
+ export declare function trackingHost(files: TrackedFiles, owned: OwnedRoots, probes?: ProbeSink): ts.ModuleResolutionHost;
54
+ /**
55
+ * Tracks one program file: its existence and content, and all failed candidate paths and package
56
+ * manifests of its imports and type references, not only the successfully loaded files. A newly
57
+ * created missing module or a changed exports/types field must invalidate consumers.
58
+ */
59
+ export declare function trackSourceFile(source: ts.SourceFile, options: ts.CompilerOptions, host: ts.ModuleResolutionHost, files: TrackedFiles, owned: OwnedRoots, imports?: ImportResolution[]): void;
60
+ /**
61
+ * Tracks every non-owned file of the project's program into one flat set (a query that added a
62
+ * source file tracks the re-created program into its own dependencies this way).
63
+ */
64
+ export declare function trackProgram(project: Project, files: TrackedFiles, owned: OwnedRoots): void;
65
+ /**
66
+ * The aggregate `semantic` definition: the whole program, its configuration, resolution libraries
67
+ * and source membership, over the observations made so far.
68
+ */
69
+ export declare function semanticDefinition(configuration: SemanticConfiguration, files: TrackedFiles, project: Project): SemanticDefinition;
70
+ /** The per-importer and global observations of one program, and their aggregate. */
71
+ export declare class ProgramObservations {
72
+ private readonly segments;
73
+ private readonly importerSegments;
74
+ private current?;
75
+ private logging;
76
+ private aggregate;
77
+ private resolutionProbes;
78
+ private definition?;
79
+ private reverse?;
80
+ constructor();
81
+ /** The published observations: every global and per-importer one, and the definition. */
82
+ get files(): TrackedFiles;
83
+ /** Every directory reported missing and symlinked path resolved (global and per importer). */
84
+ get probes(): ResolutionProbes;
85
+ /** The aggregate `semantic` definition, once {@link define} ran. */
86
+ get semantic(): SemanticDefinition | undefined;
87
+ /** Reports resolution facts to the aggregate and to the current owner. */
88
+ readonly probeSink: ProbeSink;
89
+ /** Tracks every non-owned program file, each attributed to itself as importer. */
90
+ track(project: Project, owned: OwnedRoots): void;
91
+ /** Derives the aggregate `semantic` definition from the observations and publishes it. */
92
+ define(configuration: SemanticConfiguration, project: Project): SemanticDefinition;
93
+ /** The observations not attributed to a program file, in observation order. */
94
+ global(): Dependency[];
95
+ /** The tracked program files, in program order. */
96
+ importers(): string[];
97
+ /** What tracking one program file observed, or undefined when it is not a tracked importer. */
98
+ importer(path: string): ImporterObservations | undefined;
99
+ /** The tracked program files with a reference that resolved to this file, in program order. */
100
+ importersOf(path: string): string[];
101
+ /**
102
+ * The aggregate replayed from the attribution log: every observation (without the definition),
103
+ * probe and symlink in observation order. It equals what the aggregate recorded directly.
104
+ */
105
+ replay(): {
106
+ files: TrackedFiles;
107
+ probes: ResolutionProbes;
108
+ };
109
+ /**
110
+ * The aggregate as a synchronization that failed right after tracking the program files had it:
111
+ * every observation logged up to the last program file (the configuration, entries, scopes,
112
+ * membership and the files), without the later global ones (the formatter probes) and without a
113
+ * definition. A patched synchronization that fails its syntax check reports exactly these, as the
114
+ * cold one does.
115
+ */
116
+ throughImporters(): Dependency[];
117
+ /**
118
+ * Re-tracks program files against the project's current program: each file's observations are
119
+ * replaced in its place in the log, the aggregate and the probes are re-derived from the log,
120
+ * and so is the `semantic` definition when one was defined. Returns the
121
+ * re-tracked observations (the ones a patch re-stamps). The retained entries see the result,
122
+ * because they read the observations through the mirror.
123
+ *
124
+ * A program file can also be read as a global observation: an entry file is read before the
125
+ * program is tracked. A cold synchronization of the edited tree reads it again, so its global
126
+ * content observation takes the file's current digest too; otherwise the log would hold the old
127
+ * and the new digest of one path, and the aggregate would record them as conflicting. `reads`
128
+ * holds the digest of the bytes the caller applied (a global read digests the raw bytes, as
129
+ * `TrackedFiles.read` does); without it the file is read again.
130
+ */
131
+ retrack(project: Project, paths: Iterable<string>, owned: OwnedRoots, reads?: ReadonlyMap<string, string>): Dependency[];
132
+ /**
133
+ * The log's three parts: the global observations logged before the first program file (the
134
+ * program's root membership: the tsconfig reads, the entries, the API scope globs and the
135
+ * tsconfig membership), the tracked program files, and every later global observation (the
136
+ * formatter configuration probes).
137
+ */
138
+ layout(): {
139
+ membership: Dependency[];
140
+ importers: string[];
141
+ tail: Dependency[];
142
+ tailMissing: string[];
143
+ tailRealpaths: Array<[string, string]>;
144
+ };
145
+ /**
146
+ * Rebuilds the log for the project's current program after its root set or file set changed
147
+ * (`program-retention.ts` `restructureProgram`), as a cold synchronization of the same tree logs
148
+ * it: `membership`'s global observations (recorded again for the new root membership), then every
149
+ * non-owned program file in program order, then the later global observations as they are. A
150
+ * program file `keep` accepts keeps its segment (its observations were verified to hold); every
151
+ * other one is tracked again. The aggregate, the probes and the definition are re-derived from
152
+ * the log. Returns the observations of the files tracked again (the ones to stamp).
153
+ */
154
+ restructure(project: Project, owned: OwnedRoots, membership: ProgramObservations, keep: (path: string) => boolean): Dependency[];
155
+ private createAggregate;
156
+ private open;
157
+ private segment;
158
+ }
@@ -0,0 +1,147 @@
1
+ import { type Project, ts } from 'ts-morph';
2
+ import type { Dependency, DiscoverySnapshot, FileChange } from '../contracts.js';
3
+ import { type DirectoryFact } from '../graph/index.js';
4
+ import { type SemanticFailure } from './dependencies.js';
5
+ import type { OwnedRoots } from './owned-roots.js';
6
+ import { ProgramObservations } from './program-observations.js';
7
+ import type { ProgramWatch, RetainedProgram, SweepCounters } from './program-state.js';
8
+ /**
9
+ * Program retention: the key a retained program is valid for, the re-verification state recorded
10
+ * when it is retained, the check that decides whether it may be reused as it is or patched, and
11
+ * the patch itself: the content of edited program files applied to the retained Project, whose
12
+ * program TypeScript then re-creates from the old one.
13
+ */
14
+ /** A tsconfig/jsconfig or package manifest change always rebuilds (resolution and options). */
15
+ export declare const PROGRAM_CONFIGURATION: RegExp;
16
+ /**
17
+ * Everything of a discovery snapshot that `synchronize` reads. Queries read the live snapshot of
18
+ * their own generation, so the rest may differ between the retaining and the reusing generation.
19
+ */
20
+ export declare function programKey(discovery: DiscoverySnapshot): string;
21
+ /**
22
+ * The re-verification state of a program synchronized for retention (see {@link ProgramWatch}).
23
+ * Recording the `types` directives' probes re-resolves them with a tracking host into the private
24
+ * observations only.
25
+ */
26
+ export declare function watchProgram(project: Project, observations: ProgramObservations, owned: OwnedRoots, tsConfig: string, observedAtNs: bigint): ProgramWatch;
27
+ /**
28
+ * A program's private observations (see {@link ProgramWatch}) as JSON, so that another process
29
+ * can check that a program synchronized now would be this one without building it: the published
30
+ * dependencies and these facts are everything the program read. Glob listings are left out: such
31
+ * a check observes each published glob again in full.
32
+ */
33
+ export interface ProgramWatchFacts {
34
+ /** The `types` directives' probes and reads (content and existence observations). */
35
+ hidden: Dependency[];
36
+ missingDirectories: string[];
37
+ realpaths: Array<[string, string]>;
38
+ directories: DirectoryFact[];
39
+ }
40
+ /**
41
+ * The facts of `watch`, or undefined when a listing cannot vouch for its directory.
42
+ */
43
+ export declare function watchFacts(watch: ProgramWatch): ProgramWatchFacts | undefined;
44
+ /**
45
+ * Why the facts no longer hold, or undefined: the predicates of a retained program's sweep
46
+ * (`holds`), by reading, never by stat stamps. The caller checks the hidden observations with the
47
+ * published ones.
48
+ */
49
+ export declare function watchFactsChange(facts: ProgramWatchFacts): string | undefined;
50
+ /**
51
+ * Why a retained program may no longer describe the workspace, or the sweep counters when it
52
+ * provably still does: the discovery inputs of `synchronize` are equal, no change touches a
53
+ * program configuration, an observed path or an observed glob's membership, and every content
54
+ * and existence observation still holds (stat, re-hash on a stat change).
55
+ */
56
+ export declare function stale(previous: RetainedProgram, key: string, changes: FileChange[]): string | SweepCounters;
57
+ /** At most this many program files are patched into a retained program at once. */
58
+ export declare const MAX_PATCHED_FILES = 50;
59
+ /** What a synchronization may do with a retained program (see {@link assess}). */
60
+ export type ProgramAssessment = {
61
+ kind: 'full';
62
+ reason: string;
63
+ } | {
64
+ kind: 'reuse';
65
+ counters: SweepCounters;
66
+ }
67
+ /**
68
+ * Patch `files` (program files, in program order), then check the program as a cold one.
69
+ * `restructure`: the program's root membership or file set may change as well (entries added or
70
+ * removed, an API scope or tsconfig glob that gained or lost a file, a program file deleted), so
71
+ * the patch observes the root membership again (`restructureProgram`).
72
+ */
73
+ | {
74
+ kind: 'patch';
75
+ files: string[];
76
+ counters: SweepCounters;
77
+ restructure?: true;
78
+ };
79
+ /**
80
+ * Decides how a synchronization treats a retained program. Without `patching` this is
81
+ * {@link stale}: any change rebuilds. With it, the content observations of program files are
82
+ * verified one by one; the files whose bytes changed, and the paths a failed patch left applied
83
+ * (`ProgramMirror.appliedSinceBase`), are to be patched, and everything else the program observed
84
+ * must hold exactly as for a reuse. A change event of a program file that still exists is
85
+ * explained by that file's content, so it is taken off the events the remaining checks see.
86
+ *
87
+ * With `discovery` (the generation's snapshot), a change that moves the root membership (the
88
+ * discovery inputs of the program, an observed glob's membership, a deleted program file) may
89
+ * still be applied to the retained Project: {@link assessRestructure} checks everything but the
90
+ * root membership itself, which the patch observes again.
91
+ */
92
+ export declare function assess(previous: RetainedProgram, key: string, changes: FileChange[], patching: boolean, discovery?: DiscoverySnapshot): ProgramAssessment;
93
+ /** The outcome of {@link patchProgram}. */
94
+ export type PatchResult =
95
+ /** The Project now equals a cold synchronization of the tree; its mirror says so. */
96
+ {
97
+ kind: 'patched';
98
+ }
99
+ /**
100
+ * The patch is applied and tracked, but the program has syntax errors: the cold failure, with
101
+ * the observations a cold synchronization reports when it fails there.
102
+ */
103
+ | {
104
+ kind: 'failed';
105
+ failure: SemanticFailure;
106
+ dependencies: Dependency[];
107
+ }
108
+ /** The files cannot be patched; the Project may be changed and must not be kept. */
109
+ | {
110
+ kind: 'refused';
111
+ reason: string;
112
+ };
113
+ /**
114
+ * Applies the current content of `files` (program files of the retained Project, in program order)
115
+ * to the Project and re-creates its program from the old one:
116
+ *
117
+ * 1. Each file must be a TypeScript module before and after the edit (no declaration, JSON,
118
+ * library or script file, no global or ambient module augmentation, no UMD global) whose
119
+ * import, reference, type-reference and lib directives are unchanged; otherwise nothing is
120
+ * changed and the patch is refused. A file whose directives changed, and an assessment that
121
+ * moves the root membership (`restructure`), are applied by {@link restructureProgram}
122
+ * instead, which needs the generation's `discovery`.
123
+ * 2. Write-ahead: each path is recorded as applied (`appliedSinceBase`) before the Project changes.
124
+ * 3. The texts are applied with the program's root names pinned to the FULL synchronization's.
125
+ * 4. The patched program must have the same root names and the same files in the same order, and
126
+ * each re-tracked file must resolve exactly what it resolved before; otherwise it is refused.
127
+ * 5. The re-tracked files are re-stamped, as observed when their bytes were read.
128
+ * 6. The syntax check of a cold synchronization: errors fail the synchronization with the cold
129
+ * diagnostic, and the paths stay applied.
130
+ *
131
+ * Throws only on a programmer error of ts-morph or TypeScript (or a pinned-version assumption that
132
+ * no longer holds), which the caller treats as refused.
133
+ */
134
+ export declare function patchProgram(previous: RetainedProgram, assessment: {
135
+ files: readonly string[];
136
+ restructure?: true;
137
+ }, discovery?: DiscoverySnapshot): Promise<PatchResult>;
138
+ /** ts-morph's program wrapper; `_reset` is how its language service re-creates the program. */
139
+ export interface ResettableProgram {
140
+ _reset(rootNames: readonly string[], host: unknown): void;
141
+ }
142
+ /**
143
+ * Runs `action` with the program's re-creation pinned to `roots`: ts-morph re-creates a changed
144
+ * program from every file in its cache (resolved dependencies included), which would change the
145
+ * root set, the file order and TypeScript's structure reuse.
146
+ */
147
+ export declare function withPinnedRoots(program: ResettableProgram, roots: readonly string[], action: () => void, hostFor?: (host: ts.CompilerHost) => ts.CompilerHost): void;