@ecopages/core 0.2.0-beta.3 → 0.2.0-beta.31
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 +38 -9
- package/package.json +241 -30
- package/src/adapters/README.md +6 -2
- package/src/adapters/abstract/application-adapter.d.ts +123 -6
- package/src/adapters/abstract/application-adapter.js +151 -1
- package/src/adapters/abstract/segment-path-matcher.d.ts +6 -0
- package/src/adapters/abstract/segment-path-matcher.js +149 -0
- package/src/adapters/abstract/server-adapter.d.ts +16 -2
- package/src/adapters/abstract/ws-pattern-matcher.d.ts +12 -0
- package/src/adapters/abstract/ws-pattern-matcher.js +30 -0
- package/src/adapters/bun/bun-user-websocket-lifecycle.d.ts +22 -0
- package/src/adapters/bun/bun-user-websocket-lifecycle.js +96 -0
- package/src/adapters/bun/client-bridge.d.ts +1 -0
- package/src/adapters/bun/client-bridge.js +3 -0
- package/src/adapters/bun/create-app.d.ts +9 -6
- package/src/adapters/bun/create-app.js +76 -45
- package/src/adapters/bun/hmr-manager.d.ts +1 -1
- package/src/adapters/bun/hmr-manager.js +1 -1
- package/src/adapters/bun/index.d.ts +1 -1
- package/src/adapters/bun/index.js +25 -2
- package/src/adapters/bun/runtime-host.d.ts +1 -1
- package/src/adapters/bun/runtime-host.js +1 -1
- package/src/adapters/bun/server-adapter.d.ts +92 -41
- package/src/adapters/bun/server-adapter.js +256 -117
- package/src/adapters/bun/static-preview-host.d.ts +1 -1
- package/src/adapters/bun/static-preview-host.js +25 -20
- package/src/adapters/create-app.d.ts +13 -11
- package/src/adapters/create-app.js +2 -51
- package/src/adapters/index.d.ts +2 -2
- package/src/adapters/index.js +26 -4
- package/src/adapters/node/create-app.d.ts +8 -3
- package/src/adapters/node/create-app.js +61 -13
- package/src/adapters/node/node-client-bridge.d.ts +1 -0
- package/src/adapters/node/node-client-bridge.js +3 -0
- package/src/adapters/node/node-hmr-manager.d.ts +1 -1
- package/src/adapters/node/node-hmr-manager.js +1 -1
- package/src/adapters/node/runtime-host.d.ts +1 -1
- package/src/adapters/node/runtime-host.js +1 -1
- package/src/adapters/node/server-adapter-dependencies.js +4 -0
- package/src/adapters/node/server-adapter.d.ts +64 -23
- package/src/adapters/node/server-adapter.js +169 -142
- package/src/adapters/node/static-content-server.d.ts +1 -0
- package/src/adapters/node/static-content-server.js +10 -2
- package/src/adapters/node/static-preview-host.d.ts +1 -1
- package/src/adapters/node/static-preview-host.js +27 -12
- package/src/adapters/shared/{hmr-entrypoint-registrar.d.ts → hmr/hmr-entrypoint-registrar.d.ts} +31 -30
- package/src/adapters/shared/hmr/hmr-entrypoint-registrar.js +106 -0
- package/src/adapters/shared/{hmr-html-response.d.ts → hmr/hmr-html-response.d.ts} +2 -2
- package/src/adapters/shared/{hmr-html-response.js → hmr/hmr-html-response.js} +4 -1
- package/src/adapters/shared/hmr/shared-hmr-manager.d.ts +101 -0
- package/src/adapters/shared/hmr/shared-hmr-manager.js +432 -0
- package/src/adapters/shared/http/api-request-pipeline.d.ts +23 -0
- package/src/adapters/shared/http/api-request-pipeline.js +129 -0
- package/src/adapters/shared/{api-response.d.ts → http/api-response.d.ts} +1 -1
- package/src/adapters/shared/{api-response.js → http/api-response.js} +6 -23
- package/src/adapters/shared/http/create-body-response.d.ts +12 -0
- package/src/adapters/shared/http/create-body-response.js +23 -0
- package/src/adapters/shared/http/define-api-handler.d.ts +90 -0
- package/src/adapters/shared/http/define-api-handler.js +63 -0
- package/src/adapters/shared/{explicit-static-render-preparation.d.ts → http/explicit-static-render-preparation.d.ts} +3 -3
- package/src/adapters/shared/{explicit-static-route-matcher.d.ts → http/explicit-static-route-matcher.d.ts} +3 -9
- package/src/adapters/shared/{explicit-static-route-matcher.js → http/explicit-static-route-matcher.js} +3 -38
- package/src/adapters/shared/{file-route-middleware-pipeline.d.ts → http/file-route-middleware-pipeline.d.ts} +2 -2
- package/src/adapters/shared/{file-route-middleware-pipeline.js → http/file-route-middleware-pipeline.js} +10 -22
- package/src/adapters/shared/{fs-server-response-factory.d.ts → http/fs-server-response-factory.d.ts} +7 -2
- package/src/adapters/shared/{fs-server-response-factory.js → http/fs-server-response-factory.js} +22 -2
- package/src/adapters/shared/{fs-server-response-matcher.d.ts → http/fs-server-response-matcher.d.ts} +25 -5
- package/src/adapters/shared/{fs-server-response-matcher.js → http/fs-server-response-matcher.js} +109 -27
- package/src/adapters/shared/http/run-middleware-chain.d.ts +5 -0
- package/src/adapters/shared/http/run-middleware-chain.js +17 -0
- package/src/adapters/shared/{application-adapter.d.ts → runtime/application-adapter.d.ts} +2 -2
- package/src/adapters/shared/{application-adapter.js → runtime/application-adapter.js} +1 -1
- package/src/adapters/shared/runtime/copy-runtime-public-dir.d.ts +6 -0
- package/src/adapters/shared/runtime/copy-runtime-public-dir.js +24 -0
- package/src/adapters/shared/runtime/port-manager.d.ts +116 -0
- package/src/adapters/shared/runtime/port-manager.js +196 -0
- package/src/adapters/shared/{render-context.d.ts → runtime/render-context.d.ts} +2 -2
- package/src/adapters/shared/{render-context.js → runtime/render-context.js} +8 -17
- package/src/adapters/shared/{runtime-app-bootstrap.d.ts → runtime/runtime-app-bootstrap.d.ts} +4 -3
- package/src/adapters/shared/{runtime-app-bootstrap.js → runtime/runtime-app-bootstrap.js} +4 -7
- package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +46 -0
- package/src/adapters/shared/runtime/runtime-server-lifecycle.js +57 -0
- package/src/adapters/shared/{server-adapter.d.ts → runtime/server-adapter.d.ts} +23 -49
- package/src/adapters/shared/runtime/server-adapter.js +226 -0
- package/src/adapters/shared/{server-route-handler.d.ts → runtime/server-route-handler.d.ts} +6 -33
- package/src/adapters/shared/{server-route-handler.js → runtime/server-route-handler.js} +5 -43
- package/src/adapters/shared/{server-static-builder.d.ts → runtime/server-static-builder.d.ts} +27 -35
- package/src/adapters/shared/runtime/server-static-builder.js +191 -0
- package/src/adapters/shared/{static-preview-host.d.ts → runtime/static-preview-host.d.ts} +6 -1
- package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +21 -0
- package/src/adapters/shared/ws/node-http-websocket-upgrades.js +100 -0
- package/src/adapters/shared/ws/websocket-lifecycle.d.ts +24 -0
- package/src/adapters/shared/ws/websocket-lifecycle.js +55 -0
- package/src/build/README.md +140 -31
- package/src/build/app-build-manifest-runtime.d.ts +39 -0
- package/src/build/app-build-manifest-runtime.js +124 -0
- package/src/build/{browser-runtime-plugin.d.ts → browser/browser-runtime-plugin.d.ts} +1 -1
- package/src/build/{browser-runtime-plugin.js → browser/browser-runtime-plugin.js} +1 -1
- package/src/build/browser/jsx-ownership-plugins.d.ts +24 -0
- package/src/build/browser/jsx-ownership-plugins.js +41 -0
- package/src/build/browser/lit-static-render-worker-context.d.ts +2 -0
- package/src/build/browser/lit-static-render-worker-context.js +6 -0
- package/src/build/build-adapter.d.ts +29 -334
- package/src/build/build-adapter.js +32 -133
- package/src/build/cache/build-input-fingerprint.d.ts +28 -0
- package/src/build/cache/build-input-fingerprint.js +31 -0
- package/src/build/cache/cache-constants.d.ts +4 -0
- package/src/build/cache/cache-constants.js +6 -0
- package/src/build/cache/cache-keys.d.ts +22 -0
- package/src/build/cache/cache-keys.js +63 -0
- package/src/build/cache/dev-browser-script-cache.d.ts +34 -0
- package/src/build/cache/dev-browser-script-cache.js +90 -0
- package/src/build/cache/pages-unified-graph-build.d.ts +31 -0
- package/src/build/cache/pages-unified-graph-build.js +198 -0
- package/src/build/cache/production-build-cache.d.ts +20 -0
- package/src/build/cache/production-build-cache.js +63 -0
- package/src/build/cache/server-entry-build-cache.d.ts +43 -0
- package/src/build/cache/server-entry-build-cache.js +165 -0
- package/src/build/contracts/build-contracts.d.ts +96 -0
- package/src/build/contracts/build-manifest.d.ts +90 -0
- package/src/build/{build-manifest.js → contracts/build-manifest.js} +2 -2
- package/src/build/contracts/build-types.js +0 -0
- package/src/build/{rolldown-adapter-helpers.d.ts → rolldown/rolldown-adapter-helpers.d.ts} +23 -9
- package/src/build/{rolldown-adapter-helpers.js → rolldown/rolldown-adapter-helpers.js} +99 -13
- package/src/build/{rolldown-build-adapter.d.ts → rolldown/rolldown-build-adapter.d.ts} +3 -7
- package/src/build/{rolldown-build-adapter.js → rolldown/rolldown-build-adapter.js} +3 -3
- package/src/build/rolldown/rolldown-build-invocation-metrics.d.ts +12 -0
- package/src/build/rolldown/rolldown-build-invocation-metrics.js +43 -0
- package/src/build/{rolldown-plugin-bridge.d.ts → rolldown/rolldown-plugin-bridge.d.ts} +16 -2
- package/src/build/{rolldown-plugin-bridge.js → rolldown/rolldown-plugin-bridge.js} +21 -6
- package/src/build/rolldown/rolldown-source-transform-pass.d.ts +15 -0
- package/src/build/rolldown/rolldown-source-transform-pass.js +61 -0
- package/src/build/rolldown/runtime-build-output-normalizer.d.ts +10 -0
- package/src/build/rolldown/runtime-build-output-normalizer.js +201 -0
- package/src/build/runtime/build-profile-options.d.ts +7 -0
- package/src/build/runtime/build-profile-options.js +37 -0
- package/src/build/runtime/build-request-identity.d.ts +17 -0
- package/src/build/runtime/build-request-identity.js +54 -0
- package/src/build/runtime/build-request-policy.d.ts +59 -0
- package/src/build/runtime/build-request-policy.js +46 -0
- package/src/build/runtime/build-runtime.d.ts +28 -0
- package/src/build/runtime/build-runtime.js +65 -0
- package/src/build/runtime/deduping-build-executor.d.ts +21 -0
- package/src/build/runtime/deduping-build-executor.js +34 -0
- package/src/build/runtime/parallel-build-executor.d.ts +21 -0
- package/src/build/runtime/parallel-build-executor.js +52 -0
- package/src/build/{serialized-build-executor.d.ts → runtime/serialized-build-executor.d.ts} +1 -1
- package/src/client/navigation-scripts/classification.d.ts +16 -0
- package/src/client/navigation-scripts/classification.js +41 -0
- package/src/client/navigation-scripts/index.d.ts +3 -0
- package/src/client/navigation-scripts/index.js +23 -0
- package/src/client/navigation-scripts/navigation-scripts.test.browser.js +65 -0
- package/src/client/navigation-scripts/registry.d.ts +11 -0
- package/src/client/navigation-scripts/registry.js +12 -0
- package/src/client/navigation-scripts/rerun-queue.d.ts +37 -0
- package/src/client/navigation-scripts/rerun-queue.js +73 -0
- package/src/client/scroll.d.ts +17 -0
- package/src/client/scroll.js +25 -0
- package/src/client/scroll.test.browser.js +37 -0
- package/src/client/view-transitions.d.ts +16 -0
- package/src/client/view-transitions.js +63 -0
- package/src/config/config-builder.d.ts +25 -10
- package/src/config/config-builder.js +53 -11
- package/src/config/constants.d.ts +1 -0
- package/src/config/constants.js +2 -1
- package/src/dev/client-bridge-registry.d.ts +5 -0
- package/src/dev/client-bridge-registry.js +15 -0
- package/src/dev/dev-client-ownership.d.ts +7 -0
- package/src/dev/dev-client-ownership.js +6 -0
- package/src/dev/hmr-manager-registry.d.ts +8 -0
- package/src/dev/hmr-manager-registry.js +15 -0
- package/src/dev/host-runtime.d.ts +3 -0
- package/src/dev/host-runtime.js +7 -0
- package/src/dev/runtime-server-started-message.d.ts +2 -0
- package/src/dev/runtime-server-started-message.js +6 -0
- package/src/diagnostics/request-build-dedupe.d.ts +18 -0
- package/src/diagnostics/request-build-dedupe.js +33 -0
- package/src/diagnostics/startup-trace.d.ts +72 -0
- package/src/diagnostics/startup-trace.js +253 -0
- package/src/eco/README.md +11 -0
- package/src/eco/eco-declared-component.d.ts +14 -0
- package/src/eco/eco-declared-component.js +16 -0
- package/src/eco/eco.browser.js +5 -6
- package/src/eco/eco.js +7 -8
- package/src/eco/eco.types.d.ts +14 -3
- package/src/eco/eco.utils.d.ts +1 -1
- package/src/eco/eco.utils.js +1 -1
- package/src/eco/page-layout-normalization.d.ts +21 -0
- package/src/eco/page-layout-normalization.js +59 -0
- package/src/env.d.ts +2 -0
- package/src/errors/index.d.ts +1 -0
- package/src/errors/index.js +7 -1
- package/src/errors/undeclared-component-dependency-error.d.ts +11 -0
- package/src/errors/undeclared-component-dependency-error.js +17 -0
- package/src/hmr/client/hmr-runtime.js +7 -4
- package/src/hmr/hmr-entrypoint-output.d.ts +49 -0
- package/src/hmr/hmr-entrypoint-output.js +60 -0
- package/src/hmr/hmr-file-change-prep.d.ts +10 -0
- package/src/hmr/hmr-file-change-prep.js +17 -0
- package/src/hmr/hmr-strategy.d.ts +15 -0
- package/src/hmr/hmr-strategy.js +19 -0
- package/src/hmr/strategies/js-hmr-strategy.d.ts +3 -5
- package/src/hmr/strategies/js-hmr-strategy.js +72 -19
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +29 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +28 -2
- package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -6
- package/src/integrations/ghtml/ghtml-renderer.js +2 -51
- package/src/integrations/ghtml/ghtml.plugin.d.ts +3 -16
- package/src/integrations/ghtml/ghtml.plugin.js +7 -14
- package/src/plugins/alias-resolver-cache.d.ts +6 -9
- package/src/plugins/alias-resolver-plugin.d.ts +3 -3
- package/src/plugins/alias-resolver-plugin.js +38 -51
- package/src/plugins/define-integration.d.ts +26 -0
- package/src/plugins/define-integration.js +19 -0
- package/src/plugins/eco-component-meta-plugin.d.ts +1 -1
- package/src/plugins/eco-component-meta-plugin.js +5 -8
- package/src/plugins/foreign-jsx-override-plugin.d.ts +1 -1
- package/src/plugins/foreign-jsx-override-plugin.js +4 -6
- package/src/plugins/integration-plugin.d.ts +43 -14
- package/src/plugins/integration-plugin.js +18 -5
- package/src/plugins/jsx-import-source.utils.d.ts +8 -0
- package/src/plugins/jsx-import-source.utils.js +26 -0
- package/src/plugins/processor.d.ts +61 -12
- package/src/plugins/processor.js +24 -5
- package/src/plugins/source-transform.d.ts +32 -1
- package/src/plugins/source-transform.js +23 -1
- package/src/plugins/tsconfig-import-resolver.d.ts +18 -0
- package/src/plugins/tsconfig-import-resolver.js +159 -0
- package/src/route-renderer/GRAPH.md +26 -32
- package/src/route-renderer/README.md +38 -31
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.d.ts +107 -0
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +148 -0
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.d.ts +20 -0
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.js +31 -0
- package/src/route-renderer/orchestration/{component-render-context.d.ts → foreign-child/component-render-context.d.ts} +8 -15
- package/src/route-renderer/orchestration/{component-render-context.js → foreign-child/component-render-context.js} +4 -2
- package/src/route-renderer/orchestration/{render-output.utils.d.ts → foreign-child/foreign-child-output.utils.d.ts} +17 -7
- package/src/route-renderer/orchestration/{render-output.utils.js → foreign-child/foreign-child-output.utils.js} +35 -26
- package/src/route-renderer/orchestration/{foreign-subtree-execution.service.d.ts → foreign-child/foreign-subtree-execution.service.d.ts} +64 -34
- package/src/route-renderer/orchestration/{foreign-subtree-execution.service.js → foreign-child/foreign-subtree-execution.service.js} +170 -37
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.d.ts +19 -0
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.js +35 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +24 -143
- package/src/route-renderer/orchestration/integration-renderer.js +163 -402
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.d.ts +75 -0
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +177 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.d.ts +10 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +143 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph.d.ts +34 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph.js +96 -0
- package/src/route-renderer/orchestration/{ownership-validation.service.d.ts → ownership-graph/ownership-validation.service.d.ts} +7 -2
- package/src/route-renderer/orchestration/{ownership-validation.service.js → ownership-graph/ownership-validation.service.js} +30 -3
- package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.d.ts +7 -0
- package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.js +32 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.d.ts +9 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.js +7 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.d.ts +12 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.js +29 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +106 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +436 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +31 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +229 -0
- package/src/route-renderer/orchestration/{processed-asset-dedupe.d.ts → page-browser-graph/processed-asset-dedupe.d.ts} +1 -1
- package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.d.ts +31 -0
- package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.js +25 -0
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +6 -0
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +27 -0
- package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.d.ts +15 -0
- package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.js +36 -0
- package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.d.ts +20 -0
- package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.js +24 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.d.ts +25 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +49 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.d.ts +4 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.js +33 -0
- package/src/route-renderer/orchestration/{route-render-orchestrator.d.ts → route-pipeline/route-render-orchestrator.d.ts} +13 -53
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +162 -0
- package/src/route-renderer/orchestration/string-markup-renderer.d.ts +14 -0
- package/src/route-renderer/orchestration/string-markup-renderer.js +55 -0
- package/src/route-renderer/page-loading/component-dependency-collection.js +5 -2
- package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +6 -0
- package/src/route-renderer/page-loading/ecopages-virtual-imports.js +7 -2
- package/src/route-renderer/page-loading/module-declaration-aggregation.js +4 -0
- package/src/router/client/link-intent.d.ts +11 -21
- package/src/router/client/link-intent.js +10 -0
- package/src/router/client/link-intent.test.browser.js +12 -1
- package/src/router/client/link-navigation-policy.d.ts +45 -0
- package/src/router/client/link-navigation-policy.js +101 -0
- package/src/router/client/link-navigation-policy.test.browser.d.ts +1 -0
- package/src/router/client/link-navigation-policy.test.browser.js +92 -0
- package/src/router/client/navigation-coordinator.d.ts +1 -1
- package/src/router/client/navigation-coordinator.js +12 -2
- package/src/services/assets/asset-processing-service/asset-dependency-keys.d.ts +13 -0
- package/src/services/assets/asset-processing-service/asset-dependency-keys.js +3 -0
- package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +6 -1
- package/src/services/assets/asset-processing-service/asset-processing.service.js +44 -5
- package/src/services/assets/asset-processing-service/assets.types.d.ts +1 -1
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +2 -1
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
- package/src/services/assets/asset-processing-service/browser-runtime-entry-resolution.d.ts +52 -0
- package/src/services/assets/asset-processing-service/browser-runtime-entry-resolution.js +78 -0
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +4 -2
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +28 -13
- package/src/services/assets/asset-processing-service/finalize-processed-asset.d.ts +3 -0
- package/src/services/assets/asset-processing-service/finalize-processed-asset.js +7 -0
- package/src/services/assets/asset-processing-service/grouped-content-bundles.d.ts +2 -1
- package/src/services/assets/asset-processing-service/grouped-content-bundles.js +38 -12
- package/src/services/assets/asset-processing-service/index.d.ts +2 -0
- package/src/services/assets/asset-processing-service/index.js +2 -0
- package/src/services/assets/asset-processing-service/inline-content-script-body.d.ts +11 -0
- package/src/services/assets/asset-processing-service/inline-content-script-body.js +17 -0
- package/src/services/assets/asset-processing-service/materialize-content-script-asset.d.ts +9 -0
- package/src/services/assets/asset-processing-service/materialize-content-script-asset.js +18 -0
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +0 -2
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +2 -15
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +8 -0
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +73 -68
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +0 -1
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +18 -15
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +17 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +2 -31
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +2 -30
- package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
- package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +43 -0
- package/src/services/assets/asset-processing-service/resolve-integration-plugin.d.ts +4 -0
- package/src/services/assets/asset-processing-service/resolve-integration-plugin.js +17 -0
- package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.d.ts +0 -1
- package/src/services/assets/asset-processing-service/ungrouped-dependency-processing.js +5 -10
- package/src/services/assets/browser-bundle.service.d.ts +28 -30
- package/src/services/assets/browser-bundle.service.js +28 -19
- package/src/services/html/html-transformer.service.d.ts +1 -1
- package/src/services/html/html-transformer.service.js +5 -5
- package/src/services/invalidation/development-invalidation.service.d.ts +25 -2
- package/src/services/invalidation/development-invalidation.service.js +64 -11
- package/src/services/module-loading/README.md +49 -0
- package/src/services/module-loading/app-server-module-transpiler.service.d.ts +8 -0
- package/src/services/module-loading/app-server-module-transpiler.service.js +3 -21
- package/src/services/module-loading/page-module-import.service.d.ts +6 -2
- package/src/services/module-loading/page-module-import.service.js +110 -47
- package/src/services/module-loading/route-module-build-cache-registry.d.ts +24 -0
- package/src/services/module-loading/route-module-build-cache-registry.js +37 -0
- package/src/services/module-loading/route-module-build-cache.d.ts +4 -0
- package/src/services/module-loading/route-module-build-cache.js +38 -0
- package/src/services/module-loading/route-module-build-cache.store.d.ts +57 -0
- package/src/services/module-loading/route-module-build-cache.store.js +207 -0
- package/src/services/module-loading/route-module-build-manifest.d.ts +54 -0
- package/src/services/module-loading/route-module-build-manifest.js +85 -0
- package/src/services/module-loading/route-module-dependency-hasher.d.ts +81 -0
- package/src/services/module-loading/route-module-dependency-hasher.js +122 -0
- package/src/services/module-loading/server-module-transpiler.service.d.ts +1 -1
- package/src/services/module-loading/server-module-transpiler.service.js +1 -1
- package/src/services/validation/schema-validation-service.d.ts +1 -4
- package/src/services/validation/schema-validation-service.js +12 -13
- package/src/services/validation/standard-schema.types.d.ts +9 -62
- package/src/services/validation/validate-standard-schema.d.ts +7 -0
- package/src/services/validation/validate-standard-schema.js +14 -0
- package/src/static-site-generator/README.md +41 -0
- package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +28 -0
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +22 -0
- package/src/static-site-generator/sitemap-routes.d.ts +14 -0
- package/src/static-site-generator/sitemap-routes.js +31 -0
- package/src/static-site-generator/sitemap.d.ts +15 -0
- package/src/static-site-generator/sitemap.js +33 -0
- package/src/static-site-generator/static-build-invalidation.d.ts +10 -0
- package/src/static-site-generator/static-build-invalidation.js +59 -0
- package/src/static-site-generator/static-export-context.d.ts +30 -0
- package/src/static-site-generator/static-export-context.js +0 -0
- package/src/static-site-generator/static-site-generator.d.ts +43 -25
- package/src/static-site-generator/static-site-generator.js +381 -106
- package/src/types/internal-types.d.ts +39 -13
- package/src/types/public-types.d.ts +289 -52
- package/src/utils/ecopages-route-info.d.ts +26 -0
- package/src/utils/ecopages-route-info.js +26 -0
- package/src/utils/html-escaping.d.ts +7 -0
- package/src/utils/html-escaping.js +5 -1
- package/src/utils/parse-cli-args.d.ts +2 -0
- package/src/utils/parse-cli-args.js +6 -0
- package/src/utils/path-pattern.d.ts +23 -0
- package/src/utils/path-pattern.js +27 -0
- package/src/utils/server-utils.module.d.ts +3 -2
- package/src/utils/server-utils.module.js +5 -6
- package/src/utils/static-file-extensions.d.ts +12 -0
- package/src/utils/static-file-extensions.js +48 -0
- package/src/watchers/project-watcher-ignore.d.ts +11 -0
- package/src/watchers/project-watcher-ignore.js +16 -0
- package/src/watchers/project-watcher.d.ts +29 -6
- package/src/watchers/project-watcher.js +146 -34
- package/src/watchers/project-watcher.test-helpers.js +5 -5
- package/src/adapters/shared/define-api-handler.d.ts +0 -25
- package/src/adapters/shared/define-api-handler.js +0 -15
- package/src/adapters/shared/hmr-entrypoint-registrar.js +0 -87
- package/src/adapters/shared/server-adapter.js +0 -436
- package/src/adapters/shared/server-static-builder.js +0 -162
- package/src/adapters/shared/shared-hmr-manager.d.ts +0 -59
- package/src/adapters/shared/shared-hmr-manager.js +0 -241
- package/src/build/build-manifest.d.ts +0 -33
- package/src/build/rolldown-dev-build-adapter.d.ts +0 -82
- package/src/build/rolldown-dev-build-adapter.js +0 -166
- package/src/build/runtime-build-executor.d.ts +0 -21
- package/src/build/runtime-build-executor.js +0 -19
- package/src/build/runtime-build-output-normalizer.d.ts +0 -3
- package/src/build/runtime-build-output-normalizer.js +0 -111
- package/src/hmr/hmr.postcss.test.e2e.js +0 -31
- package/src/hmr/hmr.test.e2e.js +0 -43
- package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +0 -18
- package/src/route-renderer/orchestration/declared-ownership-graph.js +0 -34
- package/src/route-renderer/orchestration/ownership-planning.service.d.ts +0 -24
- package/src/route-renderer/orchestration/ownership-planning.service.js +0 -63
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +0 -91
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +0 -170
- package/src/route-renderer/orchestration/route-render-orchestrator.js +0 -577
- package/src/route-renderer/orchestration/template-serialization.d.ts +0 -38
- package/src/route-renderer/orchestration/template-serialization.js +0 -45
- /package/src/adapters/shared/{explicit-static-render-preparation.js → http/explicit-static-render-preparation.js} +0 -0
- /package/src/adapters/shared/{runtime-host.d.ts → runtime/runtime-host.d.ts} +0 -0
- /package/src/adapters/shared/{runtime-host.js → runtime/runtime-host.js} +0 -0
- /package/src/adapters/shared/{static-preview-host.js → runtime/static-preview-host.js} +0 -0
- /package/src/build/{browser-runtime-manifest.d.ts → browser/browser-runtime-manifest.d.ts} +0 -0
- /package/src/build/{browser-runtime-manifest.js → browser/browser-runtime-manifest.js} +0 -0
- /package/src/build/{browser-runtime-plugin-helpers.d.ts → browser/browser-runtime-plugin-helpers.d.ts} +0 -0
- /package/src/build/{browser-runtime-plugin-helpers.js → browser/browser-runtime-plugin-helpers.js} +0 -0
- /package/src/build/{build-types.js → contracts/build-contracts.js} +0 -0
- /package/src/build/{build-types.d.ts → contracts/build-types.d.ts} +0 -0
- /package/src/build/{server-side-css-shim-plugin.d.ts → rolldown/server-side-css-shim-plugin.d.ts} +0 -0
- /package/src/build/{server-side-css-shim-plugin.js → rolldown/server-side-css-shim-plugin.js} +0 -0
- /package/src/build/{serialized-build-executor.js → runtime/serialized-build-executor.js} +0 -0
- /package/src/{hmr/hmr.postcss.test.e2e.d.ts → client/navigation-scripts/navigation-scripts.test.browser.d.ts} +0 -0
- /package/src/{hmr/hmr.test.e2e.d.ts → client/scroll.test.browser.d.ts} +0 -0
- /package/src/route-renderer/orchestration/{processed-asset-dedupe.js → page-browser-graph/processed-asset-dedupe.js} +0 -0
|
@@ -9,289 +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.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import type
|
|
20
|
-
|
|
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`.
|
|
17
|
+
*/
|
|
18
|
+
import type { EcoBuildPlugin } from './contracts/build-types.js';
|
|
19
|
+
import { type BuildAdapter, type BuildExecutor, type BuildOptions, type BuildOwnership, type BuildResult, type BuildTranspileOptions, type BuildTranspileProfile } from './contracts/build-contracts.js';
|
|
20
|
+
export type { BuildAdapter, BuildDependencyGraph, BuildExecutor, BuildLog, BuildOptions, BuildOutput, BuildOwnership, BuildResult, BuildTranspileOptions, BuildTranspileProfile, } from './contracts/build-contracts.js';
|
|
21
|
+
import { type AppBuildManifest } from './contracts/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
|
-
/**
|
|
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.
|
|
293
|
-
*/
|
|
294
|
-
export declare function withBuildExecutorPlugins(executor: BuildExecutor, getPlugins: () => EcoBuildPlugin[]): BuildExecutor;
|
|
295
23
|
/**
|
|
296
24
|
* Boundary-marker adapter for Vite-host ownership.
|
|
297
25
|
*
|
|
@@ -397,7 +125,14 @@ export declare function setAppBuildAdapter(appConfig: EcoPagesAppConfig, buildAd
|
|
|
397
125
|
* services.
|
|
398
126
|
*/
|
|
399
127
|
export declare function getAppBuildManifest(appConfig: EcoPagesAppConfig): AppBuildManifest;
|
|
400
|
-
/** Installs the build manifest that should be visible to one app instance.
|
|
128
|
+
/** Installs the build manifest that should be visible to one app instance.
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* Production apps are sealed via {@link updateAppBuildManifest} during
|
|
132
|
+
* {@link ConfigBuilder.build}. Call `setAppBuildManifest` directly only in tests or
|
|
133
|
+
* when replacing the entire manifest object; partial updates should use
|
|
134
|
+
* {@link updateAppBuildManifest}.
|
|
135
|
+
*/
|
|
401
136
|
export declare function setAppBuildManifest(appConfig: EcoPagesAppConfig, buildManifest: AppBuildManifest): void;
|
|
402
137
|
/**
|
|
403
138
|
* Builds a fresh app manifest from the config's loaders plus optional
|
|
@@ -413,45 +148,14 @@ export declare function createConfiguredAppBuildManifest(appConfig: EcoPagesAppC
|
|
|
413
148
|
/**
|
|
414
149
|
* Replaces the app-owned manifest using config-owned loaders and the
|
|
415
150
|
* caller-supplied contribution input.
|
|
416
|
-
*/
|
|
417
|
-
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
151
|
*
|
|
423
152
|
* @remarks
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
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}.
|
|
153
|
+
* Primary production entry: `ConfigBuilder.build()` passes the return value of
|
|
154
|
+
* {@link collectConfiguredAppBuildManifestContributions} here to seal
|
|
155
|
+
* `appConfig.runtime.buildManifest` before startup.
|
|
433
156
|
*/
|
|
434
|
-
export declare function
|
|
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>;
|
|
157
|
+
export declare function updateAppBuildManifest(appConfig: EcoPagesAppConfig, input?: Partial<AppBuildManifest>): void;
|
|
158
|
+
export { collectConfiguredAppBuildManifestContributions, ensureIntegrationRuntimeReady, setupAppRuntimePlugins, } from './app-build-manifest-runtime.js';
|
|
455
159
|
/**
|
|
456
160
|
* Returns the server-bundle plugin list for one app/runtime instance.
|
|
457
161
|
*
|
|
@@ -468,28 +172,19 @@ export declare function getAppServerBuildPlugins(appConfig: EcoPagesAppConfig):
|
|
|
468
172
|
* Reads from the app's sealed build manifest. The browser-bundle
|
|
469
173
|
* manifest is the source of truth for which plugins participate in the
|
|
470
174
|
* browser bundle.
|
|
471
|
-
*/
|
|
472
|
-
export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
|
|
473
|
-
/**
|
|
474
|
-
* Returns the executor owned by an app/runtime instance.
|
|
475
175
|
*
|
|
476
|
-
* @
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* a {@link SerializedBuildExecutor} via
|
|
480
|
-
* {@link installAppRuntimeBuildExecutor}.
|
|
176
|
+
* Plugins whose `name` matches a registered {@link EcoSourceTransform} are
|
|
177
|
+
* excluded here because browser builds run those transforms via the Rolldown
|
|
178
|
+
* bridge post-load pass instead of as competing `onLoad` handlers.
|
|
481
179
|
*/
|
|
482
|
-
export declare function
|
|
483
|
-
/** Installs the executor that should serve future builds for one app instance. */
|
|
484
|
-
export declare function setAppBuildExecutor(appConfig: EcoPagesAppConfig, buildExecutor: BuildExecutor): void;
|
|
180
|
+
export declare function getAppBrowserBuildPlugins(appConfig: EcoPagesAppConfig): EcoBuildPlugin[];
|
|
485
181
|
/**
|
|
486
182
|
* Runs a build through the active pipeline.
|
|
487
183
|
*
|
|
488
184
|
* @remarks
|
|
489
185
|
* `executor` defaults to the default-bundler adapter for non-app-aware
|
|
490
|
-
* callsites. App-aware code should pass
|
|
491
|
-
*
|
|
492
|
-
* per-app pipeline.
|
|
186
|
+
* callsites. App-aware code should pass a profile executor from
|
|
187
|
+
* {@link requireBuildRuntime} to honor the per-app pipeline.
|
|
493
188
|
*/
|
|
494
189
|
export declare function build(options: BuildOptions, executor?: BuildExecutor): Promise<BuildResult>;
|
|
495
190
|
/**
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { createForeignJsxOverridePlugin } from "../plugins/foreign-jsx-override-plugin.js";
|
|
1
|
+
import {
|
|
2
|
+
} from "./contracts/build-contracts.js";
|
|
4
3
|
import {
|
|
5
4
|
createAppBuildManifest,
|
|
6
5
|
getBrowserBuildPlugins,
|
|
7
6
|
getServerBuildPlugins
|
|
8
|
-
} from "./build-manifest.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
byName.set(plugin.name, plugin);
|
|
18
|
-
}
|
|
19
|
-
for (const plugin of appPlugins) {
|
|
20
|
-
byName.set(plugin.name, plugin);
|
|
21
|
-
}
|
|
22
|
-
return Array.from(byName.values());
|
|
23
|
-
}
|
|
24
|
-
function withBuildExecutorPlugins(executor, getPlugins) {
|
|
25
|
-
return {
|
|
26
|
-
async build(options) {
|
|
27
|
-
const appPlugins = getPlugins();
|
|
28
|
-
if (appPlugins.length === 0) {
|
|
29
|
-
return executor.build(options);
|
|
30
|
-
}
|
|
31
|
-
return executor.build({
|
|
32
|
-
...options,
|
|
33
|
-
plugins: mergeBuildExecutorPlugins(options.plugins, appPlugins)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
7
|
+
} from "./contracts/build-manifest.js";
|
|
8
|
+
import { getAppSourceTransforms } from "../plugins/source-transform.js";
|
|
9
|
+
import { createAliasResolverPlugin } from "../plugins/alias-resolver-plugin.js";
|
|
10
|
+
import { getJsxOwnershipPlugins } from "./browser/jsx-ownership-plugins.js";
|
|
11
|
+
import { createRolldownBuildAdapter } from "./rolldown/rolldown-build-adapter.js";
|
|
12
|
+
function patchAppRuntime(appConfig, patch) {
|
|
13
|
+
appConfig.runtime = {
|
|
14
|
+
...appConfig.runtime ?? {},
|
|
15
|
+
...patch
|
|
36
16
|
};
|
|
37
17
|
}
|
|
38
18
|
function createHostOwnedBuildError(methodName) {
|
|
@@ -59,8 +39,6 @@ function createBuildAdapter(options) {
|
|
|
59
39
|
switch (options?.ownership ?? "rolldown") {
|
|
60
40
|
case "vite-host":
|
|
61
41
|
return createViteHostBuildAdapter();
|
|
62
|
-
case "rolldown-dev":
|
|
63
|
-
return createRolldownDevBuildAdapter();
|
|
64
42
|
case "rolldown":
|
|
65
43
|
default:
|
|
66
44
|
return createRolldownBuildAdapter();
|
|
@@ -79,31 +57,24 @@ function getAppBuildOwnership(appConfig) {
|
|
|
79
57
|
return appConfig.runtime?.buildOwnership ?? getBuildAdapterOwnership(appConfig.runtime?.buildAdapter);
|
|
80
58
|
}
|
|
81
59
|
function setAppBuildOwnership(appConfig, buildOwnership) {
|
|
82
|
-
appConfig
|
|
83
|
-
...appConfig.runtime ?? {},
|
|
84
|
-
buildOwnership
|
|
85
|
-
};
|
|
60
|
+
patchAppRuntime(appConfig, { buildOwnership });
|
|
86
61
|
}
|
|
87
62
|
function getAppBuildAdapter(appConfig) {
|
|
88
63
|
return appConfig.runtime?.buildAdapter ?? getDefaultBuildAdapter(getAppBuildOwnership(appConfig));
|
|
89
64
|
}
|
|
90
65
|
function setAppBuildAdapter(appConfig, buildAdapter) {
|
|
91
|
-
appConfig
|
|
92
|
-
...appConfig.runtime ?? {},
|
|
66
|
+
patchAppRuntime(appConfig, {
|
|
93
67
|
buildOwnership: getBuildAdapterOwnership(buildAdapter),
|
|
94
68
|
buildAdapter
|
|
95
|
-
};
|
|
69
|
+
});
|
|
96
70
|
}
|
|
97
71
|
function getAppBuildManifest(appConfig) {
|
|
98
72
|
return appConfig.runtime?.buildManifest ?? createAppBuildManifest({
|
|
99
|
-
loaderPlugins: Array.from(appConfig.loaders
|
|
73
|
+
loaderPlugins: Array.from(appConfig.loaders?.values() ?? [])
|
|
100
74
|
});
|
|
101
75
|
}
|
|
102
76
|
function setAppBuildManifest(appConfig, buildManifest) {
|
|
103
|
-
appConfig
|
|
104
|
-
...appConfig.runtime ?? {},
|
|
105
|
-
buildManifest
|
|
106
|
-
};
|
|
77
|
+
patchAppRuntime(appConfig, { buildManifest });
|
|
107
78
|
}
|
|
108
79
|
function createConfiguredAppBuildManifest(appConfig, input) {
|
|
109
80
|
return createAppBuildManifest({
|
|
@@ -116,96 +87,26 @@ function createConfiguredAppBuildManifest(appConfig, input) {
|
|
|
116
87
|
function updateAppBuildManifest(appConfig, input) {
|
|
117
88
|
setAppBuildManifest(appConfig, createConfiguredAppBuildManifest(appConfig, input));
|
|
118
89
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
}
|
|
90
|
+
import {
|
|
91
|
+
collectConfiguredAppBuildManifestContributions,
|
|
92
|
+
ensureIntegrationRuntimeReady,
|
|
93
|
+
setupAppRuntimePlugins
|
|
94
|
+
} from "./app-build-manifest-runtime.js";
|
|
169
95
|
function getAppServerBuildPlugins(appConfig) {
|
|
170
|
-
|
|
96
|
+
const projectDir = appConfig.absolutePaths?.projectDir;
|
|
97
|
+
const aliasPlugin = projectDir ? [createAliasResolverPlugin(projectDir)] : [];
|
|
98
|
+
return [...aliasPlugin, ...getServerBuildPlugins(getAppBuildManifest(appConfig))];
|
|
171
99
|
}
|
|
172
100
|
function getAppBrowserBuildPlugins(appConfig) {
|
|
173
101
|
const manifest = getAppBuildManifest(appConfig);
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
};
|
|
102
|
+
const sourceTransformNames = new Set(getAppSourceTransforms(appConfig).map((transform) => transform.name));
|
|
103
|
+
const browserPlugins = getBrowserBuildPlugins(manifest).filter((plugin) => !sourceTransformNames.has(plugin.name));
|
|
104
|
+
const projectDir = appConfig.absolutePaths?.projectDir;
|
|
105
|
+
const aliasPlugin = projectDir ? [createAliasResolverPlugin(projectDir)] : [];
|
|
106
|
+
return [...aliasPlugin, ...browserPlugins, ...getJsxOwnershipPlugins(appConfig)];
|
|
198
107
|
}
|
|
199
108
|
function build(options, executor = defaultRolldownBuildAdapter) {
|
|
200
|
-
return executor.build(options)
|
|
201
|
-
if (result.success) {
|
|
202
|
-
normalizeNodeRuntimeBuildOutputs(
|
|
203
|
-
result.outputs.map((output) => output.path),
|
|
204
|
-
options.root ?? process.cwd()
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
return result;
|
|
208
|
-
});
|
|
109
|
+
return executor.build(options);
|
|
209
110
|
}
|
|
210
111
|
function getTranspileOptions(profile) {
|
|
211
112
|
return defaultRolldownBuildAdapter.getTranspileOptions(profile);
|
|
@@ -223,9 +124,9 @@ export {
|
|
|
223
124
|
defaultBuildAdapter,
|
|
224
125
|
defaultRolldownBuildAdapter,
|
|
225
126
|
defaultViteHostBuildAdapter,
|
|
127
|
+
ensureIntegrationRuntimeReady,
|
|
226
128
|
getAppBrowserBuildPlugins,
|
|
227
129
|
getAppBuildAdapter,
|
|
228
|
-
getAppBuildExecutor,
|
|
229
130
|
getAppBuildManifest,
|
|
230
131
|
getAppBuildOwnership,
|
|
231
132
|
getAppServerBuildPlugins,
|
|
@@ -234,10 +135,8 @@ export {
|
|
|
234
135
|
getDefaultBuildAdapter,
|
|
235
136
|
getTranspileOptions,
|
|
236
137
|
setAppBuildAdapter,
|
|
237
|
-
setAppBuildExecutor,
|
|
238
138
|
setAppBuildManifest,
|
|
239
139
|
setAppBuildOwnership,
|
|
240
140
|
setupAppRuntimePlugins,
|
|
241
|
-
updateAppBuildManifest
|
|
242
|
-
withBuildExecutorPlugins
|
|
141
|
+
updateAppBuildManifest
|
|
243
142
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IntegrationPlugin } from '../../plugins/integration-plugin.js';
|
|
2
|
+
import type { Processor } from '../../plugins/processor.js';
|
|
3
|
+
import type { EcoPagesAppConfig } from '../../types/internal-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Optional contributor surface for build-time cache invalidation.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Processors and integrations may override {@link didChange} to report that
|
|
9
|
+
* their build inputs changed independently of route source files.
|
|
10
|
+
*/
|
|
11
|
+
export interface BuildInputChangeContributor {
|
|
12
|
+
/**
|
|
13
|
+
* Returns `true` when this contributor's build inputs changed since the last
|
|
14
|
+
* persisted incremental build metadata was written.
|
|
15
|
+
*/
|
|
16
|
+
didChange?(): boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Returns whether a processor or integration signals changed build inputs. */
|
|
19
|
+
export declare function didBuildInputContributorChange(contributor: BuildInputChangeContributor): boolean;
|
|
20
|
+
/** Hashes the app's eco.config.ts file when present. */
|
|
21
|
+
export declare function hashAppConfigFile(appConfig: EcoPagesAppConfig): string;
|
|
22
|
+
/** Fingerprints processor/integration build-input state for cache invalidation. */
|
|
23
|
+
export declare function createBuildInputsFingerprint(appConfig: EcoPagesAppConfig): string;
|
|
24
|
+
/** Returns true when any processor or integration reports changed build inputs. */
|
|
25
|
+
export declare function haveBuildInputsChanged(appConfig: EcoPagesAppConfig): boolean;
|
|
26
|
+
/** Collects every processor and integration that can invalidate incremental builds. */
|
|
27
|
+
export declare function collectBuildInputContributors(appConfig: EcoPagesAppConfig): BuildInputChangeContributor[];
|
|
28
|
+
export type { Processor, IntegrationPlugin };
|