@analogjs/platform 3.0.0-alpha.2 → 3.0.0-alpha.20

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 (292) hide show
  1. package/package.json +13 -17
  2. package/src/index.d.ts +5 -2
  3. package/src/index.js +9 -3
  4. package/src/index.js.map +1 -0
  5. package/src/lib/clear-client-page-endpoint.d.ts +2 -2
  6. package/src/lib/clear-client-page-endpoint.js +22 -32
  7. package/src/lib/clear-client-page-endpoint.js.map +1 -0
  8. package/src/lib/content/marked/index.d.ts +5 -5
  9. package/src/lib/content/marked/index.js +10 -6
  10. package/src/lib/content/marked/index.js.map +1 -0
  11. package/src/lib/content/marked/marked-content-highlighter.d.ts +2 -4
  12. package/src/lib/content/marked/marked-content-highlighter.js +6 -3
  13. package/src/lib/content/marked/marked-content-highlighter.js.map +1 -0
  14. package/src/lib/content/marked/marked-setup.service.d.ts +8 -8
  15. package/src/lib/content/marked/marked-setup.service.js +44 -54
  16. package/src/lib/content/marked/marked-setup.service.js.map +1 -0
  17. package/src/lib/content/prism/angular.d.ts +1 -0
  18. package/src/lib/content/prism/angular.js +18 -19
  19. package/src/lib/content/prism/angular.js.map +1 -0
  20. package/src/lib/content/prism/index.d.ts +1 -1
  21. package/src/lib/content/prism/index.js +10 -7
  22. package/src/lib/content/prism/index.js.map +1 -0
  23. package/src/lib/content/prism/options.d.ts +1 -1
  24. package/src/lib/content/prism/prism-highlighter.d.ts +5 -5
  25. package/src/lib/content/prism/prism-highlighter.js +33 -33
  26. package/src/lib/content/prism/prism-highlighter.js.map +1 -0
  27. package/src/lib/content/shiki/index.d.ts +3 -3
  28. package/src/lib/content/shiki/index.js +19 -28
  29. package/src/lib/content/shiki/index.js.map +1 -0
  30. package/src/lib/content/shiki/options.d.ts +7 -7
  31. package/src/lib/content/shiki/shiki-highlighter.d.ts +13 -13
  32. package/src/lib/content/shiki/shiki-highlighter.js +45 -44
  33. package/src/lib/content/shiki/shiki-highlighter.js.map +1 -0
  34. package/src/lib/content-plugin.d.ts +19 -19
  35. package/src/lib/content-plugin.js +178 -196
  36. package/src/lib/content-plugin.js.map +1 -0
  37. package/src/lib/deps-plugin.d.ts +2 -2
  38. package/src/lib/deps-plugin.js +73 -82
  39. package/src/lib/deps-plugin.js.map +1 -0
  40. package/src/lib/json-ld-manifest-plugin.d.ts +41 -0
  41. package/src/lib/json-ld-manifest-plugin.js +84 -0
  42. package/src/lib/json-ld-manifest-plugin.js.map +1 -0
  43. package/src/lib/nx-plugin/builders.json +7 -0
  44. package/src/lib/nx-plugin/executors.json +5 -0
  45. package/src/lib/nx-plugin/generators.json +25 -0
  46. package/src/lib/nx-plugin/package.json +1 -5
  47. package/src/lib/nx-plugin/src/executors/vite/compat.d.ts +3 -2
  48. package/src/lib/nx-plugin/src/executors/vite/compat.js +6 -6
  49. package/src/lib/nx-plugin/src/executors/vite/compat.js.map +1 -1
  50. package/src/lib/nx-plugin/src/executors/vite/schema.d.ts +1 -1
  51. package/src/lib/nx-plugin/src/executors/vite/vite.impl.d.ts +1 -1
  52. package/src/lib/nx-plugin/src/executors/vite/vite.impl.js +5 -4
  53. package/src/lib/nx-plugin/src/executors/vite/vite.impl.js.map +1 -1
  54. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.d.ts +3 -2
  55. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js +6 -6
  56. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js.map +1 -1
  57. package/src/lib/nx-plugin/src/executors/vite-dev-server/schema.d.ts +1 -1
  58. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.d.ts +1 -1
  59. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js +5 -4
  60. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js.map +1 -1
  61. package/src/lib/nx-plugin/src/executors/vitest/compat.d.ts +3 -2
  62. package/src/lib/nx-plugin/src/executors/vitest/compat.js +6 -6
  63. package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
  64. package/src/lib/nx-plugin/src/executors/vitest/schema.d.ts +1 -1
  65. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.d.ts +1 -1
  66. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js +5 -4
  67. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
  68. package/src/lib/nx-plugin/src/generators/app/compat.d.ts +9 -2
  69. package/src/lib/nx-plugin/src/generators/app/compat.js +17 -6
  70. package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
  71. package/src/lib/nx-plugin/src/generators/app/files/root/tsconfig.base.json +3 -6
  72. package/src/lib/nx-plugin/src/generators/app/files/template-angular/src/test-setup.ts__template__ +1 -0
  73. package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.app.json__template__ +1 -3
  74. package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.json__template__ +2 -1
  75. package/src/lib/nx-plugin/src/generators/app/files/template-angular/vite.config.ts__template__ +6 -0
  76. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/src/app/app.config.ts__template__ +0 -6
  77. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/tsconfig.json__template__ +4 -2
  78. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/vite.config.ts__template__ +0 -18
  79. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/src/app/app.config.ts__template__ +0 -6
  80. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/tsconfig.json__template__ +4 -2
  81. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/vite.config.ts__template__ +0 -18
  82. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/src/app/app.config.ts__template__ +0 -6
  83. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.app.json__template__ +1 -3
  84. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.json__template__ +4 -2
  85. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/vite.config.ts__template__ +0 -9
  86. package/src/lib/nx-plugin/src/generators/app/generator.d.ts +11 -11
  87. package/src/lib/nx-plugin/src/generators/app/generator.js +78 -88
  88. package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
  89. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.d.ts +1 -1
  90. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.d.ts +1 -1
  91. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js +72 -89
  92. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js.map +1 -1
  93. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.d.ts +2 -2
  94. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js +24 -58
  95. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js.map +1 -1
  96. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.d.ts +2 -2
  97. package/src/lib/nx-plugin/src/generators/app/lib/add-files.d.ts +2 -2
  98. package/src/lib/nx-plugin/src/generators/app/lib/add-files.js +15 -16
  99. package/src/lib/nx-plugin/src/generators/app/lib/add-files.js.map +1 -1
  100. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.d.ts +2 -2
  101. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js +14 -13
  102. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js.map +1 -1
  103. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.d.ts +7 -7
  104. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js +15 -30
  105. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js.map +1 -1
  106. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.d.ts +3 -5
  107. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js +49 -147
  108. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js.map +1 -1
  109. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.d.ts +1 -1
  110. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.d.ts +2 -2
  111. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js +17 -20
  112. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js.map +1 -1
  113. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.d.ts +2 -2
  114. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.d.ts +1 -1
  115. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js +14 -12
  116. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js.map +1 -1
  117. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.d.ts +4 -5
  118. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js +6 -10
  119. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js.map +1 -1
  120. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.d.ts +0 -3
  121. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.d.ts +0 -5
  122. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +9 -16
  123. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js +7 -37
  124. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js.map +1 -1
  125. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.d.ts +1 -1
  126. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js +9 -15
  127. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js.map +1 -1
  128. package/src/lib/nx-plugin/src/generators/app/versions.d.ts +0 -28
  129. package/src/lib/nx-plugin/src/generators/init/compat.d.ts +9 -2
  130. package/src/lib/nx-plugin/src/generators/init/compat.js +17 -6
  131. package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
  132. package/src/lib/nx-plugin/src/generators/init/generator.d.ts +3 -3
  133. package/src/lib/nx-plugin/src/generators/init/generator.js +54 -55
  134. package/src/lib/nx-plugin/src/generators/init/generator.js.map +1 -1
  135. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.d.ts +1 -1
  136. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js +19 -20
  137. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js.map +1 -1
  138. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.d.ts +2 -2
  139. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js +20 -18
  140. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js.map +1 -1
  141. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.d.ts +2 -2
  142. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js +56 -57
  143. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js.map +1 -1
  144. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.d.ts +1 -1
  145. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js +12 -11
  146. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js.map +1 -1
  147. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.d.ts +2 -2
  148. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js +17 -15
  149. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js.map +1 -1
  150. package/src/lib/nx-plugin/src/generators/init/lib/update-main.d.ts +2 -2
  151. package/src/lib/nx-plugin/src/generators/init/lib/update-main.js +12 -12
  152. package/src/lib/nx-plugin/src/generators/init/lib/update-main.js.map +1 -1
  153. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.d.ts +2 -2
  154. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js +19 -25
  155. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js.map +1 -1
  156. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.d.ts +2 -2
  157. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js +43 -45
  158. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js.map +1 -1
  159. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.d.ts +2 -2
  160. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js +27 -28
  161. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js.map +1 -1
  162. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.d.ts +2 -2
  163. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js +19 -17
  164. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js.map +1 -1
  165. package/src/lib/nx-plugin/src/generators/init/test-files/src/test-setup.ts__template__ +1 -0
  166. package/src/lib/nx-plugin/src/generators/page/compat.d.ts +9 -0
  167. package/src/lib/nx-plugin/src/generators/page/compat.js +18 -0
  168. package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -0
  169. package/src/lib/nx-plugin/src/generators/page/generator.d.ts +3 -4
  170. package/src/lib/nx-plugin/src/generators/page/generator.js +33 -44
  171. package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
  172. package/src/lib/nx-plugin/src/generators/preset/__snapshots__/generator.spec.ts.snap +5 -3
  173. package/src/lib/nx-plugin/src/generators/preset/generator.d.ts +3 -3
  174. package/src/lib/nx-plugin/src/generators/preset/generator.js +17 -43
  175. package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
  176. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.d.ts +9 -2
  177. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js +17 -6
  178. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js.map +1 -1
  179. package/src/lib/nx-plugin/src/generators/setup-vitest/files/src/test-setup.ts__template__ +1 -0
  180. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.d.ts +3 -3
  181. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js +35 -32
  182. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js.map +1 -1
  183. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.d.ts +1 -1
  184. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js +7 -7
  185. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js.map +1 -1
  186. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.d.ts +2 -2
  187. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js +20 -21
  188. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js.map +1 -1
  189. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.d.ts +2 -2
  190. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js +19 -19
  191. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js.map +1 -1
  192. package/src/lib/nx-plugin/src/index.js +0 -1
  193. package/src/lib/nx-plugin/src/utils/version-utils.d.ts +1 -1
  194. package/src/lib/nx-plugin/src/utils/version-utils.js +20 -18
  195. package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
  196. package/src/lib/nx-plugin/src/utils/versions/dependencies.js +42 -62
  197. package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
  198. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +49 -83
  199. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js.map +1 -1
  200. package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js +33 -20
  201. package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js.map +1 -1
  202. package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js +33 -20
  203. package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js.map +1 -1
  204. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.d.ts +7 -7
  205. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js +37 -23
  206. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
  207. package/src/lib/options.d.ts +158 -80
  208. package/src/lib/platform-plugin.d.ts +2 -2
  209. package/src/lib/platform-plugin.js +67 -61
  210. package/src/lib/platform-plugin.js.map +1 -0
  211. package/src/lib/route-file-discovery.d.ts +23 -0
  212. package/src/lib/route-file-discovery.js +114 -0
  213. package/src/lib/route-file-discovery.js.map +1 -0
  214. package/src/lib/route-generation-plugin.d.ts +3 -0
  215. package/src/lib/route-generation-plugin.js +34 -0
  216. package/src/lib/route-generation-plugin.js.map +1 -0
  217. package/src/lib/route-manifest.d.ts +118 -0
  218. package/src/lib/route-manifest.js +377 -0
  219. package/src/lib/route-manifest.js.map +1 -0
  220. package/src/lib/router-plugin.d.ts +19 -19
  221. package/src/lib/router-plugin.js +193 -150
  222. package/src/lib/router-plugin.js.map +1 -0
  223. package/src/lib/ssr/inject-html-plugin.d.ts +1 -1
  224. package/src/lib/ssr/inject-html-plugin.js +25 -25
  225. package/src/lib/ssr/inject-html-plugin.js.map +1 -0
  226. package/src/lib/ssr/ssr-build-plugin.d.ts +18 -2
  227. package/src/lib/ssr/ssr-build-plugin.js +54 -30
  228. package/src/lib/ssr/ssr-build-plugin.js.map +1 -0
  229. package/src/lib/tailwind-preprocessor.d.ts +23 -0
  230. package/src/lib/tailwind-preprocessor.js +33 -0
  231. package/src/lib/tailwind-preprocessor.js.map +1 -0
  232. package/src/lib/typed-routes-plugin.d.ts +50 -0
  233. package/src/lib/typed-routes-plugin.js +204 -0
  234. package/src/lib/typed-routes-plugin.js.map +1 -0
  235. package/src/lib/utils/rolldown.d.ts +3 -0
  236. package/src/lib/utils/rolldown.js +15 -0
  237. package/src/lib/utils/rolldown.js.map +1 -0
  238. package/src/server-mode-plugin.d.ts +6 -6
  239. package/src/server-mode-plugin.js +16 -18
  240. package/src/server-mode-plugin.js.map +1 -0
  241. package/README.md +0 -5
  242. package/src/lib/content/prism/options.js +0 -1
  243. package/src/lib/content/shiki/options.js +0 -1
  244. package/src/lib/nx-plugin/README.md +0 -23
  245. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/postcss.config.cjs__template__ +0 -10
  246. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/tailwind.config.cjs__template__ +0 -14
  247. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/postcss.config.cjs__template__ +0 -10
  248. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/tailwind.config.ts__template__ +0 -14
  249. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/.postcssrc.json +0 -5
  250. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/tailwind.config.ts__template__ +0 -14
  251. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/index.html__template__ +0 -15
  252. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.spec.ts__template__ +0 -17
  253. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.ts__template__ +0 -10
  254. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/favicon.ico__template__ +0 -0
  255. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.providers.ts__template__ +0 -5
  256. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.server.ts__template__ +0 -23
  257. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.ts__template__ +0 -17
  258. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/.gitkeep__template__ +0 -0
  259. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/analog.svg__template__ +0 -1
  260. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/vite.svg__template__ +0 -1
  261. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/server/routes/v1/hello.ts__template__ +0 -3
  262. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/styles.css__template__ +0 -4
  263. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/test-setup.ts__template__ +0 -12
  264. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/vite-env.d.ts__template__ +0 -1
  265. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.app.json__template__ +0 -16
  266. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.editor.json__template__ +0 -7
  267. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.json__template__ +0 -32
  268. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.spec.json__template__ +0 -14
  269. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/vite.config.ts__template__ +0 -69
  270. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js +0 -15
  271. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js.map +0 -1
  272. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js +0 -58
  273. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js.map +0 -1
  274. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js +0 -47
  275. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js.map +0 -1
  276. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js +0 -107
  277. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js.map +0 -1
  278. package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js +0 -56
  279. package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js.map +0 -1
  280. package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js +0 -72
  281. package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js.map +0 -1
  282. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js +0 -46
  283. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js.map +0 -1
  284. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js +0 -37
  285. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js.map +0 -1
  286. package/src/lib/nx-plugin/src/generators/app/versions.js +0 -43
  287. package/src/lib/nx-plugin/src/generators/app/versions.js.map +0 -1
  288. package/src/lib/nx-plugin/src/index.d.ts +0 -0
  289. package/src/lib/nx-plugin/src/index.js.map +0 -1
  290. package/src/lib/options.js +0 -1
  291. package/src/lib/ssr/ssr-xhr-plugin.d.ts +0 -2
  292. package/src/lib/ssr/ssr-xhr-plugin.js +0 -28
@@ -0,0 +1,114 @@
1
+ import { normalizePath } from "vite";
2
+ import { globSync } from "tinyglobby";
3
+ import { resolve } from "node:path";
4
+ //#region packages/platform/src/lib/route-file-discovery.ts
5
+ function createRouteFileDiscovery(options) {
6
+ const { root, workspaceRoot, additionalPagesDirs, additionalContentDirs } = options;
7
+ let routeFilesCache = /* @__PURE__ */ new Set();
8
+ let contentFilesCache = /* @__PURE__ */ new Set();
9
+ let appLocalFilesCache = /* @__PURE__ */ new Set();
10
+ let initialized = false;
11
+ const joinDir = (dir) => dir.startsWith(workspaceRoot) ? normalizePath(dir) : dir.startsWith("/") ? normalizePath(`${workspaceRoot}${dir}`) : normalizePath(resolve(workspaceRoot, dir));
12
+ const additionalPagesRoots = additionalPagesDirs.map(joinDir);
13
+ const additionalContentRoots = additionalContentDirs.map(joinDir);
14
+ function normalizePath_(absolutePath) {
15
+ const normalized = normalizePath(absolutePath);
16
+ if (normalized.startsWith(root)) return normalized.slice(root.length);
17
+ if (normalized.startsWith(workspaceRoot)) return normalized.slice(workspaceRoot.length);
18
+ return normalized;
19
+ }
20
+ function isWithinDir(path, dir) {
21
+ return path === dir || path.startsWith(`${dir}/`);
22
+ }
23
+ function getDiscoveredFileKind(path) {
24
+ const normalized = normalizePath(path);
25
+ if (normalized.endsWith(".md") && (normalized.includes("/src/app/routes/") || normalized.includes("/src/app/pages/") || normalized.includes("/src/content/") || additionalContentRoots.some((dir) => isWithinDir(normalized, dir)))) return "content";
26
+ if ((normalized.includes("/app/routes/") || normalized.includes("/src/app/routes/")) && normalized.endsWith(".ts")) return "route";
27
+ if (normalized.endsWith(".page.ts") && (normalized.includes("/src/app/pages/") || additionalPagesRoots.some((dir) => isWithinDir(normalized, dir)))) return "route";
28
+ return null;
29
+ }
30
+ function scanRouteFiles() {
31
+ const appLocalGlobs = [
32
+ `${root}/app/routes/**/*.ts`,
33
+ `${root}/src/app/routes/**/*.ts`,
34
+ `${root}/src/app/pages/**/*.page.ts`
35
+ ];
36
+ const additionalGlobs = additionalPagesDirs.map((dir) => `${joinDir(dir)}/**/*.page.ts`);
37
+ const appLocal = globSync(appLocalGlobs, {
38
+ dot: true,
39
+ absolute: true
40
+ }).map(normalizePath_);
41
+ const additional = globSync(additionalGlobs, {
42
+ dot: true,
43
+ absolute: true
44
+ }).map(normalizePath_);
45
+ for (const f of appLocal) appLocalFilesCache.add(f);
46
+ return [...appLocal, ...additional];
47
+ }
48
+ function scanContentFiles() {
49
+ const appLocalGlobs = [
50
+ `${root}/src/app/routes/**/*.md`,
51
+ `${root}/src/app/pages/**/*.md`,
52
+ `${root}/src/content/**/*.md`
53
+ ];
54
+ const additionalGlobs = additionalContentDirs.map((dir) => `${joinDir(dir)}/**/*.md`);
55
+ const appLocal = globSync(appLocalGlobs, {
56
+ dot: true,
57
+ absolute: true
58
+ }).map(normalizePath_);
59
+ const additional = globSync(additionalGlobs, {
60
+ dot: true,
61
+ absolute: true
62
+ }).map(normalizePath_);
63
+ for (const f of appLocal) appLocalFilesCache.add(f);
64
+ return [...appLocal, ...additional];
65
+ }
66
+ function isAppLocalByPath(absolutePath) {
67
+ return normalizePath(absolutePath).startsWith(root);
68
+ }
69
+ function ensureInitialized() {
70
+ if (initialized) return;
71
+ routeFilesCache = new Set(scanRouteFiles());
72
+ contentFilesCache = new Set(scanContentFiles());
73
+ initialized = true;
74
+ }
75
+ return {
76
+ getRouteFiles() {
77
+ ensureInitialized();
78
+ return [...routeFilesCache].sort();
79
+ },
80
+ getContentFiles() {
81
+ ensureInitialized();
82
+ return [...contentFilesCache].sort();
83
+ },
84
+ getDiscoveredFileKind(path) {
85
+ return getDiscoveredFileKind(path);
86
+ },
87
+ updateDiscoveredFile(path, event) {
88
+ ensureInitialized();
89
+ const kind = getDiscoveredFileKind(path);
90
+ if (!kind) return;
91
+ const normalizedPath = normalizePath_(path);
92
+ const targetCache = kind === "content" ? contentFilesCache : routeFilesCache;
93
+ if (event === "unlink") {
94
+ targetCache.delete(normalizedPath);
95
+ appLocalFilesCache.delete(normalizedPath);
96
+ return;
97
+ }
98
+ targetCache.add(normalizedPath);
99
+ if (isAppLocalByPath(path)) appLocalFilesCache.add(normalizedPath);
100
+ },
101
+ isAppLocal(normalizedFilename) {
102
+ ensureInitialized();
103
+ return appLocalFilesCache.has(normalizedFilename);
104
+ },
105
+ reset() {
106
+ initialized = false;
107
+ appLocalFilesCache = /* @__PURE__ */ new Set();
108
+ }
109
+ };
110
+ }
111
+ //#endregion
112
+ export { createRouteFileDiscovery };
113
+
114
+ //# sourceMappingURL=route-file-discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-file-discovery.js","names":[],"sources":["../../../src/lib/route-file-discovery.ts"],"sourcesContent":["import { normalizePath } from 'vite';\nimport { resolve } from 'node:path';\nimport { globSync } from 'tinyglobby';\n\nexport interface RouteFileDiscoveryOptions {\n root: string;\n workspaceRoot: string;\n additionalPagesDirs: string[];\n additionalContentDirs: string[];\n}\n\nexport interface RouteFileDiscovery {\n getRouteFiles(): string[];\n getContentFiles(): string[];\n getDiscoveredFileKind(path: string): 'route' | 'content' | null;\n updateDiscoveredFile(path: string, event: 'add' | 'change' | 'unlink'): void;\n /**\n * Returns true if the normalized filename was discovered from an app-local\n * glob (under the configured root) rather than from an additional directory.\n *\n * Used by collision priority to prefer app-local routes over shared/external\n * routes based on actual configured roots instead of hard-coded path\n * substrings.\n */\n isAppLocal(normalizedFilename: string): boolean;\n reset(): void;\n}\n\nexport function createRouteFileDiscovery(\n options: RouteFileDiscoveryOptions,\n): RouteFileDiscovery {\n const { root, workspaceRoot, additionalPagesDirs, additionalContentDirs } =\n options;\n\n let routeFilesCache = new Set<string>();\n let contentFilesCache = new Set<string>();\n let appLocalFilesCache = new Set<string>();\n let initialized = false;\n const joinDir = (dir: string) =>\n dir.startsWith(workspaceRoot)\n ? normalizePath(dir)\n : dir.startsWith('/')\n ? normalizePath(`${workspaceRoot}${dir}`)\n : normalizePath(resolve(workspaceRoot, dir));\n const additionalPagesRoots = additionalPagesDirs.map(joinDir);\n const additionalContentRoots = additionalContentDirs.map(joinDir);\n\n function normalizePath_(absolutePath: string): string {\n const normalized = normalizePath(absolutePath);\n if (normalized.startsWith(root)) {\n return normalized.slice(root.length);\n }\n if (normalized.startsWith(workspaceRoot)) {\n return normalized.slice(workspaceRoot.length);\n }\n return normalized;\n }\n\n function isWithinDir(path: string, dir: string): boolean {\n return path === dir || path.startsWith(`${dir}/`);\n }\n\n function getDiscoveredFileKind(path: string): 'route' | 'content' | null {\n const normalized = normalizePath(path);\n\n if (\n normalized.endsWith('.md') &&\n (normalized.includes('/src/app/routes/') ||\n normalized.includes('/src/app/pages/') ||\n normalized.includes('/src/content/') ||\n additionalContentRoots.some((dir) => isWithinDir(normalized, dir)))\n ) {\n return 'content';\n }\n\n if (\n (normalized.includes('/app/routes/') ||\n normalized.includes('/src/app/routes/')) &&\n normalized.endsWith('.ts')\n ) {\n return 'route';\n }\n\n // Keep the dev watcher aligned with the build-time route scan. In\n // particular, `src/server/routes/**` must stay out of typed route codegen\n // because Nitro API handlers are not client-navigable pages.\n if (\n normalized.endsWith('.page.ts') &&\n (normalized.includes('/src/app/pages/') ||\n additionalPagesRoots.some((dir) => isWithinDir(normalized, dir)))\n ) {\n return 'route';\n }\n\n return null;\n }\n\n function scanRouteFiles(): string[] {\n const appLocalGlobs = [\n `${root}/app/routes/**/*.ts`,\n `${root}/src/app/routes/**/*.ts`,\n `${root}/src/app/pages/**/*.page.ts`,\n ];\n const additionalGlobs = additionalPagesDirs.map(\n (dir) => `${joinDir(dir)}/**/*.page.ts`,\n );\n\n const appLocal = globSync(appLocalGlobs, {\n dot: true,\n absolute: true,\n }).map(normalizePath_);\n\n const additional = globSync(additionalGlobs, {\n dot: true,\n absolute: true,\n }).map(normalizePath_);\n\n for (const f of appLocal) {\n appLocalFilesCache.add(f);\n }\n\n return [...appLocal, ...additional];\n }\n\n function scanContentFiles(): string[] {\n const appLocalGlobs = [\n `${root}/src/app/routes/**/*.md`,\n `${root}/src/app/pages/**/*.md`,\n `${root}/src/content/**/*.md`,\n ];\n const additionalGlobs = additionalContentDirs.map(\n (dir) => `${joinDir(dir)}/**/*.md`,\n );\n\n const appLocal = globSync(appLocalGlobs, {\n dot: true,\n absolute: true,\n }).map(normalizePath_);\n\n const additional = globSync(additionalGlobs, {\n dot: true,\n absolute: true,\n }).map(normalizePath_);\n\n for (const f of appLocal) {\n appLocalFilesCache.add(f);\n }\n\n return [...appLocal, ...additional];\n }\n\n function isAppLocalByPath(absolutePath: string): boolean {\n const normalized = normalizePath(absolutePath);\n return normalized.startsWith(root);\n }\n\n function ensureInitialized(): void {\n if (initialized) {\n return;\n }\n\n routeFilesCache = new Set(scanRouteFiles());\n contentFilesCache = new Set(scanContentFiles());\n initialized = true;\n }\n\n return {\n getRouteFiles(): string[] {\n ensureInitialized();\n return [...routeFilesCache].sort();\n },\n\n getContentFiles(): string[] {\n ensureInitialized();\n return [...contentFilesCache].sort();\n },\n\n getDiscoveredFileKind(path: string): 'route' | 'content' | null {\n return getDiscoveredFileKind(path);\n },\n\n updateDiscoveredFile(\n path: string,\n event: 'add' | 'change' | 'unlink',\n ): void {\n ensureInitialized();\n const kind = getDiscoveredFileKind(path);\n if (!kind) {\n return;\n }\n\n const normalizedPath = normalizePath_(path);\n const targetCache =\n kind === 'content' ? contentFilesCache : routeFilesCache;\n\n if (event === 'unlink') {\n targetCache.delete(normalizedPath);\n appLocalFilesCache.delete(normalizedPath);\n return;\n }\n\n targetCache.add(normalizedPath);\n if (isAppLocalByPath(path)) {\n appLocalFilesCache.add(normalizedPath);\n }\n },\n\n isAppLocal(normalizedFilename: string): boolean {\n ensureInitialized();\n return appLocalFilesCache.has(normalizedFilename);\n },\n\n reset(): void {\n initialized = false;\n appLocalFilesCache = new Set<string>();\n },\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "vite";
2
+ import type { Options } from "./options.js";
3
+ export declare function routeGenerationPlugin(options?: Options): Plugin;
@@ -0,0 +1,34 @@
1
+ import { typedRoutes } from "./typed-routes-plugin.js";
2
+ //#region packages/platform/src/lib/route-generation-plugin.ts
3
+ function resolveTypedRouterOptions(experimental) {
4
+ const typedRouter = experimental?.typedRouter;
5
+ if (typedRouter === false) return {
6
+ enabled: false,
7
+ options: {}
8
+ };
9
+ if (!typedRouter || typedRouter === true) return {
10
+ enabled: true,
11
+ options: { jsonLdManifest: true }
12
+ };
13
+ return {
14
+ enabled: true,
15
+ options: {
16
+ ...typedRouter,
17
+ jsonLdManifest: typedRouter.jsonLdManifest ?? true
18
+ }
19
+ };
20
+ }
21
+ function routeGenerationPlugin(options) {
22
+ const { enabled, options: typedRouterOptions } = resolveTypedRouterOptions(options?.experimental);
23
+ if (!enabled) return { name: "analog-route-generation-disabled" };
24
+ return typedRoutes({
25
+ ...typedRouterOptions,
26
+ workspaceRoot: options?.workspaceRoot,
27
+ additionalPagesDirs: options?.additionalPagesDirs,
28
+ additionalContentDirs: options?.additionalContentDirs
29
+ });
30
+ }
31
+ //#endregion
32
+ export { routeGenerationPlugin };
33
+
34
+ //# sourceMappingURL=route-generation-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-generation-plugin.js","names":[],"sources":["../../../src/lib/route-generation-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\nimport type { Options, TypedRouterOptions } from './options.js';\nimport {\n typedRoutes,\n type TypedRoutesPluginOptions,\n} from './typed-routes-plugin.js';\n\nfunction resolveTypedRouterOptions(experimental: Options['experimental']): {\n enabled: boolean;\n options: TypedRouterOptions;\n} {\n const typedRouter = experimental?.typedRouter;\n if (typedRouter === false) {\n return { enabled: false, options: {} };\n }\n if (!typedRouter || typedRouter === true) {\n return { enabled: true, options: { jsonLdManifest: true } };\n }\n return {\n enabled: true,\n options: {\n ...typedRouter,\n jsonLdManifest: typedRouter.jsonLdManifest ?? true,\n },\n };\n}\n\nexport function routeGenerationPlugin(options?: Options): Plugin {\n const { enabled, options: typedRouterOptions } = resolveTypedRouterOptions(\n options?.experimental,\n );\n\n if (!enabled) {\n return {\n name: 'analog-route-generation-disabled',\n };\n }\n\n const pluginOptions: TypedRoutesPluginOptions = {\n ...typedRouterOptions,\n workspaceRoot: options?.workspaceRoot,\n additionalPagesDirs: options?.additionalPagesDirs,\n additionalContentDirs: options?.additionalContentDirs,\n };\n\n return typedRoutes(pluginOptions);\n}\n"],"mappings":";;AAQA,SAAS,0BAA0B,cAGjC;CACA,MAAM,cAAc,cAAc;AAClC,KAAI,gBAAgB,MAClB,QAAO;EAAE,SAAS;EAAO,SAAS,EAAE;EAAE;AAExC,KAAI,CAAC,eAAe,gBAAgB,KAClC,QAAO;EAAE,SAAS;EAAM,SAAS,EAAE,gBAAgB,MAAM;EAAE;AAE7D,QAAO;EACL,SAAS;EACT,SAAS;GACP,GAAG;GACH,gBAAgB,YAAY,kBAAkB;GAC/C;EACF;;AAGH,SAAgB,sBAAsB,SAA2B;CAC/D,MAAM,EAAE,SAAS,SAAS,uBAAuB,0BAC/C,SAAS,aACV;AAED,KAAI,CAAC,QACH,QAAO,EACL,MAAM,oCACP;AAUH,QAAO,YAPyC;EAC9C,GAAG;EACH,eAAe,SAAS;EACxB,qBAAqB,SAAS;EAC9B,uBAAuB,SAAS;EACjC,CAEgC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Route-manifest engine for typed file routes.
3
+ *
4
+ * Pure functions (no Angular dependencies) for converting discovered
5
+ * filenames into typed route manifests and generated declarations.
6
+ */
7
+ export interface RouteParamInfo {
8
+ name: string;
9
+ type: "dynamic" | "catchAll" | "optionalCatchAll";
10
+ }
11
+ export interface RouteSchemaInfo {
12
+ hasParamsSchema: boolean;
13
+ hasQuerySchema: boolean;
14
+ }
15
+ export interface GenerateRouteTreeDeclarationOptions {
16
+ jsonLdPaths?: Iterable<string>;
17
+ }
18
+ export interface RouteEntry {
19
+ /** Stable structural route id derived from the source filename */
20
+ id: string;
21
+ /** The route path segment relative to the nearest existing parent route */
22
+ path: string;
23
+ /** The fully resolved navigation path pattern (e.g., '/users/[id]') */
24
+ fullPath: string;
25
+ /** Extracted parameter information */
26
+ params: RouteParamInfo[];
27
+ /** Original filename that produced this route */
28
+ filename: string;
29
+ /** Schema export info (detected from file content) */
30
+ schemas: RouteSchemaInfo;
31
+ /** Type of source that produced this route */
32
+ kind: "page" | "content";
33
+ /** Parent route id, or null for top-level routes */
34
+ parentId: string | null;
35
+ /** Child route ids */
36
+ children: string[];
37
+ /** Whether the source filename represents an index route */
38
+ isIndex: boolean;
39
+ /** Whether the source filename includes route-group/pathless segments */
40
+ isGroup: boolean;
41
+ /** Whether the route contains a required catch-all parameter */
42
+ isCatchAll: boolean;
43
+ /** Whether the route contains an optional catch-all parameter */
44
+ isOptionalCatchAll: boolean;
45
+ }
46
+ export interface RouteManifest {
47
+ routes: RouteEntry[];
48
+ }
49
+ /**
50
+ * Converts a discovered filename to a route path pattern.
51
+ *
52
+ * Uses the same stripping rules as the existing route system
53
+ * but preserves bracket param syntax instead of converting to
54
+ * Angular's `:param` syntax.
55
+ *
56
+ * The regex applies four alternations (left to right, all replaced with ''):
57
+ * 1. `^(.*?)[\\/](?:routes|pages|content)[\\/]` — anchored, strips everything
58
+ * up to and including the first /routes/, /pages/, or /content/ segment.
59
+ * Handles app-local paths (`/src/app/pages/`) AND additional dirs
60
+ * (`/libs/shared/feature/src/content/`) uniformly.
61
+ * 2. `[\\/](?:app[\\/](?:routes|pages)|src[\\/]content)[\\/]` — non-anchored
62
+ * fallback for legacy paths where the directory marker appears mid-string.
63
+ * 3. `\.page\.(js|ts|analog|ag)$` — strips page file extensions.
64
+ * 4. `\.(ts|md|analog|ag)$` — strips remaining file extensions.
65
+ *
66
+ * Examples:
67
+ * - '/app/routes/index.ts' -> '/'
68
+ * - '/app/routes/about.ts' -> '/about'
69
+ * - '/src/app/pages/users/[id].page.ts' -> '/users/[id]'
70
+ * - '/app/routes/blog.[slug].ts' -> '/blog/[slug]'
71
+ * - '/src/app/pages/(auth)/login.page.ts' -> '/login'
72
+ * - '/src/app/pages/docs/[...slug].page.ts' -> '/docs/[...slug]'
73
+ * - '/src/app/pages/shop/[[...category]].page.ts' -> '/shop/[[...category]]'
74
+ * - '/libs/shared/feature/src/content/test.md' -> '/test'
75
+ */
76
+ export declare function filenameToRoutePath(filename: string): string;
77
+ /**
78
+ * Converts a discovered filename to a stable structural route id.
79
+ *
80
+ * Unlike `filenameToRoutePath`, this preserves route groups and `index`
81
+ * segments so that multiple files resolving to the same URL shape can still
82
+ * have distinct structural identities in the generated route tree metadata.
83
+ *
84
+ * Uses the same directory-stripping regex as `filenameToRoutePath` —
85
+ * changes to the regex must be kept in sync between both functions.
86
+ */
87
+ export declare function filenameToRouteId(filename: string): string;
88
+ /**
89
+ * Extracts parameter information from a route path pattern.
90
+ */
91
+ export declare function extractRouteParams(routePath: string): RouteParamInfo[];
92
+ /**
93
+ * Detects whether a route file exports schema constants.
94
+ */
95
+ export declare function detectSchemaExports(fileContent: string): RouteSchemaInfo;
96
+ /**
97
+ * Generates a route manifest from a list of discovered filenames.
98
+ *
99
+ * @param collisionPriority - Optional callback that returns a numeric priority
100
+ * for each filename (lower wins). When provided, this replaces the default
101
+ * hard-coded path-substring heuristic with config-derived precedence.
102
+ */
103
+ export declare function generateRouteManifest(filenames: string[], schemaDetector?: (filename: string) => RouteSchemaInfo, collisionPriority?: (filename: string) => number): RouteManifest;
104
+ /**
105
+ * Produces a human-readable summary of the generated route manifest.
106
+ */
107
+ export declare function formatManifestSummary(manifest: RouteManifest): string;
108
+ /**
109
+ * Generates the route-table section for the combined generated route module.
110
+ */
111
+ export declare function generateRouteTableDeclaration(manifest: RouteManifest): string;
112
+ /**
113
+ * Generates the route-tree section for the combined generated route module.
114
+ */
115
+ export declare function generateRouteTreeDeclaration(manifest: RouteManifest, options?: GenerateRouteTreeDeclarationOptions): string;
116
+ export type JsonLdObject = Record<string, unknown>;
117
+ export declare function isJsonLdObject(value: unknown): value is JsonLdObject;
118
+ export declare function normalizeJsonLd(value: unknown): JsonLdObject[];