@ecopages/core 0.2.0-beta.25 → 0.2.0-beta.27

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 (144) hide show
  1. package/package.json +58 -50
  2. package/src/adapters/bun/server-adapter.js +2 -2
  3. package/src/adapters/node/server-adapter.js +2 -2
  4. package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +10 -0
  5. package/src/adapters/shared/hmr-entrypoint-registrar.js +34 -10
  6. package/src/adapters/shared/runtime-server-lifecycle.js +1 -1
  7. package/src/adapters/shared/server-static-builder.d.ts +2 -1
  8. package/src/adapters/shared/server-static-builder.js +16 -14
  9. package/src/adapters/shared/shared-hmr-manager.d.ts +11 -4
  10. package/src/adapters/shared/shared-hmr-manager.js +22 -3
  11. package/src/build/README.md +92 -46
  12. package/src/build/app-build-manifest-runtime.d.ts +28 -2
  13. package/src/build/app-build-manifest-runtime.js +26 -10
  14. package/src/build/{browser-runtime-plugin.d.ts → browser/browser-runtime-plugin.d.ts} +1 -1
  15. package/src/build/{browser-runtime-plugin.js → browser/browser-runtime-plugin.js} +1 -1
  16. package/src/build/{jsx-ownership-plugins.d.ts → browser/jsx-ownership-plugins.d.ts} +2 -2
  17. package/src/build/{jsx-ownership-plugins.js → browser/jsx-ownership-plugins.js} +2 -2
  18. package/src/build/build-adapter.d.ts +18 -21
  19. package/src/build/build-adapter.js +8 -43
  20. package/src/build/{build-input-fingerprint.d.ts → cache/build-input-fingerprint.d.ts} +3 -3
  21. package/src/build/cache/cache-constants.d.ts +4 -0
  22. package/src/build/cache/cache-constants.js +6 -0
  23. package/src/build/cache/cache-keys.d.ts +22 -0
  24. package/src/build/cache/cache-keys.js +63 -0
  25. package/src/build/{dev-browser-script-cache.d.ts → cache/dev-browser-script-cache.d.ts} +2 -2
  26. package/src/build/{dev-browser-script-cache.js → cache/dev-browser-script-cache.js} +4 -4
  27. package/src/build/{pages-unified-graph-build.d.ts → cache/pages-unified-graph-build.d.ts} +1 -1
  28. package/src/build/{pages-unified-graph-build.js → cache/pages-unified-graph-build.js} +18 -26
  29. package/src/build/{production-build-cache.d.ts → cache/production-build-cache.d.ts} +1 -1
  30. package/src/build/{production-build-cache.js → cache/production-build-cache.js} +2 -2
  31. package/src/build/{server-entry-build-cache.d.ts → cache/server-entry-build-cache.d.ts} +3 -4
  32. package/src/build/{server-entry-build-cache.js → cache/server-entry-build-cache.js} +16 -12
  33. package/src/build/{build-contracts.d.ts → contracts/build-contracts.d.ts} +1 -2
  34. package/src/build/contracts/build-manifest.d.ts +90 -0
  35. package/src/build/{build-manifest.js → contracts/build-manifest.js} +2 -2
  36. package/src/build/{rolldown-adapter-helpers.d.ts → rolldown/rolldown-adapter-helpers.d.ts} +20 -3
  37. package/src/build/{rolldown-adapter-helpers.js → rolldown/rolldown-adapter-helpers.js} +26 -6
  38. package/src/build/{rolldown-build-adapter.d.ts → rolldown/rolldown-build-adapter.d.ts} +1 -1
  39. package/src/build/{rolldown-plugin-bridge.d.ts → rolldown/rolldown-plugin-bridge.d.ts} +2 -2
  40. package/src/build/{rolldown-plugin-bridge.js → rolldown/rolldown-plugin-bridge.js} +1 -1
  41. package/src/build/{rolldown-source-transform-pass.d.ts → rolldown/rolldown-source-transform-pass.d.ts} +1 -1
  42. package/src/build/{rolldown-source-transform-pass.js → rolldown/rolldown-source-transform-pass.js} +4 -1
  43. package/src/build/{runtime-build-output-normalizer.js → rolldown/runtime-build-output-normalizer.js} +2 -2
  44. package/src/build/{build-profile-options.d.ts → runtime/build-profile-options.d.ts} +2 -2
  45. package/src/build/runtime/build-request-identity.d.ts +17 -0
  46. package/src/build/runtime/build-request-identity.js +54 -0
  47. package/src/build/runtime/build-request-policy.d.ts +59 -0
  48. package/src/build/runtime/build-request-policy.js +46 -0
  49. package/src/build/{build-runtime.d.ts → runtime/build-runtime.d.ts} +8 -4
  50. package/src/build/{build-runtime.js → runtime/build-runtime.js} +11 -11
  51. package/src/build/{deduping-build-executor.d.ts → runtime/deduping-build-executor.d.ts} +2 -9
  52. package/src/build/runtime/deduping-build-executor.js +34 -0
  53. package/src/build/{parallel-build-executor.d.ts → runtime/parallel-build-executor.d.ts} +1 -1
  54. package/src/build/{serialized-build-executor.d.ts → runtime/serialized-build-executor.d.ts} +1 -1
  55. package/src/config/config-builder.d.ts +1 -1
  56. package/src/diagnostics/startup-trace.d.ts +49 -2
  57. package/src/diagnostics/startup-trace.js +140 -8
  58. package/src/hmr/client/hmr-runtime.js +1 -1
  59. package/src/hmr/hmr-file-change-prep.d.ts +10 -0
  60. package/src/hmr/hmr-file-change-prep.js +17 -0
  61. package/src/plugins/alias-resolver-plugin.d.ts +1 -1
  62. package/src/plugins/eco-component-meta-plugin.d.ts +1 -1
  63. package/src/plugins/foreign-jsx-override-plugin.d.ts +1 -1
  64. package/src/plugins/integration-plugin.d.ts +16 -5
  65. package/src/plugins/integration-plugin.js +11 -1
  66. package/src/plugins/processor.d.ts +28 -8
  67. package/src/plugins/source-transform.d.ts +1 -1
  68. package/src/route-renderer/GRAPH.md +13 -19
  69. package/src/route-renderer/README.md +1 -1
  70. package/src/route-renderer/orchestration/component-render-context.d.ts +4 -4
  71. package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +6 -2
  72. package/src/route-renderer/orchestration/integration-renderer.d.ts +11 -52
  73. package/src/route-renderer/orchestration/integration-renderer.js +38 -91
  74. package/src/route-renderer/orchestration/integration-route-render-adapter.d.ts +1 -8
  75. package/src/route-renderer/orchestration/integration-route-render-adapter.js +0 -2
  76. package/src/route-renderer/orchestration/page-browser-graph-session.d.ts +106 -0
  77. package/src/route-renderer/orchestration/page-browser-graph-session.js +436 -0
  78. package/src/route-renderer/orchestration/page-browser-graph.service.d.ts +9 -3
  79. package/src/route-renderer/orchestration/page-browser-graph.service.js +89 -40
  80. package/src/route-renderer/orchestration/render-output.utils.d.ts +14 -0
  81. package/src/route-renderer/orchestration/render-output.utils.js +30 -0
  82. package/src/route-renderer/orchestration/route-html-finalization.service.d.ts +0 -1
  83. package/src/route-renderer/orchestration/route-html-finalization.service.js +4 -9
  84. package/src/route-renderer/orchestration/route-prepared-options.builder.d.ts +1 -2
  85. package/src/route-renderer/orchestration/route-prepared-options.builder.js +1 -10
  86. package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +3 -12
  87. package/src/route-renderer/orchestration/route-render-orchestrator.js +4 -14
  88. package/src/services/assets/asset-processing-service/asset-dependency-keys.d.ts +13 -0
  89. package/src/services/assets/asset-processing-service/asset-dependency-keys.js +3 -0
  90. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +3 -1
  91. package/src/services/assets/asset-processing-service/asset-processing.service.js +4 -2
  92. package/src/services/assets/asset-processing-service/assets.types.d.ts +1 -1
  93. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +1 -1
  94. package/src/services/assets/asset-processing-service/grouped-content-bundles.js +19 -3
  95. package/src/services/assets/asset-processing-service/inline-content-script-body.d.ts +11 -0
  96. package/src/services/assets/asset-processing-service/inline-content-script-body.js +17 -0
  97. package/src/services/assets/asset-processing-service/materialize-content-script-asset.d.ts +4 -6
  98. package/src/services/assets/asset-processing-service/materialize-content-script-asset.js +2 -1
  99. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +0 -2
  100. package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +2 -15
  101. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +3 -2
  102. package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +33 -54
  103. package/src/services/assets/browser-bundle.service.d.ts +27 -31
  104. package/src/services/assets/browser-bundle.service.js +12 -23
  105. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +8 -0
  106. package/src/services/module-loading/app-server-module-transpiler.service.js +1 -7
  107. package/src/services/module-loading/page-module-import.service.d.ts +1 -1
  108. package/src/services/module-loading/page-module-import.service.js +40 -28
  109. package/src/services/module-loading/route-module-build-cache.store.js +1 -1
  110. package/src/services/module-loading/route-module-build-manifest.d.ts +2 -9
  111. package/src/services/module-loading/route-module-build-manifest.js +12 -43
  112. package/src/services/module-loading/server-module-transpiler.service.d.ts +1 -1
  113. package/src/static-site-generator/README.md +1 -1
  114. package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +28 -0
  115. package/src/static-site-generator/production-page-browser-graph-prebuild.js +22 -0
  116. package/src/static-site-generator/static-build-invalidation.d.ts +2 -2
  117. package/src/static-site-generator/static-build-invalidation.js +3 -3
  118. package/src/static-site-generator/static-site-generator.js +23 -1
  119. package/src/types/internal-types.d.ts +10 -4
  120. package/src/types/public-types.d.ts +58 -9
  121. package/src/watchers/project-watcher.js +12 -2
  122. package/src/build/build-manifest.d.ts +0 -33
  123. package/src/build/deduping-build-executor.js +0 -56
  124. package/src/build/runtime-build-executor.d.ts +0 -14
  125. package/src/build/runtime-build-executor.js +0 -16
  126. /package/src/build/{browser-runtime-manifest.d.ts → browser/browser-runtime-manifest.d.ts} +0 -0
  127. /package/src/build/{browser-runtime-manifest.js → browser/browser-runtime-manifest.js} +0 -0
  128. /package/src/build/{browser-runtime-plugin-helpers.d.ts → browser/browser-runtime-plugin-helpers.d.ts} +0 -0
  129. /package/src/build/{browser-runtime-plugin-helpers.js → browser/browser-runtime-plugin-helpers.js} +0 -0
  130. /package/src/build/{lit-static-render-worker-context.d.ts → browser/lit-static-render-worker-context.d.ts} +0 -0
  131. /package/src/build/{lit-static-render-worker-context.js → browser/lit-static-render-worker-context.js} +0 -0
  132. /package/src/build/{build-input-fingerprint.js → cache/build-input-fingerprint.js} +0 -0
  133. /package/src/build/{build-contracts.js → contracts/build-contracts.js} +0 -0
  134. /package/src/build/{build-types.d.ts → contracts/build-types.d.ts} +0 -0
  135. /package/src/build/{build-types.js → contracts/build-types.js} +0 -0
  136. /package/src/build/{rolldown-build-adapter.js → rolldown/rolldown-build-adapter.js} +0 -0
  137. /package/src/build/{rolldown-build-invocation-metrics.d.ts → rolldown/rolldown-build-invocation-metrics.d.ts} +0 -0
  138. /package/src/build/{rolldown-build-invocation-metrics.js → rolldown/rolldown-build-invocation-metrics.js} +0 -0
  139. /package/src/build/{runtime-build-output-normalizer.d.ts → rolldown/runtime-build-output-normalizer.d.ts} +0 -0
  140. /package/src/build/{server-side-css-shim-plugin.d.ts → rolldown/server-side-css-shim-plugin.d.ts} +0 -0
  141. /package/src/build/{server-side-css-shim-plugin.js → rolldown/server-side-css-shim-plugin.js} +0 -0
  142. /package/src/build/{build-profile-options.js → runtime/build-profile-options.js} +0 -0
  143. /package/src/build/{parallel-build-executor.js → runtime/parallel-build-executor.js} +0 -0
  144. /package/src/build/{serialized-build-executor.js → runtime/serialized-build-executor.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/core",
3
- "version": "0.2.0-beta.25",
3
+ "version": "0.2.0-beta.27",
4
4
  "description": "Core package for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -17,7 +17,7 @@
17
17
  "directory": "packages/core"
18
18
  },
19
19
  "dependencies": {
20
- "@ecopages/file-system": "0.2.0-beta.25",
20
+ "@ecopages/file-system": "0.2.0-beta.27",
21
21
  "@ecopages/logger": "^0.2.3",
22
22
  "@ecopages/scripts-injector": "^0.1.5",
23
23
  "@oxc-project/runtime": "0.134.0",
@@ -116,6 +116,10 @@
116
116
  "types": "./src/config/constants.d.ts",
117
117
  "default": "./src/config/constants.js"
118
118
  },
119
+ "./diagnostics/startup-trace": {
120
+ "types": "./src/diagnostics/startup-trace.d.ts",
121
+ "default": "./src/diagnostics/startup-trace.js"
122
+ },
119
123
  "./bun": {
120
124
  "types": "./src/adapters/bun/index.d.ts",
121
125
  "default": "./src/adapters/bun/index.js"
@@ -124,6 +128,10 @@
124
128
  "types": "./src/hmr/hmr-strategy.d.ts",
125
129
  "default": "./src/hmr/hmr-strategy.js"
126
130
  },
131
+ "./hmr/hmr-file-change-prep": {
132
+ "types": "./src/hmr/hmr-file-change-prep.d.ts",
133
+ "default": "./src/hmr/hmr-file-change-prep.js"
134
+ },
127
135
  "./hmr/client/hmr-runtime": {
128
136
  "types": "./src/hmr/client/hmr-runtime.d.ts",
129
137
  "default": "./src/hmr/client/hmr-runtime.js"
@@ -165,52 +173,48 @@
165
173
  "default": "./src/plugins/source-transform.js"
166
174
  },
167
175
  "./build/build-types": {
168
- "types": "./src/build/build-types.d.ts",
169
- "default": "./src/build/build-types.js"
176
+ "types": "./src/build/contracts/build-types.d.ts",
177
+ "default": "./src/build/contracts/build-types.js"
170
178
  },
171
179
  "./build/build-adapter": {
172
180
  "types": "./src/build/build-adapter.d.ts",
173
181
  "default": "./src/build/build-adapter.js"
174
182
  },
175
- "./build/runtime-build-executor": {
176
- "types": "./src/build/runtime-build-executor.d.ts",
177
- "default": "./src/build/runtime-build-executor.js"
178
- },
179
183
  "./build/build-runtime": {
180
- "types": "./src/build/build-runtime.d.ts",
181
- "default": "./src/build/build-runtime.js"
184
+ "types": "./src/build/runtime/build-runtime.d.ts",
185
+ "default": "./src/build/runtime/build-runtime.js"
182
186
  },
183
187
  "./build/build-contracts": {
184
- "types": "./src/build/build-contracts.d.ts",
185
- "default": "./src/build/build-contracts.js"
188
+ "types": "./src/build/contracts/build-contracts.d.ts",
189
+ "default": "./src/build/contracts/build-contracts.js"
186
190
  },
187
191
  "./build/production-build-cache": {
188
- "types": "./src/build/production-build-cache.d.ts",
189
- "default": "./src/build/production-build-cache.js"
192
+ "types": "./src/build/cache/production-build-cache.d.ts",
193
+ "default": "./src/build/cache/production-build-cache.js"
190
194
  },
191
195
  "./build/server-entry-build-cache": {
192
- "types": "./src/build/server-entry-build-cache.d.ts",
193
- "default": "./src/build/server-entry-build-cache.js"
196
+ "types": "./src/build/cache/server-entry-build-cache.d.ts",
197
+ "default": "./src/build/cache/server-entry-build-cache.js"
194
198
  },
195
199
  "./build/runtime-build-output-normalizer": {
196
- "types": "./src/build/runtime-build-output-normalizer.d.ts",
197
- "default": "./src/build/runtime-build-output-normalizer.js"
200
+ "types": "./src/build/rolldown/runtime-build-output-normalizer.d.ts",
201
+ "default": "./src/build/rolldown/runtime-build-output-normalizer.js"
198
202
  },
199
203
  "./build/browser-runtime-manifest": {
200
- "types": "./src/build/browser-runtime-manifest.d.ts",
201
- "default": "./src/build/browser-runtime-manifest.js"
204
+ "types": "./src/build/browser/browser-runtime-manifest.d.ts",
205
+ "default": "./src/build/browser/browser-runtime-manifest.js"
202
206
  },
203
207
  "./build/browser-runtime-plugin": {
204
- "types": "./src/build/browser-runtime-plugin.d.ts",
205
- "default": "./src/build/browser-runtime-plugin.js"
208
+ "types": "./src/build/browser/browser-runtime-plugin.d.ts",
209
+ "default": "./src/build/browser/browser-runtime-plugin.js"
206
210
  },
207
211
  "./build/jsx-ownership-plugins": {
208
- "types": "./src/build/jsx-ownership-plugins.d.ts",
209
- "default": "./src/build/jsx-ownership-plugins.js"
212
+ "types": "./src/build/browser/jsx-ownership-plugins.d.ts",
213
+ "default": "./src/build/browser/jsx-ownership-plugins.js"
210
214
  },
211
215
  "./build/lit-static-render-worker-context": {
212
- "types": "./src/build/lit-static-render-worker-context.d.ts",
213
- "default": "./src/build/lit-static-render-worker-context.js"
216
+ "types": "./src/build/browser/lit-static-render-worker-context.d.ts",
217
+ "default": "./src/build/browser/lit-static-render-worker-context.js"
214
218
  },
215
219
  "./cache": {
216
220
  "types": "./src/cache/index.d.ts",
@@ -337,6 +341,10 @@
337
341
  "types": "./src/config/constants.d.ts",
338
342
  "default": "./src/config/constants.js"
339
343
  },
344
+ "./diagnostics/startup-trace.ts": {
345
+ "types": "./src/diagnostics/startup-trace.d.ts",
346
+ "default": "./src/diagnostics/startup-trace.js"
347
+ },
340
348
  "./bun.ts": {
341
349
  "types": "./src/adapters/bun/index.d.ts",
342
350
  "default": "./src/adapters/bun/index.js"
@@ -345,6 +353,10 @@
345
353
  "types": "./src/hmr/hmr-strategy.d.ts",
346
354
  "default": "./src/hmr/hmr-strategy.js"
347
355
  },
356
+ "./hmr/hmr-file-change-prep.ts": {
357
+ "types": "./src/hmr/hmr-file-change-prep.d.ts",
358
+ "default": "./src/hmr/hmr-file-change-prep.js"
359
+ },
348
360
  "./hmr/client/hmr-runtime.ts": {
349
361
  "types": "./src/hmr/client/hmr-runtime.d.ts",
350
362
  "default": "./src/hmr/client/hmr-runtime.js"
@@ -386,52 +398,48 @@
386
398
  "default": "./src/plugins/source-transform.js"
387
399
  },
388
400
  "./build/build-types.ts": {
389
- "types": "./src/build/build-types.d.ts",
390
- "default": "./src/build/build-types.js"
401
+ "types": "./src/build/contracts/build-types.d.ts",
402
+ "default": "./src/build/contracts/build-types.js"
391
403
  },
392
404
  "./build/build-adapter.ts": {
393
405
  "types": "./src/build/build-adapter.d.ts",
394
406
  "default": "./src/build/build-adapter.js"
395
407
  },
396
- "./build/runtime-build-executor.ts": {
397
- "types": "./src/build/runtime-build-executor.d.ts",
398
- "default": "./src/build/runtime-build-executor.js"
399
- },
400
408
  "./build/build-runtime.ts": {
401
- "types": "./src/build/build-runtime.d.ts",
402
- "default": "./src/build/build-runtime.js"
409
+ "types": "./src/build/runtime/build-runtime.d.ts",
410
+ "default": "./src/build/runtime/build-runtime.js"
403
411
  },
404
412
  "./build/build-contracts.ts": {
405
- "types": "./src/build/build-contracts.d.ts",
406
- "default": "./src/build/build-contracts.js"
413
+ "types": "./src/build/contracts/build-contracts.d.ts",
414
+ "default": "./src/build/contracts/build-contracts.js"
407
415
  },
408
416
  "./build/production-build-cache.ts": {
409
- "types": "./src/build/production-build-cache.d.ts",
410
- "default": "./src/build/production-build-cache.js"
417
+ "types": "./src/build/cache/production-build-cache.d.ts",
418
+ "default": "./src/build/cache/production-build-cache.js"
411
419
  },
412
420
  "./build/server-entry-build-cache.ts": {
413
- "types": "./src/build/server-entry-build-cache.d.ts",
414
- "default": "./src/build/server-entry-build-cache.js"
421
+ "types": "./src/build/cache/server-entry-build-cache.d.ts",
422
+ "default": "./src/build/cache/server-entry-build-cache.js"
415
423
  },
416
424
  "./build/runtime-build-output-normalizer.ts": {
417
- "types": "./src/build/runtime-build-output-normalizer.d.ts",
418
- "default": "./src/build/runtime-build-output-normalizer.js"
425
+ "types": "./src/build/rolldown/runtime-build-output-normalizer.d.ts",
426
+ "default": "./src/build/rolldown/runtime-build-output-normalizer.js"
419
427
  },
420
428
  "./build/browser-runtime-manifest.ts": {
421
- "types": "./src/build/browser-runtime-manifest.d.ts",
422
- "default": "./src/build/browser-runtime-manifest.js"
429
+ "types": "./src/build/browser/browser-runtime-manifest.d.ts",
430
+ "default": "./src/build/browser/browser-runtime-manifest.js"
423
431
  },
424
432
  "./build/browser-runtime-plugin.ts": {
425
- "types": "./src/build/browser-runtime-plugin.d.ts",
426
- "default": "./src/build/browser-runtime-plugin.js"
433
+ "types": "./src/build/browser/browser-runtime-plugin.d.ts",
434
+ "default": "./src/build/browser/browser-runtime-plugin.js"
427
435
  },
428
436
  "./build/jsx-ownership-plugins.ts": {
429
- "types": "./src/build/jsx-ownership-plugins.d.ts",
430
- "default": "./src/build/jsx-ownership-plugins.js"
437
+ "types": "./src/build/browser/jsx-ownership-plugins.d.ts",
438
+ "default": "./src/build/browser/jsx-ownership-plugins.js"
431
439
  },
432
440
  "./build/lit-static-render-worker-context.ts": {
433
- "types": "./src/build/lit-static-render-worker-context.d.ts",
434
- "default": "./src/build/lit-static-render-worker-context.js"
441
+ "types": "./src/build/browser/lit-static-render-worker-context.d.ts",
442
+ "default": "./src/build/browser/lit-static-render-worker-context.js"
435
443
  },
436
444
  "./cache.ts": {
437
445
  "types": "./src/cache/index.d.ts",
@@ -6,7 +6,7 @@ import { createRequire } from "../../utils/locals-utils.js";
6
6
  import { findWebSocketRoute } from "../abstract/ws-pattern-matcher.js";
7
7
  import { fileSystem } from "@ecopages/file-system";
8
8
  import { setupAppRuntimePlugins } from "../../build/build-adapter.js";
9
- import { installAppRuntimeBuildExecutor } from "../../build/runtime-build-executor.js";
9
+ import { installBuildRuntime } from "../../build/runtime/build-runtime.js";
10
10
  import { StaticSiteGenerator } from "../../static-site-generator/static-site-generator.js";
11
11
  import { ProjectWatcher } from "../../watchers/project-watcher.js";
12
12
  import { SharedServerAdapter } from "../shared/server-adapter.js";
@@ -156,7 +156,7 @@ class BunServerAdapter extends SharedServerAdapter {
156
156
  * Initializes the server adapter's core runtime components.
157
157
  */
158
158
  async initialize() {
159
- installAppRuntimeBuildExecutor(this.appConfig);
159
+ installBuildRuntime(this.appConfig);
160
160
  this.staticSiteGenerator = new StaticSiteGenerator({ appConfig: this.appConfig });
161
161
  prepareRuntimePublicDir(this.appConfig);
162
162
  const staticBuilderOptions = {
@@ -2,7 +2,7 @@ import {} from "node:http";
2
2
  import path from "node:path";
3
3
  import { fileSystem } from "@ecopages/file-system";
4
4
  import { setupAppRuntimePlugins } from "../../build/build-adapter.js";
5
- import { installAppRuntimeBuildExecutor } from "../../build/runtime-build-executor.js";
5
+ import { installBuildRuntime } from "../../build/runtime/build-runtime.js";
6
6
  import { appLogger } from "../../global/app-logger.js";
7
7
  import { NodeClientBridge } from "./node-client-bridge.js";
8
8
  import { NodeHmrManager } from "./node-hmr-manager.js";
@@ -114,7 +114,7 @@ class NodeServerAdapter extends SharedServerAdapter {
114
114
  * processors during their `setup()` calls.
115
115
  */
116
116
  async initialize() {
117
- installAppRuntimeBuildExecutor(this.appConfig);
117
+ installBuildRuntime(this.appConfig);
118
118
  prepareRuntimePublicDir(this.appConfig);
119
119
  if (!this.deferRuntimeAssetSetup) {
120
120
  await setupAppRuntimePlugins({
@@ -35,6 +35,16 @@ export declare class HmrEntrypointRegistrar {
35
35
  getRegistered(): ReadonlyMap<string, ResolvedHmrEntrypoint>;
36
36
  getWatchedFiles(): Map<string, string>;
37
37
  clearRegistration(entrypointPath: string): void;
38
+ /**
39
+ * Registers an already-materialized HMR entrypoint without running the emit hook.
40
+ *
41
+ * @remarks
42
+ * Cold dev batches build entrypoints in grouped Rolldown passes and then seed
43
+ * the registrar so the first SSR can resolve the artifact without rebuilding.
44
+ * The source path is committed verbatim so `getResolvedScriptOutput()` and the
45
+ * file watcher see it as a regular watched entrypoint.
46
+ */
47
+ seedResolvedEntrypoint(resolved: ResolvedHmrEntrypoint): void;
38
48
  clearAll(): void;
39
49
  /**
40
50
  * Registers a single source entrypoint and returns its verified HMR artifact.
@@ -24,6 +24,22 @@ class HmrEntrypointRegistrar {
24
24
  clearRegistration(entrypointPath) {
25
25
  this.registered.delete(path.resolve(entrypointPath));
26
26
  }
27
+ /**
28
+ * Registers an already-materialized HMR entrypoint without running the emit hook.
29
+ *
30
+ * @remarks
31
+ * Cold dev batches build entrypoints in grouped Rolldown passes and then seed
32
+ * the registrar so the first SSR can resolve the artifact without rebuilding.
33
+ * The source path is committed verbatim so `getResolvedScriptOutput()` and the
34
+ * file watcher see it as a regular watched entrypoint.
35
+ */
36
+ seedResolvedEntrypoint(resolved) {
37
+ this.registered.set(path.resolve(resolved.sourcePath), {
38
+ sourcePath: resolved.sourcePath,
39
+ outputPath: resolved.outputPath,
40
+ outputUrl: resolved.outputUrl
41
+ });
42
+ }
27
43
  clearAll() {
28
44
  this.inFlight.clear();
29
45
  this.registered.clear();
@@ -58,23 +74,31 @@ class HmrEntrypointRegistrar {
58
74
  }
59
75
  }
60
76
  async registerEntrypointInternal(entrypointPath, registrationOptions) {
77
+ const previous = this.registered.get(entrypointPath);
61
78
  const { outputPath, outputUrl } = resolveHmrEntrypointOutputPaths(
62
79
  this.options.srcDir,
63
80
  this.options.distDir,
64
81
  entrypointPath
65
82
  );
66
83
  removeStaleHmrEntrypointOutput(outputPath, "HMR");
67
- await registrationOptions.emit(entrypointPath, outputPath);
68
- if (!fileSystem.exists(outputPath)) {
69
- throw registrationOptions.getMissingOutputError(entrypointPath, outputPath);
84
+ try {
85
+ await registrationOptions.emit(entrypointPath, outputPath);
86
+ if (!fileSystem.exists(outputPath)) {
87
+ throw registrationOptions.getMissingOutputError(entrypointPath, outputPath);
88
+ }
89
+ const resolved = {
90
+ sourcePath: entrypointPath,
91
+ outputPath,
92
+ outputUrl
93
+ };
94
+ this.registered.set(entrypointPath, resolved);
95
+ return resolved;
96
+ } catch (error) {
97
+ if (previous && fileSystem.exists(previous.outputPath)) {
98
+ this.registered.set(entrypointPath, previous);
99
+ }
100
+ throw error;
70
101
  }
71
- const resolved = {
72
- sourcePath: entrypointPath,
73
- outputPath,
74
- outputUrl
75
- };
76
- this.registered.set(entrypointPath, resolved);
77
- return resolved;
78
102
  }
79
103
  }
80
104
  export {
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { fileSystem } from "@ecopages/file-system";
3
3
  import { RESOLVED_ASSETS_DIR } from "../../config/constants.js";
4
- import { disposeAppBuildRuntime } from "../../build/build-runtime.js";
4
+ import { disposeAppBuildRuntime } from "../../build/runtime/build-runtime.js";
5
5
  import { copyRuntimePublicDirIfChanged } from "./copy-runtime-public-dir.js";
6
6
  import { clearAppDevClientBridge } from "../../dev/client-bridge-registry.js";
7
7
  import { clearAppHmrManager } from "../../dev/hmr-manager-registry.js";
@@ -1,5 +1,5 @@
1
1
  import type { EcoPagesAppConfig, IHmrManager } from '../../types/internal-types.js';
2
- import type { EcoBuildPlugin } from '../../build/build-types.js';
2
+ import type { EcoBuildPlugin } from '../../build/contracts/build-types.js';
3
3
  import type { StaticRoute } from '../../types/public-types.js';
4
4
  import type { RouteRegistry } from '../../router/server/route-registry.js';
5
5
  import type { StaticSiteGenerator } from '../../static-site-generator/static-site-generator.js';
@@ -34,6 +34,7 @@ export interface ServerStaticBuilderParams {
34
34
  export interface ServerStaticBuilderLogger {
35
35
  warn(message: string, detail?: string): unknown;
36
36
  info(message: string): unknown;
37
+ debug(message: string): unknown;
37
38
  error(message: string): unknown;
38
39
  }
39
40
  /**
@@ -3,15 +3,15 @@ import { fileSystem } from "@ecopages/file-system";
3
3
  import { DEFAULT_ECOPAGES_HOSTNAME, DEFAULT_ECOPAGES_PORT } from "../../config/constants.js";
4
4
  import { appLogger } from "../../global/app-logger.js";
5
5
  import { build, getAppBuildAdapter, setupAppRuntimePlugins } from "../../build/build-adapter.js";
6
+ import { createServerBuildRequest } from "../../build/runtime/build-request-policy.js";
7
+ import { requireBuildRuntime } from "../../build/runtime/build-runtime.js";
6
8
  import { attachHmrToIntegrations } from "./runtime-server-lifecycle.js";
7
- import { resolveBuildProfileOptions } from "../../build/build-profile-options.js";
8
9
  import {
9
10
  getServerBundleOutputPaths,
10
11
  lookupServerEntryBuildCache,
11
12
  recordServerEntryBuildCache,
12
13
  writeServerBundleDeployManifest
13
- } from "../../build/server-entry-build-cache.js";
14
- import { getInstalledServerEntryBuildExecutor } from "../../build/runtime-build-executor.js";
14
+ } from "../../build/cache/server-entry-build-cache.js";
15
15
  import {
16
16
  clearProductionBuildCaches,
17
17
  shouldResetStaticExportDirectory
@@ -134,16 +134,14 @@ class ServerStaticBuilder {
134
134
  }
135
135
  }
136
136
  this.logger.info("Bundling server entry file...");
137
- const buildOptions = {
138
- ...resolveBuildProfileOptions("server-entry", this.appConfig, {
139
- entrypoints: [entryPath],
140
- outdir: serverOutdir,
141
- naming: SERVER_BUNDLE_FILENAME,
142
- sourcemap: "hidden"
143
- }),
144
- entrypoints: [entryPath]
145
- };
146
- const result = await build(buildOptions, getInstalledServerEntryBuildExecutor(this.appConfig));
137
+ const buildOptions = createServerBuildRequest(this.appConfig, {
138
+ profile: "server-entry",
139
+ entrypoints: [entryPath],
140
+ outdir: serverOutdir,
141
+ naming: SERVER_BUNDLE_FILENAME,
142
+ sourcemap: "hidden"
143
+ });
144
+ const result = await build(buildOptions, requireBuildRuntime(this.appConfig).getProfile("server-entry"));
147
145
  if (!result.success) {
148
146
  const errorMessages = result.logs.map((log) => log.message).join("\n");
149
147
  throw new Error(`Failed to bundle server entry file:
@@ -181,7 +179,11 @@ ${errorMessages}`);
181
179
  force,
182
180
  preserveExportDirectory
183
181
  });
184
- this.logger.info("Build completed");
182
+ if (process.env.ECOPAGES_BENCH === "1" && process.env.ECOPAGES_BENCH_VERBOSE !== "1") {
183
+ this.logger.debug("Build completed");
184
+ } else {
185
+ this.logger.info("Build completed");
186
+ }
185
187
  }
186
188
  }
187
189
  export {
@@ -3,14 +3,12 @@ import { type ResolvedHmrEntrypoint } from '../../hmr/hmr-entrypoint-output.js';
3
3
  import type { DefaultHmrContext, EcoPagesAppConfig, IHmrManager, IClientBridge } from '../../types/internal-types.js';
4
4
  import { type HmrStrategy } from '../../hmr/hmr-strategy.js';
5
5
  import { DevelopmentInvalidationService } from '../../services/invalidation/development-invalidation.service.js';
6
- import type { ClientBridgeEvent } from '../../types/public-types.js';
6
+ import type { ClientBridgeEvent, HmrFileChangeOptions } from '../../types/public-types.js';
7
7
  import { HmrEntrypointRegistrar } from './hmr-entrypoint-registrar.js';
8
8
  import { BrowserBundleService } from '../../services/assets/browser-bundle.service.js';
9
9
  import { type EntrypointDependencyGraph } from '../../services/runtime-state/entrypoint-dependency-graph.service.js';
10
10
  import type { ServerModuleTranspiler } from '../../services/module-loading/server-module-transpiler.service.js';
11
- type HandleFileChangeOptions = {
12
- broadcast?: boolean;
13
- };
11
+ type HandleFileChangeOptions = HmrFileChangeOptions;
14
12
  type SharedHmrManagerParams = {
15
13
  appConfig: EcoPagesAppConfig;
16
14
  bridge: IClientBridge;
@@ -71,6 +69,15 @@ export declare abstract class SharedHmrManager implements IHmrManager {
71
69
  */
72
70
  private prepareRegisteredScriptChange;
73
71
  getOutputUrl(entrypointPath: string): string | undefined;
72
+ /**
73
+ * Registers an already-materialized HMR entrypoint without rebuilding it.
74
+ *
75
+ * @remarks
76
+ * Cold dev batches build grouped Rolldown passes up front and then seed the
77
+ * registrar so the first SSR resolves the artifact from disk. The entrypoint
78
+ * is also added to the watched files so subsequent source edits still rebuild.
79
+ */
80
+ seedResolvedEntrypoint(resolved: ResolvedHmrEntrypoint): void;
74
81
  /**
75
82
  * Returns the emitted HMR script output when the entrypoint is already registered
76
83
  * and its browser bundle exists on disk.
@@ -7,7 +7,7 @@ import {
7
7
  isRegisteredScriptEntrypoint,
8
8
  isBrowserOnlyRegisteredScriptEntrypoint
9
9
  } from "../../hmr/hmr-entrypoint-output.js";
10
- import { requireBuildRuntime } from "../../build/build-runtime.js";
10
+ import { requireBuildRuntime } from "../../build/runtime/build-runtime.js";
11
11
  import { fileSystem } from "@ecopages/file-system";
12
12
  import { HmrStrategyType } from "../../hmr/hmr-strategy.js";
13
13
  import { DefaultHmrStrategy } from "../../hmr/strategies/default-hmr-strategy.js";
@@ -181,6 +181,7 @@ class SharedHmrManager {
181
181
  if (isRegisteredScriptEntrypoint(this.entrypointRegistrar.getRegistered(), resolvedFilePath)) {
182
182
  await this.prepareRegisteredScriptChange(resolvedFilePath);
183
183
  }
184
+ const shouldBroadcast = options.broadcast ?? true;
184
185
  const strategy = this.selectChangeStrategy(filePath);
185
186
  if (!strategy) {
186
187
  appLogger.warn(`[HMR] No strategy found for ${filePath}`);
@@ -188,10 +189,16 @@ class SharedHmrManager {
188
189
  }
189
190
  appLogger.debug(`[${this.constructor.name}] Selected strategy: ${strategy.constructor.name}`);
190
191
  const action = await strategy.process(filePath);
191
- const shouldBroadcast = options.broadcast ?? true;
192
192
  if (shouldBroadcast && action.type === "broadcast" && action.events) {
193
+ if (this.bridge.subscriberCount === 0) {
194
+ appLogger.debug(
195
+ `[${this.constructor.name}] Deferring HMR client broadcast for ${filePath} until a subscriber connects`
196
+ );
197
+ return;
198
+ }
193
199
  for (const event of action.events) {
194
- this.broadcast(event);
200
+ const graphIdentities = event.graphIdentities ?? options.graphIdentities;
201
+ this.broadcast(graphIdentities === void 0 ? event : { ...event, graphIdentities });
195
202
  }
196
203
  }
197
204
  }
@@ -282,6 +289,17 @@ class SharedHmrManager {
282
289
  getOutputUrl(entrypointPath) {
283
290
  return this.entrypointRegistrar.getRegistered().get(path.resolve(entrypointPath))?.outputUrl;
284
291
  }
292
+ /**
293
+ * Registers an already-materialized HMR entrypoint without rebuilding it.
294
+ *
295
+ * @remarks
296
+ * Cold dev batches build grouped Rolldown passes up front and then seed the
297
+ * registrar so the first SSR resolves the artifact from disk. The entrypoint
298
+ * is also added to the watched files so subsequent source edits still rebuild.
299
+ */
300
+ seedResolvedEntrypoint(resolved) {
301
+ this.entrypointRegistrar.seedResolvedEntrypoint(resolved);
302
+ }
285
303
  /**
286
304
  * Returns the emitted HMR script output when the entrypoint is already registered
287
305
  * and its browser bundle exists on disk.
@@ -314,6 +332,7 @@ class SharedHmrManager {
314
332
  getBuildExecutor: () => requireBuildRuntime(this.appConfig).getProfile("browser-hmr"),
315
333
  getBrowserBundleService: () => this.browserBundleService,
316
334
  getEntrypointDependencyGraph: () => this.entrypointDependencyGraph,
335
+ seedResolvedEntrypoint: (resolved) => this.seedResolvedEntrypoint(resolved),
317
336
  importServerModule: async (filePath) => await this.serverModuleTranspiler.importModule({
318
337
  filePath,
319
338
  outdir: path.join(resolveInternalExecutionDir(this.appConfig), ".server-modules"),