@ecopages/core 0.2.1 → 0.3.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 +201 -72
- package/package.json +83 -254
- package/src/adapters/README.md +25 -6
- package/src/adapters/create-app.d.ts +56 -19
- package/src/adapters/create-app.js +48 -63
- package/src/adapters/node/create-app.d.ts +200 -15
- package/src/adapters/node/create-app.js +582 -146
- package/src/adapters/node/dev-session.d.ts +35 -0
- package/src/adapters/node/dev-session.js +117 -0
- package/src/adapters/node/http-request-bridge.d.ts +57 -0
- package/src/adapters/node/http-request-bridge.js +199 -0
- package/src/adapters/node/node-client-bridge.d.ts +2 -1
- package/src/adapters/node/node-client-bridge.js +62 -61
- package/src/adapters/node/runtime-host.d.ts +57 -0
- package/src/adapters/node/runtime-host.js +104 -0
- package/src/adapters/node/server-adapter.d.ts +120 -90
- package/src/adapters/node/server-adapter.js +409 -341
- package/src/adapters/shared/hmr/dev-transform-entrypoint-registry.d.ts +16 -0
- package/src/adapters/shared/hmr/dev-transform-entrypoint-registry.js +32 -0
- package/src/adapters/shared/hmr/hmr-html-response.d.ts +14 -0
- package/src/adapters/shared/hmr/hmr-html-response.js +25 -0
- package/src/adapters/shared/hmr/hmr-manager.d.ts +116 -0
- package/src/adapters/shared/hmr/hmr-manager.js +464 -0
- package/src/adapters/shared/hmr/hmr-manager.test-helpers.d.ts +28 -0
- package/src/adapters/shared/hmr/hmr-manager.test-helpers.js +53 -0
- package/src/adapters/shared/http/api-request-pipeline.d.ts +50 -0
- package/src/adapters/shared/http/api-request-pipeline.js +204 -0
- package/src/adapters/shared/{api-response.d.ts → http/api-response.d.ts} +3 -2
- package/src/adapters/shared/http/api-response.js +79 -0
- package/src/adapters/shared/http/create-body-response.d.ts +12 -0
- package/src/adapters/shared/http/create-body-response.js +26 -0
- package/src/adapters/shared/http/define-api-handler.d.ts +48 -0
- package/src/adapters/shared/http/define-api-handler.js +49 -0
- package/src/adapters/shared/{explicit-static-route-matcher.d.ts → http/explicit-static-route-matcher.d.ts} +9 -11
- package/src/adapters/shared/http/explicit-static-route-matcher.js +63 -0
- package/src/adapters/shared/{file-route-middleware-pipeline.d.ts → http/file-route-middleware-pipeline.d.ts} +8 -11
- package/src/adapters/shared/http/file-route-middleware-pipeline.js +84 -0
- package/src/adapters/shared/http/fs-server-response-factory.d.ts +9 -0
- package/src/adapters/shared/http/fs-server-response-factory.js +23 -0
- package/src/adapters/shared/http/fs-server-response-matcher.d.ts +98 -0
- package/src/adapters/shared/http/fs-server-response-matcher.js +244 -0
- 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/runtime/bind-runtime-server.d.ts +17 -0
- package/src/adapters/shared/runtime/bind-runtime-server.js +50 -0
- package/src/adapters/shared/runtime/copy-runtime-public-dir.d.ts +8 -0
- package/src/adapters/shared/runtime/copy-runtime-public-dir.js +71 -0
- package/src/adapters/shared/runtime/dev-static-route-prewarm.d.ts +13 -0
- package/src/adapters/shared/runtime/dev-static-route-prewarm.js +56 -0
- package/src/adapters/shared/runtime/port-manager-default-prompt.d.ts +6 -0
- package/src/adapters/shared/runtime/port-manager-default-prompt.js +41 -0
- package/src/adapters/shared/runtime/port-manager.d.ts +116 -0
- package/src/adapters/shared/runtime/port-manager.js +195 -0
- package/src/adapters/shared/{render-context.d.ts → runtime/render-context.d.ts} +5 -4
- package/src/adapters/shared/runtime/render-context.js +94 -0
- package/src/adapters/shared/runtime/runtime-app-bootstrap.d.ts +17 -0
- package/src/adapters/shared/runtime/runtime-app-bootstrap.js +34 -0
- package/src/adapters/shared/runtime/runtime-host.d.ts +15 -0
- package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +45 -0
- package/src/adapters/shared/runtime/runtime-server-lifecycle.js +93 -0
- package/src/adapters/shared/runtime/server-request-pipeline.d.ts +100 -0
- package/src/adapters/shared/runtime/server-request-pipeline.js +276 -0
- package/src/adapters/shared/{server-route-handler.d.ts → runtime/server-route-handler.d.ts} +10 -39
- package/src/adapters/shared/runtime/server-route-handler.js +95 -0
- package/src/adapters/shared/runtime/server-static-builder.d.ts +107 -0
- package/src/adapters/shared/runtime/server-static-builder.js +172 -0
- package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +20 -0
- package/src/adapters/shared/ws/node-http-websocket-upgrades.js +122 -0
- package/src/adapters/shared/ws/websocket-lifecycle.d.ts +24 -0
- package/src/adapters/shared/ws/websocket-lifecycle.js +62 -0
- package/src/adapters/shared/ws/ws-pattern-matcher.d.ts +7 -0
- package/src/adapters/shared/ws/ws-pattern-matcher.js +20 -0
- package/src/assets/README.md +35 -0
- package/src/assets/app-browser-client-build.d.ts +18 -0
- package/src/assets/app-browser-client-build.js +476 -0
- package/src/assets/app-browser-client-manifest.d.ts +69 -0
- package/src/assets/app-browser-client-manifest.js +332 -0
- package/src/assets/asset-processing-service/app-browser-client-bundle.d.ts +35 -0
- package/src/assets/asset-processing-service/app-browser-client-bundle.js +41 -0
- package/src/assets/asset-processing-service/asset-dependency-keys.d.ts +16 -0
- package/src/assets/asset-processing-service/asset-dependency-keys.js +80 -0
- package/src/assets/asset-processing-service/asset-package-role.d.ts +2 -0
- package/src/assets/asset-processing-service/asset-package-role.js +3 -0
- package/src/assets/asset-processing-service/asset-processing-integration.d.ts +7 -0
- package/src/assets/asset-processing-service/asset-processing-integration.js +6 -0
- package/src/assets/asset-processing-service/asset-processing.service.d.ts +156 -0
- package/src/assets/asset-processing-service/asset-processing.service.js +555 -0
- package/src/assets/asset-processing-service/asset.factory.js +79 -0
- package/src/assets/asset-processing-service/assets.types.d.ts +1 -0
- package/src/{services/assets → assets}/asset-processing-service/browser-runtime-asset.factory.d.ts +4 -1
- package/src/assets/asset-processing-service/browser-runtime-asset.factory.js +61 -0
- package/src/assets/asset-processing-service/browser-runtime-entry-resolution.d.ts +79 -0
- package/src/assets/asset-processing-service/browser-runtime-entry-resolution.js +200 -0
- package/src/{services/assets → assets}/asset-processing-service/browser-runtime-entry.factory.d.ts +6 -2
- package/src/assets/asset-processing-service/browser-runtime-entry.factory.js +67 -0
- package/src/assets/asset-processing-service/finalize-processed-asset.d.ts +3 -0
- package/src/assets/asset-processing-service/finalize-processed-asset.js +5 -0
- package/src/assets/asset-processing-service/grouped-content-bundles.d.ts +11 -0
- package/src/assets/asset-processing-service/grouped-content-bundles.js +39 -0
- package/src/assets/asset-processing-service/index.d.ts +10 -0
- package/src/{services/assets/asset-processing-service/index.d.ts → assets/asset-processing-service/index.js} +4 -0
- package/src/assets/asset-processing-service/inline-content-script-body.d.ts +11 -0
- package/src/assets/asset-processing-service/inline-content-script-body.js +23 -0
- package/src/assets/asset-processing-service/materialize-content-script-asset.d.ts +9 -0
- package/src/assets/asset-processing-service/materialize-content-script-asset.js +22 -0
- package/src/assets/asset-processing-service/page-package.d.ts +6 -0
- package/src/assets/asset-processing-service/page-package.js +81 -0
- package/src/assets/asset-processing-service/processor.interface.d.ts +8 -0
- package/src/assets/asset-processing-service/processor.interface.js +1 -0
- package/src/assets/asset-processing-service/processors/base/base-processor.d.ts +13 -0
- package/src/assets/asset-processing-service/processors/base/base-processor.js +22 -0
- package/src/assets/asset-processing-service/processors/base/base-script-processor.d.ts +40 -0
- package/src/assets/asset-processing-service/processors/base/base-script-processor.js +136 -0
- package/src/assets/asset-processing-service/processors/index.js +5 -0
- package/src/assets/asset-processing-service/processors/script/classic-script-compiler.d.ts +26 -0
- package/src/assets/asset-processing-service/processors/script/classic-script-compiler.js +92 -0
- package/src/assets/asset-processing-service/processors/script/content-script.processor.d.ts +21 -0
- package/src/assets/asset-processing-service/processors/script/content-script.processor.js +88 -0
- package/src/assets/asset-processing-service/processors/script/file-script.processor.d.ts +43 -0
- package/src/assets/asset-processing-service/processors/script/file-script.processor.js +165 -0
- package/src/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +64 -0
- package/src/assets/asset-processing-service/processors/script/node-module-script.processor.js +135 -0
- package/src/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +36 -0
- package/src/{services/assets → assets}/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
- package/src/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +40 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +19 -0
- package/src/assets/browser-bundle.service.d.ts +45 -0
- package/src/assets/browser-bundle.service.js +50 -0
- package/src/assets/browser-runtime-asset-page-cache.d.ts +11 -0
- package/src/assets/browser-runtime-asset-page-cache.js +17 -0
- package/src/assets/hashed-browser-asset.d.ts +25 -0
- package/src/assets/hashed-browser-asset.js +99 -0
- package/src/assets/processed-asset-dedupe.d.ts +3 -0
- package/src/assets/processed-asset-dedupe.js +24 -0
- package/src/browser-env.d.ts +4 -0
- package/src/browser-env.js +11 -0
- package/src/build/README.md +259 -68
- package/src/build/app-build-manifest-runtime.d.ts +38 -0
- package/src/build/app-build-manifest-runtime.js +126 -0
- package/src/build/browser/browser-runtime-manifest.d.ts +35 -0
- package/src/build/browser/browser-runtime-manifest.js +65 -0
- package/src/build/browser/browser-runtime-plugin-helpers.d.ts +14 -0
- package/src/build/browser/browser-runtime-plugin-helpers.js +21 -0
- package/src/build/browser/browser-runtime-plugin.d.ts +54 -0
- package/src/build/browser/browser-runtime-plugin.js +76 -0
- package/src/build/browser/jsx-ownership-plugins.d.ts +24 -0
- package/src/build/browser/jsx-ownership-plugins.js +55 -0
- package/src/build/browser/lit-static-render-worker-context.d.ts +1 -0
- package/src/build/browser/lit-static-render-worker-context.js +5 -0
- package/src/build/build-adapter.d.ts +21 -221
- package/src/build/build-adapter.js +39 -569
- package/src/build/build-graph.d.ts +34 -0
- package/src/build/build-graph.js +162 -0
- package/src/build/build-log.d.ts +19 -0
- package/src/build/build-log.js +35 -0
- package/src/build/build-parallelism.d.ts +4 -0
- package/src/build/build-parallelism.js +7 -0
- package/src/build/cache/app-config-hash.d.ts +10 -0
- package/src/build/cache/app-config-hash.js +22 -0
- package/src/build/cache/build-input-dependency-index.d.ts +118 -0
- package/src/build/cache/build-input-dependency-index.js +249 -0
- package/src/build/cache/cache-keys.d.ts +9 -0
- package/src/build/cache/cache-keys.js +31 -0
- package/src/build/cache/pages-unified-graph-build.d.ts +54 -0
- package/src/build/cache/pages-unified-graph-build.js +197 -0
- package/src/build/contracts/build-contracts.d.ts +157 -0
- package/src/build/contracts/build-contracts.js +1 -0
- package/src/build/contracts/build-manifest.d.ts +29 -0
- package/src/build/contracts/build-manifest.js +52 -0
- package/src/build/contracts/build-types.d.ts +1 -0
- package/src/build/contracts/build-types.js +1 -0
- package/src/build/contracts/content-virtual-modules.d.ts +14 -0
- package/src/build/contracts/content-virtual-modules.js +37 -0
- package/src/build/contracts/server-only-specifier.d.ts +8 -0
- package/src/build/contracts/server-only-specifier.js +11 -0
- package/src/build/contracts.d.ts +4 -0
- package/src/build/contracts.js +2 -0
- package/src/build/mapped-source-transform.d.ts +22 -0
- package/src/build/mapped-source-transform.js +31 -0
- package/src/build/preserve-import-meta-transform.d.ts +32 -0
- package/src/build/preserve-import-meta-transform.js +138 -0
- package/src/build/rolldown/app-package-declarations.d.ts +8 -0
- package/src/build/rolldown/app-package-declarations.js +81 -0
- package/src/build/rolldown/entry-module-closures.d.ts +8 -0
- package/src/build/rolldown/entry-module-closures.js +39 -0
- package/src/build/rolldown/rolldown-adapter-helpers.d.ts +97 -0
- package/src/build/rolldown/rolldown-adapter-helpers.js +570 -0
- package/src/build/rolldown/rolldown-build-adapter.d.ts +27 -0
- package/src/build/rolldown/rolldown-build-adapter.js +86 -0
- package/src/build/rolldown/rolldown-build-invocation-metrics.d.ts +12 -0
- package/src/build/rolldown/rolldown-build-invocation-metrics.js +40 -0
- package/src/build/rolldown/rolldown-plugin-bridge.d.ts +76 -0
- package/src/build/rolldown/rolldown-plugin-bridge.js +450 -0
- package/src/build/rolldown/server-side-css-shim-plugin.d.ts +28 -0
- package/src/build/rolldown/server-side-css-shim-plugin.js +59 -0
- package/src/build/runtime/build-environment-options.d.ts +4 -0
- package/src/build/runtime/build-environment-options.js +20 -0
- package/src/build/runtime/build-queue.d.ts +63 -0
- package/src/build/runtime/build-queue.js +117 -0
- package/src/build/runtime/build-request-identity.d.ts +15 -0
- package/src/build/runtime/build-request-identity.js +52 -0
- package/src/build/runtime/build-request-policy.d.ts +80 -0
- package/src/build/runtime/build-request-policy.js +132 -0
- package/src/build/server/README.md +50 -0
- package/src/build/server/app-module-loader.service.d.ts +35 -0
- package/src/build/server/app-module-loader.service.js +36 -0
- package/src/build/server/page-module-import.service.d.ts +112 -0
- package/src/build/server/page-module-import.service.js +264 -0
- package/src/build/server/route-module-build-cache-registry.d.ts +20 -0
- package/src/build/server/route-module-build-cache-registry.js +41 -0
- package/src/build/server/route-module-build-cache.store.d.ts +49 -0
- package/src/build/server/route-module-build-cache.store.js +75 -0
- package/src/build/server/route-module-build-manifest.d.ts +56 -0
- package/src/build/server/route-module-build-manifest.js +49 -0
- package/src/build/server/route-module-dependency-hasher.d.ts +66 -0
- package/src/build/server/route-module-dependency-hasher.js +131 -0
- package/src/build/server/view-module-loader.d.ts +10 -0
- package/src/build/server/view-module-loader.js +46 -0
- package/src/build/server-bundle-deploy-manifest.d.ts +71 -0
- package/src/build/server-bundle-deploy-manifest.js +164 -0
- package/src/build/server-bundle-publication.d.ts +12 -0
- package/src/build/server-bundle-publication.js +39 -0
- package/src/build/server-module.d.ts +8 -0
- package/src/build/server-module.js +22 -0
- package/src/build/source-maps.d.ts +17 -0
- package/src/build/source-maps.js +29 -0
- package/src/build.d.ts +19 -0
- package/src/build.js +19 -0
- package/src/cache/README.md +5 -0
- package/src/cache/index.d.ts +7 -0
- package/src/cache/index.js +7 -0
- package/src/cache/module-parse-cache.d.ts +43 -0
- package/src/cache/module-parse-cache.js +97 -0
- package/src/cache/module-transform-profiler.d.ts +7 -0
- package/src/cache/module-transform-profiler.js +8 -0
- package/src/client/README.md +5 -0
- package/src/client/navigation-attributes.d.ts +2 -0
- package/src/client/navigation-attributes.js +2 -0
- package/src/client/navigation-scripts/activation.d.ts +36 -0
- package/src/client/navigation-scripts/activation.js +97 -0
- package/src/client/navigation-scripts/classification.d.ts +12 -0
- package/src/client/navigation-scripts/classification.js +49 -0
- package/src/client/navigation-scripts/identity.d.ts +19 -0
- package/src/client/navigation-scripts/identity.js +26 -0
- package/src/client/navigation-scripts/index.d.ts +4 -0
- package/src/client/navigation-scripts/index.js +4 -0
- package/src/client/navigation-scripts/navigation-scripts.test.browser.d.ts +1 -0
- package/src/client/navigation-scripts/navigation-scripts.test.browser.js +111 -0
- package/src/client/navigation-scripts/registry.d.ts +12 -0
- package/src/client/navigation-scripts/registry.js +17 -0
- package/src/client/navigation-scripts/rerun-queue.d.ts +30 -0
- package/src/client/navigation-scripts/rerun-queue.js +84 -0
- package/src/client/scroll.d.ts +17 -0
- package/src/client/scroll.js +33 -0
- package/src/client/scroll.test.browser.d.ts +1 -0
- package/src/client/scroll.test.browser.js +31 -0
- package/src/client/view-transitions.d.ts +28 -0
- package/src/client/view-transitions.js +121 -0
- package/src/client/view-transitions.test.browser.d.ts +1 -0
- package/src/client/view-transitions.test.browser.js +53 -0
- package/src/client.d.ts +15 -0
- package/src/client.js +15 -0
- package/src/config/README.md +34 -12
- package/src/config/assembly/app-runtime.d.ts +73 -0
- package/src/config/assembly/app-runtime.js +82 -0
- package/src/config/assembly/finalize-config.d.ts +26 -0
- package/src/config/assembly/finalize-config.js +243 -0
- package/src/config/config-module-files.d.ts +11 -0
- package/src/config/config-module-files.js +70 -0
- package/src/config/constants.d.ts +1 -45
- package/src/config/constants.js +1 -25
- package/src/config/define-config.d.ts +11 -0
- package/src/config/define-config.js +3 -0
- package/src/config/index.d.ts +6 -0
- package/src/config/index.js +5 -0
- package/src/config/internal-types.d.ts +187 -0
- package/src/config/internal-types.js +1 -0
- package/src/config/load-eco-config.d.ts +15 -0
- package/src/config/load-eco-config.js +72 -0
- package/src/config/resolve-eco-config-path.d.ts +38 -0
- package/src/config/resolve-eco-config-path.js +70 -0
- package/src/config/server-config-bundle.d.ts +14 -0
- package/src/config/server-config-bundle.js +36 -0
- package/src/config/user-config-types.d.ts +156 -0
- package/src/config/user-config-types.js +1 -0
- package/src/config/write-types.d.ts +1 -0
- package/src/config/write-types.js +18 -0
- package/src/constants.d.ts +46 -0
- package/src/constants.js +46 -0
- package/src/css-imports.d.ts +4 -0
- package/src/declarations.d.ts +13 -6
- package/src/dev/README.md +61 -0
- package/src/dev/development-restart-watch-paths.d.ts +13 -0
- package/src/dev/development-restart-watch-paths.js +44 -0
- package/src/dev/development-restart.d.ts +25 -0
- package/src/dev/development-restart.js +45 -0
- package/src/dev/invalidation/README.md +11 -0
- package/src/dev/invalidation/development-invalidation.service.d.ts +153 -0
- package/src/dev/invalidation/development-invalidation.service.js +338 -0
- package/src/dev/runtime-server-started-message.d.ts +10 -0
- package/src/dev/runtime-server-started-message.js +14 -0
- package/src/dev/transform-server/dev-transform-bundler.d.ts +26 -0
- package/src/dev/transform-server/dev-transform-bundler.js +77 -0
- package/src/dev/transform-server/dev-transform-externalize-plugin.d.ts +12 -0
- package/src/dev/transform-server/dev-transform-externalize-plugin.js +29 -0
- package/src/dev/transform-server/dev-transform-import-rewriter.d.ts +17 -0
- package/src/dev/transform-server/dev-transform-import-rewriter.js +128 -0
- package/src/dev/transform-server/dev-transform-module-kind.d.ts +13 -0
- package/src/dev/transform-server/dev-transform-module-kind.js +17 -0
- package/src/dev/transform-server/dev-transform-runtime-specifiers.d.ts +5 -0
- package/src/dev/transform-server/dev-transform-runtime-specifiers.js +16 -0
- package/src/dev/transform-server/dev-transform-server.d.ts +61 -0
- package/src/dev/transform-server/dev-transform-server.js +234 -0
- package/src/dev/transform-server/dev-transform-url.d.ts +18 -0
- package/src/dev/transform-server/dev-transform-url.js +88 -0
- package/src/dev/transform-server/dev-transform-vendor-registry.d.ts +28 -0
- package/src/dev/transform-server/dev-transform-vendor-registry.js +148 -0
- package/src/dev/transform-server/index.d.ts +6 -0
- package/src/dev/transform-server/index.js +4 -0
- package/src/dev/transform-server/types.d.ts +1 -0
- package/src/dev/transform-server/types.js +1 -0
- package/src/dev-toolbar/README.md +66 -0
- package/src/dev-toolbar/build-error-contract.d.ts +12 -0
- package/src/dev-toolbar/build-error-contract.js +3 -0
- package/src/dev-toolbar/define-dev-tool.d.ts +21 -0
- package/src/dev-toolbar/define-dev-tool.js +9 -0
- package/src/dev-toolbar/dev-toolbar-config.d.ts +24 -0
- package/src/dev-toolbar/dev-toolbar-config.js +17 -0
- package/src/dev-toolbar/dev-toolbar-manifest-contract.d.ts +22 -0
- package/src/dev-toolbar/dev-toolbar-manifest-contract.js +2 -0
- package/src/dev-toolbar/dev-toolbar-manifest.d.ts +27 -0
- package/src/dev-toolbar/dev-toolbar-manifest.js +65 -0
- package/src/dev-toolbar/dev-toolbar-package.d.ts +34 -0
- package/src/dev-toolbar/dev-toolbar-package.js +78 -0
- package/src/dev-toolbar/dev-toolbar-runtime-paths.d.ts +8 -0
- package/src/dev-toolbar/dev-toolbar-runtime-paths.js +11 -0
- package/src/dev-toolbar/dev-toolbar-runtime.d.ts +10 -0
- package/src/dev-toolbar/dev-toolbar-runtime.js +26 -0
- package/src/diagnostics/README.md +11 -0
- package/src/diagnostics/request-pipeline-metrics.d.ts +48 -0
- package/src/diagnostics/request-pipeline-metrics.js +113 -0
- package/src/diagnostics/startup-trace.d.ts +71 -0
- package/src/diagnostics/startup-trace.js +247 -0
- package/src/eco/README.md +108 -22
- package/src/eco/component-identity.d.ts +17 -0
- package/src/eco/component-identity.js +25 -0
- package/src/eco/component-internal-state.d.ts +5 -0
- package/src/eco/component-internal-state.js +17 -0
- package/src/eco/component-render-context.d.ts +60 -0
- package/src/eco/component-render-context.js +140 -0
- package/src/{route-renderer/orchestration/render-output.utils.d.ts → eco/component-render-output.d.ts} +24 -16
- package/src/eco/component-render-output.js +123 -0
- package/src/eco/discovered-dependencies.d.ts +45 -0
- package/src/eco/discovered-dependencies.js +87 -0
- package/src/eco/eco-declared-component.d.ts +15 -0
- package/src/eco/eco-declared-component.js +23 -0
- package/src/eco/eco.browser.d.ts +1 -1
- package/src/eco/eco.browser.js +64 -66
- package/src/eco/eco.d.ts +1 -1
- package/src/eco/eco.js +173 -67
- package/src/eco/global-injector-map.d.ts +3 -3
- package/src/eco/global-injector-map.js +55 -41
- package/src/eco/module-dependencies.js +52 -44
- package/src/eco/page-dependency-contributions.d.ts +19 -0
- package/src/eco/page-dependency-contributions.js +52 -0
- package/src/eco/page-layout-normalization.d.ts +21 -0
- package/src/eco/page-layout-normalization.js +69 -0
- package/src/env.d.ts +31 -7
- package/src/env.js +38 -0
- package/src/errors/README.md +5 -0
- package/src/errors/http-error-page-contract.d.ts +77 -0
- package/src/errors/http-error-page-contract.js +106 -0
- package/src/errors/http-error.d.ts +8 -0
- package/src/errors/http-error.js +66 -49
- package/src/errors/index.d.ts +2 -0
- package/src/errors/index.js +3 -4
- package/src/errors/locals-access-error.js +5 -8
- package/src/errors/undeclared-component-dependency-error.d.ts +11 -0
- package/src/errors/undeclared-component-dependency-error.js +17 -0
- package/src/global/README.md +5 -0
- package/src/global/app-logger.js +4 -6
- package/src/hmr/README.md +38 -0
- package/src/hmr/client/build-error-overlay.d.ts +17 -0
- package/src/hmr/client/build-error-overlay.js +79 -0
- package/src/hmr/client/build-error-overlay.test.browser.d.ts +1 -0
- package/src/hmr/client/build-error-overlay.test.browser.js +48 -0
- package/src/hmr/client/build-error-presentation.d.ts +2 -0
- package/src/hmr/client/build-error-presentation.js +30 -0
- package/src/hmr/client/hmr-runtime.js +122 -101
- package/src/hmr/client/hmr-runtime.test.browser.d.ts +1 -0
- package/src/hmr/client/hmr-runtime.test.browser.js +32 -0
- package/src/hmr/client/module-update.d.ts +13 -0
- package/src/hmr/client/module-update.js +39 -0
- package/src/hmr/dev-client-runtime.d.ts +39 -0
- package/src/hmr/dev-client-runtime.js +78 -0
- package/src/hmr/entrypoint-dependency-graph.d.ts +12 -0
- package/src/hmr/entrypoint-dependency-graph.js +27 -0
- package/src/hmr/hmr-asset-paths.d.ts +14 -0
- package/src/hmr/hmr-asset-paths.js +22 -0
- package/src/hmr/hmr-entrypoint-output.d.ts +11 -0
- package/src/hmr/hmr-entrypoint-output.js +34 -0
- package/src/hmr/hmr-file-change-prep.d.ts +9 -0
- package/src/hmr/hmr-file-change-prep.js +11 -0
- package/src/hmr/hmr-registered-entrypoints-context.d.ts +7 -0
- package/src/hmr/hmr-registered-entrypoints-context.js +1 -0
- package/src/hmr/hmr-runtime-paths.d.ts +10 -0
- package/src/hmr/hmr-runtime-paths.js +13 -0
- package/src/hmr/hmr-strategy.d.ts +18 -22
- package/src/hmr/hmr-strategy.js +111 -42
- package/src/hmr/strategies/default-hmr-strategy.js +55 -33
- package/src/hmr/strategies/js-hmr-strategy.d.ts +16 -102
- package/src/hmr/strategies/js-hmr-strategy.js +113 -170
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +35 -0
- package/src/html/README.md +15 -0
- package/src/html/html-rewriter.d.ts +77 -0
- package/src/html/html-rewriter.js +590 -0
- package/src/html/html-source-parser.d.ts +59 -0
- package/src/html/html-source-parser.js +203 -0
- package/src/html/html-tokenizer.d.ts +69 -0
- package/src/html/html-tokenizer.js +193 -0
- package/src/html/html-transformer.service.d.ts +74 -0
- package/src/html/html-transformer.service.js +173 -0
- package/src/html-pages/README.md +104 -0
- package/src/html-pages/html-page-classic-script.d.ts +15 -0
- package/src/html-pages/html-page-classic-script.js +25 -0
- package/src/html-pages/html-page-document.d.ts +33 -0
- package/src/html-pages/html-page-document.js +100 -0
- package/src/html-pages/html-page-module-scripts.d.ts +86 -0
- package/src/html-pages/html-page-module-scripts.js +293 -0
- package/src/html-pages/html-page-module.d.ts +32 -0
- package/src/html-pages/html-page-module.js +113 -0
- package/src/html-pages/html-page-renderer.d.ts +69 -0
- package/src/html-pages/html-page-renderer.js +287 -0
- package/src/html-pages/html-page-template.d.ts +128 -0
- package/src/html-pages/html-page-template.js +495 -0
- package/src/html-pages/html-page-warning-state.d.ts +8 -0
- package/src/html-pages/html-page-warning-state.js +6 -0
- package/src/html-pages/html-pages.plugin.d.ts +23 -0
- package/src/html-pages/html-pages.plugin.js +32 -0
- package/src/index.browser.d.ts +4 -1
- package/src/index.browser.js +5 -4
- package/src/index.d.ts +8 -4
- package/src/index.js +9 -21
- package/src/integration.d.ts +25 -0
- package/src/integration.js +23 -0
- package/src/islands/README.md +44 -0
- package/src/islands/island-host.d.ts +43 -0
- package/src/islands/island-host.js +65 -0
- package/src/page-cache/README.md +17 -0
- package/src/page-cache/cache.types.d.ts +1 -0
- package/src/page-cache/cache.types.js +1 -0
- package/src/page-cache/html-page-cache-dependency-index.d.ts +15 -0
- package/src/page-cache/html-page-cache-dependency-index.js +27 -0
- package/src/{services/cache → page-cache}/memory-cache-store.d.ts +3 -3
- package/src/page-cache/memory-cache-store.js +118 -0
- package/src/{services/cache → page-cache}/page-cache-service.d.ts +29 -10
- package/src/page-cache/page-cache-service.js +374 -0
- package/src/{services/cache → page-cache}/page-request-cache-coordinator.service.d.ts +7 -2
- package/src/page-cache/page-request-cache-coordinator.service.js +139 -0
- package/src/plugins/README.md +29 -11
- package/src/plugins/alias-resolver-cache.d.ts +39 -0
- package/src/plugins/alias-resolver-cache.js +62 -0
- package/src/plugins/alias-resolver-plugin.d.ts +3 -2
- package/src/plugins/alias-resolver-plugin.js +34 -50
- package/src/plugins/component-import-discovery.d.ts +28 -0
- package/src/plugins/component-import-discovery.js +244 -0
- package/src/plugins/define-integration.d.ts +24 -0
- package/src/plugins/define-integration.js +20 -0
- package/src/plugins/eco-component-meta-plugin.d.ts +21 -93
- package/src/plugins/eco-component-meta-plugin.js +311 -161
- package/src/plugins/find-integration-for-file.d.ts +16 -0
- package/src/plugins/find-integration-for-file.js +34 -0
- package/src/plugins/foreign-jsx-override-plugin.d.ts +4 -2
- package/src/plugins/foreign-jsx-override-plugin.js +48 -31
- package/src/plugins/integration-plugin.d.ts +109 -104
- package/src/plugins/integration-plugin.js +150 -172
- package/src/plugins/jsx-import-source.utils.d.ts +7 -0
- package/src/plugins/jsx-import-source.utils.js +15 -0
- package/src/plugins/package-specifier.d.ts +8 -0
- package/src/plugins/package-specifier.js +24 -0
- package/src/plugins/processor.d.ts +85 -34
- package/src/plugins/processor.js +160 -126
- package/src/plugins/tsconfig-import-resolver.d.ts +46 -0
- package/src/plugins/tsconfig-import-resolver.js +268 -0
- package/src/processor.d.ts +4 -0
- package/src/processor.js +3 -0
- package/src/route-renderer/GRAPH.md +94 -305
- package/src/route-renderer/README.md +114 -70
- package/src/route-renderer/error-pages/README.md +11 -0
- package/src/route-renderer/error-pages/default-error-pages.d.ts +39 -0
- package/src/route-renderer/error-pages/default-error-pages.js +192 -0
- package/src/route-renderer/error-pages/error-page-renderer.d.ts +51 -0
- package/src/route-renderer/error-pages/error-page-renderer.js +130 -0
- package/src/route-renderer/error-pages/semantic-error-page-exporter.d.ts +22 -0
- package/src/route-renderer/error-pages/semantic-error-page-exporter.js +33 -0
- package/src/route-renderer/explicit-view-render-preparation.d.ts +44 -0
- package/src/route-renderer/explicit-view-render-preparation.js +49 -0
- package/src/route-renderer/orchestration/custom-element-scripts/README.md +15 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.d.ts +8 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.js +24 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.d.ts +78 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.js +164 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.d.ts +17 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.js +34 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.d.ts +15 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.js +65 -0
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.d.ts +114 -0
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +161 -0
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.d.ts +32 -0
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.js +52 -0
- package/src/route-renderer/orchestration/foreign-child/foreign-child-output.utils.d.ts +4 -0
- package/src/route-renderer/orchestration/foreign-child/foreign-child-output.utils.js +27 -0
- package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.d.ts +127 -0
- package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js +319 -0
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.d.ts +18 -0
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.js +33 -0
- package/src/route-renderer/orchestration/foreign-child/render-session.d.ts +27 -0
- package/src/route-renderer/orchestration/foreign-child/render-session.js +9 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +339 -344
- package/src/route-renderer/orchestration/integration-renderer.js +1210 -942
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.d.ts +39 -0
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +94 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.d.ts +15 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +49 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph.d.ts +70 -0
- package/src/route-renderer/orchestration/ownership-graph/component-graph.js +177 -0
- package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.d.ts +26 -0
- package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.js +74 -0
- package/src/route-renderer/orchestration/ownership-graph/page-client-browser-assets.d.ts +28 -0
- package/src/route-renderer/orchestration/ownership-graph/page-client-browser-assets.js +44 -0
- package/src/route-renderer/orchestration/ownership-graph/page-client-plan.d.ts +40 -0
- package/src/route-renderer/orchestration/ownership-graph/page-client-plan.js +175 -0
- 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 +31 -0
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.d.ts +33 -0
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.js +14 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.d.ts +5 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.js +30 -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 +32 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +113 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +492 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +58 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +360 -0
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.d.ts +26 -0
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.js +32 -0
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +5 -0
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +11 -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 +43 -0
- package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.d.ts +26 -0
- package/src/route-renderer/orchestration/route-pipeline/route-html-finalization.service.js +43 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.d.ts +26 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +44 -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 +30 -0
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.d.ts +131 -0
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +350 -0
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.test-fixtures.d.ts +35 -0
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.test-fixtures.js +69 -0
- package/src/route-renderer/orchestration/string-markup-renderer.d.ts +11 -0
- package/src/route-renderer/orchestration/string-markup-renderer.js +10 -0
- package/src/route-renderer/page-loading/component-dependency-collection.d.ts +50 -0
- package/src/route-renderer/page-loading/component-dependency-collection.js +197 -0
- package/src/route-renderer/page-loading/declared-asset-collection.d.ts +24 -0
- package/src/route-renderer/page-loading/declared-asset-collection.js +78 -0
- package/src/route-renderer/page-loading/dependency-resolver.d.ts +41 -6
- package/src/route-renderer/page-loading/dependency-resolver.js +232 -417
- package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +12 -0
- package/src/route-renderer/page-loading/ecopages-virtual-imports.js +100 -0
- package/src/route-renderer/page-loading/file-scoped-dependency-components.d.ts +41 -0
- package/src/route-renderer/page-loading/file-scoped-dependency-components.js +120 -0
- package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +44 -0
- package/src/route-renderer/page-loading/lazy-entry-collection.js +74 -0
- package/src/route-renderer/page-loading/lazy-trigger-planning.d.ts +19 -0
- package/src/route-renderer/page-loading/lazy-trigger-planning.js +51 -0
- package/src/route-renderer/page-loading/module-declaration-aggregation.d.ts +5 -0
- package/src/route-renderer/page-loading/module-declaration-aggregation.js +44 -0
- package/src/route-renderer/page-loading/module-declaration-scripts.d.ts +3 -0
- package/src/route-renderer/page-loading/module-declaration-scripts.js +13 -0
- package/src/route-renderer/page-loading/page-dependency-bundling.d.ts +12 -0
- package/src/route-renderer/page-loading/page-dependency-bundling.js +200 -0
- package/src/route-renderer/page-loading/page-module-loader.d.ts +9 -9
- package/src/route-renderer/page-loading/page-module-loader.js +136 -123
- package/src/route-renderer/page-loading/resolved-page-dependencies.d.ts +11 -0
- package/src/route-renderer/page-loading/resolved-page-dependencies.js +39 -0
- package/src/route-renderer/route-renderer.d.ts +38 -34
- package/src/route-renderer/route-renderer.js +50 -93
- package/src/router/README.md +85 -22
- package/src/router/client/link-intent.d.ts +11 -21
- package/src/router/client/link-intent.js +56 -30
- package/src/router/client/link-intent.test.browser.js +30 -40
- package/src/router/client/link-navigation-policy.d.ts +45 -0
- package/src/router/client/link-navigation-policy.js +102 -0
- package/src/router/client/link-navigation-policy.test.browser.d.ts +1 -0
- package/src/router/client/link-navigation-policy.test.browser.js +142 -0
- package/src/router/client/navigation-commit.d.ts +22 -0
- package/src/router/client/navigation-commit.js +57 -0
- package/src/router/client/navigation-commit.test.browser.d.ts +1 -0
- package/src/router/client/navigation-commit.test.browser.js +116 -0
- package/src/router/client/navigation-coordinator.d.ts +21 -20
- package/src/router/client/navigation-coordinator.js +194 -204
- package/src/router/client/navigation-document.d.ts +37 -0
- package/src/router/client/navigation-document.js +106 -0
- package/src/router/client/navigation-document.test.browser.d.ts +1 -0
- package/src/router/client/navigation-document.test.browser.js +77 -0
- package/src/router/client/navigation-head.d.ts +13 -0
- package/src/router/client/navigation-head.js +238 -0
- package/src/router/client/navigation-head.test.browser.d.ts +1 -0
- package/src/router/client/navigation-head.test.browser.js +101 -0
- package/src/router/client/navigation-lifecycle.d.ts +49 -0
- package/src/router/client/navigation-lifecycle.js +50 -0
- package/src/router/client/navigation-lifecycle.test.browser.d.ts +1 -0
- package/src/router/client/navigation-lifecycle.test.browser.js +97 -0
- package/src/router/client/navigation-pipeline.d.ts +8 -0
- package/src/router/client/navigation-pipeline.js +8 -0
- package/src/router/client/navigation-replay.d.ts +16 -0
- package/src/router/client/navigation-replay.js +17 -0
- package/src/router/client/navigation-view-transition.d.ts +9 -0
- package/src/router/client/navigation-view-transition.js +61 -0
- package/src/router/client/navigation-view-transition.test.browser.d.ts +1 -0
- package/src/router/client/navigation-view-transition.test.browser.js +189 -0
- package/src/router/client/staged-stylesheets.test-fixtures.d.ts +18 -0
- package/src/router/client/staged-stylesheets.test-fixtures.js +31 -0
- package/src/router/server/parse-search-params.d.ts +9 -0
- package/src/router/server/parse-search-params.js +16 -0
- package/src/router/server/route-registry.d.ts +103 -0
- package/src/router/server/route-registry.js +239 -0
- package/src/router/server/segment-path-matcher.d.ts +27 -0
- package/src/router/server/segment-path-matcher.js +149 -0
- package/src/static-site-generator/README.md +41 -0
- package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +36 -0
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +196 -0
- package/src/static-site-generator/sitemap-routes.d.ts +14 -0
- package/src/static-site-generator/sitemap-routes.js +36 -0
- package/src/static-site-generator/sitemap.d.ts +15 -0
- package/src/static-site-generator/sitemap.js +42 -0
- package/src/static-site-generator/static-export-context.d.ts +33 -0
- package/src/static-site-generator/static-export-context.js +1 -0
- package/src/static-site-generator/static-site-generator.d.ts +52 -47
- package/src/static-site-generator/static-site-generator.js +555 -331
- package/src/static-site-generator/static-site-generator.test-utils.d.ts +2 -0
- package/src/static-site-generator/static-site-generator.test-utils.js +41 -0
- package/src/types/README.md +5 -0
- package/src/types/api-response.d.ts +9 -0
- package/src/types/api-response.js +1 -0
- package/src/{services/assets/asset-processing-service/assets.types.d.ts → types/asset-types.d.ts} +36 -4
- package/src/types/asset-types.js +1 -0
- package/src/types/build-types.d.ts +104 -0
- package/src/types/build-types.js +1 -0
- package/src/{services/cache/cache.types.d.ts → types/cache-types.d.ts} +20 -9
- package/src/types/cache-types.js +5 -0
- package/src/types/component-identity.d.ts +6 -0
- package/src/types/component-identity.js +1 -0
- package/src/types/contracts.d.ts +1523 -0
- package/src/types/contracts.js +1 -0
- package/src/types/dev-transform-types.d.ts +15 -0
- package/src/types/dev-transform-types.js +1 -0
- package/src/{eco/eco.types.d.ts → types/eco-api-types.d.ts} +79 -44
- package/src/types/eco-api-types.js +5 -0
- package/src/types/integration-types.d.ts +3 -0
- package/src/types/integration-types.js +1 -0
- package/src/types/public-types.d.ts +3 -1165
- package/src/types/public-types.js +1 -0
- package/src/types/standard-schema-types.d.ts +12 -0
- package/src/types/standard-schema-types.js +1 -0
- package/src/utils/README.md +7 -0
- package/src/utils/additional-watch-paths.d.ts +25 -0
- package/src/utils/additional-watch-paths.js +49 -0
- package/src/utils/app-runtime.d.ts +9 -0
- package/src/utils/app-runtime.js +13 -0
- package/src/utils/content-hash.d.ts +8 -0
- package/src/utils/content-hash.js +16 -0
- package/src/utils/deep-merge.js +39 -26
- package/src/utils/ecopages-route-info.d.ts +22 -0
- package/src/utils/ecopages-route-info.js +20 -0
- package/src/utils/html-entities.d.ts +10 -0
- package/src/utils/html-entities.js +34 -0
- package/src/utils/html-escaping.d.ts +14 -0
- package/src/utils/html-escaping.js +42 -5
- package/src/utils/invariant.js +11 -10
- package/src/utils/locals-utils.d.ts +1 -1
- package/src/utils/locals-utils.js +32 -22
- package/src/utils/parse-cli-args.d.ts +3 -6
- package/src/utils/parse-cli-args.js +55 -60
- package/src/utils/path-containment.d.ts +15 -0
- package/src/utils/path-containment.js +27 -0
- package/src/utils/path-pattern.d.ts +23 -0
- package/src/utils/path-pattern.js +42 -0
- package/src/utils/regex-escaping.d.ts +2 -0
- package/src/utils/regex-escaping.js +4 -0
- package/src/utils/resolve-entry-file.d.ts +72 -0
- package/src/utils/resolve-entry-file.js +74 -0
- package/src/utils/resolve-work-dir.js +23 -27
- package/src/utils/runtime.d.ts +12 -9
- package/src/utils/runtime.js +14 -39
- package/src/utils/server-utils.module.d.ts +13 -2
- package/src/utils/server-utils.module.js +74 -53
- package/src/utils/static-file-extensions.d.ts +12 -0
- package/src/utils/static-file-extensions.js +54 -0
- package/src/validation/README.md +9 -0
- package/src/validation/standard-schema.types.d.ts +1 -0
- package/src/validation/standard-schema.types.js +1 -0
- package/src/validation/validate-request.d.ts +36 -0
- package/src/validation/validate-request.js +56 -0
- package/src/validation/validate-standard-schema.d.ts +7 -0
- package/src/validation/validate-standard-schema.js +14 -0
- package/src/watchers/README.md +15 -0
- package/src/watchers/project-watcher-ignore.d.ts +13 -0
- package/src/watchers/project-watcher-ignore.js +27 -0
- package/src/watchers/project-watcher.d.ts +80 -84
- package/src/watchers/project-watcher.js +495 -264
- package/src/watchers/project-watcher.test-helpers.d.ts +59 -3
- package/src/watchers/project-watcher.test-helpers.js +106 -50
- package/src/watchers/workspace-package-watch-roots.d.ts +9 -0
- package/src/watchers/workspace-package-watch-roots.js +44 -0
- package/CHANGELOG.md +0 -38
- package/src/adapters/abstract/application-adapter.d.ts +0 -194
- package/src/adapters/abstract/application-adapter.js +0 -121
- package/src/adapters/abstract/router-adapter.d.ts +0 -26
- package/src/adapters/abstract/router-adapter.js +0 -5
- package/src/adapters/abstract/server-adapter.d.ts +0 -69
- package/src/adapters/abstract/server-adapter.js +0 -15
- package/src/adapters/bun/client-bridge.d.ts +0 -34
- package/src/adapters/bun/client-bridge.js +0 -48
- package/src/adapters/bun/create-app.d.ts +0 -52
- package/src/adapters/bun/create-app.js +0 -116
- package/src/adapters/bun/hmr-manager.d.ts +0 -143
- package/src/adapters/bun/hmr-manager.js +0 -334
- package/src/adapters/bun/index.d.ts +0 -2
- package/src/adapters/bun/index.js +0 -8
- package/src/adapters/bun/server-adapter.d.ts +0 -155
- package/src/adapters/bun/server-adapter.js +0 -374
- package/src/adapters/bun/server-lifecycle.d.ts +0 -63
- package/src/adapters/bun/server-lifecycle.js +0 -92
- package/src/adapters/index.d.ts +0 -2
- package/src/adapters/index.js +0 -8
- package/src/adapters/node/node-hmr-manager.d.ts +0 -133
- package/src/adapters/node/node-hmr-manager.js +0 -312
- package/src/adapters/node/static-content-server.d.ts +0 -60
- package/src/adapters/node/static-content-server.js +0 -194
- package/src/adapters/shared/api-response.js +0 -96
- package/src/adapters/shared/application-adapter.d.ts +0 -18
- package/src/adapters/shared/application-adapter.js +0 -90
- 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/explicit-static-route-matcher.js +0 -103
- package/src/adapters/shared/file-route-middleware-pipeline.js +0 -99
- package/src/adapters/shared/fs-server-response-factory.d.ts +0 -19
- package/src/adapters/shared/fs-server-response-factory.js +0 -97
- package/src/adapters/shared/fs-server-response-matcher.d.ts +0 -75
- package/src/adapters/shared/fs-server-response-matcher.js +0 -160
- package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +0 -55
- package/src/adapters/shared/hmr-entrypoint-registrar.js +0 -87
- package/src/adapters/shared/hmr-html-response.d.ts +0 -22
- package/src/adapters/shared/hmr-html-response.js +0 -32
- package/src/adapters/shared/render-context.js +0 -72
- package/src/adapters/shared/runtime-bootstrap.d.ts +0 -38
- package/src/adapters/shared/runtime-bootstrap.js +0 -43
- package/src/adapters/shared/server-adapter.d.ts +0 -97
- package/src/adapters/shared/server-adapter.js +0 -390
- package/src/adapters/shared/server-route-handler.js +0 -111
- package/src/adapters/shared/server-static-builder.d.ts +0 -70
- package/src/adapters/shared/server-static-builder.js +0 -100
- package/src/build/build-manifest.d.ts +0 -27
- package/src/build/build-manifest.js +0 -30
- package/src/build/build-types.d.ts +0 -57
- package/src/build/build-types.js +0 -0
- package/src/build/dev-build-coordinator.d.ts +0 -72
- package/src/build/dev-build-coordinator.js +0 -154
- package/src/build/esbuild-build-adapter.d.ts +0 -78
- package/src/build/esbuild-build-adapter.js +0 -505
- package/src/build/runtime-build-executor.d.ts +0 -14
- package/src/build/runtime-build-executor.js +0 -22
- package/src/build/runtime-specifier-alias-plugin.d.ts +0 -15
- package/src/build/runtime-specifier-alias-plugin.js +0 -35
- package/src/build/runtime-specifier-aliases.d.ts +0 -5
- package/src/build/runtime-specifier-aliases.js +0 -95
- package/src/config/config-builder.d.ts +0 -261
- package/src/config/config-builder.js +0 -602
- package/src/dev/sc-server.d.ts +0 -30
- package/src/dev/sc-server.js +0 -111
- package/src/eco/eco.types.js +0 -0
- package/src/eco/eco.utils.d.ts +0 -1
- package/src/eco/eco.utils.js +0 -10
- package/src/eco/lazy-injector-map.d.ts +0 -8
- package/src/eco/lazy-injector-map.js +0 -70
- package/src/hmr/hmr.postcss.test.e2e.js +0 -31
- package/src/hmr/hmr.test.e2e.js +0 -43
- package/src/integrations/ghtml/ghtml-renderer.d.ts +0 -20
- package/src/integrations/ghtml/ghtml-renderer.js +0 -63
- package/src/integrations/ghtml/ghtml.plugin.d.ts +0 -20
- package/src/integrations/ghtml/ghtml.plugin.js +0 -21
- package/src/plugins/runtime-capability.d.ts +0 -9
- package/src/plugins/runtime-capability.js +0 -0
- package/src/plugins/source-transform.d.ts +0 -46
- package/src/plugins/source-transform.js +0 -71
- package/src/route-renderer/orchestration/component-render-context.d.ts +0 -83
- package/src/route-renderer/orchestration/component-render-context.js +0 -147
- package/src/route-renderer/orchestration/queued-boundary-runtime.service.d.ts +0 -93
- package/src/route-renderer/orchestration/queued-boundary-runtime.service.js +0 -155
- package/src/route-renderer/orchestration/render-execution.service.d.ts +0 -43
- package/src/route-renderer/orchestration/render-execution.service.js +0 -106
- package/src/route-renderer/orchestration/render-output.utils.js +0 -65
- package/src/route-renderer/orchestration/render-preparation.service.d.ts +0 -115
- package/src/route-renderer/orchestration/render-preparation.service.js +0 -325
- package/src/route-renderer/orchestration/template-serialization.d.ts +0 -38
- package/src/route-renderer/orchestration/template-serialization.js +0 -45
- package/src/router/server/fs-router-scanner.d.ts +0 -41
- package/src/router/server/fs-router-scanner.js +0 -161
- package/src/router/server/fs-router.d.ts +0 -26
- package/src/router/server/fs-router.js +0 -100
- package/src/services/README.md +0 -29
- package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +0 -120
- package/src/services/assets/asset-processing-service/asset-processing.service.js +0 -331
- package/src/services/assets/asset-processing-service/asset.factory.js +0 -82
- package/src/services/assets/asset-processing-service/assets.types.js +0 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +0 -48
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +0 -41
- package/src/services/assets/asset-processing-service/index.js +0 -5
- package/src/services/assets/asset-processing-service/processor.interface.d.ts +0 -22
- package/src/services/assets/asset-processing-service/processor.interface.js +0 -6
- package/src/services/assets/asset-processing-service/processor.registry.d.ts +0 -8
- package/src/services/assets/asset-processing-service/processor.registry.js +0 -15
- package/src/services/assets/asset-processing-service/processors/base/base-processor.d.ts +0 -24
- package/src/services/assets/asset-processing-service/processors/base/base-processor.js +0 -64
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.d.ts +0 -17
- package/src/services/assets/asset-processing-service/processors/base/base-script-processor.js +0 -72
- package/src/services/assets/asset-processing-service/processors/index.js +0 -5
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.d.ts +0 -5
- package/src/services/assets/asset-processing-service/processors/script/content-script.processor.js +0 -57
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.d.ts +0 -9
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +0 -88
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.d.ts +0 -7
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +0 -75
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +0 -25
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +0 -66
- package/src/services/assets/browser-bundle.service.d.ts +0 -32
- package/src/services/assets/browser-bundle.service.js +0 -33
- package/src/services/cache/cache.types.js +0 -0
- package/src/services/cache/index.d.ts +0 -7
- package/src/services/cache/index.js +0 -7
- package/src/services/cache/memory-cache-store.js +0 -98
- package/src/services/cache/page-cache-service.js +0 -152
- package/src/services/cache/page-request-cache-coordinator.service.js +0 -109
- package/src/services/html/html-rewriter-provider.service.d.ts +0 -37
- package/src/services/html/html-rewriter-provider.service.js +0 -68
- package/src/services/html/html-transformer.service.d.ts +0 -77
- package/src/services/html/html-transformer.service.js +0 -215
- package/src/services/invalidation/development-invalidation.service.d.ts +0 -74
- package/src/services/invalidation/development-invalidation.service.js +0 -190
- package/src/services/module-loading/app-module-loader.service.d.ts +0 -25
- package/src/services/module-loading/app-module-loader.service.js +0 -31
- package/src/services/module-loading/app-server-module-transpiler.service.d.ts +0 -24
- package/src/services/module-loading/app-server-module-transpiler.service.js +0 -109
- package/src/services/module-loading/host-module-loader-registry.d.ts +0 -4
- package/src/services/module-loading/host-module-loader-registry.js +0 -15
- package/src/services/module-loading/module-loading-types.d.ts +0 -2
- package/src/services/module-loading/module-loading-types.js +0 -0
- package/src/services/module-loading/node-bootstrap-plugin.d.ts +0 -22
- package/src/services/module-loading/node-bootstrap-plugin.js +0 -192
- package/src/services/module-loading/page-module-import.service.d.ts +0 -75
- package/src/services/module-loading/page-module-import.service.js +0 -161
- package/src/services/module-loading/server-module-transpiler.service.d.ts +0 -72
- package/src/services/module-loading/server-module-transpiler.service.js +0 -64
- package/src/services/runtime-state/dev-graph.service.d.ts +0 -118
- package/src/services/runtime-state/dev-graph.service.js +0 -162
- package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +0 -41
- package/src/services/runtime-state/entrypoint-dependency-graph.service.js +0 -85
- 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/server-invalidation-state.service.d.ts +0 -26
- package/src/services/runtime-state/server-invalidation-state.service.js +0 -35
- package/src/services/validation/schema-validation-service.d.ts +0 -122
- package/src/services/validation/schema-validation-service.js +0 -101
- package/src/services/validation/standard-schema.types.d.ts +0 -65
- package/src/services/validation/standard-schema.types.js +0 -0
- package/src/types/internal-types.d.ts +0 -231
- package/src/types/internal-types.js +0 -0
- package/src/utils/hash.d.ts +0 -1
- package/src/utils/hash.js +0 -7
- package/src/utils/html.d.ts +0 -1
- package/src/utils/html.js +0 -4
- package/src/utils/path-utils.module.d.ts +0 -5
- package/src/utils/path-utils.module.js +0 -14
- /package/src/{hmr/hmr.postcss.test.e2e.d.ts → adapters/shared/runtime/runtime-host.js} +0 -0
- /package/src/{services/assets → assets}/asset-processing-service/asset.factory.d.ts +0 -0
- /package/src/{hmr/hmr.test.e2e.d.ts → assets/asset-processing-service/assets.types.js} +0 -0
- /package/src/{services/assets → assets}/asset-processing-service/processors/index.d.ts +0 -0
- /package/src/{services/assets → assets}/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { contentHash } from '../utils/content-hash.js';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileSystem } from '@ecopages/file-system';
|
|
4
|
+
const HASH_LENGTH = 16;
|
|
5
|
+
export const HASHED_BROWSER_ASSET_INDEX_FILENAME = '.ecopages-hashed-assets';
|
|
6
|
+
const hashedBrowserAssetPaths = new Set();
|
|
7
|
+
const loadedHashedBrowserAssetDirectories = new Set();
|
|
8
|
+
/**
|
|
9
|
+
* Returns a filesystem-safe hash of the bytes that will be served.
|
|
10
|
+
*/
|
|
11
|
+
export function hashBrowserAssetBytes(bytes) {
|
|
12
|
+
return contentHash(bytes, HASH_LENGTH);
|
|
13
|
+
}
|
|
14
|
+
/** Records a content-addressed output path in process memory and beside the emitted file. */
|
|
15
|
+
export function recordHashedBrowserAsset(filePath) {
|
|
16
|
+
const resolvedPath = path.resolve(filePath);
|
|
17
|
+
const directory = path.dirname(resolvedPath);
|
|
18
|
+
loadHashedBrowserAssetDirectory(directory);
|
|
19
|
+
hashedBrowserAssetPaths.add(resolvedPath);
|
|
20
|
+
if (!fileSystem.exists(resolvedPath))
|
|
21
|
+
return;
|
|
22
|
+
const indexPath = path.join(directory, HASHED_BROWSER_ASSET_INDEX_FILENAME);
|
|
23
|
+
const recordedNames = readHashedBrowserAssetIndex(indexPath);
|
|
24
|
+
const filename = path.basename(resolvedPath);
|
|
25
|
+
if (!recordedNames.includes(filename)) {
|
|
26
|
+
fileSystem.write(indexPath, `${JSON.stringify([...recordedNames, filename].sort())}\n`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Returns whether the build pipeline recorded this path as content-addressed. */
|
|
30
|
+
export function isHashedBrowserAsset(filePath) {
|
|
31
|
+
const resolvedPath = path.resolve(filePath);
|
|
32
|
+
if (path.basename(resolvedPath) === HASHED_BROWSER_ASSET_INDEX_FILENAME)
|
|
33
|
+
return false;
|
|
34
|
+
const directory = path.dirname(resolvedPath);
|
|
35
|
+
loadHashedBrowserAssetDirectory(directory);
|
|
36
|
+
return hashedBrowserAssetPaths.has(resolvedPath);
|
|
37
|
+
}
|
|
38
|
+
export function forgetHashedBrowserAsset(filePath) {
|
|
39
|
+
const resolvedPath = path.resolve(filePath);
|
|
40
|
+
const directory = path.dirname(resolvedPath);
|
|
41
|
+
loadHashedBrowserAssetDirectory(directory);
|
|
42
|
+
hashedBrowserAssetPaths.delete(resolvedPath);
|
|
43
|
+
const indexPath = path.join(directory, HASHED_BROWSER_ASSET_INDEX_FILENAME);
|
|
44
|
+
if (!fileSystem.exists(indexPath))
|
|
45
|
+
return;
|
|
46
|
+
const filename = path.basename(resolvedPath);
|
|
47
|
+
const recordedNames = readHashedBrowserAssetIndex(indexPath).filter((name) => name !== filename);
|
|
48
|
+
if (recordedNames.length === 0) {
|
|
49
|
+
fileSystem.remove(indexPath);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
fileSystem.write(indexPath, `${JSON.stringify(recordedNames)}\n`);
|
|
53
|
+
}
|
|
54
|
+
function readHashedBrowserAssetIndex(indexPath) {
|
|
55
|
+
if (!fileSystem.exists(indexPath))
|
|
56
|
+
return [];
|
|
57
|
+
try {
|
|
58
|
+
const parsed = JSON.parse(fileSystem.readFileSync(indexPath));
|
|
59
|
+
return Array.isArray(parsed) && parsed.every((value) => typeof value === 'string')
|
|
60
|
+
? parsed
|
|
61
|
+
: [];
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function loadHashedBrowserAssetDirectory(directory) {
|
|
68
|
+
if (loadedHashedBrowserAssetDirectories.has(directory))
|
|
69
|
+
return;
|
|
70
|
+
const indexPath = path.join(directory, HASHED_BROWSER_ASSET_INDEX_FILENAME);
|
|
71
|
+
for (const filename of readHashedBrowserAssetIndex(indexPath)) {
|
|
72
|
+
hashedBrowserAssetPaths.add(path.join(directory, filename));
|
|
73
|
+
}
|
|
74
|
+
loadedHashedBrowserAssetDirectories.add(directory);
|
|
75
|
+
}
|
|
76
|
+
function normalizeExtension(extension) {
|
|
77
|
+
return extension.startsWith('.') ? extension : `.${extension}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Writes a production browser asset under a name derived from a hash of its
|
|
81
|
+
* final bytes, and returns that path.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* The same bytes always produce the same name, so an unchanged stylesheet keeps
|
|
85
|
+
* its URL and a quality or source change gets a new URL. Development keeps
|
|
86
|
+
* source-relative names so CSS HMR can refresh the same href. Vendor runtimes
|
|
87
|
+
* keep their own stable names and must not go through this helper.
|
|
88
|
+
*/
|
|
89
|
+
export function writeHashedBrowserAsset(options) {
|
|
90
|
+
const buffer = typeof options.bytes === 'string' ? Buffer.from(options.bytes) : options.bytes;
|
|
91
|
+
const filename = `${hashBrowserAssetBytes(buffer)}${normalizeExtension(options.extension)}`;
|
|
92
|
+
const filepath = path.join(options.directory, filename);
|
|
93
|
+
fileSystem.ensureDir(options.directory);
|
|
94
|
+
if (!fileSystem.exists(filepath)) {
|
|
95
|
+
fileSystem.write(filepath, buffer);
|
|
96
|
+
}
|
|
97
|
+
recordHashedBrowserAsset(filepath);
|
|
98
|
+
return filepath;
|
|
99
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function buildProcessedAssetDedupeKey(asset) {
|
|
2
|
+
return [
|
|
3
|
+
asset.kind,
|
|
4
|
+
asset.position ?? '',
|
|
5
|
+
asset.srcUrl ?? '',
|
|
6
|
+
asset.filepath ?? '',
|
|
7
|
+
asset.content ?? '',
|
|
8
|
+
asset.inline ? 'inline' : 'external',
|
|
9
|
+
asset.excludeFromHtml ? 'excluded' : 'included',
|
|
10
|
+
asset.packageRole ?? '',
|
|
11
|
+
JSON.stringify(asset.attributes ?? {}),
|
|
12
|
+
JSON.stringify(asset.bundledSourceFilepaths ?? []),
|
|
13
|
+
].join('|');
|
|
14
|
+
}
|
|
15
|
+
export function dedupeProcessedAssets(assets) {
|
|
16
|
+
const unique = new Map();
|
|
17
|
+
for (const asset of assets) {
|
|
18
|
+
const key = buildProcessedAssetDedupeKey(asset);
|
|
19
|
+
if (!unique.has(key)) {
|
|
20
|
+
unique.set(key, asset);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return [...unique.values()];
|
|
24
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Reports whether the current browser bundle was built in development mode. */
|
|
2
|
+
export declare function isDevelopmentRuntime(): boolean;
|
|
3
|
+
/** Reports whether the current browser bundle was built in production mode. */
|
|
4
|
+
export declare function isProductionRuntime(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function getBrowserRuntimeMode() {
|
|
2
|
+
return import.meta.env.NODE_ENV ?? import.meta.env.MODE;
|
|
3
|
+
}
|
|
4
|
+
/** Reports whether the current browser bundle was built in development mode. */
|
|
5
|
+
export function isDevelopmentRuntime() {
|
|
6
|
+
return getBrowserRuntimeMode() === 'development';
|
|
7
|
+
}
|
|
8
|
+
/** Reports whether the current browser bundle was built in production mode. */
|
|
9
|
+
export function isProductionRuntime() {
|
|
10
|
+
return getBrowserRuntimeMode() === 'production';
|
|
11
|
+
}
|
package/src/build/README.md
CHANGED
|
@@ -1,107 +1,298 @@
|
|
|
1
1
|
# Build Layer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Layer:** Build.
|
|
4
|
+
|
|
5
|
+
The build layer is the bundler contract for Ecopages. Rolldown is the bundled adapter.
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
- [Mental Model](#mental-model)
|
|
10
|
+
- [Files](#files)
|
|
11
|
+
- [Default Flow](#default-flow)
|
|
12
|
+
- [App build manifest](#app-build-manifest)
|
|
13
|
+
- [Plugin Authoring](#plugin-authoring)
|
|
14
|
+
- [Build diagnostics](#build-diagnostics)
|
|
15
|
+
- [BuildOptions Caveats](#buildoptions-caveats)
|
|
16
|
+
- [Dev / watch path](#dev--watch-path)
|
|
17
|
+
- [Metrics](#metrics)
|
|
18
|
+
- [Production builds](#production-builds)
|
|
19
|
+
- [Server bundle deploy layout](#server-bundle-deploy-layout)
|
|
20
|
+
- [Unified pages graph](#unified-pages-graph)
|
|
21
|
+
- [JSX Ownership Plugins](#jsx-ownership-plugins)
|
|
22
|
+
- [Rolldown operator notes](#rolldown-operator-notes)
|
|
23
|
+
- [Testing Strategy](#testing-strategy)
|
|
24
|
+
|
|
25
|
+
## Mental Model
|
|
26
|
+
|
|
27
|
+
Three concentric shapes, plus one build queue and request policy:
|
|
28
|
+
|
|
29
|
+
| Shape | Lives in | Purpose |
|
|
30
|
+
| --------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `BuildAdapter` | `build-adapter.ts` | Low-level backend. `RolldownBuildAdapter` is the bundled implementation. |
|
|
32
|
+
| `resolveBuildParallelism()` | `build-parallelism.ts` | One CPU-based concurrency limit shared by queued builds, static export, and the startup trace. |
|
|
33
|
+
| `BuildQueue` | `runtime/build-queue.ts` | The one queue every build of an app goes through: lane concurrency limits, one build per identical in-flight request, request-scope reuse. |
|
|
34
|
+
| `BuildExecutor` | `contracts/build-contracts.ts` | Narrower runtime facade. Only `build` is exposed. `BuildQueue` implements it, on the `build` lane. |
|
|
35
|
+
| `build-request-policy.ts` | `runtime/build-request-policy.ts` | Assembles complete `BuildOptions` before scheduling. Server and browser: plugins, then core's own `transform` plugins, plus JSX ownership. |
|
|
36
|
+
| `build-request-identity.ts` | `runtime/build-request-identity.ts` | Canonical request identity for in-flight and request-scope dedupe: every `BuildOptions` field except `plugins`, plus plugin names and `cacheKey`s. |
|
|
37
|
+
|
|
38
|
+
Plus one translation bridge:
|
|
39
|
+
|
|
40
|
+
- `rolldown/rolldown-plugin-bridge.ts` — converts the runtime-agnostic `EcoBuildPlugin[]` array (the contract integrations and processors register) into one Rolldown plugin. Its resolve and load registrations are checked in `EcoBuildPlugin[]` order and the first non-null result wins, so array position sets priority.
|
|
41
|
+
|
|
42
|
+
Each finalized `EcoPagesAppConfig` owns one `AppRuntime` with its build adapter, manifest, input index, and queue. Build services require that runtime; a service given an unfinalized config fails with `Missing app runtime` instead of inventing fallback state.
|
|
4
43
|
|
|
5
44
|
## Files
|
|
6
45
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
46
|
+
```
|
|
47
|
+
build/
|
|
48
|
+
build-adapter.ts adapter factories and runtime plugin setup re-exports
|
|
49
|
+
build-parallelism.ts shared build and static-export concurrency limit
|
|
50
|
+
server/ app-scoped source loading and route-module caches
|
|
51
|
+
server-module.ts builds an independent server module through the app request policy
|
|
52
|
+
app-build-manifest-runtime.ts contributor collection at startup
|
|
53
|
+
contracts/ EcoBuildPlugin, BuildOptions, AppBuildManifest
|
|
54
|
+
runtime/ build queue, request policy/identity
|
|
55
|
+
server-bundle-publication.ts staged server/config artifact publication
|
|
56
|
+
rolldown/ bundler adapter, plugin bridge, package externalization
|
|
57
|
+
cache/ fingerprints, build-input reverse index, leftover-manifest cleanup, unified pages graph
|
|
58
|
+
browser/ client runtime rewrites, JSX ownership, Lit worker guard
|
|
59
|
+
```
|
|
12
60
|
|
|
13
|
-
|
|
61
|
+
- `contracts/build-manifest.ts` + `app-build-manifest-runtime.ts`: the `AppBuildManifest` sealed once, with its plugins selected by environment, and contributor validation.
|
|
62
|
+
- `build-adapter.ts`: types, factories, and runtime plugin setup helpers.
|
|
63
|
+
- `runtime/build-queue.ts`: the `BuildQueue` and its installation on `AppRuntime.buildQueue`.
|
|
64
|
+
- `runtime/build-request-policy.ts`: server/browser request constructors and plugin collision rules.
|
|
65
|
+
- `runtime/build-request-identity.ts` / `cache/cache-keys.ts`: canonical request identity and shared cache fingerprints.
|
|
66
|
+
- `server/README.md`: app-scoped module imports, route-module caches, dependency tracking, and development invalidation.
|
|
67
|
+
- `contracts/build-types.ts`: the `EcoBuildPlugin` contract used by integrations and processors. `onLoad` receives the loaded `path` and `namespace`, and `loader` is one of `js`, `jsx`, `ts`, `tsx` or `object`.
|
|
68
|
+
- `cache/build-input-dependency-index.ts`: one reverse index from recorded filesystem inputs to Page Browser Graphs, HTML cache entries, browser entrypoints, and server route modules. Plugin loads and module closures travel on each `BuildResult`; cache owners bind those inputs to the result they retain. Processor watch roots also feed the index. The Project Watcher subscribes to that set plus `additionalWatchPaths`. The Rolldown adapter captures the active index before handing hooks to Rolldown, then passes an explicit per-build recorder through the bridge because hook callbacks do not inherit the caller's AsyncLocalStorage context.
|
|
69
|
+
- `contracts.ts`: the stable, dependency-light build contracts. Import `@ecopages/core/build/contracts` when a browser graph needs contract helpers such as the `.server` naming predicate; the broader `@ecopages/core/build` entry also exposes Node-only build tools.
|
|
70
|
+
- `rolldown/rolldown-build-adapter.ts`: the production `BuildAdapter`. Wraps the bundler and exposes a normalized `BuildResult`. With `externalPackages`, compiled packages the app declares stay bare imports, so Integration renderers and server bundles share one instance (one React). Source code is bundled: the app, workspace packages and TypeScript or JSX packages, including Core when it resolves to its TypeScript source. Every other compiled package installed in `node_modules` stays external as a `./` or `../` path from the output directory to the installed file, whichever source package imports it, because a compiled package may find files relative to itself at runtime (a native binding such as `sharp`, a platform package, a sibling file loaded through `createRequire(import.meta.url)`), which fails once it is bundled into another folder. A Rolldown `resolveId` hook resolves these packages through Rolldown with the `node` and `import` conditions and writes the path; a build whose chunk lands in a subdirectory of the output directory and imports such a path fails. The exceptions are the runtime packages that need CommonJS named-export interop (`ws`), which are bundled. Isolated package-manager installs do not expose undeclared packages as bare specifiers to the app, so a path is used instead. Server output therefore needs no app-level framework dependencies and its code holds no absolute paths of the build machine: `dist` keeps working after it moves together with `node_modules`. Named output hashes cover the bytes that are written; the adapter does not rewrite emitted files after `bundle.write()`.
|
|
71
|
+
- `rolldown/rolldown-plugin-bridge.ts`: `EcoBuildPlugin[]` → bundler-plugin translation.
|
|
72
|
+
- `server-bundle-deploy-manifest.ts`: the deploy manifest (`<distDir>/.server/manifest.json`) written beside the server entry, and the lookups that read it: `resolveProductionDistDir` selects the build output `ecopages start` runs (`--dist-dir`, else the only directory, dot-prefixed ones included, one level below the app root that holds a manifest; none or several fail, and nested or symlinked outputs need `--dist-dir`), then the production server entry and config identity lookups take that directory.
|
|
73
|
+
- `server-bundle-publication.ts`: stages the server entry, emitted config, and deploy manifest together, then publishes the complete directory with rollback.
|
|
74
|
+
- `rolldown/entry-module-closures.ts`: records each entry's static and dynamic source module closure in `generateBundle`, including inlined and tree-shaken imports.
|
|
75
|
+
- `build-graph.ts`: shared entry path and output lookup (caller path, real path, and named grouped keys), emitted chunk reachability for in-process cache artifact checks, and dependency input collection. Browser build fingerprints can include package inputs under `node_modules`; local external imports remain leaves, including missing generated server modules.
|
|
76
|
+
- `server-module.ts`: builds one server entry through the app's server request policy and returns its emitted path. The content processor owns collection-specific build identity and caching.
|
|
77
|
+
- `*.test.ts`: regression coverage colocated with each module.
|
|
14
78
|
|
|
15
|
-
|
|
79
|
+
## Default Flow
|
|
16
80
|
|
|
17
|
-
`
|
|
81
|
+
`finalizeEcoPagesConfig()` creates one app-owned adapter, manifest, and build queue on `AppRuntime`. When a server adapter initializes, it calls `installBuildQueue(appConfig)` to install a fresh queue on that runtime.
|
|
18
82
|
|
|
19
|
-
|
|
20
|
-
- It answers only how a given app instance should execute builds right now.
|
|
21
|
-
- the Bun-native adapter satisfies this contract directly in plain flows.
|
|
22
|
-
- `DevBuildCoordinator` also satisfies this contract by wrapping the temporary Bun-native esbuild adapter with development-only serialization and recovery policy.
|
|
83
|
+
## App build manifest
|
|
23
84
|
|
|
24
|
-
`
|
|
85
|
+
`AppBuildManifest` stores a `server` and a `browser` plugin list, already selected by environment, and a separate `browserRuntimeManifest` on `AppRuntime.buildManifest`. Integrations and Processors both expose `plugins(app)`. Each build plugin declares `environments: ['server']`, `['browser']`, or both; omitted environments apply to both. Config loaders are registered with them. The browser list holds the plugins that also apply to the server first, then the browser runtime plugin, then the browser-only plugins; readers take a list as it is.
|
|
25
86
|
|
|
26
|
-
|
|
27
|
-
- translate Ecopages `BuildOptions` into esbuild options
|
|
28
|
-
- bridge Ecopages build plugins into esbuild hooks
|
|
29
|
-
- normalize build output, logs, and dependency graph metadata
|
|
30
|
-
- detect the subset of runtime faults that mean the esbuild worker protocol is corrupted
|
|
87
|
+
Config finalization rejects duplicate plugin names within an environment and identifies both contributors. The same name can be registered once for server and once for browser. Browser runtime declarations remain data from an Integration's `browserRuntimeManifest`, from which core synthesizes import rewrites.
|
|
31
88
|
|
|
32
|
-
|
|
89
|
+
**Sealing flow**
|
|
33
90
|
|
|
34
|
-
`
|
|
91
|
+
1. `sealAppBuildManifest(config)` registers the config loaders, then reads `plugins(app)` of each processor and integration once. It is synchronous and calls no other Processor method.
|
|
92
|
+
2. `createAppBuildManifest(registrations, browserRuntimeManifest)` validates every registration once and stores `{ server, browser, browserRuntimeManifest }`.
|
|
93
|
+
3. `createServerBuildRequest` / `createBrowserBuildRequest` order the request's plugins with `resolveBuildPluginOrder` (`runtime/build-request-policy.ts`): caller plugins that apply to the environment, then the app plugins (the alias resolver, the manifest list, JSX ownership), then core's own `transform` plugins: component identity attribution and, on server requests, the `import.meta` rewrite. Rolldown asks plugins in that order and the first result of a resolve or load hook wins, so the position is the priority.
|
|
35
94
|
|
|
36
|
-
|
|
37
|
-
- HMR entrypoint builds
|
|
38
|
-
- script and asset processors
|
|
39
|
-
- React integration build paths
|
|
95
|
+
**Rule of thumb**
|
|
40
96
|
|
|
41
|
-
|
|
97
|
+
- Shared transforms (MDX loaders, virtual modules, route-module hooks) → `plugins`, with both environments.
|
|
98
|
+
- Client-bundle-only work (vendor aliasing, async production CSS) → `plugins`, with `environments: ['browser']`.
|
|
99
|
+
- Vendor specifier → public URL rewrites → `browserRuntimeManifest` (not a plugin list).
|
|
42
100
|
|
|
43
|
-
|
|
44
|
-
- recycling warm Node-target esbuild sessions between builds
|
|
45
|
-
- recovery from known esbuild worker protocol faults
|
|
101
|
+
`createAppRuntime(config)` calls `sealAppBuildManifest(config)` once and stores the manifest on `AppRuntime.buildManifest`.
|
|
46
102
|
|
|
47
|
-
|
|
103
|
+
```
|
|
104
|
+
Caller intent
|
|
105
|
+
→ createServerBuildRequest / createBrowserBuildRequest (plugins assembled once, with core's own transforms last)
|
|
106
|
+
→ BuildQueue.build(options, lane) (lane: build | nested | hmr)
|
|
107
|
+
→ RolldownBuildAdapter
|
|
108
|
+
→ RolldownBuildAdapter resolves Node and browser runtime specifiers during the build
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The queue uses one-shot Rolldown in both dev and production. A lane runs at most its limit of builds at once and starts the rest in arrival order: `build` serves ordinary server and browser builds (all cores but one), `hmr` serves the development server's browser rebuilds (at most three), and `nested` serves a build that a running build waits for, such as the collection bundle a content plugin requests from `onResolve`. A running build keeps its lane's slot, so a child in the same lane could wait for a slot its parent holds; `nested` builds never wait on each other. A request identical to a queued or running one, by `createBuildRequestIdentity`, shares that build whichever lane it asks for. Inside `withRequestScope`, which wraps each request the server handles, a finished build is also shared with later identical requests of the same scope. A build that rejects is not kept.
|
|
112
|
+
|
|
113
|
+
Runtime code calls `requireBuildQueue(appConfig).build(options, lane)` with a complete `BuildOptions` object from the request-policy helpers. The queue is scheduling-only: it does **not** inject app plugins.
|
|
114
|
+
|
|
115
|
+
The exported `defaultBuildAdapter` is a non-app-aware escape hatch. Runtime code uses `requireAppRuntime(appConfig).buildAdapter`, `requireBuildQueue()`, `createServerBuildRequest()` and `createBrowserBuildRequest()`.
|
|
116
|
+
|
|
117
|
+
Every `BuildOptions` request requires `environment: 'server' | 'browser'`. Environment selects the platform, default target/format, and plugin participation. Browser requests also define `import.meta.env.NODE_ENV` from the Ecopages process mode so browser runtime helpers receive the same mode. An explicit numeric `target` changes language transpilation without changing the environment. `resolveBuildEnvironmentOptions()` holds those defaults, one table per environment; a request names only what differs, as the server entry and the emitted config do with `reportPackagesOutsideRoot`. The lane (`build` | `hmr`) selects scheduling only. `BrowserBundleService` takes an explicit lane; regular browser bundles use `build`, and development HMR rebuilds use `hmr`. Every request retains browser defaults on either lane.
|
|
118
|
+
|
|
119
|
+
Migration: move Integration `browserBuildPlugins` and Processor `buildPlugins` into `plugins` with `environments: ['browser']`. Keep server-only hooks in `plugins` with `environments: ['server']`. Replace the old transpile profile arguments with `'browser'` or `'server'`.
|
|
120
|
+
|
|
121
|
+
## Plugin Authoring
|
|
122
|
+
|
|
123
|
+
`EcoBuildPlugin` is the runtime-agnostic contract integrations and processors register. The shape:
|
|
124
|
+
|
|
125
|
+
- `name: string`
|
|
126
|
+
- `environments?: ('server' | 'browser')[]` (omitted means both)
|
|
127
|
+
- `setup(build: EcoBuildPluginBuilder): void | Promise<void>`
|
|
128
|
+
- `cacheKey?: string` — set by a factory that captures an option which changes its output: the `import.meta` transform sets its runtime directory, the alias resolver its project root and tsconfig path prefixes, the browser runtime plugin its manifest entries and resolve options, the foreign JSX override its import source and extensions, and the MDX loader its compiler options (plugin functions by name). A build request is identified by every `BuildOptions` field except `plugins`, plus each plugin's name, environments and `cacheKey` in order, so two plugins of one name from different options are separate builds only through `cacheKey`. The source of `setup` is not hashed.
|
|
129
|
+
- `bundleGroupKey?: string` — lets entry-specific plugin instances with the same name, key and position relative to other plugins join one app-wide browser build. Every instance is retained so it can contribute its own entry configuration; an entry without that plugin can join too. Use `cacheKey` as well when captured options change the build output.
|
|
130
|
+
|
|
131
|
+
`EcoBuildPluginBuilder` exposes four hooks and build context:
|
|
132
|
+
|
|
133
|
+
- `entrypoints?: Readonly<Record<string, string>>` — the named entry files for the active build. Every plugin builder created for that build receives the same map, so plugins that coordinate work across entries can share build-scoped state. It is absent when the adapter cannot provide entrypoints.
|
|
134
|
+
|
|
135
|
+
- `onResolve({ filter, namespace? }, callback)` — the bundler's `resolveId` mapped to the shared plugin shape.
|
|
136
|
+
- `onLoad({ filter, namespace? }, callback)` — the bundler's `load` mapped the same way. The loaded `path` is recorded as a build input automatically. A `loader` of `js`, `jsx`, `ts` or `tsx` sets the module type, `object` builds a module from `exports`, and without a loader the type follows the file extension. Rewritten contents can return `map` to preserve their original locations.
|
|
137
|
+
- With a `namespace`, a filter matches only ids that start with `<namespace>:`, and is tested against the path after it.
|
|
138
|
+
- `transform({ filter }, callback)` — the bundler's `transform` hook, for source rewrites that must run after `load` and can return a source map. The bridge composes maps from chained transforms in registration order. A rewrite that changes code without a map clears earlier mappings and returns `{ mappings: '' }`, so debug locations do not point at stale source positions; `map: null` declares that the transform does not move code and preserves an incoming Rolldown map.
|
|
139
|
+
|
|
140
|
+
Core's own transforms use MagicString to keep unchanged source locations through JSX pragma, component identity, and `import.meta` edits. `BuildOptions.sourcemap` accepts `none`, `inline`, `external`, `linked`, or `hidden`: `linked` writes a map and a `sourceMappingURL`, `external` and `hidden` write a map without a link, `inline` embeds it, and `none` disables it.
|
|
141
|
+
|
|
142
|
+
- `module(specifier, callback)` — declares a virtual module by name, with bundler-side namespace encoding.
|
|
143
|
+
|
|
144
|
+
App-manifest plugins keep canonical registration order and cannot be silently replaced by caller plugins. Use `excludeAppBuildPlugins` on browser requests to omit app-owned plugins that the request replaces; the environment cannot express that. A core transform whose name is the name of a plugin in the same request throws instead of being dropped. A contributed plugin that registers a `transform` runs before the core transforms, in manifest order: loaders, processors, then integrations.
|
|
145
|
+
|
|
146
|
+
The browser runtime plugin maps each manifest specifier to its public URL in `onResolve` only, for every form a bundler resolves (static import, re-export, side-effect import, `import()`), and marks it external. It does not read or rewrite source. Package subpaths that the manifest does not list are left alone. Two consequences of resolving instead of rewriting: a browser request drops a manifest specifier from its `external` list (Rolldown checks `external` before any plugin, so it would otherwise stay a bare import and skip the public URL), and a tsconfig `paths` alias with the same name as a manifest specifier wins over the public URL, because the alias resolver runs first.
|
|
147
|
+
|
|
148
|
+
## Build diagnostics
|
|
149
|
+
|
|
150
|
+
`BuildResult` is a `BuildSuccess` or a `BuildFailure`, told apart by `success`. A `BuildFailure` has only `logs`, the errors of the build. A `BuildSuccess` always has `outputs`, `warnings`, `loadedInputs`, `loadedInputsByModule`, `dependencyGraph`, `entryOutputs` and `outputGraph`; `assertBuildSucceeded` narrows a result to it. `loadedInputs` lists the absolute filesystem paths recorded by plugin load hooks for that build; `loadedInputsByModule` retains those paths under the module load that recorded them. `dependencyGraph.entrypoints` carries each entry's source-module closure. Cache owners combine the relevant entry closure with only the plugin inputs recorded by modules in that closure, so another entry's source module can still be retained when a plugin explicitly reads it. Both logs and warnings are `BuildLog`s: `message` plus, when Rolldown or the plugin provides them, `code`, `plugin`, `hook`, `id`, `loc`, `frame` and `stack`. Other fields of a thrown error, such as PostCSS's `source`, are not copied. Terminal colour codes are stripped from `message` and `frame`.
|
|
151
|
+
|
|
152
|
+
- Each `BuildOutput` records whether Rolldown gave it a content-addressed name (`contentHashed`: assets, non-entry chunks, and entries named with `[hash]`). `BrowserBundleService` records those paths beside the output files (`.ecopages-hashed-assets`) so runtime file serving and the Node preview apply `immutable` from the build's record instead of a filename guess. `writeToDisk: false` calls Rolldown `generate()` and returns the output content in memory; the dev transform vendor registry uses it to keep vendor bundles process-local.
|
|
153
|
+
|
|
154
|
+
- An unattributed Rolldown `BundleError` becomes one log per underlying error; any other error, including an `AggregateError`, becomes one log (`toBuildLogs` in `rolldown/rolldown-adapter-helpers.ts`).
|
|
155
|
+
- `EcoBuildPlugin` callbacks run inside the single Rolldown plugin the bridge creates, and Rolldown overwrites `plugin` on a thrown error with that Rolldown plugin's name. The bridge therefore catches errors from `setup`, `onResolve`, `onLoad`, `module()` and `transform` callbacks and throws a new error that keeps the `EcoBuildPlugin` name, the thrown value as `cause`, its message, stack, `loc` and `frame`, and its `id` or else the module (the loaded or transformed file, or the importer for a resolve). The thrown value is never changed, so a plugin can share or freeze it. The log conversion restores `plugin` to the `EcoBuildPlugin` name.
|
|
156
|
+
- Warnings are collected through Rolldown's `onLog` input option and still printed by Rolldown's default handler. Rolldown reports them only once a build completes, so a failed build has none.
|
|
157
|
+
- `formatBuildLog()` (`build-log.ts`) is the one text form of a log, `[plugin] file:line:column: message` followed by the frame and stack frames. `assertBuildSucceeded()` throws an error built from it, and `buildOrThrow(appConfig, options, failure, lane)` (`runtime/build-queue.ts`) queues a build and does the same, so no caller joins `log.message` or formats the logs itself.
|
|
158
|
+
|
|
159
|
+
## BuildOptions Caveats
|
|
48
160
|
|
|
49
|
-
|
|
161
|
+
Core-owned browser builds reject Node builtins during resolution and imports matching the `.server` naming convention (including extensionless `./db.server`) by the resolved module, so an alias such as a `package.json` `imports` entry or a tsconfig path to `db.server.ts` fails like a relative import. Query and fragment suffixes do not change the naming classification. The error names the resolved module and its importer. This applies to browser scripts from every Integration, including Lit and ecopages-jsx, and to static imports, re-exports, side-effect imports, and dynamic imports that reach resolution. Server builds allow `.server` imports.
|
|
50
162
|
|
|
51
|
-
|
|
163
|
+
An Integration can prune server-only imports before resolution. React uses the shared naming predicate while removing server-only Page options, so a middleware-only `.server` import does not fail the browser build. No `server-only` package marker is interpreted by this guard.
|
|
52
164
|
|
|
53
|
-
|
|
165
|
+
`BuildOptions` is modeled on the bundler's options shape. Most fields map cleanly. The exception:
|
|
54
166
|
|
|
55
|
-
|
|
167
|
+
- `splitting` — when `false` with a single entrypoint, maps to Rolldown `codeSplitting: false` so dynamic imports stay in one file. Multi-entrypoint builds ignore `splitting: false` because Rolldown cannot inline across multiple inputs.
|
|
56
168
|
|
|
57
|
-
|
|
169
|
+
## Dev / watch path
|
|
58
170
|
|
|
59
|
-
|
|
171
|
+
`installBuildQueue` installs the app's `BuildQueue`. The development server's `hmr-entrypoint` and `hmr-runtime` rebuilds run on the `hmr` lane (limit three). A build that waits on another running build uses the `nested` lane; all other builds use the `build` lane.
|
|
60
172
|
|
|
61
|
-
|
|
173
|
+
`ProjectWatcher` deduplicates watch roots, ignores `.eco/` and `dist/`, and coalesces duplicate chokidar events within 150ms.
|
|
62
174
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
175
|
+
## Metrics
|
|
176
|
+
|
|
177
|
+
Set `ECOPAGES_ROLLDOWN_BUILD_METRICS=1` to log Rolldown invocation counts during dev and production builds. Compare kitchen-sink dev navigation and `static-build-bench` before/after runtime changes.
|
|
178
|
+
|
|
179
|
+
## Production builds
|
|
180
|
+
|
|
181
|
+
Every new process compiles from source. Route-module transpile, the unified pages graph, and static HTML reuse stay in memory for the current process. They are keyed by a hash of the config module and the project files it imports, and by hashes of every local module each entry loads, including modules in shared chunks and in chunks loaded through `import()`. Editing any of them rebuilds in this process. A later `ecopages build` does not read `.build-cache.json` files from an earlier run.
|
|
182
|
+
|
|
183
|
+
The adapter records source closures from Rolldown's module graph and all emitted chunk edges separately. `BuildResult.entryOutputs` is keyed by the path or grouped name the caller passed, plus the bundler's facade path when that spelling differs, so a symlink root or Windows drive casing still finds the chunk. Consumers look entries up through `getBuildEntryOutput` rather than by filename prefix. `outputGraph` supplies static and dynamic output reachability without parsing emitted JavaScript.
|
|
184
|
+
|
|
185
|
+
`requireBuildQueue(appConfig)` queues server-entry bundling on the `build` lane. Every process bundles the server entry from source.
|
|
186
|
+
|
|
187
|
+
Static production export collects every renderer's grouped Page Browser Graph plan, each route's island and lazy client entries, and the HTML Page shell module scripts, then sends compatible browser entries through app-wide `BrowserBundleService` build groups. Entries with matching `bundleOptions` share a group across Integrations and HTML shell scripts and can share chunks when splitting is enabled; entries with different options use separate build groups so an entry's external modules, defines, plugins, plugin exclusions, minification, and splitting settings do not affect unrelated entries. The resulting entry assets are attached to their routes before export rendering; development and non-static runtime requests keep the regular grouped asset path.
|
|
188
|
+
|
|
189
|
+
The deploy manifest (`dist/.server/manifest.json`) names the server entry and the emitted config relative to `dist/.server/`, and the source config relative to the project root, so it holds no absolute path and the bundle can move. It records SHA-256 hashes of the source and emitted config whatever runtime ran the build, because `ecopages start` checks them from the Node CLI. The build writes it under the app's `distDir`; `resolveProductionServerEntry()`, `assertProductionConfigIdentity()` and `resolveEmittedEcoConfigPath()` take that `distDir` as a required argument, and a server entry without a manifest counts as no bundle.
|
|
190
|
+
|
|
191
|
+
The server entry and emitted config are built in a sibling staging directory; the deploy manifest joins that generation before the directory is published. A failed build therefore leaves the previous server generation intact.
|
|
192
|
+
|
|
193
|
+
The route-module registry (`route-module-build-cache-registry.ts`) shares one `RouteModuleBuildCache` per `(app, outdir)` pair on `AppRuntime.routeModuleBuildCaches`. Compiled chunks go to `.eco/.server-modules`.
|
|
194
|
+
|
|
195
|
+
## Server bundle deploy layout
|
|
196
|
+
|
|
197
|
+
An app with API or WebSocket handlers builds a server bundle into `dist/.server/` (`app.mjs`, its chunks, `eco.config.mjs` and `manifest.json`). The bundle imports the compiled packages the app declares as bare specifiers and every other compiled package, such as the dependencies of bundled Core and of workspace processors and integrations, as paths relative to `dist/.server/`. Every server build (the server entry, the emitted config, route modules in `.eco/.server-modules/`, the unified pages graph and collections) rewrites `import.meta.url`, `import.meta.dirname` and `import.meta.filename` of bundled `.ts`, `.tsx`, `.js` and `.jsx` modules to paths relative to the output that point at their source files, so bundled Core reads its own `package.json` and a page that globs `import.meta.dirname` scans `src/pages`. Bundled `.mjs`, `.cjs`, `.mts` and `.cts` modules are not rewritten in this release, because the `import.meta` transform only runs on those four extensions, and `import.meta.resolve()` is not rewritten anywhere and resolves from the output folder. The bundle holds no absolute paths of the build machine, so it runs from any root as long as these entries of the app folder keep their relative positions:
|
|
198
|
+
|
|
199
|
+
| Entry | Why the server needs it |
|
|
200
|
+
| --------------- | ----------------------------------------------------------------------------------------- |
|
|
201
|
+
| `dist/` | Server bundle, emitted config and the static export. |
|
|
202
|
+
| `src/` | The server reads routes from `src/pages` at startup. |
|
|
203
|
+
| `node_modules/` | The install the build ran against, on the server's operating system and CPU architecture. |
|
|
204
|
+
| `package.json` | Declares `"type": "module"` for the `.js` chunks. |
|
|
205
|
+
|
|
206
|
+
Start the server from that folder with `node dist/.server/app.mjs`. A server started from a `.server` folder loads the `eco.config.mjs` beside its entry, even when `eco.config.ts` is present, so the deploy may include the source config. `ecopages start` passes the emitted config explicitly.
|
|
207
|
+
|
|
208
|
+
Relative imports name the package manager's store folders (`node_modules/.pnpm/<name>@<version>_<peers>/...`), so a reinstall works only when it reproduces those names: the same lockfile, package manager version and layout settings (pnpm `node-linker`, `virtual-store-dir`, `virtual-store-dir-max-length`). Copy the install the build used instead, built on the target platform, because native bindings are per platform.
|
|
209
|
+
|
|
210
|
+
Only installs whose package paths contain a `node_modules` folder are kept external. A package manager store whose real path has no `node_modules` segment is bundled as before, and so is a Yarn Plug'n'Play install, whose packages live in `.zip` archives that Node cannot import without the PnP loader; relocated server output does not support Plug'n'Play.
|
|
211
|
+
|
|
212
|
+
`node_modules` must hold the packages themselves. When externalized packages resolve outside the app root, the server entry and emitted config builds of `ecopages build` each log one line per server output file, named by its path (`dist/.server/app.mjs`, `dist/.server/eco.config.mjs`), with that file's complete count, the first five names and a link to the deployment docs. Route-module and other builds, including those the running server makes on the deploy target, stay silent. In a workspace, these packages live in the workspace root `node_modules`, outside the app folder, so build from a standalone install (for example the output of `pnpm deploy`) instead of copying the app folder alone. The same applies to a package manager store linked from outside the project, such as pnpm's global virtual store.
|
|
213
|
+
|
|
214
|
+
## Unified pages graph
|
|
215
|
+
|
|
216
|
+
Production static exports compile all template pages in one Rolldown invocation when `shouldBuildPagesUnifiedGraph()` is true (default in production; opt out with `ECOPAGES_UNIFIED_PAGES_GRAPH=false` or `0`). Pages of an Integration that implements `compilePageModule()`, such as [HTML Pages](../html-pages/README.md), are compiled in-process and stay out of the graph.
|
|
217
|
+
|
|
218
|
+
| Artifact | Location |
|
|
219
|
+
| ------------- | ----------------------------------------------------- |
|
|
220
|
+
| Chunk outputs | `.eco/.server-modules/` (shared with per-route cache) |
|
|
221
|
+
|
|
222
|
+
`StaticSiteGenerator` calls `ensurePagesUnifiedGraphBuilt()` before the export loop. `PageModuleImportService` imports prebuilt chunks via `importPagesUnifiedGraphModule()` and falls back to per-page Rolldown on miss.
|
|
223
|
+
|
|
224
|
+
The graph is reused only in this process, and only when it matches the build key (output directory, config module hash, template extensions and build plugins), every local file reachable from its outputs still exists, every recorded source-file hash still matches, and the exact active template route set matches recorded outputs. `importPagesUnifiedGraphModule()` applies the same check, because pages can be imported before the export loop runs. This is separate from production Page Browser Graph prebuild (`production-page-browser-graph-prebuild.ts`), which warms browser assets in `page-browser-graph-session`.
|
|
225
|
+
|
|
226
|
+
`ECOPAGES_ROLLDOWN_BUILD_METRICS=1` enables `rolldown/rolldown-build-invocation-metrics.ts` counters used by bench and parity tests.
|
|
227
|
+
|
|
228
|
+
`cache/app-config-hash.ts` hashes the config module and the project files it imports. The unified pages graph and the route-module cache key on it.
|
|
229
|
+
|
|
230
|
+
## JSX Ownership Plugins
|
|
231
|
+
|
|
232
|
+
Mixed-integration apps need explicit `@jsxImportSource` handling in two different shapes:
|
|
233
|
+
|
|
234
|
+
| Helper | Use when | Behavior |
|
|
235
|
+
| ------------------------------------ | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
236
|
+
| `getJsxOwnershipPlugins()` | App-wide server/transpile builds | Each JSX integration extension gets its **own** `jsxImportSource` so native files keep their owning runtime. |
|
|
237
|
+
| `getHostScopedJsxOwnershipPlugins()` | One integration's **client** bundle graph | Foreign `.tsx`/`.jsx` files compile with the **host** integration JSX runtime (for example React bundling `.kita.tsx`). |
|
|
238
|
+
| component identity build plugin | Component identity attribution | Prepends the **owning** integration pragma when injecting `identity` into native files. |
|
|
239
|
+
|
|
240
|
+
`foreign-jsx-override-plugin.ts` is the shared implementation. Prefer the helpers above instead of calling it directly from integrations.
|
|
241
|
+
|
|
242
|
+
## Rolldown operator notes
|
|
243
|
+
|
|
244
|
+
Ecopages bundles with Rolldown for Node server and browser targets.
|
|
245
|
+
|
|
246
|
+
### Plugin hook filters
|
|
247
|
+
|
|
248
|
+
Rolldown evaluates plugin hooks on the Rust side and only calls JavaScript when the filter matches. Hooks without filters run for every module through Rust→JS FFI, causing **3–4× slowdown** with multiple plugins.
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
// BAD — called for every module
|
|
252
|
+
resolveId(source, importer) { /* ... */ }
|
|
253
|
+
|
|
254
|
+
// GOOD — skipped unless the filter matches
|
|
255
|
+
resolveId: {
|
|
256
|
+
filter: { id: /\.tsx?$/ },
|
|
257
|
+
handler(source, importer) { /* ... */ },
|
|
258
|
+
}
|
|
75
259
|
```
|
|
76
260
|
|
|
77
|
-
|
|
261
|
+
Rolldown reads hook filters when a plugin is registered, before `buildStart`, so filters cannot come from registrations made during the build. See [rolldown.rs/reference/plugin-hooks](https://rolldown.rs/reference/plugin-hooks).
|
|
78
262
|
|
|
79
|
-
|
|
263
|
+
### The bridge plugin
|
|
80
264
|
|
|
81
|
-
|
|
265
|
+
Each Rolldown plugin adds FFI overhead per module per hook. `rolldown-plugin-bridge.ts` merges all `EcoBuildPlugin` instances into one Rolldown plugin and routes in JavaScript.
|
|
82
266
|
|
|
83
|
-
|
|
84
|
-
2. Stop the current esbuild service instance.
|
|
85
|
-
3. Increment the esbuild module generation so the next import gets a fresh worker instance.
|
|
267
|
+
Every build creates a new bridge. The bridge runs each plugin's `setup` before it creates the Rolldown plugin, then declares the union of the registered filters as the `resolveId`, `load`, and `transform` hook filters. A handler registered after its plugin's `setup` has finished would miss the filters, so the builder throws. A module that no registration can match never calls into JavaScript. Rolldown tests the filters against ids with `/` separators.
|
|
86
268
|
|
|
87
|
-
|
|
269
|
+
| Registration | Hook filter |
|
|
270
|
+
| --------------------------- | ------------------------------------------------------- |
|
|
271
|
+
| `onResolve` / `onLoad` | the registered `filter` |
|
|
272
|
+
| the same with a `namespace` | `^<namespace>:`; the exact `filter` runs in JS |
|
|
273
|
+
| `module(specifier)` | `^<specifier>$` on resolve, its namespace on load |
|
|
274
|
+
| `transform` | the registered `filter`, tested on the id without query |
|
|
88
275
|
|
|
89
|
-
|
|
276
|
+
Within the handler, `onResolve` and `onLoad` registrations run in `EcoBuildPlugin[]` order and the first non-null result wins. `transform` runs every matching registration in that same order. A hook with no registrations is not declared. In a kitchen-sink production build, the filters cut JS `resolveId` calls from 7344 to 323 and `load` calls from 4146 to 2826. Source-transform plugins use the `transform` hook, so they no longer admit most source files to `load`. The transform filter is tested with the query and hash stripped, so `/\.tsx$/` still matches `page.tsx?v=1`.
|
|
90
277
|
|
|
91
|
-
|
|
278
|
+
### Benchmarks
|
|
92
279
|
|
|
93
|
-
|
|
280
|
+
Kitchen-sink benchmarks (`ECOPAGES_BENCH=1 pnpm vitest bench`) show Rolldown winning 15/18 scenarios versus esbuild, with a **1.21×** geometric mean speedup. Largest wins: React page rebuilds (1.56×), production single page (1.49×), Lit (1.52×), Ecopages-JSX (1.47×). Three scenarios regressed (KitaJS postcss, dynamic route, no-op rebuild); route-module disk cache and fingerprinted production caches reduce repeated work on warm paths.
|
|
94
281
|
|
|
95
|
-
|
|
96
|
-
- development policy stays in one place (`DevBuildCoordinator`) for the remaining Bun-native path only
|
|
97
|
-
- callers with app context use that executor explicitly instead of consulting global state
|
|
98
|
-
- tests can still instantiate `EsbuildBuildAdapter`, `ViteHostBuildAdapter`, or `DevBuildCoordinator` directly when they want the raw ownership boundary or compatibility backend only
|
|
282
|
+
### Native MagicString and CSS shim
|
|
99
283
|
|
|
100
|
-
|
|
284
|
+
- `experimental.nativeMagicString: true` enables Rust-native string manipulation for faster transforms.
|
|
285
|
+
- Server-side builds use `createServerSideCssShimPlugin()` to turn `.css` imports into empty ESM modules. Skipped for browser builds.
|
|
286
|
+
- Core's own hooks (the browser server-only guard's builtin check and the CSS shim) declare Rolldown hook filters, so Rolldown calls them only for the ids they handle instead of for every module. The adapter closes its Rolldown bundle in a `finally`, so a failed write does not leave it open.
|
|
101
287
|
|
|
102
|
-
|
|
288
|
+
## Testing Strategy
|
|
103
289
|
|
|
104
|
-
- `build-adapter.test.ts`
|
|
105
|
-
- `
|
|
290
|
+
- `rolldown/rolldown-build-adapter.test.ts` covers the adapter's `build`, `resolve`, and dependency-graph extraction end-to-end.
|
|
291
|
+
- `rolldown/rolldown-plugin-bridge.test.ts` covers the `EcoBuildPlugin[]` → plugin translation in isolation.
|
|
292
|
+
- `build-adapter.test.ts` covers the adapter factories, manifest sealing, and runtime plugin setup.
|
|
293
|
+
- `runtime/build-queue.test.ts` covers lane limits, shared in-flight builds, builds that wait for a child build, and request-scope reuse.
|
|
294
|
+
- `runtime/build-request-policy.test.ts` and `runtime/build-request-identity.test.ts` cover request assembly and dedupe identity.
|
|
295
|
+
- `rolldown/app-package-declarations.test.ts` covers the app `package.json` lookups that decide which packages stay external.
|
|
296
|
+
- `server-bundle-relocation.test.ts` builds an app installed with an isolated (pnpm-style) layout, moves the deploy layout to another root, and serves the home page with `node`.
|
|
106
297
|
|
|
107
|
-
If you change
|
|
298
|
+
If you change option mapping or plugin-bridge semantics, update the adapter and bridge tests first. If you change the app-owned helper contracts, update `build-adapter.test.ts` first.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type AppBuildManifest } from './contracts/build-manifest.js';
|
|
2
|
+
import type { EcoPagesAppConfig } from '../config/internal-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Seals the app's build manifest from its loaders, processors and integrations.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Called during runtime assembly. Loaders come first, then processors, then integrations. Each one's
|
|
8
|
+
* `plugins(app)` is read once; every registration is validated once, by {@link createAppBuildManifest}. Browser
|
|
9
|
+
* runtime manifests are data, not lifecycle hooks. Runtime setup happens after finalization.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sealAppBuildManifest(appConfig: EcoPagesAppConfig): AppBuildManifest;
|
|
12
|
+
export declare function setupAppRuntimePlugins(options: {
|
|
13
|
+
appConfig: EcoPagesAppConfig;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Activates one integration's runtime setup on first use.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Concurrent callers share a single in-flight promise per integration name.
|
|
20
|
+
* Failed activations are evicted so a later caller can retry.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ensureIntegrationRuntimeReady(options: {
|
|
23
|
+
appConfig: EcoPagesAppConfig;
|
|
24
|
+
integrationName: string;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
export declare function setupAppRuntimeIntegrations(options: {
|
|
27
|
+
appConfig: EcoPagesAppConfig;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Releases runtime resources owned by the app's Integrations.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Waits for in-flight setup calls before teardown and clears activation state after each activated Integration
|
|
34
|
+
* has had a chance to release its resources.
|
|
35
|
+
*/
|
|
36
|
+
export declare function teardownAppRuntimeIntegrations(options: {
|
|
37
|
+
appConfig: EcoPagesAppConfig;
|
|
38
|
+
}): Promise<void>;
|