@ogygia/core 0.0.0 → 0.11.1
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/LICENSE +21 -0
- package/README.md +7 -1
- package/ambient.d.ts +194 -0
- package/dist/ClientBindingStub.svelte +6 -0
- package/dist/ClientBindingStub.svelte.d.ts +26 -0
- package/dist/KeepHost.svelte +19 -0
- package/dist/KeepHost.svelte.d.ts +10 -0
- package/dist/LakeBoundary.svelte +16 -0
- package/dist/LakeBoundary.svelte.d.ts +11 -0
- package/dist/LateIsland.svelte +22 -0
- package/dist/LateIsland.svelte.d.ts +15 -0
- package/dist/LateIslandAwait.svelte +17 -0
- package/dist/LateIslandAwait.svelte.d.ts +15 -0
- package/dist/LiveHost.svelte +19 -0
- package/dist/LiveHost.svelte.d.ts +10 -0
- package/dist/NestedProvider.svelte +13 -0
- package/dist/NestedProvider.svelte.d.ts +8 -0
- package/dist/OgygiaBoundary.svelte +5 -0
- package/dist/OgygiaBoundary.svelte.d.ts +17 -0
- package/dist/PromiseRegion.svelte +40 -0
- package/dist/PromiseRegion.svelte.d.ts +15 -0
- package/dist/PromiseRegionAwait.svelte +27 -0
- package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
- package/dist/Provide.svelte +27 -0
- package/dist/Provide.svelte.d.ts +8 -0
- package/dist/RawHtml.svelte +9 -0
- package/dist/RawHtml.svelte.d.ts +6 -0
- package/dist/Region.svelte +1173 -0
- package/dist/Region.svelte.d.ts +68 -0
- package/dist/SlotBoundary.svelte +13 -0
- package/dist/SlotBoundary.svelte.d.ts +7 -0
- package/dist/app.d.ts +4 -0
- package/dist/app.js +3 -0
- package/dist/boundary.d.ts +35 -0
- package/dist/boundary.js +127 -0
- package/dist/build-cache.d.ts +13 -0
- package/dist/build-cache.js +77 -0
- package/dist/compiler/blank-styles.d.ts +1 -0
- package/dist/compiler/blank-styles.js +63 -0
- package/dist/compiler/bom.d.ts +2 -0
- package/dist/compiler/bom.js +15 -0
- package/dist/compiler/browser-full.d.ts +8 -0
- package/dist/compiler/browser-full.js +8 -0
- package/dist/compiler/browser.d.ts +11 -0
- package/dist/compiler/browser.js +11 -0
- package/dist/compiler/content/transportables.d.ts +26 -0
- package/dist/compiler/content/transportables.js +219 -0
- package/dist/compiler/ctx.d.ts +185 -0
- package/dist/compiler/ctx.js +203 -0
- package/dist/compiler/debarrel/barrel.d.ts +55 -0
- package/dist/compiler/debarrel/barrel.js +248 -0
- package/dist/compiler/debarrel/options.d.ts +67 -0
- package/dist/compiler/debarrel/options.js +31 -0
- package/dist/compiler/debarrel/parse.d.ts +65 -0
- package/dist/compiler/debarrel/parse.js +256 -0
- package/dist/compiler/debarrel/plugin.d.ts +31 -0
- package/dist/compiler/debarrel/plugin.js +190 -0
- package/dist/compiler/debarrel/rewrite.d.ts +27 -0
- package/dist/compiler/debarrel/rewrite.js +118 -0
- package/dist/compiler/debarrel/svelte.d.ts +13 -0
- package/dist/compiler/debarrel/svelte.js +56 -0
- package/dist/compiler/dev/css-scope.d.ts +16 -0
- package/dist/compiler/dev/css-scope.js +38 -0
- package/dist/compiler/dev/dev-hmr.d.ts +25 -0
- package/dist/compiler/dev/dev-hmr.js +29 -0
- package/dist/compiler/dev/hmr.d.ts +34 -0
- package/dist/compiler/dev/hmr.js +57 -0
- package/dist/compiler/dev/region-bytes.d.ts +34 -0
- package/dist/compiler/dev/region-bytes.js +126 -0
- package/dist/compiler/driver.d.ts +280 -0
- package/dist/compiler/driver.js +1352 -0
- package/dist/compiler/flags.d.ts +16 -0
- package/dist/compiler/flags.js +101 -0
- package/dist/compiler/fouc-css.d.ts +97 -0
- package/dist/compiler/fouc-css.js +335 -0
- package/dist/compiler/free-vars.d.ts +20 -0
- package/dist/compiler/free-vars.js +327 -0
- package/dist/compiler/host.d.ts +65 -0
- package/dist/compiler/host.js +51 -0
- package/dist/compiler/ids.d.ts +84 -0
- package/dist/compiler/ids.js +86 -0
- package/dist/compiler/index.d.ts +11 -0
- package/dist/compiler/index.js +11 -0
- package/dist/compiler/kit.d.ts +129 -0
- package/dist/compiler/kit.js +563 -0
- package/dist/compiler/link/build-output.d.ts +44 -0
- package/dist/compiler/link/build-output.js +147 -0
- package/dist/compiler/link/caps.d.ts +48 -0
- package/dist/compiler/link/caps.js +64 -0
- package/dist/compiler/link/context-detect.d.ts +23 -0
- package/dist/compiler/link/context-detect.js +137 -0
- package/dist/compiler/link/emit-gate.d.ts +11 -0
- package/dist/compiler/link/emit-gate.js +40 -0
- package/dist/compiler/link/entry-shim.d.ts +4 -0
- package/dist/compiler/link/entry-shim.js +29 -0
- package/dist/compiler/link/island-deps.d.ts +142 -0
- package/dist/compiler/link/island-deps.js +525 -0
- package/dist/compiler/link/manifest.d.ts +5 -0
- package/dist/compiler/link/manifest.js +9 -0
- package/dist/compiler/link/page-keys.d.ts +64 -0
- package/dist/compiler/link/page-keys.js +683 -0
- package/dist/compiler/link/registry-stub.d.ts +41 -0
- package/dist/compiler/link/registry-stub.js +212 -0
- package/dist/compiler/link/router-config.d.ts +11 -0
- package/dist/compiler/link/router-config.js +15 -0
- package/dist/compiler/link/router-css.d.ts +22 -0
- package/dist/compiler/link/router-css.js +142 -0
- package/dist/compiler/link/runtime-entry.d.ts +71 -0
- package/dist/compiler/link/runtime-entry.js +132 -0
- package/dist/compiler/link/server-manifest.d.ts +12 -0
- package/dist/compiler/link/server-manifest.js +45 -0
- package/dist/compiler/link/speculation.d.ts +17 -0
- package/dist/compiler/link/speculation.js +36 -0
- package/dist/compiler/link/transport.d.ts +31 -0
- package/dist/compiler/link/transport.js +67 -0
- package/dist/compiler/macros/bake.d.ts +20 -0
- package/dist/compiler/macros/bake.js +317 -0
- package/dist/compiler/macros/browser.d.ts +11 -0
- package/dist/compiler/macros/browser.js +69 -0
- package/dist/compiler/macros/dedent.d.ts +12 -0
- package/dist/compiler/macros/dedent.js +36 -0
- package/dist/compiler/macros/dollar.d.ts +15 -0
- package/dist/compiler/macros/dollar.js +387 -0
- package/dist/compiler/macros/pipeline.d.ts +31 -0
- package/dist/compiler/macros/pipeline.js +106 -0
- package/dist/compiler/macros/source.d.ts +6 -0
- package/dist/compiler/macros/source.js +127 -0
- package/dist/compiler/macros/store.d.ts +17 -0
- package/dist/compiler/macros/store.js +244 -0
- package/dist/compiler/macros/wire.d.ts +14 -0
- package/dist/compiler/macros/wire.js +160 -0
- package/dist/compiler/ownership-stamps.d.ts +6 -0
- package/dist/compiler/ownership-stamps.js +144 -0
- package/dist/compiler/parse/oxc.d.ts +34 -0
- package/dist/compiler/parse/oxc.js +59 -0
- package/dist/compiler/parse/scan.d.ts +43 -0
- package/dist/compiler/parse/scan.js +232 -0
- package/dist/compiler/program.d.ts +140 -0
- package/dist/compiler/program.js +242 -0
- package/dist/compiler/region/emit.d.ts +169 -0
- package/dist/compiler/region/emit.js +286 -0
- package/dist/compiler/region/identity.d.ts +28 -0
- package/dist/compiler/region/identity.js +75 -0
- package/dist/compiler/region/ir.d.ts +65 -0
- package/dist/compiler/region/ir.js +0 -0
- package/dist/compiler/region/transform.d.ts +178 -0
- package/dist/compiler/region/transform.js +1933 -0
- package/dist/compiler/script-request.d.ts +1 -0
- package/dist/compiler/script-request.js +43 -0
- package/dist/context-bridge.d.ts +65 -0
- package/dist/context-bridge.js +217 -0
- package/dist/context-registry.d.ts +40 -0
- package/dist/context-registry.js +15 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +158 -0
- package/dist/current-region.d.ts +14 -0
- package/dist/current-region.js +36 -0
- package/dist/document.d.ts +41 -0
- package/dist/document.js +125 -0
- package/dist/entry-hydrate.d.ts +5 -0
- package/dist/entry-hydrate.js +42 -0
- package/dist/escape.d.ts +18 -0
- package/dist/escape.js +37 -0
- package/dist/events/bus.d.ts +33 -0
- package/dist/events/bus.js +153 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +4 -0
- package/dist/events/schema.d.ts +389 -0
- package/dist/events/schema.js +23 -0
- package/dist/events/server-registry.d.ts +7 -0
- package/dist/events/server-registry.js +13 -0
- package/dist/events/sinks.d.ts +64 -0
- package/dist/events/sinks.js +85 -0
- package/dist/fn-transport.d.ts +33 -0
- package/dist/fn-transport.js +140 -0
- package/dist/frame.d.ts +20 -0
- package/dist/frame.js +19 -0
- package/dist/holes-record.d.ts +6 -0
- package/dist/holes-record.js +8 -0
- package/dist/hooks.d.ts +43 -0
- package/dist/hooks.js +1191 -0
- package/dist/hydration-info.d.ts +1 -0
- package/dist/hydration-info.js +31 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -0
- package/dist/insights/attr-rules.d.ts +15 -0
- package/dist/insights/attr-rules.js +27 -0
- package/dist/insights/cpu.d.ts +82 -0
- package/dist/insights/cpu.js +177 -0
- package/dist/insights/fp-drift.d.ts +28 -0
- package/dist/insights/fp-drift.js +148 -0
- package/dist/insights/hole-segments.d.ts +26 -0
- package/dist/insights/hole-segments.js +50 -0
- package/dist/insights/html-diff.d.ts +25 -0
- package/dist/insights/html-diff.js +157 -0
- package/dist/insights/hydration-hazards.d.ts +36 -0
- package/dist/insights/hydration-hazards.js +136 -0
- package/dist/insights/hydration-status.d.ts +2 -0
- package/dist/insights/hydration-status.js +0 -0
- package/dist/insights/index.d.ts +14 -0
- package/dist/insights/index.js +12 -0
- package/dist/insights/page-assets.d.ts +211 -0
- package/dist/insights/page-assets.js +608 -0
- package/dist/insights/page-insights.d.ts +749 -0
- package/dist/insights/page-insights.js +2157 -0
- package/dist/insights/session-data.d.ts +108 -0
- package/dist/insights/session-data.js +0 -0
- package/dist/insights/session-insights.d.ts +121 -0
- package/dist/insights/session-insights.js +548 -0
- package/dist/insights/switch.d.ts +53 -0
- package/dist/insights/switch.js +91 -0
- package/dist/insights/testing-version.d.ts +19 -0
- package/dist/insights/testing-version.js +21 -0
- package/dist/insights/third-party.d.ts +75 -0
- package/dist/insights/third-party.js +160 -0
- package/dist/internal-instruments.d.ts +13 -0
- package/dist/internal-instruments.js +12 -0
- package/dist/internal-reconcile.d.ts +3 -0
- package/dist/internal-reconcile.js +3 -0
- package/dist/internal-register.d.ts +7 -0
- package/dist/internal-register.js +7 -0
- package/dist/internal-server.d.ts +7 -0
- package/dist/internal-server.js +7 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +13 -0
- package/dist/island-graph.d.ts +36 -0
- package/dist/island-graph.js +89 -0
- package/dist/keep-fallback-marker.d.ts +7 -0
- package/dist/keep-fallback-marker.js +9 -0
- package/dist/keep-fallback.d.ts +13 -0
- package/dist/keep-fallback.js +39 -0
- package/dist/kit-paths.d.ts +2 -0
- package/dist/kit-paths.js +39 -0
- package/dist/late-region-registry.d.ts +40 -0
- package/dist/late-region-registry.js +36 -0
- package/dist/live-transport.d.ts +57 -0
- package/dist/live-transport.js +145 -0
- package/dist/markup.d.ts +4 -0
- package/dist/markup.js +4 -0
- package/dist/own-package.d.ts +15 -0
- package/dist/own-package.js +20 -0
- package/dist/page-defer.d.ts +33 -0
- package/dist/page-defer.js +35 -0
- package/dist/page-facts-script.d.ts +7 -0
- package/dist/page-facts-script.js +9 -0
- package/dist/page-seed-registry.d.ts +72 -0
- package/dist/page-seed-registry.js +31 -0
- package/dist/plugin/capability.d.ts +14 -0
- package/dist/plugin/capability.js +44 -0
- package/dist/plugin/client.d.ts +39 -0
- package/dist/plugin/client.js +6 -0
- package/dist/plugin/css.d.ts +3 -0
- package/dist/plugin/css.js +54 -0
- package/dist/plugin/facts.d.ts +42 -0
- package/dist/plugin/facts.js +37 -0
- package/dist/plugin/hooks.d.ts +33 -0
- package/dist/plugin/hooks.js +38 -0
- package/dist/plugin/index.d.ts +127 -0
- package/dist/plugin/index.js +26 -0
- package/dist/plugin/routes.d.ts +32 -0
- package/dist/plugin/routes.js +35 -0
- package/dist/plugin/server.d.ts +27 -0
- package/dist/plugin/server.js +92 -0
- package/dist/plugin/standard-schema.d.ts +27 -0
- package/dist/plugin/standard-schema.js +0 -0
- package/dist/plugin/testing.d.ts +13 -0
- package/dist/plugin/testing.js +54 -0
- package/dist/plugin/utils.d.ts +13 -0
- package/dist/plugin/utils.js +19 -0
- package/dist/portable-form.d.ts +22 -0
- package/dist/portable-form.js +52 -0
- package/dist/preference.d.ts +35 -0
- package/dist/preference.js +84 -0
- package/dist/preload.d.ts +1 -0
- package/dist/preload.js +21 -0
- package/dist/ref-watch.d.ts +31 -0
- package/dist/ref-watch.js +66 -0
- package/dist/ref.d.ts +124 -0
- package/dist/ref.js +272 -0
- package/dist/region-brand.d.ts +8 -0
- package/dist/region-brand.js +10 -0
- package/dist/region-core.d.ts +2 -0
- package/dist/region-core.js +1 -0
- package/dist/region-snippet.d.ts +73 -0
- package/dist/region-snippet.js +351 -0
- package/dist/region.d.ts +127 -0
- package/dist/region.js +162 -0
- package/dist/request-event.d.ts +1 -0
- package/dist/request-event.js +37 -0
- package/dist/router-css.d.ts +39 -0
- package/dist/router-css.js +66 -0
- package/dist/runtime/app-transport.d.ts +2 -0
- package/dist/runtime/app-transport.js +13 -0
- package/dist/runtime/beacon.d.ts +271 -0
- package/dist/runtime/beacon.js +2190 -0
- package/dist/runtime/boot-link.d.ts +1 -0
- package/dist/runtime/boot-link.js +44 -0
- package/dist/runtime/client-hooks.d.ts +5 -0
- package/dist/runtime/client-hooks.js +22 -0
- package/dist/runtime/client-plugins.d.ts +8 -0
- package/dist/runtime/client-plugins.js +34 -0
- package/dist/runtime/concurrency.d.ts +12 -0
- package/dist/runtime/concurrency.js +29 -0
- package/dist/runtime/connected.d.ts +12 -0
- package/dist/runtime/connected.js +16 -0
- package/dist/runtime/context.d.ts +1 -0
- package/dist/runtime/context.js +19 -0
- package/dist/runtime/core.d.ts +15 -0
- package/dist/runtime/core.js +1173 -0
- package/dist/runtime/drift-watch.d.ts +9 -0
- package/dist/runtime/drift-watch.js +60 -0
- package/dist/runtime/entry-locations.d.ts +33 -0
- package/dist/runtime/entry-locations.js +119 -0
- package/dist/runtime/foreign-props.d.ts +8 -0
- package/dist/runtime/foreign-props.js +14 -0
- package/dist/runtime/form-continuity.d.ts +10 -0
- package/dist/runtime/form-continuity.js +107 -0
- package/dist/runtime/frame-nav.d.ts +36 -0
- package/dist/runtime/frame-nav.js +225 -0
- package/dist/runtime/frame-store.d.ts +62 -0
- package/dist/runtime/frame-store.js +214 -0
- package/dist/runtime/frames.d.ts +1 -0
- package/dist/runtime/frames.js +25 -0
- package/dist/runtime/full.d.ts +4 -0
- package/dist/runtime/full.js +32 -0
- package/dist/runtime/hash.d.ts +41 -0
- package/dist/runtime/hash.js +79 -0
- package/dist/runtime/hole-facts.d.ts +8 -0
- package/dist/runtime/hole-facts.js +57 -0
- package/dist/runtime/host-classes.d.ts +24 -0
- package/dist/runtime/host-classes.js +43 -0
- package/dist/runtime/hydrate-core.d.ts +101 -0
- package/dist/runtime/hydrate-core.js +605 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/interaction-replay.d.ts +11 -0
- package/dist/runtime/interaction-replay.js +70 -0
- package/dist/runtime/interaction.d.ts +33 -0
- package/dist/runtime/interaction.js +217 -0
- package/dist/runtime/island-graph-preload.d.ts +13 -0
- package/dist/runtime/island-graph-preload.js +99 -0
- package/dist/runtime/kit-boot.d.ts +29 -0
- package/dist/runtime/kit-boot.js +60 -0
- package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
- package/dist/runtime/kit-page-thread.svelte.js +116 -0
- package/dist/runtime/lake-anchors.d.ts +13 -0
- package/dist/runtime/lake-anchors.js +19 -0
- package/dist/runtime/lakes.d.ts +15 -0
- package/dist/runtime/lakes.js +212 -0
- package/dist/runtime/live.d.ts +3 -0
- package/dist/runtime/live.js +17 -0
- package/dist/runtime/load-scheduler.d.ts +53 -0
- package/dist/runtime/load-scheduler.js +317 -0
- package/dist/runtime/morph.d.ts +42 -0
- package/dist/runtime/morph.js +671 -0
- package/dist/runtime/nav-handle.d.ts +25 -0
- package/dist/runtime/nav-handle.js +71 -0
- package/dist/runtime/nav-hooks.d.ts +2 -0
- package/dist/runtime/nav-hooks.js +23 -0
- package/dist/runtime/nearest-attr.d.ts +4 -0
- package/dist/runtime/nearest-attr.js +16 -0
- package/dist/runtime/observe.d.ts +27 -0
- package/dist/runtime/observe.js +63 -0
- package/dist/runtime/own-cost.d.ts +9 -0
- package/dist/runtime/own-cost.js +35 -0
- package/dist/runtime/ownership.d.ts +101 -0
- package/dist/runtime/ownership.js +115 -0
- package/dist/runtime/page-cache.d.ts +23 -0
- package/dist/runtime/page-cache.js +74 -0
- package/dist/runtime/page-defer.d.ts +14 -0
- package/dist/runtime/page-defer.js +103 -0
- package/dist/runtime/parse-html.d.ts +40 -0
- package/dist/runtime/parse-html.js +81 -0
- package/dist/runtime/reconcile.d.ts +41 -0
- package/dist/runtime/reconcile.js +194 -0
- package/dist/runtime/region-attrs.d.ts +95 -0
- package/dist/runtime/region-attrs.js +153 -0
- package/dist/runtime/region-endpoint-url.d.ts +76 -0
- package/dist/runtime/region-endpoint-url.js +169 -0
- package/dist/runtime/region-ids.d.ts +8 -0
- package/dist/runtime/region-ids.js +33 -0
- package/dist/runtime/remote-seeds.d.ts +2 -0
- package/dist/runtime/remote-seeds.js +21 -0
- package/dist/runtime/render-blocking.d.ts +2 -0
- package/dist/runtime/render-blocking.js +30 -0
- package/dist/runtime/restore.d.ts +34 -0
- package/dist/runtime/restore.js +390 -0
- package/dist/runtime/router-nav.d.ts +63 -0
- package/dist/runtime/router-nav.js +740 -0
- package/dist/runtime/router.d.ts +201 -0
- package/dist/runtime/router.js +593 -0
- package/dist/runtime/schedule.d.ts +49 -0
- package/dist/runtime/schedule.js +256 -0
- package/dist/runtime/seeds.d.ts +50 -0
- package/dist/runtime/seeds.js +208 -0
- package/dist/runtime/session.d.ts +52 -0
- package/dist/runtime/session.js +130 -0
- package/dist/runtime/sidecar.d.ts +3 -0
- package/dist/runtime/sidecar.js +56 -0
- package/dist/runtime/slots.d.ts +183 -0
- package/dist/runtime/slots.js +44 -0
- package/dist/runtime/spa-cacheable.d.ts +7 -0
- package/dist/runtime/spa-cacheable.js +18 -0
- package/dist/runtime/speculate-hint.d.ts +1 -0
- package/dist/runtime/speculate-hint.js +35 -0
- package/dist/runtime/svelte-warnings.d.ts +28 -0
- package/dist/runtime/svelte-warnings.js +71 -0
- package/dist/runtime/wire-classes.d.ts +3 -0
- package/dist/runtime/wire-classes.js +69 -0
- package/dist/runtime/wire-format.d.ts +7 -0
- package/dist/runtime/wire-format.js +22 -0
- package/dist/script.d.ts +134 -0
- package/dist/script.js +184 -0
- package/dist/seed-refs.d.ts +105 -0
- package/dist/seed-refs.js +487 -0
- package/dist/server/capability-lifetime.d.ts +28 -0
- package/dist/server/capability-lifetime.js +31 -0
- package/dist/server/dead-kit-resolves.d.ts +1 -0
- package/dist/server/dead-kit-resolves.js +39 -0
- package/dist/server/document-assembly.d.ts +30 -0
- package/dist/server/document-assembly.js +26 -0
- package/dist/server/document-tail.d.ts +113 -0
- package/dist/server/document-tail.js +208 -0
- package/dist/server/endpoint.d.ts +51 -0
- package/dist/server/endpoint.js +90 -0
- package/dist/server/entry-location.d.ts +8 -0
- package/dist/server/entry-location.js +29 -0
- package/dist/server/fingerprint.d.ts +1 -0
- package/dist/server/fingerprint.js +25 -0
- package/dist/server/head-presence.d.ts +45 -0
- package/dist/server/head-presence.js +156 -0
- package/dist/server/hmac.d.ts +38 -0
- package/dist/server/hmac.js +89 -0
- package/dist/server/hole-graph.d.ts +7 -0
- package/dist/server/hole-graph.js +71 -0
- package/dist/server/hole-urls.d.ts +3 -0
- package/dist/server/hole-urls.js +76 -0
- package/dist/server/html-scan.d.ts +19 -0
- package/dist/server/html-scan.js +60 -0
- package/dist/server/kit-context.d.ts +78 -0
- package/dist/server/kit-context.js +110 -0
- package/dist/server/late-wire.d.ts +22 -0
- package/dist/server/late-wire.js +28 -0
- package/dist/server/page-facts.d.ts +25 -0
- package/dist/server/page-facts.js +138 -0
- package/dist/server/page-seed.d.ts +33 -0
- package/dist/server/page-seed.js +60 -0
- package/dist/server/page-stream.d.ts +55 -0
- package/dist/server/page-stream.js +121 -0
- package/dist/server/payload.d.ts +6 -0
- package/dist/server/payload.js +22 -0
- package/dist/server/personal-response.d.ts +6 -0
- package/dist/server/personal-response.js +13 -0
- package/dist/server/props-wire.d.ts +56 -0
- package/dist/server/props-wire.js +178 -0
- package/dist/server/rate-limit.d.ts +22 -0
- package/dist/server/rate-limit.js +63 -0
- package/dist/server/region-css.d.ts +5 -0
- package/dist/server/region-css.js +30 -0
- package/dist/server/region-endpoint.d.ts +35 -0
- package/dist/server/region-endpoint.js +142 -0
- package/dist/server/region-props.d.ts +6 -0
- package/dist/server/region-props.js +44 -0
- package/dist/server/remote-seed-gate.d.ts +50 -0
- package/dist/server/remote-seed-gate.js +66 -0
- package/dist/server/render-cache.d.ts +26 -0
- package/dist/server/render-cache.js +51 -0
- package/dist/server/render-page.d.ts +51 -0
- package/dist/server/render-page.js +176 -0
- package/dist/server/render-region-html.d.ts +2 -0
- package/dist/server/render-region-html.js +19 -0
- package/dist/server/request-stats.d.ts +174 -0
- package/dist/server/request-stats.js +54 -0
- package/dist/server/reversible.d.ts +83 -0
- package/dist/server/reversible.js +994 -0
- package/dist/server/seed-shape.d.ts +22 -0
- package/dist/server/seed-shape.js +24 -0
- package/dist/server/shared-cache.d.ts +35 -0
- package/dist/server/shared-cache.js +104 -0
- package/dist/server/signing-key.d.ts +11 -0
- package/dist/server/signing-key.js +47 -0
- package/dist/server/sized-lru.d.ts +20 -0
- package/dist/server/sized-lru.js +68 -0
- package/dist/server/split-regions.d.ts +81 -0
- package/dist/server/split-regions.js +368 -0
- package/dist/server/stream-regions.d.ts +5 -0
- package/dist/server/stream-regions.js +36 -0
- package/dist/shared-state.d.ts +7 -0
- package/dist/shared-state.js +152 -0
- package/dist/shims/app-environment.d.ts +4 -0
- package/dist/shims/app-environment.js +6 -0
- package/dist/shims/app-navigation.d.ts +33 -0
- package/dist/shims/app-navigation.js +119 -0
- package/dist/shims/app-paths.d.ts +6 -0
- package/dist/shims/app-paths.js +18 -0
- package/dist/shims/app-state.svelte.d.ts +23 -0
- package/dist/shims/app-state.svelte.js +50 -0
- package/dist/shims/app-stores.d.ts +21 -0
- package/dist/shims/app-stores.js +54 -0
- package/dist/shims/kit-bridge.d.ts +29 -0
- package/dist/shims/kit-bridge.js +7 -0
- package/dist/shims/kit-remote/client-stub.d.ts +27 -0
- package/dist/shims/kit-remote/client-stub.js +43 -0
- package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
- package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
- package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
- package/dist/shims/kit-remote/remote-cache.js +73 -0
- package/dist/shims/kit-remote/state-stub.d.ts +8 -0
- package/dist/shims/kit-remote/state-stub.js +8 -0
- package/dist/shims/page-store.svelte.d.ts +39 -0
- package/dist/shims/page-store.svelte.js +77 -0
- package/dist/source.d.ts +29 -0
- package/dist/source.js +87 -0
- package/dist/store-transport.d.ts +86 -0
- package/dist/store-transport.js +229 -0
- package/dist/tool-fetches.d.ts +5 -0
- package/dist/tool-fetches.js +41 -0
- package/dist/transport.d.ts +48 -0
- package/dist/transport.js +181 -0
- package/dist/unscoped-css.d.ts +26 -0
- package/dist/unscoped-css.js +53 -0
- package/dist/vite/dev-maps.d.ts +33 -0
- package/dist/vite/dev-maps.js +140 -0
- package/dist/vite/index.d.ts +19 -0
- package/dist/vite/index.js +820 -0
- package/dist/vite/kit-dirs.d.ts +7 -0
- package/dist/vite/kit-dirs.js +67 -0
- package/dist/vite/late-island.d.ts +25 -0
- package/dist/vite/late-island.js +33 -0
- package/dist/vite/module-map.d.ts +8 -0
- package/dist/vite/module-map.js +144 -0
- package/dist/vite/options.d.ts +208 -0
- package/dist/vite/options.js +74 -0
- package/dist/vite/package-files.d.ts +3 -0
- package/dist/vite/package-files.js +84 -0
- package/dist/vite/paths.d.ts +45 -0
- package/dist/vite/paths.js +112 -0
- package/dist/vite/plugin-api.d.ts +166 -0
- package/dist/vite/plugin-api.js +212 -0
- package/dist/vite/profiler-maps.d.ts +23 -0
- package/dist/vite/profiler-maps.js +178 -0
- package/dist/vite/server-sourcemaps.d.ts +8 -0
- package/dist/vite/server-sourcemaps.js +80 -0
- package/dist/vite/sourcemaps.d.ts +18 -0
- package/dist/vite/sourcemaps.js +80 -0
- package/dist/vite/style-preprocess.d.ts +2 -0
- package/dist/vite/style-preprocess.js +96 -0
- package/package.json +180 -6
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import { path } from "../host.js";
|
|
2
|
+
import { merge_page_keys } from "./page-keys.js";
|
|
3
|
+
import { hydration_hazards } from "../../insights/hydration-hazards.js";
|
|
4
|
+
import { OWN_FILE_RE, OWN_PACKAGE_NAMES } from "../../own-package.js";
|
|
5
|
+
// src/compiler/link/island-deps.ts
|
|
6
|
+
/**
|
|
7
|
+
* Whole-program island dependency collection — from a finished client bundle, the transitive static
|
|
8
|
+
* import + CSS chains for each `og-region.<id>.js` facade, so SSR can `modulepreload` a hydrate
|
|
9
|
+
* island's hashed dependency chunks (Vite's auto graph does not cover `@vite-ignore` `import(entry)`).
|
|
10
|
+
* Pure over the bundle it is handed. Covered by unit tests.
|
|
11
|
+
*/
|
|
12
|
+
/** Deterministic island facade filename (content-hashed Vite deps are separate). */
|
|
13
|
+
const ISLAND_FACADE_RE = /(?:^|\/)og-region\.[0-9a-f]+\.js$/;
|
|
14
|
+
const LEADING_SLASH = /^\//;
|
|
15
|
+
/** A Kit remote-function module (`*.remote.js` / `.ts`, Kit's `moduleExtensions` defaults), once
|
|
16
|
+
* its `?query` is stripped. In the CLIENT graph Kit swaps its body for fetching stubs, but the
|
|
17
|
+
* module keeps its file id — which is how an island's chunk closure names the remotes it can call. */
|
|
18
|
+
const REMOTE_MODULE_RE = /\.remote\.[cm]?[jt]s$/;
|
|
19
|
+
const BACKSLASH_G = /\\/g;
|
|
20
|
+
/**
|
|
21
|
+
* Kit's own `hash()` (`@sveltejs/kit/src/utils/hash.js`: djb2 ×33 xor, unsigned, base36) — the
|
|
22
|
+
* function a remote's id is minted with: `${hash(file)}/${exportName}`, `file` the module's path
|
|
23
|
+
* relative to `process.cwd()`, posix. Mirrored here (Kit does not export it) so the build can
|
|
24
|
+
* name a remote by the same id the server sees on `internals.id` at render time. Covered by a
|
|
25
|
+
* vector test against ids observed from a real Kit build.
|
|
26
|
+
*/
|
|
27
|
+
function kit_remote_hash(file) {
|
|
28
|
+
let hash = 5381;
|
|
29
|
+
let i = file.length;
|
|
30
|
+
while (i) hash = hash * 33 ^ file.charCodeAt(--i);
|
|
31
|
+
return (hash >>> 0).toString(36);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The Kit remote id-hash of a CLIENT module id, or `null` for a module that is not a remote file.
|
|
35
|
+
* `cwd` is what Kit hashed the file against (`process.cwd()` at build), either separator.
|
|
36
|
+
*
|
|
37
|
+
* @internal Exported for the plugin and unit tests.
|
|
38
|
+
*/
|
|
39
|
+
function remote_hash_of(module_id, cwd) {
|
|
40
|
+
const id = module_id.split("?")[0].replace(BACKSLASH_G, "/");
|
|
41
|
+
if (!REMOTE_MODULE_RE.test(id)) return null;
|
|
42
|
+
const root = cwd.replace(BACKSLASH_G, "/").replace(TRAILING_SLASH_RE, "");
|
|
43
|
+
return kit_remote_hash(id.startsWith(root + "/") ? id.slice(root.length + 1) : path.posix.relative(root, id));
|
|
44
|
+
}
|
|
45
|
+
const TRAILING_SLASH_RE = /\/+$/;
|
|
46
|
+
/**
|
|
47
|
+
* From a client `generateBundle` output, collect transitive static `imports` for each
|
|
48
|
+
* `og-region.<id>.js` facade. Keys/values are public URLs (`/_app/immutable/…`).
|
|
49
|
+
* Used so SSR can `modulepreload` hashed dependency chunks for `hydrate: 'load'` islands
|
|
50
|
+
* (Vite’s auto graph does not apply to `@vite-ignore` `import(entry)`).
|
|
51
|
+
*
|
|
52
|
+
* @internal Exported for unit tests.
|
|
53
|
+
*/
|
|
54
|
+
function collectIslandDepModulepreloads(bundle, page_reader_files = [], remote_hash = null, page_keys_of = null, read_source = null, runtime_file = null, entries = null) {
|
|
55
|
+
const js = {};
|
|
56
|
+
const css = {};
|
|
57
|
+
const page = {};
|
|
58
|
+
const page_keys = {};
|
|
59
|
+
const remotes = {};
|
|
60
|
+
const interactivity = {};
|
|
61
|
+
const hazards = {};
|
|
62
|
+
const hazards_cache = /* @__PURE__ */ new Map();
|
|
63
|
+
const hazards_of = (id) => {
|
|
64
|
+
if (!read_source) return [];
|
|
65
|
+
const clean = norm(id.split("?")[0]);
|
|
66
|
+
if (!clean.endsWith(".svelte") || OWN_OR_DEP_RE.test(clean) && !SITE_KIT_RE.test(clean)) return [];
|
|
67
|
+
const hit = hazards_cache.get(clean);
|
|
68
|
+
if (hit) return hit;
|
|
69
|
+
const src = read_source(clean);
|
|
70
|
+
const at_src = clean.lastIndexOf("/src/");
|
|
71
|
+
const file = SITE_KIT_RE.test(clean) ? `ogygia/${clean.slice(clean.lastIndexOf("/content/") + 1)}` : at_src !== -1 ? clean.slice(at_src + 1) : clean.split("/").slice(-2).join("/");
|
|
72
|
+
const out = src === null ? [] : hydration_hazards(src).slice(0, 3).map((h) => ({
|
|
73
|
+
file,
|
|
74
|
+
...h
|
|
75
|
+
}));
|
|
76
|
+
hazards_cache.set(clean, out);
|
|
77
|
+
return out;
|
|
78
|
+
};
|
|
79
|
+
const facts_cache = /* @__PURE__ */ new Map();
|
|
80
|
+
const facts_of = (id) => {
|
|
81
|
+
if (!read_source) return null;
|
|
82
|
+
const clean = norm(id.split("?")[0]);
|
|
83
|
+
if (!clean.endsWith(".svelte") || OWN_OR_DEP_RE.test(clean)) return null;
|
|
84
|
+
const hit = facts_cache.get(clean);
|
|
85
|
+
if (hit !== void 0) return hit;
|
|
86
|
+
const src = read_source(clean);
|
|
87
|
+
const f = src === null ? null : interactivity_facts(src);
|
|
88
|
+
facts_cache.set(clean, f);
|
|
89
|
+
return f;
|
|
90
|
+
};
|
|
91
|
+
const norm = (p) => p.split("\\").join("/");
|
|
92
|
+
const readers = new Set(page_reader_files.map(norm));
|
|
93
|
+
const keys_in = (fileName) => {
|
|
94
|
+
if (!page_keys_of) return void 0;
|
|
95
|
+
let acc = null;
|
|
96
|
+
let any = false;
|
|
97
|
+
for (const id of bundle[fileName]?.moduleIds ?? []) {
|
|
98
|
+
const k = page_keys_of(norm(id.split("?")[0]));
|
|
99
|
+
if (k === null) continue;
|
|
100
|
+
any = true;
|
|
101
|
+
acc = merge_page_keys(acc, k);
|
|
102
|
+
if (acc === "all") break;
|
|
103
|
+
}
|
|
104
|
+
return any ? acc : void 0;
|
|
105
|
+
};
|
|
106
|
+
const reads_page = (fileName) => {
|
|
107
|
+
if (!readers.size) return false;
|
|
108
|
+
for (const id of bundle[fileName]?.moduleIds ?? []) if (readers.has(norm(id.split("?")[0]))) return true;
|
|
109
|
+
return false;
|
|
110
|
+
};
|
|
111
|
+
const remotes_in = (fileName, acc) => {
|
|
112
|
+
if (!remote_hash) return;
|
|
113
|
+
for (const id of bundle[fileName]?.moduleIds ?? []) {
|
|
114
|
+
const h = remote_hash(id);
|
|
115
|
+
if (h) acc.add(h);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const closure_all = (fileName) => {
|
|
119
|
+
const seen = /* @__PURE__ */ new Set([fileName]);
|
|
120
|
+
const queue = [fileName];
|
|
121
|
+
while (queue.length) {
|
|
122
|
+
const chunk = bundle[queue.pop()];
|
|
123
|
+
if (!chunk || chunk.type !== "chunk") continue;
|
|
124
|
+
for (const imp of [...chunk.imports ?? [], ...chunk.dynamicImports ?? []]) {
|
|
125
|
+
if (seen.has(imp)) continue;
|
|
126
|
+
const dep = bundle[imp];
|
|
127
|
+
if (!dep || dep.type !== "chunk") continue;
|
|
128
|
+
seen.add(imp);
|
|
129
|
+
queue.push(imp);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return seen;
|
|
133
|
+
};
|
|
134
|
+
const css_of = (fileName) => {
|
|
135
|
+
const imported = bundle[fileName]?.viteMetadata?.importedCss;
|
|
136
|
+
if (!imported) return [];
|
|
137
|
+
return [...imported].map((f) => f.startsWith("/") ? f : "/" + f);
|
|
138
|
+
};
|
|
139
|
+
const walk = (fileName, seen, css_acc) => {
|
|
140
|
+
const chunk = bundle[fileName];
|
|
141
|
+
if (!chunk || chunk.type !== "chunk") return [];
|
|
142
|
+
const deps = [];
|
|
143
|
+
for (const imp of chunk.imports ?? []) {
|
|
144
|
+
if (seen.has(imp)) continue;
|
|
145
|
+
seen.add(imp);
|
|
146
|
+
const dep = bundle[imp];
|
|
147
|
+
if (!dep || dep.type !== "chunk") continue;
|
|
148
|
+
deps.push(imp.startsWith("/") ? imp : "/" + imp);
|
|
149
|
+
css_acc.push(...css_of(imp));
|
|
150
|
+
deps.push(...walk(imp, seen, css_acc));
|
|
151
|
+
}
|
|
152
|
+
return deps;
|
|
153
|
+
};
|
|
154
|
+
const identity_of = (fileName) => entries ? entries.islands.get(fileName) ?? null : ISLAND_FACADE_RE.test(fileName) ? fileName.startsWith("/") ? fileName : "/" + fileName : null;
|
|
155
|
+
for (const [key, chunk] of Object.entries(bundle)) {
|
|
156
|
+
if (chunk.type !== "chunk") continue;
|
|
157
|
+
const fileName = chunk.fileName || key;
|
|
158
|
+
const entryUrl = identity_of(fileName);
|
|
159
|
+
if (!entryUrl) continue;
|
|
160
|
+
const seen = /* @__PURE__ */ new Set([fileName]);
|
|
161
|
+
const css_acc = css_of(fileName);
|
|
162
|
+
const raw = walk(fileName, seen, css_acc);
|
|
163
|
+
const uniq = [];
|
|
164
|
+
const have = /* @__PURE__ */ new Set([entryUrl, "/" + fileName.replace(LEADING_SLASH, "")]);
|
|
165
|
+
for (const d of raw) {
|
|
166
|
+
if (have.has(d)) continue;
|
|
167
|
+
have.add(d);
|
|
168
|
+
uniq.push(d);
|
|
169
|
+
}
|
|
170
|
+
js[entryUrl] = uniq;
|
|
171
|
+
css[entryUrl] = [...new Set(css_acc)];
|
|
172
|
+
const full = closure_all(fileName);
|
|
173
|
+
let reads = false;
|
|
174
|
+
for (const s of full) if (reads_page(s)) {
|
|
175
|
+
reads = true;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
page[entryUrl] = reads;
|
|
179
|
+
if (reads) {
|
|
180
|
+
let acc = null;
|
|
181
|
+
let saw_reader = false;
|
|
182
|
+
for (const s of full) {
|
|
183
|
+
const k = keys_in(s);
|
|
184
|
+
if (k === void 0) continue;
|
|
185
|
+
saw_reader = true;
|
|
186
|
+
acc = merge_page_keys(acc, k);
|
|
187
|
+
if (acc === "all") break;
|
|
188
|
+
}
|
|
189
|
+
page_keys[entryUrl] = !saw_reader || acc === "all" || acc === null ? null : [...acc].sort();
|
|
190
|
+
}
|
|
191
|
+
const found = /* @__PURE__ */ new Set();
|
|
192
|
+
for (const s of full) remotes_in(s, found);
|
|
193
|
+
remotes[entryUrl] = [...found].sort();
|
|
194
|
+
if (read_source) {
|
|
195
|
+
let acc;
|
|
196
|
+
const seen_files = /* @__PURE__ */ new Set();
|
|
197
|
+
const lines = [];
|
|
198
|
+
for (const s of full) for (const id of bundle[s]?.moduleIds ?? []) {
|
|
199
|
+
const clean = norm(id.split("?")[0]);
|
|
200
|
+
if (seen_files.has(clean)) continue;
|
|
201
|
+
seen_files.add(clean);
|
|
202
|
+
const f = facts_of(id);
|
|
203
|
+
if (f) acc = merge_facts(acc, f);
|
|
204
|
+
if (lines.length < 5) {
|
|
205
|
+
for (const h of hazards_of(id)) if (lines.length < 5) lines.push(h);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (lines.length) hazards[entryUrl] = lines;
|
|
209
|
+
if (acc) interactivity[entryUrl] = {
|
|
210
|
+
...acc,
|
|
211
|
+
remotes: remotes[entryUrl].length
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (runtime_file) {
|
|
216
|
+
const runtime_key = norm(runtime_file).replace(LEADING_SLASH, "");
|
|
217
|
+
const chunk = bundle[runtime_key];
|
|
218
|
+
if (chunk && chunk.type === "chunk") js[entries?.runtime ?? "/" + runtime_key] = [...new Set(walk(runtime_key, /* @__PURE__ */ new Set([runtime_key]), []))];
|
|
219
|
+
}
|
|
220
|
+
const contents = {};
|
|
221
|
+
const heavy = {};
|
|
222
|
+
const summarize = (s) => {
|
|
223
|
+
const url = s.startsWith("/") ? s : "/" + s;
|
|
224
|
+
if (contents[url]) return;
|
|
225
|
+
const chunk = bundle[s];
|
|
226
|
+
const ids = chunk?.moduleIds ?? [];
|
|
227
|
+
const mods = chunk?.modules;
|
|
228
|
+
const size_of = mods ? (id) => mods[id]?.renderedLength ?? 0 : void 0;
|
|
229
|
+
if (ids.length) contents[url] = summarize_chunk_contents(ids, 6, 5, size_of);
|
|
230
|
+
if (ids.length && size_of) {
|
|
231
|
+
const named = chunk_module_bytes(ids, size_of);
|
|
232
|
+
if (named.top.length) heavy[url] = named;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
for (const [key, chunk] of Object.entries(bundle)) {
|
|
236
|
+
if (chunk.type !== "chunk") continue;
|
|
237
|
+
const fileName = chunk.fileName || key;
|
|
238
|
+
if (!identity_of(fileName)) continue;
|
|
239
|
+
for (const s of closure_all(fileName)) summarize(s);
|
|
240
|
+
}
|
|
241
|
+
for (const [key, chunk] of Object.entries(bundle)) if (chunk.type === "chunk") summarize(chunk.fileName || key);
|
|
242
|
+
return {
|
|
243
|
+
js,
|
|
244
|
+
css,
|
|
245
|
+
page,
|
|
246
|
+
page_keys,
|
|
247
|
+
remotes,
|
|
248
|
+
interactivity,
|
|
249
|
+
hazards,
|
|
250
|
+
contents,
|
|
251
|
+
heavy,
|
|
252
|
+
dupes: duplicate_modules(Object.entries(bundle).filter(([, c]) => c.type === "chunk").map(([key, c]) => {
|
|
253
|
+
const mods = c.modules;
|
|
254
|
+
return {
|
|
255
|
+
file: c.fileName || key,
|
|
256
|
+
ids: c.moduleIds ?? [],
|
|
257
|
+
...mods ? { size_of: (id) => mods[id]?.renderedLength ?? 0 } : {}
|
|
258
|
+
};
|
|
259
|
+
}))
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/** Where a module id's copy came from: an installed package's version (`name@1.2.3`, from a pnpm
|
|
263
|
+
* store path), else the package's top folder (`name/src`, `name/dist`). */
|
|
264
|
+
function module_origin(id) {
|
|
265
|
+
const p = id.split("\\").join("/");
|
|
266
|
+
const store = p.lastIndexOf("/.pnpm/");
|
|
267
|
+
if (store !== -1) {
|
|
268
|
+
const seg = p.slice(store + 7, p.indexOf("/", store + 7));
|
|
269
|
+
const cut = seg.indexOf("_");
|
|
270
|
+
return (cut === -1 ? seg : seg.slice(0, cut)).split("+").join("/");
|
|
271
|
+
}
|
|
272
|
+
if (!module_key(id)) return void 0;
|
|
273
|
+
let at = -1;
|
|
274
|
+
let top = "";
|
|
275
|
+
for (const t of [
|
|
276
|
+
"/src/",
|
|
277
|
+
"/dist/",
|
|
278
|
+
"/esm/",
|
|
279
|
+
"/build/"
|
|
280
|
+
]) {
|
|
281
|
+
const i = p.lastIndexOf(t);
|
|
282
|
+
if (i > at) {
|
|
283
|
+
at = i;
|
|
284
|
+
top = t;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return at === -1 ? void 0 : `${p.slice(p.lastIndexOf("/", at - 1) + 1, at)}${top.slice(0, -1)}`;
|
|
288
|
+
}
|
|
289
|
+
/** A module id as the file of its package, the build-or-source folder and the extension left out:
|
|
290
|
+
* two ids with one key are one module twice. Null for ids that are no file (virtual, `\0`). */
|
|
291
|
+
function module_key(id) {
|
|
292
|
+
if (!id || id.startsWith("\0") || id.startsWith("virtual:")) return null;
|
|
293
|
+
let p = id.split("\\").join("/");
|
|
294
|
+
const q = p.indexOf("?");
|
|
295
|
+
if (q !== -1) p = p.slice(0, q);
|
|
296
|
+
let pkg;
|
|
297
|
+
let rest;
|
|
298
|
+
const nm = p.lastIndexOf("/node_modules/");
|
|
299
|
+
if (nm !== -1) {
|
|
300
|
+
const after = p.slice(nm + 14).split("/");
|
|
301
|
+
const n = after[0].startsWith("@") ? 2 : 1;
|
|
302
|
+
pkg = after.slice(0, n).join("/");
|
|
303
|
+
rest = after.slice(n).join("/");
|
|
304
|
+
} else {
|
|
305
|
+
const at = Math.max(p.lastIndexOf("/src/"), p.lastIndexOf("/dist/"));
|
|
306
|
+
if (at === -1) return null;
|
|
307
|
+
pkg = p.slice(p.lastIndexOf("/", at - 1) + 1, at);
|
|
308
|
+
rest = p.slice(at + 1);
|
|
309
|
+
}
|
|
310
|
+
for (const top of [
|
|
311
|
+
"src/",
|
|
312
|
+
"dist/",
|
|
313
|
+
"esm/",
|
|
314
|
+
"build/"
|
|
315
|
+
]) if (rest.startsWith(top)) rest = rest.slice(top.length);
|
|
316
|
+
for (const ext of [
|
|
317
|
+
".mjs",
|
|
318
|
+
".cjs",
|
|
319
|
+
".mts",
|
|
320
|
+
".ts",
|
|
321
|
+
".js"
|
|
322
|
+
]) if (rest.endsWith(ext)) rest = rest.slice(0, -ext.length);
|
|
323
|
+
return pkg && rest ? `${pkg}/${rest}` : null;
|
|
324
|
+
}
|
|
325
|
+
/** Every module the build shipped more than once: one key, two or more ids (a single id is in one
|
|
326
|
+
* chunk only). The heaviest first, copies of 512 bytes or more, at most 50.
|
|
327
|
+
* @internal exported for the tests */
|
|
328
|
+
function duplicate_modules(chunks) {
|
|
329
|
+
const by = /* @__PURE__ */ new Map();
|
|
330
|
+
for (const c of chunks) for (const id of c.ids) {
|
|
331
|
+
const key = module_key(id);
|
|
332
|
+
if (!key) continue;
|
|
333
|
+
const ids = by.get(key) ?? by.set(key, /* @__PURE__ */ new Map()).get(key);
|
|
334
|
+
if (!ids.has(id)) {
|
|
335
|
+
const from = module_origin(id);
|
|
336
|
+
ids.set(id, {
|
|
337
|
+
file: c.file.startsWith("/") ? c.file : "/" + c.file,
|
|
338
|
+
bytes: c.size_of?.(id) ?? 0,
|
|
339
|
+
...from ? { from } : {}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const out = [];
|
|
344
|
+
for (const [name, ids] of by) {
|
|
345
|
+
if (ids.size < 2) continue;
|
|
346
|
+
const copies = [...ids.values()].filter((c) => c.bytes >= 512);
|
|
347
|
+
if (copies.length >= 2) out.push({
|
|
348
|
+
name,
|
|
349
|
+
copies
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
const weight = (d) => d.copies.reduce((s, c) => s + c.bytes, 0);
|
|
353
|
+
return out.sort((a, b) => weight(b) - weight(a)).slice(0, 50);
|
|
354
|
+
}
|
|
355
|
+
/** A chunk's modules as readable names (the same names `contents` uses) with their rendered bytes,
|
|
356
|
+
* heaviest first, the five heaviest; a package's modules summed under its name.
|
|
357
|
+
* @internal exported for the tests */
|
|
358
|
+
function chunk_module_bytes(module_ids, size_of) {
|
|
359
|
+
const by = /* @__PURE__ */ new Map();
|
|
360
|
+
let total = 0;
|
|
361
|
+
for (const raw of module_ids) {
|
|
362
|
+
if (!raw || raw.startsWith("\0") || raw.startsWith("virtual:")) continue;
|
|
363
|
+
const name = summarize_chunk_contents([raw], 1, 1)[0];
|
|
364
|
+
if (!name) continue;
|
|
365
|
+
const bytes = size_of(raw) || 0;
|
|
366
|
+
total += bytes;
|
|
367
|
+
by.set(name, (by.get(name) ?? 0) + bytes);
|
|
368
|
+
}
|
|
369
|
+
const top = [...by].filter(([, bytes]) => bytes > 0).sort((a, b) => b[1] - a[1]).slice(0, 5).map(([name, bytes]) => ({
|
|
370
|
+
name,
|
|
371
|
+
bytes
|
|
372
|
+
}));
|
|
373
|
+
return {
|
|
374
|
+
total,
|
|
375
|
+
top
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
const PKG_IN_PATH_RE = /\/node_modules\/((?:@[^/]+\/)?[^/]+)/;
|
|
379
|
+
const SRC_IN_PATH_RE = /\/src\/(.+)$/;
|
|
380
|
+
/**
|
|
381
|
+
* A chunk's source modules as a short readable list: the app's own files first (relative to
|
|
382
|
+
* `src/`), then the packages, the framework runtimes named plainly. Capped; the tail is "+N more".
|
|
383
|
+
* @internal exported for the tests
|
|
384
|
+
*/
|
|
385
|
+
function summarize_chunk_contents(module_ids, max_files = 6, max_pkgs = 5, size_of) {
|
|
386
|
+
const files = [];
|
|
387
|
+
const pkgs = [];
|
|
388
|
+
const bytes = /* @__PURE__ */ new Map();
|
|
389
|
+
const add = (list, v, raw) => {
|
|
390
|
+
if (!list.includes(v)) list.push(v);
|
|
391
|
+
if (size_of) bytes.set(v, (bytes.get(v) ?? 0) + (size_of(raw) || 0));
|
|
392
|
+
};
|
|
393
|
+
const ordered = (list) => size_of ? [...list].sort((a, b) => (bytes.get(b) ?? 0) - (bytes.get(a) ?? 0)) : list;
|
|
394
|
+
for (const raw of module_ids) {
|
|
395
|
+
if (!raw || raw.startsWith("\0") || raw.startsWith("virtual:")) continue;
|
|
396
|
+
const id = raw.split("\\").join("/").split("?")[0];
|
|
397
|
+
const nm = id.lastIndexOf("/node_modules/");
|
|
398
|
+
if (nm !== -1) {
|
|
399
|
+
const pkg = PKG_IN_PATH_RE.exec(id.slice(nm))?.[1];
|
|
400
|
+
if (pkg === "svelte") add(pkgs, "svelte runtime", raw);
|
|
401
|
+
else if (pkg && OWN_PACKAGE_NAMES.includes(pkg)) add(pkgs, "ogygia runtime", raw);
|
|
402
|
+
else if (pkg) add(pkgs, pkg, raw);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (OWN_FILE_RE.test(id)) add(pkgs, "ogygia runtime", raw);
|
|
406
|
+
else {
|
|
407
|
+
const rel = SRC_IN_PATH_RE.exec(id);
|
|
408
|
+
add(files, rel ? "src/" + rel[1] : id.split("/").slice(-2).join("/"), raw);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
const out = [...ordered(files).slice(0, max_files), ...ordered(pkgs).slice(0, max_pkgs)];
|
|
412
|
+
const more = files.length - Math.min(files.length, max_files) + (pkgs.length - Math.min(pkgs.length, max_pkgs));
|
|
413
|
+
if (more > 0) out.push(`+${more} more`);
|
|
414
|
+
return out;
|
|
415
|
+
}
|
|
416
|
+
const OWN_OR_DEP_RE = new RegExp(`/node_modules/|${OWN_FILE_RE.source}`);
|
|
417
|
+
/** the site kit's components (ogygia's content/site): an app's own islands in all but location */
|
|
418
|
+
const SITE_KIT_RE = /\/ogygia\/(?:src|dist)\/content\//;
|
|
419
|
+
const HANDLER_RE = /\son[a-z]+\s*=\s*\{|\son:[a-z]+/g;
|
|
420
|
+
const STATE_RE = /\$state(?:\.raw)?\s*\(/g;
|
|
421
|
+
const EFFECT_RE = /\$effect(?:\.pre)?\s*\(/g;
|
|
422
|
+
const BIND_RE = /\sbind:[a-zA-Z]/g;
|
|
423
|
+
const ACTION_RE = /\suse:[a-zA-Z]/g;
|
|
424
|
+
const AWAIT_RE = /\{\s*(?:#\s*)?await\s/g;
|
|
425
|
+
const SHARED_RE = /\bgetContext\s*(?:<[^>]*>\s*)?\(|\bfrom\s*['"][^'"]+\.svelte\.(?:js|ts)['"]/g;
|
|
426
|
+
const count = (src, re) => (src.match(re) ?? []).length;
|
|
427
|
+
/** Count a component source's interactivity markers. */
|
|
428
|
+
function interactivity_facts(src) {
|
|
429
|
+
return {
|
|
430
|
+
handlers: count(src, HANDLER_RE),
|
|
431
|
+
state: count(src, STATE_RE),
|
|
432
|
+
effects: count(src, EFFECT_RE),
|
|
433
|
+
binds: count(src, BIND_RE),
|
|
434
|
+
actions: count(src, ACTION_RE),
|
|
435
|
+
awaits: count(src, AWAIT_RE),
|
|
436
|
+
shared: count(src, SHARED_RE),
|
|
437
|
+
files: 1
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
function merge_facts(a, b) {
|
|
441
|
+
if (!a) return { ...b };
|
|
442
|
+
return {
|
|
443
|
+
handlers: a.handlers + b.handlers,
|
|
444
|
+
state: a.state + b.state,
|
|
445
|
+
effects: a.effects + b.effects,
|
|
446
|
+
binds: a.binds + b.binds,
|
|
447
|
+
actions: a.actions + b.actions,
|
|
448
|
+
awaits: (a.awaits ?? 0) + (b.awaits ?? 0),
|
|
449
|
+
shared: (a.shared ?? 0) + (b.shared ?? 0),
|
|
450
|
+
files: a.files + b.files
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
/** Stable handoff path under Kit's `outDir`: client `generateBundle` writes; SSR reads at render
|
|
454
|
+
* (Kit is SSR-first). */
|
|
455
|
+
function islandDepsHandoffPath(out_dir) {
|
|
456
|
+
return path.join(out_dir, "og-region-deps.json");
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* `virtual:ogygia/island-deps` emitter — the SSR-render-time reader of the deps handoff.
|
|
460
|
+
* Client: unused (modulepreload is SSR HTML). SSR: read the handoff JSON at *render* time — Kit
|
|
461
|
+
* builds the server bundle before the client, so baking at `load()` would always be empty;
|
|
462
|
+
* prerender/live SSR run after client generateBundle. Resolve via import.meta.url walk (not absolute
|
|
463
|
+
* build-machine paths) so adapters find `output/server/og-region-deps.json` next to the server bundle.
|
|
464
|
+
* `out_dir_rel` — Kit's `outDir` relative to the app root (`.svelte-kit` by default) — is the cwd
|
|
465
|
+
* fallback for adapter-node / preview run from the app root.
|
|
466
|
+
*/
|
|
467
|
+
/** A CSS text that would close its own `<style>` cannot be inlined — link it instead. */
|
|
468
|
+
const STYLE_CLOSE_RE = /<\/style/i;
|
|
469
|
+
/**
|
|
470
|
+
* INLINE REGION CSS. For every region CSS asset (`hrefs`: the union of the handoff's `css` and
|
|
471
|
+
* `content_css` lists) whose bytes are under `threshold` — Kit's `inlineStyleThreshold`, the same
|
|
472
|
+
* number Kit inlines its own route sheets under — keep the asset's text, keyed by its public href.
|
|
473
|
+
* The render then emits `<style data-ogygia-region-css="href">` in place of a blocking `<link>`:
|
|
474
|
+
* a page carrying twenty-five small island sheets (42 KB on a measured home page, twenty of them
|
|
475
|
+
* under 3 KB) stops paying twenty-five requests before first paint. `0` = keep nothing (Kit's
|
|
476
|
+
* default: never inline). Above the threshold, or not an emitted asset, → not in the map → linked.
|
|
477
|
+
*
|
|
478
|
+
* @internal Exported for unit tests.
|
|
479
|
+
*/
|
|
480
|
+
function collect_inline_css(bundle, hrefs, threshold) {
|
|
481
|
+
const out = {};
|
|
482
|
+
if (!(threshold > 0)) return out;
|
|
483
|
+
const by_href = /* @__PURE__ */ new Map();
|
|
484
|
+
for (const key in bundle) {
|
|
485
|
+
const item = bundle[key];
|
|
486
|
+
if (item.type !== "asset") continue;
|
|
487
|
+
const file = item.fileName || key;
|
|
488
|
+
by_href.set(file.startsWith("/") ? file : "/" + file, item);
|
|
489
|
+
}
|
|
490
|
+
for (const href of hrefs) {
|
|
491
|
+
if (href in out) continue;
|
|
492
|
+
const asset = by_href.get(href);
|
|
493
|
+
if (!asset || asset.source == null) continue;
|
|
494
|
+
const text = typeof asset.source === "string" ? asset.source : new TextDecoder().decode(asset.source);
|
|
495
|
+
if (text.length >= threshold) continue;
|
|
496
|
+
if (STYLE_CLOSE_RE.test(text)) continue;
|
|
497
|
+
out[href] = text;
|
|
498
|
+
}
|
|
499
|
+
return out;
|
|
500
|
+
}
|
|
501
|
+
function island_deps_module(ssr, is_dev, out_dir_rel = ".svelte-kit") {
|
|
502
|
+
if (!ssr) return `export function islandDeps(_entry) { return []; }\nexport function islandCss(_entry) { return []; }\nexport function islandCssInline(_href) { return null; }\nexport function contentCss(_id) { return []; }\nexport function islandReadsPage(_entry) { return false; }\nexport function islandPageKeys(_entry) { return null; }\nexport function islandPageWhy(_entry) { return null; }\nexport function islandRemotes(_entry) { return null; }\nexport function islandInteractivity(_entry) { return null; }\nexport function islandHazards(_entry) { return null; }\nexport function chunkContents(_href) { return null; }\nexport function chunkHeavy(_href) { return null; }\nexport function chunkBarrels(_href) { return null; }\nexport function chunkDuplicates() { return null; }\nexport function fnManifest() { return null; }\nexport function entryLocation(_identity) { return null; }`;
|
|
503
|
+
if (is_dev) return `export function islandDeps(_entry) { return []; }\nexport function islandCss(entry) { return entry ? [entry] : []; }\nexport function islandCssInline(_href) { return null; }\nexport function contentCss(_id) { return []; }\nexport function islandReadsPage(_entry) { return true; }\nexport function islandPageKeys(_entry) { return null; }\nexport function islandPageWhy(_entry) { return null; }\nexport function islandRemotes(_entry) { return null; }\nexport function islandInteractivity(_entry) { return null; }\nexport function islandHazards(_entry) { return null; }\nexport function chunkContents(_href) { return null; }\nexport function chunkHeavy(_href) { return null; }\nexport function chunkBarrels(_href) { return null; }\nexport function chunkDuplicates() { return null; }\nexport function fnManifest() { return null; }\nexport function entryLocation(_identity) { return null; }`;
|
|
504
|
+
return `import fs from 'node:fs';
|
|
505
|
+
import path from 'node:path';
|
|
506
|
+
import { fileURLToPath } from 'node:url';
|
|
507
|
+
const __OG_INLINE = '__OGYGIA_ISLAND_DEPS_INLINE__';
|
|
508
|
+
let cache = null;
|
|
509
|
+
try { if (__OG_INLINE.charCodeAt(0) === 123) cache = JSON.parse(__OG_INLINE); } catch {}
|
|
510
|
+
function candidates() {
|
|
511
|
+
const out = [];
|
|
512
|
+
try {
|
|
513
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
514
|
+
for (let i = 0; i < 8; i++) {
|
|
515
|
+
out.push(path.join(dir, 'og-region-deps.json'));
|
|
516
|
+
const parent = path.dirname(dir);
|
|
517
|
+
if (parent === dir) break;
|
|
518
|
+
dir = parent;
|
|
519
|
+
}
|
|
520
|
+
} catch {}
|
|
521
|
+
if (typeof process !== 'undefined' && process.cwd) {
|
|
522
|
+
const cwd = process.cwd();
|
|
523
|
+
out.push(path.join(cwd, ${JSON.stringify(out_dir_rel)}, 'og-region-deps.json'));\n out.push(path.join(cwd, ${JSON.stringify(out_dir_rel)}, 'output', 'server', 'og-region-deps.json'));\n }\n return out;\n}\nfunction load() {\n if (cache) return cache;\n for (const p of candidates()) {\n try { cache = JSON.parse(fs.readFileSync(p, 'utf8')); return cache; } catch {}\n }\n cache = {};\n return cache;\n}\n// map (pre-css build) degrades gracefully: js falls back to the root, css to [].\nfunction pick(kind, entry) {\n const all = load();\n const map = all && typeof all[kind] === 'object' ? all[kind] : kind === 'js' ? all : null;\n const list = map ? map[entry] : null;\n return Array.isArray(list) ? list : [];\n}\nexport function islandDeps(entry) {\n return entry ? pick('js', entry) : [];\n}\nexport function islandCss(entry) {\n return entry ? pick('css', entry) : [];\n}\nexport function islandCssInline(href) {\n const all = load();\n const map = all && typeof all.css_inline === 'object' && all.css_inline ? all.css_inline : null;\n if (!map || !href) return null;\n const v = map[href];\n return typeof v === 'string' ? v : null;\n}\nexport function contentCss(id) {\n return id ? pick('content_css', id) : [];\n}\nexport function islandReadsPage(entry) {\n const all = load();\n const map = all && typeof all.page === 'object' && all.page ? all.page : null;\n if (!map || !entry) return true;\n const v = map[entry];\n return v === undefined ? true : !!v;\n}\nexport function islandPageKeys(entry) {\n const all = load();\n const map = all && typeof all.page_keys === 'object' && all.page_keys ? all.page_keys : null;\n if (!map || !entry) return null;\n const v = map[entry];\n return Array.isArray(v) ? v : null;\n}\nexport function islandPageWhy(entry) {\n const all = load();\n const map = all && typeof all.page_why === 'object' && all.page_why ? all.page_why : null;\n if (!map || !entry) return null;\n const v = map[entry];\n return Array.isArray(v) ? v : null;\n}\nexport function islandRemotes(entry) {\n const all = load();\n const map = all && typeof all.remotes === 'object' && all.remotes ? all.remotes : null;\n if (!map || !entry) return null;\n const v = map[entry];\n return Array.isArray(v) ? v : null;\n}\nexport function islandInteractivity(entry) {\n const all = load();\n const map = all && typeof all.interactivity === 'object' && all.interactivity ? all.interactivity : null;\n if (!map || !entry) return null;\n const v = map[entry];\n return v && typeof v === 'object' ? v : null;\n}\nexport function chunkContents(href) {\n const all = load();\n const map = all && typeof all.contents === 'object' && all.contents ? all.contents : null;\n if (!map || !href) return null;\n const key = href.startsWith('/') ? href : '/' + href.replace(/^\\.\\//, '');\n const v = map[key] ?? map[href];\n return Array.isArray(v) ? v : null;\n}\nexport function chunkHeavy(href) {\n const all = load();\n const map = all && typeof all.heavy === 'object' && all.heavy ? all.heavy : null;\n if (!map || !href) return null;\n const key = href.startsWith('/') ? href : '/' + href.replace(/^\\.\\//, '');\n const v = map[key] ?? map[href];\n return v && typeof v === 'object' && Array.isArray(v.top) ? v : null;\n}\nexport function chunkDuplicates() {\n const all = load();\n const v = all && Array.isArray(all.dupes) ? all.dupes : null;\n return v && v.length ? v : null;\n}\nexport function islandHazards(entry) {\n const all = load();\n const map = all && typeof all.hazards === 'object' && all.hazards ? all.hazards : null;\n if (!map || !entry) return null;\n const v = map[entry];\n return Array.isArray(v) ? v : null;\n}\nexport function chunkBarrels(href) {\n const all = load();\n const map = all && typeof all.barrels === 'object' && all.barrels ? all.barrels : null;\n if (!map || !href) return null;\n const key = href.startsWith('/') ? href : '/' + href.replace(/^\\.\\//, '');\n const v = map[key] ?? map[href];\n return Array.isArray(v) ? v : null;\n}\nexport function fnManifest() {\n const m = load().fn_manifest;\n return m && typeof m === 'object' && Object.keys(m).length ? m : null;\n}\nexport function entryLocation(identity) {\n const m = load().entries;\n const v = m && typeof m === 'object' && identity ? m[identity] : null;\n return typeof v === 'string' ? v : null;\n}\n`;
|
|
524
|
+
}
|
|
525
|
+
export { chunk_module_bytes, collectIslandDepModulepreloads, collect_inline_css, duplicate_modules, interactivity_facts, islandDepsHandoffPath, island_deps_module, kit_remote_hash, module_key, module_origin, remote_hash_of, summarize_chunk_contents };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/compiler/link/manifest.ts
|
|
2
|
+
/**
|
|
3
|
+
* `virtual:ogygia/manifest` emitter — a legacy stub. Hydrate modules are loaded via
|
|
4
|
+
* `<ogygia-region entry>` URLs, not this map; only the `dev` flag is still read.
|
|
5
|
+
*/
|
|
6
|
+
function manifest_module(is_dev) {
|
|
7
|
+
return `export const dev = ${is_dev ? "true" : "false"};\nexport const regions = {};`;
|
|
8
|
+
}
|
|
9
|
+
export { manifest_module };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AstNode } from "../parse/oxc.js";
|
|
2
|
+
type Node = AstNode;
|
|
3
|
+
export type PageKeys = ReadonlySet<string> | "all";
|
|
4
|
+
/** `'all'` with its reason: which construct, at which line. */
|
|
5
|
+
export type AllReason = {
|
|
6
|
+
why: string;
|
|
7
|
+
line: number | null;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A call that hands the page to an IMPORTED helper: `getParams(page)`. The module alone cannot say
|
|
11
|
+
* what the helper reads; the build resolves the specifier, summarizes the helper's export
|
|
12
|
+
* ({@link summarize_export}) and folds the answer in — one level deep. A CMS app passed the page
|
|
13
|
+
* to one `url`-reading helper from 149 modules; following the call pins all of them.
|
|
14
|
+
*/
|
|
15
|
+
export type PendingCall = {
|
|
16
|
+
specifier: string;
|
|
17
|
+
imported: string;
|
|
18
|
+
arg: number;
|
|
19
|
+
line: number | null;
|
|
20
|
+
};
|
|
21
|
+
export type PageKeysAnswer = {
|
|
22
|
+
keys: PageKeys | null;
|
|
23
|
+
reason: AllReason | null;
|
|
24
|
+
pending: PendingCall[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The top-level `page.data` keys a module reads, or `'all'` when a read cannot be pinned to a
|
|
28
|
+
* literal key, or `null` when the module never imports the page (nothing to ship for it).
|
|
29
|
+
* `kind` picks the parser: `'svelte'` for a component source, `'script'` for `.ts` / `.js`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function page_data_keys(code: string, id: string, kind: "svelte" | "script"): PageKeys | null;
|
|
32
|
+
/** The same answer with the reason an `'all'` was given (for the build report). */
|
|
33
|
+
export declare function page_data_keys_answer(code: string, id: string, kind: "svelte" | "script"): PageKeysAnswer;
|
|
34
|
+
/**
|
|
35
|
+
* What an exported helper reads of a page handed to it as its `arg`-th parameter — the bundle-time
|
|
36
|
+
* half of following `helper(page)`. `'all'` when the export is not a plain function (a re-export,
|
|
37
|
+
* a class, a variable the analysis cannot follow), when the parameter is not a plain name, or when
|
|
38
|
+
* the helper itself hands the page on (one level only).
|
|
39
|
+
*/
|
|
40
|
+
export type ExportSummary = PageKeys | {
|
|
41
|
+
follow: string[];
|
|
42
|
+
imported: string;
|
|
43
|
+
};
|
|
44
|
+
export declare function summarize_export(code: string, id: string, kind: "svelte" | "script", name: string, arg: number): ExportSummary;
|
|
45
|
+
/** Union two answers: `'all'` absorbs everything, `null` is the identity. */
|
|
46
|
+
export declare function merge_page_keys(a: PageKeys | null, b: PageKeys | null): PageKeys | null;
|
|
47
|
+
/** Does this module even mention a page-store specifier? (the transform's pre-filter) */
|
|
48
|
+
export declare function mentions_page_store(code: string): boolean;
|
|
49
|
+
export declare function parse_roots(code: string, id: string, kind: "svelte" | "script"): Node[] | null;
|
|
50
|
+
export type PendingResolver = (specifier: string, importer: string) => Promise<{
|
|
51
|
+
id: string;
|
|
52
|
+
} | null | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* For every module with pending `helper(page)` calls: resolve each helper, summarize its export,
|
|
55
|
+
* fold the answer into the module's keys (`'all'` with a reason when the helper cannot be
|
|
56
|
+
* summarized). Runs once per build, before the closure union. `read` and `resolve` are the
|
|
57
|
+
* build's (fs + the bundler's resolver), threaded in so this stays testable.
|
|
58
|
+
*/
|
|
59
|
+
export declare function follow_pending_page_calls(program: {
|
|
60
|
+
page_keys: Map<string, PageKeys>;
|
|
61
|
+
page_key_reasons: Map<string, AllReason>;
|
|
62
|
+
page_pending: Map<string, PendingCall[]>;
|
|
63
|
+
}, resolve: PendingResolver, read?: (file: string) => string | null): Promise<void>;
|
|
64
|
+
export {};
|