@ecopages/core 0.2.0-beta.2 → 0.2.0-beta.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 (273) hide show
  1. package/README.md +1 -1
  2. package/package.json +163 -3
  3. package/src/adapters/abstract/application-adapter.d.ts +104 -5
  4. package/src/adapters/abstract/application-adapter.js +125 -1
  5. package/src/adapters/abstract/server-adapter.d.ts +6 -2
  6. package/src/adapters/abstract/ws-pattern-matcher.d.ts +60 -0
  7. package/src/adapters/abstract/ws-pattern-matcher.js +61 -0
  8. package/src/adapters/bun/client-bridge.d.ts +1 -0
  9. package/src/adapters/bun/client-bridge.js +3 -0
  10. package/src/adapters/bun/create-app.d.ts +6 -4
  11. package/src/adapters/bun/create-app.js +65 -43
  12. package/src/adapters/bun/hmr-manager.d.ts +2 -1
  13. package/src/adapters/bun/hmr-manager.js +2 -2
  14. package/src/adapters/bun/server-adapter.d.ts +90 -22
  15. package/src/adapters/bun/server-adapter.js +265 -84
  16. package/src/adapters/bun/static-preview-host.js +25 -20
  17. package/src/adapters/create-app.d.ts +13 -11
  18. package/src/adapters/create-app.js +2 -51
  19. package/src/adapters/index.d.ts +1 -1
  20. package/src/adapters/index.js +1 -2
  21. package/src/adapters/node/create-app.d.ts +5 -1
  22. package/src/adapters/node/create-app.js +51 -12
  23. package/src/adapters/node/node-client-bridge.d.ts +1 -0
  24. package/src/adapters/node/node-client-bridge.js +3 -0
  25. package/src/adapters/node/node-hmr-manager.d.ts +2 -1
  26. package/src/adapters/node/node-hmr-manager.js +2 -2
  27. package/src/adapters/node/server-adapter-dependencies.js +4 -0
  28. package/src/adapters/node/server-adapter.d.ts +62 -20
  29. package/src/adapters/node/server-adapter.js +161 -131
  30. package/src/adapters/node/static-content-server.d.ts +1 -0
  31. package/src/adapters/node/static-content-server.js +10 -2
  32. package/src/adapters/node/static-preview-host.js +27 -12
  33. package/src/adapters/shared/bun-user-websocket-lifecycle.d.ts +22 -0
  34. package/src/adapters/shared/bun-user-websocket-lifecycle.js +96 -0
  35. package/src/adapters/shared/copy-runtime-public-dir.d.ts +6 -0
  36. package/src/adapters/shared/copy-runtime-public-dir.js +24 -0
  37. package/src/adapters/shared/fs-server-response-matcher.d.ts +2 -0
  38. package/src/adapters/shared/fs-server-response-matcher.js +40 -18
  39. package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +0 -2
  40. package/src/adapters/shared/hmr-entrypoint-registrar.js +3 -26
  41. package/src/adapters/shared/hmr-html-response.d.ts +1 -1
  42. package/src/adapters/shared/hmr-html-response.js +4 -1
  43. package/src/adapters/shared/node-http-websocket-upgrades.d.ts +21 -0
  44. package/src/adapters/shared/node-http-websocket-upgrades.js +100 -0
  45. package/src/adapters/shared/port-manager.d.ts +116 -0
  46. package/src/adapters/shared/port-manager.js +196 -0
  47. package/src/adapters/shared/runtime-app-bootstrap.d.ts +2 -1
  48. package/src/adapters/shared/runtime-app-bootstrap.js +3 -6
  49. package/src/adapters/shared/runtime-server-lifecycle.d.ts +38 -0
  50. package/src/adapters/shared/runtime-server-lifecycle.js +43 -0
  51. package/src/adapters/shared/server-adapter.d.ts +2 -1
  52. package/src/adapters/shared/server-adapter.js +13 -6
  53. package/src/adapters/shared/server-route-handler.d.ts +4 -1
  54. package/src/adapters/shared/server-route-handler.js +5 -2
  55. package/src/adapters/shared/server-static-builder.d.ts +23 -32
  56. package/src/adapters/shared/server-static-builder.js +97 -73
  57. package/src/adapters/shared/shared-hmr-manager.d.ts +28 -0
  58. package/src/adapters/shared/shared-hmr-manager.js +119 -9
  59. package/src/adapters/shared/static-preview-host.d.ts +5 -0
  60. package/src/adapters/shared/websocket-lifecycle.d.ts +24 -0
  61. package/src/adapters/shared/websocket-lifecycle.js +55 -0
  62. package/src/build/README.md +77 -14
  63. package/src/build/app-build-manifest-runtime.d.ts +10 -0
  64. package/src/build/app-build-manifest-runtime.js +90 -0
  65. package/src/build/build-adapter.d.ts +17 -319
  66. package/src/build/build-adapter.js +28 -94
  67. package/src/build/build-contracts.d.ts +97 -0
  68. package/src/build/build-contracts.js +0 -0
  69. package/src/build/build-input-fingerprint.d.ts +28 -0
  70. package/src/build/build-input-fingerprint.js +31 -0
  71. package/src/build/build-profile-options.d.ts +7 -0
  72. package/src/build/build-profile-options.js +37 -0
  73. package/src/build/build-runtime.d.ts +24 -0
  74. package/src/build/build-runtime.js +65 -0
  75. package/src/build/deduping-build-executor.d.ts +28 -0
  76. package/src/build/deduping-build-executor.js +56 -0
  77. package/src/build/jsx-ownership-plugins.d.ts +24 -0
  78. package/src/build/jsx-ownership-plugins.js +41 -0
  79. package/src/build/pages-unified-graph-build.d.ts +31 -0
  80. package/src/build/pages-unified-graph-build.js +206 -0
  81. package/src/build/parallel-build-executor.d.ts +21 -0
  82. package/src/build/parallel-build-executor.js +52 -0
  83. package/src/build/production-build-cache.d.ts +20 -0
  84. package/src/build/production-build-cache.js +63 -0
  85. package/src/build/rolldown-adapter-helpers.d.ts +3 -6
  86. package/src/build/rolldown-adapter-helpers.js +71 -6
  87. package/src/build/rolldown-build-adapter.d.ts +2 -6
  88. package/src/build/rolldown-build-adapter.js +3 -3
  89. package/src/build/rolldown-build-invocation-metrics.d.ts +12 -0
  90. package/src/build/rolldown-build-invocation-metrics.js +43 -0
  91. package/src/build/rolldown-plugin-bridge.d.ts +15 -1
  92. package/src/build/rolldown-plugin-bridge.js +20 -5
  93. package/src/build/rolldown-source-transform-pass.d.ts +15 -0
  94. package/src/build/rolldown-source-transform-pass.js +58 -0
  95. package/src/build/runtime-build-executor.d.ts +8 -15
  96. package/src/build/runtime-build-executor.js +12 -15
  97. package/src/build/runtime-build-output-normalizer.d.ts +7 -0
  98. package/src/build/runtime-build-output-normalizer.js +94 -2
  99. package/src/build/server-entry-build-cache.d.ts +44 -0
  100. package/src/build/server-entry-build-cache.js +161 -0
  101. package/src/client/navigation-scripts/classification.d.ts +16 -0
  102. package/src/client/navigation-scripts/classification.js +41 -0
  103. package/src/client/navigation-scripts/index.d.ts +3 -0
  104. package/src/client/navigation-scripts/index.js +23 -0
  105. package/src/client/navigation-scripts/navigation-scripts.test.browser.js +65 -0
  106. package/src/client/navigation-scripts/registry.d.ts +11 -0
  107. package/src/client/navigation-scripts/registry.js +12 -0
  108. package/src/client/navigation-scripts/rerun-queue.d.ts +37 -0
  109. package/src/client/navigation-scripts/rerun-queue.js +73 -0
  110. package/src/client/scroll.d.ts +17 -0
  111. package/src/client/scroll.js +25 -0
  112. package/src/client/scroll.test.browser.js +37 -0
  113. package/src/client/view-transitions.d.ts +16 -0
  114. package/src/client/view-transitions.js +63 -0
  115. package/src/config/config-builder.d.ts +12 -7
  116. package/src/config/config-builder.js +12 -9
  117. package/src/dev/client-bridge-registry.d.ts +5 -0
  118. package/src/dev/client-bridge-registry.js +15 -0
  119. package/src/dev/dev-client-ownership.d.ts +7 -0
  120. package/src/dev/dev-client-ownership.js +6 -0
  121. package/src/dev/hmr-manager-registry.d.ts +8 -0
  122. package/src/dev/hmr-manager-registry.js +15 -0
  123. package/src/dev/host-runtime.d.ts +3 -0
  124. package/src/dev/host-runtime.js +7 -0
  125. package/src/dev/runtime-server-started-message.d.ts +2 -0
  126. package/src/dev/runtime-server-started-message.js +6 -0
  127. package/src/eco/README.md +11 -0
  128. package/src/eco/eco-declared-component.d.ts +14 -0
  129. package/src/eco/eco-declared-component.js +16 -0
  130. package/src/eco/eco.browser.js +5 -6
  131. package/src/eco/eco.js +5 -6
  132. package/src/eco/eco.types.d.ts +2 -2
  133. package/src/eco/page-layout-normalization.d.ts +21 -0
  134. package/src/eco/page-layout-normalization.js +59 -0
  135. package/src/errors/index.d.ts +1 -0
  136. package/src/errors/index.js +7 -1
  137. package/src/errors/undeclared-component-dependency-error.d.ts +11 -0
  138. package/src/errors/undeclared-component-dependency-error.js +17 -0
  139. package/src/hmr/client/hmr-runtime.js +5 -2
  140. package/src/hmr/hmr-entrypoint-output.d.ts +28 -0
  141. package/src/hmr/hmr-entrypoint-output.js +58 -0
  142. package/src/hmr/strategies/js-hmr-strategy.d.ts +3 -0
  143. package/src/hmr/strategies/js-hmr-strategy.js +68 -18
  144. package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
  145. package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +29 -0
  146. package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -6
  147. package/src/integrations/ghtml/ghtml-renderer.js +2 -51
  148. package/src/integrations/ghtml/ghtml.plugin.d.ts +3 -16
  149. package/src/integrations/ghtml/ghtml.plugin.js +7 -14
  150. package/src/plugins/define-integration.d.ts +26 -0
  151. package/src/plugins/define-integration.js +19 -0
  152. package/src/plugins/eco-component-meta-plugin.js +5 -8
  153. package/src/plugins/foreign-jsx-override-plugin.js +4 -6
  154. package/src/plugins/integration-plugin.d.ts +19 -9
  155. package/src/plugins/integration-plugin.js +7 -4
  156. package/src/plugins/jsx-import-source.utils.d.ts +8 -0
  157. package/src/plugins/jsx-import-source.utils.js +26 -0
  158. package/src/plugins/processor.d.ts +19 -4
  159. package/src/plugins/processor.js +22 -4
  160. package/src/plugins/source-transform.d.ts +31 -0
  161. package/src/plugins/source-transform.js +23 -1
  162. package/src/route-renderer/GRAPH.md +8 -8
  163. package/src/route-renderer/README.md +30 -28
  164. package/src/route-renderer/orchestration/component-graph-collectors.d.ts +10 -0
  165. package/src/route-renderer/orchestration/component-graph-collectors.js +143 -0
  166. package/src/route-renderer/orchestration/component-graph.d.ts +36 -0
  167. package/src/route-renderer/orchestration/component-graph.js +98 -0
  168. package/src/route-renderer/orchestration/component-render-context.d.ts +3 -10
  169. package/src/route-renderer/orchestration/component-render-context.js +3 -1
  170. package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +1 -18
  171. package/src/route-renderer/orchestration/declared-ownership-graph.js +5 -31
  172. package/src/route-renderer/orchestration/document-shell-render.service.d.ts +90 -0
  173. package/src/route-renderer/orchestration/document-shell-render.service.js +120 -0
  174. package/src/route-renderer/orchestration/foreign-subtree-execution.service.d.ts +59 -29
  175. package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +164 -35
  176. package/src/route-renderer/orchestration/global-injector-assets.service.d.ts +7 -0
  177. package/src/route-renderer/orchestration/global-injector-assets.service.js +32 -0
  178. package/src/route-renderer/orchestration/integration-renderer.d.ts +18 -54
  179. package/src/route-renderer/orchestration/integration-renderer.js +113 -195
  180. package/src/route-renderer/orchestration/integration-route-render-adapter.d.ts +38 -0
  181. package/src/route-renderer/orchestration/integration-route-render-adapter.js +27 -0
  182. package/src/route-renderer/orchestration/layout-shell-props.service.d.ts +20 -0
  183. package/src/route-renderer/orchestration/layout-shell-props.service.js +31 -0
  184. package/src/route-renderer/orchestration/ownership-validation.service.d.ts +5 -0
  185. package/src/route-renderer/orchestration/ownership-validation.service.js +29 -1
  186. package/src/route-renderer/orchestration/page-browser-graph-contribution.loader.d.ts +9 -0
  187. package/src/route-renderer/orchestration/page-browser-graph-contribution.loader.js +7 -0
  188. package/src/route-renderer/orchestration/page-browser-graph.service.d.ts +25 -0
  189. package/src/route-renderer/orchestration/page-browser-graph.service.js +174 -0
  190. package/src/route-renderer/orchestration/render-output.utils.d.ts +2 -0
  191. package/src/route-renderer/orchestration/render-output.utils.js +4 -0
  192. package/src/route-renderer/orchestration/route-html-finalization.service.d.ts +17 -0
  193. package/src/route-renderer/orchestration/route-html-finalization.service.js +26 -0
  194. package/src/route-renderer/orchestration/route-prepared-options.builder.d.ts +26 -0
  195. package/src/route-renderer/orchestration/route-prepared-options.builder.js +54 -0
  196. package/src/route-renderer/orchestration/route-prepared-options.utils.d.ts +4 -0
  197. package/src/route-renderer/orchestration/route-prepared-options.utils.js +33 -0
  198. package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +8 -39
  199. package/src/route-renderer/orchestration/route-render-orchestrator.js +53 -461
  200. package/src/route-renderer/orchestration/string-markup-renderer.d.ts +14 -0
  201. package/src/route-renderer/orchestration/string-markup-renderer.js +55 -0
  202. package/src/route-renderer/page-loading/component-dependency-collection.js +5 -2
  203. package/src/router/client/link-intent.d.ts +11 -21
  204. package/src/router/client/link-intent.js +10 -0
  205. package/src/router/client/link-intent.test.browser.js +12 -1
  206. package/src/router/client/link-navigation-policy.d.ts +45 -0
  207. package/src/router/client/link-navigation-policy.js +101 -0
  208. package/src/router/client/link-navigation-policy.test.browser.d.ts +1 -0
  209. package/src/router/client/link-navigation-policy.test.browser.js +92 -0
  210. package/src/router/client/navigation-coordinator.d.ts +1 -1
  211. package/src/router/client/navigation-coordinator.js +12 -2
  212. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +1 -0
  213. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
  214. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +4 -2
  215. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +27 -7
  216. package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +36 -14
  217. package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +17 -3
  218. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -3
  219. package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +2 -31
  220. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
  221. package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +2 -30
  222. package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
  223. package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +43 -0
  224. package/src/services/assets/browser-bundle.service.d.ts +3 -1
  225. package/src/services/assets/browser-bundle.service.js +17 -5
  226. package/src/services/html/html-transformer.service.d.ts +1 -1
  227. package/src/services/html/html-transformer.service.js +4 -4
  228. package/src/services/invalidation/development-invalidation.service.d.ts +20 -2
  229. package/src/services/invalidation/development-invalidation.service.js +56 -2
  230. package/src/services/module-loading/README.md +49 -0
  231. package/src/services/module-loading/app-server-module-transpiler.service.js +5 -17
  232. package/src/services/module-loading/page-module-import.service.d.ts +5 -1
  233. package/src/services/module-loading/page-module-import.service.js +97 -45
  234. package/src/services/module-loading/route-module-build-cache-registry.d.ts +24 -0
  235. package/src/services/module-loading/route-module-build-cache-registry.js +37 -0
  236. package/src/services/module-loading/route-module-build-cache.d.ts +4 -0
  237. package/src/services/module-loading/route-module-build-cache.js +38 -0
  238. package/src/services/module-loading/route-module-build-cache.store.d.ts +57 -0
  239. package/src/services/module-loading/route-module-build-cache.store.js +207 -0
  240. package/src/services/module-loading/route-module-build-manifest.d.ts +61 -0
  241. package/src/services/module-loading/route-module-build-manifest.js +116 -0
  242. package/src/services/module-loading/route-module-dependency-hasher.d.ts +81 -0
  243. package/src/services/module-loading/route-module-dependency-hasher.js +121 -0
  244. package/src/services/module-loading/server-module-transpiler.service.js +1 -1
  245. package/src/static-site-generator/README.md +33 -0
  246. package/src/static-site-generator/static-build-invalidation.d.ts +10 -0
  247. package/src/static-site-generator/static-build-invalidation.js +59 -0
  248. package/src/static-site-generator/static-export-context.d.ts +22 -0
  249. package/src/static-site-generator/static-export-context.js +0 -0
  250. package/src/static-site-generator/static-site-generator.d.ts +17 -20
  251. package/src/static-site-generator/static-site-generator.js +188 -85
  252. package/src/types/internal-types.d.ts +16 -9
  253. package/src/types/public-types.d.ts +138 -26
  254. package/src/utils/parse-cli-args.d.ts +2 -0
  255. package/src/utils/parse-cli-args.js +6 -0
  256. package/src/utils/server-utils.module.d.ts +3 -2
  257. package/src/utils/server-utils.module.js +5 -6
  258. package/src/utils/static-file-extensions.d.ts +12 -0
  259. package/src/utils/static-file-extensions.js +48 -0
  260. package/src/watchers/project-watcher-ignore.d.ts +11 -0
  261. package/src/watchers/project-watcher-ignore.js +16 -0
  262. package/src/watchers/project-watcher.d.ts +25 -2
  263. package/src/watchers/project-watcher.js +130 -23
  264. package/src/build/rolldown-dev-build-adapter.d.ts +0 -82
  265. package/src/build/rolldown-dev-build-adapter.js +0 -166
  266. package/src/hmr/hmr.postcss.test.e2e.js +0 -31
  267. package/src/hmr/hmr.test.e2e.js +0 -43
  268. package/src/route-renderer/orchestration/ownership-planning.service.d.ts +0 -24
  269. package/src/route-renderer/orchestration/ownership-planning.service.js +0 -63
  270. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +0 -91
  271. package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +0 -170
  272. /package/src/{hmr/hmr.postcss.test.e2e.d.ts → client/navigation-scripts/navigation-scripts.test.browser.d.ts} +0 -0
  273. /package/src/{hmr/hmr.test.e2e.d.ts → client/scroll.test.browser.d.ts} +0 -0
@@ -9,274 +9,17 @@
9
9
  * {@link ViteHostBuildAdapter} (a host-owned boundary marker that throws
10
10
  * on direct use, for host runtimes that own their own build pipeline).
11
11
  * - `BuildExecutor` — the runtime-facing facade stored on
12
- * `appConfig.runtime.buildExecutor`. It is intentionally narrower than
13
- * `BuildAdapter` so callers that only need to issue builds do not depend
14
- * on `resolve` / `getTranspileOptions`.
15
- * - App-owned helpers (`getAppBuildAdapter`, `getAppBuildExecutor`, and
16
- * the `set*` counterparts) — the supported way for runtime code to read
17
- * and mutate the active adapter per `EcoPagesAppConfig`.
12
+ * `appConfig.runtime.buildRuntime` via profile-based accessors.
13
+ * - App-owned helpers (`getAppBuildAdapter` and the `set*` counterparts)
14
+ * the supported way for runtime code to read and mutate the active adapter
15
+ * per `EcoPagesAppConfig`. Profile executors live on
16
+ * `appConfig.runtime.buildRuntime`.
18
17
  */
19
18
  import type { EcoBuildPlugin } from './build-types.js';
19
+ import { type BuildAdapter, type BuildExecutor, type BuildOptions, type BuildOwnership, type BuildResult, type BuildTranspileOptions, type BuildTranspileProfile } from './build-contracts.js';
20
+ export type { BuildAdapter, BuildDependencyGraph, BuildExecutor, BuildLog, BuildOptions, BuildOutput, BuildOwnership, BuildResult, BuildTranspileOptions, BuildTranspileProfile, } from './build-contracts.js';
20
21
  import { type AppBuildManifest } from './build-manifest.js';
21
22
  import type { EcoPagesAppConfig } from '../types/internal-types.js';
22
- import type { IHmrManager } from '../types/public-types.js';
23
- /**
24
- * Which backend owns the app's build pipeline.
25
- *
26
- * - `'rolldown'`: the default. Ecopages runs the build directly through
27
- * its bundler-backed adapter.
28
- * - `'rolldown-dev'`: uses Rolldown's DevEngine for cached incremental
29
- * rebuilds. Ideal for HMR and watch mode where the same entrypoints
30
- * are rebuilt repeatedly.
31
- * - `'vite-host'`: a host runtime owns the build. {@link ViteHostBuildAdapter}
32
- * is exposed as a boundary marker; any direct call into it throws.
33
- */
34
- export type BuildOwnership = 'vite-host' | 'rolldown' | 'rolldown-dev';
35
- /**
36
- * A single message emitted by the build backend.
37
- *
38
- * @remarks
39
- * Today this only carries `message`. Severity and structured fields
40
- * belong in a future schema bump; the current shape mirrors the
41
- * bundler's log output 1:1.
42
- */
43
- export interface BuildLog {
44
- message: string;
45
- }
46
- /**
47
- * A single artifact emitted by the build backend.
48
- *
49
- * @remarks
50
- * `path` is the absolute on-disk path of the emitted file. For
51
- * filename templates that include a content-hash token, the bundler
52
- * returns the concrete resolved path (not the template), so callers
53
- * can read the file directly.
54
- */
55
- export interface BuildOutput {
56
- path: string;
57
- }
58
- /**
59
- * Per-entrypoint dependency metadata surfaced alongside a build.
60
- *
61
- * @remarks
62
- * Populated from the bundler's per-chunk module list and exposed as a
63
- * normalized absolute-path map. Consumers (HMR invalidation, the build
64
- * manifest) read this without needing to know which adapter produced
65
- * it. The shape is preserved across adapters so historical callers
66
- * continue to compile.
67
- */
68
- export interface BuildDependencyGraph {
69
- /**
70
- * Normalized absolute entrypoint path mapped to every normalized
71
- * absolute source input that contributed to that entrypoint's
72
- * output, including the entrypoint itself.
73
- */
74
- entrypoints: Record<string, string[]>;
75
- }
76
- /**
77
- * The full result of one `BuildAdapter.build` call.
78
- *
79
- * @remarks
80
- * `success === false` means the build failed and `outputs` will be
81
- * empty. Inspect `logs` for the error message; the original `Error` is
82
- * already normalized into `BuildLog` shape.
83
- */
84
- export interface BuildResult {
85
- success: boolean;
86
- logs: BuildLog[];
87
- outputs: BuildOutput[];
88
- /**
89
- * Per-entrypoint dependency metadata, when the backend produced it.
90
- * Some backends (notably the Vite-host boundary marker) leave this
91
- * undefined; callers must treat that as a valid state and fall
92
- * back deterministically.
93
- */
94
- dependencyGraph?: BuildDependencyGraph;
95
- }
96
- /**
97
- * Options accepted by every `BuildAdapter.build` call.
98
- *
99
- * @remarks
100
- * Fields that the adapter can forward are honored; fields that cannot
101
- * (currently `splitting`, `bundle`, and `outbase`) are accepted so
102
- * call-sites compile, but the adapter ignores them. See each field's
103
- * docstring for the current behavior.
104
- */
105
- export interface BuildOptions {
106
- /**
107
- * Absolute or context-root-relative source files that begin the build graph.
108
- *
109
- * Use a record (key → source path) when the caller needs to control chunk
110
- * names. Keys become the `[name]` token in `naming`, which lets the caller
111
- * embed path information that the bundler would otherwise strip.
112
- */
113
- entrypoints: string[] | Record<string, string>;
114
- /** Output directory. Defaults to `dist/assets` when omitted. */
115
- outdir?: string;
116
- /**
117
- * Base directory for `[dir]` placeholders in `naming`. Currently
118
- * the bundled adapter derives the base from `root` directly and
119
- * ignores this field.
120
- */
121
- outbase?: string;
122
- /**
123
- * Filename pattern for entrypoints. The bundled adapter honors
124
- * `[name]`, `[hash]`, and `[ext]`. The `[dir]` token is stripped
125
- * before forwarding to the bundler (rolldown does not implement it);
126
- * callers that need directory structure preserved should use the
127
- * record form of `entrypoints` so each key becomes its own chunk.
128
- * When omitted, the bundler's default applies.
129
- */
130
- naming?: string;
131
- /**
132
- * Package export conditions to honor during resolution
133
- * (e.g. `['import', 'browser', 'default']`).
134
- */
135
- conditions?: string[];
136
- /**
137
- * Global identifier replacements. Honored by the bundled adapter.
138
- */
139
- define?: Record<string, string>;
140
- /** Run the bundler's minifier. Off by default. */
141
- minify?: boolean;
142
- /** Enable the bundler's tree-shaker. Defaults to `true`. */
143
- treeshaking?: boolean;
144
- /**
145
- * Output target family. Accepted values: `'browser'`, `'node'`,
146
- * anything else falls through to a platform-neutral setup.
147
- */
148
- target?: string;
149
- /** Output module format. Accepted: `'esm'`, `'cjs'`, `'iife'`. */
150
- format?: string;
151
- /**
152
- * Source map mode. Accepted: `'none'`, `'inline'`, `'external'`,
153
- * `'linked'`. Anything else maps to the bundler's default (linked).
154
- */
155
- sourcemap?: string;
156
- /**
157
- * Historical code-splitting flag. Currently a no-op on the bundled
158
- * adapter: the bundler splits by default and this flag is not
159
- * forwarded. See the per-chunk naming convention in the adapter for
160
- * the available control.
161
- */
162
- splitting?: boolean;
163
- /** Project root used to resolve relative paths and the tsconfig lookup. */
164
- root?: string;
165
- /**
166
- * Historical bundle flag. Currently a no-op on the bundled adapter:
167
- * the bundler always bundles. Accepted so call-sites compile.
168
- */
169
- bundle?: boolean;
170
- /**
171
- * Treat `node_modules` packages as external. Honored by the bundled
172
- * adapter.
173
- */
174
- externalPackages?: boolean;
175
- /** Explicit list of module specifiers to leave as external imports. */
176
- external?: string[];
177
- /**
178
- * JSX runtime configuration. Mirrors the bundler's `jsx` option shape.
179
- */
180
- jsx?: {
181
- development?: boolean;
182
- factory?: string;
183
- fragment?: string;
184
- importSource?: string;
185
- runtime?: 'classic' | 'automatic';
186
- sideEffects?: boolean;
187
- };
188
- /**
189
- * Runtime-agnostic `EcoBuildPlugin[]` to attach to this build. The
190
- * bundled adapter translates the array via the rolldown plugin
191
- * bridge.
192
- */
193
- plugins?: EcoBuildPlugin[];
194
- /**
195
- * Escape hatch for backends that need to forward unknown options
196
- * to their underlying driver. Consumers should prefer the typed
197
- * fields above.
198
- */
199
- [key: string]: unknown;
200
- }
201
- /** Stable profile identifiers for `BuildAdapter.getTranspileOptions`. */
202
- export type BuildTranspileProfile = 'browser-script' | 'hmr-runtime' | 'hmr-entrypoint';
203
- /**
204
- * Resolved transpile settings for a given profile.
205
- *
206
- * @remarks
207
- * The three fields map 1:1 to the trio the HMR and browser-script
208
- * code paths look at: target platform, output format, and source-map
209
- * mode. Today the bundled adapter returns identical defaults for all
210
- * three profiles; the type is kept open so per-profile tuning can
211
- * land without breaking callers.
212
- */
213
- export interface BuildTranspileOptions {
214
- target: string;
215
- format: string;
216
- sourcemap: string;
217
- }
218
- /**
219
- * Low-level build backend contract.
220
- *
221
- * @remarks
222
- * One instance is owned by each `EcoPagesAppConfig` (see
223
- * {@link getAppBuildAdapter}). Two implementations exist: the bundled
224
- * adapter does the work; {@link ViteHostBuildAdapter} is a host-owned
225
- * boundary marker that throws on direct use.
226
- */
227
- export interface BuildAdapter {
228
- /** Which backend owns this adapter. Used for routing decisions in app helpers. */
229
- readonly ownership?: BuildOwnership;
230
- /**
231
- * Run one build.
232
- *
233
- * @remarks
234
- * Implementations are expected to be safe to call from any caller.
235
- * Concurrent calls are not guaranteed to be serialized by the
236
- * adapter itself; the dev-watch pipeline wraps the adapter in
237
- * {@link SerializedBuildExecutor} when it needs FIFO ordering.
238
- *
239
- * Returns a `BuildResult` with `success: false` on failure; the
240
- * thrown-error variant (`buildOrThrow`) is reserved for callers
241
- * that need the original `Error` object.
242
- */
243
- build(options: BuildOptions): Promise<BuildResult>;
244
- /**
245
- * Resolve a module specifier against the project's `rootDir`.
246
- *
247
- * @remarks
248
- * Used by the source-loading services when they need to know the
249
- * absolute path of a specifier without performing a full build.
250
- */
251
- resolve(importPath: string, rootDir: string): string;
252
- /**
253
- * Resolve transpile settings for a known profile.
254
- *
255
- * @remarks
256
- * Today the bundled adapter returns identical defaults for all
257
- * profiles. The profile argument is kept so per-profile tuning
258
- * can land without breaking callers.
259
- */
260
- getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
261
- }
262
- /**
263
- * Runtime-facing facade for issuing builds.
264
- *
265
- * @remarks
266
- * Strictly narrower than {@link BuildAdapter}: it only exposes `build`.
267
- * This is the shape stored on `appConfig.runtime.buildExecutor` and
268
- * passed across the dev-watch and server-module-loading seams, so
269
- * callers cannot accidentally depend on `resolve` or
270
- * `getTranspileOptions`.
271
- *
272
- * In production and non-watch flows the executor is the adapter
273
- * itself. In development watch flows the executor is a
274
- * {@link SerializedBuildExecutor} wrapping the adapter so dev-watch
275
- * pipelines are FIFO-serialized.
276
- */
277
- export interface BuildExecutor {
278
- build(options: BuildOptions): Promise<BuildResult>;
279
- }
280
23
  /**
281
24
  * Wraps a {@link BuildExecutor} so each call to `build` receives the
282
25
  * union of the caller's `options.plugins` and the plugins sourced
@@ -287,9 +30,9 @@ export interface BuildExecutor {
287
30
  * `ConfigBuilder` stores a raw adapter on
288
31
  * `appConfig.runtime.buildAdapter` and the
289
32
  * `installAppRuntimeBuildExecutor` step wraps that adapter with this
290
- * helper. Callers that issue builds against
291
- * `appConfig.runtime.buildExecutor` get the merged plugin set without
292
- * further ceremony.
33
+ * helper. Callers that issue builds through
34
+ * `requireBuildRuntime(appConfig).getProfile(...)` get the merged plugin set
35
+ * without further ceremony.
293
36
  */
294
37
  export declare function withBuildExecutorPlugins(executor: BuildExecutor, getPlugins: () => EcoBuildPlugin[]): BuildExecutor;
295
38
  /**
@@ -415,43 +158,7 @@ export declare function createConfiguredAppBuildManifest(appConfig: EcoPagesAppC
415
158
  * caller-supplied contribution input.
416
159
  */
417
160
  export declare function updateAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): void;
418
- /**
419
- * Collects the build-facing processor and integration contributions
420
- * that should be sealed into the app manifest during config
421
- * finalization.
422
- *
423
- * @remarks
424
- * Runs `prepareBuildContributions()` on every processor and
425
- * integration. Runtime-only side effects (HMR registration, cache
426
- * prewarming, runtime-origin wiring) belong to the startup path and
427
- * must not be triggered here; use {@link setupAppRuntimePlugins} for
428
- * those.
429
- *
430
- * @returns The new manifest's runtime / browser / browser-runtime-manifest
431
- * contribution buckets. Caller seals them into a manifest via
432
- * {@link updateAppBuildManifest}.
433
- */
434
- export declare function collectConfiguredAppBuildManifestContributions(appConfig: EcoPagesAppConfig): Promise<Pick<AppBuildManifest, 'runtimePlugins' | 'browserBundlePlugins' | 'browserRuntimeManifest'>>;
435
- /**
436
- * Runs runtime-only processor and integration setup against an already
437
- * sealed app manifest.
438
- *
439
- * @remarks
440
- * Startup paths call this after `ConfigBuilder.build` has finalized
441
- * the manifest. The manifest is reused as-is; this helper only performs
442
- * the runtime side effects that need live startup context (cache
443
- * prewarming, runtime-origin wiring, HMR manager attachment).
444
- *
445
- * Loaders, processors, and integrations are visited in that order;
446
- * each one's plugins are forwarded to the optional `onRuntimePlugin`
447
- * callback so callers can attach to every plugin discovered.
448
- */
449
- export declare function setupAppRuntimePlugins(options: {
450
- appConfig: EcoPagesAppConfig;
451
- runtimeOrigin: string;
452
- hmrManager?: IHmrManager;
453
- onRuntimePlugin?: (plugin: EcoBuildPlugin) => void;
454
- }): Promise<void>;
161
+ export { collectConfiguredAppBuildManifestContributions, setupAppRuntimePlugins, } from './app-build-manifest-runtime.js';
455
162
  /**
456
163
  * Returns the server-bundle plugin list for one app/runtime instance.
457
164
  *
@@ -468,28 +175,19 @@ export declare function getAppServerBuildPlugins(appConfig: EcoPagesAppConfig):
468
175
  * Reads from the app's sealed build manifest. The browser-bundle
469
176
  * manifest is the source of truth for which plugins participate in the
470
177
  * browser bundle.
471
- */
472
- export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
473
- /**
474
- * Returns the executor owned by an app/runtime instance.
475
178
  *
476
- * @remarks
477
- * Falls back to {@link getAppBuildAdapter} when no executor is set
478
- * on the runtime yet. The dev-watch pipeline replaces this value with
479
- * a {@link SerializedBuildExecutor} via
480
- * {@link installAppRuntimeBuildExecutor}.
179
+ * Plugins whose `name` matches a registered {@link EcoSourceTransform} are
180
+ * excluded here because browser builds run those transforms via the Rolldown
181
+ * bridge post-load pass instead of as competing `onLoad` handlers.
481
182
  */
482
- export declare function getAppBuildExecutor(appConfig: EcoPagesAppConfig): BuildExecutor;
483
- /** Installs the executor that should serve future builds for one app instance. */
484
- export declare function setAppBuildExecutor(appConfig: EcoPagesAppConfig, buildExecutor: BuildExecutor): void;
183
+ export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
485
184
  /**
486
185
  * Runs a build through the active pipeline.
487
186
  *
488
187
  * @remarks
489
188
  * `executor` defaults to the default-bundler adapter for non-app-aware
490
- * callsites. App-aware code should pass
491
- * `getAppBuildExecutor(appConfig)` (or read it directly) to honor the
492
- * per-app pipeline.
189
+ * callsites. App-aware code should pass a profile executor from
190
+ * {@link requireBuildRuntime} to honor the per-app pipeline.
493
191
  */
494
192
  export declare function build(options: BuildOptions, executor?: BuildExecutor): Promise<BuildResult>;
495
193
  /**
@@ -1,13 +1,15 @@
1
- import { mergeBrowserRuntimeManifests } from "./browser-runtime-manifest.js";
2
1
  import { normalizeNodeRuntimeBuildOutputs } from "./runtime-build-output-normalizer.js";
3
- import { createForeignJsxOverridePlugin } from "../plugins/foreign-jsx-override-plugin.js";
2
+ import {
3
+ } from "./build-contracts.js";
4
4
  import {
5
5
  createAppBuildManifest,
6
6
  getBrowserBuildPlugins,
7
7
  getServerBuildPlugins
8
8
  } from "./build-manifest.js";
9
+ import { getAppSourceTransforms } from "../plugins/source-transform.js";
10
+ import { createAliasResolverPlugin } from "../plugins/alias-resolver-plugin.js";
11
+ import { getJsxOwnershipPlugins } from "./jsx-ownership-plugins.js";
9
12
  import { createRolldownBuildAdapter } from "./rolldown-build-adapter.js";
10
- import { createRolldownDevBuildAdapter } from "./rolldown-dev-build-adapter.js";
11
13
  function mergeBuildExecutorPlugins(existing, appPlugins) {
12
14
  if (!existing || existing.length === 0) {
13
15
  return appPlugins;
@@ -35,6 +37,12 @@ function withBuildExecutorPlugins(executor, getPlugins) {
35
37
  }
36
38
  };
37
39
  }
40
+ function patchAppRuntime(appConfig, patch) {
41
+ appConfig.runtime = {
42
+ ...appConfig.runtime ?? {},
43
+ ...patch
44
+ };
45
+ }
38
46
  function createHostOwnedBuildError(methodName) {
39
47
  return new Error(
40
48
  `Vite-hosted builds are owned by the host runtime. Core cannot ${methodName} through the host-owned compatibility adapter.`
@@ -59,8 +67,6 @@ function createBuildAdapter(options) {
59
67
  switch (options?.ownership ?? "rolldown") {
60
68
  case "vite-host":
61
69
  return createViteHostBuildAdapter();
62
- case "rolldown-dev":
63
- return createRolldownDevBuildAdapter();
64
70
  case "rolldown":
65
71
  default:
66
72
  return createRolldownBuildAdapter();
@@ -79,31 +85,24 @@ function getAppBuildOwnership(appConfig) {
79
85
  return appConfig.runtime?.buildOwnership ?? getBuildAdapterOwnership(appConfig.runtime?.buildAdapter);
80
86
  }
81
87
  function setAppBuildOwnership(appConfig, buildOwnership) {
82
- appConfig.runtime = {
83
- ...appConfig.runtime ?? {},
84
- buildOwnership
85
- };
88
+ patchAppRuntime(appConfig, { buildOwnership });
86
89
  }
87
90
  function getAppBuildAdapter(appConfig) {
88
91
  return appConfig.runtime?.buildAdapter ?? getDefaultBuildAdapter(getAppBuildOwnership(appConfig));
89
92
  }
90
93
  function setAppBuildAdapter(appConfig, buildAdapter) {
91
- appConfig.runtime = {
92
- ...appConfig.runtime ?? {},
94
+ patchAppRuntime(appConfig, {
93
95
  buildOwnership: getBuildAdapterOwnership(buildAdapter),
94
96
  buildAdapter
95
- };
97
+ });
96
98
  }
97
99
  function getAppBuildManifest(appConfig) {
98
100
  return appConfig.runtime?.buildManifest ?? createAppBuildManifest({
99
- loaderPlugins: Array.from(appConfig.loaders.values())
101
+ loaderPlugins: Array.from(appConfig.loaders?.values() ?? [])
100
102
  });
101
103
  }
102
104
  function setAppBuildManifest(appConfig, buildManifest) {
103
- appConfig.runtime = {
104
- ...appConfig.runtime ?? {},
105
- buildManifest
106
- };
105
+ patchAppRuntime(appConfig, { buildManifest });
107
106
  }
108
107
  function createConfiguredAppBuildManifest(appConfig, input) {
109
108
  return createAppBuildManifest({
@@ -116,85 +115,22 @@ function createConfiguredAppBuildManifest(appConfig, input) {
116
115
  function updateAppBuildManifest(appConfig, input) {
117
116
  setAppBuildManifest(appConfig, createConfiguredAppBuildManifest(appConfig, input));
118
117
  }
119
- async function collectConfiguredAppBuildManifestContributions(appConfig) {
120
- const runtimePlugins = [];
121
- const browserBundlePlugins = [];
122
- const browserRuntimeManifests = [];
123
- for (const processor of appConfig.processors.values()) {
124
- await processor.prepareBuildContributions();
125
- if (processor.plugins) {
126
- runtimePlugins.push(...processor.plugins);
127
- }
128
- if (processor.buildPlugins) {
129
- browserBundlePlugins.push(...processor.buildPlugins);
130
- }
131
- }
132
- for (const integration of appConfig.integrations) {
133
- integration.setConfig(appConfig);
134
- await integration.prepareBuildContributions();
135
- runtimePlugins.push(...integration.plugins ?? []);
136
- browserBundlePlugins.push(...integration.browserBuildPlugins ?? []);
137
- browserRuntimeManifests.push(integration.browserRuntimeManifest);
138
- }
139
- return {
140
- runtimePlugins,
141
- browserBundlePlugins,
142
- browserRuntimeManifest: mergeBrowserRuntimeManifests(...browserRuntimeManifests)
143
- };
144
- }
145
- async function setupAppRuntimePlugins(options) {
146
- for (const loader of options.appConfig.loaders.values()) {
147
- options.onRuntimePlugin?.(loader);
148
- }
149
- for (const processor of options.appConfig.processors.values()) {
150
- await processor.setup();
151
- if (processor.plugins) {
152
- for (const plugin of processor.plugins) {
153
- options.onRuntimePlugin?.(plugin);
154
- }
155
- }
156
- }
157
- for (const integration of options.appConfig.integrations) {
158
- integration.setConfig(options.appConfig);
159
- integration.setRuntimeOrigin(options.runtimeOrigin);
160
- if (options.hmrManager) {
161
- integration.setHmrManager(options.hmrManager);
162
- }
163
- await integration.setup();
164
- for (const plugin of integration.plugins) {
165
- options.onRuntimePlugin?.(plugin);
166
- }
167
- }
168
- }
118
+ import {
119
+ collectConfiguredAppBuildManifestContributions,
120
+ setupAppRuntimePlugins
121
+ } from "./app-build-manifest-runtime.js";
169
122
  function getAppServerBuildPlugins(appConfig) {
170
- return getServerBuildPlugins(getAppBuildManifest(appConfig));
123
+ const srcDir = appConfig.absolutePaths?.srcDir;
124
+ const aliasPlugin = srcDir ? [createAliasResolverPlugin(srcDir)] : [];
125
+ return [...aliasPlugin, ...getServerBuildPlugins(getAppBuildManifest(appConfig))];
171
126
  }
172
127
  function getAppBrowserBuildPlugins(appConfig) {
173
128
  const manifest = getAppBuildManifest(appConfig);
174
- const jsxOwnershipPlugins = collectJsxOwnershipPlugins(appConfig);
175
- return [...getBrowserBuildPlugins(manifest), ...jsxOwnershipPlugins];
176
- }
177
- function collectJsxOwnershipPlugins(appConfig) {
178
- const jsxExtensions = (appConfig.integrations ?? []).filter((integration) => integration.jsxImportSource).flatMap(
179
- (integration) => integration.extensions.filter((extension) => extension.endsWith(".tsx") || extension.endsWith(".jsx")).map((extension) => ({ integration, extension }))
180
- ).sort((left, right) => right.extension.length - left.extension.length);
181
- return jsxExtensions.map(
182
- ({ integration, extension }) => createForeignJsxOverridePlugin({
183
- hostJsxImportSource: integration.jsxImportSource,
184
- foreignExtensions: [extension],
185
- excludeExtensions: jsxExtensions.filter((candidate) => candidate.extension.length > extension.length).filter((candidate) => candidate.extension.endsWith(extension)).map((candidate) => candidate.extension),
186
- name: `ecopages-jsx-ownership-${integration.name}-${extension.replace(/[^a-zA-Z0-9]+/g, "-")}`
187
- })
188
- );
189
- }
190
- function getAppBuildExecutor(appConfig) {
191
- return appConfig.runtime?.buildExecutor ?? getAppBuildAdapter(appConfig);
192
- }
193
- function setAppBuildExecutor(appConfig, buildExecutor) {
194
- appConfig.runtime = {
195
- ...appConfig.runtime ?? {},
196
- buildExecutor
197
- };
129
+ const sourceTransformNames = new Set(getAppSourceTransforms(appConfig).map((transform) => transform.name));
130
+ const browserPlugins = getBrowserBuildPlugins(manifest).filter((plugin) => !sourceTransformNames.has(plugin.name));
131
+ const srcDir = appConfig.absolutePaths?.srcDir;
132
+ const aliasPlugin = srcDir ? [createAliasResolverPlugin(srcDir)] : [];
133
+ return [...aliasPlugin, ...browserPlugins, ...getJsxOwnershipPlugins(appConfig)];
198
134
  }
199
135
  function build(options, executor = defaultRolldownBuildAdapter) {
200
136
  return executor.build(options).then((result) => {
@@ -225,7 +161,6 @@ export {
225
161
  defaultViteHostBuildAdapter,
226
162
  getAppBrowserBuildPlugins,
227
163
  getAppBuildAdapter,
228
- getAppBuildExecutor,
229
164
  getAppBuildManifest,
230
165
  getAppBuildOwnership,
231
166
  getAppServerBuildPlugins,
@@ -234,7 +169,6 @@ export {
234
169
  getDefaultBuildAdapter,
235
170
  getTranspileOptions,
236
171
  setAppBuildAdapter,
237
- setAppBuildExecutor,
238
172
  setAppBuildManifest,
239
173
  setAppBuildOwnership,
240
174
  setupAppRuntimePlugins,
@@ -0,0 +1,97 @@
1
+ import type { EcoSourceTransform } from '../plugins/source-transform.js';
2
+ import type { EcoBuildPlugin } from './build-types.js';
3
+ /**
4
+ * Which backend owns the app's build pipeline.
5
+ *
6
+ * - `'rolldown'`: the default. Ecopages runs the build directly through
7
+ * its bundler-backed adapter.
8
+ * - `'vite-host'`: a host runtime owns the build. {@link ViteHostBuildAdapter}
9
+ * is exposed as a boundary marker; any direct call into it throws.
10
+ */
11
+ export type BuildOwnership = 'vite-host' | 'rolldown';
12
+ /** A single message emitted by the build backend. */
13
+ export interface BuildLog {
14
+ message: string;
15
+ }
16
+ /** A single artifact emitted by the build backend. */
17
+ export interface BuildOutput {
18
+ path: string;
19
+ }
20
+ /** Per-entrypoint dependency metadata surfaced alongside a build. */
21
+ export interface BuildDependencyGraph {
22
+ entrypoints: Record<string, string[]>;
23
+ }
24
+ /** The full result of one `BuildAdapter.build` call. */
25
+ export interface BuildResult {
26
+ success: boolean;
27
+ logs: BuildLog[];
28
+ outputs: BuildOutput[];
29
+ dependencyGraph?: BuildDependencyGraph;
30
+ entryOutputs?: Record<string, string>;
31
+ }
32
+ /**
33
+ * Options accepted by every `BuildAdapter.build` call.
34
+ *
35
+ * @remarks
36
+ * Fields that the adapter can forward are honored; fields that cannot
37
+ * (currently `splitting`, `bundle`, and `outbase`) are accepted so
38
+ * call-sites compile, but the adapter ignores them.
39
+ */
40
+ export interface BuildOptions {
41
+ entrypoints: string[] | Record<string, string>;
42
+ outdir?: string;
43
+ /**
44
+ * Base directory for `[dir]` placeholders in `naming`. Currently
45
+ * the bundled adapter derives the base from `root` directly and
46
+ * ignores this field.
47
+ *
48
+ * @deprecated Accepted for call-site compatibility only. Use record-form
49
+ * `entrypoints` keys to preserve directory structure.
50
+ */
51
+ outbase?: string;
52
+ naming?: string;
53
+ conditions?: string[];
54
+ define?: Record<string, string>;
55
+ minify?: boolean;
56
+ treeshaking?: boolean;
57
+ target?: string;
58
+ format?: string;
59
+ sourcemap?: string;
60
+ /** @deprecated Accepted for call-site compatibility only. */
61
+ splitting?: boolean;
62
+ root?: string;
63
+ /** @deprecated Accepted for call-site compatibility only. */
64
+ bundle?: boolean;
65
+ externalPackages?: boolean;
66
+ external?: string[];
67
+ jsx?: {
68
+ development?: boolean;
69
+ factory?: string;
70
+ fragment?: string;
71
+ importSource?: string;
72
+ runtime?: 'classic' | 'automatic';
73
+ sideEffects?: boolean;
74
+ };
75
+ plugins?: EcoBuildPlugin[];
76
+ sourceTransforms?: EcoSourceTransform[];
77
+ [key: string]: unknown;
78
+ }
79
+ /** Stable profile identifiers for `BuildAdapter.getTranspileOptions`. */
80
+ export type BuildTranspileProfile = 'browser-script' | 'hmr-runtime' | 'hmr-entrypoint';
81
+ /** Resolved transpile settings for a given profile. */
82
+ export interface BuildTranspileOptions {
83
+ target: string;
84
+ format: string;
85
+ sourcemap: string;
86
+ }
87
+ /** Low-level build backend contract. */
88
+ export interface BuildAdapter {
89
+ readonly ownership?: BuildOwnership;
90
+ build(options: BuildOptions): Promise<BuildResult>;
91
+ resolve(importPath: string, rootDir: string): string;
92
+ getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
93
+ }
94
+ /** Runtime-facing facade for issuing builds. */
95
+ export interface BuildExecutor {
96
+ build(options: BuildOptions): Promise<BuildResult>;
97
+ }
File without changes