@ecopages/core 0.2.0-beta.3 → 0.2.0-beta.30

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 (433) hide show
  1. package/README.md +38 -9
  2. package/package.json +241 -30
  3. package/src/adapters/README.md +6 -2
  4. package/src/adapters/abstract/application-adapter.d.ts +123 -6
  5. package/src/adapters/abstract/application-adapter.js +151 -1
  6. package/src/adapters/abstract/segment-path-matcher.d.ts +6 -0
  7. package/src/adapters/abstract/segment-path-matcher.js +149 -0
  8. package/src/adapters/abstract/server-adapter.d.ts +16 -2
  9. package/src/adapters/abstract/ws-pattern-matcher.d.ts +12 -0
  10. package/src/adapters/abstract/ws-pattern-matcher.js +30 -0
  11. package/src/adapters/bun/bun-user-websocket-lifecycle.d.ts +22 -0
  12. package/src/adapters/bun/bun-user-websocket-lifecycle.js +96 -0
  13. package/src/adapters/bun/client-bridge.d.ts +1 -0
  14. package/src/adapters/bun/client-bridge.js +3 -0
  15. package/src/adapters/bun/create-app.d.ts +9 -6
  16. package/src/adapters/bun/create-app.js +76 -45
  17. package/src/adapters/bun/hmr-manager.d.ts +1 -1
  18. package/src/adapters/bun/hmr-manager.js +1 -1
  19. package/src/adapters/bun/index.d.ts +1 -1
  20. package/src/adapters/bun/index.js +25 -2
  21. package/src/adapters/bun/runtime-host.d.ts +1 -1
  22. package/src/adapters/bun/runtime-host.js +1 -1
  23. package/src/adapters/bun/server-adapter.d.ts +92 -41
  24. package/src/adapters/bun/server-adapter.js +256 -117
  25. package/src/adapters/bun/static-preview-host.d.ts +1 -1
  26. package/src/adapters/bun/static-preview-host.js +25 -20
  27. package/src/adapters/create-app.d.ts +13 -11
  28. package/src/adapters/create-app.js +2 -51
  29. package/src/adapters/index.d.ts +2 -2
  30. package/src/adapters/index.js +26 -4
  31. package/src/adapters/node/create-app.d.ts +8 -3
  32. package/src/adapters/node/create-app.js +61 -13
  33. package/src/adapters/node/node-client-bridge.d.ts +1 -0
  34. package/src/adapters/node/node-client-bridge.js +3 -0
  35. package/src/adapters/node/node-hmr-manager.d.ts +1 -1
  36. package/src/adapters/node/node-hmr-manager.js +1 -1
  37. package/src/adapters/node/runtime-host.d.ts +1 -1
  38. package/src/adapters/node/runtime-host.js +1 -1
  39. package/src/adapters/node/server-adapter-dependencies.js +4 -0
  40. package/src/adapters/node/server-adapter.d.ts +64 -23
  41. package/src/adapters/node/server-adapter.js +169 -142
  42. package/src/adapters/node/static-content-server.d.ts +1 -0
  43. package/src/adapters/node/static-content-server.js +10 -2
  44. package/src/adapters/node/static-preview-host.d.ts +1 -1
  45. package/src/adapters/node/static-preview-host.js +27 -12
  46. package/src/adapters/shared/{hmr-entrypoint-registrar.d.ts → hmr/hmr-entrypoint-registrar.d.ts} +31 -30
  47. package/src/adapters/shared/hmr/hmr-entrypoint-registrar.js +106 -0
  48. package/src/adapters/shared/{hmr-html-response.d.ts → hmr/hmr-html-response.d.ts} +2 -2
  49. package/src/adapters/shared/{hmr-html-response.js → hmr/hmr-html-response.js} +4 -1
  50. package/src/adapters/shared/hmr/shared-hmr-manager.d.ts +101 -0
  51. package/src/adapters/shared/hmr/shared-hmr-manager.js +432 -0
  52. package/src/adapters/shared/http/api-request-pipeline.d.ts +23 -0
  53. package/src/adapters/shared/http/api-request-pipeline.js +129 -0
  54. package/src/adapters/shared/{api-response.d.ts → http/api-response.d.ts} +1 -1
  55. package/src/adapters/shared/{api-response.js → http/api-response.js} +6 -23
  56. package/src/adapters/shared/http/create-body-response.d.ts +12 -0
  57. package/src/adapters/shared/http/create-body-response.js +23 -0
  58. package/src/adapters/shared/http/define-api-handler.d.ts +90 -0
  59. package/src/adapters/shared/http/define-api-handler.js +63 -0
  60. package/src/adapters/shared/{explicit-static-render-preparation.d.ts → http/explicit-static-render-preparation.d.ts} +3 -3
  61. package/src/adapters/shared/{explicit-static-route-matcher.d.ts → http/explicit-static-route-matcher.d.ts} +3 -9
  62. package/src/adapters/shared/{explicit-static-route-matcher.js → http/explicit-static-route-matcher.js} +3 -38
  63. package/src/adapters/shared/{file-route-middleware-pipeline.d.ts → http/file-route-middleware-pipeline.d.ts} +2 -2
  64. package/src/adapters/shared/{file-route-middleware-pipeline.js → http/file-route-middleware-pipeline.js} +10 -22
  65. package/src/adapters/shared/{fs-server-response-factory.d.ts → http/fs-server-response-factory.d.ts} +7 -2
  66. package/src/adapters/shared/{fs-server-response-factory.js → http/fs-server-response-factory.js} +22 -2
  67. package/src/adapters/shared/{fs-server-response-matcher.d.ts → http/fs-server-response-matcher.d.ts} +25 -5
  68. package/src/adapters/shared/{fs-server-response-matcher.js → http/fs-server-response-matcher.js} +109 -27
  69. package/src/adapters/shared/http/run-middleware-chain.d.ts +5 -0
  70. package/src/adapters/shared/http/run-middleware-chain.js +17 -0
  71. package/src/adapters/shared/{application-adapter.d.ts → runtime/application-adapter.d.ts} +2 -2
  72. package/src/adapters/shared/{application-adapter.js → runtime/application-adapter.js} +1 -1
  73. package/src/adapters/shared/runtime/copy-runtime-public-dir.d.ts +6 -0
  74. package/src/adapters/shared/runtime/copy-runtime-public-dir.js +24 -0
  75. package/src/adapters/shared/runtime/port-manager.d.ts +116 -0
  76. package/src/adapters/shared/runtime/port-manager.js +196 -0
  77. package/src/adapters/shared/{render-context.d.ts → runtime/render-context.d.ts} +2 -2
  78. package/src/adapters/shared/{render-context.js → runtime/render-context.js} +8 -17
  79. package/src/adapters/shared/{runtime-app-bootstrap.d.ts → runtime/runtime-app-bootstrap.d.ts} +4 -3
  80. package/src/adapters/shared/{runtime-app-bootstrap.js → runtime/runtime-app-bootstrap.js} +4 -7
  81. package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +46 -0
  82. package/src/adapters/shared/runtime/runtime-server-lifecycle.js +57 -0
  83. package/src/adapters/shared/{server-adapter.d.ts → runtime/server-adapter.d.ts} +23 -49
  84. package/src/adapters/shared/runtime/server-adapter.js +226 -0
  85. package/src/adapters/shared/{server-route-handler.d.ts → runtime/server-route-handler.d.ts} +6 -33
  86. package/src/adapters/shared/{server-route-handler.js → runtime/server-route-handler.js} +5 -43
  87. package/src/adapters/shared/{server-static-builder.d.ts → runtime/server-static-builder.d.ts} +27 -35
  88. package/src/adapters/shared/runtime/server-static-builder.js +191 -0
  89. package/src/adapters/shared/{static-preview-host.d.ts → runtime/static-preview-host.d.ts} +6 -1
  90. package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +21 -0
  91. package/src/adapters/shared/ws/node-http-websocket-upgrades.js +100 -0
  92. package/src/adapters/shared/ws/websocket-lifecycle.d.ts +24 -0
  93. package/src/adapters/shared/ws/websocket-lifecycle.js +55 -0
  94. package/src/build/README.md +140 -31
  95. package/src/build/app-build-manifest-runtime.d.ts +39 -0
  96. package/src/build/app-build-manifest-runtime.js +124 -0
  97. package/src/build/{browser-runtime-plugin.d.ts → browser/browser-runtime-plugin.d.ts} +1 -1
  98. package/src/build/{browser-runtime-plugin.js → browser/browser-runtime-plugin.js} +1 -1
  99. package/src/build/browser/jsx-ownership-plugins.d.ts +24 -0
  100. package/src/build/browser/jsx-ownership-plugins.js +41 -0
  101. package/src/build/browser/lit-static-render-worker-context.d.ts +2 -0
  102. package/src/build/browser/lit-static-render-worker-context.js +6 -0
  103. package/src/build/build-adapter.d.ts +29 -334
  104. package/src/build/build-adapter.js +32 -133
  105. package/src/build/cache/build-input-fingerprint.d.ts +28 -0
  106. package/src/build/cache/build-input-fingerprint.js +31 -0
  107. package/src/build/cache/cache-constants.d.ts +4 -0
  108. package/src/build/cache/cache-constants.js +6 -0
  109. package/src/build/cache/cache-keys.d.ts +22 -0
  110. package/src/build/cache/cache-keys.js +63 -0
  111. package/src/build/cache/dev-browser-script-cache.d.ts +34 -0
  112. package/src/build/cache/dev-browser-script-cache.js +90 -0
  113. package/src/build/cache/pages-unified-graph-build.d.ts +31 -0
  114. package/src/build/cache/pages-unified-graph-build.js +198 -0
  115. package/src/build/cache/production-build-cache.d.ts +20 -0
  116. package/src/build/cache/production-build-cache.js +63 -0
  117. package/src/build/cache/server-entry-build-cache.d.ts +43 -0
  118. package/src/build/cache/server-entry-build-cache.js +165 -0
  119. package/src/build/contracts/build-contracts.d.ts +96 -0
  120. package/src/build/contracts/build-manifest.d.ts +90 -0
  121. package/src/build/{build-manifest.js → contracts/build-manifest.js} +2 -2
  122. package/src/build/contracts/build-types.js +0 -0
  123. package/src/build/{rolldown-adapter-helpers.d.ts → rolldown/rolldown-adapter-helpers.d.ts} +23 -9
  124. package/src/build/{rolldown-adapter-helpers.js → rolldown/rolldown-adapter-helpers.js} +99 -13
  125. package/src/build/{rolldown-build-adapter.d.ts → rolldown/rolldown-build-adapter.d.ts} +3 -7
  126. package/src/build/{rolldown-build-adapter.js → rolldown/rolldown-build-adapter.js} +3 -3
  127. package/src/build/rolldown/rolldown-build-invocation-metrics.d.ts +12 -0
  128. package/src/build/rolldown/rolldown-build-invocation-metrics.js +43 -0
  129. package/src/build/{rolldown-plugin-bridge.d.ts → rolldown/rolldown-plugin-bridge.d.ts} +16 -2
  130. package/src/build/{rolldown-plugin-bridge.js → rolldown/rolldown-plugin-bridge.js} +21 -6
  131. package/src/build/rolldown/rolldown-source-transform-pass.d.ts +15 -0
  132. package/src/build/rolldown/rolldown-source-transform-pass.js +61 -0
  133. package/src/build/rolldown/runtime-build-output-normalizer.d.ts +10 -0
  134. package/src/build/rolldown/runtime-build-output-normalizer.js +201 -0
  135. package/src/build/runtime/build-profile-options.d.ts +7 -0
  136. package/src/build/runtime/build-profile-options.js +37 -0
  137. package/src/build/runtime/build-request-identity.d.ts +17 -0
  138. package/src/build/runtime/build-request-identity.js +54 -0
  139. package/src/build/runtime/build-request-policy.d.ts +59 -0
  140. package/src/build/runtime/build-request-policy.js +46 -0
  141. package/src/build/runtime/build-runtime.d.ts +28 -0
  142. package/src/build/runtime/build-runtime.js +65 -0
  143. package/src/build/runtime/deduping-build-executor.d.ts +21 -0
  144. package/src/build/runtime/deduping-build-executor.js +34 -0
  145. package/src/build/runtime/parallel-build-executor.d.ts +21 -0
  146. package/src/build/runtime/parallel-build-executor.js +52 -0
  147. package/src/build/{serialized-build-executor.d.ts → runtime/serialized-build-executor.d.ts} +1 -1
  148. package/src/client/navigation-scripts/classification.d.ts +16 -0
  149. package/src/client/navigation-scripts/classification.js +41 -0
  150. package/src/client/navigation-scripts/index.d.ts +3 -0
  151. package/src/client/navigation-scripts/index.js +23 -0
  152. package/src/client/navigation-scripts/navigation-scripts.test.browser.js +65 -0
  153. package/src/client/navigation-scripts/registry.d.ts +11 -0
  154. package/src/client/navigation-scripts/registry.js +12 -0
  155. package/src/client/navigation-scripts/rerun-queue.d.ts +37 -0
  156. package/src/client/navigation-scripts/rerun-queue.js +73 -0
  157. package/src/client/scroll.d.ts +17 -0
  158. package/src/client/scroll.js +25 -0
  159. package/src/client/scroll.test.browser.js +37 -0
  160. package/src/client/view-transitions.d.ts +16 -0
  161. package/src/client/view-transitions.js +63 -0
  162. package/src/config/config-builder.d.ts +25 -10
  163. package/src/config/config-builder.js +53 -11
  164. package/src/config/constants.d.ts +1 -0
  165. package/src/config/constants.js +2 -1
  166. package/src/dev/client-bridge-registry.d.ts +5 -0
  167. package/src/dev/client-bridge-registry.js +15 -0
  168. package/src/dev/dev-client-ownership.d.ts +7 -0
  169. package/src/dev/dev-client-ownership.js +6 -0
  170. package/src/dev/hmr-manager-registry.d.ts +8 -0
  171. package/src/dev/hmr-manager-registry.js +15 -0
  172. package/src/dev/host-runtime.d.ts +3 -0
  173. package/src/dev/host-runtime.js +7 -0
  174. package/src/dev/runtime-server-started-message.d.ts +2 -0
  175. package/src/dev/runtime-server-started-message.js +6 -0
  176. package/src/diagnostics/request-build-dedupe.d.ts +18 -0
  177. package/src/diagnostics/request-build-dedupe.js +33 -0
  178. package/src/diagnostics/startup-trace.d.ts +72 -0
  179. package/src/diagnostics/startup-trace.js +253 -0
  180. package/src/eco/README.md +11 -0
  181. package/src/eco/eco-declared-component.d.ts +14 -0
  182. package/src/eco/eco-declared-component.js +16 -0
  183. package/src/eco/eco.browser.js +5 -6
  184. package/src/eco/eco.js +7 -8
  185. package/src/eco/eco.types.d.ts +14 -3
  186. package/src/eco/eco.utils.d.ts +1 -1
  187. package/src/eco/eco.utils.js +1 -1
  188. package/src/eco/page-layout-normalization.d.ts +21 -0
  189. package/src/eco/page-layout-normalization.js +59 -0
  190. package/src/env.d.ts +2 -0
  191. package/src/errors/index.d.ts +1 -0
  192. package/src/errors/index.js +7 -1
  193. package/src/errors/undeclared-component-dependency-error.d.ts +11 -0
  194. package/src/errors/undeclared-component-dependency-error.js +17 -0
  195. package/src/hmr/client/hmr-runtime.js +7 -4
  196. package/src/hmr/hmr-entrypoint-output.d.ts +49 -0
  197. package/src/hmr/hmr-entrypoint-output.js +60 -0
  198. package/src/hmr/hmr-file-change-prep.d.ts +10 -0
  199. package/src/hmr/hmr-file-change-prep.js +17 -0
  200. package/src/hmr/hmr-strategy.d.ts +15 -0
  201. package/src/hmr/hmr-strategy.js +19 -0
  202. package/src/hmr/strategies/js-hmr-strategy.d.ts +3 -5
  203. package/src/hmr/strategies/js-hmr-strategy.js +72 -19
  204. package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
  205. package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +29 -0
  206. package/src/index.d.ts +2 -1
  207. package/src/index.js +28 -2
  208. package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -6
  209. package/src/integrations/ghtml/ghtml-renderer.js +2 -51
  210. package/src/integrations/ghtml/ghtml.plugin.d.ts +3 -16
  211. package/src/integrations/ghtml/ghtml.plugin.js +7 -14
  212. package/src/plugins/alias-resolver-cache.d.ts +6 -9
  213. package/src/plugins/alias-resolver-plugin.d.ts +3 -3
  214. package/src/plugins/alias-resolver-plugin.js +38 -51
  215. package/src/plugins/define-integration.d.ts +26 -0
  216. package/src/plugins/define-integration.js +19 -0
  217. package/src/plugins/eco-component-meta-plugin.d.ts +1 -1
  218. package/src/plugins/eco-component-meta-plugin.js +5 -8
  219. package/src/plugins/foreign-jsx-override-plugin.d.ts +1 -1
  220. package/src/plugins/foreign-jsx-override-plugin.js +4 -6
  221. package/src/plugins/integration-plugin.d.ts +43 -14
  222. package/src/plugins/integration-plugin.js +18 -5
  223. package/src/plugins/jsx-import-source.utils.d.ts +8 -0
  224. package/src/plugins/jsx-import-source.utils.js +26 -0
  225. package/src/plugins/processor.d.ts +61 -12
  226. package/src/plugins/processor.js +24 -5
  227. package/src/plugins/source-transform.d.ts +32 -1
  228. package/src/plugins/source-transform.js +23 -1
  229. package/src/plugins/tsconfig-import-resolver.d.ts +18 -0
  230. package/src/plugins/tsconfig-import-resolver.js +159 -0
  231. package/src/route-renderer/GRAPH.md +26 -32
  232. package/src/route-renderer/README.md +38 -31
  233. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.d.ts +107 -0
  234. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +148 -0
  235. package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.d.ts +20 -0
  236. package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.js +31 -0
  237. package/src/route-renderer/orchestration/{component-render-context.d.ts → foreign-child/component-render-context.d.ts} +8 -15
  238. package/src/route-renderer/orchestration/{component-render-context.js → foreign-child/component-render-context.js} +4 -2
  239. package/src/route-renderer/orchestration/{render-output.utils.d.ts → foreign-child/foreign-child-output.utils.d.ts} +17 -7
  240. package/src/route-renderer/orchestration/{render-output.utils.js → foreign-child/foreign-child-output.utils.js} +35 -26
  241. package/src/route-renderer/orchestration/{foreign-subtree-execution.service.d.ts → foreign-child/foreign-subtree-execution.service.d.ts} +64 -34
  242. package/src/route-renderer/orchestration/{foreign-subtree-execution.service.js → foreign-child/foreign-subtree-execution.service.js} +170 -37
  243. package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.d.ts +19 -0
  244. package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.js +35 -0
  245. package/src/route-renderer/orchestration/integration-renderer.d.ts +24 -143
  246. package/src/route-renderer/orchestration/integration-renderer.js +163 -402
  247. package/src/route-renderer/orchestration/integration-renderer.test-fixtures.d.ts +75 -0
  248. package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +177 -0
  249. package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.d.ts +10 -0
  250. package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +143 -0
  251. package/src/route-renderer/orchestration/ownership-graph/component-graph.d.ts +34 -0
  252. package/src/route-renderer/orchestration/ownership-graph/component-graph.js +96 -0
  253. package/src/route-renderer/orchestration/{ownership-validation.service.d.ts → ownership-graph/ownership-validation.service.d.ts} +7 -2
  254. package/src/route-renderer/orchestration/{ownership-validation.service.js → ownership-graph/ownership-validation.service.js} +30 -3
  255. package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.d.ts +7 -0
  256. package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.js +32 -0
  257. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.d.ts +9 -0
  258. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.js +7 -0
  259. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.d.ts +12 -0
  260. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.js +29 -0
  261. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +106 -0
  262. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +436 -0
  263. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +31 -0
  264. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +229 -0
  265. package/src/route-renderer/orchestration/{processed-asset-dedupe.d.ts → page-browser-graph/processed-asset-dedupe.d.ts} +1 -1
  266. package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.d.ts +31 -0
  267. package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.js +25 -0
  268. package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +6 -0
  269. package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +27 -0
  270. package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.d.ts +15 -0
  271. package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.js +36 -0
  272. package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.d.ts +20 -0
  273. package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.js +24 -0
  274. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.d.ts +25 -0
  275. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +49 -0
  276. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.d.ts +4 -0
  277. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.js +33 -0
  278. package/src/route-renderer/orchestration/{route-render-orchestrator.d.ts → route-pipeline/route-render-orchestrator.d.ts} +13 -53
  279. package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +162 -0
  280. package/src/route-renderer/orchestration/string-markup-renderer.d.ts +14 -0
  281. package/src/route-renderer/orchestration/string-markup-renderer.js +55 -0
  282. package/src/route-renderer/page-loading/component-dependency-collection.js +5 -2
  283. package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +6 -0
  284. package/src/route-renderer/page-loading/ecopages-virtual-imports.js +7 -2
  285. package/src/route-renderer/page-loading/module-declaration-aggregation.js +4 -0
  286. package/src/router/client/link-intent.d.ts +11 -21
  287. package/src/router/client/link-intent.js +10 -0
  288. package/src/router/client/link-intent.test.browser.js +12 -1
  289. package/src/router/client/link-navigation-policy.d.ts +45 -0
  290. package/src/router/client/link-navigation-policy.js +101 -0
  291. package/src/router/client/link-navigation-policy.test.browser.d.ts +1 -0
  292. package/src/router/client/link-navigation-policy.test.browser.js +92 -0
  293. package/src/router/client/navigation-coordinator.d.ts +1 -1
  294. package/src/router/client/navigation-coordinator.js +12 -2
  295. package/src/services/assets/asset-processing-service/asset-dependency-keys.d.ts +13 -0
  296. package/src/services/assets/asset-processing-service/asset-dependency-keys.js +3 -0
  297. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +6 -1
  298. package/src/services/assets/asset-processing-service/asset-processing.service.js +44 -5
  299. package/src/services/assets/asset-processing-service/assets.types.d.ts +1 -1
  300. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +2 -1
  301. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
  302. package/src/services/assets/asset-processing-service/browser-runtime-entry-resolution.d.ts +52 -0
  303. package/src/services/assets/asset-processing-service/browser-runtime-entry-resolution.js +78 -0
  304. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +4 -2
  305. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +28 -13
  306. package/src/services/assets/asset-processing-service/finalize-processed-asset.d.ts +3 -0
  307. package/src/services/assets/asset-processing-service/finalize-processed-asset.js +7 -0
  308. package/src/services/assets/asset-processing-service/grouped-content-bundles.d.ts +2 -1
  309. package/src/services/assets/asset-processing-service/grouped-content-bundles.js +38 -12
  310. package/src/services/assets/asset-processing-service/index.d.ts +2 -0
  311. package/src/services/assets/asset-processing-service/index.js +2 -0
  312. package/src/services/assets/asset-processing-service/inline-content-script-body.d.ts +11 -0
  313. package/src/services/assets/asset-processing-service/inline-content-script-body.js +17 -0
  314. package/src/services/assets/asset-processing-service/materialize-content-script-asset.d.ts +9 -0
  315. package/src/services/assets/asset-processing-service/materialize-content-script-asset.js +18 -0
  316. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +0 -2
  317. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +2 -15
  318. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +8 -0
  319. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +73 -68
  320. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +0 -1
  321. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +18 -15
  322. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +17 -3
  323. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -3
  324. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +2 -31
  325. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
  326. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +2 -30
  327. package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
  328. package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +43 -0
  329. package/src/services/assets/asset-processing-service/resolve-integration-plugin.d.ts +4 -0
  330. package/src/services/assets/asset-processing-service/resolve-integration-plugin.js +17 -0
  331. package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.d.ts +0 -1
  332. package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.js +5 -10
  333. package/src/services/assets/browser-bundle.service.d.ts +28 -30
  334. package/src/services/assets/browser-bundle.service.js +28 -19
  335. package/src/services/html/html-transformer.service.d.ts +1 -1
  336. package/src/services/html/html-transformer.service.js +5 -5
  337. package/src/services/invalidation/development-invalidation.service.d.ts +25 -2
  338. package/src/services/invalidation/development-invalidation.service.js +64 -11
  339. package/src/services/module-loading/README.md +49 -0
  340. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +8 -0
  341. package/src/services/module-loading/app-server-module-transpiler.service.js +3 -21
  342. package/src/services/module-loading/page-module-import.service.d.ts +6 -2
  343. package/src/services/module-loading/page-module-import.service.js +110 -47
  344. package/src/services/module-loading/route-module-build-cache-registry.d.ts +24 -0
  345. package/src/services/module-loading/route-module-build-cache-registry.js +37 -0
  346. package/src/services/module-loading/route-module-build-cache.d.ts +4 -0
  347. package/src/services/module-loading/route-module-build-cache.js +38 -0
  348. package/src/services/module-loading/route-module-build-cache.store.d.ts +57 -0
  349. package/src/services/module-loading/route-module-build-cache.store.js +207 -0
  350. package/src/services/module-loading/route-module-build-manifest.d.ts +54 -0
  351. package/src/services/module-loading/route-module-build-manifest.js +85 -0
  352. package/src/services/module-loading/route-module-dependency-hasher.d.ts +81 -0
  353. package/src/services/module-loading/route-module-dependency-hasher.js +122 -0
  354. package/src/services/module-loading/server-module-transpiler.service.d.ts +1 -1
  355. package/src/services/module-loading/server-module-transpiler.service.js +1 -1
  356. package/src/services/validation/schema-validation-service.d.ts +1 -4
  357. package/src/services/validation/schema-validation-service.js +12 -13
  358. package/src/services/validation/standard-schema.types.d.ts +9 -62
  359. package/src/services/validation/validate-standard-schema.d.ts +7 -0
  360. package/src/services/validation/validate-standard-schema.js +14 -0
  361. package/src/static-site-generator/README.md +41 -0
  362. package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +28 -0
  363. package/src/static-site-generator/production-page-browser-graph-prebuild.js +22 -0
  364. package/src/static-site-generator/sitemap-routes.d.ts +14 -0
  365. package/src/static-site-generator/sitemap-routes.js +31 -0
  366. package/src/static-site-generator/sitemap.d.ts +15 -0
  367. package/src/static-site-generator/sitemap.js +33 -0
  368. package/src/static-site-generator/static-build-invalidation.d.ts +10 -0
  369. package/src/static-site-generator/static-build-invalidation.js +59 -0
  370. package/src/static-site-generator/static-export-context.d.ts +30 -0
  371. package/src/static-site-generator/static-export-context.js +0 -0
  372. package/src/static-site-generator/static-site-generator.d.ts +43 -25
  373. package/src/static-site-generator/static-site-generator.js +381 -106
  374. package/src/types/internal-types.d.ts +39 -13
  375. package/src/types/public-types.d.ts +289 -52
  376. package/src/utils/ecopages-route-info.d.ts +26 -0
  377. package/src/utils/ecopages-route-info.js +26 -0
  378. package/src/utils/html-escaping.d.ts +7 -0
  379. package/src/utils/html-escaping.js +5 -1
  380. package/src/utils/parse-cli-args.d.ts +2 -0
  381. package/src/utils/parse-cli-args.js +6 -0
  382. package/src/utils/path-pattern.d.ts +23 -0
  383. package/src/utils/path-pattern.js +27 -0
  384. package/src/utils/server-utils.module.d.ts +3 -2
  385. package/src/utils/server-utils.module.js +5 -6
  386. package/src/utils/static-file-extensions.d.ts +12 -0
  387. package/src/utils/static-file-extensions.js +48 -0
  388. package/src/watchers/project-watcher-ignore.d.ts +11 -0
  389. package/src/watchers/project-watcher-ignore.js +16 -0
  390. package/src/watchers/project-watcher.d.ts +29 -6
  391. package/src/watchers/project-watcher.js +146 -34
  392. package/src/watchers/project-watcher.test-helpers.js +5 -5
  393. package/src/adapters/shared/define-api-handler.d.ts +0 -25
  394. package/src/adapters/shared/define-api-handler.js +0 -15
  395. package/src/adapters/shared/hmr-entrypoint-registrar.js +0 -87
  396. package/src/adapters/shared/server-adapter.js +0 -436
  397. package/src/adapters/shared/server-static-builder.js +0 -162
  398. package/src/adapters/shared/shared-hmr-manager.d.ts +0 -59
  399. package/src/adapters/shared/shared-hmr-manager.js +0 -241
  400. package/src/build/build-manifest.d.ts +0 -33
  401. package/src/build/rolldown-dev-build-adapter.d.ts +0 -82
  402. package/src/build/rolldown-dev-build-adapter.js +0 -166
  403. package/src/build/runtime-build-executor.d.ts +0 -21
  404. package/src/build/runtime-build-executor.js +0 -19
  405. package/src/build/runtime-build-output-normalizer.d.ts +0 -3
  406. package/src/build/runtime-build-output-normalizer.js +0 -111
  407. package/src/hmr/hmr.postcss.test.e2e.js +0 -31
  408. package/src/hmr/hmr.test.e2e.js +0 -43
  409. package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +0 -18
  410. package/src/route-renderer/orchestration/declared-ownership-graph.js +0 -34
  411. package/src/route-renderer/orchestration/ownership-planning.service.d.ts +0 -24
  412. package/src/route-renderer/orchestration/ownership-planning.service.js +0 -63
  413. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +0 -91
  414. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +0 -170
  415. package/src/route-renderer/orchestration/route-render-orchestrator.js +0 -577
  416. package/src/route-renderer/orchestration/template-serialization.d.ts +0 -38
  417. package/src/route-renderer/orchestration/template-serialization.js +0 -45
  418. /package/src/adapters/shared/{explicit-static-render-preparation.js → http/explicit-static-render-preparation.js} +0 -0
  419. /package/src/adapters/shared/{runtime-host.d.ts → runtime/runtime-host.d.ts} +0 -0
  420. /package/src/adapters/shared/{runtime-host.js → runtime/runtime-host.js} +0 -0
  421. /package/src/adapters/shared/{static-preview-host.js → runtime/static-preview-host.js} +0 -0
  422. /package/src/build/{browser-runtime-manifest.d.ts → browser/browser-runtime-manifest.d.ts} +0 -0
  423. /package/src/build/{browser-runtime-manifest.js → browser/browser-runtime-manifest.js} +0 -0
  424. /package/src/build/{browser-runtime-plugin-helpers.d.ts → browser/browser-runtime-plugin-helpers.d.ts} +0 -0
  425. /package/src/build/{browser-runtime-plugin-helpers.js → browser/browser-runtime-plugin-helpers.js} +0 -0
  426. /package/src/build/{build-types.js → contracts/build-contracts.js} +0 -0
  427. /package/src/build/{build-types.d.ts → contracts/build-types.d.ts} +0 -0
  428. /package/src/build/{server-side-css-shim-plugin.d.ts → rolldown/server-side-css-shim-plugin.d.ts} +0 -0
  429. /package/src/build/{server-side-css-shim-plugin.js → rolldown/server-side-css-shim-plugin.js} +0 -0
  430. /package/src/build/{serialized-build-executor.js → runtime/serialized-build-executor.js} +0 -0
  431. /package/src/{hmr/hmr.postcss.test.e2e.d.ts → client/navigation-scripts/navigation-scripts.test.browser.d.ts} +0 -0
  432. /package/src/{hmr/hmr.test.e2e.d.ts → client/scroll.test.browser.d.ts} +0 -0
  433. /package/src/route-renderer/orchestration/{processed-asset-dedupe.js → page-browser-graph/processed-asset-dedupe.js} +0 -0
@@ -1,18 +1,23 @@
1
- import type { EcoBuildPlugin } from '../build/build-types.js';
2
- import type { AppBuildManifest } from '../build/build-manifest.js';
3
- import type { BuildAdapter, BuildExecutor, BuildOwnership } from '../build/build-adapter.js';
1
+ import type { EcoBuildPlugin } from '../build/contracts/build-types.js';
2
+ import type { AppBuildManifest } from '../build/contracts/build-manifest.js';
3
+ import type { BuildAdapter, BuildOwnership } from '../build/build-adapter.js';
4
+ import type { BuildRuntime } from '../build/runtime/build-runtime.js';
4
5
  import type { AnyIntegrationPlugin } from '../plugins/integration-plugin.js';
5
6
  import type { Processor } from '../plugins/processor.js';
6
7
  import type { EcoSourceTransform } from '../plugins/source-transform.js';
7
- import type { PageMetadataProps } from './public-types.js';
8
+ import type { PageMetadataProps, SitemapConfig } from './public-types.js';
8
9
  import type { RouteRegistry } from '../router/server/route-registry.js';
9
10
  import type { CacheConfig } from '../services/cache/cache.types.js';
10
11
  import type { DevGraphService } from '../services/runtime-state/dev-graph.service.js';
11
12
  import type { AppModuleLoader } from '../services/module-loading/app-module-loader.service.js';
12
13
  import type { SourceModuleLoader } from '../services/module-loading/module-loading-types.js';
13
14
  import type { EntrypointDependencyGraph } from '../services/runtime-state/entrypoint-dependency-graph.service.js';
15
+ import type { SessionPageBrowserGraphCache } from '../route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js';
14
16
  import type { ServerInvalidationState } from '../services/runtime-state/server-invalidation-state.service.js';
15
17
  import type { ServerModuleTranspiler } from '../services/module-loading/server-module-transpiler.service.js';
18
+ import type { RouteModuleBuildCache } from '../services/module-loading/route-module-build-cache.store.js';
19
+ /** Integration hook for registered `dependencies.scripts` entrypoint changes in dev. */
20
+ export type RegisteredScriptEntrypointChangeHandler = (filePath: string) => void | Promise<void>;
16
21
  export interface RobotsPreference {
17
22
  /**
18
23
  * The user agent
@@ -94,6 +99,12 @@ export type EcoPagesAppConfig = {
94
99
  */
95
100
  preferences: RobotsPreference;
96
101
  };
102
+ /**
103
+ * Automatic sitemap.xml generation during static export.
104
+ *
105
+ * @default { enabled: false, fileName: 'sitemap.xml', extraUrls: [], exclude: [] }
106
+ */
107
+ sitemap: SitemapConfig;
97
108
  /** Additional paths to watch. Use this to monitor extra files. It is relative to the rootDir */
98
109
  additionalWatchPaths: string[];
99
110
  /**
@@ -118,6 +129,7 @@ export type EcoPagesAppConfig = {
118
129
  srcDir: string;
119
130
  htmlTemplatePath: string;
120
131
  error404TemplatePath: string;
132
+ error500TemplatePath: string;
121
133
  };
122
134
  /**
123
135
  * The processors to be used in the app
@@ -149,13 +161,34 @@ export type EcoPagesAppConfig = {
149
161
  buildOwnership?: BuildOwnership;
150
162
  buildAdapter?: BuildAdapter;
151
163
  buildManifest?: AppBuildManifest;
152
- buildExecutor?: BuildExecutor;
153
164
  devGraphService?: DevGraphService;
154
165
  entrypointDependencyGraph?: EntrypointDependencyGraph;
166
+ pageBrowserGraphSession?: SessionPageBrowserGraphCache;
155
167
  hostModuleLoader?: SourceModuleLoader;
156
168
  rendererModuleContext?: unknown;
157
169
  serverInvalidationState?: ServerInvalidationState;
158
170
  serverModuleTranspiler?: ServerModuleTranspiler;
171
+ routeModuleBuildCaches?: Map<string, RouteModuleBuildCache>;
172
+ /** Profile-based build runtime installed by {@link installBuildRuntime}. */
173
+ buildRuntime?: BuildRuntime;
174
+ /** Set after {@link setupAppRuntimePlugins} runs processor/integration setup once per process. */
175
+ runtimeAssetsPrepared?: boolean;
176
+ /** Registers integration runtime plugins when lazy activation completes. */
177
+ onRuntimePlugin?: (plugin: import('../build/contracts/build-types.js').EcoBuildPlugin) => void;
178
+ /**
179
+ * In-flight or completed lazy integration activation promises, keyed by integration name.
180
+ *
181
+ * @remarks
182
+ * Concurrent callers (background prewarm + first render) share the same promise.
183
+ * Failed activations are removed so a later caller can retry.
184
+ */
185
+ integrationActivations?: Map<string, Promise<void>>;
186
+ /** When `'host'`, the embedded dev server owns browser dev-client bootstrap. */
187
+ devClientOwner?: 'core' | 'host';
188
+ /** Integration hooks run when a registered `dependencies.scripts` entrypoint changes. */
189
+ registeredScriptEntrypointChangeHandlers?: RegisteredScriptEntrypointChangeHandler[];
190
+ /** @deprecated Prefer {@link devClientOwner}: `'host'`. */
191
+ delegateBrowserReloadToHost?: boolean;
159
192
  };
160
193
  /**
161
194
  * Experimental features.
@@ -222,11 +255,4 @@ export interface EcoPagesFileSystemServerAdapter<ServerInstanceOptions = unknown
222
255
  server: unknown;
223
256
  }>;
224
257
  }
225
- export interface ProcessorPlugin {
226
- name: string;
227
- description?: string;
228
- setup(): Promise<void>;
229
- process<T = unknown>(input: T): Promise<T>;
230
- teardown?(): Promise<void>;
231
- }
232
- export type { ClientBridgeEvent, DefaultHmrContext, IHmrManager, IClientBridge } from './public-types.js';
258
+ export type { ClientBridgeEvent, DefaultHmrContext, HmrFileChangeOptions, IHmrManager, IClientBridge, } from './public-types.js';
@@ -1,8 +1,7 @@
1
1
  import type { Readable } from 'node:stream';
2
- import type { ApiResponseBuilder } from '../adapters/shared/api-response.js';
2
+ import type { ApiResponseBuilder } from '../adapters/shared/http/api-response.js';
3
3
  import type { BuildExecutor } from '../build/build-adapter.js';
4
- import type { EcoBuildPlugin } from '../build/build-types.js';
5
- import type { ForeignChildRuntime } from '../route-renderer/orchestration/component-render-context.js';
4
+ import type { ForeignChildRuntime } from '../route-renderer/orchestration/foreign-child/component-render-context.js';
6
5
  import type { EcoPageComponent } from '../eco/eco.types.js';
7
6
  import type { EcoPagesAppConfig } from './internal-types.js';
8
7
  import type { HmrStrategy } from '../hmr/hmr-strategy.js';
@@ -14,8 +13,84 @@ import type { EntrypointDependencyGraph } from '../services/runtime-state/entryp
14
13
  export type { EcoPagesAppConfig } from './internal-types.js';
15
14
  export type { EcoPageComponent } from '../eco/eco.types.js';
16
15
  export type { ProcessedAsset } from '../services/assets/asset-processing-service/assets.types.js';
17
- import type { StandardSchema, StandardSchemaResult, StandardSchemaSuccessResult, StandardSchemaFailureResult, StandardSchemaIssue, InferOutput } from '../services/validation/standard-schema.types.js';
18
- export type { StandardSchema, StandardSchemaResult, StandardSchemaSuccessResult, StandardSchemaFailureResult, StandardSchemaIssue, InferOutput, ForeignChildRuntime, };
16
+ /**
17
+ * Runtime-agnostic incoming WebSocket frame.
18
+ *
19
+ * Both Bun and Node `ws` deliver text and binary frames; this discriminated
20
+ * union lets handlers deal with both without runtime-specific casts.
21
+ */
22
+ export type IncomingWebSocketMessage = {
23
+ readonly kind: 'text';
24
+ readonly text: string;
25
+ } | {
26
+ readonly kind: 'binary';
27
+ readonly data: Uint8Array;
28
+ };
29
+ /**
30
+ * Runtime-agnostic outgoing WebSocket payload.
31
+ *
32
+ * Strings are sent as text frames. Anything binary-shaped is sent as binary
33
+ * frames. `Blob` is included for cross-runtime parity and is normalized to a
34
+ * binary frame by each adapter.
35
+ */
36
+ export type OutgoingWebSocketMessage = string | Uint8Array | ArrayBuffer | ArrayBufferView | Blob;
37
+ /**
38
+ * Close event delivered to `onClose` after a connection terminates.
39
+ */
40
+ export interface WebSocketCloseInfo {
41
+ readonly code: number;
42
+ readonly reason: string;
43
+ readonly wasClean: boolean;
44
+ }
45
+ /**
46
+ * Input passed to a WebSocket handler's `context()` factory.
47
+ *
48
+ * Adapters call `context()` exactly once per accepted upgrade. The returned
49
+ * value becomes `socket.context` and is shared by all lifecycle hooks.
50
+ */
51
+ export interface WebSocketContextFactoryInput<TParams extends Record<string, string> = Record<string, string>> {
52
+ readonly request: Request;
53
+ readonly kind: string;
54
+ readonly params: TParams;
55
+ readonly search: Readonly<Record<string, string>>;
56
+ readonly locals?: RequestLocals;
57
+ }
58
+ /**
59
+ * Runtime-agnostic WebSocket socket view exposed to handlers.
60
+ *
61
+ * Framework-owned fields:
62
+ * - `kind`: the registered route pattern (e.g. '/ws/chat/:roomId')
63
+ * - `params`: dynamic segments captured at match time
64
+ * - `search`: query string, always string-typed
65
+ *
66
+ * App-owned field:
67
+ * - `context`: returned by the handler's `context()` factory
68
+ */
69
+ export interface EcopagesSocket<TContext = unknown, TParams extends Record<string, string> = Record<string, string>> {
70
+ readonly kind: string;
71
+ readonly params: TParams;
72
+ readonly search: Readonly<Record<string, string>>;
73
+ readonly context: TContext;
74
+ send(message: OutgoingWebSocketMessage): void;
75
+ sendStream(stream: ReadableStream<Uint8Array>): Promise<void>;
76
+ close(code?: number, reason?: string): void;
77
+ }
78
+ /**
79
+ * Connection-lifecycle handler object.
80
+ *
81
+ * All hooks are optional. `context()` is the one-time initializer that
82
+ * produces the per-connection state shared by the lifecycle hooks. Returning
83
+ * a rejected promise from `context()` aborts the upgrade.
84
+ */
85
+ export interface EcopagesWebSocketHandler<TContext = unknown, TParams extends Record<string, string> = Record<string, string>> {
86
+ context?(input: WebSocketContextFactoryInput<TParams>): TContext | Promise<TContext>;
87
+ onConnect?(socket: EcopagesSocket<TContext, TParams>): void | Promise<void>;
88
+ onMessage?(socket: EcopagesSocket<TContext, TParams>, message: IncomingWebSocketMessage): void | Promise<void>;
89
+ onClose?(socket: EcopagesSocket<TContext, TParams>, event: WebSocketCloseInfo): void | Promise<void>;
90
+ onError?(socket: EcopagesSocket<TContext, TParams>, error: unknown): void | Promise<void>;
91
+ }
92
+ import type { StandardSchema, StandardSchemaResult, StandardSchemaSuccessResult, StandardSchemaFailureResult, StandardSchemaIssue, InferOutput, StandardSchemaV1 } from '../services/validation/standard-schema.types.js';
93
+ export type { StandardSchema, StandardSchemaResult, StandardSchemaSuccessResult, StandardSchemaFailureResult, StandardSchemaIssue, InferOutput, StandardSchemaV1, ForeignChildRuntime, };
19
94
  export type InteractionEventsString = ScriptsInjectorInteractionEventsString;
20
95
  export type DependencyLazyTrigger = {
21
96
  'on:idle': true;
@@ -99,10 +174,6 @@ export interface DefaultHmrContext {
99
174
  * Directory where HMR bundles are written.
100
175
  */
101
176
  getDistDir(): string;
102
- /**
103
- * Build plugins to use during bundling.
104
- */
105
- getPlugins(): EcoBuildPlugin[];
106
177
  /**
107
178
  * Absolute path to the source directory.
108
179
  */
@@ -133,6 +204,14 @@ export interface DefaultHmrContext {
133
204
  * Entrypoint dependency graph for selective HMR invalidation.
134
205
  */
135
206
  getEntrypointDependencyGraph(): EntrypointDependencyGraph;
207
+ /**
208
+ * Registers an already-materialized HMR entrypoint without rebuilding it.
209
+ *
210
+ * @remarks
211
+ * Cold dev batches seed the registrar after grouped builds so the first SSR
212
+ * resolves the artifact from disk instead of triggering a rebuild.
213
+ */
214
+ seedResolvedEntrypoint(resolved: ResolvedHmrEntrypoint): void;
136
215
  }
137
216
  /**
138
217
  * Represents an event broadcast to connected clients via the ClientBridge.
@@ -154,6 +233,22 @@ export type ClientBridgeEvent = {
154
233
  * Timestamp for cache busting
155
234
  */
156
235
  timestamp?: number;
236
+ /**
237
+ * Page Browser Graph identities invalidated by the originating file change.
238
+ */
239
+ graphIdentities?: Array<{
240
+ integrationName: string;
241
+ routeFile: string;
242
+ policy: 'development' | 'production';
243
+ entryFingerprint: string;
244
+ }>;
245
+ };
246
+ /**
247
+ * Options for handling a development file change through HMR.
248
+ */
249
+ export type HmrFileChangeOptions = {
250
+ broadcast?: boolean;
251
+ graphIdentities?: ClientBridgeEvent['graphIdentities'];
157
252
  };
158
253
  /**
159
254
  * Adapter-agnostic interface for broadcasting development events to connected clients.
@@ -167,6 +262,14 @@ export interface IClientBridge {
167
262
  error(message: string): void;
168
263
  subscriberCount: number;
169
264
  }
265
+ /**
266
+ * Verified HMR entrypoint artifact produced by registration.
267
+ */
268
+ export interface ResolvedHmrEntrypoint {
269
+ sourcePath: string;
270
+ outputPath: string;
271
+ outputUrl: string;
272
+ }
170
273
  /**
171
274
  * Interface for the HMR Manager.
172
275
  * Used by integration plugins to register entrypoints and strategies.
@@ -188,19 +291,19 @@ export interface IHmrManager {
188
291
  * framework integration. Unlike `registerEntrypoint()`, it may use the generic
189
292
  * script bundling path.
190
293
  */
191
- registerScriptEntrypoint(entrypointPath: string): Promise<string>;
294
+ registerScriptEntrypoint(entrypointPath: string): Promise<ResolvedHmrEntrypoint>;
192
295
  /**
193
296
  * Registers a custom HMR strategy.
194
297
  */
195
298
  registerStrategy(strategy: HmrStrategy): void;
196
- /**
197
- * Sets the build plugins to use during bundling.
198
- */
199
- setPlugins(plugins: EcoBuildPlugin[]): void;
200
299
  /**
201
300
  * Enables or disables HMR.
202
301
  */
203
302
  setEnabled(enabled: boolean): void;
303
+ /**
304
+ * Stops active HMR watchers and releases dev-time resources.
305
+ */
306
+ stop(): void;
204
307
  /**
205
308
  * Returns whether HMR is enabled.
206
309
  */
@@ -213,6 +316,18 @@ export interface IHmrManager {
213
316
  * Gets the output URL for a registered entrypoint.
214
317
  */
215
318
  getOutputUrl(entrypointPath: string): string | undefined;
319
+ /**
320
+ * Returns an existing emitted HMR script artifact without registering it.
321
+ */
322
+ getResolvedScriptOutput?(entrypointPath: string): ResolvedHmrEntrypoint | undefined;
323
+ /**
324
+ * Registers an already-materialized HMR entrypoint without rebuilding it.
325
+ *
326
+ * @remarks
327
+ * Cold dev batches seed the registrar after grouped builds so the first SSR
328
+ * resolves the artifact from disk instead of triggering a rebuild.
329
+ */
330
+ seedResolvedEntrypoint?(resolved: ResolvedHmrEntrypoint): void;
216
331
  /**
217
332
  * Gets the map of watched files.
218
333
  */
@@ -222,9 +337,13 @@ export interface IHmrManager {
222
337
  */
223
338
  getDistDir(): string;
224
339
  /**
225
- * Gets the build plugins.
340
+ * Returns the on-disk path to the bundled HMR runtime script.
226
341
  */
227
- getPlugins(): EcoBuildPlugin[];
342
+ getRuntimePath(): string;
343
+ /**
344
+ * Serves a development HMR asset request when the URL matches a known HMR path.
345
+ */
346
+ tryHandleAssetRequest(request: Request): Response | null;
228
347
  /**
229
348
  * Gets the default HMR context.
230
349
  */
@@ -232,7 +351,7 @@ export interface IHmrManager {
232
351
  /**
233
352
  * Handles a file change event.
234
353
  */
235
- handleFileChange(path: string): Promise<void>;
354
+ handleFileChange(path: string, options?: HmrFileChangeOptions): Promise<void>;
236
355
  }
237
356
  /**
238
357
  * Represents the dependencies for an EcoComponent.
@@ -247,23 +366,35 @@ export type EcoComponentDependencies = {
247
366
  * to express explicit module imports for client bundles.
248
367
  */
249
368
  modules?: string[];
250
- components?: EcoComponent[];
369
+ /**
370
+ * Child components whose assets and foreign-child graph are collected transitively.
371
+ * Each entry must be an `eco.component()`, `eco.layout()`, or `eco.html()` result
372
+ * with plugin-injected `config.__eco` metadata.
373
+ */
374
+ components?: EcoDeclaredComponent[];
251
375
  };
376
+ /**
377
+ * Component returned from `eco.component()`, `eco.layout()`, or `eco.html()`.
378
+ *
379
+ * @remarks
380
+ * Used for `dependencies.components` and eco factory return types. Plugin-injected
381
+ * `config.__eco` is enforced at runtime via `isEcoDeclaredComponent()`, not by this alias.
382
+ */
383
+ export type EcoDeclaredComponent<P = any, R = any> = EcoComponent<P, R>;
252
384
  export type EcoPagesElement = string | Promise<string>;
253
385
  /**
254
386
  * Serializable child payloads accepted by cross-integration deferred rendering.
255
387
  *
256
- * This models the broad value shapes that EcoPages already flattens when a
257
- * foreign component boundary serializes its children for another integration.
258
- * It is intentionally transport-oriented rather than framework-native, so it
259
- * can be shared across Kita, Lit, React, and Ecopages JSX authoring surfaces
260
- * without coupling core types to any one renderer.
388
+ * @remarks
389
+ * Covers primitives, arrays, and Kita/Lit-style template results (`strings` /
390
+ * optional `values`). Plain opaque objects are intentionally excluded; foreign
391
+ * composition boundaries reject them before serializers can coerce `String(object)`.
392
+ * Framework-native trees (React nodes, JSX elements) stay outside this type and
393
+ * use EcoEmbed or already-serialized HTML at the boundary.
261
394
  */
262
395
  export type EcoChildren = string | Promise<string> | number | bigint | boolean | null | undefined | readonly EcoChildren[] | {
263
396
  strings: readonly string[];
264
397
  values?: readonly EcoChildren[];
265
- } | {
266
- [key: string]: EcoChildren;
267
398
  };
268
399
  /**
269
400
  * Represents the input configuration for EcoPages.
@@ -314,11 +445,13 @@ export type EcoComponentConfig = {
314
445
  * );
315
446
  *
316
447
  * // Page using the layout
317
- * const MyPage = () => <h1>Hello</h1>;
318
- * MyPage.config = { layout: Layout };
448
+ * const MyPage = eco.page({ layout: Layout, render: () => <h1>Hello</h1> });
319
449
  * ```
320
450
  */
321
- layout?: EcoPageLayoutComponent<any>;
451
+ /** Normalized outer→inner layout stack from `eco.page({ layout: [...] })`. */
452
+ layouts?: EcoDeclaredComponent[];
453
+ /** Layout entries retained for per-tier prop factories. */
454
+ layoutEntries?: EcoPageLayoutEntry[];
322
455
  dependencies?: EcoComponentDependencies;
323
456
  /**
324
457
  * Internal: Resolved lazy scripts grouped by trigger.
@@ -409,6 +542,21 @@ export type EcoComponent<P = any, R = any> = IsAny<P> extends true ? EcoFunction
409
542
  export type PageProps<T = unknown> = T & StaticPageContext & {
410
543
  locals?: RequestLocals;
411
544
  };
545
+ /**
546
+ * Page-level robots directives for the document head and sitemap filtering.
547
+ *
548
+ * @remarks
549
+ * When `index` is `false`, the page is omitted from the auto-generated sitemap
550
+ * for routes whose metadata can be resolved during static export (filesystem
551
+ * pages and `app.static()` views with `metadata`). Defaults when omitted:
552
+ * `index: true`, `follow: true`. A `<meta name="robots">` tag is emitted by the
553
+ * route HTML finalization path when directives differ from those defaults.
554
+ */
555
+ export interface PageRobotsMetadata {
556
+ index?: boolean;
557
+ follow?: boolean;
558
+ nocache?: boolean;
559
+ }
412
560
  /**
413
561
  * Represents the metadata for a page.
414
562
  */
@@ -418,6 +566,48 @@ export interface PageMetadataProps {
418
566
  image?: string;
419
567
  url?: string;
420
568
  keywords?: string[];
569
+ robots?: PageRobotsMetadata;
570
+ }
571
+ /**
572
+ * Configuration for automatic `sitemap.xml` generation during static export.
573
+ *
574
+ * @remarks
575
+ * Disabled by default. When enabled, the sitemap is written after
576
+ * `afterStaticExport` so integration-generated URLs can be listed via
577
+ * `extraUrls`. Use `exclude` for bulk pathname filters and `metadata.robots.index: false`
578
+ * for page-level noindex that also removes the URL from the sitemap when metadata
579
+ * is available during export.
580
+ */
581
+ export interface SitemapConfig {
582
+ /** Emit sitemap.xml during static generation. @default false */
583
+ enabled?: boolean;
584
+ /** Output file name. @default "sitemap.xml" */
585
+ fileName?: string;
586
+ /**
587
+ * Extra, non-page URLs to include (e.g. "/rss.xml").
588
+ *
589
+ * @remarks
590
+ * Relative paths are resolved against `baseUrl`. Absolute `http(s)` URLs pass
591
+ * through. Always appended after page URLs; not filtered by `exclude` or page robots.
592
+ */
593
+ extraUrls?: string[];
594
+ /**
595
+ * Pathname patterns to exclude even if a page exists.
596
+ *
597
+ * @remarks
598
+ * Supported patterns: exact paths (`/admin`) and prefix wildcards (`/admin/**`).
599
+ * Unsupported patterns are treated as exact matches. This is not a full glob engine.
600
+ */
601
+ exclude?: string[];
602
+ }
603
+ /**
604
+ * Slim route descriptor for static-export hooks and runtime consumers.
605
+ */
606
+ export interface EcopagesRouteInfo {
607
+ /** Resolved URL pathname, e.g. `/blog/my-post`. */
608
+ pathname: string;
609
+ /** Route params for dynamic routes (empty for static routes). */
610
+ params: Record<string, string>;
421
611
  }
422
612
  /**
423
613
  * Represents the props for the head of a page.
@@ -441,7 +631,46 @@ export interface HtmlTemplateProps<T = EcoPagesElement> extends PageHeadProps<T>
441
631
  language?: string;
442
632
  headContent?: T;
443
633
  pageProps: Record<string, unknown>;
634
+ /**
635
+ * Browser-importable page module URL for router-enabled documents.
636
+ *
637
+ * @remarks
638
+ * Transport-only: threaded into HTML shells (for example `EcoPropsScript`
639
+ * `moduleUrl`) and serialized as the page-data envelope `moduleUrl`. Not page
640
+ * component state.
641
+ */
642
+ pageModuleUrl?: string;
444
643
  }
644
+ /**
645
+ * Request-scoped context available to layout prop factories on `eco.page`.
646
+ */
647
+ export type LayoutPropsContext = {
648
+ params?: Record<string, string>;
649
+ query?: Record<string, string>;
650
+ locals?: RequestLocals;
651
+ };
652
+ /**
653
+ * One layout tier in a page layout stack (outer→inner).
654
+ */
655
+ export type EcoPageLayoutEntry<E = EcoPagesElement> = {
656
+ component: EcoDeclaredComponent<any, E>;
657
+ props?: (context: LayoutPropsContext) => Record<string, unknown>;
658
+ };
659
+ /**
660
+ * Layout declaration accepted by `eco.page()`.
661
+ *
662
+ * @remarks
663
+ * Array order is outer→inner, matching Next.js App Router segment nesting.
664
+ */
665
+ export type EcoPageLayoutSpec<E = EcoPagesElement> = EcoDeclaredComponent<any, E> | EcoPageLayoutEntry<E>;
666
+ /**
667
+ * One or more layout tiers for `eco.page({ layout })`.
668
+ *
669
+ * @remarks
670
+ * When an array, order is **outer → inner** (outermost layout wraps all inner tiers).
671
+ * Normalized at factory time to `config.layouts` and `config.layoutEntries`.
672
+ */
673
+ export type EcoPageLayouts<E = EcoPagesElement> = EcoPageLayoutSpec<E> | EcoPageLayoutSpec<E>[];
445
674
  /**
446
675
  * Layout components accepted by pages.
447
676
  *
@@ -458,12 +687,25 @@ export type EcoLayoutComponent<T = EcoPagesElement> = EcoComponent<LayoutProps<T
458
687
  */
459
688
  export type EcoHtmlComponent<T = EcoPagesElement> = EcoComponent<HtmlTemplateProps, T>;
460
689
  /**
461
- * Represents the props for the error 404 template.
690
+ * Props type for the semantic `404.*` page template.
691
+ * @remarks `message` and `stack` are declared for future error context. The
692
+ * runtime does not currently pass these props when rendering the custom 404 page.
462
693
  */
463
694
  export interface Error404TemplateProps extends Omit<HtmlTemplateProps, 'children'> {
464
695
  message: string;
465
696
  stack?: string;
466
697
  }
698
+ /**
699
+ * Props type for the semantic `500.*` page template.
700
+ * @remarks In development, the page-pipeline passes `message` and `stack` from the
701
+ * thrown error when rendering this page after a failure. In production those
702
+ * fields are omitted so stacks are not serialized into HTML. Direct visits to
703
+ * `/500` also omit them.
704
+ */
705
+ export interface Error500TemplateProps extends Omit<HtmlTemplateProps, 'children'> {
706
+ message?: string;
707
+ stack?: string;
708
+ }
467
709
  /**
468
710
  * Represents the parameters for a page.
469
711
  * The keys are strings, and the values can be either a string or an array of strings.
@@ -587,6 +829,12 @@ export type RouteRendererOptions = {
587
829
  params?: PageParams;
588
830
  query?: PageQuery;
589
831
  locals?: RequestLocals;
832
+ /**
833
+ * Extra props merged into the page props for this render.
834
+ * @remarks Used by semantic error pages (for example development `message` /
835
+ * `stack` on the custom 500 page).
836
+ */
837
+ props?: Record<string, unknown>;
590
838
  };
591
839
  /**
592
840
  * The body of the route renderer.
@@ -659,15 +907,15 @@ export type IntegrationRendererRenderOptions<C = EcoPagesElement> = RouteRendere
659
907
  metadata: PageMetadataProps;
660
908
  HtmlTemplate: EcoHtmlComponent<C>;
661
909
  Page: EcoComponent<PageProps, C>;
910
+ Layouts?: EcoDeclaredComponent[];
662
911
  Layout?: EcoPageLayoutComponent<any>;
912
+ layoutEntries?: EcoPageLayoutEntry[];
663
913
  dependencies?: EcoComponentDependencies;
664
914
  resolvedDependencies: ProcessedAsset[];
665
915
  pagePackage?: PagePackageResult;
666
- componentRender?: ComponentRenderResult;
667
916
  pageProps?: Record<string, unknown>;
668
917
  cacheStrategy?: CacheStrategy;
669
918
  pageLocals?: RequestLocals;
670
- ownershipPlan?: OwnershipPlan;
671
919
  };
672
920
  /**
673
921
  * Structured page asset package produced after dependency resolution.
@@ -746,27 +994,6 @@ export interface OwnershipValidationError {
746
994
  integrationName?: string;
747
995
  }
748
996
  export type OwnershipPlanNodeSource = 'route' | 'page' | 'layout' | 'html-template' | 'dependency';
749
- export interface IntegrationOwnership {
750
- integrationName: string;
751
- componentId: string;
752
- componentFile?: string;
753
- isPageEntry: boolean;
754
- isForeignToParent: boolean;
755
- }
756
- export interface OwnershipPlanNode {
757
- id: string;
758
- source: OwnershipPlanNodeSource;
759
- ownership: IntegrationOwnership;
760
- children: OwnershipPlanNode[];
761
- declaredDependenciesValid: boolean;
762
- }
763
- export interface OwnershipPlan {
764
- root: OwnershipPlanNode;
765
- rendererNames: string[];
766
- foreignEdgeCount: number;
767
- hasValidationErrors: boolean;
768
- validationErrors: OwnershipValidationError[];
769
- }
770
997
  export type ForeignSubtreeAttachmentPolicy = {
771
998
  kind: 'none';
772
999
  } | {
@@ -790,6 +1017,16 @@ export interface BaseIntegrationContext {
790
1017
  rendererCache?: Map<string, unknown>;
791
1018
  componentInstanceId?: string;
792
1019
  }
1020
+ /**
1021
+ * Shared input for renderer-owned component execution.
1022
+ *
1023
+ * @remarks
1024
+ * `children` stays `unknown` at this boundary so integrations can receive
1025
+ * queued tokens, already-serialized HTML, or framework-native values before
1026
+ * their own placement rules apply. Opaque values must be rejected or converted
1027
+ * by foreign-child interception before string serializers run; adapters keep
1028
+ * framework-specific placement (React raw HTML, Lit slot markers).
1029
+ */
793
1030
  export interface ComponentRenderInput<TIntegrationContext extends BaseIntegrationContext = BaseIntegrationContext> {
794
1031
  component: EcoComponent;
795
1032
  props: Record<string, unknown>;
@@ -0,0 +1,26 @@
1
+ import type { EcopagesRouteInfo } from '../types/public-types.js';
2
+ /**
3
+ * Maps a static-generation or registry route into the public slim route shape.
4
+ */
5
+ export declare function toEcopagesRouteInfo(route: {
6
+ pathname: string;
7
+ params: Record<string, string | string[]>;
8
+ }): EcopagesRouteInfo;
9
+ /**
10
+ * Flattens string | string[] route params into string values for public APIs.
11
+ */
12
+ export declare function normalizeRouteParams(params: Record<string, string | string[]>): Record<string, string>;
13
+ type StaticGenerationRouteLister = (input: {
14
+ runtimeOrigin: string;
15
+ }) => Promise<readonly {
16
+ pathname: string;
17
+ params: Record<string, string | string[]>;
18
+ }[]>;
19
+ /**
20
+ * Resolves {@link EcopagesRouteInfo} entries for app-start and similar consumers.
21
+ */
22
+ export declare function resolveAppStartRoutes(input: {
23
+ listStaticGenerationRoutes?: StaticGenerationRouteLister;
24
+ runtimeOrigin: string;
25
+ }): Promise<EcopagesRouteInfo[]>;
26
+ export {};
@@ -0,0 +1,26 @@
1
+ import { normalizePathname } from "./path-pattern.js";
2
+ function toEcopagesRouteInfo(route) {
3
+ return {
4
+ pathname: normalizePathname(route.pathname),
5
+ params: normalizeRouteParams(route.params)
6
+ };
7
+ }
8
+ function normalizeRouteParams(params) {
9
+ const normalized = {};
10
+ for (const [key, value] of Object.entries(params)) {
11
+ normalized[key] = Array.isArray(value) ? value.join("/") : value;
12
+ }
13
+ return normalized;
14
+ }
15
+ async function resolveAppStartRoutes(input) {
16
+ if (!input.listStaticGenerationRoutes) {
17
+ return [];
18
+ }
19
+ const routes = await input.listStaticGenerationRoutes({ runtimeOrigin: input.runtimeOrigin });
20
+ return routes.map(toEcopagesRouteInfo);
21
+ }
22
+ export {
23
+ normalizeRouteParams,
24
+ resolveAppStartRoutes,
25
+ toEcopagesRouteInfo
26
+ };
@@ -5,3 +5,10 @@
5
5
  * @returns Escaped attribute-safe string.
6
6
  */
7
7
  export declare function escapeHtmlAttribute(value: string): string;
8
+ /**
9
+ * Escapes a string for safe use as XML text content (e.g. `<loc>` values).
10
+ *
11
+ * @param value Raw text node value.
12
+ * @returns Escaped XML-safe string.
13
+ */
14
+ export declare function escapeXmlText(value: string): string;
@@ -1,6 +1,10 @@
1
1
  function escapeHtmlAttribute(value) {
2
2
  return value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
3
3
  }
4
+ function escapeXmlText(value) {
5
+ return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
6
+ }
4
7
  export {
5
- escapeHtmlAttribute
8
+ escapeHtmlAttribute,
9
+ escapeXmlText
6
10
  };