@ecopages/core 0.2.1 → 0.3.1

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 (838) hide show
  1. package/README.md +201 -72
  2. package/package.json +83 -254
  3. package/src/adapters/create-app.d.ts +56 -19
  4. package/src/adapters/create-app.js +48 -63
  5. package/src/adapters/node/create-app.d.ts +218 -15
  6. package/src/adapters/node/create-app.js +593 -146
  7. package/src/adapters/node/dev-session.d.ts +35 -0
  8. package/src/adapters/node/dev-session.js +116 -0
  9. package/src/adapters/node/http-request-bridge.d.ts +61 -0
  10. package/src/adapters/node/http-request-bridge.js +207 -0
  11. package/src/adapters/node/node-client-bridge.d.ts +2 -1
  12. package/src/adapters/node/node-client-bridge.js +62 -61
  13. package/src/adapters/node/runtime-host.d.ts +74 -0
  14. package/src/adapters/node/runtime-host.js +123 -0
  15. package/src/adapters/node/server-adapter.d.ts +95 -90
  16. package/src/adapters/node/server-adapter.js +373 -342
  17. package/src/adapters/shared/hmr/dev-transform-entrypoint-registry.d.ts +16 -0
  18. package/src/adapters/shared/hmr/dev-transform-entrypoint-registry.js +32 -0
  19. package/src/adapters/shared/hmr/hmr-html-response.d.ts +14 -0
  20. package/src/adapters/shared/hmr/hmr-html-response.js +25 -0
  21. package/src/adapters/shared/hmr/hmr-manager.d.ts +120 -0
  22. package/src/adapters/shared/hmr/hmr-manager.js +448 -0
  23. package/src/adapters/shared/http/api-request-pipeline.d.ts +41 -0
  24. package/src/adapters/shared/http/api-request-pipeline.js +204 -0
  25. package/src/adapters/shared/{api-response.d.ts → http/api-response.d.ts} +3 -2
  26. package/src/adapters/shared/http/api-response.js +79 -0
  27. package/src/adapters/shared/http/create-body-response.d.ts +12 -0
  28. package/src/adapters/shared/http/create-body-response.js +26 -0
  29. package/src/adapters/shared/http/define-api-handler.d.ts +48 -0
  30. package/src/adapters/shared/http/define-api-handler.js +49 -0
  31. package/src/adapters/shared/http/dist-file-handler.d.ts +16 -0
  32. package/src/adapters/shared/http/dist-file-handler.js +172 -0
  33. package/src/adapters/shared/{explicit-static-route-matcher.d.ts → http/explicit-static-route-matcher.d.ts} +9 -11
  34. package/src/adapters/shared/http/explicit-static-route-matcher.js +64 -0
  35. package/src/adapters/shared/{file-route-middleware-pipeline.d.ts → http/file-route-middleware-pipeline.d.ts} +8 -11
  36. package/src/adapters/shared/http/file-route-middleware-pipeline.js +84 -0
  37. package/src/adapters/shared/http/fs-server-response-factory.d.ts +9 -0
  38. package/src/adapters/shared/http/fs-server-response-factory.js +23 -0
  39. package/src/adapters/shared/http/fs-server-response-matcher.d.ts +98 -0
  40. package/src/adapters/shared/http/fs-server-response-matcher.js +245 -0
  41. package/src/adapters/shared/http/run-middleware-chain.d.ts +5 -0
  42. package/src/adapters/shared/http/run-middleware-chain.js +17 -0
  43. package/src/adapters/shared/runtime/bind-runtime-server.d.ts +15 -0
  44. package/src/adapters/shared/runtime/bind-runtime-server.js +44 -0
  45. package/src/adapters/shared/runtime/copy-runtime-public-dir.d.ts +8 -0
  46. package/src/adapters/shared/runtime/copy-runtime-public-dir.js +71 -0
  47. package/src/adapters/shared/runtime/dev-static-route-prewarm.d.ts +13 -0
  48. package/src/adapters/shared/runtime/dev-static-route-prewarm.js +56 -0
  49. package/src/adapters/shared/runtime/port-manager-default-prompt.d.ts +6 -0
  50. package/src/adapters/shared/runtime/port-manager-default-prompt.js +41 -0
  51. package/src/adapters/shared/runtime/port-manager.d.ts +107 -0
  52. package/src/adapters/shared/runtime/port-manager.js +170 -0
  53. package/src/adapters/shared/{render-context.d.ts → runtime/render-context.d.ts} +5 -4
  54. package/src/adapters/shared/runtime/render-context.js +94 -0
  55. package/src/adapters/shared/runtime/runtime-app-bootstrap.d.ts +17 -0
  56. package/src/adapters/shared/runtime/runtime-app-bootstrap.js +34 -0
  57. package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +42 -0
  58. package/src/adapters/shared/runtime/runtime-server-lifecycle.js +90 -0
  59. package/src/adapters/shared/runtime/server-request-pipeline.d.ts +98 -0
  60. package/src/adapters/shared/runtime/server-request-pipeline.js +272 -0
  61. package/src/adapters/shared/{server-route-handler.d.ts → runtime/server-route-handler.d.ts} +10 -39
  62. package/src/adapters/shared/runtime/server-route-handler.js +95 -0
  63. package/src/adapters/shared/runtime/server-static-builder.d.ts +107 -0
  64. package/src/adapters/shared/runtime/server-static-builder.js +172 -0
  65. package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +20 -0
  66. package/src/adapters/shared/ws/node-http-websocket-upgrades.js +123 -0
  67. package/src/adapters/shared/ws/websocket-lifecycle.d.ts +23 -0
  68. package/src/adapters/shared/ws/websocket-lifecycle.js +61 -0
  69. package/src/adapters/shared/ws/ws-pattern-matcher.d.ts +7 -0
  70. package/src/adapters/shared/ws/ws-pattern-matcher.js +20 -0
  71. package/src/assets/app-browser-client-build.d.ts +18 -0
  72. package/src/assets/app-browser-client-build.js +476 -0
  73. package/src/assets/app-browser-client-manifest.d.ts +69 -0
  74. package/src/assets/app-browser-client-manifest.js +332 -0
  75. package/src/assets/asset-processing-service/app-browser-client-bundle.d.ts +35 -0
  76. package/src/assets/asset-processing-service/app-browser-client-bundle.js +41 -0
  77. package/src/assets/asset-processing-service/asset-dependency-keys.d.ts +16 -0
  78. package/src/assets/asset-processing-service/asset-dependency-keys.js +80 -0
  79. package/src/assets/asset-processing-service/asset-package-role.d.ts +2 -0
  80. package/src/assets/asset-processing-service/asset-package-role.js +3 -0
  81. package/src/assets/asset-processing-service/asset-processing-integration.d.ts +7 -0
  82. package/src/assets/asset-processing-service/asset-processing-integration.js +6 -0
  83. package/src/assets/asset-processing-service/asset-processing.service.d.ts +156 -0
  84. package/src/assets/asset-processing-service/asset-processing.service.js +555 -0
  85. package/src/assets/asset-processing-service/asset.factory.js +79 -0
  86. package/src/assets/asset-processing-service/assets.types.d.ts +1 -0
  87. package/src/{services/assets → assets}/asset-processing-service/browser-runtime-asset.factory.d.ts +4 -1
  88. package/src/assets/asset-processing-service/browser-runtime-asset.factory.js +61 -0
  89. package/src/assets/asset-processing-service/browser-runtime-entry-resolution.d.ts +79 -0
  90. package/src/assets/asset-processing-service/browser-runtime-entry-resolution.js +200 -0
  91. package/src/{services/assets → assets}/asset-processing-service/browser-runtime-entry.factory.d.ts +6 -2
  92. package/src/assets/asset-processing-service/browser-runtime-entry.factory.js +67 -0
  93. package/src/assets/asset-processing-service/finalize-processed-asset.d.ts +3 -0
  94. package/src/assets/asset-processing-service/finalize-processed-asset.js +5 -0
  95. package/src/assets/asset-processing-service/grouped-content-bundles.d.ts +11 -0
  96. package/src/assets/asset-processing-service/grouped-content-bundles.js +39 -0
  97. package/src/assets/asset-processing-service/index.d.ts +10 -0
  98. package/src/{services/assets/asset-processing-service/index.d.ts → assets/asset-processing-service/index.js} +4 -0
  99. package/src/assets/asset-processing-service/inline-content-script-body.d.ts +11 -0
  100. package/src/assets/asset-processing-service/inline-content-script-body.js +23 -0
  101. package/src/assets/asset-processing-service/materialize-content-script-asset.d.ts +9 -0
  102. package/src/assets/asset-processing-service/materialize-content-script-asset.js +22 -0
  103. package/src/assets/asset-processing-service/page-package.d.ts +6 -0
  104. package/src/assets/asset-processing-service/page-package.js +81 -0
  105. package/src/assets/asset-processing-service/processor.interface.d.ts +8 -0
  106. package/src/assets/asset-processing-service/processors/base/base-processor.d.ts +13 -0
  107. package/src/assets/asset-processing-service/processors/base/base-processor.js +22 -0
  108. package/src/assets/asset-processing-service/processors/base/base-script-processor.d.ts +40 -0
  109. package/src/assets/asset-processing-service/processors/base/base-script-processor.js +136 -0
  110. package/src/assets/asset-processing-service/processors/index.js +5 -0
  111. package/src/assets/asset-processing-service/processors/script/classic-script-compiler.d.ts +26 -0
  112. package/src/assets/asset-processing-service/processors/script/classic-script-compiler.js +92 -0
  113. package/src/assets/asset-processing-service/processors/script/content-script.processor.d.ts +21 -0
  114. package/src/assets/asset-processing-service/processors/script/content-script.processor.js +88 -0
  115. package/src/assets/asset-processing-service/processors/script/file-script.processor.d.ts +43 -0
  116. package/src/assets/asset-processing-service/processors/script/file-script.processor.js +165 -0
  117. package/src/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +64 -0
  118. package/src/assets/asset-processing-service/processors/script/node-module-script.processor.js +135 -0
  119. package/src/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +36 -0
  120. package/src/{services/assets → assets}/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
  121. package/src/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +40 -0
  122. package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
  123. package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +19 -0
  124. package/src/assets/browser-bundle.service.d.ts +45 -0
  125. package/src/assets/browser-bundle.service.js +50 -0
  126. package/src/assets/browser-runtime-asset-page-cache.d.ts +11 -0
  127. package/src/assets/browser-runtime-asset-page-cache.js +17 -0
  128. package/src/assets/hashed-browser-asset.d.ts +25 -0
  129. package/src/assets/hashed-browser-asset.js +99 -0
  130. package/src/assets/processed-asset-dedupe.d.ts +3 -0
  131. package/src/assets/processed-asset-dedupe.js +24 -0
  132. package/src/browser-env.d.ts +4 -0
  133. package/src/browser-env.js +11 -0
  134. package/src/build/app-build-manifest-runtime.d.ts +38 -0
  135. package/src/build/app-build-manifest-runtime.js +126 -0
  136. package/src/build/browser/browser-runtime-manifest.d.ts +35 -0
  137. package/src/build/browser/browser-runtime-manifest.js +65 -0
  138. package/src/build/browser/browser-runtime-plugin-helpers.d.ts +14 -0
  139. package/src/build/browser/browser-runtime-plugin-helpers.js +21 -0
  140. package/src/build/browser/browser-runtime-plugin.d.ts +54 -0
  141. package/src/build/browser/browser-runtime-plugin.js +76 -0
  142. package/src/build/browser/jsx-ownership-plugins.d.ts +24 -0
  143. package/src/build/browser/jsx-ownership-plugins.js +55 -0
  144. package/src/build/browser/lit-static-render-worker-context.d.ts +1 -0
  145. package/src/build/browser/lit-static-render-worker-context.js +5 -0
  146. package/src/build/build-adapter.d.ts +11 -228
  147. package/src/build/build-adapter.js +18 -569
  148. package/src/build/build-graph.d.ts +34 -0
  149. package/src/build/build-graph.js +162 -0
  150. package/src/build/build-log.d.ts +19 -0
  151. package/src/build/build-log.js +35 -0
  152. package/src/build/build-parallelism.d.ts +4 -0
  153. package/src/build/build-parallelism.js +7 -0
  154. package/src/build/cache/app-config-hash.d.ts +10 -0
  155. package/src/build/cache/app-config-hash.js +22 -0
  156. package/src/build/cache/build-input-dependency-index.d.ts +118 -0
  157. package/src/build/cache/build-input-dependency-index.js +249 -0
  158. package/src/build/cache/cache-keys.d.ts +6 -0
  159. package/src/build/cache/cache-keys.js +17 -0
  160. package/src/build/cache/pages-unified-graph-build.d.ts +54 -0
  161. package/src/build/cache/pages-unified-graph-build.js +182 -0
  162. package/src/build/contracts/build-contracts.d.ts +154 -0
  163. package/src/build/contracts/build-manifest.d.ts +29 -0
  164. package/src/build/contracts/build-manifest.js +52 -0
  165. package/src/build/contracts/build-types.d.ts +1 -0
  166. package/src/build/contracts/build-types.js +1 -0
  167. package/src/build/contracts/content-virtual-modules.d.ts +14 -0
  168. package/src/build/contracts/content-virtual-modules.js +37 -0
  169. package/src/build/contracts/server-only-specifier.d.ts +8 -0
  170. package/src/build/contracts/server-only-specifier.js +11 -0
  171. package/src/build/contracts.d.ts +4 -0
  172. package/src/build/contracts.js +2 -0
  173. package/src/build/mapped-source-transform.d.ts +22 -0
  174. package/src/build/mapped-source-transform.js +31 -0
  175. package/src/build/preserve-import-meta-transform.d.ts +32 -0
  176. package/src/build/preserve-import-meta-transform.js +138 -0
  177. package/src/build/rolldown/app-package-declarations.d.ts +8 -0
  178. package/src/build/rolldown/app-package-declarations.js +81 -0
  179. package/src/build/rolldown/entry-module-closures.d.ts +8 -0
  180. package/src/build/rolldown/entry-module-closures.js +39 -0
  181. package/src/build/rolldown/rolldown-adapter-helpers.d.ts +97 -0
  182. package/src/build/rolldown/rolldown-adapter-helpers.js +570 -0
  183. package/src/build/rolldown/rolldown-build-adapter.d.ts +26 -0
  184. package/src/build/rolldown/rolldown-build-adapter.js +85 -0
  185. package/src/build/rolldown/rolldown-build-invocation-metrics.d.ts +11 -0
  186. package/src/build/rolldown/rolldown-build-invocation-metrics.js +33 -0
  187. package/src/build/rolldown/rolldown-plugin-bridge.d.ts +76 -0
  188. package/src/build/rolldown/rolldown-plugin-bridge.js +450 -0
  189. package/src/build/rolldown/server-side-css-shim-plugin.d.ts +28 -0
  190. package/src/build/rolldown/server-side-css-shim-plugin.js +59 -0
  191. package/src/build/runtime/build-environment-options.d.ts +4 -0
  192. package/src/build/runtime/build-environment-options.js +20 -0
  193. package/src/build/runtime/build-queue.d.ts +58 -0
  194. package/src/build/runtime/build-queue.js +106 -0
  195. package/src/build/runtime/build-request-identity.d.ts +15 -0
  196. package/src/build/runtime/build-request-identity.js +52 -0
  197. package/src/build/runtime/build-request-policy.d.ts +80 -0
  198. package/src/build/runtime/build-request-policy.js +132 -0
  199. package/src/build/server/app-module-loader.service.d.ts +35 -0
  200. package/src/build/server/app-module-loader.service.js +34 -0
  201. package/src/build/server/page-module-import.service.d.ts +111 -0
  202. package/src/build/server/page-module-import.service.js +263 -0
  203. package/src/build/server/route-module-build-cache-registry.d.ts +20 -0
  204. package/src/build/server/route-module-build-cache-registry.js +41 -0
  205. package/src/build/server/route-module-build-cache.store.d.ts +49 -0
  206. package/src/build/server/route-module-build-cache.store.js +75 -0
  207. package/src/build/server/route-module-build-manifest.d.ts +56 -0
  208. package/src/build/server/route-module-build-manifest.js +49 -0
  209. package/src/build/server/route-module-dependency-hasher.d.ts +66 -0
  210. package/src/build/server/route-module-dependency-hasher.js +131 -0
  211. package/src/build/server/view-module-loader.d.ts +10 -0
  212. package/src/build/server/view-module-loader.js +46 -0
  213. package/src/build/server-bundle-deploy-manifest.d.ts +76 -0
  214. package/src/build/server-bundle-deploy-manifest.js +178 -0
  215. package/src/build/server-bundle-publication.d.ts +12 -0
  216. package/src/build/server-bundle-publication.js +39 -0
  217. package/src/build/server-module.d.ts +8 -0
  218. package/src/build/server-module.js +22 -0
  219. package/src/build/source-maps.d.ts +17 -0
  220. package/src/build/source-maps.js +29 -0
  221. package/src/build.d.ts +19 -0
  222. package/src/build.js +19 -0
  223. package/src/cache/index.d.ts +7 -0
  224. package/src/cache/index.js +7 -0
  225. package/src/cache/module-parse-cache.d.ts +43 -0
  226. package/src/cache/module-parse-cache.js +97 -0
  227. package/src/cache/module-transform-profiler.d.ts +7 -0
  228. package/src/cache/module-transform-profiler.js +8 -0
  229. package/src/client/navigation-attributes.d.ts +2 -0
  230. package/src/client/navigation-attributes.js +2 -0
  231. package/src/client/navigation-scripts/activation.d.ts +36 -0
  232. package/src/client/navigation-scripts/activation.js +97 -0
  233. package/src/client/navigation-scripts/classification.d.ts +12 -0
  234. package/src/client/navigation-scripts/classification.js +49 -0
  235. package/src/client/navigation-scripts/identity.d.ts +19 -0
  236. package/src/client/navigation-scripts/identity.js +26 -0
  237. package/src/client/navigation-scripts/index.d.ts +4 -0
  238. package/src/client/navigation-scripts/index.js +4 -0
  239. package/src/client/navigation-scripts/registry.d.ts +12 -0
  240. package/src/client/navigation-scripts/registry.js +17 -0
  241. package/src/client/navigation-scripts/rerun-queue.d.ts +30 -0
  242. package/src/client/navigation-scripts/rerun-queue.js +84 -0
  243. package/src/client/scroll.d.ts +17 -0
  244. package/src/client/scroll.js +33 -0
  245. package/src/client/view-transitions.d.ts +28 -0
  246. package/src/client/view-transitions.js +121 -0
  247. package/src/client.d.ts +15 -0
  248. package/src/client.js +15 -0
  249. package/src/config/assembly/app-runtime.d.ts +73 -0
  250. package/src/config/assembly/app-runtime.js +82 -0
  251. package/src/config/assembly/finalize-config.d.ts +26 -0
  252. package/src/config/assembly/finalize-config.js +242 -0
  253. package/src/config/config-module-files.d.ts +11 -0
  254. package/src/config/config-module-files.js +70 -0
  255. package/src/config/define-config.d.ts +11 -0
  256. package/src/config/define-config.js +3 -0
  257. package/src/config/index.d.ts +6 -0
  258. package/src/config/index.js +5 -0
  259. package/src/config/internal-types.d.ts +180 -0
  260. package/src/config/internal-types.js +1 -0
  261. package/src/config/load-eco-config.d.ts +15 -0
  262. package/src/config/load-eco-config.js +72 -0
  263. package/src/config/resolve-eco-config-path.d.ts +38 -0
  264. package/src/config/resolve-eco-config-path.js +70 -0
  265. package/src/config/server-config-bundle.d.ts +14 -0
  266. package/src/config/server-config-bundle.js +36 -0
  267. package/src/config/user-config-types.d.ts +152 -0
  268. package/src/config/user-config-types.js +1 -0
  269. package/src/config/write-types.d.ts +1 -0
  270. package/src/config/write-types.js +18 -0
  271. package/src/{config/constants.d.ts → constants.d.ts} +5 -4
  272. package/src/constants.js +46 -0
  273. package/src/css-imports.d.ts +4 -0
  274. package/src/declarations.d.ts +13 -6
  275. package/src/dev/development-restart-watch-paths.d.ts +13 -0
  276. package/src/dev/development-restart-watch-paths.js +44 -0
  277. package/src/dev/development-restart.d.ts +25 -0
  278. package/src/dev/development-restart.js +45 -0
  279. package/src/dev/invalidation/development-invalidation.service.d.ts +153 -0
  280. package/src/dev/invalidation/development-invalidation.service.js +338 -0
  281. package/src/dev/runtime-server-started-message.d.ts +10 -0
  282. package/src/dev/runtime-server-started-message.js +14 -0
  283. package/src/dev/transform-server/dev-transform-bundler.d.ts +26 -0
  284. package/src/dev/transform-server/dev-transform-bundler.js +77 -0
  285. package/src/dev/transform-server/dev-transform-externalize-plugin.d.ts +12 -0
  286. package/src/dev/transform-server/dev-transform-externalize-plugin.js +29 -0
  287. package/src/dev/transform-server/dev-transform-import-rewriter.d.ts +17 -0
  288. package/src/dev/transform-server/dev-transform-import-rewriter.js +128 -0
  289. package/src/dev/transform-server/dev-transform-module-kind.d.ts +13 -0
  290. package/src/dev/transform-server/dev-transform-module-kind.js +17 -0
  291. package/src/dev/transform-server/dev-transform-runtime-specifiers.d.ts +5 -0
  292. package/src/dev/transform-server/dev-transform-runtime-specifiers.js +16 -0
  293. package/src/dev/transform-server/dev-transform-server.d.ts +61 -0
  294. package/src/dev/transform-server/dev-transform-server.js +234 -0
  295. package/src/dev/transform-server/dev-transform-url.d.ts +18 -0
  296. package/src/dev/transform-server/dev-transform-url.js +88 -0
  297. package/src/dev/transform-server/dev-transform-vendor-registry.d.ts +28 -0
  298. package/src/dev/transform-server/dev-transform-vendor-registry.js +148 -0
  299. package/src/dev/transform-server/index.d.ts +6 -0
  300. package/src/dev/transform-server/index.js +4 -0
  301. package/src/dev/transform-server/types.d.ts +1 -0
  302. package/src/dev/transform-server/types.js +1 -0
  303. package/src/dev-toolbar/build-error-contract.d.ts +12 -0
  304. package/src/dev-toolbar/build-error-contract.js +3 -0
  305. package/src/dev-toolbar/define-dev-tool.d.ts +21 -0
  306. package/src/dev-toolbar/define-dev-tool.js +9 -0
  307. package/src/dev-toolbar/dev-toolbar-config.d.ts +24 -0
  308. package/src/dev-toolbar/dev-toolbar-config.js +17 -0
  309. package/src/dev-toolbar/dev-toolbar-manifest-contract.d.ts +22 -0
  310. package/src/dev-toolbar/dev-toolbar-manifest-contract.js +2 -0
  311. package/src/dev-toolbar/dev-toolbar-manifest.d.ts +27 -0
  312. package/src/dev-toolbar/dev-toolbar-manifest.js +65 -0
  313. package/src/dev-toolbar/dev-toolbar-package.d.ts +34 -0
  314. package/src/dev-toolbar/dev-toolbar-package.js +78 -0
  315. package/src/dev-toolbar/dev-toolbar-runtime-paths.d.ts +8 -0
  316. package/src/dev-toolbar/dev-toolbar-runtime-paths.js +11 -0
  317. package/src/dev-toolbar/dev-toolbar-runtime.d.ts +10 -0
  318. package/src/dev-toolbar/dev-toolbar-runtime.js +26 -0
  319. package/src/diagnostics/request-pipeline-metrics.d.ts +48 -0
  320. package/src/diagnostics/request-pipeline-metrics.js +113 -0
  321. package/src/diagnostics/startup-trace.d.ts +71 -0
  322. package/src/diagnostics/startup-trace.js +247 -0
  323. package/src/eco/component-identity.d.ts +17 -0
  324. package/src/eco/component-identity.js +25 -0
  325. package/src/eco/component-internal-state.d.ts +5 -0
  326. package/src/eco/component-internal-state.js +17 -0
  327. package/src/eco/component-render-context.d.ts +60 -0
  328. package/src/eco/component-render-context.js +140 -0
  329. package/src/{route-renderer/orchestration/render-output.utils.d.ts → eco/component-render-output.d.ts} +24 -16
  330. package/src/eco/component-render-output.js +123 -0
  331. package/src/eco/discovered-dependencies.d.ts +45 -0
  332. package/src/eco/discovered-dependencies.js +87 -0
  333. package/src/eco/eco-declared-component.d.ts +15 -0
  334. package/src/eco/eco-declared-component.js +23 -0
  335. package/src/eco/eco.browser.d.ts +1 -1
  336. package/src/eco/eco.browser.js +64 -66
  337. package/src/eco/eco.d.ts +1 -1
  338. package/src/eco/eco.js +173 -67
  339. package/src/eco/global-injector-map.d.ts +3 -3
  340. package/src/eco/global-injector-map.js +55 -41
  341. package/src/eco/module-dependencies.js +52 -44
  342. package/src/eco/page-dependency-contributions.d.ts +19 -0
  343. package/src/eco/page-dependency-contributions.js +52 -0
  344. package/src/eco/page-layout-normalization.d.ts +21 -0
  345. package/src/eco/page-layout-normalization.js +69 -0
  346. package/src/env.d.ts +31 -7
  347. package/src/env.js +38 -0
  348. package/src/errors/http-error-page-contract.d.ts +77 -0
  349. package/src/errors/http-error-page-contract.js +106 -0
  350. package/src/errors/http-error.d.ts +10 -2
  351. package/src/errors/http-error.js +66 -49
  352. package/src/errors/index.d.ts +2 -0
  353. package/src/errors/index.js +3 -4
  354. package/src/errors/locals-access-error.js +5 -8
  355. package/src/errors/undeclared-component-dependency-error.d.ts +11 -0
  356. package/src/errors/undeclared-component-dependency-error.js +17 -0
  357. package/src/global/app-logger.js +4 -6
  358. package/src/hmr/client/build-error-overlay.d.ts +17 -0
  359. package/src/hmr/client/build-error-overlay.js +79 -0
  360. package/src/hmr/client/build-error-presentation.d.ts +2 -0
  361. package/src/hmr/client/build-error-presentation.js +30 -0
  362. package/src/hmr/client/hmr-runtime.js +131 -101
  363. package/src/hmr/client/module-update.d.ts +20 -0
  364. package/src/hmr/client/module-update.js +56 -0
  365. package/src/hmr/dev-client-runtime.d.ts +39 -0
  366. package/src/hmr/dev-client-runtime.js +78 -0
  367. package/src/hmr/hmr-asset-paths.d.ts +14 -0
  368. package/src/hmr/hmr-asset-paths.js +22 -0
  369. package/src/hmr/hmr-entrypoint-output.d.ts +11 -0
  370. package/src/hmr/hmr-entrypoint-output.js +34 -0
  371. package/src/hmr/hmr-registered-entrypoints-context.d.ts +7 -0
  372. package/src/hmr/hmr-registered-entrypoints-context.js +1 -0
  373. package/src/hmr/hmr-runtime-paths.d.ts +10 -0
  374. package/src/hmr/hmr-runtime-paths.js +13 -0
  375. package/src/hmr/hmr-strategy.d.ts +18 -25
  376. package/src/hmr/hmr-strategy.js +108 -42
  377. package/src/hmr/strategies/default-hmr-strategy.js +55 -33
  378. package/src/hmr/strategies/js-hmr-strategy.d.ts +15 -102
  379. package/src/hmr/strategies/js-hmr-strategy.js +110 -170
  380. package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
  381. package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +35 -0
  382. package/src/html/html-rewriter.d.ts +77 -0
  383. package/src/html/html-rewriter.js +590 -0
  384. package/src/html/html-source-parser.d.ts +59 -0
  385. package/src/html/html-source-parser.js +203 -0
  386. package/src/html/html-tokenizer.d.ts +69 -0
  387. package/src/html/html-tokenizer.js +193 -0
  388. package/src/html/html-transformer.service.d.ts +74 -0
  389. package/src/html/html-transformer.service.js +173 -0
  390. package/src/html-pages/html-page-classic-script.d.ts +15 -0
  391. package/src/html-pages/html-page-classic-script.js +25 -0
  392. package/src/html-pages/html-page-document.d.ts +33 -0
  393. package/src/html-pages/html-page-document.js +100 -0
  394. package/src/html-pages/html-page-module-scripts.d.ts +86 -0
  395. package/src/html-pages/html-page-module-scripts.js +293 -0
  396. package/src/html-pages/html-page-module.d.ts +32 -0
  397. package/src/html-pages/html-page-module.js +113 -0
  398. package/src/html-pages/html-page-renderer.d.ts +69 -0
  399. package/src/html-pages/html-page-renderer.js +287 -0
  400. package/src/html-pages/html-page-template.d.ts +128 -0
  401. package/src/html-pages/html-page-template.js +495 -0
  402. package/src/html-pages/html-page-warning-state.d.ts +8 -0
  403. package/src/html-pages/html-page-warning-state.js +6 -0
  404. package/src/html-pages/html-pages.plugin.d.ts +23 -0
  405. package/src/html-pages/html-pages.plugin.js +32 -0
  406. package/src/index.browser.d.ts +4 -1
  407. package/src/index.browser.js +5 -4
  408. package/src/index.d.ts +8 -4
  409. package/src/index.js +9 -21
  410. package/src/integration.d.ts +25 -0
  411. package/src/integration.js +23 -0
  412. package/src/islands/island-host.d.ts +43 -0
  413. package/src/islands/island-host.js +65 -0
  414. package/src/page-cache/cache.types.d.ts +1 -0
  415. package/src/page-cache/cache.types.js +1 -0
  416. package/src/page-cache/html-page-cache-dependency-index.d.ts +15 -0
  417. package/src/page-cache/html-page-cache-dependency-index.js +27 -0
  418. package/src/{services/cache → page-cache}/memory-cache-store.d.ts +3 -3
  419. package/src/page-cache/memory-cache-store.js +118 -0
  420. package/src/{services/cache → page-cache}/page-cache-service.d.ts +29 -10
  421. package/src/page-cache/page-cache-service.js +374 -0
  422. package/src/{services/cache → page-cache}/page-request-cache-coordinator.service.d.ts +7 -2
  423. package/src/page-cache/page-request-cache-coordinator.service.js +139 -0
  424. package/src/plugins/alias-resolver-cache.d.ts +40 -0
  425. package/src/plugins/alias-resolver-cache.js +63 -0
  426. package/src/plugins/alias-resolver-plugin.d.ts +3 -2
  427. package/src/plugins/alias-resolver-plugin.js +34 -50
  428. package/src/plugins/component-import-discovery.d.ts +28 -0
  429. package/src/plugins/component-import-discovery.js +244 -0
  430. package/src/plugins/define-integration.d.ts +24 -0
  431. package/src/plugins/define-integration.js +20 -0
  432. package/src/plugins/eco-component-meta-plugin.d.ts +29 -92
  433. package/src/plugins/eco-component-meta-plugin.js +367 -161
  434. package/src/plugins/find-integration-for-file.d.ts +16 -0
  435. package/src/plugins/find-integration-for-file.js +34 -0
  436. package/src/plugins/foreign-jsx-override-plugin.d.ts +4 -2
  437. package/src/plugins/foreign-jsx-override-plugin.js +49 -31
  438. package/src/plugins/integration-plugin.d.ts +109 -104
  439. package/src/plugins/integration-plugin.js +150 -172
  440. package/src/plugins/jsx-import-source.utils.d.ts +7 -0
  441. package/src/plugins/jsx-import-source.utils.js +15 -0
  442. package/src/plugins/package-specifier.d.ts +8 -0
  443. package/src/plugins/package-specifier.js +24 -0
  444. package/src/plugins/processor.d.ts +85 -34
  445. package/src/plugins/processor.js +160 -126
  446. package/src/plugins/tsconfig-import-resolver.d.ts +46 -0
  447. package/src/plugins/tsconfig-import-resolver.js +268 -0
  448. package/src/processor.d.ts +4 -0
  449. package/src/processor.js +3 -0
  450. package/src/route-renderer/error-pages/default-error-pages.d.ts +39 -0
  451. package/src/route-renderer/error-pages/default-error-pages.js +193 -0
  452. package/src/route-renderer/error-pages/error-page-renderer.d.ts +51 -0
  453. package/src/route-renderer/error-pages/error-page-renderer.js +130 -0
  454. package/src/route-renderer/error-pages/semantic-error-page-exporter.d.ts +22 -0
  455. package/src/route-renderer/error-pages/semantic-error-page-exporter.js +33 -0
  456. package/src/route-renderer/explicit-view-render-preparation.d.ts +44 -0
  457. package/src/route-renderer/explicit-view-render-preparation.js +49 -0
  458. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.d.ts +8 -0
  459. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.js +24 -0
  460. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.d.ts +78 -0
  461. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.js +164 -0
  462. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.d.ts +17 -0
  463. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.js +34 -0
  464. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.d.ts +15 -0
  465. package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.js +65 -0
  466. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.d.ts +114 -0
  467. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +161 -0
  468. package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.d.ts +32 -0
  469. package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.js +52 -0
  470. package/src/route-renderer/orchestration/foreign-child/foreign-child-output.utils.d.ts +4 -0
  471. package/src/route-renderer/orchestration/foreign-child/foreign-child-output.utils.js +27 -0
  472. package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.d.ts +127 -0
  473. package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js +319 -0
  474. package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.d.ts +18 -0
  475. package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.js +33 -0
  476. package/src/route-renderer/orchestration/foreign-child/render-session.d.ts +26 -0
  477. package/src/route-renderer/orchestration/foreign-child/render-session.js +9 -0
  478. package/src/route-renderer/orchestration/integration-renderer.d.ts +346 -346
  479. package/src/route-renderer/orchestration/integration-renderer.js +1209 -942
  480. package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.d.ts +15 -0
  481. package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +49 -0
  482. package/src/route-renderer/orchestration/ownership-graph/component-graph.d.ts +70 -0
  483. package/src/route-renderer/orchestration/ownership-graph/component-graph.js +177 -0
  484. package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.d.ts +26 -0
  485. package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.js +74 -0
  486. package/src/route-renderer/orchestration/ownership-graph/page-client-browser-assets.d.ts +28 -0
  487. package/src/route-renderer/orchestration/ownership-graph/page-client-browser-assets.js +44 -0
  488. package/src/route-renderer/orchestration/ownership-graph/page-client-plan.d.ts +40 -0
  489. package/src/route-renderer/orchestration/ownership-graph/page-client-plan.js +175 -0
  490. package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.d.ts +7 -0
  491. package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.js +31 -0
  492. package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.d.ts +33 -0
  493. package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.js +14 -0
  494. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.d.ts +5 -0
  495. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.js +30 -0
  496. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.d.ts +12 -0
  497. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.js +32 -0
  498. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +108 -0
  499. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +486 -0
  500. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +58 -0
  501. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +338 -0
  502. package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.d.ts +26 -0
  503. package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.js +32 -0
  504. package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +5 -0
  505. package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +11 -0
  506. package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.d.ts +15 -0
  507. package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.js +43 -0
  508. package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.d.ts +26 -0
  509. package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.js +43 -0
  510. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.d.ts +26 -0
  511. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +44 -0
  512. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.d.ts +4 -0
  513. package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.js +30 -0
  514. package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.d.ts +131 -0
  515. package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +350 -0
  516. package/src/route-renderer/orchestration/string-markup-renderer.d.ts +11 -0
  517. package/src/route-renderer/orchestration/string-markup-renderer.js +10 -0
  518. package/src/route-renderer/page-loading/component-dependency-collection.d.ts +50 -0
  519. package/src/route-renderer/page-loading/component-dependency-collection.js +197 -0
  520. package/src/route-renderer/page-loading/declared-asset-collection.d.ts +24 -0
  521. package/src/route-renderer/page-loading/declared-asset-collection.js +78 -0
  522. package/src/route-renderer/page-loading/dependency-resolver.d.ts +41 -6
  523. package/src/route-renderer/page-loading/dependency-resolver.js +232 -417
  524. package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +12 -0
  525. package/src/route-renderer/page-loading/ecopages-virtual-imports.js +100 -0
  526. package/src/route-renderer/page-loading/file-scoped-dependency-components.d.ts +41 -0
  527. package/src/route-renderer/page-loading/file-scoped-dependency-components.js +120 -0
  528. package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +44 -0
  529. package/src/route-renderer/page-loading/lazy-entry-collection.js +74 -0
  530. package/src/route-renderer/page-loading/lazy-trigger-planning.d.ts +19 -0
  531. package/src/route-renderer/page-loading/lazy-trigger-planning.js +51 -0
  532. package/src/route-renderer/page-loading/module-declaration-aggregation.d.ts +5 -0
  533. package/src/route-renderer/page-loading/module-declaration-aggregation.js +44 -0
  534. package/src/route-renderer/page-loading/module-declaration-scripts.d.ts +3 -0
  535. package/src/route-renderer/page-loading/module-declaration-scripts.js +13 -0
  536. package/src/route-renderer/page-loading/page-dependency-bundling.d.ts +12 -0
  537. package/src/route-renderer/page-loading/page-dependency-bundling.js +200 -0
  538. package/src/route-renderer/page-loading/page-module-loader.d.ts +9 -9
  539. package/src/route-renderer/page-loading/page-module-loader.js +136 -123
  540. package/src/route-renderer/page-loading/resolved-page-dependencies.d.ts +11 -0
  541. package/src/route-renderer/page-loading/resolved-page-dependencies.js +39 -0
  542. package/src/route-renderer/route-renderer.d.ts +36 -35
  543. package/src/route-renderer/route-renderer.js +48 -93
  544. package/src/router/client/link-intent.d.ts +11 -21
  545. package/src/router/client/link-intent.js +56 -30
  546. package/src/router/client/link-navigation-policy.d.ts +48 -0
  547. package/src/router/client/link-navigation-policy.js +116 -0
  548. package/src/router/client/navigation-commit.d.ts +22 -0
  549. package/src/router/client/navigation-commit.js +57 -0
  550. package/src/router/client/navigation-coordinator.d.ts +21 -20
  551. package/src/router/client/navigation-coordinator.js +194 -204
  552. package/src/router/client/navigation-document.d.ts +37 -0
  553. package/src/router/client/navigation-document.js +106 -0
  554. package/src/router/client/navigation-head.d.ts +13 -0
  555. package/src/router/client/navigation-head.js +238 -0
  556. package/src/router/client/navigation-lifecycle.d.ts +49 -0
  557. package/src/router/client/navigation-lifecycle.js +50 -0
  558. package/src/router/client/navigation-pipeline.d.ts +8 -0
  559. package/src/router/client/navigation-pipeline.js +8 -0
  560. package/src/router/client/navigation-replay.d.ts +16 -0
  561. package/src/router/client/navigation-replay.js +17 -0
  562. package/src/router/client/navigation-view-transition.d.ts +9 -0
  563. package/src/router/client/navigation-view-transition.js +61 -0
  564. package/src/router/server/parse-search-params.d.ts +9 -0
  565. package/src/router/server/parse-search-params.js +16 -0
  566. package/src/router/server/route-registry.d.ts +102 -0
  567. package/src/router/server/route-registry.js +230 -0
  568. package/src/router/server/segment-path-matcher.d.ts +39 -0
  569. package/src/router/server/segment-path-matcher.js +179 -0
  570. package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +36 -0
  571. package/src/static-site-generator/production-page-browser-graph-prebuild.js +196 -0
  572. package/src/static-site-generator/sitemap-routes.d.ts +14 -0
  573. package/src/static-site-generator/sitemap-routes.js +36 -0
  574. package/src/static-site-generator/sitemap.d.ts +15 -0
  575. package/src/static-site-generator/sitemap.js +42 -0
  576. package/src/static-site-generator/static-export-context.d.ts +33 -0
  577. package/src/static-site-generator/static-export-context.js +1 -0
  578. package/src/static-site-generator/static-site-generator.d.ts +52 -52
  579. package/src/static-site-generator/static-site-generator.js +542 -331
  580. package/src/types/api-response.d.ts +9 -0
  581. package/src/types/api-response.js +1 -0
  582. package/src/{services/assets/asset-processing-service/assets.types.d.ts → types/asset-types.d.ts} +36 -4
  583. package/src/types/asset-types.js +1 -0
  584. package/src/types/build-types.d.ts +104 -0
  585. package/src/types/build-types.js +1 -0
  586. package/src/{services/cache/cache.types.d.ts → types/cache-types.d.ts} +20 -9
  587. package/src/types/cache-types.js +5 -0
  588. package/src/types/component-identity.d.ts +6 -0
  589. package/src/types/component-identity.js +1 -0
  590. package/src/types/contracts.d.ts +1513 -0
  591. package/src/types/contracts.js +1 -0
  592. package/src/types/dev-transform-types.d.ts +15 -0
  593. package/src/types/dev-transform-types.js +1 -0
  594. package/src/{eco/eco.types.d.ts → types/eco-api-types.d.ts} +79 -44
  595. package/src/types/eco-api-types.js +5 -0
  596. package/src/types/integration-types.d.ts +3 -0
  597. package/src/types/integration-types.js +1 -0
  598. package/src/types/public-types.d.ts +3 -1165
  599. package/src/types/public-types.js +1 -0
  600. package/src/types/standard-schema-types.d.ts +12 -0
  601. package/src/types/standard-schema-types.js +1 -0
  602. package/src/utils/additional-watch-paths.d.ts +25 -0
  603. package/src/utils/additional-watch-paths.js +49 -0
  604. package/src/utils/app-runtime.d.ts +9 -0
  605. package/src/utils/app-runtime.js +13 -0
  606. package/src/utils/content-hash.d.ts +8 -0
  607. package/src/utils/content-hash.js +16 -0
  608. package/src/utils/deep-merge.js +39 -26
  609. package/src/utils/ecopages-route-info.d.ts +22 -0
  610. package/src/utils/ecopages-route-info.js +20 -0
  611. package/src/utils/format-error-chain.d.ts +9 -0
  612. package/src/utils/format-error-chain.js +20 -0
  613. package/src/utils/html-entities.d.ts +10 -0
  614. package/src/utils/html-entities.js +34 -0
  615. package/src/utils/html-escaping.d.ts +14 -0
  616. package/src/utils/html-escaping.js +42 -5
  617. package/src/utils/invariant.d.ts +6 -1
  618. package/src/utils/invariant.js +16 -10
  619. package/src/utils/locals-utils.d.ts +1 -1
  620. package/src/utils/locals-utils.js +32 -22
  621. package/src/utils/parse-cli-args.d.ts +3 -6
  622. package/src/utils/parse-cli-args.js +55 -60
  623. package/src/utils/path-containment.d.ts +15 -0
  624. package/src/utils/path-containment.js +27 -0
  625. package/src/utils/path-pattern.d.ts +23 -0
  626. package/src/utils/path-pattern.js +42 -0
  627. package/src/utils/regex-escaping.d.ts +2 -0
  628. package/src/utils/regex-escaping.js +4 -0
  629. package/src/utils/resolve-entry-file.d.ts +72 -0
  630. package/src/utils/resolve-entry-file.js +74 -0
  631. package/src/utils/resolve-work-dir.js +23 -27
  632. package/src/utils/runtime.d.ts +12 -9
  633. package/src/utils/runtime.js +14 -39
  634. package/src/utils/server-utils.module.d.ts +13 -2
  635. package/src/utils/server-utils.module.js +74 -53
  636. package/src/utils/static-file-extensions.d.ts +12 -0
  637. package/src/utils/static-file-extensions.js +54 -0
  638. package/src/validation/standard-schema.types.d.ts +1 -0
  639. package/src/validation/standard-schema.types.js +1 -0
  640. package/src/validation/validate-request.d.ts +36 -0
  641. package/src/validation/validate-request.js +56 -0
  642. package/src/validation/validate-standard-schema.d.ts +7 -0
  643. package/src/validation/validate-standard-schema.js +14 -0
  644. package/src/watchers/project-watcher-ignore.d.ts +13 -0
  645. package/src/watchers/project-watcher-ignore.js +27 -0
  646. package/src/watchers/project-watcher.d.ts +95 -80
  647. package/src/watchers/project-watcher.js +526 -264
  648. package/src/watchers/workspace-package-watch-roots.d.ts +9 -0
  649. package/src/watchers/workspace-package-watch-roots.js +44 -0
  650. package/CHANGELOG.md +0 -38
  651. package/src/adapters/README.md +0 -39
  652. package/src/adapters/abstract/application-adapter.d.ts +0 -194
  653. package/src/adapters/abstract/application-adapter.js +0 -121
  654. package/src/adapters/abstract/router-adapter.d.ts +0 -26
  655. package/src/adapters/abstract/router-adapter.js +0 -5
  656. package/src/adapters/abstract/server-adapter.d.ts +0 -69
  657. package/src/adapters/abstract/server-adapter.js +0 -15
  658. package/src/adapters/bun/client-bridge.d.ts +0 -34
  659. package/src/adapters/bun/client-bridge.js +0 -48
  660. package/src/adapters/bun/create-app.d.ts +0 -52
  661. package/src/adapters/bun/create-app.js +0 -116
  662. package/src/adapters/bun/hmr-manager.d.ts +0 -143
  663. package/src/adapters/bun/hmr-manager.js +0 -334
  664. package/src/adapters/bun/index.d.ts +0 -2
  665. package/src/adapters/bun/index.js +0 -8
  666. package/src/adapters/bun/server-adapter.d.ts +0 -155
  667. package/src/adapters/bun/server-adapter.js +0 -374
  668. package/src/adapters/bun/server-lifecycle.d.ts +0 -63
  669. package/src/adapters/bun/server-lifecycle.js +0 -92
  670. package/src/adapters/index.d.ts +0 -2
  671. package/src/adapters/index.js +0 -8
  672. package/src/adapters/node/node-hmr-manager.d.ts +0 -133
  673. package/src/adapters/node/node-hmr-manager.js +0 -312
  674. package/src/adapters/node/static-content-server.d.ts +0 -60
  675. package/src/adapters/node/static-content-server.js +0 -194
  676. package/src/adapters/shared/api-response.js +0 -96
  677. package/src/adapters/shared/application-adapter.d.ts +0 -18
  678. package/src/adapters/shared/application-adapter.js +0 -90
  679. package/src/adapters/shared/define-api-handler.d.ts +0 -25
  680. package/src/adapters/shared/define-api-handler.js +0 -15
  681. package/src/adapters/shared/explicit-static-route-matcher.js +0 -103
  682. package/src/adapters/shared/file-route-middleware-pipeline.js +0 -99
  683. package/src/adapters/shared/fs-server-response-factory.d.ts +0 -19
  684. package/src/adapters/shared/fs-server-response-factory.js +0 -97
  685. package/src/adapters/shared/fs-server-response-matcher.d.ts +0 -75
  686. package/src/adapters/shared/fs-server-response-matcher.js +0 -160
  687. package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +0 -55
  688. package/src/adapters/shared/hmr-entrypoint-registrar.js +0 -87
  689. package/src/adapters/shared/hmr-html-response.d.ts +0 -22
  690. package/src/adapters/shared/hmr-html-response.js +0 -32
  691. package/src/adapters/shared/render-context.js +0 -72
  692. package/src/adapters/shared/runtime-bootstrap.d.ts +0 -38
  693. package/src/adapters/shared/runtime-bootstrap.js +0 -43
  694. package/src/adapters/shared/server-adapter.d.ts +0 -97
  695. package/src/adapters/shared/server-adapter.js +0 -390
  696. package/src/adapters/shared/server-route-handler.js +0 -111
  697. package/src/adapters/shared/server-static-builder.d.ts +0 -70
  698. package/src/adapters/shared/server-static-builder.js +0 -100
  699. package/src/build/README.md +0 -107
  700. package/src/build/build-manifest.d.ts +0 -27
  701. package/src/build/build-manifest.js +0 -30
  702. package/src/build/build-types.d.ts +0 -57
  703. package/src/build/build-types.js +0 -0
  704. package/src/build/dev-build-coordinator.d.ts +0 -72
  705. package/src/build/dev-build-coordinator.js +0 -154
  706. package/src/build/esbuild-build-adapter.d.ts +0 -78
  707. package/src/build/esbuild-build-adapter.js +0 -505
  708. package/src/build/runtime-build-executor.d.ts +0 -14
  709. package/src/build/runtime-build-executor.js +0 -22
  710. package/src/build/runtime-specifier-alias-plugin.d.ts +0 -15
  711. package/src/build/runtime-specifier-alias-plugin.js +0 -35
  712. package/src/build/runtime-specifier-aliases.d.ts +0 -5
  713. package/src/build/runtime-specifier-aliases.js +0 -95
  714. package/src/config/README.md +0 -36
  715. package/src/config/config-builder.d.ts +0 -261
  716. package/src/config/config-builder.js +0 -602
  717. package/src/config/constants.js +0 -25
  718. package/src/dev/sc-server.d.ts +0 -30
  719. package/src/dev/sc-server.js +0 -111
  720. package/src/eco/README.md +0 -690
  721. package/src/eco/eco.types.js +0 -0
  722. package/src/eco/eco.utils.d.ts +0 -1
  723. package/src/eco/eco.utils.js +0 -10
  724. package/src/eco/lazy-injector-map.d.ts +0 -8
  725. package/src/eco/lazy-injector-map.js +0 -70
  726. package/src/hmr/README.md +0 -26
  727. package/src/hmr/hmr.postcss.test.e2e.js +0 -31
  728. package/src/hmr/hmr.test.e2e.js +0 -43
  729. package/src/integrations/ghtml/ghtml-renderer.d.ts +0 -20
  730. package/src/integrations/ghtml/ghtml-renderer.js +0 -63
  731. package/src/integrations/ghtml/ghtml.plugin.d.ts +0 -20
  732. package/src/integrations/ghtml/ghtml.plugin.js +0 -21
  733. package/src/plugins/README.md +0 -35
  734. package/src/plugins/runtime-capability.d.ts +0 -9
  735. package/src/plugins/runtime-capability.js +0 -0
  736. package/src/plugins/source-transform.d.ts +0 -46
  737. package/src/plugins/source-transform.js +0 -71
  738. package/src/route-renderer/GRAPH.md +0 -353
  739. package/src/route-renderer/README.md +0 -116
  740. package/src/route-renderer/orchestration/component-render-context.d.ts +0 -83
  741. package/src/route-renderer/orchestration/component-render-context.js +0 -147
  742. package/src/route-renderer/orchestration/queued-boundary-runtime.service.d.ts +0 -93
  743. package/src/route-renderer/orchestration/queued-boundary-runtime.service.js +0 -155
  744. package/src/route-renderer/orchestration/render-execution.service.d.ts +0 -43
  745. package/src/route-renderer/orchestration/render-execution.service.js +0 -106
  746. package/src/route-renderer/orchestration/render-output.utils.js +0 -65
  747. package/src/route-renderer/orchestration/render-preparation.service.d.ts +0 -115
  748. package/src/route-renderer/orchestration/render-preparation.service.js +0 -325
  749. package/src/route-renderer/orchestration/template-serialization.d.ts +0 -38
  750. package/src/route-renderer/orchestration/template-serialization.js +0 -45
  751. package/src/router/README.md +0 -97
  752. package/src/router/client/link-intent.test.browser.js +0 -43
  753. package/src/router/server/fs-router-scanner.d.ts +0 -41
  754. package/src/router/server/fs-router-scanner.js +0 -161
  755. package/src/router/server/fs-router.d.ts +0 -26
  756. package/src/router/server/fs-router.js +0 -100
  757. package/src/services/README.md +0 -29
  758. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +0 -120
  759. package/src/services/assets/asset-processing-service/asset-processing.service.js +0 -331
  760. package/src/services/assets/asset-processing-service/asset.factory.js +0 -82
  761. package/src/services/assets/asset-processing-service/assets.types.js +0 -0
  762. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +0 -48
  763. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +0 -41
  764. package/src/services/assets/asset-processing-service/index.js +0 -5
  765. package/src/services/assets/asset-processing-service/processor.interface.d.ts +0 -22
  766. package/src/services/assets/asset-processing-service/processor.interface.js +0 -6
  767. package/src/services/assets/asset-processing-service/processor.registry.d.ts +0 -8
  768. package/src/services/assets/asset-processing-service/processor.registry.js +0 -15
  769. package/src/services/assets/asset-processing-service/processors/base/base-processor.d.ts +0 -24
  770. package/src/services/assets/asset-processing-service/processors/base/base-processor.js +0 -64
  771. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +0 -17
  772. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +0 -72
  773. package/src/services/assets/asset-processing-service/processors/index.js +0 -5
  774. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +0 -5
  775. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +0 -57
  776. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +0 -9
  777. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +0 -88
  778. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +0 -7
  779. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +0 -75
  780. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +0 -25
  781. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +0 -66
  782. package/src/services/assets/browser-bundle.service.d.ts +0 -32
  783. package/src/services/assets/browser-bundle.service.js +0 -33
  784. package/src/services/cache/cache.types.js +0 -0
  785. package/src/services/cache/index.d.ts +0 -7
  786. package/src/services/cache/index.js +0 -7
  787. package/src/services/cache/memory-cache-store.js +0 -98
  788. package/src/services/cache/page-cache-service.js +0 -152
  789. package/src/services/cache/page-request-cache-coordinator.service.js +0 -109
  790. package/src/services/html/html-rewriter-provider.service.d.ts +0 -37
  791. package/src/services/html/html-rewriter-provider.service.js +0 -68
  792. package/src/services/html/html-transformer.service.d.ts +0 -77
  793. package/src/services/html/html-transformer.service.js +0 -215
  794. package/src/services/invalidation/development-invalidation.service.d.ts +0 -74
  795. package/src/services/invalidation/development-invalidation.service.js +0 -190
  796. package/src/services/module-loading/app-module-loader.service.d.ts +0 -25
  797. package/src/services/module-loading/app-module-loader.service.js +0 -31
  798. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +0 -24
  799. package/src/services/module-loading/app-server-module-transpiler.service.js +0 -109
  800. package/src/services/module-loading/host-module-loader-registry.d.ts +0 -4
  801. package/src/services/module-loading/host-module-loader-registry.js +0 -15
  802. package/src/services/module-loading/module-loading-types.d.ts +0 -2
  803. package/src/services/module-loading/module-loading-types.js +0 -0
  804. package/src/services/module-loading/node-bootstrap-plugin.d.ts +0 -22
  805. package/src/services/module-loading/node-bootstrap-plugin.js +0 -192
  806. package/src/services/module-loading/page-module-import.service.d.ts +0 -75
  807. package/src/services/module-loading/page-module-import.service.js +0 -161
  808. package/src/services/module-loading/server-module-transpiler.service.d.ts +0 -72
  809. package/src/services/module-loading/server-module-transpiler.service.js +0 -64
  810. package/src/services/runtime-state/dev-graph.service.d.ts +0 -118
  811. package/src/services/runtime-state/dev-graph.service.js +0 -162
  812. package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +0 -41
  813. package/src/services/runtime-state/entrypoint-dependency-graph.service.js +0 -85
  814. package/src/services/runtime-state/runtime-specifier-registry.service.d.ts +0 -69
  815. package/src/services/runtime-state/runtime-specifier-registry.service.js +0 -37
  816. package/src/services/runtime-state/server-invalidation-state.service.d.ts +0 -26
  817. package/src/services/runtime-state/server-invalidation-state.service.js +0 -35
  818. package/src/services/validation/schema-validation-service.d.ts +0 -122
  819. package/src/services/validation/schema-validation-service.js +0 -101
  820. package/src/services/validation/standard-schema.types.d.ts +0 -65
  821. package/src/services/validation/standard-schema.types.js +0 -0
  822. package/src/static-site-generator/README.md +0 -26
  823. package/src/types/internal-types.d.ts +0 -231
  824. package/src/types/internal-types.js +0 -0
  825. package/src/utils/hash.d.ts +0 -1
  826. package/src/utils/hash.js +0 -7
  827. package/src/utils/html.d.ts +0 -1
  828. package/src/utils/html.js +0 -4
  829. package/src/utils/path-utils.module.d.ts +0 -5
  830. package/src/utils/path-utils.module.js +0 -14
  831. package/src/watchers/project-watcher.test-helpers.d.ts +0 -4
  832. package/src/watchers/project-watcher.test-helpers.js +0 -52
  833. /package/src/{services/assets → assets}/asset-processing-service/asset.factory.d.ts +0 -0
  834. /package/src/{hmr/hmr.postcss.test.e2e.d.ts → assets/asset-processing-service/assets.types.js} +0 -0
  835. /package/src/{hmr/hmr.test.e2e.d.ts → assets/asset-processing-service/processor.interface.js} +0 -0
  836. /package/src/{services/assets → assets}/asset-processing-service/processors/index.d.ts +0 -0
  837. /package/src/{services/assets → assets}/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -0
  838. /package/src/{router/client/link-intent.test.browser.d.ts → build/contracts/build-contracts.js} +0 -0
@@ -1,192 +0,0 @@
1
- import path from "node:path";
2
- import { existsSync, mkdirSync, readFileSync, symlinkSync } from "node:fs";
3
- import { createRequire } from "node:module";
4
- import { fileURLToPath, pathToFileURL } from "node:url";
5
- import { resolveInternalExecutionDir } from "../../utils/resolve-work-dir.js";
6
- function getAppRuntimeNodeModulesDir(appConfig) {
7
- return path.join(resolveInternalExecutionDir(appConfig), "node_modules");
8
- }
9
- function getPackageNameFromSpecifier(specifier) {
10
- if (specifier.startsWith("@")) {
11
- const [scope, name] = specifier.split("/");
12
- return `${scope}/${name}`;
13
- }
14
- return specifier.split("/")[0] ?? specifier;
15
- }
16
- function findPackageRoot(resolvedPath) {
17
- let currentPath = path.dirname(resolvedPath);
18
- while (true) {
19
- const packageJsonPath = path.join(currentPath, "package.json");
20
- if (existsSync(packageJsonPath)) {
21
- return currentPath;
22
- }
23
- const parentPath = path.dirname(currentPath);
24
- if (parentPath === currentPath) {
25
- throw new Error(`Could not find package root for resolved dependency path: ${resolvedPath}`);
26
- }
27
- currentPath = parentPath;
28
- }
29
- }
30
- function ensureRuntimePackageLink(nodeModulesDir, specifier, resolvedPath) {
31
- const packageName = getPackageNameFromSpecifier(specifier);
32
- const packageRoot = findPackageRoot(resolvedPath);
33
- const linkPath = path.join(nodeModulesDir, packageName);
34
- if (existsSync(linkPath)) {
35
- return;
36
- }
37
- mkdirSync(path.dirname(linkPath), { recursive: true });
38
- symlinkSync(packageRoot, linkPath, "dir");
39
- }
40
- function getNodeUnsupportedBuiltinError(specifier, importer) {
41
- return `Node bootstrap transpilation does not support Bun builtin specifier ${JSON.stringify(specifier)}${importer ? ` imported from ${importer}` : ""}.`;
42
- }
43
- function shouldResolveFromImporter(importer) {
44
- return Boolean(importer && importer.includes(`${path.sep}node_modules${path.sep}`));
45
- }
46
- function resolveSpecifier(specifier, parentPath) {
47
- try {
48
- return createRequire(parentPath).resolve(specifier);
49
- } catch {
50
- return fileURLToPath(import.meta.resolve(specifier, pathToFileURL(parentPath).href));
51
- }
52
- }
53
- function resolveFromCore(specifier) {
54
- return createRequire(import.meta.url).resolve(specifier);
55
- }
56
- function getBootstrapBuildLoaderForPath(filePath) {
57
- switch (path.extname(filePath).toLowerCase()) {
58
- case ".ts":
59
- case ".mts":
60
- case ".cts":
61
- return "ts";
62
- case ".tsx":
63
- return "tsx";
64
- case ".jsx":
65
- return "jsx";
66
- case ".json":
67
- return "json";
68
- default:
69
- return "js";
70
- }
71
- }
72
- const REEXPORT_FROM_STATEMENT_PATTERN = /^\s*export\s+(?!type\b)(?:\*|\{[\s\S]*?\})\s+from\s+(['"][^'"]+['"])\s*;?\s*$/gm;
73
- function injectBootstrapReexportImports(source) {
74
- const sideEffectImports = [];
75
- const importedSpecifiers = /* @__PURE__ */ new Set();
76
- let importIndex = 0;
77
- const rewrittenSource = source.replace(REEXPORT_FROM_STATEMENT_PATTERN, (statement, specifierLiteral) => {
78
- if (!importedSpecifiers.has(specifierLiteral)) {
79
- importedSpecifiers.add(specifierLiteral);
80
- const importBinding = `__eco_bootstrap_reexport_${importIndex++}`;
81
- sideEffectImports.push(`import * as ${importBinding} from ${specifierLiteral};`);
82
- sideEffectImports.push(`void ${importBinding};`);
83
- }
84
- return statement;
85
- });
86
- if (sideEffectImports.length === 0) {
87
- return source;
88
- }
89
- return `${sideEffectImports.join("\n")}
90
- ${rewrittenSource}`;
91
- }
92
- function shouldRewriteBootstrapSource(filePath, projectDir) {
93
- const normalizedPath = path.resolve(filePath);
94
- const normalizedProjectDir = path.resolve(projectDir);
95
- return normalizedPath.startsWith(`${normalizedProjectDir}${path.sep}`) && !normalizedPath.includes(`${path.sep}node_modules${path.sep}`);
96
- }
97
- function resolveNodeBootstrapDependency(args, options) {
98
- if (args.path.startsWith("./") || args.path.startsWith("../") || args.path.startsWith("@/") || args.path.startsWith("/") || args.path.startsWith("node:")) {
99
- return void 0;
100
- }
101
- const resolveParent = args.importer && path.isAbsolute(args.importer) && shouldResolveFromImporter(args.importer) ? args.importer : path.join(options.projectDir, "package.json");
102
- if (args.path.startsWith("@ecopages/")) {
103
- let resolvedPath2;
104
- try {
105
- resolvedPath2 = resolveFromCore(args.path);
106
- } catch {
107
- try {
108
- resolvedPath2 = resolveSpecifier(args.path, resolveParent);
109
- } catch {
110
- const packageName = getPackageNameFromSpecifier(args.path);
111
- const candidatePath = path.join(options.projectDir, "node_modules", packageName);
112
- const candidatePackageJson = path.join(candidatePath, "package.json");
113
- if (existsSync(candidatePackageJson)) {
114
- ensureRuntimePackageLink(options.runtimeNodeModulesDir, args.path, candidatePackageJson);
115
- return { path: args.path, external: true };
116
- }
117
- }
118
- }
119
- if (!resolvedPath2) {
120
- return void 0;
121
- }
122
- if (resolvedPath2.includes(`${path.sep}node_modules${path.sep}`)) {
123
- ensureRuntimePackageLink(options.runtimeNodeModulesDir, args.path, resolvedPath2);
124
- return {
125
- path: args.path,
126
- external: true
127
- };
128
- }
129
- return { path: resolvedPath2 };
130
- }
131
- const resolvedPath = resolveSpecifier(args.path, resolveParent);
132
- ensureRuntimePackageLink(options.runtimeNodeModulesDir, args.path, resolvedPath);
133
- return {
134
- path: args.path,
135
- external: true
136
- };
137
- }
138
- function createNodeBootstrapPlugin(options) {
139
- const projectDir = path.resolve(options.projectDir);
140
- const importMetaRewritePaths = new Set(
141
- (options.preserveImportMetaPaths ?? []).map((filePath) => path.resolve(filePath))
142
- );
143
- return {
144
- name: "node-bootstrap-plugin",
145
- setup(build) {
146
- build.onResolve({ filter: /^bun:/ }, (args) => {
147
- throw new Error(getNodeUnsupportedBuiltinError(args.path, args.importer));
148
- });
149
- build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, async (args) => {
150
- const absolutePath = path.resolve(args.path);
151
- const shouldPreserveImportMeta = importMetaRewritePaths.has(absolutePath);
152
- const shouldRewriteReexports = shouldRewriteBootstrapSource(absolutePath, projectDir);
153
- if (!shouldPreserveImportMeta && !shouldRewriteReexports) {
154
- return void 0;
155
- }
156
- const originalContents = readFileSync(args.path, "utf8");
157
- let contents = originalContents;
158
- if (shouldPreserveImportMeta) {
159
- contents = contents.replaceAll("import.meta.dirname", JSON.stringify(path.dirname(args.path))).replaceAll("import.meta.filename", JSON.stringify(args.path));
160
- }
161
- if (shouldRewriteReexports) {
162
- contents = injectBootstrapReexportImports(contents);
163
- }
164
- if (contents === originalContents) {
165
- return void 0;
166
- }
167
- return {
168
- contents,
169
- loader: getBootstrapBuildLoaderForPath(args.path),
170
- resolveDir: path.dirname(args.path)
171
- };
172
- });
173
- build.onResolve({ filter: /^[@A-Za-z0-9][^:]*$/ }, (args) => {
174
- return resolveNodeBootstrapDependency(args, options);
175
- });
176
- }
177
- };
178
- }
179
- function createAppNodeBootstrapPlugin(appConfig, options) {
180
- return createNodeBootstrapPlugin({
181
- projectDir: appConfig.rootDir,
182
- runtimeNodeModulesDir: getAppRuntimeNodeModulesDir(appConfig),
183
- preserveImportMetaPaths: options?.preserveImportMetaPaths
184
- });
185
- }
186
- export {
187
- createAppNodeBootstrapPlugin,
188
- createNodeBootstrapPlugin,
189
- getAppRuntimeNodeModulesDir,
190
- getNodeUnsupportedBuiltinError,
191
- resolveNodeBootstrapDependency
192
- };
@@ -1,75 +0,0 @@
1
- import { build, type BuildExecutor, type BuildResult } from '../../build/build-adapter.js';
2
- import type { EcoBuildPlugin } from '../../build/build-types.js';
3
- import type { SourceModuleLoaderFactory } from './module-loading-types.js';
4
- export interface PageModuleImportOptions {
5
- filePath: string;
6
- rootDir: string;
7
- outdir: string;
8
- bypassCache?: boolean;
9
- buildExecutor?: BuildExecutor;
10
- invalidationVersion?: number;
11
- splitting?: boolean;
12
- externalPackages?: boolean;
13
- plugins?: EcoBuildPlugin[];
14
- transpileErrorMessage?: (details: string) => string;
15
- noOutputMessage?: (filePath: string) => string;
16
- }
17
- /**
18
- * Minimal runtime dependencies required to load page modules.
19
- *
20
- * @remarks
21
- * This service owns cache and runtime import policy. Hashing and build
22
- * execution are injected so tests can provide explicit fakes without module
23
- * interception.
24
- */
25
- export interface PageModuleImportDependencies {
26
- hashFile(filePath: string): string;
27
- buildModule(options: Parameters<typeof build>[0], buildExecutor?: BuildExecutor): Promise<BuildResult>;
28
- canLoadSourceModuleFromHost(filePath: string): boolean;
29
- getHostModuleLoader: SourceModuleLoaderFactory;
30
- }
31
- /**
32
- * Loads source page modules in a runtime-agnostic way.
33
- *
34
- * This service centralizes the Bun-vs-Node import strategy used by route
35
- * scanning, page data loading, and request-time page inspection. In Bun it can
36
- * import source files directly; in Node it transpiles the file into a dedicated
37
- * output directory first and then imports the generated module.
38
- *
39
- * Keeping this logic in one place prevents subtle drift in cache-busting,
40
- * transpilation settings, and error semantics across the different callers.
41
- */
42
- export declare class PageModuleImportService {
43
- private readonly dependencies;
44
- private readonly importCache;
45
- private developmentInvalidationVersion;
46
- constructor(dependencies?: Partial<PageModuleImportDependencies>);
47
- /**
48
- * Clears the shared import cache used by framework-owned page-module loads.
49
- */
50
- clearImportCache(): void;
51
- /**
52
- * Invalidates all previously imported modules in development by clearing the
53
- * import cache and incrementing the invalidation version included in cache keys.
54
- *
55
- * This forces all modules to be reloaded on the next import, even if their
56
- * source content hasn't changed. This is necessary to ensure that changes to
57
- * non-content aspects of modules (e.g. dependencies, transpilation output)
58
- * are picked up during development.
59
- */
60
- invalidateDevelopmentGraph(): void;
61
- /**
62
- * Imports a page-like module from source.
63
- *
64
- * The caller controls the output directory and error wording so different
65
- * subsystems can reuse the same loading mechanism while preserving their
66
- * current diagnostics. Module identities stay stable for unchanged files and
67
- * roll forward automatically when the source hash changes during watch mode.
68
- *
69
- * @typeParam T Expected module shape.
70
- * @param options Runtime-specific import settings.
71
- * @returns The loaded module.
72
- */
73
- importModule<T = unknown>(options: PageModuleImportOptions): Promise<T>;
74
- private loadModule;
75
- }
@@ -1,161 +0,0 @@
1
- import path from "node:path";
2
- import { pathToFileURL } from "node:url";
3
- import { fileSystem } from "@ecopages/file-system";
4
- import { build } from "../../build/build-adapter.js";
5
- class PageModuleImportService {
6
- dependencies;
7
- importCache = /* @__PURE__ */ new Map();
8
- developmentInvalidationVersion = 0;
9
- constructor(dependencies) {
10
- this.dependencies = {
11
- hashFile: dependencies?.hashFile ?? ((filePath) => fileSystem.hash(filePath)),
12
- buildModule: dependencies?.buildModule ?? ((options, buildExecutor) => build(options, buildExecutor)),
13
- canLoadSourceModuleFromHost: dependencies?.canLoadSourceModuleFromHost ?? supportsHostSourceModuleLoading,
14
- getHostModuleLoader: dependencies?.getHostModuleLoader ?? (() => void 0)
15
- };
16
- }
17
- /**
18
- * Clears the shared import cache used by framework-owned page-module loads.
19
- */
20
- clearImportCache() {
21
- this.importCache.clear();
22
- }
23
- /**
24
- * Invalidates all previously imported modules in development by clearing the
25
- * import cache and incrementing the invalidation version included in cache keys.
26
- *
27
- * This forces all modules to be reloaded on the next import, even if their
28
- * source content hasn't changed. This is necessary to ensure that changes to
29
- * non-content aspects of modules (e.g. dependencies, transpilation output)
30
- * are picked up during development.
31
- */
32
- invalidateDevelopmentGraph() {
33
- this.clearImportCache();
34
- this.developmentInvalidationVersion += 1;
35
- }
36
- /**
37
- * Imports a page-like module from source.
38
- *
39
- * The caller controls the output directory and error wording so different
40
- * subsystems can reuse the same loading mechanism while preserving their
41
- * current diagnostics. Module identities stay stable for unchanged files and
42
- * roll forward automatically when the source hash changes during watch mode.
43
- *
44
- * @typeParam T Expected module shape.
45
- * @param options Runtime-specific import settings.
46
- * @returns The loaded module.
47
- */
48
- async importModule(options) {
49
- const { filePath, rootDir, externalPackages, splitting } = options;
50
- const invalidationVersion = options.invalidationVersion ?? this.developmentInvalidationVersion;
51
- const fileHash = this.dependencies.hashFile(filePath);
52
- const hostModuleLoader = typeof Bun === "undefined" && process.env.NODE_ENV === "development" && this.dependencies.canLoadSourceModuleFromHost(filePath) ? this.dependencies.getHostModuleLoader() : void 0;
53
- if (hostModuleLoader) {
54
- const sourceModuleUrl = createRuntimeModuleUrl(filePath, fileHash, invalidationVersion);
55
- return await hostModuleLoader(sourceModuleUrl.href);
56
- }
57
- if (options.bypassCache) {
58
- this.developmentInvalidationVersion += 1;
59
- return await this.loadModule({
60
- ...options,
61
- invalidationVersion: this.developmentInvalidationVersion,
62
- fileHash
63
- });
64
- }
65
- const runtime = typeof Bun !== "undefined" ? "bun" : "node-build";
66
- const cacheKey = [
67
- runtime,
68
- filePath,
69
- rootDir,
70
- splitting ?? "default",
71
- externalPackages ?? "default",
72
- fileHash,
73
- invalidationVersion
74
- ].join("::");
75
- const cachedModule = this.importCache.get(cacheKey);
76
- if (cachedModule) {
77
- return await cachedModule;
78
- }
79
- const importPromise = this.loadModule({
80
- ...options,
81
- fileHash
82
- });
83
- this.importCache.set(cacheKey, importPromise);
84
- try {
85
- return await importPromise;
86
- } catch (error) {
87
- this.importCache.delete(cacheKey);
88
- throw error;
89
- }
90
- }
91
- async loadModule(options) {
92
- const {
93
- filePath,
94
- rootDir,
95
- outdir,
96
- invalidationVersion = this.developmentInvalidationVersion,
97
- splitting,
98
- externalPackages,
99
- transpileErrorMessage = (details) => `Error transpiling page module: ${details}`,
100
- noOutputMessage = (targetFilePath) => `No transpiled output generated for page module: ${targetFilePath}`,
101
- fileHash
102
- } = options;
103
- const sourceModuleUrl = createRuntimeModuleUrl(filePath, fileHash, invalidationVersion);
104
- if (typeof Bun !== "undefined") {
105
- return await import(
106
- /* @vite-ignore */
107
- sourceModuleUrl.href
108
- );
109
- }
110
- const fileBaseName = path.basename(filePath, path.extname(filePath));
111
- const outputFileName = `${fileBaseName}-${fileHash}.js`;
112
- const buildResult = await this.dependencies.buildModule(
113
- {
114
- entrypoints: [filePath],
115
- root: rootDir,
116
- outdir,
117
- target: "es2022",
118
- format: "esm",
119
- sourcemap: "none",
120
- splitting: splitting ?? true,
121
- minify: false,
122
- naming: outputFileName,
123
- externalPackages: true,
124
- plugins: options.plugins,
125
- ...externalPackages !== void 0 ? { externalPackages } : {}
126
- },
127
- options.buildExecutor
128
- );
129
- if (!buildResult.success) {
130
- const details = buildResult.logs.map((log) => log.message).join(" | ");
131
- throw new Error(transpileErrorMessage(details));
132
- }
133
- const preferredOutputPath = path.join(outdir, outputFileName);
134
- const compiledOutput = buildResult.outputs.find((output) => output.path === preferredOutputPath)?.path ?? buildResult.outputs.find((output) => output.path.endsWith(".js"))?.path;
135
- if (!compiledOutput) {
136
- throw new Error(noOutputMessage(filePath));
137
- }
138
- const compiledOutputUrl = pathToFileURL(compiledOutput);
139
- if (process.env.NODE_ENV === "development") {
140
- compiledOutputUrl.searchParams.set("update", `${fileHash}-${invalidationVersion}`);
141
- }
142
- return await import(
143
- /* @vite-ignore */
144
- compiledOutputUrl.href
145
- );
146
- }
147
- }
148
- function createRuntimeModuleUrl(filePath, fileHash, invalidationVersion) {
149
- const moduleUrl = pathToFileURL(filePath);
150
- if (process.env.NODE_ENV === "development") {
151
- moduleUrl.searchParams.set("update", `${fileHash}-${invalidationVersion}`);
152
- }
153
- return moduleUrl;
154
- }
155
- function supportsHostSourceModuleLoading(filePath) {
156
- const extension = path.extname(filePath);
157
- return extension === ".js" || extension === ".jsx" || extension === ".ts" || extension === ".tsx" || extension === ".mjs" || extension === ".mts" || extension === ".cjs" || extension === ".cts";
158
- }
159
- export {
160
- PageModuleImportService
161
- };
@@ -1,72 +0,0 @@
1
- import type { BuildExecutor } from '../../build/build-adapter.js';
2
- import type { EcoBuildPlugin } from '../../build/build-types.js';
3
- import { type PageModuleImportOptions } from './page-module-import.service.js';
4
- import type { SourceModuleLoaderFactory } from './module-loading-types.js';
5
- export type ServerModuleTranspilerOptions = Omit<PageModuleImportOptions, 'rootDir' | 'buildExecutor'>;
6
- /**
7
- * Minimal import-service dependency required by the server module transpiler.
8
- *
9
- * @remarks
10
- * This keeps the transpiler boundary testable without module-level mocking and
11
- * lets callers provide an app-owned import implementation when needed.
12
- */
13
- export interface ServerModuleImportDependency {
14
- importModule<T = unknown>(options: PageModuleImportOptions): Promise<T>;
15
- invalidateDevelopmentGraph(): void;
16
- }
17
- /**
18
- * Immutable execution context for one server-transpiler instance.
19
- *
20
- * @remarks
21
- * Callers own when and why a new transpiler is created. This service only owns
22
- * applying the supplied root/build-executor pair consistently to every module
23
- * load that passes through it.
24
- */
25
- export type ServerModuleTranspilerBootstrapArgs = {
26
- rootDir: string;
27
- getBuildExecutor: () => BuildExecutor | undefined;
28
- canLoadSourceModuleFromHost?: (filePath: string) => boolean;
29
- getHostModuleLoader?: SourceModuleLoaderFactory;
30
- getInvalidationVersion?: () => number;
31
- invalidateModules?: (changedFiles?: string[]) => void;
32
- pageModuleImportService?: ServerModuleImportDependency;
33
- /** Factory evaluated on each importModule call to produce plugins applied to every load. */
34
- getDefaultPlugins?: () => EcoBuildPlugin[];
35
- };
36
- /**
37
- * App-owned boundary for server-side source module loading.
38
- *
39
- * @remarks
40
- * This service centralizes server-side module transpilation and import behind
41
- * an explicit caller-owned root and build executor.
42
- */
43
- export declare class ServerModuleTranspiler {
44
- private readonly pageModuleImportService;
45
- private readonly getRootDir;
46
- private readonly getBuildExecutor;
47
- private readonly getInvalidationVersion;
48
- private readonly invalidateModules;
49
- private readonly getDefaultPlugins;
50
- /**
51
- * Creates one explicit server-transpiler boundary for a given execution
52
- * context.
53
- */
54
- constructor(args: ServerModuleTranspilerBootstrapArgs);
55
- /**
56
- * Loads a server-side source module through the caller-owned transpile
57
- * context.
58
- */
59
- importModule<T = unknown>(options: ServerModuleTranspilerOptions): Promise<T>;
60
- /**
61
- * Invalidates cached module state for development reloads.
62
- */
63
- invalidate(changedFiles?: string[]): void;
64
- /**
65
- * Releases transpiler-owned resources.
66
- *
67
- * @remarks
68
- * The current implementation delegates cache ownership to lower-level module
69
- * loading services, so disposal is intentionally a no-op for now.
70
- */
71
- dispose(): Promise<void>;
72
- }
@@ -1,64 +0,0 @@
1
- import { PageModuleImportService } from "./page-module-import.service.js";
2
- class ServerModuleTranspiler {
3
- pageModuleImportService;
4
- getRootDir;
5
- getBuildExecutor;
6
- getInvalidationVersion;
7
- invalidateModules;
8
- getDefaultPlugins;
9
- /**
10
- * Creates one explicit server-transpiler boundary for a given execution
11
- * context.
12
- */
13
- constructor(args) {
14
- this.pageModuleImportService = args.pageModuleImportService ?? new PageModuleImportService({
15
- canLoadSourceModuleFromHost: args.canLoadSourceModuleFromHost,
16
- getHostModuleLoader: args.getHostModuleLoader
17
- });
18
- this.getRootDir = () => args.rootDir;
19
- this.getBuildExecutor = args.getBuildExecutor;
20
- this.getInvalidationVersion = () => args.getInvalidationVersion?.();
21
- this.getDefaultPlugins = args.getDefaultPlugins ?? (() => []);
22
- this.invalidateModules = (changedFiles) => {
23
- if (args.invalidateModules) {
24
- args.invalidateModules(changedFiles);
25
- return;
26
- }
27
- this.pageModuleImportService.invalidateDevelopmentGraph();
28
- };
29
- }
30
- /**
31
- * Loads a server-side source module through the caller-owned transpile
32
- * context.
33
- */
34
- async importModule(options) {
35
- const mergedPlugins = [...this.getDefaultPlugins(), ...options.plugins ?? []];
36
- const { plugins: _plugins, ...baseOptions } = options;
37
- return await this.pageModuleImportService.importModule({
38
- ...baseOptions,
39
- ...mergedPlugins.length > 0 ? { plugins: mergedPlugins } : {},
40
- rootDir: this.getRootDir(),
41
- buildExecutor: this.getBuildExecutor(),
42
- invalidationVersion: this.getInvalidationVersion()
43
- });
44
- }
45
- /**
46
- * Invalidates cached module state for development reloads.
47
- */
48
- invalidate(changedFiles) {
49
- this.invalidateModules(changedFiles);
50
- }
51
- /**
52
- * Releases transpiler-owned resources.
53
- *
54
- * @remarks
55
- * The current implementation delegates cache ownership to lower-level module
56
- * loading services, so disposal is intentionally a no-op for now.
57
- */
58
- async dispose() {
59
- return;
60
- }
61
- }
62
- export {
63
- ServerModuleTranspiler
64
- };
@@ -1,118 +0,0 @@
1
- import type { EcoPagesAppConfig } from '../../types/internal-types.js';
2
- import { type ServerInvalidationState } from './server-invalidation-state.service.js';
3
- import { type EntrypointDependencyGraph } from './entrypoint-dependency-graph.service.js';
4
- /**
5
- * Tracks development-time dependency relationships and invalidation state for
6
- * one Ecopages app instance.
7
- *
8
- * @remarks
9
- * The current contract stays intentionally small. It supports today's needs for
10
- * server-module cache invalidation and entrypoint-to-dependency lookups without
11
- * forcing the rest of the runtime to know about one specific graph
12
- * implementation.
13
- */
14
- export interface DevGraphService extends ServerInvalidationState, EntrypointDependencyGraph {
15
- }
16
- /**
17
- * Minimal dev-graph implementation used when an app has no selective graph
18
- * metadata available.
19
- *
20
- * @remarks
21
- * This preserves correct behavior by using coarse invalidation version bumps.
22
- * Callers still pass changed-file information through the interface now so a
23
- * richer graph can become more selective later without changing call sites.
24
- */
25
- export declare class NoopDevGraphService implements DevGraphService {
26
- private readonly invalidationState;
27
- private readonly dependencyGraph;
28
- /**
29
- * Returns the current coarse invalidation version.
30
- */
31
- getServerInvalidationVersion(): number;
32
- /**
33
- * Invalidates all server-side module state by incrementing the shared version.
34
- */
35
- invalidateServerModules(changedFiles?: string[]): void;
36
- /**
37
- * Indicates that this graph cannot target invalidation to one entrypoint set.
38
- */
39
- supportsSelectiveInvalidation(): boolean;
40
- /**
41
- * Returns an empty entrypoint set because this implementation stores no
42
- * dependency graph metadata.
43
- */
44
- getDependencyEntrypoints(filePath: string): Set<string>;
45
- /**
46
- * Accepts dependency updates to preserve interface compatibility, but stores no
47
- * graph state in the noop implementation.
48
- */
49
- setEntrypointDependencies(entrypointPath: string, dependencies: string[]): void;
50
- /**
51
- * Clears one entrypoint from the graph.
52
- *
53
- * @remarks
54
- * There is no stored graph state in this implementation, so this is a no-op.
55
- */
56
- clearEntrypointDependencies(entrypointPath: string): void;
57
- /**
58
- * Resets graph-owned state for a fresh runtime cycle.
59
- */
60
- reset(): void;
61
- }
62
- /**
63
- * In-memory development graph with entrypoint-to-dependency reverse lookups.
64
- *
65
- * @remarks
66
- * This is the current selective graph implementation used by development flows
67
- * that need to answer which entrypoints depend on a changed file while still
68
- * keeping invalidation state app-local.
69
- */
70
- export declare class InMemoryDevGraphService implements DevGraphService {
71
- private readonly invalidationState;
72
- private readonly dependencyGraph;
73
- /**
74
- * Returns the current app-local server invalidation version.
75
- */
76
- getServerInvalidationVersion(): number;
77
- /**
78
- * Invalidates the current server-module cache generation.
79
- *
80
- * @remarks
81
- * The current implementation still uses a coarse generation bump for server
82
- * modules. Selective dependency lookups are used by callers that need to limit
83
- * browser rebuild work.
84
- */
85
- invalidateServerModules(changedFiles?: string[]): void;
86
- /**
87
- * Indicates that this graph can answer dependency-to-entrypoint lookups.
88
- */
89
- supportsSelectiveInvalidation(): boolean;
90
- /**
91
- * Returns all known entrypoints that currently depend on the given file.
92
- */
93
- getDependencyEntrypoints(filePath: string): Set<string>;
94
- /**
95
- * Replaces the stored dependency set for one entrypoint.
96
- *
97
- * @remarks
98
- * The entrypoint itself is always included in its own dependency set so reverse
99
- * lookups can map a changed entry file back to that same entrypoint.
100
- */
101
- setEntrypointDependencies(entrypointPath: string, dependencies: string[]): void;
102
- /**
103
- * Removes one entrypoint and all of its reverse dependency edges.
104
- */
105
- clearEntrypointDependencies(entrypointPath: string): void;
106
- /**
107
- * Clears all graph state and starts a fresh invalidation generation.
108
- */
109
- reset(): void;
110
- }
111
- /**
112
- * Returns the dev-graph service owned by one app instance.
113
- */
114
- export declare function getAppDevGraphService(appConfig: EcoPagesAppConfig): DevGraphService;
115
- /**
116
- * Installs the dev-graph service that should back one app/runtime instance.
117
- */
118
- export declare function setAppDevGraphService(appConfig: EcoPagesAppConfig, devGraphService: DevGraphService): void;