@ecopages/core 0.2.0-alpha.9 → 0.2.1-beta.0
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.
- package/README.md +79 -28
- package/package.json +94 -116
- package/src/adapters/README.md +2 -2
- package/src/adapters/abstract/application-adapter.d.ts +28 -2
- package/src/adapters/abstract/application-adapter.js +14 -2
- package/src/adapters/abstract/router-adapter.d.ts +1 -1
- package/src/adapters/abstract/server-adapter.d.ts +2 -2
- package/src/adapters/bun/client-bridge.d.ts +1 -1
- package/src/adapters/bun/create-app.d.ts +12 -12
- package/src/adapters/bun/create-app.js +64 -41
- package/src/adapters/bun/hmr-manager.d.ts +19 -115
- package/src/adapters/bun/hmr-manager.js +25 -301
- package/src/adapters/bun/index.d.ts +1 -1
- package/src/adapters/bun/index.js +2 -2
- package/src/adapters/bun/runtime-host.d.ts +52 -0
- package/src/adapters/bun/runtime-host.js +56 -0
- package/src/adapters/bun/server-adapter.d.ts +100 -32
- package/src/adapters/bun/server-adapter.js +142 -65
- package/src/adapters/bun/static-preview-host.d.ts +28 -0
- package/src/adapters/bun/static-preview-host.js +45 -0
- package/src/{create-app.d.ts → adapters/create-app.d.ts} +9 -6
- package/src/{create-app.js → adapters/create-app.js} +4 -4
- package/src/adapters/index.d.ts +1 -5
- package/src/adapters/index.js +1 -7
- package/src/adapters/node/create-app.d.ts +15 -12
- package/src/adapters/node/create-app.js +34 -85
- package/src/adapters/node/http-request-bridge.d.ts +57 -0
- package/src/adapters/node/http-request-bridge.js +118 -0
- package/src/adapters/node/node-client-bridge.d.ts +1 -1
- package/src/adapters/node/node-hmr-manager.d.ts +22 -103
- package/src/adapters/node/node-hmr-manager.js +26 -289
- package/src/adapters/node/runtime-host.d.ts +57 -0
- package/src/adapters/node/runtime-host.js +92 -0
- package/src/adapters/node/server-adapter-dependencies.d.ts +19 -0
- package/src/adapters/node/server-adapter-dependencies.js +18 -0
- package/src/adapters/node/server-adapter.d.ts +19 -42
- package/src/adapters/node/server-adapter.js +94 -139
- package/src/adapters/node/static-content-server.d.ts +1 -1
- package/src/adapters/node/static-content-server.js +1 -1
- package/src/adapters/node/static-preview-host.d.ts +55 -0
- package/src/adapters/node/static-preview-host.js +68 -0
- package/src/adapters/shared/application-adapter.d.ts +1 -1
- package/src/adapters/shared/define-api-handler.d.ts +1 -1
- package/src/adapters/shared/explicit-static-render-preparation.d.ts +25 -0
- package/src/adapters/shared/explicit-static-render-preparation.js +26 -0
- package/src/adapters/shared/explicit-static-route-matcher.d.ts +7 -4
- package/src/adapters/shared/explicit-static-route-matcher.js +14 -16
- package/src/adapters/shared/file-route-middleware-pipeline.d.ts +7 -10
- package/src/adapters/shared/file-route-middleware-pipeline.js +2 -11
- package/src/adapters/shared/fs-server-response-factory.d.ts +14 -10
- package/src/adapters/shared/fs-server-response-factory.js +11 -27
- package/src/adapters/shared/fs-server-response-matcher.d.ts +18 -18
- package/src/adapters/shared/fs-server-response-matcher.js +72 -46
- package/src/adapters/shared/hmr-entrypoint-registrar.js +1 -1
- package/src/adapters/shared/hmr-html-response.d.ts +1 -1
- package/src/adapters/shared/hmr-html-response.js +4 -3
- package/src/adapters/shared/render-context.d.ts +5 -3
- package/src/adapters/shared/render-context.js +24 -1
- package/src/adapters/shared/runtime-app-bootstrap.d.ts +26 -0
- package/src/adapters/shared/runtime-app-bootstrap.js +46 -0
- package/src/adapters/shared/runtime-host.d.ts +12 -0
- package/src/adapters/shared/server-adapter.d.ts +22 -11
- package/src/adapters/shared/server-adapter.js +183 -133
- package/src/adapters/shared/server-route-handler.d.ts +5 -5
- package/src/adapters/shared/server-route-handler.js +4 -4
- package/src/adapters/shared/server-static-builder.d.ts +8 -7
- package/src/adapters/shared/server-static-builder.js +6 -5
- package/src/adapters/shared/shared-hmr-manager.d.ts +59 -0
- package/src/adapters/shared/shared-hmr-manager.js +241 -0
- package/src/adapters/shared/static-preview-host.d.ts +10 -0
- package/src/build/README.md +57 -67
- package/src/build/browser-runtime-manifest.d.ts +31 -0
- package/src/build/browser-runtime-manifest.js +61 -0
- package/src/build/browser-runtime-plugin-helpers.d.ts +26 -0
- package/src/build/browser-runtime-plugin-helpers.js +14 -0
- package/src/build/browser-runtime-plugin.d.ts +78 -0
- package/src/build/browser-runtime-plugin.js +173 -0
- package/src/build/build-adapter.d.ts +384 -63
- package/src/build/build-adapter.js +129 -54
- package/src/build/build-manifest.d.ts +6 -0
- package/src/build/build-manifest.js +21 -2
- package/src/build/build-types.d.ts +2 -2
- package/src/build/rolldown-adapter-helpers.d.ts +58 -0
- package/src/build/rolldown-adapter-helpers.js +265 -0
- package/src/build/rolldown-build-adapter.d.ts +28 -0
- package/src/build/rolldown-build-adapter.js +65 -0
- package/src/build/rolldown-dev-build-adapter.d.ts +82 -0
- package/src/build/rolldown-dev-build-adapter.js +166 -0
- package/src/build/rolldown-plugin-bridge.d.ts +59 -0
- package/src/build/rolldown-plugin-bridge.js +199 -0
- package/src/build/runtime-build-executor.d.ts +15 -7
- package/src/build/runtime-build-executor.js +8 -9
- package/src/build/runtime-build-output-normalizer.d.ts +3 -0
- package/src/build/runtime-build-output-normalizer.js +111 -0
- package/src/build/serialized-build-executor.d.ts +64 -0
- package/src/build/serialized-build-executor.js +63 -0
- package/src/build/server-side-css-shim-plugin.d.ts +41 -0
- package/src/build/server-side-css-shim-plugin.js +35 -0
- package/src/cache/index.d.ts +6 -0
- package/src/cache/index.js +6 -0
- package/src/cache/module-parse-cache.d.ts +65 -0
- package/src/cache/module-parse-cache.js +75 -0
- package/src/config/README.md +5 -2
- package/src/config/config-builder.d.ts +41 -13
- package/src/config/config-builder.js +62 -24
- package/src/declarations.d.ts +1 -1
- package/src/dev/host-runtime.d.ts +10 -0
- package/src/dev/host-runtime.js +24 -0
- package/src/dev/sc-server.d.ts +1 -1
- package/src/dev/sc-server.js +1 -1
- package/src/eco/eco.browser.d.ts +2 -0
- package/src/eco/eco.browser.js +88 -0
- package/src/eco/eco.js +50 -45
- package/src/eco/eco.types.d.ts +60 -8
- package/src/eco/eco.utils.d.ts +1 -40
- package/src/eco/eco.utils.js +5 -35
- package/src/eco/global-injector-map.d.ts +3 -3
- package/src/eco/global-injector-map.js +2 -2
- package/src/eco/lazy-injector-map.d.ts +2 -2
- package/src/errors/index.d.ts +1 -0
- package/src/errors/index.js +3 -1
- package/src/hmr/client/hmr-runtime.js +9 -1
- package/src/hmr/hmr-strategy.d.ts +16 -13
- package/src/hmr/hmr-strategy.js +22 -7
- package/src/hmr/strategies/default-hmr-strategy.d.ts +2 -2
- package/src/hmr/strategies/default-hmr-strategy.js +1 -1
- package/src/hmr/strategies/js-hmr-strategy.d.ts +4 -9
- package/src/hmr/strategies/js-hmr-strategy.js +5 -10
- package/src/index.browser.d.ts +2 -2
- package/src/index.browser.js +1 -1
- package/src/index.d.ts +3 -2
- package/src/index.js +15 -4
- package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -1
- package/src/integrations/ghtml/ghtml-renderer.js +24 -29
- package/src/integrations/ghtml/ghtml.constants.d.ts +1 -0
- package/src/integrations/ghtml/ghtml.constants.js +4 -0
- package/src/integrations/ghtml/ghtml.plugin.d.ts +2 -6
- package/src/integrations/ghtml/ghtml.plugin.js +3 -4
- package/src/plugins/README.md +1 -0
- package/src/plugins/alias-resolver-cache.d.ts +68 -0
- package/src/plugins/alias-resolver-cache.js +106 -0
- package/src/plugins/alias-resolver-plugin.d.ts +5 -1
- package/src/plugins/alias-resolver-plugin.js +19 -7
- package/src/plugins/eco-component-meta-plugin.d.ts +12 -1
- package/src/plugins/eco-component-meta-plugin.js +43 -25
- package/src/plugins/foreign-jsx-override-plugin.d.ts +33 -0
- package/src/plugins/foreign-jsx-override-plugin.js +41 -0
- package/src/plugins/integration-plugin.d.ts +136 -42
- package/src/plugins/integration-plugin.js +99 -31
- package/src/plugins/processor.d.ts +4 -2
- package/src/plugins/processor.js +8 -3
- package/src/plugins/source-transform.d.ts +46 -0
- package/src/plugins/source-transform.js +71 -0
- package/src/route-renderer/GRAPH.md +80 -318
- package/src/route-renderer/README.md +74 -78
- package/src/route-renderer/orchestration/component-render-context.d.ts +97 -0
- package/src/route-renderer/orchestration/component-render-context.js +147 -0
- package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +18 -0
- package/src/route-renderer/orchestration/declared-ownership-graph.js +34 -0
- package/src/route-renderer/orchestration/foreign-subtree-execution.service.d.ts +110 -0
- package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +233 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +290 -128
- package/src/route-renderer/orchestration/integration-renderer.js +660 -258
- package/src/route-renderer/orchestration/ownership-planning.service.d.ts +24 -0
- package/src/route-renderer/orchestration/ownership-planning.service.js +63 -0
- package/src/route-renderer/orchestration/ownership-validation.service.d.ts +29 -0
- package/src/route-renderer/orchestration/ownership-validation.service.js +53 -0
- package/src/route-renderer/orchestration/processed-asset-dedupe.d.ts +3 -0
- package/src/route-renderer/orchestration/processed-asset-dedupe.js +27 -0
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +91 -0
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +170 -0
- package/src/route-renderer/orchestration/render-output.utils.d.ts +66 -0
- package/src/route-renderer/orchestration/render-output.utils.js +171 -0
- package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +156 -0
- package/src/route-renderer/orchestration/route-render-orchestrator.js +577 -0
- package/src/route-renderer/orchestration/template-serialization.d.ts +38 -0
- package/src/route-renderer/orchestration/template-serialization.js +45 -0
- package/src/route-renderer/page-loading/component-dependency-collection.d.ts +37 -0
- package/src/route-renderer/page-loading/component-dependency-collection.js +132 -0
- package/src/route-renderer/page-loading/declared-asset-collection.d.ts +24 -0
- package/src/route-renderer/page-loading/declared-asset-collection.js +106 -0
- package/src/route-renderer/page-loading/dependency-resolver.d.ts +2 -2
- package/src/route-renderer/page-loading/dependency-resolver.js +27 -354
- package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +11 -0
- package/src/route-renderer/page-loading/ecopages-virtual-imports.js +57 -0
- package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +45 -0
- package/src/route-renderer/page-loading/lazy-entry-collection.js +105 -0
- package/src/route-renderer/page-loading/lazy-trigger-planning.d.ts +19 -0
- package/src/route-renderer/page-loading/lazy-trigger-planning.js +40 -0
- package/src/route-renderer/page-loading/module-declaration-aggregation.d.ts +5 -0
- package/src/route-renderer/page-loading/module-declaration-aggregation.js +33 -0
- package/src/route-renderer/page-loading/module-declaration-scripts.d.ts +3 -0
- package/src/route-renderer/page-loading/module-declaration-scripts.js +18 -0
- package/src/route-renderer/page-loading/page-dependency-bundling.d.ts +13 -0
- package/src/route-renderer/page-loading/page-dependency-bundling.js +137 -0
- package/src/route-renderer/page-loading/page-module-loader.d.ts +7 -4
- package/src/route-renderer/page-loading/page-module-loader.js +8 -5
- package/src/route-renderer/route-renderer.d.ts +31 -23
- package/src/route-renderer/route-renderer.js +17 -24
- package/src/router/README.md +76 -8
- package/src/router/client/navigation-coordinator.d.ts +20 -0
- package/src/router/client/navigation-coordinator.js +2 -2
- package/src/router/server/route-registry.d.ts +78 -0
- package/src/router/server/route-registry.js +262 -0
- package/src/services/README.md +1 -2
- package/src/services/assets/asset-processing-service/asset-dependency-keys.d.ts +3 -0
- package/src/services/assets/asset-processing-service/asset-dependency-keys.js +56 -0
- package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +3 -20
- package/src/services/assets/asset-processing-service/asset-processing.service.js +52 -98
- package/src/services/assets/asset-processing-service/asset.factory.d.ts +1 -1
- package/src/services/assets/asset-processing-service/asset.factory.js +2 -2
- package/src/services/assets/asset-processing-service/assets.types.d.ts +14 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +2 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
- package/src/services/assets/asset-processing-service/grouped-content-bundles.d.ts +30 -0
- package/src/services/assets/asset-processing-service/grouped-content-bundles.js +65 -0
- package/src/services/assets/asset-processing-service/index.d.ts +6 -5
- package/src/services/assets/asset-processing-service/index.js +6 -5
- package/src/services/assets/asset-processing-service/page-package.d.ts +6 -0
- package/src/services/assets/asset-processing-service/page-package.js +80 -0
- package/src/services/assets/asset-processing-service/processor.interface.d.ts +2 -2
- package/src/services/assets/asset-processing-service/processor.registry.d.ts +2 -2
- package/src/services/assets/asset-processing-service/processors/base/base-processor.d.ts +1 -1
- package/src/services/assets/asset-processing-service/processors/base/base-processor.js +3 -2
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +10 -5
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +69 -5
- package/src/services/assets/asset-processing-service/processors/index.d.ts +5 -5
- package/src/services/assets/asset-processing-service/processors/index.js +5 -5
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +3 -2
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +66 -3
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +4 -3
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +27 -6
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +38 -3
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +57 -6
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +5 -2
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +39 -5
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +2 -2
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +5 -2
- package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.d.ts +18 -0
- package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.js +45 -0
- package/src/services/assets/browser-bundle.service.d.ts +44 -3
- package/src/services/assets/browser-bundle.service.js +15 -7
- package/src/services/html/html-rewriter-provider.service.d.ts +3 -0
- package/src/services/html/html-rewriter-provider.service.js +4 -1
- package/src/services/html/html-transformer.service.d.ts +22 -3
- package/src/services/html/html-transformer.service.js +101 -35
- package/src/services/invalidation/development-invalidation.service.d.ts +1 -1
- package/src/services/invalidation/development-invalidation.service.js +1 -0
- package/src/services/module-loading/app-module-loader.service.d.ts +7 -0
- package/src/services/module-loading/app-module-loader.service.js +0 -0
- package/src/services/module-loading/app-server-module-transpiler.service.d.ts +9 -1
- package/src/services/module-loading/app-server-module-transpiler.service.js +102 -6
- package/src/services/module-loading/host-module-loader-registry.d.ts +4 -0
- package/src/services/module-loading/host-module-loader-registry.js +15 -0
- package/src/services/module-loading/module-loading-types.d.ts +2 -0
- package/src/services/module-loading/module-loading-types.js +0 -0
- package/src/services/module-loading/page-module-import.service.d.ts +32 -8
- package/src/services/module-loading/page-module-import.service.js +83 -22
- package/src/services/module-loading/server-module-transpiler.service.d.ts +8 -14
- package/src/services/module-loading/server-module-transpiler.service.js +5 -2
- package/src/services/module-loading/source-module-support.d.ts +5 -0
- package/src/services/module-loading/source-module-support.js +8 -0
- package/src/services/runtime-state/dev-graph.service.d.ts +6 -6
- package/src/services/runtime-state/dev-graph.service.js +10 -10
- package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +1 -1
- package/src/services/runtime-state/server-invalidation-state.service.d.ts +1 -1
- package/src/static-site-generator/static-site-generator.d.ts +23 -28
- package/src/static-site-generator/static-site-generator.js +119 -156
- package/src/{internal-types.d.ts → types/internal-types.d.ts} +34 -23
- package/src/types/internal-types.js +0 -0
- package/src/{public-types.d.ts → types/public-types.d.ts} +195 -37
- package/src/types/public-types.js +0 -0
- package/src/utils/html-escaping.d.ts +7 -0
- package/src/utils/html-escaping.js +6 -0
- package/src/utils/locals-utils.d.ts +1 -1
- package/src/utils/parse-cli-args.d.ts +4 -1
- package/src/utils/parse-cli-args.js +16 -1
- package/src/utils/resolve-work-dir.js +1 -1
- package/src/watchers/project-watcher.d.ts +4 -4
- package/src/watchers/project-watcher.js +35 -41
- package/src/watchers/project-watcher.test-helpers.d.ts +2 -2
- package/src/watchers/project-watcher.test-helpers.js +5 -5
- package/CHANGELOG.md +0 -31
- package/src/adapters/abstract/application-adapter.ts +0 -337
- package/src/adapters/abstract/router-adapter.ts +0 -30
- package/src/adapters/abstract/server-adapter.ts +0 -79
- package/src/adapters/bun/client-bridge.ts +0 -62
- package/src/adapters/bun/create-app.ts +0 -189
- package/src/adapters/bun/hmr-manager.ts +0 -409
- package/src/adapters/bun/index.ts +0 -2
- package/src/adapters/bun/server-adapter.ts +0 -499
- package/src/adapters/bun/server-lifecycle.d.ts +0 -63
- package/src/adapters/bun/server-lifecycle.js +0 -92
- package/src/adapters/bun/server-lifecycle.ts +0 -124
- package/src/adapters/index.ts +0 -6
- package/src/adapters/node/bootstrap-dependency-resolver.d.ts +0 -44
- package/src/adapters/node/bootstrap-dependency-resolver.js +0 -172
- package/src/adapters/node/bootstrap-dependency-resolver.ts +0 -301
- package/src/adapters/node/create-app.ts +0 -179
- package/src/adapters/node/index.d.ts +0 -6
- package/src/adapters/node/index.js +0 -11
- package/src/adapters/node/index.ts +0 -16
- package/src/adapters/node/node-client-bridge.ts +0 -79
- package/src/adapters/node/node-hmr-manager.ts +0 -381
- package/src/adapters/node/runtime-adapter.d.ts +0 -46
- package/src/adapters/node/runtime-adapter.js +0 -306
- package/src/adapters/node/runtime-adapter.ts +0 -439
- package/src/adapters/node/server-adapter.ts +0 -488
- package/src/adapters/node/static-content-server.ts +0 -239
- package/src/adapters/node/write-runtime-manifest.d.ts +0 -26
- package/src/adapters/node/write-runtime-manifest.js +0 -12
- package/src/adapters/node/write-runtime-manifest.ts +0 -38
- package/src/adapters/shared/api-response.ts +0 -104
- package/src/adapters/shared/application-adapter.ts +0 -199
- package/src/adapters/shared/define-api-handler.ts +0 -66
- package/src/adapters/shared/explicit-static-route-matcher.ts +0 -140
- package/src/adapters/shared/file-route-middleware-pipeline.ts +0 -127
- package/src/adapters/shared/fs-server-response-factory.ts +0 -118
- package/src/adapters/shared/fs-server-response-matcher.ts +0 -205
- package/src/adapters/shared/hmr-entrypoint-registrar.ts +0 -149
- package/src/adapters/shared/hmr-html-response.ts +0 -52
- package/src/adapters/shared/render-context.ts +0 -120
- package/src/adapters/shared/runtime-bootstrap.d.ts +0 -38
- package/src/adapters/shared/runtime-bootstrap.js +0 -43
- package/src/adapters/shared/runtime-bootstrap.ts +0 -79
- package/src/adapters/shared/server-adapter.ts +0 -489
- package/src/adapters/shared/server-route-handler.ts +0 -153
- package/src/adapters/shared/server-static-builder.ts +0 -166
- package/src/build/build-adapter.ts +0 -361
- package/src/build/build-manifest.ts +0 -54
- package/src/build/build-types.ts +0 -83
- package/src/build/dev-build-coordinator.d.ts +0 -74
- package/src/build/dev-build-coordinator.js +0 -161
- package/src/build/dev-build-coordinator.ts +0 -221
- package/src/build/esbuild-build-adapter.d.ts +0 -72
- package/src/build/esbuild-build-adapter.js +0 -422
- package/src/build/esbuild-build-adapter.ts +0 -559
- package/src/build/runtime-build-executor.ts +0 -34
- package/src/build/runtime-specifier-alias-plugin.d.ts +0 -15
- package/src/build/runtime-specifier-alias-plugin.js +0 -31
- package/src/build/runtime-specifier-alias-plugin.ts +0 -58
- package/src/config/config-builder.ts +0 -706
- package/src/constants.ts +0 -54
- package/src/create-app.ts +0 -87
- package/src/dev/sc-server.ts +0 -143
- package/src/eco/component-render-context.d.ts +0 -105
- package/src/eco/component-render-context.js +0 -87
- package/src/eco/component-render-context.ts +0 -224
- package/src/eco/eco.ts +0 -242
- package/src/eco/eco.types.ts +0 -221
- package/src/eco/eco.utils.ts +0 -89
- package/src/eco/global-injector-map.ts +0 -112
- package/src/eco/lazy-injector-map.ts +0 -120
- package/src/eco/module-dependencies.ts +0 -75
- package/src/errors/http-error.ts +0 -72
- package/src/errors/index.ts +0 -2
- package/src/errors/locals-access-error.ts +0 -7
- package/src/global/app-logger.ts +0 -4
- package/src/hmr/client/hmr-runtime.ts +0 -152
- package/src/hmr/hmr-strategy.ts +0 -172
- package/src/hmr/hmr.postcss.test.e2e.ts +0 -41
- package/src/hmr/hmr.test.e2e.ts +0 -66
- package/src/hmr/strategies/default-hmr-strategy.ts +0 -60
- package/src/hmr/strategies/js-hmr-strategy.ts +0 -320
- package/src/index.browser.ts +0 -3
- package/src/index.ts +0 -5
- package/src/integrations/ghtml/ghtml-renderer.ts +0 -96
- package/src/integrations/ghtml/ghtml.plugin.ts +0 -32
- package/src/internal-types.ts +0 -232
- package/src/plugins/alias-resolver-plugin.ts +0 -63
- package/src/plugins/eco-component-meta-plugin.ts +0 -481
- package/src/plugins/integration-plugin.ts +0 -226
- package/src/plugins/processor.ts +0 -240
- package/src/plugins/runtime-capability.ts +0 -14
- package/src/public-types.ts +0 -1317
- package/src/route-renderer/component-graph/component-graph-executor.d.ts +0 -32
- package/src/route-renderer/component-graph/component-graph-executor.js +0 -31
- package/src/route-renderer/component-graph/component-graph-executor.ts +0 -84
- package/src/route-renderer/component-graph/component-graph.d.ts +0 -42
- package/src/route-renderer/component-graph/component-graph.js +0 -72
- package/src/route-renderer/component-graph/component-graph.ts +0 -159
- package/src/route-renderer/component-graph/component-marker.d.ts +0 -52
- package/src/route-renderer/component-graph/component-marker.js +0 -46
- package/src/route-renderer/component-graph/component-marker.ts +0 -117
- package/src/route-renderer/component-graph/component-reference.d.ts +0 -10
- package/src/route-renderer/component-graph/component-reference.js +0 -19
- package/src/route-renderer/component-graph/component-reference.ts +0 -29
- package/src/route-renderer/component-graph/marker-graph-resolver.d.ts +0 -77
- package/src/route-renderer/component-graph/marker-graph-resolver.js +0 -95
- package/src/route-renderer/component-graph/marker-graph-resolver.ts +0 -155
- package/src/route-renderer/orchestration/integration-renderer.ts +0 -790
- package/src/route-renderer/orchestration/render-execution.service.d.ts +0 -103
- package/src/route-renderer/orchestration/render-execution.service.js +0 -121
- package/src/route-renderer/orchestration/render-execution.service.ts +0 -230
- package/src/route-renderer/orchestration/render-preparation.service.d.ts +0 -121
- package/src/route-renderer/orchestration/render-preparation.service.js +0 -332
- package/src/route-renderer/orchestration/render-preparation.service.ts +0 -476
- package/src/route-renderer/page-loading/dependency-resolver.ts +0 -612
- package/src/route-renderer/page-loading/page-module-loader.ts +0 -181
- package/src/route-renderer/route-renderer.ts +0 -115
- package/src/router/client/link-intent.test.browser.ts +0 -51
- package/src/router/client/link-intent.ts +0 -92
- package/src/router/client/navigation-coordinator.ts +0 -433
- package/src/router/server/fs-router-scanner.d.ts +0 -41
- package/src/router/server/fs-router-scanner.js +0 -156
- package/src/router/server/fs-router-scanner.ts +0 -219
- package/src/router/server/fs-router.d.ts +0 -26
- package/src/router/server/fs-router.js +0 -100
- package/src/router/server/fs-router.ts +0 -122
- package/src/services/assets/asset-processing-service/asset-processing.service.ts +0 -401
- package/src/services/assets/asset-processing-service/asset.factory.ts +0 -105
- package/src/services/assets/asset-processing-service/assets.types.ts +0 -113
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.ts +0 -95
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.ts +0 -78
- package/src/services/assets/asset-processing-service/index.ts +0 -5
- package/src/services/assets/asset-processing-service/processor.interface.ts +0 -27
- package/src/services/assets/asset-processing-service/processor.registry.ts +0 -18
- package/src/services/assets/asset-processing-service/processors/base/base-processor.ts +0 -82
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.ts +0 -95
- package/src/services/assets/asset-processing-service/processors/index.ts +0 -5
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.ts +0 -66
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.ts +0 -88
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.ts +0 -85
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.ts +0 -27
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.ts +0 -80
- package/src/services/assets/browser-bundle.service.ts +0 -53
- package/src/services/cache/cache.types.ts +0 -126
- package/src/services/cache/index.ts +0 -18
- package/src/services/cache/memory-cache-store.ts +0 -130
- package/src/services/cache/page-cache-service.ts +0 -202
- package/src/services/cache/page-request-cache-coordinator.service.ts +0 -131
- package/src/services/html/html-rewriter-provider.service.ts +0 -103
- package/src/services/html/html-transformer.service.ts +0 -279
- package/src/services/invalidation/development-invalidation.service.ts +0 -261
- package/src/services/module-loading/app-server-module-transpiler.service.ts +0 -52
- package/src/services/module-loading/page-module-import.service.ts +0 -200
- package/src/services/module-loading/server-loader.service.d.ts +0 -96
- package/src/services/module-loading/server-loader.service.js +0 -32
- package/src/services/module-loading/server-loader.service.ts +0 -130
- package/src/services/module-loading/server-module-transpiler.service.ts +0 -105
- package/src/services/runtime-manifest/node-runtime-manifest.service.d.ts +0 -35
- package/src/services/runtime-manifest/node-runtime-manifest.service.js +0 -60
- package/src/services/runtime-manifest/node-runtime-manifest.service.ts +0 -101
- package/src/services/runtime-state/dev-graph.service.ts +0 -217
- package/src/services/runtime-state/entrypoint-dependency-graph.service.ts +0 -136
- package/src/services/runtime-state/runtime-specifier-registry.service.d.ts +0 -69
- package/src/services/runtime-state/runtime-specifier-registry.service.js +0 -37
- package/src/services/runtime-state/runtime-specifier-registry.service.ts +0 -96
- package/src/services/runtime-state/server-invalidation-state.service.ts +0 -68
- package/src/services/validation/schema-validation-service.ts +0 -204
- package/src/services/validation/standard-schema.types.ts +0 -68
- package/src/static-site-generator/static-site-generator.ts +0 -462
- package/src/utils/css.d.ts +0 -1
- package/src/utils/css.js +0 -7
- package/src/utils/css.ts +0 -5
- package/src/utils/deep-merge.ts +0 -47
- package/src/utils/hash.ts +0 -5
- package/src/utils/html.ts +0 -1
- package/src/utils/invariant.ts +0 -15
- package/src/utils/locals-utils.ts +0 -37
- package/src/utils/parse-cli-args.ts +0 -83
- package/src/utils/path-utils.module.ts +0 -14
- package/src/utils/resolve-work-dir.ts +0 -45
- package/src/utils/runtime.ts +0 -44
- package/src/utils/server-utils.module.ts +0 -67
- package/src/watchers/project-watcher.test-helpers.ts +0 -41
- package/src/watchers/project-watcher.ts +0 -363
- /package/src/{internal-types.js → adapters/shared/runtime-host.js} +0 -0
- /package/src/{public-types.js → adapters/shared/static-preview-host.js} +0 -0
- /package/src/{constants.d.ts → config/constants.d.ts} +0 -0
- /package/src/{constants.js → config/constants.js} +0 -0
|
@@ -1,157 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build pipeline contracts and app-owned adapter wiring.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The build layer exposes three concentric shapes:
|
|
6
|
+
*
|
|
7
|
+
* - `BuildAdapter` — the low-level backend contract. Two implementations
|
|
8
|
+
* exist: a bundler-backed adapter (the real backend) and
|
|
9
|
+
* {@link ViteHostBuildAdapter} (a host-owned boundary marker that throws
|
|
10
|
+
* on direct use, for host runtimes that own their own build pipeline).
|
|
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`.
|
|
18
|
+
*/
|
|
1
19
|
import type { EcoBuildPlugin } from './build-types.js';
|
|
2
20
|
import { type AppBuildManifest } from './build-manifest.js';
|
|
3
|
-
import type { EcoPagesAppConfig } from '../internal-types.js';
|
|
4
|
-
import type { IHmrManager } from '../public-types.js';
|
|
5
|
-
|
|
21
|
+
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
|
+
*/
|
|
6
43
|
export interface BuildLog {
|
|
7
44
|
message: string;
|
|
8
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
|
+
*/
|
|
9
55
|
export interface BuildOutput {
|
|
10
56
|
path: string;
|
|
11
57
|
}
|
|
12
58
|
/**
|
|
13
|
-
*
|
|
59
|
+
* Per-entrypoint dependency metadata surfaced alongside a build.
|
|
14
60
|
*
|
|
15
61
|
* @remarks
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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.
|
|
18
67
|
*/
|
|
19
68
|
export interface BuildDependencyGraph {
|
|
20
69
|
/**
|
|
21
|
-
* Normalized absolute entrypoint path mapped to
|
|
22
|
-
* source
|
|
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.
|
|
23
73
|
*/
|
|
24
74
|
entrypoints: Record<string, string[]>;
|
|
25
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
|
+
*/
|
|
26
84
|
export interface BuildResult {
|
|
27
85
|
success: boolean;
|
|
28
86
|
logs: BuildLog[];
|
|
29
87
|
outputs: BuildOutput[];
|
|
30
88
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* treat missing graph data as a valid state and fall back deterministically.
|
|
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.
|
|
36
93
|
*/
|
|
37
94
|
dependencyGraph?: BuildDependencyGraph;
|
|
38
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
|
+
*/
|
|
39
105
|
export interface BuildOptions {
|
|
40
|
-
|
|
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. */
|
|
41
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
|
+
*/
|
|
42
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
|
+
*/
|
|
43
130
|
naming?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Package export conditions to honor during resolution
|
|
133
|
+
* (e.g. `['import', 'browser', 'default']`).
|
|
134
|
+
*/
|
|
44
135
|
conditions?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Global identifier replacements. Honored by the bundled adapter.
|
|
138
|
+
*/
|
|
45
139
|
define?: Record<string, string>;
|
|
140
|
+
/** Run the bundler's minifier. Off by default. */
|
|
46
141
|
minify?: boolean;
|
|
142
|
+
/** Enable the bundler's tree-shaker. Defaults to `true`. */
|
|
47
143
|
treeshaking?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Output target family. Accepted values: `'browser'`, `'node'`,
|
|
146
|
+
* anything else falls through to a platform-neutral setup.
|
|
147
|
+
*/
|
|
48
148
|
target?: string;
|
|
149
|
+
/** Output module format. Accepted: `'esm'`, `'cjs'`, `'iife'`. */
|
|
49
150
|
format?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Source map mode. Accepted: `'none'`, `'inline'`, `'external'`,
|
|
153
|
+
* `'linked'`. Anything else maps to the bundler's default (linked).
|
|
154
|
+
*/
|
|
50
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
|
+
*/
|
|
51
162
|
splitting?: boolean;
|
|
163
|
+
/** Project root used to resolve relative paths and the tsconfig lookup. */
|
|
52
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
|
+
*/
|
|
53
169
|
bundle?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Treat `node_modules` packages as external. Honored by the bundled
|
|
172
|
+
* adapter.
|
|
173
|
+
*/
|
|
54
174
|
externalPackages?: boolean;
|
|
175
|
+
/** Explicit list of module specifiers to leave as external imports. */
|
|
55
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
|
+
*/
|
|
56
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
|
+
*/
|
|
57
199
|
[key: string]: unknown;
|
|
58
200
|
}
|
|
201
|
+
/** Stable profile identifiers for `BuildAdapter.getTranspileOptions`. */
|
|
59
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
|
+
*/
|
|
60
213
|
export interface BuildTranspileOptions {
|
|
61
214
|
target: string;
|
|
62
215
|
format: string;
|
|
63
216
|
sourcemap: string;
|
|
64
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
|
+
*/
|
|
65
227
|
export interface BuildAdapter {
|
|
228
|
+
/** Which backend owns this adapter. Used for routing decisions in app helpers. */
|
|
229
|
+
readonly ownership?: BuildOwnership;
|
|
66
230
|
/**
|
|
67
|
-
*
|
|
231
|
+
* Run one build.
|
|
68
232
|
*
|
|
69
233
|
* @remarks
|
|
70
|
-
*
|
|
71
|
-
*
|
|
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.
|
|
72
242
|
*/
|
|
73
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
|
+
*/
|
|
74
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
|
+
*/
|
|
75
260
|
getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
|
|
76
261
|
}
|
|
77
262
|
/**
|
|
78
|
-
* Runtime-
|
|
263
|
+
* Runtime-facing facade for issuing builds.
|
|
79
264
|
*
|
|
80
265
|
* @remarks
|
|
81
|
-
*
|
|
82
|
-
*
|
|
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`.
|
|
83
271
|
*
|
|
84
|
-
* In production and non-watch flows the executor is
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
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.
|
|
88
276
|
*/
|
|
89
277
|
export interface BuildExecutor {
|
|
90
278
|
build(options: BuildOptions): Promise<BuildResult>;
|
|
91
279
|
}
|
|
92
|
-
export declare function createBuildAdapter(): BuildAdapter;
|
|
93
280
|
/**
|
|
94
|
-
* @
|
|
281
|
+
* Wraps a {@link BuildExecutor} so each call to `build` receives the
|
|
282
|
+
* union of the caller's `options.plugins` and the plugins sourced
|
|
283
|
+
* from `getPlugins()`.
|
|
284
|
+
*
|
|
285
|
+
* @remarks
|
|
286
|
+
* The single point of plugin injection in the runtime path: the
|
|
287
|
+
* `ConfigBuilder` stores a raw adapter on
|
|
288
|
+
* `appConfig.runtime.buildAdapter` and the
|
|
289
|
+
* `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.
|
|
95
293
|
*/
|
|
96
|
-
export declare
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
294
|
+
export declare function withBuildExecutorPlugins(executor: BuildExecutor, getPlugins: () => EcoBuildPlugin[]): BuildExecutor;
|
|
295
|
+
/**
|
|
296
|
+
* Boundary-marker adapter for Vite-host ownership.
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* This is not a real backend. It exists so `appConfig.runtime.buildAdapter`
|
|
300
|
+
* can carry the `'vite-host'` ownership without falling back to a
|
|
301
|
+
* framework-owned bundler path. Every method throws a
|
|
302
|
+
* {@link createHostOwnedBuildError} so misrouted calls fail loudly
|
|
303
|
+
* with a clear message instead of silently executing under a
|
|
304
|
+
* different backend.
|
|
305
|
+
*
|
|
306
|
+
* The class stays in the public surface for host runtimes that own
|
|
307
|
+
* their build pipeline (e.g. Nitro) and for app code that wants to
|
|
308
|
+
* opt into host-owned ownership before its host wires up the build.
|
|
309
|
+
*/
|
|
310
|
+
export declare class ViteHostBuildAdapter implements BuildAdapter {
|
|
311
|
+
readonly ownership: "vite-host";
|
|
312
|
+
build(_options: BuildOptions): Promise<BuildResult>;
|
|
313
|
+
resolve(_importPath: string, _rootDir: string): string;
|
|
314
|
+
getTranspileOptions(_profile: BuildTranspileProfile): BuildTranspileOptions;
|
|
100
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* Constructs a {@link ViteHostBuildAdapter}. Use only in code paths
|
|
318
|
+
* that explicitly opt into the host-owned boundary.
|
|
319
|
+
*/
|
|
320
|
+
export declare function createViteHostBuildAdapter(): BuildAdapter;
|
|
321
|
+
/**
|
|
322
|
+
* Constructs a build adapter for the given ownership.
|
|
323
|
+
*
|
|
324
|
+
* @param options - When `options.ownership` is omitted, the default is
|
|
325
|
+
* `'rolldown'`. The Vite-host path is opt-in.
|
|
326
|
+
*/
|
|
327
|
+
export declare function createBuildAdapter(options?: {
|
|
328
|
+
ownership?: BuildOwnership;
|
|
329
|
+
}): BuildAdapter;
|
|
330
|
+
/** The shared default-bundler backend instance. Use {@link getAppBuildAdapter} in app-aware code. */
|
|
331
|
+
export declare const defaultRolldownBuildAdapter: BuildAdapter;
|
|
332
|
+
/** The shared Vite-host boundary instance. Use {@link getAppBuildAdapter} in app-aware code. */
|
|
333
|
+
export declare const defaultViteHostBuildAdapter: BuildAdapter;
|
|
334
|
+
/**
|
|
335
|
+
* Global default build adapter.
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* Resolves to the bundled default-bundler adapter. New app-aware
|
|
339
|
+
* code should prefer {@link getAppBuildAdapter}.
|
|
340
|
+
*/
|
|
101
341
|
export declare const defaultBuildAdapter: BuildAdapter;
|
|
342
|
+
/**
|
|
343
|
+
* Resolves the default build adapter for an ownership value.
|
|
344
|
+
*
|
|
345
|
+
* @param ownership - Defaults to `'rolldown'`. Returns the
|
|
346
|
+
* {@link ViteHostBuildAdapter} only when the caller explicitly asks
|
|
347
|
+
* for `'vite-host'`.
|
|
348
|
+
*/
|
|
349
|
+
export declare function getDefaultBuildAdapter(ownership?: BuildOwnership): BuildAdapter;
|
|
350
|
+
/**
|
|
351
|
+
* Reads the {@link BuildOwnership} declared on a {@link BuildAdapter}.
|
|
352
|
+
*
|
|
353
|
+
* @param buildAdapter - When `undefined`, defaults to `'rolldown'`.
|
|
354
|
+
*/
|
|
355
|
+
export declare function getBuildAdapterOwnership(buildAdapter: BuildAdapter | undefined): BuildOwnership;
|
|
356
|
+
/**
|
|
357
|
+
* Resolves the build ownership of an app config.
|
|
358
|
+
*
|
|
359
|
+
* @remarks
|
|
360
|
+
* Resolution order: `appConfig.runtime.buildOwnership` (explicit), then
|
|
361
|
+
* the ownership declared on `appConfig.runtime.buildAdapter`, then the
|
|
362
|
+
* default `'rolldown'`.
|
|
363
|
+
*/
|
|
364
|
+
export declare function getAppBuildOwnership(appConfig: EcoPagesAppConfig): BuildOwnership;
|
|
365
|
+
/**
|
|
366
|
+
* Sets the explicit build ownership on an app config.
|
|
367
|
+
*
|
|
368
|
+
* @remarks
|
|
369
|
+
* The `ConfigBuilder` uses this when the caller calls
|
|
370
|
+
* `setBuildOwnership`. App code that needs a different ownership
|
|
371
|
+
* should call this directly with a new value; passing the same
|
|
372
|
+
* value is a no-op.
|
|
373
|
+
*/
|
|
374
|
+
export declare function setAppBuildOwnership(appConfig: EcoPagesAppConfig, buildOwnership: BuildOwnership): void;
|
|
102
375
|
/**
|
|
103
376
|
* Returns the adapter owned by an app/runtime instance.
|
|
104
377
|
*
|
|
105
378
|
* @remarks
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
379
|
+
* Falls back through `appConfig.runtime.buildAdapter` →
|
|
380
|
+
* {@link getDefaultBuildAdapter} on the resolved ownership. Throws
|
|
381
|
+
* never; a missing adapter resolves to the global default.
|
|
109
382
|
*/
|
|
110
383
|
export declare function getAppBuildAdapter(appConfig: EcoPagesAppConfig): BuildAdapter;
|
|
111
384
|
/**
|
|
112
|
-
* Installs the adapter that should serve future builds for one app
|
|
385
|
+
* Installs the adapter that should serve future builds for one app
|
|
386
|
+
* instance, and aligns the ownership field to the new adapter's
|
|
387
|
+
* declared ownership.
|
|
113
388
|
*/
|
|
114
389
|
export declare function setAppBuildAdapter(appConfig: EcoPagesAppConfig, buildAdapter: BuildAdapter): void;
|
|
115
390
|
/**
|
|
116
391
|
* Returns the build manifest owned by an app/runtime instance.
|
|
392
|
+
*
|
|
393
|
+
* @remarks
|
|
394
|
+
* Falls back to a fresh manifest seeded from the config's loaders when
|
|
395
|
+
* the app config has no manifest yet. This is the supported way to
|
|
396
|
+
* read the manifest across the source-loading and asset-processing
|
|
397
|
+
* services.
|
|
117
398
|
*/
|
|
118
399
|
export declare function getAppBuildManifest(appConfig: EcoPagesAppConfig): AppBuildManifest;
|
|
119
|
-
/**
|
|
120
|
-
* Installs the build manifest that should be visible to one app instance.
|
|
121
|
-
*/
|
|
400
|
+
/** Installs the build manifest that should be visible to one app instance. */
|
|
122
401
|
export declare function setAppBuildManifest(appConfig: EcoPagesAppConfig, buildManifest: AppBuildManifest): void;
|
|
123
402
|
/**
|
|
124
|
-
*
|
|
125
|
-
* runtime/browser
|
|
403
|
+
* Builds a fresh app manifest from the config's loaders plus optional
|
|
404
|
+
* caller-supplied runtime/browser contributions.
|
|
126
405
|
*
|
|
127
406
|
* @remarks
|
|
128
|
-
*
|
|
129
|
-
*
|
|
407
|
+
* Loader plugins are always taken from the config; runtime and
|
|
408
|
+
* browser-bundle plugins are passed through from the caller when
|
|
409
|
+
* supplied, otherwise left empty for later population by
|
|
410
|
+
* {@link collectConfiguredAppBuildManifestContributions}.
|
|
130
411
|
*/
|
|
131
412
|
export declare function createConfiguredAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): AppBuildManifest;
|
|
132
413
|
/**
|
|
133
|
-
* Replaces the app-owned manifest using config-owned loaders and
|
|
134
|
-
* contribution input.
|
|
414
|
+
* Replaces the app-owned manifest using config-owned loaders and the
|
|
415
|
+
* caller-supplied contribution input.
|
|
135
416
|
*/
|
|
136
417
|
export declare function updateAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): void;
|
|
137
418
|
/**
|
|
138
|
-
* Collects the build-facing processor and integration contributions
|
|
139
|
-
* be sealed into the app manifest during config
|
|
419
|
+
* Collects the build-facing processor and integration contributions
|
|
420
|
+
* that should be sealed into the app manifest during config
|
|
421
|
+
* finalization.
|
|
140
422
|
*
|
|
141
423
|
* @remarks
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
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}.
|
|
145
433
|
*/
|
|
146
|
-
export declare function collectConfiguredAppBuildManifestContributions(appConfig: EcoPagesAppConfig): Promise<Pick<AppBuildManifest, 'runtimePlugins' | 'browserBundlePlugins'>>;
|
|
434
|
+
export declare function collectConfiguredAppBuildManifestContributions(appConfig: EcoPagesAppConfig): Promise<Pick<AppBuildManifest, 'runtimePlugins' | 'browserBundlePlugins' | 'browserRuntimeManifest'>>;
|
|
147
435
|
/**
|
|
148
|
-
* Runs runtime-only processor and integration setup against an already
|
|
149
|
-
* app manifest.
|
|
436
|
+
* Runs runtime-only processor and integration setup against an already
|
|
437
|
+
* sealed app manifest.
|
|
150
438
|
*
|
|
151
439
|
* @remarks
|
|
152
|
-
* Startup paths call this after
|
|
153
|
-
*
|
|
154
|
-
* runtime side effects that
|
|
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.
|
|
155
448
|
*/
|
|
156
449
|
export declare function setupAppRuntimePlugins(options: {
|
|
157
450
|
appConfig: EcoPagesAppConfig;
|
|
@@ -159,28 +452,56 @@ export declare function setupAppRuntimePlugins(options: {
|
|
|
159
452
|
hmrManager?: IHmrManager;
|
|
160
453
|
onRuntimePlugin?: (plugin: EcoBuildPlugin) => void;
|
|
161
454
|
}): Promise<void>;
|
|
455
|
+
/**
|
|
456
|
+
* Returns the server-bundle plugin list for one app/runtime instance.
|
|
457
|
+
*
|
|
458
|
+
* @remarks
|
|
459
|
+
* Reads from the app's sealed build manifest; the manifest itself is
|
|
460
|
+
* the source of truth for which plugins participate in the server
|
|
461
|
+
* bundle.
|
|
462
|
+
*/
|
|
162
463
|
export declare function getAppServerBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
|
|
464
|
+
/**
|
|
465
|
+
* Returns the browser-bundle plugin list for one app/runtime instance.
|
|
466
|
+
*
|
|
467
|
+
* @remarks
|
|
468
|
+
* Reads from the app's sealed build manifest. The browser-bundle
|
|
469
|
+
* manifest is the source of truth for which plugins participate in the
|
|
470
|
+
* browser bundle.
|
|
471
|
+
*/
|
|
163
472
|
export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
|
|
164
473
|
/**
|
|
165
474
|
* Returns the executor owned by an app/runtime instance.
|
|
166
475
|
*
|
|
167
476
|
* @remarks
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
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}.
|
|
171
481
|
*/
|
|
172
482
|
export declare function getAppBuildExecutor(appConfig: EcoPagesAppConfig): BuildExecutor;
|
|
173
|
-
/**
|
|
174
|
-
* Installs the executor that should serve future builds for one app instance.
|
|
175
|
-
*/
|
|
483
|
+
/** Installs the executor that should serve future builds for one app instance. */
|
|
176
484
|
export declare function setAppBuildExecutor(appConfig: EcoPagesAppConfig, buildExecutor: BuildExecutor): void;
|
|
177
485
|
/**
|
|
178
486
|
* Runs a build through the active pipeline.
|
|
179
487
|
*
|
|
180
488
|
* @remarks
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
489
|
+
* `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.
|
|
184
493
|
*/
|
|
185
494
|
export declare function build(options: BuildOptions, executor?: BuildExecutor): Promise<BuildResult>;
|
|
495
|
+
/**
|
|
496
|
+
* Default transpile-options helper for callsites without app runtime
|
|
497
|
+
* context.
|
|
498
|
+
*
|
|
499
|
+
* @remarks
|
|
500
|
+
* New app-aware code should prefer {@link getAppTranspileOptions}.
|
|
501
|
+
*/
|
|
186
502
|
export declare function getTranspileOptions(profile: BuildTranspileProfile): BuildTranspileOptions;
|
|
503
|
+
/**
|
|
504
|
+
* Resolves transpile options for one app/runtime instance by asking
|
|
505
|
+
* the app's adapter.
|
|
506
|
+
*/
|
|
507
|
+
export declare function getAppTranspileOptions(appConfig: EcoPagesAppConfig, profile: BuildTranspileProfile): BuildTranspileOptions;
|