@ecopages/core 0.2.0-alpha.2 → 0.2.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/CHANGELOG.md +26 -64
  2. package/README.md +212 -14
  3. package/package.json +116 -66
  4. package/src/adapters/README.md +39 -0
  5. package/src/adapters/abstract/application-adapter.d.ts +28 -2
  6. package/src/adapters/abstract/application-adapter.js +14 -2
  7. package/src/adapters/abstract/router-adapter.d.ts +1 -1
  8. package/src/adapters/abstract/server-adapter.d.ts +2 -2
  9. package/src/adapters/bun/client-bridge.d.ts +1 -1
  10. package/src/adapters/bun/create-app.d.ts +4 -12
  11. package/src/adapters/bun/create-app.js +4 -5
  12. package/src/adapters/bun/hmr-manager.d.ts +80 -21
  13. package/src/adapters/bun/hmr-manager.js +168 -62
  14. package/src/adapters/bun/index.d.ts +2 -3
  15. package/src/adapters/bun/index.js +3 -3
  16. package/src/adapters/bun/server-adapter.d.ts +5 -5
  17. package/src/adapters/bun/server-adapter.js +40 -34
  18. package/src/adapters/bun/server-lifecycle.d.ts +28 -17
  19. package/src/adapters/bun/server-lifecycle.js +34 -62
  20. package/src/{create-app.d.ts → adapters/create-app.d.ts} +9 -6
  21. package/src/{create-app.js → adapters/create-app.js} +4 -4
  22. package/src/adapters/index.d.ts +2 -6
  23. package/src/adapters/index.js +2 -8
  24. package/src/adapters/node/create-app.d.ts +6 -9
  25. package/src/adapters/node/create-app.js +12 -6
  26. package/src/adapters/node/node-client-bridge.d.ts +1 -1
  27. package/src/adapters/node/node-hmr-manager.d.ts +89 -18
  28. package/src/adapters/node/node-hmr-manager.js +185 -95
  29. package/src/adapters/node/server-adapter.d.ts +6 -35
  30. package/src/adapters/node/server-adapter.js +44 -105
  31. package/src/adapters/node/static-content-server.d.ts +37 -1
  32. package/src/adapters/node/static-content-server.js +29 -1
  33. package/src/adapters/shared/application-adapter.d.ts +1 -1
  34. package/src/{define-api-handler.d.ts → adapters/shared/define-api-handler.d.ts} +1 -1
  35. package/src/adapters/shared/explicit-static-route-matcher.d.ts +2 -2
  36. package/src/adapters/shared/explicit-static-route-matcher.js +4 -1
  37. package/src/adapters/shared/file-route-middleware-pipeline.d.ts +1 -1
  38. package/src/adapters/shared/file-route-middleware-pipeline.js +1 -0
  39. package/src/adapters/shared/fs-server-response-factory.d.ts +2 -2
  40. package/src/adapters/shared/fs-server-response-factory.js +1 -1
  41. package/src/adapters/shared/fs-server-response-matcher.d.ts +8 -12
  42. package/src/adapters/shared/fs-server-response-matcher.js +10 -18
  43. package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +55 -0
  44. package/src/adapters/shared/hmr-entrypoint-registrar.js +87 -0
  45. package/src/adapters/shared/hmr-html-response.d.ts +22 -0
  46. package/src/adapters/shared/hmr-html-response.js +32 -0
  47. package/src/adapters/shared/render-context.d.ts +2 -1
  48. package/src/adapters/shared/render-context.js +6 -3
  49. package/src/adapters/shared/runtime-bootstrap.d.ts +38 -0
  50. package/src/adapters/shared/runtime-bootstrap.js +43 -0
  51. package/src/adapters/shared/server-adapter.d.ts +13 -3
  52. package/src/adapters/shared/server-adapter.js +42 -5
  53. package/src/adapters/shared/server-route-handler.d.ts +4 -4
  54. package/src/adapters/shared/server-route-handler.js +6 -15
  55. package/src/adapters/shared/server-static-builder.d.ts +38 -6
  56. package/src/adapters/shared/server-static-builder.js +64 -10
  57. package/src/build/README.md +107 -0
  58. package/src/build/build-adapter.d.ts +168 -3
  59. package/src/build/build-adapter.js +604 -16
  60. package/src/build/build-manifest.d.ts +27 -0
  61. package/src/build/build-manifest.js +30 -0
  62. package/src/build/dev-build-coordinator.d.ts +72 -0
  63. package/src/build/dev-build-coordinator.js +154 -0
  64. package/src/build/esbuild-build-adapter.d.ts +15 -6
  65. package/src/build/esbuild-build-adapter.js +189 -74
  66. package/src/build/runtime-build-executor.d.ts +14 -0
  67. package/src/build/runtime-build-executor.js +22 -0
  68. package/src/build/runtime-specifier-alias-plugin.d.ts +15 -0
  69. package/src/build/runtime-specifier-alias-plugin.js +35 -0
  70. package/src/build/runtime-specifier-aliases.d.ts +5 -0
  71. package/src/build/runtime-specifier-aliases.js +95 -0
  72. package/src/config/README.md +36 -0
  73. package/src/config/config-builder.d.ts +52 -27
  74. package/src/config/config-builder.js +260 -49
  75. package/src/{constants.d.ts → config/constants.d.ts} +13 -0
  76. package/src/{constants.js → config/constants.js} +4 -0
  77. package/src/declarations.d.ts +19 -14
  78. package/src/dev/sc-server.d.ts +1 -1
  79. package/src/dev/sc-server.js +1 -1
  80. package/src/eco/README.md +70 -16
  81. package/src/eco/eco.browser.d.ts +2 -0
  82. package/src/eco/eco.browser.js +83 -0
  83. package/src/eco/eco.js +32 -57
  84. package/src/eco/eco.types.d.ts +12 -4
  85. package/src/eco/eco.utils.d.ts +1 -40
  86. package/src/eco/eco.utils.js +5 -35
  87. package/src/eco/global-injector-map.d.ts +1 -1
  88. package/src/eco/lazy-injector-map.d.ts +1 -1
  89. package/src/hmr/README.md +26 -0
  90. package/src/hmr/client/hmr-runtime.d.ts +1 -6
  91. package/src/hmr/client/hmr-runtime.js +30 -7
  92. package/src/hmr/hmr-strategy.d.ts +16 -13
  93. package/src/hmr/hmr-strategy.js +22 -7
  94. package/src/hmr/hmr.postcss.test.e2e.d.ts +1 -0
  95. package/src/hmr/hmr.postcss.test.e2e.js +31 -0
  96. package/src/hmr/hmr.test.e2e.js +26 -33
  97. package/src/hmr/strategies/default-hmr-strategy.d.ts +2 -2
  98. package/src/hmr/strategies/default-hmr-strategy.js +1 -1
  99. package/src/hmr/strategies/js-hmr-strategy.d.ts +46 -43
  100. package/src/hmr/strategies/js-hmr-strategy.js +72 -73
  101. package/src/index.browser.d.ts +2 -2
  102. package/src/index.browser.js +1 -1
  103. package/src/index.d.ts +4 -3
  104. package/src/index.js +16 -5
  105. package/src/integrations/ghtml/ghtml-renderer.d.ts +7 -2
  106. package/src/integrations/ghtml/ghtml-renderer.js +33 -30
  107. package/src/integrations/ghtml/ghtml.constants.d.ts +1 -0
  108. package/src/integrations/ghtml/ghtml.constants.js +4 -0
  109. package/src/integrations/ghtml/ghtml.plugin.d.ts +2 -6
  110. package/src/integrations/ghtml/ghtml.plugin.js +3 -4
  111. package/src/plugins/README.md +35 -0
  112. package/src/plugins/alias-resolver-plugin.js +17 -3
  113. package/src/plugins/eco-component-meta-plugin.d.ts +14 -1
  114. package/src/plugins/eco-component-meta-plugin.js +27 -21
  115. package/src/plugins/foreign-jsx-override-plugin.d.ts +31 -0
  116. package/src/plugins/foreign-jsx-override-plugin.js +35 -0
  117. package/src/plugins/integration-plugin.d.ts +145 -28
  118. package/src/plugins/integration-plugin.js +109 -13
  119. package/src/plugins/processor.d.ts +15 -2
  120. package/src/plugins/processor.js +16 -2
  121. package/src/plugins/runtime-capability.d.ts +9 -0
  122. package/src/plugins/source-transform.d.ts +46 -0
  123. package/src/plugins/source-transform.js +71 -0
  124. package/src/route-renderer/GRAPH.md +64 -98
  125. package/src/route-renderer/README.md +67 -46
  126. package/src/route-renderer/orchestration/boundary-planning.service.d.ts +25 -0
  127. package/src/route-renderer/orchestration/boundary-planning.service.js +97 -0
  128. package/src/route-renderer/orchestration/component-render-context.d.ts +83 -0
  129. package/src/route-renderer/orchestration/component-render-context.js +147 -0
  130. package/src/route-renderer/orchestration/integration-renderer.d.ts +554 -0
  131. package/src/route-renderer/orchestration/integration-renderer.js +957 -0
  132. package/src/route-renderer/orchestration/queued-boundary-runtime.service.d.ts +89 -0
  133. package/src/route-renderer/orchestration/queued-boundary-runtime.service.js +155 -0
  134. package/src/route-renderer/orchestration/render-execution.service.d.ts +43 -0
  135. package/src/route-renderer/orchestration/render-execution.service.js +106 -0
  136. package/src/{eco/eco.utils.ts → route-renderer/orchestration/render-output.utils.d.ts} +10 -53
  137. package/src/route-renderer/orchestration/render-output.utils.js +65 -0
  138. package/src/route-renderer/{render-preparation.service.d.ts → orchestration/render-preparation.service.d.ts} +18 -10
  139. package/src/route-renderer/{render-preparation.service.js → orchestration/render-preparation.service.js} +115 -17
  140. package/src/route-renderer/orchestration/route-shell-composer.service.d.ts +50 -0
  141. package/src/route-renderer/orchestration/route-shell-composer.service.js +81 -0
  142. package/src/route-renderer/orchestration/template-serialization.d.ts +38 -0
  143. package/src/route-renderer/orchestration/template-serialization.js +45 -0
  144. package/src/route-renderer/{dependency-resolver.d.ts → page-loading/dependency-resolver.d.ts} +15 -4
  145. package/src/route-renderer/{dependency-resolver.js → page-loading/dependency-resolver.js} +28 -12
  146. package/src/route-renderer/page-loading/page-module-loader.d.ts +90 -0
  147. package/src/route-renderer/{page-module-loader.js → page-loading/page-module-loader.js} +39 -14
  148. package/src/route-renderer/route-renderer.d.ts +45 -4
  149. package/src/route-renderer/route-renderer.js +38 -3
  150. package/src/router/README.md +97 -0
  151. package/src/router/client/link-intent.d.ts +53 -0
  152. package/src/router/client/link-intent.js +34 -0
  153. package/src/router/client/link-intent.test.browser.d.ts +1 -0
  154. package/src/router/client/link-intent.test.browser.js +43 -0
  155. package/src/router/client/navigation-coordinator.d.ts +149 -0
  156. package/src/router/client/navigation-coordinator.js +215 -0
  157. package/src/router/{fs-router-scanner.d.ts → server/fs-router-scanner.d.ts} +3 -3
  158. package/src/router/{fs-router-scanner.js → server/fs-router-scanner.js} +14 -8
  159. package/src/router/{fs-router.d.ts → server/fs-router.d.ts} +1 -1
  160. package/src/router/{fs-router.js → server/fs-router.js} +1 -1
  161. package/src/services/README.md +29 -0
  162. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +120 -0
  163. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset-processing.service.js +91 -10
  164. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset.factory.d.ts +1 -1
  165. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset.factory.js +2 -2
  166. package/src/services/{asset-processing-service → assets/asset-processing-service}/assets.types.d.ts +2 -1
  167. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +55 -0
  168. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +48 -0
  169. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +20 -0
  170. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +41 -0
  171. package/src/services/assets/asset-processing-service/index.d.ts +5 -0
  172. package/src/services/assets/asset-processing-service/index.js +5 -0
  173. package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.interface.d.ts +2 -2
  174. package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.registry.d.ts +2 -2
  175. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-processor.d.ts +1 -1
  176. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-processor.js +9 -4
  177. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-script-processor.d.ts +5 -4
  178. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-script-processor.js +15 -23
  179. package/src/services/assets/asset-processing-service/processors/index.d.ts +5 -0
  180. package/src/services/assets/asset-processing-service/processors/index.js +5 -0
  181. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/content-script.processor.d.ts +2 -2
  182. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/content-script.processor.js +1 -1
  183. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/file-script.processor.d.ts +4 -3
  184. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/file-script.processor.js +16 -4
  185. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/node-module-script.processor.d.ts +3 -3
  186. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/node-module-script.processor.js +6 -5
  187. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/content-stylesheet.processor.d.ts +2 -2
  188. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/content-stylesheet.processor.js +1 -1
  189. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/file-stylesheet.processor.d.ts +2 -2
  190. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/file-stylesheet.processor.js +5 -2
  191. package/src/services/assets/browser-bundle.service.d.ts +32 -0
  192. package/src/services/assets/browser-bundle.service.js +33 -0
  193. package/src/services/{page-request-cache-coordinator.service.d.ts → cache/page-request-cache-coordinator.service.d.ts} +2 -2
  194. package/src/services/{page-request-cache-coordinator.service.js → cache/page-request-cache-coordinator.service.js} +3 -1
  195. package/src/services/html/html-rewriter-provider.service.d.ts +37 -0
  196. package/src/services/html/html-rewriter-provider.service.js +68 -0
  197. package/src/services/html/html-transformer.service.d.ts +77 -0
  198. package/src/services/html/html-transformer.service.js +215 -0
  199. package/src/services/invalidation/development-invalidation.service.d.ts +74 -0
  200. package/src/services/invalidation/development-invalidation.service.js +190 -0
  201. package/src/services/module-loading/app-module-loader.service.d.ts +28 -0
  202. package/src/services/module-loading/app-module-loader.service.js +35 -0
  203. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +24 -0
  204. package/src/services/module-loading/app-server-module-transpiler.service.js +109 -0
  205. package/src/services/module-loading/host-module-loader-registry.d.ts +4 -0
  206. package/src/services/module-loading/host-module-loader-registry.js +15 -0
  207. package/src/services/module-loading/module-loading-types.d.ts +2 -0
  208. package/src/services/module-loading/node-bootstrap-plugin.d.ts +42 -0
  209. package/src/services/module-loading/node-bootstrap-plugin.js +204 -0
  210. package/src/services/module-loading/page-module-import.service.d.ts +76 -0
  211. package/src/services/module-loading/page-module-import.service.js +173 -0
  212. package/src/services/module-loading/server-module-transpiler.service.d.ts +72 -0
  213. package/src/services/module-loading/server-module-transpiler.service.js +64 -0
  214. package/src/services/runtime-state/dev-graph.service.d.ts +118 -0
  215. package/src/services/runtime-state/dev-graph.service.js +162 -0
  216. package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +41 -0
  217. package/src/services/runtime-state/entrypoint-dependency-graph.service.js +85 -0
  218. package/src/services/runtime-state/runtime-specifier-registry.service.d.ts +69 -0
  219. package/src/services/runtime-state/runtime-specifier-registry.service.js +37 -0
  220. package/src/services/runtime-state/server-invalidation-state.service.d.ts +26 -0
  221. package/src/services/runtime-state/server-invalidation-state.service.js +35 -0
  222. package/src/services/{schema-validation-service.d.ts → validation/schema-validation-service.d.ts} +1 -1
  223. package/src/static-site-generator/README.md +26 -0
  224. package/src/static-site-generator/static-site-generator.d.ts +50 -3
  225. package/src/static-site-generator/static-site-generator.js +71 -5
  226. package/src/{internal-types.d.ts → types/internal-types.d.ts} +53 -22
  227. package/src/types/internal-types.js +0 -0
  228. package/src/{public-types.d.ts → types/public-types.d.ts} +146 -21
  229. package/src/types/public-types.js +0 -0
  230. package/src/utils/html-escaping.d.ts +7 -0
  231. package/src/utils/html-escaping.js +6 -0
  232. package/src/utils/locals-utils.d.ts +1 -1
  233. package/src/utils/parse-cli-args.d.ts +4 -1
  234. package/src/utils/parse-cli-args.js +16 -1
  235. package/src/utils/resolve-work-dir.d.ts +11 -0
  236. package/src/utils/resolve-work-dir.js +31 -0
  237. package/src/watchers/project-watcher.d.ts +40 -24
  238. package/src/watchers/project-watcher.js +129 -92
  239. package/src/watchers/project-watcher.test-helpers.d.ts +2 -2
  240. package/src/watchers/project-watcher.test-helpers.js +1 -0
  241. package/src/adapters/abstract/application-adapter.ts +0 -337
  242. package/src/adapters/abstract/router-adapter.ts +0 -30
  243. package/src/adapters/abstract/server-adapter.ts +0 -79
  244. package/src/adapters/bun/client-bridge.ts +0 -62
  245. package/src/adapters/bun/create-app.ts +0 -189
  246. package/src/adapters/bun/define-api-handler.d.ts +0 -61
  247. package/src/adapters/bun/define-api-handler.ts +0 -114
  248. package/src/adapters/bun/hmr-manager.ts +0 -281
  249. package/src/adapters/bun/index.ts +0 -3
  250. package/src/adapters/bun/server-adapter.ts +0 -492
  251. package/src/adapters/bun/server-lifecycle.ts +0 -154
  252. package/src/adapters/index.ts +0 -6
  253. package/src/adapters/node/create-app.ts +0 -179
  254. package/src/adapters/node/index.d.ts +0 -4
  255. package/src/adapters/node/index.js +0 -8
  256. package/src/adapters/node/index.ts +0 -9
  257. package/src/adapters/node/node-client-bridge.ts +0 -79
  258. package/src/adapters/node/node-hmr-manager.ts +0 -271
  259. package/src/adapters/node/server-adapter.ts +0 -561
  260. package/src/adapters/node/static-content-server.ts +0 -203
  261. package/src/adapters/shared/api-response.ts +0 -104
  262. package/src/adapters/shared/application-adapter.ts +0 -199
  263. package/src/adapters/shared/explicit-static-route-matcher.ts +0 -134
  264. package/src/adapters/shared/file-route-middleware-pipeline.ts +0 -123
  265. package/src/adapters/shared/fs-server-response-factory.ts +0 -118
  266. package/src/adapters/shared/fs-server-response-matcher.ts +0 -198
  267. package/src/adapters/shared/render-context.ts +0 -105
  268. package/src/adapters/shared/server-adapter.ts +0 -442
  269. package/src/adapters/shared/server-route-handler.ts +0 -166
  270. package/src/adapters/shared/server-static-builder.ts +0 -82
  271. package/src/build/build-adapter.ts +0 -132
  272. package/src/build/build-types.ts +0 -83
  273. package/src/build/esbuild-build-adapter.ts +0 -510
  274. package/src/config/config-builder.ts +0 -474
  275. package/src/constants.ts +0 -39
  276. package/src/create-app.ts +0 -87
  277. package/src/define-api-handler.js +0 -15
  278. package/src/define-api-handler.ts +0 -66
  279. package/src/dev/sc-server.ts +0 -143
  280. package/src/eco/component-render-context.d.ts +0 -105
  281. package/src/eco/component-render-context.js +0 -77
  282. package/src/eco/component-render-context.ts +0 -202
  283. package/src/eco/eco.ts +0 -221
  284. package/src/eco/eco.types.ts +0 -202
  285. package/src/eco/global-injector-map.ts +0 -112
  286. package/src/eco/lazy-injector-map.ts +0 -120
  287. package/src/eco/module-dependencies.ts +0 -75
  288. package/src/errors/http-error.ts +0 -72
  289. package/src/errors/index.ts +0 -2
  290. package/src/errors/locals-access-error.ts +0 -7
  291. package/src/global/app-logger.ts +0 -4
  292. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-HMR-Server-Integration-should-have-HMR-script-injected-in-page-1.png +0 -0
  293. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-HMR-Server-Integration-should-load-fixture-app-page-1.png +0 -0
  294. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-WebSocket-Connection-should-connect-to-correct-HMR-endpoint-1.png +0 -0
  295. package/src/hmr/client/hmr-runtime.ts +0 -121
  296. package/src/hmr/hmr-strategy.ts +0 -172
  297. package/src/hmr/hmr.test.e2e.ts +0 -75
  298. package/src/hmr/strategies/default-hmr-strategy.ts +0 -60
  299. package/src/hmr/strategies/js-hmr-strategy.ts +0 -308
  300. package/src/index.browser.ts +0 -3
  301. package/src/index.ts +0 -5
  302. package/src/integrations/ghtml/ghtml-renderer.ts +0 -93
  303. package/src/integrations/ghtml/ghtml.plugin.ts +0 -32
  304. package/src/internal-types.ts +0 -212
  305. package/src/plugins/alias-resolver-plugin.ts +0 -45
  306. package/src/plugins/eco-component-meta-plugin.ts +0 -474
  307. package/src/plugins/integration-plugin.ts +0 -184
  308. package/src/plugins/processor.ts +0 -220
  309. package/src/public-types.ts +0 -1255
  310. package/src/route-renderer/component-graph-executor.d.ts +0 -32
  311. package/src/route-renderer/component-graph-executor.js +0 -31
  312. package/src/route-renderer/component-graph-executor.ts +0 -84
  313. package/src/route-renderer/component-graph.d.ts +0 -42
  314. package/src/route-renderer/component-graph.js +0 -72
  315. package/src/route-renderer/component-graph.ts +0 -159
  316. package/src/route-renderer/component-marker.d.ts +0 -52
  317. package/src/route-renderer/component-marker.js +0 -46
  318. package/src/route-renderer/component-marker.ts +0 -117
  319. package/src/route-renderer/dependency-resolver.ts +0 -596
  320. package/src/route-renderer/html-post-processing.service.d.ts +0 -40
  321. package/src/route-renderer/html-post-processing.service.js +0 -86
  322. package/src/route-renderer/html-post-processing.service.ts +0 -103
  323. package/src/route-renderer/integration-renderer.d.ts +0 -339
  324. package/src/route-renderer/integration-renderer.js +0 -526
  325. package/src/route-renderer/integration-renderer.ts +0 -696
  326. package/src/route-renderer/marker-graph-resolver.d.ts +0 -76
  327. package/src/route-renderer/marker-graph-resolver.js +0 -93
  328. package/src/route-renderer/marker-graph-resolver.ts +0 -153
  329. package/src/route-renderer/page-module-loader.d.ts +0 -61
  330. package/src/route-renderer/page-module-loader.ts +0 -153
  331. package/src/route-renderer/render-execution.service.d.ts +0 -69
  332. package/src/route-renderer/render-execution.service.js +0 -91
  333. package/src/route-renderer/render-execution.service.ts +0 -158
  334. package/src/route-renderer/render-preparation.service.ts +0 -358
  335. package/src/route-renderer/route-renderer.ts +0 -80
  336. package/src/router/fs-router-scanner.ts +0 -217
  337. package/src/router/fs-router.ts +0 -122
  338. package/src/services/asset-processing-service/asset-processing.service.d.ts +0 -41
  339. package/src/services/asset-processing-service/asset-processing.service.ts +0 -306
  340. package/src/services/asset-processing-service/asset.factory.ts +0 -105
  341. package/src/services/asset-processing-service/assets.types.ts +0 -112
  342. package/src/services/asset-processing-service/index.d.ts +0 -3
  343. package/src/services/asset-processing-service/index.js +0 -3
  344. package/src/services/asset-processing-service/index.ts +0 -3
  345. package/src/services/asset-processing-service/processor.interface.ts +0 -27
  346. package/src/services/asset-processing-service/processor.registry.ts +0 -18
  347. package/src/services/asset-processing-service/processors/base/base-processor.ts +0 -76
  348. package/src/services/asset-processing-service/processors/base/base-script-processor.ts +0 -105
  349. package/src/services/asset-processing-service/processors/index.d.ts +0 -5
  350. package/src/services/asset-processing-service/processors/index.js +0 -5
  351. package/src/services/asset-processing-service/processors/index.ts +0 -5
  352. package/src/services/asset-processing-service/processors/script/content-script.processor.ts +0 -66
  353. package/src/services/asset-processing-service/processors/script/file-script.processor.ts +0 -88
  354. package/src/services/asset-processing-service/processors/script/node-module-script.processor.ts +0 -84
  355. package/src/services/asset-processing-service/processors/stylesheet/content-stylesheet.processor.ts +0 -27
  356. package/src/services/asset-processing-service/processors/stylesheet/file-stylesheet.processor.ts +0 -77
  357. package/src/services/cache/cache.types.ts +0 -126
  358. package/src/services/cache/index.ts +0 -18
  359. package/src/services/cache/memory-cache-store.ts +0 -130
  360. package/src/services/cache/page-cache-service.ts +0 -202
  361. package/src/services/html-transformer.service.d.ts +0 -50
  362. package/src/services/html-transformer.service.js +0 -163
  363. package/src/services/html-transformer.service.ts +0 -217
  364. package/src/services/page-module-import.service.d.ts +0 -37
  365. package/src/services/page-module-import.service.js +0 -88
  366. package/src/services/page-module-import.service.ts +0 -129
  367. package/src/services/page-request-cache-coordinator.service.ts +0 -128
  368. package/src/services/schema-validation-service.ts +0 -204
  369. package/src/services/validation/standard-schema.types.ts +0 -68
  370. package/src/static-site-generator/static-site-generator.ts +0 -359
  371. package/src/utils/css.d.ts +0 -1
  372. package/src/utils/css.js +0 -7
  373. package/src/utils/css.ts +0 -5
  374. package/src/utils/deep-merge.ts +0 -47
  375. package/src/utils/hash.ts +0 -5
  376. package/src/utils/html.ts +0 -1
  377. package/src/utils/invariant.ts +0 -15
  378. package/src/utils/locals-utils.ts +0 -37
  379. package/src/utils/parse-cli-args.ts +0 -83
  380. package/src/utils/path-utils.module.ts +0 -14
  381. package/src/utils/runtime.ts +0 -44
  382. package/src/utils/server-utils.module.ts +0 -67
  383. package/src/watchers/project-watcher.test-helpers.ts +0 -40
  384. package/src/watchers/project-watcher.ts +0 -306
  385. /package/src/adapters/{bun → shared}/define-api-handler.js +0 -0
  386. /package/src/{internal-types.js → plugins/runtime-capability.js} +0 -0
  387. /package/src/services/{asset-processing-service → assets/asset-processing-service}/assets.types.js +0 -0
  388. /package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.interface.js +0 -0
  389. /package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.registry.js +0 -0
  390. /package/src/{public-types.js → services/module-loading/module-loading-types.js} +0 -0
  391. /package/src/services/{schema-validation-service.js → validation/schema-validation-service.js} +0 -0
@@ -0,0 +1,85 @@
1
+ import path from "node:path";
2
+ class NoopEntrypointDependencyGraph {
3
+ supportsSelectiveInvalidation() {
4
+ return false;
5
+ }
6
+ getDependencyEntrypoints(_filePath) {
7
+ return /* @__PURE__ */ new Set();
8
+ }
9
+ setEntrypointDependencies(_entrypointPath, _dependencies) {
10
+ }
11
+ clearEntrypointDependencies(_entrypointPath) {
12
+ }
13
+ reset() {
14
+ }
15
+ }
16
+ class InMemoryEntrypointDependencyGraph {
17
+ dependencyEntrypoints = /* @__PURE__ */ new Map();
18
+ entrypointDependencies = /* @__PURE__ */ new Map();
19
+ supportsSelectiveInvalidation() {
20
+ return true;
21
+ }
22
+ getDependencyEntrypoints(filePath) {
23
+ return new Set(this.dependencyEntrypoints.get(path.resolve(filePath)) ?? []);
24
+ }
25
+ setEntrypointDependencies(entrypointPath, dependencies) {
26
+ const normalizedEntrypoint = path.resolve(entrypointPath);
27
+ this.clearEntrypointDependencies(normalizedEntrypoint);
28
+ const normalizedDependencies = /* @__PURE__ */ new Set([
29
+ normalizedEntrypoint,
30
+ ...dependencies.map((dependencyPath) => path.resolve(dependencyPath))
31
+ ]);
32
+ this.entrypointDependencies.set(normalizedEntrypoint, normalizedDependencies);
33
+ for (const dependencyPath of normalizedDependencies) {
34
+ const entrypoints = this.dependencyEntrypoints.get(dependencyPath) ?? /* @__PURE__ */ new Set();
35
+ entrypoints.add(normalizedEntrypoint);
36
+ this.dependencyEntrypoints.set(dependencyPath, entrypoints);
37
+ }
38
+ }
39
+ clearEntrypointDependencies(entrypointPath) {
40
+ const normalizedEntrypoint = path.resolve(entrypointPath);
41
+ const previousDependencies = this.entrypointDependencies.get(normalizedEntrypoint);
42
+ if (!previousDependencies) {
43
+ return;
44
+ }
45
+ for (const dependencyPath of previousDependencies) {
46
+ const entrypoints = this.dependencyEntrypoints.get(dependencyPath);
47
+ if (!entrypoints) {
48
+ continue;
49
+ }
50
+ entrypoints.delete(normalizedEntrypoint);
51
+ if (entrypoints.size === 0) {
52
+ this.dependencyEntrypoints.delete(dependencyPath);
53
+ }
54
+ }
55
+ this.entrypointDependencies.delete(normalizedEntrypoint);
56
+ }
57
+ reset() {
58
+ this.dependencyEntrypoints.clear();
59
+ this.entrypointDependencies.clear();
60
+ }
61
+ }
62
+ function isLegacyEntrypointDependencyGraph(value) {
63
+ return Boolean(value) && typeof value === "object" && typeof value.supportsSelectiveInvalidation === "function" && typeof value.getDependencyEntrypoints === "function" && typeof value.setEntrypointDependencies === "function" && typeof value.clearEntrypointDependencies === "function" && typeof value.reset === "function";
64
+ }
65
+ function getAppEntrypointDependencyGraph(appConfig) {
66
+ if (appConfig.runtime?.entrypointDependencyGraph) {
67
+ return appConfig.runtime.entrypointDependencyGraph;
68
+ }
69
+ if (isLegacyEntrypointDependencyGraph(appConfig.runtime?.devGraphService)) {
70
+ return appConfig.runtime.devGraphService;
71
+ }
72
+ return new NoopEntrypointDependencyGraph();
73
+ }
74
+ function setAppEntrypointDependencyGraph(appConfig, entrypointDependencyGraph) {
75
+ appConfig.runtime = {
76
+ ...appConfig.runtime ?? {},
77
+ entrypointDependencyGraph
78
+ };
79
+ }
80
+ export {
81
+ InMemoryEntrypointDependencyGraph,
82
+ NoopEntrypointDependencyGraph,
83
+ getAppEntrypointDependencyGraph,
84
+ setAppEntrypointDependencyGraph
85
+ };
@@ -0,0 +1,69 @@
1
+ import type { EcoPagesAppConfig } from '../../types/internal-types.js';
2
+ /**
3
+ * Stores runtime-visible bare-specifier mappings for one app instance.
4
+ *
5
+ * @remarks
6
+ * Integrations populate this registry during runtime setup when they expose
7
+ * browser runtime modules through stable bare imports. Build and HMR code later
8
+ * consume the collected map to create aliasing and bootstrap behavior without
9
+ * forcing integrations to own global registry state.
10
+ */
11
+ export interface RuntimeSpecifierRegistry {
12
+ /**
13
+ * Merges a new batch of specifier mappings into the registry.
14
+ *
15
+ * @remarks
16
+ * Later registrations replace earlier URLs for the same specifier. This keeps
17
+ * runtime setup deterministic while still allowing an integration to refresh
18
+ * its own declarations during one app session.
19
+ */
20
+ register(map: Record<string, string>): void;
21
+ /**
22
+ * Returns the current registry contents.
23
+ *
24
+ * @remarks
25
+ * The returned map is the live backing map for the registry implementation, so
26
+ * callers should treat it as read-only unless they intentionally own registry
27
+ * mutation semantics.
28
+ */
29
+ getAll(): Map<string, string>;
30
+ /**
31
+ * Removes all registered specifiers for the current app/runtime instance.
32
+ */
33
+ clear(): void;
34
+ }
35
+ /**
36
+ * Default in-memory runtime specifier registry used by core.
37
+ *
38
+ * @remarks
39
+ * Runtime specifier maps are app-local bootstrap metadata, not durable build
40
+ * artifacts, so the default implementation stays intentionally small.
41
+ */
42
+ export declare class InMemoryRuntimeSpecifierRegistry implements RuntimeSpecifierRegistry {
43
+ private readonly specifierMap;
44
+ /**
45
+ * Merges one integration-provided mapping set into the app registry.
46
+ */
47
+ register(map: Record<string, string>): void;
48
+ /**
49
+ * Returns the live app-owned mapping table.
50
+ */
51
+ getAll(): Map<string, string>;
52
+ /**
53
+ * Clears all mappings for the current runtime session.
54
+ */
55
+ clear(): void;
56
+ }
57
+ /**
58
+ * Returns the runtime specifier registry owned by one app instance.
59
+ *
60
+ * @remarks
61
+ * Older tests and helpers may not seed runtime state explicitly yet, so this
62
+ * helper still provides an in-memory fallback when the app runtime has not been
63
+ * initialized.
64
+ */
65
+ export declare function getAppRuntimeSpecifierRegistry(appConfig: EcoPagesAppConfig): RuntimeSpecifierRegistry;
66
+ /**
67
+ * Installs the runtime specifier registry that should back one app instance.
68
+ */
69
+ export declare function setAppRuntimeSpecifierRegistry(appConfig: EcoPagesAppConfig, runtimeSpecifierRegistry: RuntimeSpecifierRegistry): void;
@@ -0,0 +1,37 @@
1
+ class InMemoryRuntimeSpecifierRegistry {
2
+ specifierMap = /* @__PURE__ */ new Map();
3
+ /**
4
+ * Merges one integration-provided mapping set into the app registry.
5
+ */
6
+ register(map) {
7
+ for (const [specifier, url] of Object.entries(map)) {
8
+ this.specifierMap.set(specifier, url);
9
+ }
10
+ }
11
+ /**
12
+ * Returns the live app-owned mapping table.
13
+ */
14
+ getAll() {
15
+ return this.specifierMap;
16
+ }
17
+ /**
18
+ * Clears all mappings for the current runtime session.
19
+ */
20
+ clear() {
21
+ this.specifierMap.clear();
22
+ }
23
+ }
24
+ function getAppRuntimeSpecifierRegistry(appConfig) {
25
+ return appConfig.runtime?.runtimeSpecifierRegistry ?? new InMemoryRuntimeSpecifierRegistry();
26
+ }
27
+ function setAppRuntimeSpecifierRegistry(appConfig, runtimeSpecifierRegistry) {
28
+ appConfig.runtime = {
29
+ ...appConfig.runtime ?? {},
30
+ runtimeSpecifierRegistry
31
+ };
32
+ }
33
+ export {
34
+ InMemoryRuntimeSpecifierRegistry,
35
+ getAppRuntimeSpecifierRegistry,
36
+ setAppRuntimeSpecifierRegistry
37
+ };
@@ -0,0 +1,26 @@
1
+ import type { EcoPagesAppConfig } from '../../types/internal-types.js';
2
+ /**
3
+ * App-owned coarse invalidation state for server-executed modules.
4
+ */
5
+ export interface ServerInvalidationState {
6
+ getServerInvalidationVersion(): number;
7
+ invalidateServerModules(changedFiles?: string[]): void;
8
+ reset(): void;
9
+ }
10
+ /**
11
+ * Minimal app-local invalidation state backed by a single generation counter.
12
+ */
13
+ export declare class CounterServerInvalidationState implements ServerInvalidationState {
14
+ private serverInvalidationVersion;
15
+ getServerInvalidationVersion(): number;
16
+ invalidateServerModules(_changedFiles?: string[]): void;
17
+ reset(): void;
18
+ }
19
+ /**
20
+ * Returns the app-owned server invalidation state.
21
+ */
22
+ export declare function getAppServerInvalidationState(appConfig: EcoPagesAppConfig): ServerInvalidationState;
23
+ /**
24
+ * Installs the invalidation state used by one app instance.
25
+ */
26
+ export declare function setAppServerInvalidationState(appConfig: EcoPagesAppConfig, serverInvalidationState: ServerInvalidationState): void;
@@ -0,0 +1,35 @@
1
+ class CounterServerInvalidationState {
2
+ serverInvalidationVersion = 0;
3
+ getServerInvalidationVersion() {
4
+ return this.serverInvalidationVersion;
5
+ }
6
+ invalidateServerModules(_changedFiles) {
7
+ this.serverInvalidationVersion += 1;
8
+ }
9
+ reset() {
10
+ this.serverInvalidationVersion += 1;
11
+ }
12
+ }
13
+ function isLegacyServerInvalidationState(value) {
14
+ return Boolean(value) && typeof value === "object" && typeof value.getServerInvalidationVersion === "function" && typeof value.invalidateServerModules === "function" && typeof value.reset === "function";
15
+ }
16
+ function getAppServerInvalidationState(appConfig) {
17
+ if (appConfig.runtime?.serverInvalidationState) {
18
+ return appConfig.runtime.serverInvalidationState;
19
+ }
20
+ if (isLegacyServerInvalidationState(appConfig.runtime?.devGraphService)) {
21
+ return appConfig.runtime.devGraphService;
22
+ }
23
+ return new CounterServerInvalidationState();
24
+ }
25
+ function setAppServerInvalidationState(appConfig, serverInvalidationState) {
26
+ appConfig.runtime = {
27
+ ...appConfig.runtime ?? {},
28
+ serverInvalidationState
29
+ };
30
+ }
31
+ export {
32
+ CounterServerInvalidationState,
33
+ getAppServerInvalidationState,
34
+ setAppServerInvalidationState
35
+ };
@@ -1,4 +1,4 @@
1
- import type { StandardSchema } from './validation/standard-schema.types.js';
1
+ import type { StandardSchema } from './standard-schema.types.js';
2
2
  export interface ValidationResult<T = unknown> {
3
3
  success: boolean;
4
4
  data?: T;
@@ -0,0 +1,26 @@
1
+ # Static Site Generation
2
+
3
+ This directory contains the static-build execution path used when Ecopages renders pages ahead of time.
4
+
5
+ ## Purpose
6
+
7
+ The static-site generator reuses the same app-owned config, route matching, and rendering services that development and preview flows use, but drives them in a build-oriented loop.
8
+
9
+ It is responsible for:
10
+
11
+ - enumerating renderable routes
12
+ - rendering static outputs through the normal rendering pipeline
13
+ - respecting route-level constraints such as cache policy and unsupported dynamic server-only paths
14
+
15
+ ## Design Rule
16
+
17
+ Static generation should follow the same ownership model as runtime rendering.
18
+
19
+ That means it should reuse:
20
+
21
+ - built app config
22
+ - route matching
23
+ - render orchestration
24
+ - asset processing
25
+
26
+ It should not invent a parallel rendering stack just for build mode.
@@ -1,7 +1,7 @@
1
- import type { EcoPagesAppConfig } from '../internal-types.js';
2
- import type { StaticRoute } from '../public-types.js';
1
+ import type { EcoPagesAppConfig } from '../types/internal-types.js';
2
+ import type { StaticRoute } from '../types/public-types.js';
3
3
  import type { RouteRendererFactory } from '../route-renderer/route-renderer.js';
4
- import type { FSRouter } from '../router/fs-router.js';
4
+ import type { FSRouter } from '../router/server/fs-router.js';
5
5
  export declare const STATIC_SITE_GENERATOR_ERRORS: {
6
6
  readonly ROUTE_RENDERER_FACTORY_REQUIRED: "RouteRendererFactory is required for render strategy";
7
7
  readonly unsupportedBodyType: (bodyType: string) => string;
@@ -9,13 +9,49 @@ export declare const STATIC_SITE_GENERATOR_ERRORS: {
9
9
  readonly noRendererForIntegration: (integrationName: string) => string;
10
10
  readonly dynamicRouteRequiresStaticPaths: (routePath: string) => string;
11
11
  };
12
+ /**
13
+ * Generates static output files from the finalized app config and route graph.
14
+ *
15
+ * @remarks
16
+ * This class intentionally reuses the same routing, renderer, and server-module
17
+ * loading seams used by runtime rendering. Static generation should be a build
18
+ * loop over the normal app model, not a parallel rendering stack with different
19
+ * semantics.
20
+ */
12
21
  export declare class StaticSiteGenerator {
13
22
  appConfig: EcoPagesAppConfig;
23
+ /**
24
+ * Creates the static-site generator for one app config.
25
+ */
14
26
  constructor({ appConfig }: {
15
27
  appConfig: EcoPagesAppConfig;
16
28
  });
29
+ private getExportDir;
30
+ /**
31
+ * Logs the standardized warning emitted when a dynamic-cache page is skipped.
32
+ */
33
+ private warnDynamicPageSkipped;
34
+ /**
35
+ * Determines whether one filesystem-discovered page should be excluded from
36
+ * static generation.
37
+ */
38
+ private shouldSkipStaticPageFile;
39
+ /**
40
+ * Determines whether one explicit static route view should be excluded from
41
+ * static generation.
42
+ */
43
+ private shouldSkipStaticView;
44
+ /**
45
+ * Writes the robots.txt file declared by the app config.
46
+ */
17
47
  generateRobotsTxt(): void;
48
+ /**
49
+ * Returns whether the input path points at the root directory.
50
+ */
18
51
  isRootDir(path: string): boolean | null;
52
+ /**
53
+ * Collects parent directories that must exist for the generated route set.
54
+ */
19
55
  getDirectories(routes: string[]): string[];
20
56
  /**
21
57
  * Extracts dynamic parameters from the actual path based on the template path.
@@ -25,7 +61,18 @@ export declare class StaticSiteGenerator {
25
61
  * @returns A record of extracted parameters (e.g., { slug: "my-post" })
26
62
  */
27
63
  private extractParams;
64
+ /**
65
+ * Generates static output for all filesystem-discovered routes.
66
+ *
67
+ * @remarks
68
+ * Routes whose integrations opt into fetch-based static builds are rendered by
69
+ * issuing a request against the running server origin. Render-strategy routes
70
+ * go through the normal route renderer directly.
71
+ */
28
72
  generateStaticPages(router: FSRouter, baseUrl: string, routeRendererFactory?: RouteRendererFactory): Promise<void>;
73
+ /**
74
+ * Executes the full static-generation workflow for one app run.
75
+ */
29
76
  run({ router, baseUrl, routeRendererFactory, staticRoutes, }: {
30
77
  router: FSRouter;
31
78
  baseUrl: string;
@@ -11,9 +11,52 @@ const STATIC_SITE_GENERATOR_ERRORS = {
11
11
  };
12
12
  class StaticSiteGenerator {
13
13
  appConfig;
14
+ /**
15
+ * Creates the static-site generator for one app config.
16
+ */
14
17
  constructor({ appConfig }) {
15
18
  this.appConfig = appConfig;
16
19
  }
20
+ getExportDir() {
21
+ return this.appConfig.absolutePaths?.distDir ?? path.join(this.appConfig.rootDir, this.appConfig.distDir);
22
+ }
23
+ /**
24
+ * Logs the standardized warning emitted when a dynamic-cache page is skipped.
25
+ */
26
+ warnDynamicPageSkipped(filePath) {
27
+ appLogger.warn(
28
+ "Pages with cache: 'dynamic' are not supported in static generation or preview, so they will be skipped\n",
29
+ `\u27A4 ${filePath}`
30
+ );
31
+ }
32
+ /**
33
+ * Determines whether one filesystem-discovered page should be excluded from
34
+ * static generation.
35
+ */
36
+ async shouldSkipStaticPageFile(filePath, routeRendererFactory) {
37
+ const module = await routeRendererFactory.createRenderer(filePath).loadPageModule(filePath, {
38
+ cacheScope: "static-page-probe"
39
+ });
40
+ if (module.default?.cache !== "dynamic") {
41
+ return false;
42
+ }
43
+ this.warnDynamicPageSkipped(filePath);
44
+ return true;
45
+ }
46
+ /**
47
+ * Determines whether one explicit static route view should be excluded from
48
+ * static generation.
49
+ */
50
+ shouldSkipStaticView(routePath, view) {
51
+ if (view.cache !== "dynamic") {
52
+ return false;
53
+ }
54
+ this.warnDynamicPageSkipped(routePath);
55
+ return true;
56
+ }
57
+ /**
58
+ * Writes the robots.txt file declared by the app config.
59
+ */
17
60
  generateRobotsTxt() {
18
61
  let data = "";
19
62
  const preferences = this.appConfig.robotsTxt.preferences;
@@ -26,13 +69,19 @@ class StaticSiteGenerator {
26
69
  }
27
70
  data += "\n";
28
71
  }
29
- fileSystem.ensureDir(this.appConfig.distDir);
30
- fileSystem.write(`${this.appConfig.distDir}/robots.txt`, data);
72
+ fileSystem.ensureDir(this.getExportDir());
73
+ fileSystem.write(path.join(this.getExportDir(), "robots.txt"), data);
31
74
  }
75
+ /**
76
+ * Returns whether the input path points at the root directory.
77
+ */
32
78
  isRootDir(path2) {
33
79
  const slashes = path2.match(/\//g);
34
80
  return slashes && slashes.length === 1;
35
81
  }
82
+ /**
83
+ * Collects parent directories that must exist for the generated route set.
84
+ */
36
85
  getDirectories(routes) {
37
86
  const directories = /* @__PURE__ */ new Set();
38
87
  for (const route of routes) {
@@ -64,12 +113,20 @@ class StaticSiteGenerator {
64
113
  }
65
114
  return params;
66
115
  }
116
+ /**
117
+ * Generates static output for all filesystem-discovered routes.
118
+ *
119
+ * @remarks
120
+ * Routes whose integrations opt into fetch-based static builds are rendered by
121
+ * issuing a request against the running server origin. Render-strategy routes
122
+ * go through the normal route renderer directly.
123
+ */
67
124
  async generateStaticPages(router, baseUrl, routeRendererFactory) {
68
125
  const routes = Object.keys(router.routes).filter((route) => !route.includes("["));
69
126
  appLogger.debug("Static Pages", routes);
70
127
  const directories = this.getDirectories(routes);
71
128
  for (const directory of directories) {
72
- fileSystem.ensureDir(path.join(this.appConfig.rootDir, this.appConfig.distDir, directory));
129
+ fileSystem.ensureDir(path.join(this.getExportDir(), directory));
73
130
  }
74
131
  for (const route of routes) {
75
132
  try {
@@ -90,6 +147,9 @@ class StaticSiteGenerator {
90
147
  if (!routeRendererFactory) {
91
148
  throw new Error(STATIC_SITE_GENERATOR_ERRORS.ROUTE_RENDERER_FACTORY_REQUIRED);
92
149
  }
150
+ if (await this.shouldSkipStaticPageFile(filePath, routeRendererFactory)) {
151
+ continue;
152
+ }
93
153
  let pathname2 = routePathname;
94
154
  const pathnameSegments2 = pathname2.split("/").filter(Boolean);
95
155
  if (pathname2 === "/") {
@@ -127,7 +187,7 @@ class StaticSiteGenerator {
127
187
  } else {
128
188
  pathname += ".html";
129
189
  }
130
- const outputPath = path.join(this.appConfig.rootDir, this.appConfig.distDir, pathname);
190
+ const outputPath = path.join(this.getExportDir(), pathname);
131
191
  fileSystem.write(outputPath, contents);
132
192
  } catch (error) {
133
193
  appLogger.error(
@@ -137,6 +197,9 @@ class StaticSiteGenerator {
137
197
  }
138
198
  }
139
199
  }
200
+ /**
201
+ * Executes the full static-generation workflow for one app run.
202
+ */
140
203
  async run({
141
204
  router,
142
205
  baseUrl,
@@ -162,6 +225,9 @@ class StaticSiteGenerator {
162
225
  try {
163
226
  const mod = await route.loader();
164
227
  const view = mod.default;
228
+ if (this.shouldSkipStaticView(route.path, view)) {
229
+ continue;
230
+ }
165
231
  const isDynamic = route.path.includes(":") || route.path.includes("[");
166
232
  if (isDynamic) {
167
233
  await this.generateDynamicStaticRoute(route.path, view, routeRendererFactory);
@@ -260,7 +326,7 @@ class StaticSiteGenerator {
260
326
  } else {
261
327
  outputName = `${routePath}.html`;
262
328
  }
263
- return path.join(this.appConfig.rootDir, this.appConfig.distDir, outputName);
329
+ return path.join(this.getExportDir(), outputName);
264
330
  }
265
331
  }
266
332
  function templateSegmentsFromPath(path2) {
@@ -1,17 +1,19 @@
1
- import type { EcoBuildPlugin } from './build/build-types.js';
2
- import type { IntegrationPlugin } from './plugins/integration-plugin.js';
3
- import type { Processor } from './plugins/processor.js';
1
+ import type { EcoBuildPlugin } from '../build/build-types.js';
2
+ import type { AppBuildManifest } from '../build/build-manifest.js';
3
+ import type { BuildAdapter, BuildExecutor, BuildOwnership } from '../build/build-adapter.js';
4
+ import type { IntegrationPlugin } from '../plugins/integration-plugin.js';
5
+ import type { Processor } from '../plugins/processor.js';
6
+ import type { EcoSourceTransform } from '../plugins/source-transform.js';
4
7
  import type { PageMetadataProps } from './public-types.js';
5
- import type { FSRouter } from './router/fs-router.js';
6
- import type { CacheConfig } from './services/cache/cache.types.js';
7
- /**
8
- * The templates used to build the pages and loaded via the includes directory.
9
- */
10
- export type IncludesTemplates = {
11
- head: string;
12
- html: string;
13
- seo: string;
14
- };
8
+ import type { FSRouter } from '../router/server/fs-router.js';
9
+ import type { CacheConfig } from '../services/cache/cache.types.js';
10
+ import type { DevGraphService } from '../services/runtime-state/dev-graph.service.js';
11
+ import type { AppModuleLoader } from '../services/module-loading/app-module-loader.service.js';
12
+ import type { SourceModuleLoader } from '../services/module-loading/module-loading-types.js';
13
+ import type { EntrypointDependencyGraph } from '../services/runtime-state/entrypoint-dependency-graph.service.js';
14
+ import type { RuntimeSpecifierRegistry } from '../services/runtime-state/runtime-specifier-registry.service.js';
15
+ import type { ServerInvalidationState } from '../services/runtime-state/server-invalidation-state.service.js';
16
+ import type { ServerModuleTranspiler } from '../services/module-loading/server-module-transpiler.service.js';
15
17
  export interface RobotsPreference {
16
18
  /**
17
19
  * The user agent
@@ -58,20 +60,22 @@ export type EcoPagesAppConfig = {
58
60
  * @default "layouts"
59
61
  */
60
62
  layoutsDir: string;
61
- /**
62
- * The templates used for the pages
63
- * @default "{head: 'head.kita.tsx', html: 'html.kita.tsx', seo: 'seo.kita.tsx'}"
64
- */
65
- includesTemplates: IncludesTemplates;
66
- /** Error 404 page
67
- * @default "404.kita.tsx"
68
- */
69
- error404Template: string;
70
63
  /**
71
64
  * The directory where the output will be located
72
65
  * @default "dist"
73
66
  */
74
67
  distDir: string;
68
+ /**
69
+ * The directory where internal runtime and build artifacts are stored.
70
+ *
71
+ * @remarks
72
+ * This directory is not intended for deployment. It owns transpiled server
73
+ * modules, runtime manifests, and processor caches so `distDir` can remain a
74
+ * clean export tree.
75
+ *
76
+ * @default ".eco"
77
+ */
78
+ workDir: string;
75
79
  /**
76
80
  * The templates extensions based on the integrations
77
81
  */
@@ -106,6 +110,7 @@ export type EcoPagesAppConfig = {
106
110
  config: string;
107
111
  componentsDir: string;
108
112
  distDir: string;
113
+ workDir: string;
109
114
  includesDir: string;
110
115
  layoutsDir: string;
111
116
  pagesDir: string;
@@ -123,11 +128,37 @@ export type EcoPagesAppConfig = {
123
128
  * Loaders to be used in the app, these are used to process the files when importing them
124
129
  */
125
130
  loaders: Map<string, EcoBuildPlugin>;
131
+ /**
132
+ * App-owned source transforms that can be adapted into Vite or other
133
+ * transform-first bundlers without going through the legacy loader bridge.
134
+ */
135
+ sourceTransforms: Map<string, EcoSourceTransform>;
126
136
  /**
127
137
  * Cache configuration for ISR and page caching.
128
138
  * @default { store: 'memory', defaultStrategy: 'static', enabled: true }
129
139
  */
130
140
  cache?: CacheConfig;
141
+ /**
142
+ * Runtime-owned services attached after config construction.
143
+ *
144
+ * These values are internal implementation details used to thread per-app
145
+ * executors and similar runtime state through the system without relying on
146
+ * process-global registries.
147
+ */
148
+ runtime?: {
149
+ appModuleLoader?: AppModuleLoader;
150
+ buildOwnership?: BuildOwnership;
151
+ buildAdapter?: BuildAdapter;
152
+ buildManifest?: AppBuildManifest;
153
+ buildExecutor?: BuildExecutor;
154
+ devGraphService?: DevGraphService;
155
+ entrypointDependencyGraph?: EntrypointDependencyGraph;
156
+ hostModuleLoader?: SourceModuleLoader;
157
+ rendererModuleContext?: unknown;
158
+ runtimeSpecifierRegistry?: RuntimeSpecifierRegistry;
159
+ serverInvalidationState?: ServerInvalidationState;
160
+ serverModuleTranspiler?: ServerModuleTranspiler;
161
+ };
131
162
  /**
132
163
  * Experimental features.
133
164
  */
File without changes