@ecopages/core 0.2.0-alpha.8 → 0.2.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/README.md +79 -28
  2. package/package.json +94 -116
  3. package/src/adapters/README.md +2 -2
  4. package/src/adapters/abstract/application-adapter.d.ts +28 -2
  5. package/src/adapters/abstract/application-adapter.js +14 -2
  6. package/src/adapters/abstract/router-adapter.d.ts +1 -1
  7. package/src/adapters/abstract/server-adapter.d.ts +2 -2
  8. package/src/adapters/bun/client-bridge.d.ts +1 -1
  9. package/src/adapters/bun/create-app.d.ts +12 -12
  10. package/src/adapters/bun/create-app.js +64 -41
  11. package/src/adapters/bun/hmr-manager.d.ts +19 -115
  12. package/src/adapters/bun/hmr-manager.js +25 -301
  13. package/src/adapters/bun/index.d.ts +1 -1
  14. package/src/adapters/bun/index.js +2 -2
  15. package/src/adapters/bun/runtime-host.d.ts +52 -0
  16. package/src/adapters/bun/runtime-host.js +56 -0
  17. package/src/adapters/bun/server-adapter.d.ts +100 -32
  18. package/src/adapters/bun/server-adapter.js +142 -65
  19. package/src/adapters/bun/static-preview-host.d.ts +28 -0
  20. package/src/adapters/bun/static-preview-host.js +45 -0
  21. package/src/{create-app.d.ts → adapters/create-app.d.ts} +9 -6
  22. package/src/{create-app.js → adapters/create-app.js} +4 -4
  23. package/src/adapters/index.d.ts +1 -5
  24. package/src/adapters/index.js +1 -7
  25. package/src/adapters/node/create-app.d.ts +15 -12
  26. package/src/adapters/node/create-app.js +34 -85
  27. package/src/adapters/node/http-request-bridge.d.ts +57 -0
  28. package/src/adapters/node/http-request-bridge.js +118 -0
  29. package/src/adapters/node/node-client-bridge.d.ts +1 -1
  30. package/src/adapters/node/node-hmr-manager.d.ts +22 -103
  31. package/src/adapters/node/node-hmr-manager.js +26 -289
  32. package/src/adapters/node/runtime-host.d.ts +57 -0
  33. package/src/adapters/node/runtime-host.js +92 -0
  34. package/src/adapters/node/server-adapter-dependencies.d.ts +19 -0
  35. package/src/adapters/node/server-adapter-dependencies.js +18 -0
  36. package/src/adapters/node/server-adapter.d.ts +19 -42
  37. package/src/adapters/node/server-adapter.js +94 -139
  38. package/src/adapters/node/static-content-server.d.ts +1 -1
  39. package/src/adapters/node/static-content-server.js +1 -1
  40. package/src/adapters/node/static-preview-host.d.ts +55 -0
  41. package/src/adapters/node/static-preview-host.js +68 -0
  42. package/src/adapters/shared/application-adapter.d.ts +1 -1
  43. package/src/adapters/shared/define-api-handler.d.ts +1 -1
  44. package/src/adapters/shared/explicit-static-render-preparation.d.ts +25 -0
  45. package/src/adapters/shared/explicit-static-render-preparation.js +26 -0
  46. package/src/adapters/shared/explicit-static-route-matcher.d.ts +7 -4
  47. package/src/adapters/shared/explicit-static-route-matcher.js +14 -16
  48. package/src/adapters/shared/file-route-middleware-pipeline.d.ts +7 -10
  49. package/src/adapters/shared/file-route-middleware-pipeline.js +2 -11
  50. package/src/adapters/shared/fs-server-response-factory.d.ts +14 -10
  51. package/src/adapters/shared/fs-server-response-factory.js +11 -27
  52. package/src/adapters/shared/fs-server-response-matcher.d.ts +18 -18
  53. package/src/adapters/shared/fs-server-response-matcher.js +72 -46
  54. package/src/adapters/shared/hmr-entrypoint-registrar.js +1 -1
  55. package/src/adapters/shared/hmr-html-response.d.ts +1 -1
  56. package/src/adapters/shared/hmr-html-response.js +4 -3
  57. package/src/adapters/shared/render-context.d.ts +5 -3
  58. package/src/adapters/shared/render-context.js +24 -1
  59. package/src/adapters/shared/runtime-app-bootstrap.d.ts +26 -0
  60. package/src/adapters/shared/runtime-app-bootstrap.js +46 -0
  61. package/src/adapters/shared/runtime-host.d.ts +12 -0
  62. package/src/adapters/shared/server-adapter.d.ts +22 -11
  63. package/src/adapters/shared/server-adapter.js +183 -133
  64. package/src/adapters/shared/server-route-handler.d.ts +5 -5
  65. package/src/adapters/shared/server-route-handler.js +4 -4
  66. package/src/adapters/shared/server-static-builder.d.ts +8 -7
  67. package/src/adapters/shared/server-static-builder.js +6 -5
  68. package/src/adapters/shared/shared-hmr-manager.d.ts +59 -0
  69. package/src/adapters/shared/shared-hmr-manager.js +241 -0
  70. package/src/adapters/shared/static-preview-host.d.ts +10 -0
  71. package/src/build/README.md +57 -67
  72. package/src/build/browser-runtime-manifest.d.ts +31 -0
  73. package/src/build/browser-runtime-manifest.js +61 -0
  74. package/src/build/browser-runtime-plugin-helpers.d.ts +26 -0
  75. package/src/build/browser-runtime-plugin-helpers.js +14 -0
  76. package/src/build/browser-runtime-plugin.d.ts +78 -0
  77. package/src/build/browser-runtime-plugin.js +173 -0
  78. package/src/build/build-adapter.d.ts +384 -63
  79. package/src/build/build-adapter.js +129 -54
  80. package/src/build/build-manifest.d.ts +6 -0
  81. package/src/build/build-manifest.js +21 -2
  82. package/src/build/build-types.d.ts +2 -2
  83. package/src/build/rolldown-adapter-helpers.d.ts +58 -0
  84. package/src/build/rolldown-adapter-helpers.js +265 -0
  85. package/src/build/rolldown-build-adapter.d.ts +28 -0
  86. package/src/build/rolldown-build-adapter.js +65 -0
  87. package/src/build/rolldown-dev-build-adapter.d.ts +82 -0
  88. package/src/build/rolldown-dev-build-adapter.js +166 -0
  89. package/src/build/rolldown-plugin-bridge.d.ts +59 -0
  90. package/src/build/rolldown-plugin-bridge.js +199 -0
  91. package/src/build/runtime-build-executor.d.ts +15 -7
  92. package/src/build/runtime-build-executor.js +8 -9
  93. package/src/build/runtime-build-output-normalizer.d.ts +3 -0
  94. package/src/build/runtime-build-output-normalizer.js +111 -0
  95. package/src/build/serialized-build-executor.d.ts +64 -0
  96. package/src/build/serialized-build-executor.js +63 -0
  97. package/src/build/server-side-css-shim-plugin.d.ts +41 -0
  98. package/src/build/server-side-css-shim-plugin.js +35 -0
  99. package/src/cache/index.d.ts +6 -0
  100. package/src/cache/index.js +6 -0
  101. package/src/cache/module-parse-cache.d.ts +65 -0
  102. package/src/cache/module-parse-cache.js +75 -0
  103. package/src/config/README.md +5 -2
  104. package/src/config/config-builder.d.ts +41 -13
  105. package/src/config/config-builder.js +62 -24
  106. package/src/declarations.d.ts +1 -1
  107. package/src/dev/host-runtime.d.ts +10 -0
  108. package/src/dev/host-runtime.js +24 -0
  109. package/src/dev/sc-server.d.ts +1 -1
  110. package/src/dev/sc-server.js +1 -1
  111. package/src/eco/eco.browser.d.ts +2 -0
  112. package/src/eco/eco.browser.js +88 -0
  113. package/src/eco/eco.js +50 -45
  114. package/src/eco/eco.types.d.ts +60 -8
  115. package/src/eco/eco.utils.d.ts +1 -40
  116. package/src/eco/eco.utils.js +5 -35
  117. package/src/eco/global-injector-map.d.ts +3 -3
  118. package/src/eco/global-injector-map.js +2 -2
  119. package/src/eco/lazy-injector-map.d.ts +2 -2
  120. package/src/errors/index.d.ts +1 -0
  121. package/src/errors/index.js +3 -1
  122. package/src/hmr/client/hmr-runtime.js +9 -1
  123. package/src/hmr/hmr-strategy.d.ts +16 -13
  124. package/src/hmr/hmr-strategy.js +22 -7
  125. package/src/hmr/strategies/default-hmr-strategy.d.ts +2 -2
  126. package/src/hmr/strategies/default-hmr-strategy.js +1 -1
  127. package/src/hmr/strategies/js-hmr-strategy.d.ts +4 -9
  128. package/src/hmr/strategies/js-hmr-strategy.js +5 -10
  129. package/src/index.browser.d.ts +2 -2
  130. package/src/index.browser.js +1 -1
  131. package/src/index.d.ts +3 -2
  132. package/src/index.js +15 -4
  133. package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -1
  134. package/src/integrations/ghtml/ghtml-renderer.js +24 -29
  135. package/src/integrations/ghtml/ghtml.constants.d.ts +1 -0
  136. package/src/integrations/ghtml/ghtml.constants.js +4 -0
  137. package/src/integrations/ghtml/ghtml.plugin.d.ts +2 -6
  138. package/src/integrations/ghtml/ghtml.plugin.js +3 -4
  139. package/src/plugins/README.md +1 -0
  140. package/src/plugins/alias-resolver-cache.d.ts +68 -0
  141. package/src/plugins/alias-resolver-cache.js +106 -0
  142. package/src/plugins/alias-resolver-plugin.d.ts +5 -1
  143. package/src/plugins/alias-resolver-plugin.js +19 -7
  144. package/src/plugins/eco-component-meta-plugin.d.ts +12 -1
  145. package/src/plugins/eco-component-meta-plugin.js +43 -25
  146. package/src/plugins/foreign-jsx-override-plugin.d.ts +33 -0
  147. package/src/plugins/foreign-jsx-override-plugin.js +41 -0
  148. package/src/plugins/integration-plugin.d.ts +136 -42
  149. package/src/plugins/integration-plugin.js +99 -31
  150. package/src/plugins/processor.d.ts +4 -2
  151. package/src/plugins/processor.js +8 -3
  152. package/src/plugins/source-transform.d.ts +46 -0
  153. package/src/plugins/source-transform.js +71 -0
  154. package/src/route-renderer/GRAPH.md +80 -318
  155. package/src/route-renderer/README.md +74 -78
  156. package/src/route-renderer/orchestration/component-render-context.d.ts +97 -0
  157. package/src/route-renderer/orchestration/component-render-context.js +147 -0
  158. package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +18 -0
  159. package/src/route-renderer/orchestration/declared-ownership-graph.js +34 -0
  160. package/src/route-renderer/orchestration/foreign-subtree-execution.service.d.ts +110 -0
  161. package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +233 -0
  162. package/src/route-renderer/orchestration/integration-renderer.d.ts +290 -128
  163. package/src/route-renderer/orchestration/integration-renderer.js +660 -258
  164. package/src/route-renderer/orchestration/ownership-planning.service.d.ts +24 -0
  165. package/src/route-renderer/orchestration/ownership-planning.service.js +63 -0
  166. package/src/route-renderer/orchestration/ownership-validation.service.d.ts +29 -0
  167. package/src/route-renderer/orchestration/ownership-validation.service.js +53 -0
  168. package/src/route-renderer/orchestration/processed-asset-dedupe.d.ts +3 -0
  169. package/src/route-renderer/orchestration/processed-asset-dedupe.js +27 -0
  170. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +91 -0
  171. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +170 -0
  172. package/src/route-renderer/orchestration/render-output.utils.d.ts +66 -0
  173. package/src/route-renderer/orchestration/render-output.utils.js +171 -0
  174. package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +156 -0
  175. package/src/route-renderer/orchestration/route-render-orchestrator.js +577 -0
  176. package/src/route-renderer/orchestration/template-serialization.d.ts +38 -0
  177. package/src/route-renderer/orchestration/template-serialization.js +45 -0
  178. package/src/route-renderer/page-loading/component-dependency-collection.d.ts +37 -0
  179. package/src/route-renderer/page-loading/component-dependency-collection.js +132 -0
  180. package/src/route-renderer/page-loading/declared-asset-collection.d.ts +24 -0
  181. package/src/route-renderer/page-loading/declared-asset-collection.js +106 -0
  182. package/src/route-renderer/page-loading/dependency-resolver.d.ts +2 -2
  183. package/src/route-renderer/page-loading/dependency-resolver.js +27 -354
  184. package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +11 -0
  185. package/src/route-renderer/page-loading/ecopages-virtual-imports.js +57 -0
  186. package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +45 -0
  187. package/src/route-renderer/page-loading/lazy-entry-collection.js +105 -0
  188. package/src/route-renderer/page-loading/lazy-trigger-planning.d.ts +19 -0
  189. package/src/route-renderer/page-loading/lazy-trigger-planning.js +40 -0
  190. package/src/route-renderer/page-loading/module-declaration-aggregation.d.ts +5 -0
  191. package/src/route-renderer/page-loading/module-declaration-aggregation.js +33 -0
  192. package/src/route-renderer/page-loading/module-declaration-scripts.d.ts +3 -0
  193. package/src/route-renderer/page-loading/module-declaration-scripts.js +18 -0
  194. package/src/route-renderer/page-loading/page-dependency-bundling.d.ts +13 -0
  195. package/src/route-renderer/page-loading/page-dependency-bundling.js +137 -0
  196. package/src/route-renderer/page-loading/page-module-loader.d.ts +7 -4
  197. package/src/route-renderer/page-loading/page-module-loader.js +8 -5
  198. package/src/route-renderer/route-renderer.d.ts +31 -23
  199. package/src/route-renderer/route-renderer.js +17 -24
  200. package/src/router/README.md +76 -8
  201. package/src/router/client/navigation-coordinator.d.ts +20 -0
  202. package/src/router/client/navigation-coordinator.js +2 -2
  203. package/src/router/server/route-registry.d.ts +78 -0
  204. package/src/router/server/route-registry.js +262 -0
  205. package/src/services/README.md +1 -2
  206. package/src/services/assets/asset-processing-service/asset-dependency-keys.d.ts +3 -0
  207. package/src/services/assets/asset-processing-service/asset-dependency-keys.js +56 -0
  208. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +3 -20
  209. package/src/services/assets/asset-processing-service/asset-processing.service.js +52 -98
  210. package/src/services/assets/asset-processing-service/asset.factory.d.ts +1 -1
  211. package/src/services/assets/asset-processing-service/asset.factory.js +2 -2
  212. package/src/services/assets/asset-processing-service/assets.types.d.ts +14 -0
  213. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +2 -0
  214. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
  215. package/src/services/assets/asset-processing-service/grouped-content-bundles.d.ts +30 -0
  216. package/src/services/assets/asset-processing-service/grouped-content-bundles.js +65 -0
  217. package/src/services/assets/asset-processing-service/index.d.ts +6 -5
  218. package/src/services/assets/asset-processing-service/index.js +6 -5
  219. package/src/services/assets/asset-processing-service/page-package.d.ts +6 -0
  220. package/src/services/assets/asset-processing-service/page-package.js +80 -0
  221. package/src/services/assets/asset-processing-service/processor.interface.d.ts +2 -2
  222. package/src/services/assets/asset-processing-service/processor.registry.d.ts +2 -2
  223. package/src/services/assets/asset-processing-service/processors/base/base-processor.d.ts +1 -1
  224. package/src/services/assets/asset-processing-service/processors/base/base-processor.js +3 -2
  225. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +10 -5
  226. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +69 -5
  227. package/src/services/assets/asset-processing-service/processors/index.d.ts +5 -5
  228. package/src/services/assets/asset-processing-service/processors/index.js +5 -5
  229. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +3 -2
  230. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +66 -3
  231. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +4 -3
  232. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +27 -6
  233. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +38 -3
  234. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +57 -6
  235. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +5 -2
  236. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +39 -5
  237. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +2 -2
  238. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +5 -2
  239. package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.d.ts +18 -0
  240. package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.js +45 -0
  241. package/src/services/assets/browser-bundle.service.d.ts +44 -3
  242. package/src/services/assets/browser-bundle.service.js +15 -7
  243. package/src/services/html/html-rewriter-provider.service.d.ts +3 -0
  244. package/src/services/html/html-rewriter-provider.service.js +4 -1
  245. package/src/services/html/html-transformer.service.d.ts +22 -3
  246. package/src/services/html/html-transformer.service.js +101 -35
  247. package/src/services/invalidation/development-invalidation.service.d.ts +1 -1
  248. package/src/services/invalidation/development-invalidation.service.js +1 -0
  249. package/src/services/module-loading/app-module-loader.service.d.ts +7 -0
  250. package/src/services/module-loading/app-module-loader.service.js +0 -0
  251. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +9 -1
  252. package/src/services/module-loading/app-server-module-transpiler.service.js +102 -6
  253. package/src/services/module-loading/host-module-loader-registry.d.ts +4 -0
  254. package/src/services/module-loading/host-module-loader-registry.js +15 -0
  255. package/src/services/module-loading/module-loading-types.d.ts +2 -0
  256. package/src/services/module-loading/module-loading-types.js +0 -0
  257. package/src/services/module-loading/page-module-import.service.d.ts +32 -8
  258. package/src/services/module-loading/page-module-import.service.js +83 -22
  259. package/src/services/module-loading/server-module-transpiler.service.d.ts +8 -14
  260. package/src/services/module-loading/server-module-transpiler.service.js +5 -2
  261. package/src/services/module-loading/source-module-support.d.ts +5 -0
  262. package/src/services/module-loading/source-module-support.js +8 -0
  263. package/src/services/runtime-state/dev-graph.service.d.ts +6 -6
  264. package/src/services/runtime-state/dev-graph.service.js +10 -10
  265. package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +1 -1
  266. package/src/services/runtime-state/server-invalidation-state.service.d.ts +1 -1
  267. package/src/static-site-generator/static-site-generator.d.ts +23 -28
  268. package/src/static-site-generator/static-site-generator.js +119 -156
  269. package/src/{internal-types.d.ts → types/internal-types.d.ts} +34 -23
  270. package/src/types/internal-types.js +0 -0
  271. package/src/{public-types.d.ts → types/public-types.d.ts} +195 -37
  272. package/src/types/public-types.js +0 -0
  273. package/src/utils/html-escaping.d.ts +7 -0
  274. package/src/utils/html-escaping.js +6 -0
  275. package/src/utils/locals-utils.d.ts +1 -1
  276. package/src/utils/parse-cli-args.d.ts +4 -1
  277. package/src/utils/parse-cli-args.js +16 -1
  278. package/src/utils/resolve-work-dir.js +1 -1
  279. package/src/watchers/project-watcher.d.ts +4 -4
  280. package/src/watchers/project-watcher.js +35 -41
  281. package/src/watchers/project-watcher.test-helpers.d.ts +2 -2
  282. package/src/watchers/project-watcher.test-helpers.js +5 -5
  283. package/CHANGELOG.md +0 -31
  284. package/src/adapters/abstract/application-adapter.ts +0 -337
  285. package/src/adapters/abstract/router-adapter.ts +0 -30
  286. package/src/adapters/abstract/server-adapter.ts +0 -79
  287. package/src/adapters/bun/client-bridge.ts +0 -62
  288. package/src/adapters/bun/create-app.ts +0 -189
  289. package/src/adapters/bun/hmr-manager.ts +0 -409
  290. package/src/adapters/bun/index.ts +0 -2
  291. package/src/adapters/bun/server-adapter.ts +0 -499
  292. package/src/adapters/bun/server-lifecycle.d.ts +0 -63
  293. package/src/adapters/bun/server-lifecycle.js +0 -92
  294. package/src/adapters/bun/server-lifecycle.ts +0 -124
  295. package/src/adapters/index.ts +0 -6
  296. package/src/adapters/node/bootstrap-dependency-resolver.d.ts +0 -44
  297. package/src/adapters/node/bootstrap-dependency-resolver.js +0 -172
  298. package/src/adapters/node/bootstrap-dependency-resolver.ts +0 -301
  299. package/src/adapters/node/create-app.ts +0 -179
  300. package/src/adapters/node/index.d.ts +0 -6
  301. package/src/adapters/node/index.js +0 -11
  302. package/src/adapters/node/index.ts +0 -16
  303. package/src/adapters/node/node-client-bridge.ts +0 -79
  304. package/src/adapters/node/node-hmr-manager.ts +0 -381
  305. package/src/adapters/node/runtime-adapter.d.ts +0 -46
  306. package/src/adapters/node/runtime-adapter.js +0 -306
  307. package/src/adapters/node/runtime-adapter.ts +0 -439
  308. package/src/adapters/node/server-adapter.ts +0 -488
  309. package/src/adapters/node/static-content-server.ts +0 -239
  310. package/src/adapters/node/write-runtime-manifest.d.ts +0 -26
  311. package/src/adapters/node/write-runtime-manifest.js +0 -12
  312. package/src/adapters/node/write-runtime-manifest.ts +0 -38
  313. package/src/adapters/shared/api-response.ts +0 -104
  314. package/src/adapters/shared/application-adapter.ts +0 -199
  315. package/src/adapters/shared/define-api-handler.ts +0 -66
  316. package/src/adapters/shared/explicit-static-route-matcher.ts +0 -140
  317. package/src/adapters/shared/file-route-middleware-pipeline.ts +0 -127
  318. package/src/adapters/shared/fs-server-response-factory.ts +0 -118
  319. package/src/adapters/shared/fs-server-response-matcher.ts +0 -205
  320. package/src/adapters/shared/hmr-entrypoint-registrar.ts +0 -149
  321. package/src/adapters/shared/hmr-html-response.ts +0 -52
  322. package/src/adapters/shared/render-context.ts +0 -120
  323. package/src/adapters/shared/runtime-bootstrap.d.ts +0 -38
  324. package/src/adapters/shared/runtime-bootstrap.js +0 -43
  325. package/src/adapters/shared/runtime-bootstrap.ts +0 -79
  326. package/src/adapters/shared/server-adapter.ts +0 -489
  327. package/src/adapters/shared/server-route-handler.ts +0 -153
  328. package/src/adapters/shared/server-static-builder.ts +0 -166
  329. package/src/build/build-adapter.ts +0 -361
  330. package/src/build/build-manifest.ts +0 -54
  331. package/src/build/build-types.ts +0 -83
  332. package/src/build/dev-build-coordinator.d.ts +0 -74
  333. package/src/build/dev-build-coordinator.js +0 -161
  334. package/src/build/dev-build-coordinator.ts +0 -221
  335. package/src/build/esbuild-build-adapter.d.ts +0 -72
  336. package/src/build/esbuild-build-adapter.js +0 -422
  337. package/src/build/esbuild-build-adapter.ts +0 -559
  338. package/src/build/runtime-build-executor.ts +0 -34
  339. package/src/build/runtime-specifier-alias-plugin.d.ts +0 -15
  340. package/src/build/runtime-specifier-alias-plugin.js +0 -31
  341. package/src/build/runtime-specifier-alias-plugin.ts +0 -58
  342. package/src/config/config-builder.ts +0 -706
  343. package/src/constants.ts +0 -54
  344. package/src/create-app.ts +0 -87
  345. package/src/dev/sc-server.ts +0 -143
  346. package/src/eco/component-render-context.d.ts +0 -105
  347. package/src/eco/component-render-context.js +0 -87
  348. package/src/eco/component-render-context.ts +0 -224
  349. package/src/eco/eco.ts +0 -242
  350. package/src/eco/eco.types.ts +0 -221
  351. package/src/eco/eco.utils.ts +0 -89
  352. package/src/eco/global-injector-map.ts +0 -112
  353. package/src/eco/lazy-injector-map.ts +0 -120
  354. package/src/eco/module-dependencies.ts +0 -75
  355. package/src/errors/http-error.ts +0 -72
  356. package/src/errors/index.ts +0 -2
  357. package/src/errors/locals-access-error.ts +0 -7
  358. package/src/global/app-logger.ts +0 -4
  359. package/src/hmr/client/hmr-runtime.ts +0 -152
  360. package/src/hmr/hmr-strategy.ts +0 -172
  361. package/src/hmr/hmr.postcss.test.e2e.ts +0 -41
  362. package/src/hmr/hmr.test.e2e.ts +0 -66
  363. package/src/hmr/strategies/default-hmr-strategy.ts +0 -60
  364. package/src/hmr/strategies/js-hmr-strategy.ts +0 -320
  365. package/src/index.browser.ts +0 -3
  366. package/src/index.ts +0 -5
  367. package/src/integrations/ghtml/ghtml-renderer.ts +0 -96
  368. package/src/integrations/ghtml/ghtml.plugin.ts +0 -32
  369. package/src/internal-types.ts +0 -232
  370. package/src/plugins/alias-resolver-plugin.ts +0 -63
  371. package/src/plugins/eco-component-meta-plugin.ts +0 -481
  372. package/src/plugins/integration-plugin.ts +0 -226
  373. package/src/plugins/processor.ts +0 -240
  374. package/src/plugins/runtime-capability.ts +0 -14
  375. package/src/public-types.ts +0 -1317
  376. package/src/route-renderer/component-graph/component-graph-executor.d.ts +0 -32
  377. package/src/route-renderer/component-graph/component-graph-executor.js +0 -31
  378. package/src/route-renderer/component-graph/component-graph-executor.ts +0 -84
  379. package/src/route-renderer/component-graph/component-graph.d.ts +0 -42
  380. package/src/route-renderer/component-graph/component-graph.js +0 -72
  381. package/src/route-renderer/component-graph/component-graph.ts +0 -159
  382. package/src/route-renderer/component-graph/component-marker.d.ts +0 -52
  383. package/src/route-renderer/component-graph/component-marker.js +0 -46
  384. package/src/route-renderer/component-graph/component-marker.ts +0 -117
  385. package/src/route-renderer/component-graph/component-reference.d.ts +0 -10
  386. package/src/route-renderer/component-graph/component-reference.js +0 -19
  387. package/src/route-renderer/component-graph/component-reference.ts +0 -29
  388. package/src/route-renderer/component-graph/marker-graph-resolver.d.ts +0 -77
  389. package/src/route-renderer/component-graph/marker-graph-resolver.js +0 -95
  390. package/src/route-renderer/component-graph/marker-graph-resolver.ts +0 -155
  391. package/src/route-renderer/orchestration/integration-renderer.ts +0 -790
  392. package/src/route-renderer/orchestration/render-execution.service.d.ts +0 -103
  393. package/src/route-renderer/orchestration/render-execution.service.js +0 -121
  394. package/src/route-renderer/orchestration/render-execution.service.ts +0 -230
  395. package/src/route-renderer/orchestration/render-preparation.service.d.ts +0 -121
  396. package/src/route-renderer/orchestration/render-preparation.service.js +0 -332
  397. package/src/route-renderer/orchestration/render-preparation.service.ts +0 -476
  398. package/src/route-renderer/page-loading/dependency-resolver.ts +0 -612
  399. package/src/route-renderer/page-loading/page-module-loader.ts +0 -181
  400. package/src/route-renderer/route-renderer.ts +0 -115
  401. package/src/router/client/link-intent.test.browser.ts +0 -51
  402. package/src/router/client/link-intent.ts +0 -92
  403. package/src/router/client/navigation-coordinator.ts +0 -433
  404. package/src/router/server/fs-router-scanner.d.ts +0 -41
  405. package/src/router/server/fs-router-scanner.js +0 -156
  406. package/src/router/server/fs-router-scanner.ts +0 -219
  407. package/src/router/server/fs-router.d.ts +0 -26
  408. package/src/router/server/fs-router.js +0 -100
  409. package/src/router/server/fs-router.ts +0 -122
  410. package/src/services/assets/asset-processing-service/asset-processing.service.ts +0 -401
  411. package/src/services/assets/asset-processing-service/asset.factory.ts +0 -105
  412. package/src/services/assets/asset-processing-service/assets.types.ts +0 -113
  413. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.ts +0 -95
  414. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.ts +0 -78
  415. package/src/services/assets/asset-processing-service/index.ts +0 -5
  416. package/src/services/assets/asset-processing-service/processor.interface.ts +0 -27
  417. package/src/services/assets/asset-processing-service/processor.registry.ts +0 -18
  418. package/src/services/assets/asset-processing-service/processors/base/base-processor.ts +0 -82
  419. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.ts +0 -95
  420. package/src/services/assets/asset-processing-service/processors/index.ts +0 -5
  421. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.ts +0 -66
  422. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.ts +0 -88
  423. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.ts +0 -85
  424. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.ts +0 -27
  425. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.ts +0 -80
  426. package/src/services/assets/browser-bundle.service.ts +0 -53
  427. package/src/services/cache/cache.types.ts +0 -126
  428. package/src/services/cache/index.ts +0 -18
  429. package/src/services/cache/memory-cache-store.ts +0 -130
  430. package/src/services/cache/page-cache-service.ts +0 -202
  431. package/src/services/cache/page-request-cache-coordinator.service.ts +0 -131
  432. package/src/services/html/html-rewriter-provider.service.ts +0 -103
  433. package/src/services/html/html-transformer.service.ts +0 -279
  434. package/src/services/invalidation/development-invalidation.service.ts +0 -261
  435. package/src/services/module-loading/app-server-module-transpiler.service.ts +0 -52
  436. package/src/services/module-loading/page-module-import.service.ts +0 -200
  437. package/src/services/module-loading/server-loader.service.d.ts +0 -96
  438. package/src/services/module-loading/server-loader.service.js +0 -32
  439. package/src/services/module-loading/server-loader.service.ts +0 -130
  440. package/src/services/module-loading/server-module-transpiler.service.ts +0 -105
  441. package/src/services/runtime-manifest/node-runtime-manifest.service.d.ts +0 -35
  442. package/src/services/runtime-manifest/node-runtime-manifest.service.js +0 -60
  443. package/src/services/runtime-manifest/node-runtime-manifest.service.ts +0 -101
  444. package/src/services/runtime-state/dev-graph.service.ts +0 -217
  445. package/src/services/runtime-state/entrypoint-dependency-graph.service.ts +0 -136
  446. package/src/services/runtime-state/runtime-specifier-registry.service.d.ts +0 -69
  447. package/src/services/runtime-state/runtime-specifier-registry.service.js +0 -37
  448. package/src/services/runtime-state/runtime-specifier-registry.service.ts +0 -96
  449. package/src/services/runtime-state/server-invalidation-state.service.ts +0 -68
  450. package/src/services/validation/schema-validation-service.ts +0 -204
  451. package/src/services/validation/standard-schema.types.ts +0 -68
  452. package/src/static-site-generator/static-site-generator.ts +0 -462
  453. package/src/utils/css.d.ts +0 -1
  454. package/src/utils/css.js +0 -7
  455. package/src/utils/css.ts +0 -5
  456. package/src/utils/deep-merge.ts +0 -47
  457. package/src/utils/hash.ts +0 -5
  458. package/src/utils/html.ts +0 -1
  459. package/src/utils/invariant.ts +0 -15
  460. package/src/utils/locals-utils.ts +0 -37
  461. package/src/utils/parse-cli-args.ts +0 -83
  462. package/src/utils/path-utils.module.ts +0 -14
  463. package/src/utils/resolve-work-dir.ts +0 -45
  464. package/src/utils/runtime.ts +0 -44
  465. package/src/utils/server-utils.module.ts +0 -67
  466. package/src/watchers/project-watcher.test-helpers.ts +0 -41
  467. package/src/watchers/project-watcher.ts +0 -363
  468. /package/src/{internal-types.js → adapters/shared/runtime-host.js} +0 -0
  469. /package/src/{public-types.js → adapters/shared/static-preview-host.js} +0 -0
  470. /package/src/{constants.d.ts → config/constants.d.ts} +0 -0
  471. /package/src/{constants.js → config/constants.js} +0 -0
@@ -1,157 +1,450 @@
1
+ /**
2
+ * Build pipeline contracts and app-owned adapter wiring.
3
+ *
4
+ * @remarks
5
+ * The build layer exposes three concentric shapes:
6
+ *
7
+ * - `BuildAdapter` — the low-level backend contract. Two implementations
8
+ * exist: a bundler-backed adapter (the real backend) and
9
+ * {@link ViteHostBuildAdapter} (a host-owned boundary marker that throws
10
+ * on direct use, for host runtimes that own their own build pipeline).
11
+ * - `BuildExecutor` — the runtime-facing facade stored on
12
+ * `appConfig.runtime.buildExecutor`. It is intentionally narrower than
13
+ * `BuildAdapter` so callers that only need to issue builds do not depend
14
+ * on `resolve` / `getTranspileOptions`.
15
+ * - App-owned helpers (`getAppBuildAdapter`, `getAppBuildExecutor`, and
16
+ * the `set*` counterparts) — the supported way for runtime code to read
17
+ * and mutate the active adapter per `EcoPagesAppConfig`.
18
+ */
1
19
  import type { EcoBuildPlugin } from './build-types.js';
2
20
  import { type AppBuildManifest } from './build-manifest.js';
3
- import type { EcoPagesAppConfig } from '../internal-types.js';
4
- import type { IHmrManager } from '../public-types.js';
5
- export { EsbuildBuildAdapter } from './esbuild-build-adapter.js';
21
+ import type { EcoPagesAppConfig } from '../types/internal-types.js';
22
+ import type { IHmrManager } from '../types/public-types.js';
23
+ /**
24
+ * Which backend owns the app's build pipeline.
25
+ *
26
+ * - `'rolldown'`: the default. Ecopages runs the build directly through
27
+ * its bundler-backed adapter.
28
+ * - `'rolldown-dev'`: uses Rolldown's DevEngine for cached incremental
29
+ * rebuilds. Ideal for HMR and watch mode where the same entrypoints
30
+ * are rebuilt repeatedly.
31
+ * - `'vite-host'`: a host runtime owns the build. {@link ViteHostBuildAdapter}
32
+ * is exposed as a boundary marker; any direct call into it throws.
33
+ */
34
+ export type BuildOwnership = 'vite-host' | 'rolldown' | 'rolldown-dev';
35
+ /**
36
+ * A single message emitted by the build backend.
37
+ *
38
+ * @remarks
39
+ * Today this only carries `message`. Severity and structured fields
40
+ * belong in a future schema bump; the current shape mirrors the
41
+ * bundler's log output 1:1.
42
+ */
6
43
  export interface BuildLog {
7
44
  message: string;
8
45
  }
46
+ /**
47
+ * A single artifact emitted by the build backend.
48
+ *
49
+ * @remarks
50
+ * `path` is the absolute on-disk path of the emitted file. For
51
+ * filename templates that include a content-hash token, the bundler
52
+ * returns the concrete resolved path (not the template), so callers
53
+ * can read the file directly.
54
+ */
9
55
  export interface BuildOutput {
10
56
  path: string;
11
57
  }
12
58
  /**
13
- * Dependency graph metadata produced by a build backend.
59
+ * Per-entrypoint dependency metadata surfaced alongside a build.
14
60
  *
15
61
  * @remarks
16
- * This structure is runtime-neutral at the type level, but current population
17
- * is Node/esbuild-only. Bun-backed builds may omit this metadata.
62
+ * Populated from the bundler's per-chunk module list and exposed as a
63
+ * normalized absolute-path map. Consumers (HMR invalidation, the build
64
+ * manifest) read this without needing to know which adapter produced
65
+ * it. The shape is preserved across adapters so historical callers
66
+ * continue to compile.
18
67
  */
19
68
  export interface BuildDependencyGraph {
20
69
  /**
21
- * Normalized absolute entrypoint path mapped to all normalized absolute
22
- * source inputs that contributed to that entrypoint output.
70
+ * Normalized absolute entrypoint path mapped to every normalized
71
+ * absolute source input that contributed to that entrypoint's
72
+ * output, including the entrypoint itself.
23
73
  */
24
74
  entrypoints: Record<string, string[]>;
25
75
  }
76
+ /**
77
+ * The full result of one `BuildAdapter.build` call.
78
+ *
79
+ * @remarks
80
+ * `success === false` means the build failed and `outputs` will be
81
+ * empty. Inspect `logs` for the error message; the original `Error` is
82
+ * already normalized into `BuildLog` shape.
83
+ */
26
84
  export interface BuildResult {
27
85
  success: boolean;
28
86
  logs: BuildLog[];
29
87
  outputs: BuildOutput[];
30
88
  /**
31
- * Optional build dependency metadata for selective invalidation.
32
- *
33
- * @remarks
34
- * This is currently filled by the Node/esbuild adapter. Other runtimes should
35
- * treat missing graph data as a valid state and fall back deterministically.
89
+ * Per-entrypoint dependency metadata, when the backend produced it.
90
+ * Some backends (notably the Vite-host boundary marker) leave this
91
+ * undefined; callers must treat that as a valid state and fall
92
+ * back deterministically.
36
93
  */
37
94
  dependencyGraph?: BuildDependencyGraph;
38
95
  }
96
+ /**
97
+ * Options accepted by every `BuildAdapter.build` call.
98
+ *
99
+ * @remarks
100
+ * Fields that the adapter can forward are honored; fields that cannot
101
+ * (currently `splitting`, `bundle`, and `outbase`) are accepted so
102
+ * call-sites compile, but the adapter ignores them. See each field's
103
+ * docstring for the current behavior.
104
+ */
39
105
  export interface BuildOptions {
40
- entrypoints: string[];
106
+ /**
107
+ * Absolute or context-root-relative source files that begin the build graph.
108
+ *
109
+ * Use a record (key → source path) when the caller needs to control chunk
110
+ * names. Keys become the `[name]` token in `naming`, which lets the caller
111
+ * embed path information that the bundler would otherwise strip.
112
+ */
113
+ entrypoints: string[] | Record<string, string>;
114
+ /** Output directory. Defaults to `dist/assets` when omitted. */
41
115
  outdir?: string;
116
+ /**
117
+ * Base directory for `[dir]` placeholders in `naming`. Currently
118
+ * the bundled adapter derives the base from `root` directly and
119
+ * ignores this field.
120
+ */
42
121
  outbase?: string;
122
+ /**
123
+ * Filename pattern for entrypoints. The bundled adapter honors
124
+ * `[name]`, `[hash]`, and `[ext]`. The `[dir]` token is stripped
125
+ * before forwarding to the bundler (rolldown does not implement it);
126
+ * callers that need directory structure preserved should use the
127
+ * record form of `entrypoints` so each key becomes its own chunk.
128
+ * When omitted, the bundler's default applies.
129
+ */
43
130
  naming?: string;
131
+ /**
132
+ * Package export conditions to honor during resolution
133
+ * (e.g. `['import', 'browser', 'default']`).
134
+ */
44
135
  conditions?: string[];
136
+ /**
137
+ * Global identifier replacements. Honored by the bundled adapter.
138
+ */
45
139
  define?: Record<string, string>;
140
+ /** Run the bundler's minifier. Off by default. */
46
141
  minify?: boolean;
142
+ /** Enable the bundler's tree-shaker. Defaults to `true`. */
47
143
  treeshaking?: boolean;
144
+ /**
145
+ * Output target family. Accepted values: `'browser'`, `'node'`,
146
+ * anything else falls through to a platform-neutral setup.
147
+ */
48
148
  target?: string;
149
+ /** Output module format. Accepted: `'esm'`, `'cjs'`, `'iife'`. */
49
150
  format?: string;
151
+ /**
152
+ * Source map mode. Accepted: `'none'`, `'inline'`, `'external'`,
153
+ * `'linked'`. Anything else maps to the bundler's default (linked).
154
+ */
50
155
  sourcemap?: string;
156
+ /**
157
+ * Historical code-splitting flag. Currently a no-op on the bundled
158
+ * adapter: the bundler splits by default and this flag is not
159
+ * forwarded. See the per-chunk naming convention in the adapter for
160
+ * the available control.
161
+ */
51
162
  splitting?: boolean;
163
+ /** Project root used to resolve relative paths and the tsconfig lookup. */
52
164
  root?: string;
165
+ /**
166
+ * Historical bundle flag. Currently a no-op on the bundled adapter:
167
+ * the bundler always bundles. Accepted so call-sites compile.
168
+ */
53
169
  bundle?: boolean;
170
+ /**
171
+ * Treat `node_modules` packages as external. Honored by the bundled
172
+ * adapter.
173
+ */
54
174
  externalPackages?: boolean;
175
+ /** Explicit list of module specifiers to leave as external imports. */
55
176
  external?: string[];
177
+ /**
178
+ * JSX runtime configuration. Mirrors the bundler's `jsx` option shape.
179
+ */
180
+ jsx?: {
181
+ development?: boolean;
182
+ factory?: string;
183
+ fragment?: string;
184
+ importSource?: string;
185
+ runtime?: 'classic' | 'automatic';
186
+ sideEffects?: boolean;
187
+ };
188
+ /**
189
+ * Runtime-agnostic `EcoBuildPlugin[]` to attach to this build. The
190
+ * bundled adapter translates the array via the rolldown plugin
191
+ * bridge.
192
+ */
56
193
  plugins?: EcoBuildPlugin[];
194
+ /**
195
+ * Escape hatch for backends that need to forward unknown options
196
+ * to their underlying driver. Consumers should prefer the typed
197
+ * fields above.
198
+ */
57
199
  [key: string]: unknown;
58
200
  }
201
+ /** Stable profile identifiers for `BuildAdapter.getTranspileOptions`. */
59
202
  export type BuildTranspileProfile = 'browser-script' | 'hmr-runtime' | 'hmr-entrypoint';
203
+ /**
204
+ * Resolved transpile settings for a given profile.
205
+ *
206
+ * @remarks
207
+ * The three fields map 1:1 to the trio the HMR and browser-script
208
+ * code paths look at: target platform, output format, and source-map
209
+ * mode. Today the bundled adapter returns identical defaults for all
210
+ * three profiles; the type is kept open so per-profile tuning can
211
+ * land without breaking callers.
212
+ */
60
213
  export interface BuildTranspileOptions {
61
214
  target: string;
62
215
  format: string;
63
216
  sourcemap: string;
64
217
  }
218
+ /**
219
+ * Low-level build backend contract.
220
+ *
221
+ * @remarks
222
+ * One instance is owned by each `EcoPagesAppConfig` (see
223
+ * {@link getAppBuildAdapter}). Two implementations exist: the bundled
224
+ * adapter does the work; {@link ViteHostBuildAdapter} is a host-owned
225
+ * boundary marker that throws on direct use.
226
+ */
65
227
  export interface BuildAdapter {
228
+ /** Which backend owns this adapter. Used for routing decisions in app helpers. */
229
+ readonly ownership?: BuildOwnership;
66
230
  /**
67
- * Executes one concrete backend build.
231
+ * Run one build.
68
232
  *
69
233
  * @remarks
70
- * `BuildAdapter` is the low-level backend contract. The default adapter is
71
- * `EsbuildBuildAdapter`, but alternate adapters may satisfy the same shape.
234
+ * Implementations are expected to be safe to call from any caller.
235
+ * Concurrent calls are not guaranteed to be serialized by the
236
+ * adapter itself; the dev-watch pipeline wraps the adapter in
237
+ * {@link SerializedBuildExecutor} when it needs FIFO ordering.
238
+ *
239
+ * Returns a `BuildResult` with `success: false` on failure; the
240
+ * thrown-error variant (`buildOrThrow`) is reserved for callers
241
+ * that need the original `Error` object.
72
242
  */
73
243
  build(options: BuildOptions): Promise<BuildResult>;
244
+ /**
245
+ * Resolve a module specifier against the project's `rootDir`.
246
+ *
247
+ * @remarks
248
+ * Used by the source-loading services when they need to know the
249
+ * absolute path of a specifier without performing a full build.
250
+ */
74
251
  resolve(importPath: string, rootDir: string): string;
252
+ /**
253
+ * Resolve transpile settings for a known profile.
254
+ *
255
+ * @remarks
256
+ * Today the bundled adapter returns identical defaults for all
257
+ * profiles. The profile argument is kept so per-profile tuning
258
+ * can land without breaking callers.
259
+ */
75
260
  getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
76
261
  }
77
262
  /**
78
- * Runtime-owned facade for issuing builds.
263
+ * Runtime-facing facade for issuing builds.
79
264
  *
80
265
  * @remarks
81
- * This is intentionally narrower than `BuildAdapter`. A build executor answers
82
- * only the question "how should this app execute a build right now?".
266
+ * Strictly narrower than {@link BuildAdapter}: it only exposes `build`.
267
+ * This is the shape stored on `appConfig.runtime.buildExecutor` and
268
+ * passed across the dev-watch and server-module-loading seams, so
269
+ * callers cannot accidentally depend on `resolve` or
270
+ * `getTranspileOptions`.
83
271
  *
84
- * In production and non-watch flows the executor is usually the adapter itself,
85
- * which today means `EsbuildBuildAdapter`. In development watch flows the
86
- * executor is typically `DevBuildCoordinator`, which wraps the shared esbuild
87
- * adapter to serialize callers and recover from known worker faults.
272
+ * In production and non-watch flows the executor is the adapter
273
+ * itself. In development watch flows the executor is a
274
+ * {@link SerializedBuildExecutor} wrapping the adapter so dev-watch
275
+ * pipelines are FIFO-serialized.
88
276
  */
89
277
  export interface BuildExecutor {
90
278
  build(options: BuildOptions): Promise<BuildResult>;
91
279
  }
92
- export declare function createBuildAdapter(): BuildAdapter;
93
280
  /**
94
- * @deprecated Use EsbuildBuildAdapter instead. Bun native build is missing some dependency graph features.
281
+ * Wraps a {@link BuildExecutor} so each call to `build` receives the
282
+ * union of the caller's `options.plugins` and the plugins sourced
283
+ * from `getPlugins()`.
284
+ *
285
+ * @remarks
286
+ * The single point of plugin injection in the runtime path: the
287
+ * `ConfigBuilder` stores a raw adapter on
288
+ * `appConfig.runtime.buildAdapter` and the
289
+ * `installAppRuntimeBuildExecutor` step wraps that adapter with this
290
+ * helper. Callers that issue builds against
291
+ * `appConfig.runtime.buildExecutor` get the merged plugin set without
292
+ * further ceremony.
95
293
  */
96
- export declare class BunBuildAdapter implements BuildAdapter {
97
- build(options: BuildOptions): Promise<BuildResult>;
98
- resolve(importPath: string, rootDir: string): string;
99
- getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
294
+ export declare function withBuildExecutorPlugins(executor: BuildExecutor, getPlugins: () => EcoBuildPlugin[]): BuildExecutor;
295
+ /**
296
+ * Boundary-marker adapter for Vite-host ownership.
297
+ *
298
+ * @remarks
299
+ * This is not a real backend. It exists so `appConfig.runtime.buildAdapter`
300
+ * can carry the `'vite-host'` ownership without falling back to a
301
+ * framework-owned bundler path. Every method throws a
302
+ * {@link createHostOwnedBuildError} so misrouted calls fail loudly
303
+ * with a clear message instead of silently executing under a
304
+ * different backend.
305
+ *
306
+ * The class stays in the public surface for host runtimes that own
307
+ * their build pipeline (e.g. Nitro) and for app code that wants to
308
+ * opt into host-owned ownership before its host wires up the build.
309
+ */
310
+ export declare class ViteHostBuildAdapter implements BuildAdapter {
311
+ readonly ownership: "vite-host";
312
+ build(_options: BuildOptions): Promise<BuildResult>;
313
+ resolve(_importPath: string, _rootDir: string): string;
314
+ getTranspileOptions(_profile: BuildTranspileProfile): BuildTranspileOptions;
100
315
  }
316
+ /**
317
+ * Constructs a {@link ViteHostBuildAdapter}. Use only in code paths
318
+ * that explicitly opt into the host-owned boundary.
319
+ */
320
+ export declare function createViteHostBuildAdapter(): BuildAdapter;
321
+ /**
322
+ * Constructs a build adapter for the given ownership.
323
+ *
324
+ * @param options - When `options.ownership` is omitted, the default is
325
+ * `'rolldown'`. The Vite-host path is opt-in.
326
+ */
327
+ export declare function createBuildAdapter(options?: {
328
+ ownership?: BuildOwnership;
329
+ }): BuildAdapter;
330
+ /** The shared default-bundler backend instance. Use {@link getAppBuildAdapter} in app-aware code. */
331
+ export declare const defaultRolldownBuildAdapter: BuildAdapter;
332
+ /** The shared Vite-host boundary instance. Use {@link getAppBuildAdapter} in app-aware code. */
333
+ export declare const defaultViteHostBuildAdapter: BuildAdapter;
334
+ /**
335
+ * Global default build adapter.
336
+ *
337
+ * @remarks
338
+ * Resolves to the bundled default-bundler adapter. New app-aware
339
+ * code should prefer {@link getAppBuildAdapter}.
340
+ */
101
341
  export declare const defaultBuildAdapter: BuildAdapter;
342
+ /**
343
+ * Resolves the default build adapter for an ownership value.
344
+ *
345
+ * @param ownership - Defaults to `'rolldown'`. Returns the
346
+ * {@link ViteHostBuildAdapter} only when the caller explicitly asks
347
+ * for `'vite-host'`.
348
+ */
349
+ export declare function getDefaultBuildAdapter(ownership?: BuildOwnership): BuildAdapter;
350
+ /**
351
+ * Reads the {@link BuildOwnership} declared on a {@link BuildAdapter}.
352
+ *
353
+ * @param buildAdapter - When `undefined`, defaults to `'rolldown'`.
354
+ */
355
+ export declare function getBuildAdapterOwnership(buildAdapter: BuildAdapter | undefined): BuildOwnership;
356
+ /**
357
+ * Resolves the build ownership of an app config.
358
+ *
359
+ * @remarks
360
+ * Resolution order: `appConfig.runtime.buildOwnership` (explicit), then
361
+ * the ownership declared on `appConfig.runtime.buildAdapter`, then the
362
+ * default `'rolldown'`.
363
+ */
364
+ export declare function getAppBuildOwnership(appConfig: EcoPagesAppConfig): BuildOwnership;
365
+ /**
366
+ * Sets the explicit build ownership on an app config.
367
+ *
368
+ * @remarks
369
+ * The `ConfigBuilder` uses this when the caller calls
370
+ * `setBuildOwnership`. App code that needs a different ownership
371
+ * should call this directly with a new value; passing the same
372
+ * value is a no-op.
373
+ */
374
+ export declare function setAppBuildOwnership(appConfig: EcoPagesAppConfig, buildOwnership: BuildOwnership): void;
102
375
  /**
103
376
  * Returns the adapter owned by an app/runtime instance.
104
377
  *
105
378
  * @remarks
106
- * The config builder installs a dedicated adapter per app. The shared default
107
- * adapter remains only as a compatibility fallback for older tests and helpers
108
- * that do not yet thread app runtime state explicitly.
379
+ * Falls back through `appConfig.runtime.buildAdapter`
380
+ * {@link getDefaultBuildAdapter} on the resolved ownership. Throws
381
+ * never; a missing adapter resolves to the global default.
109
382
  */
110
383
  export declare function getAppBuildAdapter(appConfig: EcoPagesAppConfig): BuildAdapter;
111
384
  /**
112
- * Installs the adapter that should serve future builds for one app instance.
385
+ * Installs the adapter that should serve future builds for one app
386
+ * instance, and aligns the ownership field to the new adapter's
387
+ * declared ownership.
113
388
  */
114
389
  export declare function setAppBuildAdapter(appConfig: EcoPagesAppConfig, buildAdapter: BuildAdapter): void;
115
390
  /**
116
391
  * Returns the build manifest owned by an app/runtime instance.
392
+ *
393
+ * @remarks
394
+ * Falls back to a fresh manifest seeded from the config's loaders when
395
+ * the app config has no manifest yet. This is the supported way to
396
+ * read the manifest across the source-loading and asset-processing
397
+ * services.
117
398
  */
118
399
  export declare function getAppBuildManifest(appConfig: EcoPagesAppConfig): AppBuildManifest;
119
- /**
120
- * Installs the build manifest that should be visible to one app instance.
121
- */
400
+ /** Installs the build manifest that should be visible to one app instance. */
122
401
  export declare function setAppBuildManifest(appConfig: EcoPagesAppConfig, buildManifest: AppBuildManifest): void;
123
402
  /**
124
- * Rebuilds an app-owned manifest from config-owned loaders plus explicit
125
- * runtime/browser contribution input.
403
+ * Builds a fresh app manifest from the config's loaders plus optional
404
+ * caller-supplied runtime/browser contributions.
126
405
  *
127
406
  * @remarks
128
- * This keeps loader ownership with config finalization while still letting a
129
- * caller supply the non-loader plugin buckets that were discovered elsewhere.
407
+ * Loader plugins are always taken from the config; runtime and
408
+ * browser-bundle plugins are passed through from the caller when
409
+ * supplied, otherwise left empty for later population by
410
+ * {@link collectConfiguredAppBuildManifestContributions}.
130
411
  */
131
412
  export declare function createConfiguredAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): AppBuildManifest;
132
413
  /**
133
- * Replaces the app-owned manifest using config-owned loaders and explicit
134
- * contribution input.
414
+ * Replaces the app-owned manifest using config-owned loaders and the
415
+ * caller-supplied contribution input.
135
416
  */
136
417
  export declare function updateAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): void;
137
418
  /**
138
- * Collects the build-facing processor and integration contributions that should
139
- * be sealed into the app manifest during config finalization.
419
+ * Collects the build-facing processor and integration contributions
420
+ * that should be sealed into the app manifest during config
421
+ * finalization.
140
422
  *
141
423
  * @remarks
142
- * This runs `prepareBuildContributions()` only. Runtime-only side effects such
143
- * as HMR registration, cache prewarming, and runtime-origin wiring belong to
144
- * the startup path and must not be triggered here.
424
+ * Runs `prepareBuildContributions()` on every processor and
425
+ * integration. Runtime-only side effects (HMR registration, cache
426
+ * prewarming, runtime-origin wiring) belong to the startup path and
427
+ * must not be triggered here; use {@link setupAppRuntimePlugins} for
428
+ * those.
429
+ *
430
+ * @returns The new manifest's runtime / browser / browser-runtime-manifest
431
+ * contribution buckets. Caller seals them into a manifest via
432
+ * {@link updateAppBuildManifest}.
145
433
  */
146
- export declare function collectConfiguredAppBuildManifestContributions(appConfig: EcoPagesAppConfig): Promise<Pick<AppBuildManifest, 'runtimePlugins' | 'browserBundlePlugins'>>;
434
+ export declare function collectConfiguredAppBuildManifestContributions(appConfig: EcoPagesAppConfig): Promise<Pick<AppBuildManifest, 'runtimePlugins' | 'browserBundlePlugins' | 'browserRuntimeManifest'>>;
147
435
  /**
148
- * Runs runtime-only processor and integration setup against an already sealed
149
- * app manifest.
436
+ * Runs runtime-only processor and integration setup against an already
437
+ * sealed app manifest.
150
438
  *
151
439
  * @remarks
152
- * Startup paths call this after config build has finalized manifest
153
- * contributions. The manifest is reused as-is; this helper only performs the
154
- * runtime side effects that still need live startup context.
440
+ * Startup paths call this after `ConfigBuilder.build` has finalized
441
+ * the manifest. The manifest is reused as-is; this helper only performs
442
+ * the runtime side effects that need live startup context (cache
443
+ * prewarming, runtime-origin wiring, HMR manager attachment).
444
+ *
445
+ * Loaders, processors, and integrations are visited in that order;
446
+ * each one's plugins are forwarded to the optional `onRuntimePlugin`
447
+ * callback so callers can attach to every plugin discovered.
155
448
  */
156
449
  export declare function setupAppRuntimePlugins(options: {
157
450
  appConfig: EcoPagesAppConfig;
@@ -159,28 +452,56 @@ export declare function setupAppRuntimePlugins(options: {
159
452
  hmrManager?: IHmrManager;
160
453
  onRuntimePlugin?: (plugin: EcoBuildPlugin) => void;
161
454
  }): Promise<void>;
455
+ /**
456
+ * Returns the server-bundle plugin list for one app/runtime instance.
457
+ *
458
+ * @remarks
459
+ * Reads from the app's sealed build manifest; the manifest itself is
460
+ * the source of truth for which plugins participate in the server
461
+ * bundle.
462
+ */
162
463
  export declare function getAppServerBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
464
+ /**
465
+ * Returns the browser-bundle plugin list for one app/runtime instance.
466
+ *
467
+ * @remarks
468
+ * Reads from the app's sealed build manifest. The browser-bundle
469
+ * manifest is the source of truth for which plugins participate in the
470
+ * browser bundle.
471
+ */
163
472
  export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
164
473
  /**
165
474
  * Returns the executor owned by an app/runtime instance.
166
475
  *
167
476
  * @remarks
168
- * The config builder seeds this with the shared default adapter. Runtime
169
- * adapters may replace it with a coordinator that still delegates to the same
170
- * backend while adding development policy.
477
+ * Falls back to {@link getAppBuildAdapter} when no executor is set
478
+ * on the runtime yet. The dev-watch pipeline replaces this value with
479
+ * a {@link SerializedBuildExecutor} via
480
+ * {@link installAppRuntimeBuildExecutor}.
171
481
  */
172
482
  export declare function getAppBuildExecutor(appConfig: EcoPagesAppConfig): BuildExecutor;
173
- /**
174
- * Installs the executor that should serve future builds for one app instance.
175
- */
483
+ /** Installs the executor that should serve future builds for one app instance. */
176
484
  export declare function setAppBuildExecutor(appConfig: EcoPagesAppConfig, buildExecutor: BuildExecutor): void;
177
485
  /**
178
486
  * Runs a build through the active pipeline.
179
487
  *
180
488
  * @remarks
181
- * Callers can pass an explicit executor when builds should be routed through an
182
- * app-owned development coordinator. Without one, the shared default adapter is
183
- * used directly.
489
+ * `executor` defaults to the default-bundler adapter for non-app-aware
490
+ * callsites. App-aware code should pass
491
+ * `getAppBuildExecutor(appConfig)` (or read it directly) to honor the
492
+ * per-app pipeline.
184
493
  */
185
494
  export declare function build(options: BuildOptions, executor?: BuildExecutor): Promise<BuildResult>;
495
+ /**
496
+ * Default transpile-options helper for callsites without app runtime
497
+ * context.
498
+ *
499
+ * @remarks
500
+ * New app-aware code should prefer {@link getAppTranspileOptions}.
501
+ */
186
502
  export declare function getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
503
+ /**
504
+ * Resolves transpile options for one app/runtime instance by asking
505
+ * the app's adapter.
506
+ */
507
+ export declare function getAppTranspileOptions(appConfig: EcoPagesAppConfig, profile: BuildTranspileProfile): BuildTranspileOptions;