@ecopages/core 0.2.0-rc.10 → 0.2.0-rc.11

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 (159) hide show
  1. package/README.md +0 -9
  2. package/package.json +3 -144
  3. package/src/adapters/README.md +8 -2
  4. package/src/adapters/abstract/application-adapter.d.ts +6 -32
  5. package/src/adapters/abstract/application-adapter.js +6 -45
  6. package/src/adapters/abstract/ws-pattern-matcher.d.ts +0 -5
  7. package/src/adapters/abstract/ws-pattern-matcher.js +0 -9
  8. package/src/adapters/bun/create-app.d.ts +8 -12
  9. package/src/adapters/bun/create-app.js +13 -55
  10. package/src/adapters/bun/hmr-manager.d.ts +0 -1
  11. package/src/adapters/bun/hmr-manager.js +2 -4
  12. package/src/adapters/bun/server-adapter.d.ts +9 -19
  13. package/src/adapters/bun/server-adapter.js +19 -66
  14. package/src/adapters/bun/static-preview-host.d.ts +1 -0
  15. package/src/adapters/bun/static-preview-host.js +1 -1
  16. package/src/adapters/create-app.d.ts +1 -1
  17. package/src/adapters/create-app.js +2 -1
  18. package/src/adapters/node/create-app.d.ts +4 -8
  19. package/src/adapters/node/create-app.js +7 -12
  20. package/src/adapters/node/runtime-host.d.ts +10 -10
  21. package/src/adapters/node/runtime-host.js +4 -4
  22. package/src/adapters/node/server-adapter-dependencies.d.ts +2 -10
  23. package/src/adapters/node/server-adapter-dependencies.js +8 -13
  24. package/src/adapters/node/server-adapter.d.ts +25 -31
  25. package/src/adapters/node/server-adapter.js +43 -64
  26. package/src/adapters/shared/hmr/shared-hmr-manager.d.ts +0 -4
  27. package/src/adapters/shared/hmr/shared-hmr-manager.js +0 -12
  28. package/src/adapters/shared/http/api-request-pipeline.d.ts +27 -1
  29. package/src/adapters/shared/http/api-request-pipeline.js +31 -16
  30. package/src/adapters/shared/http/fs-server-response-factory.d.ts +0 -1
  31. package/src/adapters/shared/http/fs-server-response-factory.js +0 -3
  32. package/src/adapters/shared/runtime/collect-dev-prewarm-plan.d.ts +1 -3
  33. package/src/adapters/shared/runtime/collect-dev-prewarm-plan.js +1 -4
  34. package/src/adapters/shared/runtime/runtime-app-bootstrap.d.ts +0 -10
  35. package/src/adapters/shared/runtime/runtime-app-bootstrap.js +0 -7
  36. package/src/adapters/shared/runtime/runtime-host.d.ts +5 -2
  37. package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +1 -1
  38. package/src/adapters/shared/runtime/runtime-server-lifecycle.js +1 -1
  39. package/src/adapters/shared/runtime/server-adapter.d.ts +13 -0
  40. package/src/adapters/shared/runtime/server-adapter.js +22 -0
  41. package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +9 -1
  42. package/src/adapters/shared/ws/node-http-websocket-upgrades.js +8 -2
  43. package/src/build/README.md +5 -6
  44. package/src/build/cache/cache-constants.d.ts +0 -2
  45. package/src/build/cache/cache-constants.js +0 -2
  46. package/src/build/cache/cache-keys.d.ts +0 -2
  47. package/src/build/cache/cache-keys.js +0 -2
  48. package/src/build/cache/output-imports.d.ts +27 -0
  49. package/src/build/cache/output-imports.js +80 -0
  50. package/src/build/cache/pages-unified-graph-build.d.ts +6 -1
  51. package/src/build/cache/pages-unified-graph-build.js +42 -17
  52. package/src/build/cache/production-build-cache.d.ts +2 -2
  53. package/src/build/cache/production-build-cache.js +2 -2
  54. package/src/build/cache/server-entry-build-cache.d.ts +1 -2
  55. package/src/build/cache/server-entry-build-cache.js +4 -5
  56. package/src/build/contracts/build-contracts.d.ts +1 -13
  57. package/src/build/rolldown/runtime-build-output-normalizer.js +3 -6
  58. package/src/build/runtime/build-request-identity.d.ts +2 -6
  59. package/src/build/runtime/build-request-identity.js +2 -8
  60. package/src/build/runtime/deduping-build-executor.d.ts +0 -1
  61. package/src/build/runtime/deduping-build-executor.js +0 -1
  62. package/src/cache/index.d.ts +1 -1
  63. package/src/cache/index.js +1 -1
  64. package/src/cache/module-parse-cache.d.ts +2 -29
  65. package/src/cache/module-parse-cache.js +6 -39
  66. package/src/config/README.md +3 -3
  67. package/src/config/apply-user-config.d.ts +3 -1
  68. package/src/config/apply-user-config.js +3 -2
  69. package/src/config/config-builder.d.ts +1 -0
  70. package/src/config/config-builder.js +2 -2
  71. package/src/config/constants.d.ts +0 -4
  72. package/src/config/constants.js +0 -4
  73. package/src/config/index.d.ts +1 -1
  74. package/src/config/index.js +1 -1
  75. package/src/config/load-eco-config.d.ts +1 -1
  76. package/src/config/load-eco-config.js +18 -11
  77. package/src/config/resolve-eco-config-path.d.ts +9 -0
  78. package/src/config/resolve-eco-config-path.js +11 -0
  79. package/src/config/server-config-bundle.js +2 -2
  80. package/src/config/user-config-types.d.ts +9 -3
  81. package/src/dev/host-runtime.d.ts +0 -1
  82. package/src/dev/host-runtime.js +0 -3
  83. package/src/dev/sc-server.d.ts +4 -1
  84. package/src/dev/sc-server.js +11 -20
  85. package/src/dev/transform-server/dev-transform-import-rewriter.js +2 -2
  86. package/src/hmr/hmr-file-change-prep.d.ts +0 -1
  87. package/src/hmr/hmr-file-change-prep.js +2 -5
  88. package/src/hmr/hmr-strategy.d.ts +3 -8
  89. package/src/hmr/hmr-strategy.js +3 -8
  90. package/src/index.browser.d.ts +1 -2
  91. package/src/index.browser.js +1 -2
  92. package/src/index.d.ts +5 -6
  93. package/src/index.js +5 -6
  94. package/src/islands/island-host.d.ts +0 -9
  95. package/src/islands/island-host.js +1 -13
  96. package/src/plugins/component-import-discovery.js +2 -2
  97. package/src/plugins/eco-component-meta-plugin.js +5 -5
  98. package/src/plugins/integration-plugin.d.ts +0 -1
  99. package/src/plugins/integration-plugin.js +0 -4
  100. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +1 -4
  101. package/src/route-renderer/orchestration/integration-renderer.d.ts +0 -6
  102. package/src/route-renderer/orchestration/integration-renderer.js +1 -11
  103. package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +1 -1
  104. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +1 -1
  105. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +1 -1
  106. package/src/services/README.md +1 -1
  107. package/src/services/assets/browser-bundle.service.d.ts +1 -6
  108. package/src/services/error-pages/default-error-pages.d.ts +1 -6
  109. package/src/services/error-pages/default-error-pages.js +0 -8
  110. package/src/services/html/html-rewriter.d.ts +77 -0
  111. package/src/services/html/html-rewriter.js +751 -0
  112. package/src/services/html/html-rewriter.parity.test.bun.d.ts +1 -0
  113. package/src/services/html/html-rewriter.parity.test.bun.js +74 -0
  114. package/src/services/html/html-transformer.service.d.ts +26 -39
  115. package/src/services/html/html-transformer.service.js +81 -153
  116. package/src/services/invalidation/development-invalidation.service.d.ts +2 -19
  117. package/src/services/invalidation/development-invalidation.service.js +1 -39
  118. package/src/services/module-loading/README.md +1 -1
  119. package/src/services/module-loading/app-module-loader.service.d.ts +0 -2
  120. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +1 -1
  121. package/src/services/module-loading/app-server-module-transpiler.service.js +0 -10
  122. package/src/services/module-loading/collection-server-module-build.service.d.ts +0 -1
  123. package/src/services/module-loading/collection-server-module-build.service.js +0 -3
  124. package/src/services/module-loading/host-module-loader-registry.d.ts +0 -1
  125. package/src/services/module-loading/host-module-loader-registry.js +0 -3
  126. package/src/services/module-loading/route-module-build-cache-registry.d.ts +0 -4
  127. package/src/services/module-loading/route-module-build-cache-registry.js +0 -4
  128. package/src/services/module-loading/route-module-build-cache.store.d.ts +3 -0
  129. package/src/services/module-loading/route-module-build-cache.store.js +18 -5
  130. package/src/services/module-loading/route-module-build-manifest.d.ts +6 -1
  131. package/src/services/module-loading/route-module-build-manifest.js +1 -2
  132. package/src/services/module-loading/route-module-dependency-hasher.d.ts +3 -2
  133. package/src/services/module-loading/server-module-transpiler.service.d.ts +1 -15
  134. package/src/services/module-loading/server-module-transpiler.service.js +0 -24
  135. package/src/services/runtime-state/entrypoint-dependency-graph.service.js +0 -12
  136. package/src/services/runtime-state/server-invalidation-state.service.d.ts +4 -2
  137. package/src/services/runtime-state/server-invalidation-state.service.js +7 -14
  138. package/src/types/internal-types.d.ts +0 -38
  139. package/src/types/public-types.d.ts +0 -112
  140. package/src/watchers/project-watcher.d.ts +0 -15
  141. package/src/watchers/project-watcher.js +1 -27
  142. package/src/watchers/project-watcher.test-helpers.d.ts +10 -1
  143. package/src/watchers/project-watcher.test-helpers.js +12 -0
  144. package/src/adapters/abstract/router-adapter.d.ts +0 -26
  145. package/src/adapters/abstract/router-adapter.js +0 -13
  146. package/src/adapters/bun/index.d.ts +0 -2
  147. package/src/adapters/bun/index.js +0 -2
  148. package/src/adapters/index.d.ts +0 -2
  149. package/src/adapters/index.js +0 -2
  150. package/src/eco/eco.utils.d.ts +0 -1
  151. package/src/eco/eco.utils.js +0 -1
  152. package/src/services/cache/index.d.ts +0 -9
  153. package/src/services/cache/index.js +0 -8
  154. package/src/services/html/html-rewriter-provider.service.d.ts +0 -40
  155. package/src/services/html/html-rewriter-provider.service.js +0 -68
  156. package/src/services/module-loading/route-module-build-cache.d.ts +0 -4
  157. package/src/services/module-loading/route-module-build-cache.js +0 -3
  158. package/src/services/runtime-state/dev-graph.service.d.ts +0 -118
  159. package/src/services/runtime-state/dev-graph.service.js +0 -170
package/README.md CHANGED
@@ -278,12 +278,6 @@ import { defineApiHandler, defineGet, defineGroupHandler, eco } from '@ecopages/
278
278
  > [!NOTE]
279
279
  > Use `createApp()` from `@ecopages/core/create-app` as the application entrypoint.
280
280
 
281
- ### Runtime Escape Hatches
282
-
283
- Use runtime-specific subpaths only when you explicitly need Bun-native APIs that bypass the universal abstractions:
284
-
285
- - `@ecopages/core/bun`
286
-
287
281
  ## Entry Point Roles
288
282
 
289
283
  The published subpaths are grouped by architectural role rather than by source folder.
@@ -299,7 +293,6 @@ Use these entrypoints when building an Ecopages app:
299
293
  - `@ecopages/core/hash`
300
294
  - `@ecopages/core/declarations`
301
295
  - `@ecopages/core/env`
302
- - `@ecopages/core/bun`
303
296
 
304
297
  ### Browser Navigation
305
298
 
@@ -326,7 +319,5 @@ Use these entrypoints only when implementing host adapters or framework-owned bu
326
319
 
327
320
  - `@ecopages/core/dev/host-runtime`
328
321
  - `@ecopages/core/build/build-adapter`
329
- - `@ecopages/core/build/build-types`
330
- - `@ecopages/core/plugins/foreign-jsx-override-plugin`
331
322
 
332
323
  These host-facing entrypoints are narrower compatibility seams. App code and most extensions should prefer the app-authoring or extension-authoring surfaces.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/core",
3
- "version": "0.2.0-rc.10",
3
+ "version": "0.2.0-rc.11",
4
4
  "description": "Core package for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -21,11 +21,10 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@clack/prompts": "^1.7.0",
24
- "@ecopages/file-system": "0.2.0-rc.10",
24
+ "@ecopages/file-system": "0.2.0-rc.11",
25
25
  "@ecopages/logger": "^0.2.3",
26
26
  "@ecopages/scripts-injector": "^0.1.5",
27
27
  "@oxc-project/runtime": "0.141.0",
28
- "@worker-tools/html-rewriter": "0.1.0-pre.19",
29
28
  "chokidar": "^5.0.0",
30
29
  "oxc-parser": "^0.141.0",
31
30
  "oxc-resolver": "^11.24.2",
@@ -35,7 +34,7 @@
35
34
  "@standard-schema/utils": "^0.3.0"
36
35
  },
37
36
  "peerDependencies": {
38
- "@ecopages/dev-toolbar": "0.2.0-rc.10"
37
+ "@ecopages/dev-toolbar": "0.2.0-rc.11"
39
38
  },
40
39
  "peerDependenciesMeta": {
41
40
  "@ecopages/dev-toolbar": {
@@ -135,11 +134,6 @@
135
134
  "types": "./src/client/navigation-scripts/index.d.ts",
136
135
  "default": "./src/client/navigation-scripts/index.js"
137
136
  },
138
- "./eco": {
139
- "browser": "./src/eco/eco.browser.js",
140
- "types": "./src/eco/eco.d.ts",
141
- "default": "./src/eco/eco.js"
142
- },
143
137
  "./eco/page-layout-normalization": {
144
138
  "types": "./src/eco/page-layout-normalization.d.ts",
145
139
  "default": "./src/eco/page-layout-normalization.js"
@@ -162,18 +156,10 @@
162
156
  "types": "./src/config/constants.d.ts",
163
157
  "default": "./src/config/constants.js"
164
158
  },
165
- "./diagnostics/startup-trace": {
166
- "types": "./src/diagnostics/startup-trace.d.ts",
167
- "default": "./src/diagnostics/startup-trace.js"
168
- },
169
159
  "./diagnostics/request-pipeline-metrics": {
170
160
  "types": "./src/diagnostics/request-pipeline-metrics.d.ts",
171
161
  "default": "./src/diagnostics/request-pipeline-metrics.js"
172
162
  },
173
- "./bun": {
174
- "types": "./src/adapters/bun/index.d.ts",
175
- "default": "./src/adapters/bun/index.js"
176
- },
177
163
  "./hmr/hmr-strategy": {
178
164
  "types": "./src/hmr/hmr-strategy.d.ts",
179
165
  "default": "./src/hmr/hmr-strategy.js"
@@ -186,14 +172,6 @@
186
172
  "types": "./src/hmr/hmr-registered-entrypoints-context.d.ts",
187
173
  "default": "./src/hmr/hmr-registered-entrypoints-context.js"
188
174
  },
189
- "./hmr/hmr-runtime-paths": {
190
- "types": "./src/hmr/hmr-runtime-paths.d.ts",
191
- "default": "./src/hmr/hmr-runtime-paths.js"
192
- },
193
- "./hmr/hmr-asset-paths": {
194
- "types": "./src/hmr/hmr-asset-paths.d.ts",
195
- "default": "./src/hmr/hmr-asset-paths.js"
196
- },
197
175
  "./hmr/hmr-file-change-prep": {
198
176
  "types": "./src/hmr/hmr-file-change-prep.d.ts",
199
177
  "default": "./src/hmr/hmr-file-change-prep.js"
@@ -211,10 +189,6 @@
211
189
  "types": "./src/dev/host-runtime.d.ts",
212
190
  "default": "./src/dev/host-runtime.js"
213
191
  },
214
- "./dev/client-bridge-registry": {
215
- "types": "./src/dev/client-bridge-registry.d.ts",
216
- "default": "./src/dev/client-bridge-registry.js"
217
- },
218
192
  "./dev/hmr-manager-registry": {
219
193
  "types": "./src/dev/hmr-manager-registry.d.ts",
220
194
  "default": "./src/dev/hmr-manager-registry.js"
@@ -243,10 +217,6 @@
243
217
  "types": "./src/plugins/source-transform.d.ts",
244
218
  "default": "./src/plugins/source-transform.js"
245
219
  },
246
- "./build/build-types": {
247
- "types": "./src/build/contracts/build-types.d.ts",
248
- "default": "./src/build/contracts/build-types.js"
249
- },
250
220
  "./build/build-adapter": {
251
221
  "types": "./src/build/build-adapter.d.ts",
252
222
  "default": "./src/build/build-adapter.js"
@@ -255,10 +225,6 @@
255
225
  "types": "./src/build/runtime/build-runtime.d.ts",
256
226
  "default": "./src/build/runtime/build-runtime.js"
257
227
  },
258
- "./build/build-contracts": {
259
- "types": "./src/build/contracts/build-contracts.d.ts",
260
- "default": "./src/build/contracts/build-contracts.js"
261
- },
262
228
  "./build/contracts/content-virtual-modules": {
263
229
  "types": "./src/build/contracts/content-virtual-modules.d.ts",
264
230
  "default": "./src/build/contracts/content-virtual-modules.js"
@@ -267,18 +233,6 @@
267
233
  "types": "./src/services/module-loading/collection-server-module-build.service.d.ts",
268
234
  "default": "./src/services/module-loading/collection-server-module-build.service.js"
269
235
  },
270
- "./build/production-build-cache": {
271
- "types": "./src/build/cache/production-build-cache.d.ts",
272
- "default": "./src/build/cache/production-build-cache.js"
273
- },
274
- "./build/server-entry-build-cache": {
275
- "types": "./src/build/cache/server-entry-build-cache.d.ts",
276
- "default": "./src/build/cache/server-entry-build-cache.js"
277
- },
278
- "./build/runtime-build-output-normalizer": {
279
- "types": "./src/build/rolldown/runtime-build-output-normalizer.d.ts",
280
- "default": "./src/build/rolldown/runtime-build-output-normalizer.js"
281
- },
282
236
  "./build/browser-runtime-manifest": {
283
237
  "types": "./src/build/browser/browser-runtime-manifest.d.ts",
284
238
  "default": "./src/build/browser/browser-runtime-manifest.js"
@@ -299,14 +253,6 @@
299
253
  "types": "./src/cache/index.d.ts",
300
254
  "default": "./src/cache/index.js"
301
255
  },
302
- "./plugins/foreign-jsx-override-plugin": {
303
- "types": "./src/plugins/foreign-jsx-override-plugin.d.ts",
304
- "default": "./src/plugins/foreign-jsx-override-plugin.js"
305
- },
306
- "./plugins/alias-resolver-plugin": {
307
- "types": "./src/plugins/alias-resolver-plugin.d.ts",
308
- "default": "./src/plugins/alias-resolver-plugin.js"
309
- },
310
256
  "./plugins/tsconfig-import-resolver": {
311
257
  "types": "./src/plugins/tsconfig-import-resolver.d.ts",
312
258
  "default": "./src/plugins/tsconfig-import-resolver.js"
@@ -324,11 +270,6 @@
324
270
  "default": "./src/utils/hash.js",
325
271
  "types": "./src/utils/hash.d.ts"
326
272
  },
327
- "./utils/hash": {
328
- "import": "./src/utils/hash.js",
329
- "default": "./src/utils/hash.js",
330
- "types": "./src/utils/hash.d.ts"
331
- },
332
273
  "./utils/resolve-entry-file": {
333
274
  "import": "./src/utils/resolve-entry-file.js",
334
275
  "types": "./src/utils/resolve-entry-file.d.ts",
@@ -342,18 +283,6 @@
342
283
  "types": "./src/dev/transform-server/index.d.ts",
343
284
  "default": "./src/dev/transform-server/index.js"
344
285
  },
345
- "./dev-toolbar/dev-toolbar-runtime-paths": {
346
- "types": "./src/dev-toolbar/dev-toolbar-runtime-paths.d.ts",
347
- "default": "./src/dev-toolbar/dev-toolbar-runtime-paths.js"
348
- },
349
- "./dev-toolbar/dev-toolbar-package": {
350
- "types": "./src/dev-toolbar/dev-toolbar-package.d.ts",
351
- "default": "./src/dev-toolbar/dev-toolbar-package.js"
352
- },
353
- "./dev-toolbar/dev-toolbar-host": {
354
- "types": "./src/dev-toolbar/dev-toolbar-host.d.ts",
355
- "default": "./src/dev-toolbar/dev-toolbar-host.js"
356
- },
357
286
  "./dev-toolbar/define-dev-tool": {
358
287
  "types": "./src/dev-toolbar/define-dev-tool.d.ts",
359
288
  "default": "./src/dev-toolbar/define-dev-tool.js"
@@ -448,11 +377,6 @@
448
377
  "types": "./src/client/navigation-scripts/index.d.ts",
449
378
  "default": "./src/client/navigation-scripts/index.js"
450
379
  },
451
- "./eco.ts": {
452
- "browser": "./src/eco/eco.browser.js",
453
- "types": "./src/eco/eco.d.ts",
454
- "default": "./src/eco/eco.js"
455
- },
456
380
  "./eco/page-layout-normalization.ts": {
457
381
  "types": "./src/eco/page-layout-normalization.d.ts",
458
382
  "default": "./src/eco/page-layout-normalization.js"
@@ -475,18 +399,10 @@
475
399
  "types": "./src/config/constants.d.ts",
476
400
  "default": "./src/config/constants.js"
477
401
  },
478
- "./diagnostics/startup-trace.ts": {
479
- "types": "./src/diagnostics/startup-trace.d.ts",
480
- "default": "./src/diagnostics/startup-trace.js"
481
- },
482
402
  "./diagnostics/request-pipeline-metrics.ts": {
483
403
  "types": "./src/diagnostics/request-pipeline-metrics.d.ts",
484
404
  "default": "./src/diagnostics/request-pipeline-metrics.js"
485
405
  },
486
- "./bun.ts": {
487
- "types": "./src/adapters/bun/index.d.ts",
488
- "default": "./src/adapters/bun/index.js"
489
- },
490
406
  "./hmr/hmr-strategy.ts": {
491
407
  "types": "./src/hmr/hmr-strategy.d.ts",
492
408
  "default": "./src/hmr/hmr-strategy.js"
@@ -499,14 +415,6 @@
499
415
  "types": "./src/hmr/hmr-registered-entrypoints-context.d.ts",
500
416
  "default": "./src/hmr/hmr-registered-entrypoints-context.js"
501
417
  },
502
- "./hmr/hmr-runtime-paths.ts": {
503
- "types": "./src/hmr/hmr-runtime-paths.d.ts",
504
- "default": "./src/hmr/hmr-runtime-paths.js"
505
- },
506
- "./hmr/hmr-asset-paths.ts": {
507
- "types": "./src/hmr/hmr-asset-paths.d.ts",
508
- "default": "./src/hmr/hmr-asset-paths.js"
509
- },
510
418
  "./hmr/hmr-file-change-prep.ts": {
511
419
  "types": "./src/hmr/hmr-file-change-prep.d.ts",
512
420
  "default": "./src/hmr/hmr-file-change-prep.js"
@@ -524,10 +432,6 @@
524
432
  "types": "./src/dev/host-runtime.d.ts",
525
433
  "default": "./src/dev/host-runtime.js"
526
434
  },
527
- "./dev/client-bridge-registry.ts": {
528
- "types": "./src/dev/client-bridge-registry.d.ts",
529
- "default": "./src/dev/client-bridge-registry.js"
530
- },
531
435
  "./dev/hmr-manager-registry.ts": {
532
436
  "types": "./src/dev/hmr-manager-registry.d.ts",
533
437
  "default": "./src/dev/hmr-manager-registry.js"
@@ -556,10 +460,6 @@
556
460
  "types": "./src/plugins/source-transform.d.ts",
557
461
  "default": "./src/plugins/source-transform.js"
558
462
  },
559
- "./build/build-types.ts": {
560
- "types": "./src/build/contracts/build-types.d.ts",
561
- "default": "./src/build/contracts/build-types.js"
562
- },
563
463
  "./build/build-adapter.ts": {
564
464
  "types": "./src/build/build-adapter.d.ts",
565
465
  "default": "./src/build/build-adapter.js"
@@ -568,10 +468,6 @@
568
468
  "types": "./src/build/runtime/build-runtime.d.ts",
569
469
  "default": "./src/build/runtime/build-runtime.js"
570
470
  },
571
- "./build/build-contracts.ts": {
572
- "types": "./src/build/contracts/build-contracts.d.ts",
573
- "default": "./src/build/contracts/build-contracts.js"
574
- },
575
471
  "./build/contracts/content-virtual-modules.ts": {
576
472
  "types": "./src/build/contracts/content-virtual-modules.d.ts",
577
473
  "default": "./src/build/contracts/content-virtual-modules.js"
@@ -580,18 +476,6 @@
580
476
  "types": "./src/services/module-loading/collection-server-module-build.service.d.ts",
581
477
  "default": "./src/services/module-loading/collection-server-module-build.service.js"
582
478
  },
583
- "./build/production-build-cache.ts": {
584
- "types": "./src/build/cache/production-build-cache.d.ts",
585
- "default": "./src/build/cache/production-build-cache.js"
586
- },
587
- "./build/server-entry-build-cache.ts": {
588
- "types": "./src/build/cache/server-entry-build-cache.d.ts",
589
- "default": "./src/build/cache/server-entry-build-cache.js"
590
- },
591
- "./build/runtime-build-output-normalizer.ts": {
592
- "types": "./src/build/rolldown/runtime-build-output-normalizer.d.ts",
593
- "default": "./src/build/rolldown/runtime-build-output-normalizer.js"
594
- },
595
479
  "./build/browser-runtime-manifest.ts": {
596
480
  "types": "./src/build/browser/browser-runtime-manifest.d.ts",
597
481
  "default": "./src/build/browser/browser-runtime-manifest.js"
@@ -612,14 +496,6 @@
612
496
  "types": "./src/cache/index.d.ts",
613
497
  "default": "./src/cache/index.js"
614
498
  },
615
- "./plugins/foreign-jsx-override-plugin.ts": {
616
- "types": "./src/plugins/foreign-jsx-override-plugin.d.ts",
617
- "default": "./src/plugins/foreign-jsx-override-plugin.js"
618
- },
619
- "./plugins/alias-resolver-plugin.ts": {
620
- "types": "./src/plugins/alias-resolver-plugin.d.ts",
621
- "default": "./src/plugins/alias-resolver-plugin.js"
622
- },
623
499
  "./plugins/tsconfig-import-resolver.ts": {
624
500
  "types": "./src/plugins/tsconfig-import-resolver.d.ts",
625
501
  "default": "./src/plugins/tsconfig-import-resolver.js"
@@ -637,11 +513,6 @@
637
513
  "default": "./src/utils/hash.js",
638
514
  "types": "./src/utils/hash.d.ts"
639
515
  },
640
- "./utils/hash.ts": {
641
- "import": "./src/utils/hash.js",
642
- "default": "./src/utils/hash.js",
643
- "types": "./src/utils/hash.d.ts"
644
- },
645
516
  "./utils/resolve-entry-file.ts": {
646
517
  "import": "./src/utils/resolve-entry-file.js",
647
518
  "types": "./src/utils/resolve-entry-file.d.ts",
@@ -655,18 +526,6 @@
655
526
  "types": "./src/dev/transform-server/index.d.ts",
656
527
  "default": "./src/dev/transform-server/index.js"
657
528
  },
658
- "./dev-toolbar/dev-toolbar-runtime-paths.ts": {
659
- "types": "./src/dev-toolbar/dev-toolbar-runtime-paths.d.ts",
660
- "default": "./src/dev-toolbar/dev-toolbar-runtime-paths.js"
661
- },
662
- "./dev-toolbar/dev-toolbar-package.ts": {
663
- "types": "./src/dev-toolbar/dev-toolbar-package.d.ts",
664
- "default": "./src/dev-toolbar/dev-toolbar-package.js"
665
- },
666
- "./dev-toolbar/dev-toolbar-host.ts": {
667
- "types": "./src/dev-toolbar/dev-toolbar-host.d.ts",
668
- "default": "./src/dev-toolbar/dev-toolbar-host.js"
669
- },
670
529
  "./dev-toolbar/define-dev-tool.ts": {
671
530
  "types": "./src/dev-toolbar/define-dev-tool.d.ts",
672
531
  "default": "./src/dev-toolbar/define-dev-tool.js"
@@ -4,7 +4,7 @@ This directory contains the runtime-host integration layer for Ecopages.
4
4
 
5
5
  ## Purpose
6
6
 
7
- Adapters translate app-owned core services into concrete runtime behavior at the host boundary. Bun remains the direct core runtime, while Node compatibility is driven by the Ecopages CLI thin-host path and reuses internal adapter pieces here.
7
+ Adapters translate app-owned core services into concrete runtime behavior at the host boundary. Bun and Node are peers: with the default `adapter: 'auto'`, `createApp()` picks the Bun adapter when the process runs on Bun and the Node adapter otherwise, and the `ecopages` CLI runs apps on Bun when the command is launched through Bun (or with `--runtime bun`) and on Node otherwise.
8
8
 
9
9
  They are responsible for:
10
10
 
@@ -23,7 +23,7 @@ They are not responsible for:
23
23
  ## Main Areas
24
24
 
25
25
  - `bun/`: Bun server adapter, lifecycle coordination, bridge, HMR transport, and Bun user WebSocket lifecycle
26
- - `node/`: internal Node compatibility adapter pieces used by the CLI thin-host path
26
+ - `node/`: Node server adapter, app shell, HTTP request bridge, HMR transport, and static preview server
27
27
  - `shared/`: runtime-neutral adapter helpers used by both hosts, clustered by concern:
28
28
  - `shared/http/` — API response builders, request pipeline, middleware runner, define-api helpers, explicit-static and filesystem matchers
29
29
  - `shared/hmr/` — HMR HTML inject helpers, shared HMR manager, entrypoint registrar
@@ -43,3 +43,9 @@ Core services still own:
43
43
  - route rendering orchestration
44
44
 
45
45
  Semantic 404/500 page selection and rendering belongs to `src/services/error-pages/`; adapters only turn its rendered body into runtime responses.
46
+
47
+ ## Shared Request Contracts
48
+
49
+ - API handler errors and errors that escape `SharedServerAdapter.handleSharedRequest` resolve through `ApiRequestPipeline.handleError` on both runtimes: a thrown `Response`, then a client abort (499, Node only), then `app.onError`, then `HttpError`, then a 500 logged with its stack. `app.fetch()` therefore always resolves with a `Response`. Page render failures render the error page instead and do not reach `app.onError`.
50
+ - On Node, `attachNodeHttpWebSocketUpgrades` owns the unmatched-upgrade policy. `/_hmr` (dev only) and user routes are handled; anything else is destroyed unless `passthroughUnmatched` leaves it for a host that shares the server, such as Vite.
51
+ - HMR endpoints and Bun's `development` serve mode follow the `dev` flag only.
@@ -56,14 +56,6 @@ export interface AppStartInfo {
56
56
  routes: EcopagesRouteInfo[];
57
57
  }
58
58
  export type OnAppStartCallback = (info: AppStartInfo) => void;
59
- /** @deprecated Use {@link AppStartInfo}. */
60
- export type ApplicationListeningInfo = AppStartInfo;
61
- /** @deprecated Use {@link OnAppStartCallback}. */
62
- export type StartCallback = OnAppStartCallback;
63
- /** @deprecated Use {@link OnAppStartCallback}. */
64
- export type ListenCallback = OnAppStartCallback;
65
- /** @deprecated Use {@link OnAppStartCallback}. */
66
- export type ApplicationListeningCallback = OnAppStartCallback;
67
59
  /**
68
60
  * Configuration options for application adapters
69
61
  */
@@ -71,11 +63,6 @@ export interface ApplicationAdapterOptions {
71
63
  appConfig: EcoPagesAppConfig;
72
64
  serverOptions?: Record<string, any>;
73
65
  runtime?: ApplicationRuntimeOptions;
74
- /**
75
- * Options for clearing the output directory before starting the server
76
- * @default false
77
- */
78
- clearOutput?: boolean;
79
66
  }
80
67
  /**
81
68
  * Common interface for application adapters
@@ -116,7 +103,6 @@ export declare abstract class AbstractApplicationAdapter<TOptions extends Applic
116
103
  private onAppStartCallback?;
117
104
  protected readonly runtimeLabel: EcopagesRuntimeLabel;
118
105
  constructor(options: TOptions, runtimeLabel: EcopagesRuntimeLabel);
119
- private clearDistFolder;
120
106
  /**
121
107
  * Register a GET route handler.
122
108
  *
@@ -180,10 +166,6 @@ export declare abstract class AbstractApplicationAdapter<TOptions extends Applic
180
166
  middleware?: readonly Middleware<TRequest, TServer, any>[];
181
167
  }): this;
182
168
  abstract group(group: RouteGroupDefinition<TRequest, TServer>): this;
183
- /**
184
- * Get all registered API handlers
185
- */
186
- getApiHandlers(): ApiHandler[];
187
169
  /**
188
170
  * Register a view for static generation at build time.
189
171
  * The view must have staticPaths defined for dynamic routes.
@@ -201,10 +183,6 @@ export declare abstract class AbstractApplicationAdapter<TOptions extends Applic
201
183
  */
202
184
  static<P>(path: string, loader: ViewLoader<P> | string | URL): this;
203
185
  private resolveViewLoader;
204
- /**
205
- * Get all registered static routes
206
- */
207
- getStaticRoutes(): StaticRoute[];
208
186
  /**
209
187
  * Registers a semantic HTML error page used when no filesystem `pages/{status}.*`
210
188
  * file exists.
@@ -257,16 +235,16 @@ export declare abstract class AbstractApplicationAdapter<TOptions extends Applic
257
235
  * ```
258
236
  */
259
237
  websocket<TContext = unknown, TParams extends Record<string, string> = Record<string, string>>(path: string, handler: EcopagesWebSocketHandler<TContext, TParams>): this;
260
- /**
261
- * Get the registered WebSocket handlers map.
262
- *
263
- * @returns The map of WebSocket route patterns to handlers
264
- */
265
- getWebsocketHandlers(): Map<string, EcopagesWebSocketHandler<any, any>>;
266
238
  /**
267
239
  * Register a global error handler for all routes.
268
240
  * Useful for logging, monitoring integration, and custom error formatting.
269
241
  *
242
+ * @remarks
243
+ * It receives errors thrown by API handlers and their middleware, and errors
244
+ * that escape the request pipeline. Page render failures render the error
245
+ * page instead and do not reach it. Client disconnects answer 499 without
246
+ * calling it.
247
+ *
270
248
  * @example
271
249
  * ```typescript
272
250
  * app.onError(async (error, ctx) => {
@@ -276,10 +254,6 @@ export declare abstract class AbstractApplicationAdapter<TOptions extends Applic
276
254
  * ```
277
255
  */
278
256
  onError(handler: ErrorHandler<TRequest, TServer>): this;
279
- /**
280
- * Get the registered error handler
281
- */
282
- getErrorHandler(): ErrorHandler | undefined;
283
257
  /**
284
258
  * Initialize the server adapter based on the runtime
285
259
  */
@@ -12,7 +12,6 @@ import { createViewModuleLoader } from '../../services/module-loading/view-modul
12
12
  import { getHostModuleLoader } from '../../services/module-loading/host-module-loader-registry.js';
13
13
  import { invariant } from '../../utils/invariant.js';
14
14
  import { ERROR_PAGE_KIND_BY_STATUS } from '../../errors/http-error-page-contract.js';
15
- import { fileSystem } from '@ecopages/file-system';
16
15
  import { formatRuntimeServerStartedMessage, } from '../../dev/runtime-server-started-message.js';
17
16
  import { parseCliArgs } from '../../utils/parse-cli-args.js';
18
17
  import { startupTrace } from '../../diagnostics/startup-trace.js';
@@ -54,24 +53,6 @@ export class AbstractApplicationAdapter {
54
53
  }
55
54
  getAppModuleLoader(this.appConfig);
56
55
  startupTrace.markConfigReady();
57
- if (options.clearOutput) {
58
- this.clearDistFolder().catch((error) => {
59
- appLogger.error('Error clearing dist folder', error);
60
- });
61
- }
62
- }
63
- async clearDistFolder() {
64
- const distPath = this.appConfig.absolutePaths.distDir;
65
- const distExists = fileSystem.exists(distPath);
66
- if (!distExists)
67
- return;
68
- try {
69
- await fileSystem.removeAsync(distPath);
70
- appLogger.debug(`Cleared dist folder: ${distPath}`);
71
- }
72
- catch (error) {
73
- appLogger.error(`Error clearing dist folder: ${distPath}`, error);
74
- }
75
56
  }
76
57
  /**
77
58
  * Internal method to add route handlers to the API handlers array
@@ -88,12 +69,6 @@ export class AbstractApplicationAdapter {
88
69
  });
89
70
  return this;
90
71
  }
91
- /**
92
- * Get all registered API handlers
93
- */
94
- getApiHandlers() {
95
- return this.apiHandlers;
96
- }
97
72
  /**
98
73
  * Register a view for static generation at build time.
99
74
  * The view must have staticPaths defined for dynamic routes.
@@ -119,12 +94,6 @@ export class AbstractApplicationAdapter {
119
94
  ? createViewModuleLoader(this.appConfig, loader)
120
95
  : loader;
121
96
  }
122
- /**
123
- * Get all registered static routes
124
- */
125
- getStaticRoutes() {
126
- return this.staticRoutes;
127
- }
128
97
  /**
129
98
  * Registers a semantic HTML error page used when no filesystem `pages/{status}.*`
130
99
  * file exists.
@@ -214,18 +183,16 @@ export class AbstractApplicationAdapter {
214
183
  this.websocketHandlers.set(path, handler);
215
184
  return this;
216
185
  }
217
- /**
218
- * Get the registered WebSocket handlers map.
219
- *
220
- * @returns The map of WebSocket route patterns to handlers
221
- */
222
- getWebsocketHandlers() {
223
- return this.websocketHandlers;
224
- }
225
186
  /**
226
187
  * Register a global error handler for all routes.
227
188
  * Useful for logging, monitoring integration, and custom error formatting.
228
189
  *
190
+ * @remarks
191
+ * It receives errors thrown by API handlers and their middleware, and errors
192
+ * that escape the request pipeline. Page render failures render the error
193
+ * page instead and do not reach it. Client disconnects answer 499 without
194
+ * calling it.
195
+ *
229
196
  * @example
230
197
  * ```typescript
231
198
  * app.onError(async (error, ctx) => {
@@ -238,12 +205,6 @@ export class AbstractApplicationAdapter {
238
205
  this.errorHandler = handler;
239
206
  return this;
240
207
  }
241
- /**
242
- * Get the registered error handler
243
- */
244
- getErrorHandler() {
245
- return this.errorHandler;
246
- }
247
208
  /**
248
209
  * Boot the server. When `onAppStart` is passed, it runs once the runtime can take traffic.
249
210
  * Embedded apps only register the callback — the host (for example Vite) boots the port.
@@ -4,9 +4,4 @@ export type WebSocketRouteMatch = {
4
4
  params: Record<string, string>;
5
5
  kind: string;
6
6
  };
7
- /**
8
- * Pattern matcher for WebSocket route paths.
9
- */
10
- export declare function matchWebSocketPath(pattern: string, pathname: string): Record<string, string> | null;
11
- export declare function scoreWebSocketPattern(pattern: string): number;
12
7
  export declare function findWebSocketRoute(handlers: Map<string, EcopagesWebSocketHandler<any, any>>, pathname: string): WebSocketRouteMatch | null;
@@ -1,13 +1,4 @@
1
1
  import { matchColonSegmentPath, scoreColonSegmentPath } from './segment-path-matcher.js';
2
- /**
3
- * Pattern matcher for WebSocket route paths.
4
- */
5
- export function matchWebSocketPath(pattern, pathname) {
6
- return matchColonSegmentPath(pattern, pathname);
7
- }
8
- export function scoreWebSocketPattern(pattern) {
9
- return scoreColonSegmentPath(pattern);
10
- }
11
2
  export function findWebSocketRoute(handlers, pathname) {
12
3
  let best = null;
13
4
  let index = 0;
@@ -10,6 +10,7 @@
10
10
  import type { Server } from 'bun';
11
11
  import type { ApiHandlerContext, EcopagesRouteInfo, RouteGroupBuilder } from '../../types/public-types.js';
12
12
  import { SharedApplicationAdapter } from '../shared/runtime/application-adapter.js';
13
+ import type { WebSocketUpgradeOptions } from '../shared/ws/node-http-websocket-upgrades.js';
13
14
  import type { RuntimeHost } from '../shared/runtime/runtime-host.js';
14
15
  import type { ResolvedEcopagesAppOptions } from '../create-app.js';
15
16
  import { type BunServerAdapterResult } from './server-adapter.js';
@@ -36,14 +37,7 @@ export declare class BunEcopagesApp<WebSocketData = undefined> extends SharedApp
36
37
  runtimeHost: RuntimeHost<Server<WebSocketData>, Bun.Serve.Options<WebSocketData>>;
37
38
  });
38
39
  fetch(request: Request): Promise<Response>;
39
- attachWebSocketUpgrades(httpServer: import('node:http').Server, options?: {
40
- passthroughUnmatched?: boolean;
41
- }): Promise<void>;
42
- /**
43
- * Complete the initialization of the server adapter by processing dynamic routes
44
- * @param server The Bun server instance
45
- */
46
- completeInitialization(server: Server<WebSocketData>): Promise<void>;
40
+ attachWebSocketUpgrades(httpServer: import('node:http').Server, options?: WebSocketUpgradeOptions): Promise<void>;
47
41
  /**
48
42
  * Initialize the Bun server adapter
49
43
  */
@@ -51,11 +45,13 @@ export declare class BunEcopagesApp<WebSocketData = undefined> extends SharedApp
51
45
  private ensureServerAdapterReady;
52
46
  private bootPreviewServeOnly;
53
47
  private bootStaticWithoutRuntimeServer;
54
- private runStaticBuildOnRuntimeServer;
55
48
  /**
56
- * Start the Bun application server
57
- * @param options Optional settings
58
- * @param options.autoCompleteInitialization Whether to automatically complete initialization with dynamic routes after server start (defaults to true)
49
+ * Starts the Bun application server, or runs the preview/build flow when the
50
+ * CLI requested one.
51
+ *
52
+ * @remarks
53
+ * HMR endpoints and Bun's `development` serve mode follow the `dev` flag only,
54
+ * matching the options `completeInitialization()` reloads the server with.
59
55
  */
60
56
  protected bootServer(): Promise<Server<WebSocketData> | void>;
61
57
  stop(force?: boolean): Promise<void>;