@timber-js/app 0.2.0-alpha.185 → 0.2.0-alpha.187
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/dist/_chunks/{actions-O_LsyCE4.js → actions-35jnMdeJ.js} +4 -3
- package/dist/_chunks/{actions-O_LsyCE4.js.map → actions-35jnMdeJ.js.map} +1 -1
- package/dist/_chunks/als-registry-C6kcfprT.js +41 -0
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js +26 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -0
- package/dist/_chunks/base-path-DaQrzbez.js +80 -0
- package/dist/_chunks/base-path-DaQrzbez.js.map +1 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js +86 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js +369 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +1 -0
- package/dist/_chunks/{cache-api-B-lhk9p4.js → cache-api-DjNrIWRR.js} +8 -14
- package/dist/_chunks/cache-api-DjNrIWRR.js.map +1 -0
- package/dist/_chunks/cli-check-CpmN7Nh-.js +256 -0
- package/dist/_chunks/cli-check-CpmN7Nh-.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-CGMp_Psg.js +298 -0
- package/dist/_chunks/cli-schema-sync-CGMp_Psg.js.map +1 -0
- package/dist/_chunks/{cloudflare-CnT5Lr7U.js → cloudflare-CGP6BZKO.js} +92 -14
- package/dist/_chunks/{cloudflare-CnT5Lr7U.js.map → cloudflare-CGP6BZKO.js.map} +1 -1
- package/dist/_chunks/convention-lint-kXsgc_-7.js +784 -0
- package/dist/_chunks/convention-lint-kXsgc_-7.js.map +1 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js +353 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -0
- package/dist/_chunks/{fast-hash-D6hIVt1Y.js → fast-hash-C-tVYrLb.js} +6 -1
- package/dist/_chunks/fast-hash-C-tVYrLb.js.map +1 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js +454 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js.map +1 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js +208 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js.map +1 -0
- package/dist/_chunks/{logger-AWfuX-KJ.js → logger-D8xJZXIN.js} +34 -51
- package/dist/_chunks/logger-D8xJZXIN.js.map +1 -0
- package/dist/_chunks/mdx-file-C005ay-P.js +25 -0
- package/dist/_chunks/mdx-file-C005ay-P.js.map +1 -0
- package/dist/_chunks/{plugin-context---kTF5v8.js → plugin-context-rCinWLiE.js} +8 -2
- package/dist/_chunks/plugin-context-rCinWLiE.js.map +1 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js +14 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js.map +1 -0
- package/dist/_chunks/{resolve-schema-Dz3fcFUo.js → resolve-schema-5ma5pp1b.js} +2 -2
- package/dist/_chunks/{resolve-schema-Dz3fcFUo.js.map → resolve-schema-5ma5pp1b.js.map} +1 -1
- package/dist/_chunks/{router-ref-CtmF-aPv.js → router-ref-DuYuV_0Q.js} +2 -2
- package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js +243 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js.map +1 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js +40 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js.map +1 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js +46 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js.map +1 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js +48 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js.map +1 -0
- package/dist/_chunks/scanner-C8b0Gcw3.js +1564 -0
- package/dist/_chunks/scanner-C8b0Gcw3.js.map +1 -0
- package/dist/_chunks/schema-bridge-Cc2Gngu1.js +199 -0
- package/dist/_chunks/schema-bridge-Cc2Gngu1.js.map +1 -0
- package/dist/_chunks/{segment-classify-Byy425ng.js → segment-classify-C539Pa2O.js} +23 -2
- package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js +97 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js.map +1 -0
- package/dist/_chunks/{canonicalize-DQHyFClh.js → segment-keys-BawYuNFO.js} +61 -2
- package/dist/_chunks/segment-keys-BawYuNFO.js.map +1 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js +76 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -0
- package/dist/_chunks/{ssr-data-BOWsq18U.js → ssr-data-14MXm7Pj.js} +17 -2
- package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -0
- package/dist/_chunks/{use-query-states-DFvWd-EA.js → use-query-states-BbU5Ge1V.js} +74 -26
- package/dist/_chunks/use-query-states-BbU5Ge1V.js.map +1 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js +398 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -0
- package/dist/_chunks/walkers-RzN6AFjr.js +141 -0
- package/dist/_chunks/walkers-RzN6AFjr.js.map +1 -0
- package/dist/adapters/build-output-helper.d.ts +37 -0
- package/dist/adapters/build-output-helper.d.ts.map +1 -1
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/compress-module.d.ts +12 -0
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/fs-identity.d.ts +64 -0
- package/dist/adapters/fs-identity.d.ts.map +1 -0
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +56 -5
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +57 -1
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/adapters/types.d.ts +13 -1
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cache/fast-hash.d.ts +5 -0
- package/dist/cache/fast-hash.d.ts.map +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cdn/cloudflare-purge.js +30 -0
- package/dist/cdn/cloudflare-purge.js.map +1 -0
- package/dist/cdn/fastly-purge.js +33 -0
- package/dist/cdn/fastly-purge.js.map +1 -0
- package/dist/cdn/index.js +94 -0
- package/dist/cdn/index.js.map +1 -0
- package/dist/cdn/workers-cache-purge.js +35 -0
- package/dist/cdn/workers-cache-purge.js.map +1 -0
- package/dist/cli-check.d.ts +153 -0
- package/dist/cli-check.d.ts.map +1 -0
- package/dist/cli.d.ts +34 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +46 -21
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/hydrate.d.ts +20 -9
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/index.d.ts +1 -1
- package/dist/client/browser-entry/index.d.ts.map +1 -1
- package/dist/client/browser-entry/post-hydration.d.ts +4 -1
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -1
- package/dist/client/browser-entry/router-init.d.ts +3 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/browser-entry/rsc-stream.d.ts +8 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -1
- package/dist/client/error-boundary.d.ts +7 -0
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -162
- package/dist/client/history.d.ts +13 -6
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +42 -41
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +4 -3
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +877 -311
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts +1 -7
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-api.d.ts +2 -2
- package/dist/client/navigation-commit.d.ts +87 -0
- package/dist/client/navigation-commit.d.ts.map +1 -0
- package/dist/client/navigation-context.d.ts +37 -20
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +63 -23
- package/dist/client/navigation-root.d.ts.map +1 -1
- package/dist/client/params-context.d.ts +81 -0
- package/dist/client/params-context.d.ts.map +1 -0
- package/dist/client/router-effects.d.ts +129 -0
- package/dist/client/router-effects.d.ts.map +1 -0
- package/dist/client/router-lifecycle.d.ts +55 -0
- package/dist/client/router-lifecycle.d.ts.map +1 -0
- package/dist/client/router-pipeline.d.ts +84 -0
- package/dist/client/router-pipeline.d.ts.map +1 -0
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/router-ref.d.ts.map +1 -1
- package/dist/client/router-skew.d.ts +21 -0
- package/dist/client/router-skew.d.ts.map +1 -0
- package/dist/client/router-types.d.ts +207 -0
- package/dist/client/router-types.d.ts.map +1 -0
- package/dist/client/router.d.ts +1 -182
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +47 -26
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +87 -34
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/ssr-data.d.ts +6 -0
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/stale-client.d.ts +69 -0
- package/dist/client/stale-client.d.ts.map +1 -0
- package/dist/client/state.d.ts +10 -1
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/top-loader.d.ts +2 -1
- package/dist/client/top-loader.d.ts.map +1 -1
- package/dist/client/unload-guard.d.ts +5 -0
- package/dist/client/unload-guard.d.ts.map +1 -1
- package/dist/client/use-cookie.d.ts.map +1 -1
- package/dist/client/use-query-states.d.ts +9 -3
- package/dist/client/use-query-states.d.ts.map +1 -1
- package/dist/client/use-router.d.ts +1 -1
- package/dist/client/use-segment-params.d.ts +18 -8
- package/dist/client/use-segment-params.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.js +5 -5
- package/dist/cookies/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1009 -759
- package/dist/index.js.map +1 -1
- package/dist/params/index.js +1 -1
- package/dist/plugin-context.d.ts +46 -0
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/request-dep/analysis.d.ts +106 -0
- package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
- package/dist/plugins/request-dep/index.d.ts +75 -0
- package/dist/plugins/request-dep/index.d.ts.map +1 -0
- package/dist/plugins/request-dep/origin.d.ts +61 -0
- package/dist/plugins/request-dep/origin.d.ts.map +1 -0
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +160 -8
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-shared.d.ts +3 -44
- package/dist/routing/codegen-shared.d.ts.map +1 -1
- package/dist/routing/codegen-types.d.ts +28 -31
- package/dist/routing/codegen-types.d.ts.map +1 -1
- package/dist/routing/codegen-write.d.ts +51 -0
- package/dist/routing/codegen-write.d.ts.map +1 -0
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/collision-probe.d.ts +104 -0
- package/dist/routing/collision-probe.d.ts.map +1 -0
- package/dist/routing/collision-spaces.d.ts +26 -0
- package/dist/routing/collision-spaces.d.ts.map +1 -0
- package/dist/routing/convention-lint.d.ts +18 -4
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/export-detect.d.ts +16 -0
- package/dist/routing/export-detect.d.ts.map +1 -1
- package/dist/routing/index.js +4 -3
- package/dist/routing/interception.d.ts +235 -6
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/routing/link-codegen.d.ts +19 -4
- package/dist/routing/link-codegen.d.ts.map +1 -1
- package/dist/routing/manifest-codegen.d.ts +1 -7
- package/dist/routing/manifest-codegen.d.ts.map +1 -1
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/segment-classify.d.ts +33 -0
- package/dist/routing/segment-classify.d.ts.map +1 -1
- package/dist/routing/segment-keys.d.ts +95 -0
- package/dist/routing/segment-keys.d.ts.map +1 -0
- package/dist/routing/slot-placement.d.ts +48 -0
- package/dist/routing/slot-placement.d.ts.map +1 -0
- package/dist/routing/types.d.ts +0 -6
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/routing/walkers.d.ts +6 -0
- package/dist/routing/walkers.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts +60 -9
- package/dist/schema-bridge.d.ts.map +1 -1
- package/dist/search-params/define.d.ts +62 -14
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.d.ts +0 -1
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +221 -10
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/parse-total.d.ts +70 -0
- package/dist/search-params/parse-total.d.ts.map +1 -0
- package/dist/search-params/wrappers.d.ts +26 -3
- package/dist/search-params/wrappers.d.ts.map +1 -1
- package/dist/server/access-gate.d.ts +19 -8
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +6 -3
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +18 -1
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/build-manifest.d.ts +13 -1
- package/dist/server/build-manifest.d.ts.map +1 -1
- package/dist/server/chain-url-parts.d.ts +82 -0
- package/dist/server/chain-url-parts.d.ts.map +1 -0
- package/dist/server/children-interception.d.ts +49 -0
- package/dist/server/children-interception.d.ts.map +1 -0
- package/dist/server/compress.d.ts.map +1 -1
- package/dist/server/default-status-page.d.ts +45 -0
- package/dist/server/default-status-page.d.ts.map +1 -0
- package/dist/server/deny-boundary.d.ts +148 -15
- package/dist/server/deny-boundary.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts +15 -4
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +85 -15
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/head-response.d.ts +35 -0
- package/dist/server/head-response.d.ts.map +1 -0
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +3 -1
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +712 -418
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-collector.d.ts +52 -0
- package/dist/server/metadata-collector.d.ts.map +1 -0
- package/dist/server/param-coercion.d.ts +22 -6
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-helpers.d.ts +0 -18
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline-interception.d.ts +59 -9
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +11 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +23 -0
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/publish-params.d.ts +33 -0
- package/dist/server/publish-params.d.ts.map +1 -0
- package/dist/server/request-context.d.ts +48 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts +22 -3
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +13 -0
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-cache-key-guard.d.ts +78 -0
- package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts +15 -3
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +2 -17
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +0 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts +1 -2
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +15 -2
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/skippable-prefix.d.ts +23 -0
- package/dist/server/skippable-prefix.d.ts.map +1 -0
- package/dist/server/slot-interception.d.ts +80 -0
- package/dist/server/slot-interception.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +70 -8
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +17 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts +0 -1
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +24 -13
- package/dist/server/ssr-wrappers.d.ts.map +1 -1
- package/dist/server/state-tree-diff.d.ts +6 -27
- package/dist/server/state-tree-diff.d.ts.map +1 -1
- package/dist/server/static-generator.d.ts +6 -0
- package/dist/server/static-generator.d.ts.map +1 -1
- package/dist/server/static-not-found.d.ts +52 -0
- package/dist/server/static-not-found.d.ts.map +1 -0
- package/dist/server/status-code-resolver.d.ts +8 -1
- package/dist/server/status-code-resolver.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts +28 -36
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/dist/server/types.d.ts +12 -7
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils/element-type.d.ts +40 -0
- package/dist/server/utils/element-type.d.ts.map +1 -0
- package/dist/shared/als-slots.d.ts +41 -0
- package/dist/shared/als-slots.d.ts.map +1 -0
- package/dist/shared/base-path.d.ts +56 -0
- package/dist/shared/base-path.d.ts.map +1 -0
- package/dist/shared/param-value.d.ts +80 -0
- package/dist/shared/param-value.d.ts.map +1 -0
- package/dist/shared/payload-root.d.ts +108 -0
- package/dist/shared/payload-root.d.ts.map +1 -0
- package/dist/shared/rsc-cache-key.d.ts +163 -0
- package/dist/shared/rsc-cache-key.d.ts.map +1 -0
- package/dist/shared/rsc-error-envelope.d.ts +25 -0
- package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
- package/dist/shared/rsc-manifest.d.ts +28 -0
- package/dist/shared/rsc-manifest.d.ts.map +1 -0
- package/dist/shared/rsc-media-type.d.ts +40 -0
- package/dist/shared/rsc-media-type.d.ts.map +1 -0
- package/dist/shared/rsc-payload-path.d.ts +42 -0
- package/dist/shared/rsc-payload-path.d.ts.map +1 -0
- package/dist/shared/segment-info.d.ts +59 -0
- package/dist/shared/segment-info.d.ts.map +1 -0
- package/dist/shared/slot-params.d.ts +51 -0
- package/dist/shared/slot-params.d.ts.map +1 -0
- package/dist/shared/static-platform-files.d.ts +71 -0
- package/dist/shared/static-platform-files.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +1 -1
- package/docs/api/31-api-client.mdx +4 -2
- package/docs/api/33-api-search-params.mdx +38 -16
- package/docs/api/35-api-typescript.mdx +3 -3
- package/docs/api/36-cli.mdx +34 -7
- package/docs/learn/00-introduction.mdx +1 -1
- package/docs/learn/02-pages-and-layouts.mdx +2 -2
- package/docs/learn/05-typed-params.mdx +8 -8
- package/docs/learn/07-typed-routes.mdx +12 -7
- package/docs/learn/11-error-handling.mdx +18 -0
- package/docs/learn/12-client-navigation.mdx +2 -2
- package/docs/learn/14-deploying.mdx +23 -0
- package/docs/more/01-advanced-routing.mdx +173 -3
- package/docs/more/03-coming-from-nextjs.mdx +2 -2
- package/docs/more/04-metadata-and-fonts.mdx +1 -1
- package/docs/more/50-ai-agent-instructions.mdx +6 -4
- package/package.json +9 -6
- package/src/adapters/build-output-helper.ts +116 -3
- package/src/adapters/cloudflare.ts +90 -12
- package/src/adapters/compress-module.ts +79 -1
- package/src/adapters/fs-identity.ts +156 -0
- package/src/adapters/nitro.ts +6 -6
- package/src/adapters/shared.ts +196 -21
- package/src/adapters/types.ts +13 -1
- package/src/cache/fast-hash.ts +5 -0
- package/src/cli-check.ts +458 -0
- package/src/cli.ts +59 -24
- package/src/client/browser-entry/action-dispatch.ts +11 -5
- package/src/client/browser-entry/hydrate.ts +40 -29
- package/src/client/browser-entry/index.ts +15 -6
- package/src/client/browser-entry/post-hydration.ts +10 -9
- package/src/client/browser-entry/router-init.ts +104 -48
- package/src/client/browser-entry/rsc-stream.ts +11 -2
- package/src/client/error-boundary.tsx +85 -16
- package/src/client/history.ts +13 -6
- package/src/client/index.ts +14 -3
- package/src/client/internal.ts +4 -3
- package/src/client/link.tsx +120 -72
- package/src/client/navigation-api.ts +3 -3
- package/src/client/navigation-commit.ts +197 -0
- package/src/client/navigation-context.ts +40 -67
- package/src/client/navigation-root.tsx +326 -101
- package/src/client/params-context.ts +192 -0
- package/src/client/router-effects.ts +231 -0
- package/src/client/router-lifecycle.ts +288 -0
- package/src/client/router-pipeline.ts +393 -0
- package/src/client/router-ref.ts +1 -1
- package/src/client/router-skew.ts +30 -0
- package/src/client/router-types.ts +230 -0
- package/src/client/router.ts +243 -707
- package/src/client/rsc-fetch.ts +183 -106
- package/src/client/segment-cache.ts +129 -44
- package/src/client/ssr-data.ts +6 -0
- package/src/client/stale-client.ts +191 -0
- package/src/client/state.ts +14 -1
- package/src/client/top-loader.tsx +2 -1
- package/src/client/unload-guard.ts +34 -2
- package/src/client/use-cookie.ts +9 -2
- package/src/client/use-query-states.ts +102 -39
- package/src/client/use-router.ts +1 -1
- package/src/client/use-segment-params.ts +41 -18
- package/src/cookies/define-cookie.ts +6 -1
- package/src/index.ts +25 -4
- package/src/plugin-context.ts +58 -0
- package/src/plugins/adapter-build.ts +4 -0
- package/src/plugins/build-manifest.ts +34 -13
- package/src/plugins/entries.ts +4 -0
- package/src/plugins/fonts.ts +11 -8
- package/src/plugins/request-dep/analysis.ts +447 -0
- package/src/plugins/request-dep/index.ts +376 -0
- package/src/plugins/request-dep/origin.ts +310 -0
- package/src/plugins/routing.ts +97 -102
- package/src/plugins/shims.ts +0 -1
- package/src/plugins/static-build.ts +391 -95
- package/src/routing/codegen-shared.ts +3 -79
- package/src/routing/codegen-types.ts +28 -31
- package/src/routing/codegen-write.ts +139 -0
- package/src/routing/codegen.ts +86 -172
- package/src/routing/collision-probe.ts +438 -0
- package/src/routing/collision-spaces.ts +281 -0
- package/src/routing/convention-lint.ts +139 -40
- package/src/routing/export-detect.ts +151 -7
- package/src/routing/interception.ts +896 -50
- package/src/routing/link-codegen.ts +32 -65
- package/src/routing/manifest-codegen.ts +6 -62
- package/src/routing/scanner.ts +117 -92
- package/src/routing/segment-classify.ts +57 -0
- package/src/routing/segment-keys.ts +146 -0
- package/src/routing/slot-placement.ts +97 -0
- package/src/routing/types.ts +0 -6
- package/src/routing/walkers.ts +8 -0
- package/src/schema-bridge.ts +180 -58
- package/src/search-params/define.ts +108 -66
- package/src/search-params/index.ts +0 -1
- package/src/search-params/parse-total.ts +78 -0
- package/src/search-params/wrappers.ts +60 -11
- package/src/server/access-gate.tsx +60 -40
- package/src/server/action-handler.ts +4 -5
- package/src/server/actions.ts +6 -3
- package/src/server/als-registry.ts +18 -1
- package/src/server/build-manifest.ts +14 -1
- package/src/server/chain-url-parts.ts +163 -0
- package/src/server/children-interception.ts +115 -0
- package/src/server/compress.ts +9 -1
- package/src/server/default-status-page.ts +127 -0
- package/src/server/deny-boundary.ts +269 -41
- package/src/server/deny-renderer.ts +111 -39
- package/src/server/error-boundary-wrapper.ts +166 -79
- package/src/server/head-response.ts +54 -0
- package/src/server/index.ts +1 -3
- package/src/server/internal.ts +2 -2
- package/src/server/metadata-collector.ts +115 -0
- package/src/server/param-coercion.ts +51 -69
- package/src/server/pipeline-helpers.ts +2 -47
- package/src/server/pipeline-interception.ts +81 -32
- package/src/server/pipeline-outcome.ts +4 -5
- package/src/server/pipeline-phases.ts +77 -25
- package/src/server/pipeline.ts +57 -10
- package/src/server/prebuilt-runtime.ts +4 -4
- package/src/server/primitives.ts +25 -0
- package/src/server/publish-params.ts +42 -0
- package/src/server/request-context.ts +97 -18
- package/src/server/route-element-builder.ts +241 -253
- package/src/server/route-handler.ts +8 -8
- package/src/server/route-matcher.ts +21 -9
- package/src/server/rsc-cache-key-guard.ts +164 -0
- package/src/server/rsc-entry/api-handler.ts +6 -8
- package/src/server/rsc-entry/deny-fallback.ts +3 -2
- package/src/server/rsc-entry/error-renderer.ts +94 -35
- package/src/server/rsc-entry/helpers.ts +33 -28
- package/src/server/rsc-entry/index.ts +36 -33
- package/src/server/rsc-entry/render-route.ts +18 -10
- package/src/server/rsc-entry/revalidate-renderer.ts +3 -2
- package/src/server/rsc-entry/rsc-payload.ts +113 -40
- package/src/server/rsc-entry/rsc-stream.ts +29 -5
- package/src/server/rsc-entry/ssr-renderer.ts +38 -22
- package/src/server/skippable-prefix.ts +92 -0
- package/src/server/slot-interception.ts +168 -0
- package/src/server/slot-resolver.ts +263 -158
- package/src/server/ssr-bridge-types.ts +18 -0
- package/src/server/ssr-entry.ts +20 -10
- package/src/server/ssr-wrappers.tsx +33 -32
- package/src/server/state-tree-diff.ts +14 -55
- package/src/server/static-generator.ts +68 -29
- package/src/server/static-not-found.ts +134 -0
- package/src/server/status-code-resolver.ts +28 -11
- package/src/server/tree-builder.ts +35 -218
- package/src/server/types.ts +12 -7
- package/src/server/utils/element-type.ts +72 -0
- package/src/shared/als-slots.ts +72 -0
- package/src/shared/base-path.ts +80 -0
- package/src/shared/param-value.ts +244 -0
- package/src/shared/payload-root.ts +151 -0
- package/src/shared/rsc-cache-key.ts +269 -0
- package/src/shared/rsc-error-envelope.ts +31 -0
- package/src/shared/rsc-manifest.ts +29 -0
- package/src/shared/rsc-media-type.ts +43 -0
- package/src/shared/rsc-payload-path.ts +45 -0
- package/src/shared/segment-info.ts +60 -0
- package/src/shared/slot-params.ts +111 -0
- package/src/shared/static-platform-files.ts +75 -0
- package/dist/_chunks/build-output-helper-DOGYFb_X.js +0 -196
- package/dist/_chunks/build-output-helper-DOGYFb_X.js.map +0 -1
- package/dist/_chunks/cache-api-B-lhk9p4.js.map +0 -1
- package/dist/_chunks/canonicalize-DQHyFClh.js.map +0 -1
- package/dist/_chunks/cli-schema-sync-BTWEKJXo.js +0 -668
- package/dist/_chunks/cli-schema-sync-BTWEKJXo.js.map +0 -1
- package/dist/_chunks/define-COtkxMRT.js +0 -191
- package/dist/_chunks/define-COtkxMRT.js.map +0 -1
- package/dist/_chunks/define-c4au4I9R.js +0 -82
- package/dist/_chunks/define-c4au4I9R.js.map +0 -1
- package/dist/_chunks/fast-hash-D6hIVt1Y.js.map +0 -1
- package/dist/_chunks/logger-AWfuX-KJ.js.map +0 -1
- package/dist/_chunks/navigation-root-bUDZLw74.js +0 -124
- package/dist/_chunks/navigation-root-bUDZLw74.js.map +0 -1
- package/dist/_chunks/plugin-context---kTF5v8.js.map +0 -1
- package/dist/_chunks/registry-DbJPKoBp.js +0 -20
- package/dist/_chunks/registry-DbJPKoBp.js.map +0 -1
- package/dist/_chunks/router-ref-CtmF-aPv.js.map +0 -1
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js +0 -119
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js.map +0 -1
- package/dist/_chunks/segment-classify-Byy425ng.js.map +0 -1
- package/dist/_chunks/segment-context-ZDnXDkbz.js +0 -34
- package/dist/_chunks/segment-context-ZDnXDkbz.js.map +0 -1
- package/dist/_chunks/ssr-data-BOWsq18U.js.map +0 -1
- package/dist/_chunks/use-query-states-DFvWd-EA.js.map +0 -1
- package/dist/_chunks/use-segment-params-D1CzlgBo.js +0 -151
- package/dist/_chunks/use-segment-params-D1CzlgBo.js.map +0 -1
- package/dist/_chunks/walkers-_6zKFlch.js +0 -1002
- package/dist/_chunks/walkers-_6zKFlch.js.map +0 -1
- package/dist/client/error-boundary.js.map +0 -1
- package/dist/plugins/request-dep.d.ts +0 -32
- package/dist/plugins/request-dep.d.ts.map +0 -1
- package/dist/search-params/registry.d.ts +0 -20
- package/dist/search-params/registry.d.ts.map +0 -1
- package/dist/segment-params/define.d.ts +0 -89
- package/dist/segment-params/define.d.ts.map +0 -1
- package/dist/segment-params/index.d.ts +0 -3
- package/dist/segment-params/index.d.ts.map +0 -1
- package/dist/segment-params/index.js +0 -2
- package/src/plugins/request-dep.ts +0 -499
- package/src/search-params/registry.ts +0 -31
- package/src/segment-params/define.ts +0 -249
- package/src/segment-params/index.ts +0 -9
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { rm, stat, writeFile } from "node:fs/promises";
|
|
4
|
+
//#region src/shared/static-platform-files.ts
|
|
5
|
+
/**
|
|
6
|
+
* Platform files the static build is allowed to overwrite in the output.
|
|
7
|
+
*
|
|
8
|
+
* The build merges two trees into the deployed directory — the client bundle
|
|
9
|
+
* (which carries everything the user put in `public/`) and the pre-rendered
|
|
10
|
+
* site. That merge otherwise refuses overlaps, because a silent overwrite
|
|
11
|
+
* leaves one of two artifacts deployed with nothing recording which
|
|
12
|
+
* (TIM-1266).
|
|
13
|
+
*
|
|
14
|
+
* These names are the exception, and only because the pre-rendered copy is
|
|
15
|
+
* *derived from* the one it replaces rather than competing with it:
|
|
16
|
+
* `plugins/static-build.ts` reads `public/_redirects` and writes the
|
|
17
|
+
* generated rules plus the user's, so the winner is a superset of the loser.
|
|
18
|
+
*
|
|
19
|
+
* That holds only for a file the current pass produced, which is why
|
|
20
|
+
* `cleanConditionalArtifacts` deletes a previous build's `_redirects` before
|
|
21
|
+
* generation: written only when a pass finds redirects, it would otherwise
|
|
22
|
+
* survive into a pass that produced nothing and claim an exemption it no
|
|
23
|
+
* longer earns.
|
|
24
|
+
*
|
|
25
|
+
* `_headers` is NOT here. It is not written into the pre-rendered tree at
|
|
26
|
+
* all — adapters generate it directly into the output, folding in the
|
|
27
|
+
* user's copy as they go (TIM-1326).
|
|
28
|
+
*
|
|
29
|
+
* Declared once so the code that performs the merge and the code that
|
|
30
|
+
* produces the merged file cannot disagree about which names are exempt.
|
|
31
|
+
*
|
|
32
|
+
* Isomorphic: no server, client, or build-time imports.
|
|
33
|
+
*/
|
|
34
|
+
/** Platform redirect rules (Cloudflare Pages, Netlify). See TIM-1245/TIM-1249. */
|
|
35
|
+
var REDIRECTS_FILE = "_redirects";
|
|
36
|
+
/** Platform header rules (Cloudflare Pages, Netlify). See TIM-1241/TIM-1326. */
|
|
37
|
+
var HEADERS_FILE = "_headers";
|
|
38
|
+
/**
|
|
39
|
+
* Where a user authors platform files. Stated once because two modules read
|
|
40
|
+
* from here — `plugins/static-build.ts` for `_redirects`, adapters for
|
|
41
|
+
* `_headers` — and they must look in the same place.
|
|
42
|
+
*
|
|
43
|
+
* Both read the **project source**, never the build output. The generated
|
|
44
|
+
* file lands under the same name in the output directory, so a reader aimed
|
|
45
|
+
* there would fold the previous build's generated rules back in and compound
|
|
46
|
+
* them on every rebuild.
|
|
47
|
+
*/
|
|
48
|
+
var USER_PLATFORM_DIR = "public";
|
|
49
|
+
/** Output-relative paths whose pre-rendered copy subsumes the `public/` one. */
|
|
50
|
+
var USER_MERGED_PLATFORM_FILES = [REDIRECTS_FILE];
|
|
51
|
+
/**
|
|
52
|
+
* Output paths the framework writes itself, which no route may claim.
|
|
53
|
+
*
|
|
54
|
+
* These are written outside the per-entry writer — `_redirects` after
|
|
55
|
+
* generation, `_headers` by the adapter after the copy — so the collision
|
|
56
|
+
* tracker never sees them and a route rendering to one of these paths is
|
|
57
|
+
* overwritten with nothing recording it.
|
|
58
|
+
*
|
|
59
|
+
* Reserved rather than tracked, because there is no version of "serve a route
|
|
60
|
+
* at `/_headers`" that works: Cloudflare Pages and Netlify read these two
|
|
61
|
+
* files themselves and never serve them, so the route is unservable however
|
|
62
|
+
* the conflict is resolved.
|
|
63
|
+
*
|
|
64
|
+
* That justification is per-file, not per-mechanism. `.nojekyll` is written
|
|
65
|
+
* the same way and is deliberately NOT here: only the `github-pages` target
|
|
66
|
+
* writes it, and everywhere else `/.nojekyll` is an ordinary servable path,
|
|
67
|
+
* so reserving it globally would refuse a valid Cloudflare site. Its write
|
|
68
|
+
* site skips the write when a file is already there instead — GitHub Pages
|
|
69
|
+
* only cares that the file exists.
|
|
70
|
+
*
|
|
71
|
+
* Same reasoning as the synthetic 404 entry using an internal urlPath so a
|
|
72
|
+
* real `/404` route cannot collide with `404.html`.
|
|
73
|
+
*/
|
|
74
|
+
var RESERVED_OUTPUT_PATHS = [REDIRECTS_FILE, HEADERS_FILE];
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/adapters/fs-identity.ts
|
|
77
|
+
/**
|
|
78
|
+
* What the output filesystem considers "the same file".
|
|
79
|
+
*
|
|
80
|
+
* Two build steps compare paths to decide whether two artifacts would land on
|
|
81
|
+
* one file — the render pass (`plugins/static-build.ts`) and the adapter's
|
|
82
|
+
* tree merge (`build-output-helper.ts`). Both are predicting a filesystem
|
|
83
|
+
* decision, so both ask the filesystem rather than comparing raw strings
|
|
84
|
+
* (TIM-1266).
|
|
85
|
+
*
|
|
86
|
+
* Two properties matter, and they are independent:
|
|
87
|
+
*
|
|
88
|
+
* - **Case folding.** macOS APFS and Windows NTFS fold by default, ext4 does
|
|
89
|
+
* not. Dynamic params `Foo` and `foo` are one file on a Mac and two on
|
|
90
|
+
* Linux CI.
|
|
91
|
+
* - **Unicode normalization.** APFS compares normalization-insensitively, so
|
|
92
|
+
* `café` spelled NFC (`é`) and NFD (`e` + combining acute) address one
|
|
93
|
+
* file. This holds even on a *case-sensitive* APFS volume, which is why it
|
|
94
|
+
* is probed separately rather than inferred from case folding.
|
|
95
|
+
*
|
|
96
|
+
* Probed rather than read off `process.platform`: a case-sensitive volume on
|
|
97
|
+
* macOS and a case-insensitive mount on Linux are both ordinary, and the
|
|
98
|
+
* answer that matters is the one for the directory being written.
|
|
99
|
+
*
|
|
100
|
+
* Leaf module — Node built-ins only. Deliberately not in `adapters/shared.ts`,
|
|
101
|
+
* which `server/asset-headers.ts` re-exports from and which therefore must
|
|
102
|
+
* stay free of `node:fs` for the Workers bundle.
|
|
103
|
+
*/
|
|
104
|
+
/** Every path comparison is exact — the conservative answer when unprobed. */
|
|
105
|
+
var EXACT_FS_IDENTITY = {
|
|
106
|
+
caseInsensitive: false,
|
|
107
|
+
normalizationInsensitive: false,
|
|
108
|
+
stripsTrailingDotsAndSpaces: false
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Probe `dir` by writing one file and asking for it under other spellings.
|
|
112
|
+
*
|
|
113
|
+
* Returns {@link EXACT_FS_IDENTITY} when the probe cannot run. That
|
|
114
|
+
* under-detects, but a directory this cannot write to is one the caller is
|
|
115
|
+
* about to fail on anyway, with a clearer error than a missed collision.
|
|
116
|
+
*/
|
|
117
|
+
async function detectFsIdentity(dir) {
|
|
118
|
+
const name = `.timber-probe-${randomUUID()}-café`;
|
|
119
|
+
const path = join(dir, name);
|
|
120
|
+
try {
|
|
121
|
+
await writeFile(path, "");
|
|
122
|
+
const [caseInsensitive, normalizationInsensitive, stripsTrailingDotsAndSpaces] = await Promise.all([
|
|
123
|
+
exists(join(dir, name.toUpperCase())),
|
|
124
|
+
exists(join(dir, name.normalize("NFD"))),
|
|
125
|
+
exists(join(dir, `${name}.`))
|
|
126
|
+
]);
|
|
127
|
+
return {
|
|
128
|
+
caseInsensitive,
|
|
129
|
+
normalizationInsensitive,
|
|
130
|
+
stripsTrailingDotsAndSpaces
|
|
131
|
+
};
|
|
132
|
+
} catch {
|
|
133
|
+
return EXACT_FS_IDENTITY;
|
|
134
|
+
} finally {
|
|
135
|
+
await rm(path, { force: true }).catch(() => {});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Fold a path to the identity the filesystem compares it under.
|
|
140
|
+
*
|
|
141
|
+
* Normalization first, then case: `toLowerCase()` operates per code point, so
|
|
142
|
+
* folding a decomposed string first would leave the combining marks in a
|
|
143
|
+
* different order than folding a precomposed one.
|
|
144
|
+
*
|
|
145
|
+
* An approximation of the filesystem's own algorithm — APFS and NTFS fold per
|
|
146
|
+
* their own Unicode tables, which `toLowerCase()` matches for everything short
|
|
147
|
+
* of the exotic. It errs toward *finding* a collision, and the cost of a false
|
|
148
|
+
* positive is a build error naming two routes rather than a silent overwrite.
|
|
149
|
+
*/
|
|
150
|
+
function fsKey(path, identity) {
|
|
151
|
+
let key = identity.caseInsensitive ? caseFold(path) : path;
|
|
152
|
+
if (identity.normalizationInsensitive) key = key.normalize("NFC");
|
|
153
|
+
if (identity.stripsTrailingDotsAndSpaces) key = key.split("/").map(stripTrailing).join("/");
|
|
154
|
+
return key;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Approximate Unicode case folding, which is what case-insensitive
|
|
158
|
+
* filesystems actually compare under.
|
|
159
|
+
*
|
|
160
|
+
* `toLowerCase()` is not it. Greek `σ` and final `ς` are both already
|
|
161
|
+
* lowercase and stay distinct under it, yet NTFS upcases both to `Σ` and APFS
|
|
162
|
+
* folds `ς` to `σ` — so two routes differing only in that letter are one file
|
|
163
|
+
* on both, and a lowercase key admitted them as two claims (TIM-1266).
|
|
164
|
+
* Uppercasing first collapses them.
|
|
165
|
+
*
|
|
166
|
+
* The residual is over-folding, in these cases and a few like them:
|
|
167
|
+
*
|
|
168
|
+
* | pair | folded together here | NTFS / APFS |
|
|
169
|
+
* | --------- | -------------------- | ----------------- |
|
|
170
|
+
* | `σ` / `ς` | yes | yes — the fix |
|
|
171
|
+
* | `ß` / `ss`| yes | no |
|
|
172
|
+
* | `ı` / `i` | yes | no |
|
|
173
|
+
* | `fi` / `fi`| yes | no |
|
|
174
|
+
*
|
|
175
|
+
* That direction is deliberate. Over-folding costs a build error naming two
|
|
176
|
+
* routes, which a developer fixes by renaming one; under-folding costs a
|
|
177
|
+
* payload silently overwritten by another route's, which nothing downstream
|
|
178
|
+
* can detect. An exact fold would need `Intl.Collator`, which compares but
|
|
179
|
+
* emits no sort key, so using it would turn a hash lookup into a pairwise
|
|
180
|
+
* scan over every claimed path.
|
|
181
|
+
*/
|
|
182
|
+
function caseFold(value) {
|
|
183
|
+
return value.toUpperCase().toLowerCase();
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Drop trailing dots and spaces from one path segment, as Win32 does.
|
|
187
|
+
*
|
|
188
|
+
* A segment that is nothing but dots and spaces is left alone: `.` and `..`
|
|
189
|
+
* are traversal, which the caller rejects before reaching here, and emptying
|
|
190
|
+
* a segment would merge two unrelated paths rather than the aliases this
|
|
191
|
+
* models.
|
|
192
|
+
*/
|
|
193
|
+
function stripTrailing(segment) {
|
|
194
|
+
const stripped = segment.replace(/[. ]+$/, "");
|
|
195
|
+
return stripped === "" ? segment : stripped;
|
|
196
|
+
}
|
|
197
|
+
async function exists(path) {
|
|
198
|
+
try {
|
|
199
|
+
await stat(path);
|
|
200
|
+
return true;
|
|
201
|
+
} catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
export { REDIRECTS_FILE as a, USER_PLATFORM_DIR as c, HEADERS_FILE as i, detectFsIdentity as n, RESERVED_OUTPUT_PATHS as o, fsKey as r, USER_MERGED_PLATFORM_FILES as s, EXACT_FS_IDENTITY as t };
|
|
207
|
+
|
|
208
|
+
//# sourceMappingURL=fs-identity-D7vb6GdI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-identity-D7vb6GdI.js","names":[],"sources":["../../src/shared/static-platform-files.ts","../../src/adapters/fs-identity.ts"],"sourcesContent":["/**\n * Platform files the static build is allowed to overwrite in the output.\n *\n * The build merges two trees into the deployed directory — the client bundle\n * (which carries everything the user put in `public/`) and the pre-rendered\n * site. That merge otherwise refuses overlaps, because a silent overwrite\n * leaves one of two artifacts deployed with nothing recording which\n * (TIM-1266).\n *\n * These names are the exception, and only because the pre-rendered copy is\n * *derived from* the one it replaces rather than competing with it:\n * `plugins/static-build.ts` reads `public/_redirects` and writes the\n * generated rules plus the user's, so the winner is a superset of the loser.\n *\n * That holds only for a file the current pass produced, which is why\n * `cleanConditionalArtifacts` deletes a previous build's `_redirects` before\n * generation: written only when a pass finds redirects, it would otherwise\n * survive into a pass that produced nothing and claim an exemption it no\n * longer earns.\n *\n * `_headers` is NOT here. It is not written into the pre-rendered tree at\n * all — adapters generate it directly into the output, folding in the\n * user's copy as they go (TIM-1326).\n *\n * Declared once so the code that performs the merge and the code that\n * produces the merged file cannot disagree about which names are exempt.\n *\n * Isomorphic: no server, client, or build-time imports.\n */\n\n/** Platform redirect rules (Cloudflare Pages, Netlify). See TIM-1245/TIM-1249. */\nexport const REDIRECTS_FILE = '_redirects';\n\n/** Platform header rules (Cloudflare Pages, Netlify). See TIM-1241/TIM-1326. */\nexport const HEADERS_FILE = '_headers';\n\n/**\n * Where a user authors platform files. Stated once because two modules read\n * from here — `plugins/static-build.ts` for `_redirects`, adapters for\n * `_headers` — and they must look in the same place.\n *\n * Both read the **project source**, never the build output. The generated\n * file lands under the same name in the output directory, so a reader aimed\n * there would fold the previous build's generated rules back in and compound\n * them on every rebuild.\n */\nexport const USER_PLATFORM_DIR = 'public';\n\n/** Output-relative paths whose pre-rendered copy subsumes the `public/` one. */\nexport const USER_MERGED_PLATFORM_FILES: readonly string[] = [REDIRECTS_FILE];\n\n/**\n * Output paths the framework writes itself, which no route may claim.\n *\n * These are written outside the per-entry writer — `_redirects` after\n * generation, `_headers` by the adapter after the copy — so the collision\n * tracker never sees them and a route rendering to one of these paths is\n * overwritten with nothing recording it.\n *\n * Reserved rather than tracked, because there is no version of \"serve a route\n * at `/_headers`\" that works: Cloudflare Pages and Netlify read these two\n * files themselves and never serve them, so the route is unservable however\n * the conflict is resolved.\n *\n * That justification is per-file, not per-mechanism. `.nojekyll` is written\n * the same way and is deliberately NOT here: only the `github-pages` target\n * writes it, and everywhere else `/.nojekyll` is an ordinary servable path,\n * so reserving it globally would refuse a valid Cloudflare site. Its write\n * site skips the write when a file is already there instead — GitHub Pages\n * only cares that the file exists.\n *\n * Same reasoning as the synthetic 404 entry using an internal urlPath so a\n * real `/404` route cannot collide with `404.html`.\n */\nexport const RESERVED_OUTPUT_PATHS: readonly string[] = [REDIRECTS_FILE, HEADERS_FILE];\n","/**\n * What the output filesystem considers \"the same file\".\n *\n * Two build steps compare paths to decide whether two artifacts would land on\n * one file — the render pass (`plugins/static-build.ts`) and the adapter's\n * tree merge (`build-output-helper.ts`). Both are predicting a filesystem\n * decision, so both ask the filesystem rather than comparing raw strings\n * (TIM-1266).\n *\n * Two properties matter, and they are independent:\n *\n * - **Case folding.** macOS APFS and Windows NTFS fold by default, ext4 does\n * not. Dynamic params `Foo` and `foo` are one file on a Mac and two on\n * Linux CI.\n * - **Unicode normalization.** APFS compares normalization-insensitively, so\n * `café` spelled NFC (`é`) and NFD (`e` + combining acute) address one\n * file. This holds even on a *case-sensitive* APFS volume, which is why it\n * is probed separately rather than inferred from case folding.\n *\n * Probed rather than read off `process.platform`: a case-sensitive volume on\n * macOS and a case-insensitive mount on Linux are both ordinary, and the\n * answer that matters is the one for the directory being written.\n *\n * Leaf module — Node built-ins only. Deliberately not in `adapters/shared.ts`,\n * which `server/asset-headers.ts` re-exports from and which therefore must\n * stay free of `node:fs` for the Workers bundle.\n */\n\nimport { writeFile, stat, rm } from 'node:fs/promises';\nimport { randomUUID } from 'node:crypto';\nimport { join } from 'node:path';\n\n/** How the output filesystem decides that two paths name one file. */\nexport interface FsIdentity {\n /** `Foo` and `foo` are the same file. */\n caseInsensitive: boolean;\n /** Canonically equivalent Unicode spellings are the same file. */\n normalizationInsensitive: boolean;\n /**\n * Trailing dots and spaces are stripped from each segment, so `foo.` and\n * `foo` are the same file. Win32 does this in path resolution rather than\n * in the filesystem, which is why it is probed like the others.\n */\n stripsTrailingDotsAndSpaces: boolean;\n}\n\n/** Every path comparison is exact — the conservative answer when unprobed. */\nexport const EXACT_FS_IDENTITY: FsIdentity = {\n caseInsensitive: false,\n normalizationInsensitive: false,\n stripsTrailingDotsAndSpaces: false,\n};\n\n/**\n * Probe `dir` by writing one file and asking for it under other spellings.\n *\n * Returns {@link EXACT_FS_IDENTITY} when the probe cannot run. That\n * under-detects, but a directory this cannot write to is one the caller is\n * about to fail on anyway, with a clearer error than a missed collision.\n */\nexport async function detectFsIdentity(dir: string): Promise<FsIdentity> {\n // `café` — NFC, with a precomposed é. The UUID contributes the\n // hex letters the case probe needs.\n const name = `.timber-probe-${randomUUID()}-café`;\n const path = join(dir, name);\n\n try {\n await writeFile(path, '');\n const [caseInsensitive, normalizationInsensitive, stripsTrailingDotsAndSpaces] =\n await Promise.all([\n exists(join(dir, name.toUpperCase())),\n // NFD spells the same string as `e` + U+0301; a filesystem that\n // resolves it to the NFC file compares normalization-insensitively.\n exists(join(dir, name.normalize('NFD'))),\n // Win32 strips trailing dots and spaces during path resolution, so\n // asking for `name.` reaches `name`.\n exists(join(dir, `${name}.`)),\n ]);\n return { caseInsensitive, normalizationInsensitive, stripsTrailingDotsAndSpaces };\n } catch {\n return EXACT_FS_IDENTITY;\n } finally {\n await rm(path, { force: true }).catch(() => {});\n }\n}\n\n/**\n * Fold a path to the identity the filesystem compares it under.\n *\n * Normalization first, then case: `toLowerCase()` operates per code point, so\n * folding a decomposed string first would leave the combining marks in a\n * different order than folding a precomposed one.\n *\n * An approximation of the filesystem's own algorithm — APFS and NTFS fold per\n * their own Unicode tables, which `toLowerCase()` matches for everything short\n * of the exotic. It errs toward *finding* a collision, and the cost of a false\n * positive is a build error naming two routes rather than a silent overwrite.\n */\nexport function fsKey(path: string, identity: FsIdentity): string {\n let key = identity.caseInsensitive ? caseFold(path) : path;\n if (identity.normalizationInsensitive) key = key.normalize('NFC');\n if (identity.stripsTrailingDotsAndSpaces) key = key.split('/').map(stripTrailing).join('/');\n return key;\n}\n\n/**\n * Approximate Unicode case folding, which is what case-insensitive\n * filesystems actually compare under.\n *\n * `toLowerCase()` is not it. Greek `σ` and final `ς` are both already\n * lowercase and stay distinct under it, yet NTFS upcases both to `Σ` and APFS\n * folds `ς` to `σ` — so two routes differing only in that letter are one file\n * on both, and a lowercase key admitted them as two claims (TIM-1266).\n * Uppercasing first collapses them.\n *\n * The residual is over-folding, in these cases and a few like them:\n *\n * | pair | folded together here | NTFS / APFS |\n * | --------- | -------------------- | ----------------- |\n * | `σ` / `ς` | yes | yes — the fix |\n * | `ß` / `ss`| yes | no |\n * | `ı` / `i` | yes | no |\n * | `fi` / `fi`| yes | no |\n *\n * That direction is deliberate. Over-folding costs a build error naming two\n * routes, which a developer fixes by renaming one; under-folding costs a\n * payload silently overwritten by another route's, which nothing downstream\n * can detect. An exact fold would need `Intl.Collator`, which compares but\n * emits no sort key, so using it would turn a hash lookup into a pairwise\n * scan over every claimed path.\n */\nfunction caseFold(value: string): string {\n return value.toUpperCase().toLowerCase();\n}\n\n/**\n * Drop trailing dots and spaces from one path segment, as Win32 does.\n *\n * A segment that is nothing but dots and spaces is left alone: `.` and `..`\n * are traversal, which the caller rejects before reaching here, and emptying\n * a segment would merge two unrelated paths rather than the aliases this\n * models.\n */\nfunction stripTrailing(segment: string): string {\n const stripped = segment.replace(/[. ]+$/, '');\n return stripped === '' ? segment : stripped;\n}\n\nasync function exists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,iBAAiB;;AAG9B,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,oBAAoB;;AAGjC,IAAa,6BAAgD,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;AAyB5E,IAAa,wBAA2C,CAAC,gBAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3BrF,IAAa,oBAAgC;CAC3C,iBAAiB;CACjB,0BAA0B;CAC1B,6BAA6B;AAC/B;;;;;;;;AASA,eAAsB,iBAAiB,KAAkC;CAGvE,MAAM,OAAO,iBAAiB,WAAW,EAAE;CAC3C,MAAM,OAAO,KAAK,KAAK,IAAI;CAE3B,IAAI;EACF,MAAM,UAAU,MAAM,EAAE;EACxB,MAAM,CAAC,iBAAiB,0BAA0B,+BAChD,MAAM,QAAQ,IAAI;GAChB,OAAO,KAAK,KAAK,KAAK,YAAY,CAAC,CAAC;GAGpC,OAAO,KAAK,KAAK,KAAK,UAAU,KAAK,CAAC,CAAC;GAGvC,OAAO,KAAK,KAAK,GAAG,KAAK,EAAE,CAAC;EAC9B,CAAC;EACH,OAAO;GAAE;GAAiB;GAA0B;EAA4B;CAClF,QAAQ;EACN,OAAO;CACT,UAAU;EACR,MAAM,GAAG,MAAM,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;CAChD;AACF;;;;;;;;;;;;;AAcA,SAAgB,MAAM,MAAc,UAA8B;CAChE,IAAI,MAAM,SAAS,kBAAkB,SAAS,IAAI,IAAI;CACtD,IAAI,SAAS,0BAA0B,MAAM,IAAI,UAAU,KAAK;CAChE,IAAI,SAAS,6BAA6B,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,KAAK,GAAG;CAC1F,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,SAAS,OAAuB;CACvC,OAAO,MAAM,YAAY,CAAC,CAAC,YAAY;AACzC;;;;;;;;;AAUA,SAAS,cAAc,SAAyB;CAC9C,MAAM,WAAW,QAAQ,QAAQ,UAAU,EAAE;CAC7C,OAAO,aAAa,KAAK,UAAU;AACrC;AAEA,eAAe,OAAO,MAAgC;CACpD,IAAI;EACF,MAAM,KAAK,IAAI;EACf,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
@@ -1,45 +1,10 @@
|
|
|
1
1
|
import { i as assertValidCookieValue, n as assertValidCookieName, r as assertValidCookieOptions, t as require_dist } from "./dist-BA3u1z3W.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { o as traceAls, r as requestContextAls, s as waitUntilAls } from "./als-registry-C6kcfprT.js";
|
|
3
|
+
import { n as _setGetSegmentParamsFn, t as _setGetSearchParamsFn } from "./als-slots-BEEIPKYm.js";
|
|
4
|
+
import { r as appVisibleSearch } from "./rsc-cache-key-DD0fl_-s.js";
|
|
5
|
+
import { t as resolveSegmentParams } from "./slot-params-BCTmZkQB.js";
|
|
4
6
|
import { a as mergePreservedSearchParams, r as validateExternalRedirectUrl, t as assertRelativeRedirectPath } from "./href-validation-CMc5JRls.js";
|
|
5
7
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import "#server-only-guard";
|
|
7
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
|
-
//#region src/server/als-registry.ts
|
|
9
|
-
/**
|
|
10
|
-
* Return a process-wide singleton `AsyncLocalStorage` keyed by `symbol`.
|
|
11
|
-
*
|
|
12
|
-
* `Symbol.for(...)` keys live in the cross-realm symbol registry, and
|
|
13
|
-
* `globalThis` is shared across every module evaluation inside the same
|
|
14
|
-
* Node.js process. Together they give a stable anchor that survives
|
|
15
|
-
* re-evaluation of this file — the second evaluation observes the
|
|
16
|
-
* `globalThis[symbol]` slot already populated by the first and hands
|
|
17
|
-
* back the identical ALS instance.
|
|
18
|
-
*/
|
|
19
|
-
function getOrCreateAls(symbol) {
|
|
20
|
-
const g = globalThis;
|
|
21
|
-
const existing = g[symbol];
|
|
22
|
-
if (existing instanceof AsyncLocalStorage) return existing;
|
|
23
|
-
const created = new AsyncLocalStorage();
|
|
24
|
-
g[symbol] = created;
|
|
25
|
-
return created;
|
|
26
|
-
}
|
|
27
|
-
/** @internal — import via request-context.ts public API */
|
|
28
|
-
var requestContextAls = getOrCreateAls(Symbol.for("timber:request-context-als"));
|
|
29
|
-
/** @internal — import via tracing.ts public API */
|
|
30
|
-
var traceAls = getOrCreateAls(Symbol.for("timber:trace-als"));
|
|
31
|
-
/** @internal — import via server-timing.ts public API */
|
|
32
|
-
var timingAls = getOrCreateAls(Symbol.for("timber:timing-als"));
|
|
33
|
-
/** @internal — import via actions.ts public API */
|
|
34
|
-
var revalidationAls = getOrCreateAls(Symbol.for("timber:revalidation-als"));
|
|
35
|
-
/** @internal — import via form-flash.ts public API */
|
|
36
|
-
var formFlashAls = getOrCreateAls(Symbol.for("timber:form-flash-als"));
|
|
37
|
-
/** @internal — import via early-hints-sender.ts public API */
|
|
38
|
-
var earlyHintsSenderAls = getOrCreateAls(Symbol.for("timber:early-hints-sender-als"));
|
|
39
|
-
/** @internal — import via waituntil-bridge.ts public API */
|
|
40
|
-
var waitUntilAls = getOrCreateAls(Symbol.for("timber:wait-until-als"));
|
|
41
|
-
getOrCreateAls(Symbol.for("timber:workers-cache-purge-als"));
|
|
42
|
-
//#endregion
|
|
43
8
|
//#region src/server/tracing.ts
|
|
44
9
|
/**
|
|
45
10
|
* Tracing — per-request trace ID via AsyncLocalStorage, OTEL span helpers.
|
|
@@ -940,13 +905,8 @@ function getSegmentParams(segmentPath) {
|
|
|
940
905
|
const store = requestContextAls.getStore();
|
|
941
906
|
if (!store) throw new Error("[timber] getSegmentParams() called outside of a request context. It can only be used in middleware, access checks, server components, and server actions.");
|
|
942
907
|
if (!store.segmentParams) throw new Error("[timber] getSegmentParams() called before route matching completed. Segment params are not available until after the route is matched.");
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
return {
|
|
946
|
-
...store.segmentParams,
|
|
947
|
-
...slotParams
|
|
948
|
-
};
|
|
949
|
-
}
|
|
908
|
+
const slotResolved = resolveSegmentParams(store.segmentParams, store.slotParams, segmentPath);
|
|
909
|
+
if (slotResolved !== store.segmentParams) return slotResolved;
|
|
950
910
|
if (segmentPath && isDebug() && store.matchedSegmentPath) {
|
|
951
911
|
const expected = extractDynamicSegments(segmentPath);
|
|
952
912
|
const actual = extractDynamicSegments(store.matchedSegmentPath);
|
|
@@ -1015,15 +975,15 @@ function getRequestSearchString() {
|
|
|
1015
975
|
*/
|
|
1016
976
|
function runWithRequestContext(req, fn) {
|
|
1017
977
|
const originalCopy = new Headers(req.headers);
|
|
1018
|
-
const
|
|
978
|
+
const appVisible = appVisibleSearch(new URL(req.url));
|
|
1019
979
|
const seed = consumeSeededCookies(req);
|
|
1020
980
|
const store = {
|
|
1021
981
|
headers: freezeHeaders(req.headers),
|
|
1022
982
|
originalHeaders: originalCopy,
|
|
1023
983
|
cookieHeader: seed ? "" : req.headers.get("cookie") ?? "",
|
|
1024
984
|
parsedCookies: seed,
|
|
1025
|
-
searchParams:
|
|
1026
|
-
searchString:
|
|
985
|
+
searchParams: appVisible.params,
|
|
986
|
+
searchString: appVisible.search,
|
|
1027
987
|
cookieJar: /* @__PURE__ */ new Map(),
|
|
1028
988
|
flushed: false,
|
|
1029
989
|
mutableContext: false
|
|
@@ -1158,6 +1118,29 @@ function warnIfNotSerializable(data, callerName) {
|
|
|
1158
1118
|
var DenySignal = class extends Error {
|
|
1159
1119
|
status;
|
|
1160
1120
|
data;
|
|
1121
|
+
/**
|
|
1122
|
+
* Segment key of the segment that owns the deny page matched for this
|
|
1123
|
+
* signal — set by a framework catch site that matched an entry it may not
|
|
1124
|
+
* render at its own position, and re-threw so the boundary at the owning
|
|
1125
|
+
* segment renders it instead.
|
|
1126
|
+
*
|
|
1127
|
+
* Written only by the three in-tree catch sites (`PageDenyBoundary`,
|
|
1128
|
+
* `TracedLayout`, `AccessGate`), never by user code. Two readers depend on
|
|
1129
|
+
* it: `TimberErrorBoundary`, which declines any deny whose `ownerKey` is
|
|
1130
|
+
* not its own `segmentKey`, and `buildRscPayloadResponse`, which keeps
|
|
1131
|
+
* streaming instead of re-rendering when it is set.
|
|
1132
|
+
*
|
|
1133
|
+
* See design/04-authorization.md §"Where a Deny Page Renders", TIM-1356.
|
|
1134
|
+
*/
|
|
1135
|
+
ownerKey;
|
|
1136
|
+
/**
|
|
1137
|
+
* When true, the pipeline must respond with `rscErrorEnvelope` so the
|
|
1138
|
+
* client hard-navigates instead of attempting to render a deny page
|
|
1139
|
+
* from the RSC payload. Set by AccessGate when a skipped segment
|
|
1140
|
+
* denies — rendering the deny page in-tree would appear inside the
|
|
1141
|
+
* client's cached layout chrome (TIM-1074). See TIM-1363.
|
|
1142
|
+
*/
|
|
1143
|
+
_hardNavigate;
|
|
1161
1144
|
constructor(status, data) {
|
|
1162
1145
|
super(`Access denied with status ${status}`);
|
|
1163
1146
|
this.name = "DenySignal";
|
|
@@ -1463,6 +1446,6 @@ function swallow(err, reason, opts) {
|
|
|
1463
1446
|
} catch {}
|
|
1464
1447
|
}
|
|
1465
1448
|
//#endregion
|
|
1466
|
-
export {
|
|
1449
|
+
export { setMatchedSegmentPath as A, addSpanEventSync as B, applyRequestHeaderOverlay as C, getSegmentParams as D, getSearchParams as E, getSetCookieHeaders as F, replaceTraceId as G, getOtelTraceId as H, getWaitUntil as I, withSpan as J, runWithTraceId as K, isDebug as L, setSegmentParams as M, getCookie as N, markResponseFlushed as O, getCookieJar as P, isDevMode as R, waitUntil as S, getHeaders as T, getSpanId as U, generateTraceId as V, getTraceId as W, RedirectSignal as _, logProxyError as a, redirect as b, logRequestReceived as c, logSwrRefetchFailed as d, logWaitUntilRejected as f, DenySignal as g, swallow as h, logMiddlewareShortCircuit as i, setMutableCookieContext as j, runWithRequestContext as k, logRouteError as l, setLogger as m, logCacheMiss as n, logRenderError as o, logWaitUntilUnsupported as p, setSpanAttribute as q, logMiddlewareError as r, logRequestCompleted as s, getLogger as t, logSlowRequest as u, RenderError as v, getHeader as w, redirectExternal as x, deny as y, addSpanEvent as z };
|
|
1467
1450
|
|
|
1468
|
-
//# sourceMappingURL=logger-
|
|
1451
|
+
//# sourceMappingURL=logger-D8xJZXIN.js.map
|