@timber-js/app 0.2.0-alpha.191 → 0.2.0-alpha.194
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/agent-skill.md +2 -0
- package/dist/_chunks/{actions-BjbbNRFN.js → actions-CWYtq6ii.js} +3 -3
- package/dist/_chunks/actions-CWYtq6ii.js.map +1 -0
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
- package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -1
- package/dist/_chunks/{build-output-helper-C3DrfzZR.js → build-output-helper-9dqCv1pZ.js} +3 -2
- package/dist/_chunks/build-output-helper-9dqCv1pZ.js.map +1 -0
- package/dist/_chunks/{cache-api-DllJ-Lyw.js → cache-api-CQeYzA5g.js} +6 -8
- package/dist/_chunks/cache-api-CQeYzA5g.js.map +1 -0
- package/dist/_chunks/chains-h7EO-u3n.js +412 -0
- package/dist/_chunks/chains-h7EO-u3n.js.map +1 -0
- package/dist/_chunks/{cli-check-DJZDc22E.js → cli-check-BVthpfLS.js} +43 -6
- package/dist/_chunks/cli-check-BVthpfLS.js.map +1 -0
- package/dist/_chunks/{cli-schema-sync-D4_AZVUb.js → cli-schema-sync-ZwM9u_ob.js} +6 -5
- package/dist/_chunks/{cli-schema-sync-D4_AZVUb.js.map → cli-schema-sync-ZwM9u_ob.js.map} +1 -1
- package/dist/_chunks/{cloudflare-CGP6BZKO.js → cloudflare-BKJC3SC_.js} +28 -22
- package/dist/_chunks/{cloudflare-CGP6BZKO.js.map → cloudflare-BKJC3SC_.js.map} +1 -1
- package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -1
- package/dist/_chunks/{convention-lint-CpteIpTm.js → convention-lint-DO10_pVl.js} +93 -7
- package/dist/_chunks/convention-lint-DO10_pVl.js.map +1 -0
- package/dist/_chunks/dist-DtrJyBbw.js +386 -0
- package/dist/_chunks/dist-DtrJyBbw.js.map +1 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -1
- package/dist/_chunks/{file-cache-DmX7OqZP.js → file-cache-Dw6BJPG7.js} +5 -1
- package/dist/_chunks/{file-cache-DmX7OqZP.js.map → file-cache-Dw6BJPG7.js.map} +1 -1
- package/dist/_chunks/{format-CfwjgPz9.js → format-BKclgVbk.js} +3 -3
- package/dist/_chunks/{format-CfwjgPz9.js.map → format-BKclgVbk.js.map} +1 -1
- package/dist/_chunks/graph-cache-CP4GEmf9.js +304 -0
- package/dist/_chunks/graph-cache-CP4GEmf9.js.map +1 -0
- package/dist/_chunks/href-validation-CMc5JRls.js.map +1 -1
- package/dist/_chunks/live-graph-Bx4HodF1.js +150 -0
- package/dist/_chunks/live-graph-Bx4HodF1.js.map +1 -0
- package/dist/_chunks/{logger-CH7IcMmg.js → logger-pumCm3Il.js} +25 -7
- package/dist/_chunks/{logger-CH7IcMmg.js.map → logger-pumCm3Il.js.map} +1 -1
- package/dist/_chunks/{mdx-file-C005ay-P.js → mdx-file-CXyHGUpS.js} +3 -3
- package/dist/_chunks/mdx-file-CXyHGUpS.js.map +1 -0
- package/dist/_chunks/{plugin-context-rCinWLiE.js → plugin-context-8idfR3UZ.js} +2 -2
- package/dist/_chunks/plugin-context-8idfR3UZ.js.map +1 -0
- package/dist/_chunks/poison-rules-DoEhbqaY.js +110 -0
- package/dist/_chunks/poison-rules-DoEhbqaY.js.map +1 -0
- package/dist/_chunks/poison-scan-BAxfTT5L.js +101 -0
- package/dist/_chunks/poison-scan-BAxfTT5L.js.map +1 -0
- package/dist/_chunks/resolve-schema-CBR6Lm4i.js.map +1 -1
- package/dist/_chunks/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -1
- package/dist/_chunks/{rsc-media-type-DRqE_lD_.js → rsc-media-type-DDc7duTD.js} +17 -2
- package/dist/_chunks/{rsc-media-type-DRqE_lD_.js.map → rsc-media-type-DDc7duTD.js.map} +1 -1
- package/dist/_chunks/scan-BoP17W3w.js +140 -0
- package/dist/_chunks/scan-BoP17W3w.js.map +1 -0
- package/dist/_chunks/{scanner-CAietmj4.js → scanner-BRIOmHE2.js} +43 -4
- package/dist/_chunks/scanner-BRIOmHE2.js.map +1 -0
- package/dist/_chunks/schema-bridge-C83xa9lT.js.map +1 -1
- package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -1
- package/dist/_chunks/{segment-keys-BawYuNFO.js → segment-keys-BhqoHiLc.js} +14 -2
- package/dist/_chunks/{segment-keys-BawYuNFO.js.map → segment-keys-BhqoHiLc.js.map} +1 -1
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -1
- package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -1
- package/dist/_chunks/use-query-states-I3JMng6J.js.map +1 -1
- package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -1
- package/dist/_chunks/{walkers-BsVLmD1S.js → walkers-uCu3WW6_.js} +9 -6
- package/dist/_chunks/{walkers-BsVLmD1S.js.map → walkers-uCu3WW6_.js.map} +1 -1
- package/dist/adapters/build-output-helper.d.ts +1 -1
- package/dist/adapters/build-output-helper.d.ts.map +1 -1
- package/dist/adapters/cloudflare-dev.d.ts.map +1 -1
- package/dist/adapters/cloudflare-dev.js +2 -1
- package/dist/adapters/cloudflare-dev.js.map +1 -1
- package/dist/adapters/cloudflare-kv-cache.d.ts +1 -1
- package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +7 -8
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -1
- package/dist/adapters/cloudflare.d.ts +1 -1
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/nitro-presets.d.ts +37 -0
- package/dist/adapters/nitro-presets.d.ts.map +1 -0
- package/dist/adapters/nitro-preview.d.ts +32 -0
- package/dist/adapters/nitro-preview.d.ts.map +1 -0
- package/dist/adapters/nitro.d.ts +28 -51
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +224 -171
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/analyze/chains.d.ts +124 -0
- package/dist/analyze/chains.d.ts.map +1 -0
- package/dist/analyze/classify.d.ts +150 -0
- package/dist/analyze/classify.d.ts.map +1 -0
- package/dist/analyze/crawl-entry.d.ts +17 -0
- package/dist/analyze/crawl-entry.d.ts.map +1 -0
- package/dist/analyze/crawl-entry.js +313 -0
- package/dist/analyze/crawl-entry.js.map +1 -0
- package/dist/analyze/crawl.d.ts +134 -0
- package/dist/analyze/crawl.d.ts.map +1 -0
- package/dist/analyze/graph-cache.d.ts +104 -0
- package/dist/analyze/graph-cache.d.ts.map +1 -0
- package/dist/analyze/graph-command.d.ts +43 -0
- package/dist/analyze/graph-command.d.ts.map +1 -0
- package/dist/analyze/graph-command.js +472 -0
- package/dist/analyze/graph-command.js.map +1 -0
- package/dist/analyze/live-graph.d.ts +81 -0
- package/dist/analyze/live-graph.d.ts.map +1 -0
- package/dist/analyze/poison-rules.d.ts +72 -0
- package/dist/analyze/poison-rules.d.ts.map +1 -0
- package/dist/analyze/poison-scan.d.ts +48 -0
- package/dist/analyze/poison-scan.d.ts.map +1 -0
- package/dist/analyze/scan.d.ts +73 -0
- package/dist/analyze/scan.d.ts.map +1 -0
- package/dist/cache/cache-api.d.ts +2 -2
- package/dist/cache/cache-api.d.ts.map +1 -1
- package/dist/cache/index.d.ts +8 -8
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cache/redis-handler.d.ts +1 -1
- package/dist/cache/redis-handler.d.ts.map +1 -1
- package/dist/cache/stores/cloudflare-kv.d.ts +1 -1
- package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -1
- package/dist/cache/stores/cloudflare-kv.js.map +1 -1
- package/dist/cache/stores/memory.d.ts +1 -1
- package/dist/cache/stores/memory.d.ts.map +1 -1
- package/dist/cache/stores/memory.js.map +1 -1
- package/dist/cache/stores/redis.d.ts +1 -1
- package/dist/cache/stores/redis.d.ts.map +1 -1
- package/dist/cache/stores/redis.js.map +1 -1
- package/dist/cache/stores/vercel.d.ts +1 -1
- package/dist/cache/stores/vercel.d.ts.map +1 -1
- package/dist/cache/stores/vercel.js.map +1 -1
- package/dist/cache/tag-aware-handler.d.ts +2 -2
- package/dist/cache/tag-aware-handler.d.ts.map +1 -1
- package/dist/cache/timber-cache.d.ts +1 -1
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cdn/cloudflare-purge.d.ts +1 -1
- package/dist/cdn/cloudflare-purge.d.ts.map +1 -1
- package/dist/cdn/cloudflare-purge.js.map +1 -1
- package/dist/cdn/fastly-purge.d.ts +1 -1
- package/dist/cdn/fastly-purge.d.ts.map +1 -1
- package/dist/cdn/fastly-purge.js.map +1 -1
- package/dist/cdn/index.d.ts +4 -4
- package/dist/cdn/index.d.ts.map +1 -1
- package/dist/cdn/workers-cache-purge.d.ts +5 -1
- package/dist/cdn/workers-cache-purge.d.ts.map +1 -1
- package/dist/cdn/workers-cache-purge.js.map +1 -1
- package/dist/cli-check.d.ts +10 -0
- package/dist/cli-check.d.ts.map +1 -1
- package/dist/cli.d.ts +12 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +30 -6
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-entry/hydrate.d.ts +2 -2
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/post-hydration.d.ts +2 -2
- package/dist/client/browser-entry/router-init.d.ts +2 -2
- package/dist/client/browser-entry/rsc-stream.d.ts +1 -1
- package/dist/client/form.d.ts +2 -2
- package/dist/client/form.d.ts.map +1 -1
- package/dist/client/history.d.ts +2 -2
- package/dist/client/index.d.ts +18 -18
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +19 -19
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +11 -15
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts +3 -3
- package/dist/client/navigation-commit.d.ts +5 -5
- package/dist/client/navigation-root.d.ts +1 -1
- package/dist/client/navigation-root.d.ts.map +1 -1
- package/dist/client/params-context.d.ts +3 -3
- package/dist/client/router-pipeline.d.ts +7 -7
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/router-types.d.ts +6 -6
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts +1 -1
- package/dist/client/rsc-fetch.d.ts +4 -4
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +2 -2
- package/dist/client/slot-provider.d.ts +1 -1
- package/dist/client/ssr-data.d.ts +2 -2
- package/dist/client/state.d.ts +4 -4
- package/dist/client/use-query-states.d.ts +1 -1
- package/dist/client/use-segment-params.d.ts +3 -3
- package/dist/codec.d.ts +2 -2
- package/dist/codec.js.map +1 -1
- package/dist/config-types.d.ts +24 -6
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts +1 -1
- package/dist/cookies/define-cookie.d.ts +3 -3
- package/dist/cookies/index.d.ts +3 -3
- package/dist/cookies/index.js +3 -4
- package/dist/cookies/index.js.map +1 -1
- package/dist/cookies/json-cookie.d.ts +1 -1
- package/dist/dev-tools/404-page.d.ts +2 -2
- package/dist/dev-tools/error-page.d.ts +2 -2
- package/dist/dev-tools/index.d.ts +12 -12
- package/dist/dev-tools/instrumentation.d.ts +1 -1
- package/dist/dev-tools/logs.d.ts +1 -1
- package/dist/dev-tools/overlay.d.ts +2 -2
- package/dist/dev-tools/terminal.d.ts +1 -1
- package/dist/fonts/ast.d.ts +4 -4
- package/dist/fonts/bundle.d.ts +3 -3
- package/dist/fonts/css.d.ts +1 -1
- package/dist/fonts/dev-middleware.d.ts +1 -1
- package/dist/fonts/google.d.ts +1 -1
- package/dist/fonts/local.d.ts +1 -1
- package/dist/fonts/pipeline.d.ts +3 -3
- package/dist/fonts/transform.d.ts +2 -2
- package/dist/fonts/types.d.ts +1 -1
- package/dist/fonts/virtual-modules.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +816 -310
- package/dist/index.js.map +1 -1
- package/dist/params/codec-registry.d.ts +1 -1
- package/dist/params/define-schema.d.ts +2 -2
- package/dist/params/index.d.ts +4 -4
- package/dist/params/index.js.map +1 -1
- package/dist/params/resolve-schema.d.ts +1 -1
- package/dist/plugin-context.d.ts +9 -9
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/adapter-build.d.ts +2 -2
- package/dist/plugins/build-manifest.d.ts +2 -2
- package/dist/plugins/build-report.d.ts +5 -5
- package/dist/plugins/cache.d.ts +1 -1
- package/dist/plugins/callsite-jsx.d.ts +2 -2
- package/dist/plugins/chunks.d.ts +1 -1
- package/dist/plugins/chunks.d.ts.map +1 -1
- package/dist/plugins/cloudflare-wasm.d.ts +1 -1
- package/dist/plugins/content.d.ts +1 -1
- package/dist/plugins/content.d.ts.map +1 -1
- package/dist/plugins/dev-discovery.d.ts +123 -0
- package/dist/plugins/dev-discovery.d.ts.map +1 -0
- package/dist/plugins/dev-server.d.ts +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +1 -1
- package/dist/plugins/fonts.d.ts +3 -3
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/graph-endpoint.d.ts +112 -0
- package/dist/plugins/graph-endpoint.d.ts.map +1 -0
- package/dist/plugins/mdx.d.ts +18 -5
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/prebuilt-capture.d.ts +2 -2
- package/dist/plugins/prebuilt-options-analysis.d.ts +1 -1
- package/dist/plugins/prebuilt.d.ts +1 -1
- package/dist/plugins/prerender-sugar.d.ts +11 -14
- package/dist/plugins/prerender-sugar.d.ts.map +1 -1
- package/dist/plugins/request-dep/analysis.d.ts +1 -1
- package/dist/plugins/request-dep/index.d.ts +5 -5
- package/dist/plugins/request-dep/origin.d.ts +1 -1
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/server-bundle.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +5 -5
- package/dist/routing/codegen-shared.d.ts +1 -1
- package/dist/routing/codegen-write.d.ts +1 -1
- package/dist/routing/codegen.d.ts +1 -1
- package/dist/routing/collision-probe.d.ts +1 -1
- package/dist/routing/collision-spaces.d.ts +1 -1
- package/dist/routing/convention-lint.d.ts +1 -1
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/index.d.ts +13 -13
- package/dist/routing/index.js +3 -3
- package/dist/routing/interception.d.ts +1 -1
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/routing/link-codegen.d.ts +1 -1
- package/dist/routing/manifest-codegen.d.ts +1 -1
- package/dist/routing/scanner.d.ts +14 -1
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/schema-validation.d.ts +1 -1
- package/dist/routing/segment-classify.d.ts +1 -1
- package/dist/routing/segment-codegen.d.ts +1 -1
- package/dist/routing/segment-keys.d.ts +1 -1
- package/dist/routing/slot-placement.d.ts +1 -1
- package/dist/routing/walkers.d.ts +1 -1
- package/dist/rsc-runtime/transforms.d.ts +13 -0
- package/dist/rsc-runtime/transforms.d.ts.map +1 -0
- package/dist/schema-bridge.d.ts +1 -1
- package/dist/search-params/define.d.ts +3 -3
- package/dist/search-params/index.d.ts +3 -3
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/wrappers.d.ts +1 -1
- package/dist/server/access-gate.d.ts +1 -1
- package/dist/server/action-client.d.ts +1 -1
- package/dist/server/action-handler.d.ts +5 -5
- package/dist/server/actions.d.ts +2 -2
- package/dist/server/als-registry.d.ts +8 -8
- package/dist/server/asset-headers.d.ts +1 -1
- package/dist/server/chain-url-parts.d.ts +3 -3
- package/dist/server/children-interception.d.ts +2 -2
- package/dist/server/cookie-context.d.ts +1 -1
- package/dist/server/cookie-parsing.d.ts +2 -2
- package/dist/server/default-logger.d.ts +1 -1
- package/dist/server/deny-boundary.d.ts +2 -2
- package/dist/server/deny-renderer.d.ts +5 -5
- package/dist/server/early-hints.d.ts +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +2 -4
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/fallback-error.d.ts +5 -5
- package/dist/server/flight-injection-state.d.ts +1 -1
- package/dist/server/form-flash.d.ts +1 -1
- package/dist/server/html-injector-core.d.ts +2 -2
- package/dist/server/html-injectors.d.ts +1 -1
- package/dist/server/index.d.ts +18 -18
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +33 -32
- package/dist/server/index.js.map +1 -1
- package/dist/server/instrumentation.d.ts +1 -1
- package/dist/server/internal.d.ts +50 -50
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +1023 -1025
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-collector.d.ts +2 -2
- package/dist/server/metadata-platform.d.ts +2 -2
- package/dist/server/metadata-render.d.ts +2 -2
- package/dist/server/metadata-routes.d.ts +3 -3
- package/dist/server/metadata-social.d.ts +2 -2
- package/dist/server/metadata.d.ts +2 -2
- package/dist/server/middleware-runner.d.ts +1 -1
- package/dist/server/node-stream-transforms.d.ts +1 -1
- package/dist/server/param-coercion.d.ts +4 -4
- package/dist/server/pipeline-helpers.d.ts +3 -3
- package/dist/server/pipeline-interception.d.ts +1 -1
- package/dist/server/pipeline-metadata.d.ts +1 -1
- package/dist/server/pipeline-outcome.d.ts +2 -2
- package/dist/server/pipeline-phases.d.ts +3 -3
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +9 -9
- package/dist/server/prebuilt/cache-key.d.ts +1 -1
- package/dist/server/prebuilt/capture-state.d.ts +1 -1
- package/dist/server/prebuilt/key-discipline.d.ts +1 -1
- package/dist/server/prebuilt/manifest-tag-index.d.ts +1 -1
- package/dist/server/prebuilt/overlay.d.ts +2 -2
- package/dist/server/prebuilt/payload-source.d.ts +1 -1
- package/dist/server/prebuilt/slots.d.ts +1 -1
- package/dist/server/prebuilt/synthetic-store.d.ts +2 -2
- package/dist/server/prebuilt-builder.d.ts +2 -2
- package/dist/server/primitives.d.ts +2 -2
- package/dist/server/publish-params.d.ts +1 -1
- package/dist/server/request-context.d.ts +3 -3
- package/dist/server/route-element-builder.d.ts +16 -6
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts +1 -1
- package/dist/server/route-matcher.d.ts +4 -4
- package/dist/server/rsc-cache-key-guard.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-middleware-runner.d.ts +2 -2
- package/dist/server/rsc-entry/api-handler.d.ts +1 -1
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts +3 -3
- package/dist/server/rsc-entry/error-renderer.d.ts +4 -4
- package/dist/server/rsc-entry/helpers.d.ts +6 -6
- package/dist/server/rsc-entry/index.d.ts +7 -6
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +4 -4
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +4 -4
- package/dist/server/rsc-entry/rsc-payload.d.ts +4 -4
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +3 -3
- package/dist/server/rsc-entry/ssr-bridge.d.ts +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +7 -7
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +5 -5
- package/dist/server/sitemap-generator.d.ts +2 -2
- package/dist/server/sitemap-handler.d.ts +1 -1
- package/dist/server/skippable-prefix.d.ts +3 -3
- package/dist/server/slot-interception.d.ts +2 -2
- package/dist/server/slot-resolver.d.ts +3 -7
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +2 -2
- package/dist/server/ssr-entry.d.ts +1 -1
- package/dist/server/static-generator.d.ts +1 -1
- package/dist/server/static-not-found.d.ts +1 -1
- package/dist/server/status-code-resolver.d.ts +1 -1
- package/dist/server/tracing.d.ts +3 -3
- package/dist/server/tree-builder.d.ts +3 -3
- package/dist/server/tree-match.d.ts +1 -1
- package/dist/server/types.d.ts +2 -2
- package/dist/server/utils/mdx-file.d.ts +2 -0
- package/dist/server/utils/mdx-file.d.ts.map +1 -1
- package/dist/server/workers-cache-bridge.d.ts +1 -1
- package/dist/shared/als-slots.d.ts +1 -1
- package/dist/shared/payload-root.d.ts +2 -2
- package/dist/shared/rsc-media-type.d.ts +12 -0
- package/dist/shared/rsc-media-type.d.ts.map +1 -1
- package/dist/shared/slot-params.d.ts +1 -1
- package/dist/shims/font-google.d.ts +1 -1
- package/dist/shims/font-google.js.map +1 -1
- package/dist/shims/font-local.d.ts +1 -1
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/navigation-client.d.ts +4 -4
- package/dist/shims/navigation.d.ts +2 -2
- package/docs/api/34-api-config.mdx +9 -8
- package/docs/api/36-cli.mdx +23 -3
- package/docs/learn/11-error-handling.mdx +11 -0
- package/docs/more/01-advanced-routing.mdx +1 -0
- package/docs/more/04b-mdx.mdx +38 -18
- package/package.json +23 -18
- package/src/adapters/build-output-helper.ts +4 -4
- package/src/adapters/cloudflare-dev.ts +7 -1
- package/src/adapters/cloudflare-kv-cache.ts +11 -8
- package/src/adapters/cloudflare.ts +21 -15
- package/src/adapters/compress-module.ts +2 -2
- package/src/adapters/nitro-presets.ts +139 -0
- package/src/adapters/nitro-preview.ts +340 -0
- package/src/adapters/nitro.ts +100 -465
- package/src/adapters/shared.ts +1 -1
- package/src/analyze/chains.ts +411 -0
- package/src/analyze/classify.ts +258 -0
- package/src/analyze/crawl-entry.ts +68 -0
- package/src/analyze/crawl.ts +500 -0
- package/src/analyze/graph-cache.ts +332 -0
- package/src/analyze/graph-command.ts +762 -0
- package/src/analyze/live-graph.ts +232 -0
- package/src/analyze/poison-rules.ts +165 -0
- package/src/analyze/poison-scan.ts +162 -0
- package/src/analyze/scan.ts +149 -0
- package/src/cache/cache-api.ts +7 -7
- package/src/cache/index.ts +9 -9
- package/src/cache/redis-handler.ts +2 -2
- package/src/cache/stores/cloudflare-kv.ts +1 -1
- package/src/cache/stores/memory.ts +2 -2
- package/src/cache/stores/redis.ts +1 -1
- package/src/cache/stores/vercel.ts +1 -1
- package/src/cache/tag-aware-handler.ts +2 -2
- package/src/cache/timber-cache.ts +8 -8
- package/src/cdn/cloudflare-purge.ts +1 -1
- package/src/cdn/fastly-purge.ts +1 -1
- package/src/cdn/index.ts +10 -4
- package/src/cdn/workers-cache-purge.ts +6 -2
- package/src/cli-check.ts +53 -4
- package/src/cli-schema-sync.ts +3 -3
- package/src/cli.ts +50 -11
- package/src/client/browser-dev.ts +1 -1
- package/src/client/browser-entry/action-dispatch.ts +5 -5
- package/src/client/browser-entry/hmr.ts +1 -1
- package/src/client/browser-entry/hydrate.ts +9 -9
- package/src/client/browser-entry/index.ts +10 -10
- package/src/client/browser-entry/post-hydration.ts +5 -5
- package/src/client/browser-entry/router-init.ts +9 -9
- package/src/client/browser-entry/rsc-stream.ts +3 -3
- package/src/client/error-boundary.tsx +4 -4
- package/src/client/form.tsx +7 -2
- package/src/client/history.ts +2 -2
- package/src/client/index.ts +21 -18
- package/src/client/internal.ts +19 -19
- package/src/client/link.tsx +9 -9
- package/src/client/navigation-api.ts +1 -1
- package/src/client/navigation-commit.ts +5 -5
- package/src/client/navigation-context.ts +1 -1
- package/src/client/navigation-root.tsx +1 -1
- package/src/client/nuqs-adapter.tsx +2 -2
- package/src/client/params-context.ts +4 -4
- package/src/client/router-effects.ts +3 -3
- package/src/client/router-lifecycle.ts +2 -2
- package/src/client/router-pipeline.ts +10 -10
- package/src/client/router-ref.ts +2 -2
- package/src/client/router-skew.ts +2 -2
- package/src/client/router-types.ts +6 -6
- package/src/client/router.ts +13 -13
- package/src/client/rsc-fetch.ts +11 -16
- package/src/client/segment-cache.ts +2 -2
- package/src/client/segment-outlet.tsx +1 -1
- package/src/client/shallow-url.ts +1 -1
- package/src/client/slot-outlet.tsx +1 -1
- package/src/client/slot-provider.tsx +1 -1
- package/src/client/ssr-data.ts +3 -3
- package/src/client/stale-client.ts +1 -1
- package/src/client/state.ts +4 -4
- package/src/client/top-loader.tsx +1 -1
- package/src/client/unload-guard.ts +1 -1
- package/src/client/use-cookie.ts +2 -2
- package/src/client/use-pathname.ts +2 -2
- package/src/client/use-pending-navigation.ts +1 -1
- package/src/client/use-query-states.ts +3 -3
- package/src/client/use-router.ts +2 -2
- package/src/client/use-search-params.ts +3 -3
- package/src/client/use-segment-params.ts +6 -6
- package/src/client/use-selected-layout-segment.ts +2 -2
- package/src/codec.ts +2 -2
- package/src/config-types.ts +27 -7
- package/src/config-validation.ts +1 -1
- package/src/cookies/define-cookie.ts +6 -6
- package/src/cookies/index.ts +3 -3
- package/src/cookies/json-cookie.ts +1 -1
- package/src/dev-tools/404-page.ts +4 -4
- package/src/dev-tools/dev-page-shell.ts +1 -1
- package/src/dev-tools/error-page.ts +4 -4
- package/src/dev-tools/index.ts +12 -12
- package/src/dev-tools/instrumentation.ts +1 -1
- package/src/dev-tools/logs.ts +1 -1
- package/src/dev-tools/overlay.ts +3 -3
- package/src/dev-tools/terminal.ts +2 -2
- package/src/fonts/ast.ts +5 -5
- package/src/fonts/bundle.ts +5 -5
- package/src/fonts/css.ts +1 -1
- package/src/fonts/dev-middleware.ts +2 -2
- package/src/fonts/google.ts +2 -2
- package/src/fonts/local.ts +4 -4
- package/src/fonts/pipeline.ts +8 -8
- package/src/fonts/transform.ts +5 -5
- package/src/fonts/types.ts +1 -1
- package/src/fonts/virtual-modules.ts +1 -1
- package/src/index.ts +46 -37
- package/src/params/codec-registry.ts +1 -1
- package/src/params/define-schema.ts +2 -2
- package/src/params/index.ts +4 -4
- package/src/params/resolve-schema.ts +2 -2
- package/src/plugin-context.ts +10 -10
- package/src/plugins/adapter-build.ts +5 -5
- package/src/plugins/build-manifest.ts +4 -4
- package/src/plugins/build-report.ts +6 -6
- package/src/plugins/cache.ts +3 -3
- package/src/plugins/callsite-ast.ts +1 -1
- package/src/plugins/callsite-jsx.ts +2 -2
- package/src/plugins/chunks.ts +1 -1
- package/src/plugins/cloudflare-wasm.ts +1 -1
- package/src/plugins/content.ts +5 -1
- package/src/plugins/dev-discovery.ts +218 -0
- package/src/plugins/dev-server.ts +97 -12
- package/src/plugins/entries.ts +1 -1
- package/src/plugins/fonts.ts +17 -10
- package/src/plugins/graph-endpoint.ts +532 -0
- package/src/plugins/mdx.ts +73 -38
- package/src/plugins/prebuilt-capture.ts +3 -3
- package/src/plugins/prebuilt-options-analysis.ts +1 -1
- package/src/plugins/prebuilt.ts +7 -7
- package/src/plugins/prerender-sugar.ts +11 -19
- package/src/plugins/request-dep/analysis.ts +1 -1
- package/src/plugins/request-dep/index.ts +8 -8
- package/src/plugins/request-dep/origin.ts +1 -1
- package/src/plugins/routing.ts +12 -7
- package/src/plugins/server-bundle.ts +11 -3
- package/src/plugins/shims.ts +16 -31
- package/src/plugins/static-build.ts +10 -10
- package/src/routing/codegen-shared.ts +1 -1
- package/src/routing/codegen-write.ts +3 -3
- package/src/routing/codegen.ts +14 -5
- package/src/routing/collision-probe.ts +3 -3
- package/src/routing/collision-spaces.ts +3 -3
- package/src/routing/convention-lint.ts +136 -6
- package/src/routing/export-detect.ts +1 -1
- package/src/routing/index.ts +13 -13
- package/src/routing/interception.ts +41 -4
- package/src/routing/link-codegen.ts +3 -3
- package/src/routing/manifest-codegen.ts +2 -2
- package/src/routing/scanner.ts +33 -9
- package/src/routing/schema-validation.ts +4 -4
- package/src/routing/segment-classify.ts +2 -2
- package/src/routing/segment-codegen.ts +1 -1
- package/src/routing/segment-keys.ts +1 -1
- package/src/routing/slot-placement.ts +1 -1
- package/src/routing/walkers.ts +1 -1
- package/src/rsc-runtime/transforms.ts +13 -0
- package/src/rsc-runtime/vendor-types.d.ts +12 -0
- package/src/schema-bridge.ts +1 -1
- package/src/search-params/define.ts +8 -8
- package/src/search-params/index.ts +3 -3
- package/src/search-params/wrappers.ts +3 -3
- package/src/server/access-gate.tsx +6 -6
- package/src/server/action-client.ts +5 -5
- package/src/server/action-handler.ts +16 -16
- package/src/server/actions.ts +5 -5
- package/src/server/als-registry.ts +8 -8
- package/src/server/asset-headers.ts +2 -2
- package/src/server/chain-url-parts.ts +5 -5
- package/src/server/children-interception.ts +4 -4
- package/src/server/compress.ts +1 -1
- package/src/server/cookie-context.ts +4 -4
- package/src/server/cookie-parsing.ts +2 -2
- package/src/server/default-logger.ts +3 -3
- package/src/server/deny-boundary.ts +10 -10
- package/src/server/deny-renderer.ts +38 -25
- package/src/server/early-hints-sender.ts +2 -2
- package/src/server/early-hints.ts +2 -2
- package/src/server/error-boundary-wrapper.ts +4 -12
- package/src/server/fallback-error.ts +13 -13
- package/src/server/flight-injection-state.ts +1 -1
- package/src/server/form-flash.ts +2 -2
- package/src/server/html-injector-core.ts +4 -4
- package/src/server/html-injectors.ts +5 -5
- package/src/server/index.ts +18 -18
- package/src/server/instrumentation.ts +1 -1
- package/src/server/internal.ts +50 -50
- package/src/server/logger.ts +4 -4
- package/src/server/metadata-collector.ts +7 -7
- package/src/server/metadata-platform.ts +2 -2
- package/src/server/metadata-render.ts +4 -4
- package/src/server/metadata-routes.ts +3 -3
- package/src/server/metadata-social.ts +2 -2
- package/src/server/metadata.ts +2 -2
- package/src/server/middleware-runner.ts +1 -1
- package/src/server/node-stream-transforms.ts +4 -4
- package/src/server/param-coercion.ts +8 -8
- package/src/server/pipeline-helpers.ts +7 -7
- package/src/server/pipeline-interception.ts +2 -2
- package/src/server/pipeline-metadata.ts +1 -1
- package/src/server/pipeline-outcome.ts +8 -8
- package/src/server/pipeline-phases.ts +24 -28
- package/src/server/pipeline.ts +22 -22
- package/src/server/prebuilt/cache-key.ts +1 -1
- package/src/server/prebuilt/capture-state.ts +1 -1
- package/src/server/prebuilt/key-discipline.ts +1 -1
- package/src/server/prebuilt/manifest-tag-index.ts +1 -1
- package/src/server/prebuilt/overlay.ts +6 -6
- package/src/server/prebuilt/payload-source.ts +2 -2
- package/src/server/prebuilt/slots.ts +5 -5
- package/src/server/prebuilt/synthetic-store.ts +2 -2
- package/src/server/prebuilt-builder.ts +16 -16
- package/src/server/prebuilt-runtime.ts +12 -12
- package/src/server/primitives.ts +7 -7
- package/src/server/publish-params.ts +3 -3
- package/src/server/request-context.ts +7 -7
- package/src/server/route-element-builder.ts +108 -50
- package/src/server/route-handler.ts +4 -4
- package/src/server/route-matcher.ts +5 -5
- package/src/server/rsc-cache-key-guard.ts +3 -5
- package/src/server/rsc-entry/action-middleware-runner.ts +7 -7
- package/src/server/rsc-entry/api-handler.ts +18 -9
- package/src/server/rsc-entry/deny-fallback.ts +10 -10
- package/src/server/rsc-entry/error-renderer.ts +27 -27
- package/src/server/rsc-entry/helpers.ts +10 -10
- package/src/server/rsc-entry/index.ts +51 -47
- package/src/server/rsc-entry/render-route.ts +20 -20
- package/src/server/rsc-entry/revalidate-renderer.ts +12 -12
- package/src/server/rsc-entry/rsc-payload.ts +19 -15
- package/src/server/rsc-entry/rsc-stream.ts +8 -8
- package/src/server/rsc-entry/ssr-bridge.ts +3 -3
- package/src/server/rsc-entry/ssr-renderer.ts +23 -23
- package/src/server/rsc-entry/wrap-action-dispatch.ts +9 -9
- package/src/server/rsc-prop-warnings.ts +1 -1
- package/src/server/sensitive-fields.ts +1 -1
- package/src/server/server-timing.ts +1 -1
- package/src/server/sitemap-generator.ts +3 -3
- package/src/server/sitemap-handler.ts +3 -3
- package/src/server/skippable-prefix.ts +7 -7
- package/src/server/slot-interception.ts +5 -5
- package/src/server/slot-resolver.ts +20 -28
- package/src/server/ssr-bridge-types.ts +2 -2
- package/src/server/ssr-entry.ts +18 -18
- package/src/server/ssr-render.ts +4 -4
- package/src/server/ssr-wrappers.tsx +1 -1
- package/src/server/state-tree-diff.ts +1 -1
- package/src/server/static-generator.ts +6 -6
- package/src/server/static-not-found.ts +3 -3
- package/src/server/status-code-resolver.ts +1 -1
- package/src/server/tracing.ts +5 -5
- package/src/server/tree-builder.ts +4 -4
- package/src/server/tree-match.ts +1 -1
- package/src/server/types.ts +2 -2
- package/src/server/utils/mdx-file.ts +2 -2
- package/src/server/waituntil-bridge.ts +1 -1
- package/src/server/workers-cache-bridge.ts +2 -2
- package/src/shared/als-slots.ts +1 -1
- package/src/shared/payload-root.ts +2 -2
- package/src/shared/rsc-media-type.ts +16 -0
- package/src/shared/slot-params.ts +1 -1
- package/src/shims/font-google.ts +1 -1
- package/src/shims/font-local.ts +1 -1
- package/src/shims/navigation-client.ts +5 -5
- package/src/shims/navigation.ts +2 -2
- package/LICENSE +0 -8
- package/dist/_chunks/actions-BjbbNRFN.js.map +0 -1
- package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +0 -1
- package/dist/_chunks/cache-api-DllJ-Lyw.js.map +0 -1
- package/dist/_chunks/cli-check-DJZDc22E.js.map +0 -1
- package/dist/_chunks/convention-lint-CpteIpTm.js.map +0 -1
- package/dist/_chunks/dist-BA3u1z3W.js +0 -423
- package/dist/_chunks/dist-BA3u1z3W.js.map +0 -1
- package/dist/_chunks/mdx-file-C005ay-P.js.map +0 -1
- package/dist/_chunks/plugin-context-rCinWLiE.js.map +0 -1
- package/dist/_chunks/scanner-CAietmj4.js.map +0 -1
- package/dist/content/index.d.ts +0 -2
- package/dist/content/index.d.ts.map +0 -1
- package/dist/content/index.js +0 -0
- package/src/content/index.ts +0 -5
- package/src/shims/server-only-noop.js +0 -6
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scan — project source-file disk scan shared by the crawl and the
|
|
3
|
+
* graph cache.
|
|
4
|
+
*
|
|
5
|
+
* One walker, one rule set: the crawl uses it to find files no graph
|
|
6
|
+
* reached (the provisional/pending set) and to bound graph membership,
|
|
7
|
+
* and the mtime-keyed graph cache fingerprints exactly the same file
|
|
8
|
+
* set — the three can never disagree about what "the project" is (a
|
|
9
|
+
* file the crawl classifies but the fingerprint ignores would make the
|
|
10
|
+
* cache silently stale).
|
|
11
|
+
*
|
|
12
|
+
* Skip rules are deliberately shallow: timber's router excludes only
|
|
13
|
+
* `_`-prefixed directories, so `app/.well-known/page.tsx` and
|
|
14
|
+
* `app/dist/page.tsx` are REAL routes — a rule that skipped `dist` or
|
|
15
|
+
* dot-directories at any depth would hide legitimate route files from
|
|
16
|
+
* the scan while the module graph still reached them (codex review,
|
|
17
|
+
* PR #1056). Therefore:
|
|
18
|
+
*
|
|
19
|
+
* - `node_modules` is skipped at ANY depth (never project source, and
|
|
20
|
+
* graph membership excludes it identically)
|
|
21
|
+
* - dot-prefixed and build-output directories (`dist`, `coverage`, …)
|
|
22
|
+
* are skipped only as the FIRST path segment under the root — that
|
|
23
|
+
* is where `.git`, `.timber`, `.wrangler`, and real build outputs
|
|
24
|
+
* live; deeper occurrences are walked
|
|
25
|
+
*
|
|
26
|
+
* Deliberately vite-free: the cache-hit path of `timber graph` reads
|
|
27
|
+
* this module without booting (or even importing) Vite.
|
|
28
|
+
*
|
|
29
|
+
* Design docs: 47-module-environment-tooling.md §2, §Cold-path policy.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { readdir } from 'node:fs/promises';
|
|
33
|
+
import { join } from 'node:path';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Slash-normalize a Windows path — Vite's `normalizePath` for the
|
|
37
|
+
* vite-free callers (the graph cache-hit path must not import Vite).
|
|
38
|
+
* Same platform guard as Vite's: posix paths pass through untouched,
|
|
39
|
+
* so a filename containing a literal backslash is never corrupted.
|
|
40
|
+
*/
|
|
41
|
+
export const normalizeSlashes: (path: string) => string =
|
|
42
|
+
process.platform === 'win32' ? (path) => path.replace(/\\/g, '/') : (path) => path;
|
|
43
|
+
|
|
44
|
+
/** A scan failure the caller records instead of swallowing. */
|
|
45
|
+
export interface ScanFailure {
|
|
46
|
+
dir: string;
|
|
47
|
+
message: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Directories never scanned when they are the first path segment under
|
|
52
|
+
* the root. `node_modules` is additionally skipped at any depth.
|
|
53
|
+
*/
|
|
54
|
+
export const SCAN_IGNORED_DIRS = new Set(['node_modules', 'dist', 'test-results', 'coverage']);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Single source of truth for builtin source extensions. Includes mdx —
|
|
58
|
+
* timber supports page.mdx via pageExtensions, so an unreferenced MDX
|
|
59
|
+
* page must not vanish from --all output.
|
|
60
|
+
*/
|
|
61
|
+
const BUILTIN_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'mts', 'cts', 'mdx'] as const;
|
|
62
|
+
|
|
63
|
+
/** Regex form of BUILTIN_EXTENSIONS for file-basename matching. */
|
|
64
|
+
export const SOURCE_EXTENSIONS = new RegExp(`\\.(?:${BUILTIN_EXTENSIONS.join('|')})$`);
|
|
65
|
+
|
|
66
|
+
/** Set form for O(1) membership checks. */
|
|
67
|
+
const BUILTIN_EXTENSION_SET = new Set<string>(BUILTIN_EXTENSIONS);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Build a regex that matches SOURCE_EXTENSIONS plus any extra
|
|
71
|
+
* extensions from the user's pageExtensions config. Returns the
|
|
72
|
+
* builtin regex unchanged when nothing new is added.
|
|
73
|
+
*/
|
|
74
|
+
export function buildSourceExtensions(pageExtensions?: readonly string[]): RegExp {
|
|
75
|
+
if (!pageExtensions) return SOURCE_EXTENSIONS;
|
|
76
|
+
const extras = pageExtensions.filter((ext) => !BUILTIN_EXTENSION_SET.has(ext));
|
|
77
|
+
if (extras.length === 0) return SOURCE_EXTENSIONS;
|
|
78
|
+
const escaped = extras.map((ext) => ext.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
|
79
|
+
return new RegExp(`\\.(?:${BUILTIN_EXTENSIONS.join('|')}|${escaped.join('|')})$`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Whether a directory SEGMENT is skipped at the given depth (0 = root child). */
|
|
83
|
+
function isSkippedDirSegment(segment: string, depth: number): boolean {
|
|
84
|
+
if (segment === 'node_modules') return true;
|
|
85
|
+
if (depth === 0 && (segment.startsWith('.') || SCAN_IGNORED_DIRS.has(segment))) return true;
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Whether a file basename is admitted as project source. */
|
|
90
|
+
function isSourceBasename(base: string, depth: number, extensions?: RegExp): boolean {
|
|
91
|
+
if (depth === 0 && base.startsWith('.')) return false;
|
|
92
|
+
if (!(extensions ?? SOURCE_EXTENSIONS).test(base)) return false;
|
|
93
|
+
// Declaration files are types-only — they never run in any environment.
|
|
94
|
+
if (/\.d\.[mc]?ts$/.test(base)) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Whether an absolute, slash-normalized path is one the scanner WOULD
|
|
100
|
+
* admit — the same segment rules the walker applies, so a
|
|
101
|
+
* directly-addressed path (`package.json`, `<root>/dist/generated.js`,
|
|
102
|
+
* `types.d.ts`, a nested node_modules file) is answered exactly the
|
|
103
|
+
* way the scan-based sweep would answer it: by exclusion. Existence
|
|
104
|
+
* and is-a-file checks remain the caller's (this is pure path logic).
|
|
105
|
+
*/
|
|
106
|
+
export function isScannableSourceFile(file: string, root: string, extensions?: RegExp): boolean {
|
|
107
|
+
if (!file.startsWith(root + '/')) return false;
|
|
108
|
+
const segments = file.slice(root.length + 1).split('/');
|
|
109
|
+
const base = segments[segments.length - 1];
|
|
110
|
+
for (let depth = 0; depth < segments.length - 1; depth++) {
|
|
111
|
+
if (isSkippedDirSegment(segments[depth], depth)) return false;
|
|
112
|
+
}
|
|
113
|
+
return isSourceBasename(base, segments.length - 1, extensions);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Recursively list project source files on disk.
|
|
118
|
+
*
|
|
119
|
+
* Unreadable directories are reported through `onFailure`, not thrown
|
|
120
|
+
* and not swallowed — this walker exists to keep files from silently
|
|
121
|
+
* vanishing, so a directory it cannot see must be visible too.
|
|
122
|
+
*/
|
|
123
|
+
export async function scanProjectSourceFiles(
|
|
124
|
+
dir: string,
|
|
125
|
+
out: string[],
|
|
126
|
+
onFailure: (failure: ScanFailure) => void,
|
|
127
|
+
depth = 0,
|
|
128
|
+
extensions?: RegExp
|
|
129
|
+
): Promise<void> {
|
|
130
|
+
let entries;
|
|
131
|
+
try {
|
|
132
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
133
|
+
} catch (error) {
|
|
134
|
+
onFailure({
|
|
135
|
+
dir,
|
|
136
|
+
message: `directory scan failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
for (const entry of entries) {
|
|
141
|
+
const full = join(dir, entry.name);
|
|
142
|
+
if (entry.isDirectory()) {
|
|
143
|
+
if (isSkippedDirSegment(entry.name, depth)) continue;
|
|
144
|
+
await scanProjectSourceFiles(full, out, onFailure, depth + 1, extensions);
|
|
145
|
+
} else if (entry.isFile() && isSourceBasename(entry.name, depth, extensions)) {
|
|
146
|
+
out.push(full);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
package/src/cache/cache-api.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { CacheOptions } from './index';
|
|
2
|
-
import type { PrebuiltComponentOptions } from '../server/prebuilt-runtime';
|
|
3
|
-
import { createCache } from './timber-cache';
|
|
4
|
-
import { getCacheHandler } from './handler-store';
|
|
5
|
-
import { recordInvalidation } from './invalidation-epoch';
|
|
6
|
-
import { writeTombstonesForTag } from '../server/prebuilt/overlay.
|
|
7
|
-
import { getCdnPurgeHandler } from '../cdn/purge-store.
|
|
1
|
+
import type { CacheOptions } from './index.ts';
|
|
2
|
+
import type { PrebuiltComponentOptions } from '../server/prebuilt-runtime.ts';
|
|
3
|
+
import { createCache } from './timber-cache.ts';
|
|
4
|
+
import { getCacheHandler } from './handler-store.ts';
|
|
5
|
+
import { recordInvalidation } from './invalidation-epoch.ts';
|
|
6
|
+
import { writeTombstonesForTag } from '../server/prebuilt/overlay.ts';
|
|
7
|
+
import { getCdnPurgeHandler } from '../cdn/purge-store.ts';
|
|
8
8
|
|
|
9
9
|
const componentFallbackWarned = new WeakSet<object>();
|
|
10
10
|
|
package/src/cache/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @timber-js/app/cache — Caching primitives
|
|
2
2
|
|
|
3
|
-
import { estimateByteSize } from './sizeof.
|
|
3
|
+
import { estimateByteSize } from './sizeof.ts';
|
|
4
4
|
|
|
5
5
|
export interface CacheHandler {
|
|
6
6
|
get(key: string): Promise<{ value: unknown; stale: boolean } | null>;
|
|
@@ -166,18 +166,18 @@ export class MemoryCacheHandler implements CacheHandler {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
export { RedisCacheHandler } from './redis-handler';
|
|
170
|
-
export type { RedisClient, RedisWriteOp } from './redis-handler';
|
|
171
|
-
export { cache } from './cache-api';
|
|
172
|
-
export { setCacheHandler, getCacheHandler } from './handler-store';
|
|
173
|
-
export { setDefaultSingleflightTimeout } from './timber-cache';
|
|
169
|
+
export { RedisCacheHandler } from './redis-handler.ts';
|
|
170
|
+
export type { RedisClient, RedisWriteOp } from './redis-handler.ts';
|
|
171
|
+
export { cache } from './cache-api.ts';
|
|
172
|
+
export { setCacheHandler, getCacheHandler } from './handler-store.ts';
|
|
173
|
+
export { setDefaultSingleflightTimeout } from './timber-cache.ts';
|
|
174
174
|
// NOTE: registerCachedFunction (runtime for 'use cache' directive) removed.
|
|
175
175
|
// Future feature pending design doc. See design/06-caching.md.
|
|
176
|
-
export { estimateByteSize } from './sizeof';
|
|
176
|
+
export { estimateByteSize } from './sizeof.ts';
|
|
177
177
|
|
|
178
178
|
// --- Cache Store layering (design/46) ---
|
|
179
|
-
export { TagAwareCacheHandler } from './tag-aware-handler';
|
|
180
|
-
export type { CacheStore } from './store';
|
|
179
|
+
export { TagAwareCacheHandler } from './tag-aware-handler.ts';
|
|
180
|
+
export type { CacheStore } from './store.ts';
|
|
181
181
|
// stableStringify, createSingleflight, and SingleflightTimeoutError are
|
|
182
182
|
// internal utilities used by the cache implementation. They are not
|
|
183
183
|
// re-exported here — import directly from the source files if needed
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CacheHandler } from './index';
|
|
2
|
-
import { warnLossyJsonValue } from './json-lossy-check.
|
|
1
|
+
import type { CacheHandler } from './index.ts';
|
|
2
|
+
import { warnLossyJsonValue } from './json-lossy-check.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Minimal Redis client contract for `RedisCacheHandler`.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* consistency model (use short TTLs for security-critical invalidation).
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { CacheStore } from '../store';
|
|
15
|
+
import type { CacheStore } from '../store.ts';
|
|
16
16
|
|
|
17
17
|
export interface CloudflareKVNamespace {
|
|
18
18
|
get(key: string, options?: { type?: string }): Promise<string | null>;
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* set size on invalidation, not to memory — stale memberships are just strings.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { CacheStore } from '../store';
|
|
16
|
-
import { estimateByteSize } from '../sizeof.
|
|
15
|
+
import type { CacheStore } from '../store.ts';
|
|
16
|
+
import { estimateByteSize } from '../sizeof.ts';
|
|
17
17
|
|
|
18
18
|
export interface MemoryStoreOptions {
|
|
19
19
|
maxEntries?: number;
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* Implements the CacheHandler interface consumed by timber-cache.ts.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { CacheHandler } from './index';
|
|
23
|
-
import type { CacheStore } from './store';
|
|
22
|
+
import type { CacheHandler } from './index.ts';
|
|
23
|
+
import type { CacheStore } from './store.ts';
|
|
24
24
|
|
|
25
25
|
const DATA_PREFIX = 'd:';
|
|
26
26
|
const TAG_SET_PREFIX = 'ts:';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CacheHandler, CacheOptions } from './index';
|
|
2
|
-
import { stableStringify } from './stable-stringify';
|
|
3
|
-
import { createSingleflight } from './singleflight';
|
|
1
|
+
import type { CacheHandler, CacheOptions } from './index.ts';
|
|
2
|
+
import { stableStringify } from './stable-stringify.ts';
|
|
3
|
+
import { createSingleflight } from './singleflight.ts';
|
|
4
4
|
import {
|
|
5
5
|
currentInvalidationEpoch,
|
|
6
6
|
lastInvalidationEpochFor,
|
|
7
7
|
wasInvalidatedSince,
|
|
8
|
-
} from './invalidation-epoch';
|
|
9
|
-
import { addSpanEventSync } from '../server/tracing.
|
|
10
|
-
import { logSwrRefetchFailed, swallow } from '../server/logger.
|
|
11
|
-
import { getWaitUntil } from '../server/waituntil-bridge.
|
|
12
|
-
import { fnv1aHash } from './fast-hash.
|
|
8
|
+
} from './invalidation-epoch.ts';
|
|
9
|
+
import { addSpanEventSync } from '../server/tracing.ts';
|
|
10
|
+
import { logSwrRefetchFailed, swallow } from '../server/logger.ts';
|
|
11
|
+
import { getWaitUntil } from '../server/waituntil-bridge.ts';
|
|
12
|
+
import { fnv1aHash } from './fast-hash.ts';
|
|
13
13
|
|
|
14
14
|
let defaultSingleflight = createSingleflight();
|
|
15
15
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* See https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { CdnPurgeHandler } from './purge-store';
|
|
8
|
+
import type { CdnPurgeHandler } from './purge-store.ts';
|
|
9
9
|
|
|
10
10
|
export interface CloudflarePurgeOptions {
|
|
11
11
|
/** Cloudflare zone ID. */
|
package/src/cdn/fastly-purge.ts
CHANGED
package/src/cdn/index.ts
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
// Header utilities and purge handler for CDN caching. Developer-elected,
|
|
4
4
|
// never automatic. See design/25-production-deployments.md §Layer 2.
|
|
5
5
|
|
|
6
|
-
export {
|
|
7
|
-
|
|
6
|
+
export {
|
|
7
|
+
cacheControl,
|
|
8
|
+
surrogateKey,
|
|
9
|
+
surrogateControl,
|
|
10
|
+
cdnCacheControl,
|
|
11
|
+
cacheTag,
|
|
12
|
+
} from './headers.ts';
|
|
13
|
+
export type { CacheControlOptions, SurrogateControlOptions } from './headers.ts';
|
|
8
14
|
|
|
9
|
-
export { setCdnPurgeHandler, getCdnPurgeHandler } from './purge-store';
|
|
10
|
-
export type { CdnPurgeHandler } from './purge-store';
|
|
15
|
+
export { setCdnPurgeHandler, getCdnPurgeHandler } from './purge-store.ts';
|
|
16
|
+
export type { CdnPurgeHandler } from './purge-store.ts';
|
|
11
17
|
|
|
12
18
|
// Platform-specific purge handlers are at their own entry points:
|
|
13
19
|
// @timber-js/app/cdn/cloudflare → CloudflarePurge (REST API, Enterprise)
|
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
* Available on ALL Cloudflare plans (no Enterprise requirement).
|
|
6
6
|
* No API token needed — uses the Workers runtime's built-in cache API.
|
|
7
7
|
*
|
|
8
|
+
* ctx.cache.purge() operates on the same underlying Cloudflare CDN cache
|
|
9
|
+
* as caches.default — entries stored via cache.put() with matching
|
|
10
|
+
* Cache-Tag headers are purged (TIM-1172). See design/25 §TIM-1172.
|
|
11
|
+
*
|
|
8
12
|
* Auto-wired by the Cloudflare adapter when no user-configured CDN
|
|
9
13
|
* purge handler is set. Uses the Workers Cache ALS bridge to access
|
|
10
14
|
* ctx.cache from within the request context.
|
|
11
15
|
*/
|
|
12
16
|
|
|
13
|
-
import type { CdnPurgeHandler } from './purge-store';
|
|
14
|
-
import { getWorkersCachePurgeCtx } from '../server/workers-cache-bridge.
|
|
17
|
+
import type { CdnPurgeHandler } from './purge-store.ts';
|
|
18
|
+
import { getWorkersCachePurgeCtx } from '../server/workers-cache-bridge.ts';
|
|
15
19
|
|
|
16
20
|
export class WorkersCachePurge implements CdnPurgeHandler {
|
|
17
21
|
async purgeTags(tags: string[]): Promise<void> {
|
package/src/cli-check.ts
CHANGED
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
import { createRequire } from 'node:module';
|
|
34
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
34
35
|
import { dirname, join, resolve } from 'node:path';
|
|
35
|
-
import { scanRoutes } from './routing/scanner.
|
|
36
|
-
import { lintConventions, formatConventionWarnings } from './routing/convention-lint.
|
|
37
|
-
import { writeRouteCodegen, CODEGEN_OUTPUT, ENV_DTS_FILENAME } from './routing/codegen-write.
|
|
38
|
-
import { isTimberPluginApi } from './plugin-context.
|
|
36
|
+
import { scanRoutes } from './routing/scanner.ts';
|
|
37
|
+
import { lintConventions, formatConventionWarnings } from './routing/convention-lint.ts';
|
|
38
|
+
import { writeRouteCodegen, CODEGEN_OUTPUT, ENV_DTS_FILENAME } from './routing/codegen-write.ts';
|
|
39
|
+
import { isTimberPluginApi } from './plugin-context.ts';
|
|
39
40
|
|
|
40
41
|
/** The plugin that publishes timber's resolved context on its Vite `api`. */
|
|
41
42
|
const TIMBER_ROOT_SYNC_PLUGIN = 'timber-root-sync';
|
|
@@ -292,10 +293,58 @@ export async function checkRoutes(
|
|
|
292
293
|
);
|
|
293
294
|
}
|
|
294
295
|
|
|
296
|
+
verifyCodegenImports(root);
|
|
297
|
+
|
|
295
298
|
// Returned so the type pass runs against the same root these files landed in.
|
|
296
299
|
return inputs;
|
|
297
300
|
}
|
|
298
301
|
|
|
302
|
+
/**
|
|
303
|
+
* Verify that the import specifiers in the generated route types resolve on the
|
|
304
|
+
* filesystem. A `.d.ts` whose import fails does NOT produce a TypeScript error —
|
|
305
|
+
* every type that depends on it silently becomes `any`. The generated file
|
|
306
|
+
* contains type-level `_AssertSchemaNotAny` / `_AssertCodecTypeNotAny` guards
|
|
307
|
+
* that catch this at typecheck time, but a diagnostic here fires earlier and
|
|
308
|
+
* names the exact import that is broken rather than leaving the user to decode
|
|
309
|
+
* a constraint error.
|
|
310
|
+
*/
|
|
311
|
+
export function verifyCodegenImports(root: string): void {
|
|
312
|
+
const dtsPath = join(root, CODEGEN_OUTPUT);
|
|
313
|
+
let content: string;
|
|
314
|
+
try {
|
|
315
|
+
content = readFileSync(dtsPath, 'utf-8');
|
|
316
|
+
} catch {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const dtsDir = dirname(dtsPath);
|
|
321
|
+
|
|
322
|
+
// Check relative imports (default imports only — the generated codegen uses
|
|
323
|
+
// `import type schema from '...'` for relative paths). Named imports from
|
|
324
|
+
// relative paths are not emitted today; if codegen adds them, extend this.
|
|
325
|
+
const RELATIVE_IMPORT_RE = /^import\s+type\s+\w+\s+from\s+'(\.\.?\/[^']+)'/gm;
|
|
326
|
+
const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '/index.ts', '/index.tsx'];
|
|
327
|
+
let match;
|
|
328
|
+
while ((match = RELATIVE_IMPORT_RE.exec(content)) !== null) {
|
|
329
|
+
const specifier = match[1];
|
|
330
|
+
const base = join(dtsDir, specifier);
|
|
331
|
+
const resolves = existsSync(base) || EXTENSIONS.some((ext) => existsSync(base + ext));
|
|
332
|
+
if (!resolves) {
|
|
333
|
+
process.stderr.write(
|
|
334
|
+
`[timber] WARNING: the generated ${CODEGEN_OUTPUT} imports '${specifier}',\n` +
|
|
335
|
+
` but no file resolves at ${base}{${EXTENSIONS.join(',')}}.\n` +
|
|
336
|
+
` Every type that depends on this import will silently become \`any\`.\n\n` +
|
|
337
|
+
` Check that your app/ directory is where timber expects it.\n\n`
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Bare-specifier imports (`@timber-js/app/params`) are NOT checked here.
|
|
343
|
+
// They are all dependencies of @timber-js/app itself — if timber is installed,
|
|
344
|
+
// they resolve. And createRequire uses CJS resolution which cannot follow
|
|
345
|
+
// ESM-only subpath exports, producing false warnings (TIM-1348 review).
|
|
346
|
+
}
|
|
347
|
+
|
|
299
348
|
/**
|
|
300
349
|
* The production `RunTsgo`: spawn the compiler with its stdio inherited, so its
|
|
301
350
|
* diagnostics stream to the terminal as they are produced (and are not capped
|
package/src/cli-schema-sync.ts
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
|
-
import { scanRoutes } from './routing/scanner.
|
|
12
|
-
import type { SegmentNode } from './routing/types.
|
|
13
|
-
import { resolveAppDir } from './plugin-context.
|
|
11
|
+
import { scanRoutes } from './routing/scanner.ts';
|
|
12
|
+
import type { SegmentNode } from './routing/types.ts';
|
|
13
|
+
import { resolveAppDir } from './plugin-context.ts';
|
|
14
14
|
|
|
15
15
|
function toBracketKey(node: SegmentNode): string {
|
|
16
16
|
if (node.paramPrefix || node.paramSuffix) return `[${node.paramName}]`;
|
package/src/cli.ts
CHANGED
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
// timber build — Run multi-environment build via createBuilder/buildApp
|
|
11
11
|
// timber preview — Serve the production build
|
|
12
12
|
// timber check — Validate types + routes without building
|
|
13
|
+
// timber graph — Classify a file's module environment(s) (design/47)
|
|
13
14
|
|
|
14
15
|
// Type-only — the implementation is imported dynamically inside runCheck so the
|
|
15
16
|
// CLI's other commands never load the route scanner.
|
|
16
|
-
import type { CheckDeps } from './cli-check.
|
|
17
|
+
import type { CheckDeps } from './cli-check.ts';
|
|
17
18
|
|
|
18
19
|
export type { CheckDeps };
|
|
19
20
|
|
|
20
|
-
const COMMANDS = ['dev', 'build', 'preview', 'check', 'schema', 'init'] as const;
|
|
21
|
+
const COMMANDS = ['dev', 'build', 'preview', 'check', 'schema', 'init', 'graph'] as const;
|
|
21
22
|
type Command = (typeof COMMANDS)[number];
|
|
22
23
|
|
|
23
24
|
export interface ParsedArgs {
|
|
@@ -25,7 +26,11 @@ export interface ParsedArgs {
|
|
|
25
26
|
config: string | undefined;
|
|
26
27
|
/** `--project`: the tsconfig `timber check` passes to tsgo. */
|
|
27
28
|
project: string | undefined;
|
|
28
|
-
/**
|
|
29
|
+
/** `timber graph` only: emit the machine-readable JSON contract. */
|
|
30
|
+
json: boolean;
|
|
31
|
+
/** `timber graph` only: classify the whole project. */
|
|
32
|
+
all: boolean;
|
|
33
|
+
/** Positional arguments after the command (`schema sync`, `graph <file>`). */
|
|
29
34
|
rest: string[];
|
|
30
35
|
}
|
|
31
36
|
|
|
@@ -54,11 +59,15 @@ export interface CommandOptions {
|
|
|
54
59
|
* starting on the default port would contradict fail-loudly. The surface stays
|
|
55
60
|
* deliberately small (design/11-platform.md §CLI); port selection goes through
|
|
56
61
|
* the PORT env var or server.port in vite.config.ts.
|
|
62
|
+
*
|
|
63
|
+
* Each subcommand declares its exact flags (the `check --project` precedent,
|
|
64
|
+
* TIM-1332): `graph` additionally accepts a file positional plus `--json` and
|
|
65
|
+
* `--all`, and those two are rejected everywhere else.
|
|
57
66
|
*/
|
|
58
67
|
export function parseArgs(args: string[]): ParsedArgs {
|
|
59
68
|
if (args.length === 0) {
|
|
60
69
|
throw new Error(
|
|
61
|
-
'No command provided. Usage: timber <dev|build|preview|check|schema|init> [--config <path>]'
|
|
70
|
+
'No command provided. Usage: timber <dev|build|preview|check|schema|init|graph> [--config <path>]'
|
|
62
71
|
);
|
|
63
72
|
}
|
|
64
73
|
|
|
@@ -69,6 +78,8 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
69
78
|
|
|
70
79
|
let config: string | undefined;
|
|
71
80
|
let project: string | undefined;
|
|
81
|
+
let json = false;
|
|
82
|
+
let all = false;
|
|
72
83
|
const rest: string[] = [];
|
|
73
84
|
for (let i = 1; i < args.length; i++) {
|
|
74
85
|
const arg = args[i];
|
|
@@ -77,6 +88,14 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
77
88
|
if (!config) {
|
|
78
89
|
throw new Error('--config requires a path argument');
|
|
79
90
|
}
|
|
91
|
+
} else if (arg === '--json' || arg === '--all') {
|
|
92
|
+
if (command !== 'graph') {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`${arg} is only valid for \`timber graph\` (the module-environment query).`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
if (arg === '--json') json = true;
|
|
98
|
+
else all = true;
|
|
80
99
|
} else if (arg === '--project') {
|
|
81
100
|
if (command !== 'check') {
|
|
82
101
|
throw new Error(
|
|
@@ -98,14 +117,20 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
98
117
|
`Unknown option: ${arg}. The timber CLI accepts --config <path>` +
|
|
99
118
|
` (and --project <path> for \`check\`).${portHint}`
|
|
100
119
|
);
|
|
101
|
-
} else if (command === 'schema' || command === 'init') {
|
|
120
|
+
} else if (command === 'schema' || command === 'init' || command === 'graph') {
|
|
102
121
|
rest.push(arg);
|
|
103
122
|
} else {
|
|
104
123
|
throw new Error(`Unexpected argument: ${arg}. Usage: timber ${command} [--config <path>]`);
|
|
105
124
|
}
|
|
106
125
|
}
|
|
107
126
|
|
|
108
|
-
|
|
127
|
+
if (command === 'graph' && rest.length > 1) {
|
|
128
|
+
throw new Error(
|
|
129
|
+
`timber graph takes one file. Usage: timber graph <file> [--json], or timber graph --all --json`
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return { command: command as Command, config, project, json, all, rest };
|
|
109
134
|
}
|
|
110
135
|
|
|
111
136
|
// ─── Command Implementations ─────────────────────────────────────────────────
|
|
@@ -153,7 +178,7 @@ export async function runBuild(options: CommandOptions, _deps?: ViteDeps): Promi
|
|
|
153
178
|
* Exported for testing — the actual runPreview function uses this internally.
|
|
154
179
|
*/
|
|
155
180
|
export function resolvePreviewStrategy(
|
|
156
|
-
adapter: import('./adapters/types').TimberPlatformAdapter | undefined
|
|
181
|
+
adapter: import('./adapters/types.ts').TimberPlatformAdapter | undefined
|
|
157
182
|
): 'adapter' | 'vite' {
|
|
158
183
|
if (adapter && typeof adapter.preview === 'function') {
|
|
159
184
|
return 'adapter';
|
|
@@ -172,11 +197,13 @@ export function resolvePreviewStrategy(
|
|
|
172
197
|
* Vite preview. See TIM-1066.
|
|
173
198
|
*/
|
|
174
199
|
export async function runPreview(options: CommandOptions, _deps?: ViteDeps): Promise<void> {
|
|
175
|
-
const { loadTimberConfigFile, resolveBuildDir } = await import('./plugin-context.
|
|
200
|
+
const { loadTimberConfigFile, resolveBuildDir } = await import('./plugin-context.ts');
|
|
176
201
|
|
|
177
202
|
const root = process.cwd();
|
|
178
203
|
const config = loadTimberConfigFile(root);
|
|
179
|
-
const adapter = config?.adapter as
|
|
204
|
+
const adapter = config?.adapter as
|
|
205
|
+
| import('./adapters/types.ts').TimberPlatformAdapter
|
|
206
|
+
| undefined;
|
|
180
207
|
|
|
181
208
|
if (resolvePreviewStrategy(adapter) === 'adapter') {
|
|
182
209
|
const buildDir = resolveBuildDir(root, config?.buildDir);
|
|
@@ -208,7 +235,7 @@ export async function runPreview(options: CommandOptions, _deps?: ViteDeps): Pro
|
|
|
208
235
|
* `--project` names the tsconfig handed to tsgo.
|
|
209
236
|
*/
|
|
210
237
|
export async function runCheck(options: CommandOptions, _deps?: CheckDeps): Promise<void> {
|
|
211
|
-
const { checkRoutes, runTypeCheck } = await import('./cli-check.
|
|
238
|
+
const { checkRoutes, runTypeCheck } = await import('./cli-check.ts');
|
|
212
239
|
const { root } = await checkRoutes({ viteConfigFile: options.config }, _deps);
|
|
213
240
|
// tsgo runs from the root the route pass resolved, not from cwd — that is
|
|
214
241
|
// where it just wrote the declarations tsgo has to read.
|
|
@@ -232,7 +259,7 @@ export async function runSchema(args: string[]): Promise<void> {
|
|
|
232
259
|
);
|
|
233
260
|
}
|
|
234
261
|
|
|
235
|
-
const { runSchemaSync, defaultCodecForSegment } = await import('./cli-schema-sync.
|
|
262
|
+
const { runSchemaSync, defaultCodecForSegment } = await import('./cli-schema-sync.ts');
|
|
236
263
|
const result = runSchemaSync(process.cwd());
|
|
237
264
|
|
|
238
265
|
if (result.filesystemSegments.length === 0) {
|
|
@@ -361,6 +388,18 @@ async function main(): Promise<void> {
|
|
|
361
388
|
case 'init':
|
|
362
389
|
await runInit();
|
|
363
390
|
break;
|
|
391
|
+
case 'graph': {
|
|
392
|
+
// Lazy import — the graph implementation (and, on a cache miss,
|
|
393
|
+
// Vite + the crawl child) never loads for the other commands.
|
|
394
|
+
const { runGraph } = await import('./analyze/graph-command.ts');
|
|
395
|
+
await runGraph({
|
|
396
|
+
file: parsed.rest[0],
|
|
397
|
+
config: parsed.config,
|
|
398
|
+
json: parsed.json,
|
|
399
|
+
all: parsed.all,
|
|
400
|
+
});
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
364
403
|
}
|
|
365
404
|
}
|
|
366
405
|
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See design/08-forms-and-actions.md §"Client-Side Form Mechanics"
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { setServerCallback, encodeReply, createFromFetch } from '../../rsc-runtime/browser.
|
|
17
|
+
import { setServerCallback, encodeReply, createFromFetch } from '../../rsc-runtime/browser.ts';
|
|
18
18
|
import { getRouter, getRouterOrNull } from '#client-internal';
|
|
19
|
-
import { setHardNavigating } from '../navigation-root.
|
|
20
|
-
import { getClientDeploymentId, DEPLOYMENT_ID_HEADER, RELOAD_HEADER } from '../rsc-fetch.
|
|
21
|
-
import { markClientStale } from '../stale-client.
|
|
22
|
-
import { RSC_CONTENT_TYPE } from '../../shared/rsc-media-type.
|
|
19
|
+
import { setHardNavigating } from '../navigation-root.tsx';
|
|
20
|
+
import { getClientDeploymentId, DEPLOYMENT_ID_HEADER, RELOAD_HEADER } from '../rsc-fetch.ts';
|
|
21
|
+
import { markClientStale } from '../stale-client.ts';
|
|
22
|
+
import { RSC_CONTENT_TYPE } from '../../shared/rsc-media-type.ts';
|
|
23
23
|
export function setupServerActions(): void {
|
|
24
24
|
setServerCallback(async (id: string, args: unknown[]) => {
|
|
25
25
|
const body = await encodeReply(args);
|