@timber-js/app 0.2.0-alpha.234 → 0.2.0-alpha.236
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-CYjRMpZI.js → actions-Top9GftB.js} +3 -3
- package/dist/_chunks/{actions-CYjRMpZI.js.map → actions-Top9GftB.js.map} +1 -1
- package/dist/_chunks/{cache-api-BZJNt01a.js → cache-api-Bo8c7XVF.js} +6 -6
- package/dist/_chunks/{cache-api-BZJNt01a.js.map → cache-api-Bo8c7XVF.js.map} +1 -1
- package/dist/_chunks/{chains-D-RRc7CM.js → chains-BsGKkMTK.js} +2 -2
- package/dist/_chunks/{chains-D-RRc7CM.js.map → chains-BsGKkMTK.js.map} +1 -1
- package/dist/_chunks/chains-DHmoKxkO.js +1 -0
- package/dist/_chunks/{classify-_W0RWa5w.js → classify-cmE0Gins.js} +2 -2
- package/dist/_chunks/{classify-_W0RWa5w.js.map → classify-cmE0Gins.js.map} +1 -1
- package/dist/_chunks/{cli-check-BAKOSTkg.js → cli-check-BwiahbTC.js} +5 -5
- package/dist/_chunks/{cli-check-BAKOSTkg.js.map → cli-check-BwiahbTC.js.map} +1 -1
- package/dist/_chunks/{cli-context-BPdyA7Fp.js → cli-context-BbwVqarO.js} +1 -1
- package/dist/_chunks/{cli-context-CwTKMjVe.js → cli-context-DZh5v0yd.js} +2 -2
- package/dist/_chunks/{cli-context-CwTKMjVe.js.map → cli-context-DZh5v0yd.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-CAllbqRB.js → cli-schema-sync-B2ldclRO.js} +3 -3
- package/dist/_chunks/{cli-schema-sync-CAllbqRB.js.map → cli-schema-sync-B2ldclRO.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-y_8ijmzO.js → cli-schema-sync-Brw7kTmm.js} +1 -1
- package/dist/_chunks/{client-dep-entries-C9hv-3k9.js → client-dep-entries-C1nMlLKV.js} +2 -2
- package/dist/_chunks/{client-dep-entries-C9hv-3k9.js.map → client-dep-entries-C1nMlLKV.js.map} +1 -1
- package/dist/_chunks/{cloudflare-_2fhxQE8.js → cloudflare-Dk5Hqo-O.js} +3 -3
- package/dist/_chunks/{cloudflare-_2fhxQE8.js.map → cloudflare-Dk5Hqo-O.js.map} +1 -1
- package/dist/_chunks/{convention-lint-D54k6uUM.js → convention-lint-CLpuzY5h.js} +3 -3
- package/dist/_chunks/{convention-lint-D54k6uUM.js.map → convention-lint-CLpuzY5h.js.map} +1 -1
- package/dist/_chunks/dev-server-BGGGhHXx.js +1 -0
- package/dist/_chunks/{dev-server-Rq659RR1.js → dev-server-lrdpD7Ws.js} +122 -6
- package/dist/_chunks/dev-server-lrdpD7Ws.js.map +1 -0
- package/dist/_chunks/{dev-span-_NzMX-au.js → dev-span-RsVeYYc_.js} +5 -2
- package/dist/_chunks/dev-span-RsVeYYc_.js.map +1 -0
- package/dist/_chunks/{error-boundary-Cf1m-Ywk.js → error-boundary-Bh-egWUI.js} +6 -6
- package/dist/_chunks/{error-boundary-Cf1m-Ywk.js.map → error-boundary-Bh-egWUI.js.map} +1 -1
- package/dist/_chunks/{flight-source-node-BGanuoSS.js → flight-source-node-BO_xD9jC.js} +2 -2
- package/dist/_chunks/{flight-source-node-BGanuoSS.js.map → flight-source-node-BO_xD9jC.js.map} +1 -1
- package/dist/_chunks/{href-BtspoNc9.js → href-8l5VD23D.js} +2 -2
- package/dist/_chunks/{href-BtspoNc9.js.map → href-8l5VD23D.js.map} +1 -1
- package/dist/_chunks/{json-lossy-check-BXM45k8p.js → json-lossy-check-D47R9Fp5.js} +2 -2
- package/dist/_chunks/{json-lossy-check-BXM45k8p.js.map → json-lossy-check-D47R9Fp5.js.map} +1 -1
- package/dist/_chunks/{live-graph-C7-yA8W9.js → live-graph-ChuFfmLi.js} +4 -4
- package/dist/_chunks/{live-graph-C7-yA8W9.js.map → live-graph-ChuFfmLi.js.map} +1 -1
- package/dist/_chunks/{logger-YtMSKfft.js → logger-DDLtp5e-.js} +16 -1
- package/dist/_chunks/logger-DDLtp5e-.js.map +1 -0
- package/dist/_chunks/navigation-root-Cvb7P1ud.js.map +1 -1
- package/dist/_chunks/{node-response-D3hXWb8y.js → node-response-DNNnKnoS.js} +2 -2
- package/dist/_chunks/{node-response-D3hXWb8y.js.map → node-response-DNNnKnoS.js.map} +1 -1
- package/dist/_chunks/{plugin-context-FCkaNLUB.js → plugin-context-BtaQcMuh.js} +2 -2
- package/dist/_chunks/{plugin-context-FCkaNLUB.js.map → plugin-context-BtaQcMuh.js.map} +1 -1
- package/dist/_chunks/{plugin-context-BfSRKJfz.js → plugin-context-I1dvGccO.js} +1 -1
- package/dist/_chunks/{poison-scan-CRSP06Es.js → poison-scan-CJ9QfJWb.js} +2 -2
- package/dist/_chunks/{poison-scan-CRSP06Es.js.map → poison-scan-CJ9QfJWb.js.map} +1 -1
- package/dist/_chunks/{scanner-BNQ4qnLX.js → scanner-CrB_h6FA.js} +5 -5
- package/dist/_chunks/{scanner-BNQ4qnLX.js.map → scanner-CrB_h6FA.js.map} +1 -1
- package/dist/_chunks/{sizeof-Cmx6Fs-Y.js → sizeof-DVhEVN_y.js} +2 -2
- package/dist/_chunks/{sizeof-Cmx6Fs-Y.js.map → sizeof-DVhEVN_y.js.map} +1 -1
- package/dist/_chunks/{walkers-D_QHR_nf.js → walkers-BUvpsb2Q.js} +3 -3
- package/dist/_chunks/{walkers-D_QHR_nf.js.map → walkers-BUvpsb2Q.js.map} +1 -1
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +2 -2
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/nitro.js +1 -1
- package/dist/analyze/crawl-entry.js +4 -4
- package/dist/analyze/graph-command.js +5 -5
- package/dist/cache/index.js +2 -2
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cli.js +6 -6
- package/dist/client/dev-pill/index.d.ts +2 -1
- package/dist/client/dev-pill/index.d.ts.map +1 -1
- package/dist/client/dev-pill/store.d.ts +0 -18
- package/dist/client/dev-pill/store.d.ts.map +1 -1
- package/dist/client/dev-pill/view.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/internal.js +3 -3
- package/dist/cookies/index.js +1 -1
- package/dist/dev-tools/await-span.d.ts +12 -1
- package/dist/dev-tools/await-span.d.ts.map +1 -1
- package/dist/dev-tools/instrumentation.d.ts.map +1 -1
- package/dist/dev-tools/logger.d.ts +8 -2
- package/dist/dev-tools/logger.d.ts.map +1 -1
- package/dist/dev-tools/span-sink.d.ts +9 -1
- package/dist/dev-tools/span-sink.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +183 -40
- package/dist/index.js.map +1 -1
- package/dist/native/rsc/_react/chunks/{react-server-dom-webpack-server.node.development-hQ_odxIB.js → react-server-dom-webpack-server.node.development-CAttMzVD.js} +2 -2
- package/dist/native/rsc/_react/flight-client.js +2 -2
- package/dist/native/rsc/_react/flight-server.js +1 -1
- package/dist/native/rsc/_react/flight-static.js +1 -1
- package/dist/native/rsc/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/native/rsc/adapters/cloudflare.js +2 -2
- package/dist/native/rsc/cache/cache-api.js +3 -3
- package/dist/native/rsc/cache/index.js +3 -3
- package/dist/native/rsc/cache/timber-cache.js +2 -2
- package/dist/native/rsc/cdn/index.js +1 -1
- package/dist/native/rsc/client/use-cookie.js +1 -1
- package/dist/native/rsc/dev-tools/404-page.js +1 -1
- package/dist/native/rsc/dev-tools/await-span.js +10 -7
- package/dist/native/rsc/dev-tools/await-span.js.map +1 -1
- package/dist/native/rsc/dev-tools/error-page.js +2 -2
- package/dist/native/rsc/dev-tools/instrumentation.js +38 -3
- package/dist/native/rsc/dev-tools/instrumentation.js.map +1 -1
- package/dist/native/rsc/dev-tools/logger.js +123 -80
- package/dist/native/rsc/dev-tools/logger.js.map +1 -1
- package/dist/native/rsc/dev-tools/span-sink.js +1 -0
- package/dist/native/rsc/dev-tools/span-sink.js.map +1 -1
- package/dist/native/rsc/dev-tools/terminal.js +1 -1
- package/dist/native/rsc/manifest.json +2 -2
- package/dist/native/rsc/params/index.js +1 -1
- package/dist/native/rsc/routing/collision-probe.js +1 -1
- package/dist/native/rsc/routing/interception.js +1 -1
- package/dist/native/rsc/search-params/define.js +2 -2
- package/dist/native/rsc/server/access-gate.js +1 -1
- package/dist/native/rsc/server/action-client.js +2 -2
- package/dist/native/rsc/server/action-handler.js +8 -8
- package/dist/native/rsc/server/actions.js +3 -3
- package/dist/native/rsc/server/children-interception.js +1 -1
- package/dist/native/rsc/server/deny-boundary.js +1 -1
- package/dist/native/rsc/server/deny-renderer.js +10 -10
- package/dist/native/rsc/server/fallback-error.js +1 -1
- package/dist/native/rsc/server/flight-injector-core.js +2 -2
- package/dist/native/rsc/server/flight-source-node.js +2 -2
- package/dist/native/rsc/server/index.js +4 -4
- package/dist/native/rsc/server/interception-gates.js +2 -2
- package/dist/native/rsc/server/internal.js +15 -15
- package/dist/native/rsc/server/logger.js +2 -2
- package/dist/native/rsc/server/metadata-route-links.js +1 -1
- package/dist/native/rsc/server/node-body-response.js +1 -1
- package/dist/native/rsc/server/param-coercion.js +1 -1
- package/dist/native/rsc/server/pipeline-helpers.js +10 -10
- package/dist/native/rsc/server/pipeline-interception.js +4 -4
- package/dist/native/rsc/server/pipeline-metadata-route.js +10 -10
- package/dist/native/rsc/server/pipeline-outcome.js +4 -4
- package/dist/native/rsc/server/pipeline-phases.js +11 -11
- package/dist/native/rsc/server/pipeline.js +10 -10
- package/dist/native/rsc/server/prebuilt/capture-render.js +1 -1
- package/dist/native/rsc/server/prebuilt/dev-store.js +1 -1
- package/dist/native/rsc/server/prebuilt/overlay.js +3 -3
- package/dist/native/rsc/server/prebuilt-builder.js +8 -8
- package/dist/native/rsc/server/prebuilt-runtime.js +15 -15
- package/dist/native/rsc/server/primitives.js +2 -2
- package/dist/native/rsc/server/publish-params.js +1 -1
- package/dist/native/rsc/server/request-context.js +1 -1
- package/dist/native/rsc/server/route-element-builder.js +7 -7
- package/dist/native/rsc/server/route-element-helpers.js +1 -1
- package/dist/native/rsc/server/route-handler.js +1 -1
- package/dist/native/rsc/server/rsc-entry/action-dispatcher.js +1 -1
- package/dist/native/rsc/server/rsc-entry/action-middleware-runner.js +1 -1
- package/dist/native/rsc/server/rsc-entry/api-handler.js +1 -1
- package/dist/native/rsc/server/rsc-entry/deny-fallback.js +6 -6
- package/dist/native/rsc/server/rsc-entry/error-renderer.js +7 -7
- package/dist/native/rsc/server/rsc-entry/helpers.js +1 -1
- package/dist/native/rsc/server/rsc-entry/render-route.js +4 -4
- package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +7 -7
- package/dist/native/rsc/server/rsc-entry/rsc-payload.js +3 -3
- package/dist/native/rsc/server/rsc-entry/rsc-stream.js +6 -6
- package/dist/native/rsc/server/rsc-entry/ssr-renderer.js +10 -10
- package/dist/native/rsc/server/rsc-error-envelope.js +1 -1
- package/dist/native/rsc/server/sitemap-handler.js +1 -1
- package/dist/native/rsc/server/skippable-prefix.js +2 -2
- package/dist/native/rsc/server/slot-interception.js +1 -1
- package/dist/native/rsc/server/slot-resolver.js +11 -11
- package/dist/native/rsc/server/static-generator.js +2 -2
- package/dist/native/rsc/server/traced-access.js +1 -1
- package/dist/native/rsc/server/tracing.js +10 -0
- package/dist/native/rsc/server/tracing.js.map +1 -1
- package/dist/native/rsc/shared/dev-span.js +11 -4
- package/dist/native/rsc/shared/dev-span.js.map +1 -1
- package/dist/native/rsc/shared/href.js +1 -1
- package/dist/native/rsc/shared/span-waterfall.js +90 -0
- package/dist/native/rsc/shared/span-waterfall.js.map +1 -0
- package/dist/native/ssr/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/native/ssr/adapters/cloudflare.js +2 -2
- package/dist/native/ssr/cache/cache-api.js +3 -3
- package/dist/native/ssr/cache/guarded-read.js +1 -1
- package/dist/native/ssr/cache/index.js +3 -3
- package/dist/native/ssr/cache/timber-cache.js +3 -3
- package/dist/native/ssr/cdn/index.js +1 -1
- package/dist/native/ssr/client/error-boundary.js +1 -1
- package/dist/native/ssr/client/index.js +5 -5
- package/dist/native/ssr/client/link.js +5 -5
- package/dist/native/ssr/client/navigation-commit.js +2 -2
- package/dist/native/ssr/client/nuqs-adapter.js +2 -2
- package/dist/native/ssr/client/params-context.js +1 -1
- package/dist/native/ssr/client/router-skew.js +1 -1
- package/dist/native/ssr/client/rsc-fetch.js +2 -2
- package/dist/native/ssr/client/use-pending-navigation.js +1 -1
- package/dist/native/ssr/client/use-search-params.js +2 -2
- package/dist/native/ssr/client/use-segment-params.js +1 -1
- package/dist/native/ssr/client/use-selected-layout-segment.js +1 -1
- package/dist/native/ssr/dev-tools/await-span.js +10 -7
- package/dist/native/ssr/dev-tools/await-span.js.map +1 -1
- package/dist/native/ssr/dev-tools/instrumentation.js +38 -3
- package/dist/native/ssr/dev-tools/instrumentation.js.map +1 -1
- package/dist/native/ssr/dev-tools/logger.js +123 -80
- package/dist/native/ssr/dev-tools/logger.js.map +1 -1
- package/dist/native/ssr/dev-tools/span-sink.js +1 -0
- package/dist/native/ssr/dev-tools/span-sink.js.map +1 -1
- package/dist/native/ssr/manifest.json +1 -0
- package/dist/native/ssr/params/index.js +1 -1
- package/dist/native/ssr/search-params/define.js +2 -2
- package/dist/native/ssr/server/access-gate.js +1 -1
- package/dist/native/ssr/server/action-client.js +2 -2
- package/dist/native/ssr/server/actions.js +3 -3
- package/dist/native/ssr/server/deny-boundary.js +2 -2
- package/dist/native/ssr/server/flight-injector-core.js +1 -1
- package/dist/native/ssr/server/flight-source-node.js +2 -2
- package/dist/native/ssr/server/index.js +4 -4
- package/dist/native/ssr/server/internal.js +12 -12
- package/dist/native/ssr/server/logger.js +2 -2
- package/dist/native/ssr/server/node-body-response.js +1 -1
- package/dist/native/ssr/server/node-stream-transforms.js +2 -2
- package/dist/native/ssr/server/param-coercion.js +3 -3
- package/dist/native/ssr/server/pipeline-helpers.js +7 -7
- package/dist/native/ssr/server/pipeline-interception.js +4 -4
- package/dist/native/ssr/server/pipeline-metadata-route.js +10 -10
- package/dist/native/ssr/server/pipeline-outcome.js +4 -4
- package/dist/native/ssr/server/pipeline-phases.js +10 -10
- package/dist/native/ssr/server/pipeline.js +10 -10
- package/dist/native/ssr/server/prebuilt/capture-render.js +2 -2
- package/dist/native/ssr/server/prebuilt/dev-store.js +1 -1
- package/dist/native/ssr/server/prebuilt/overlay.js +4 -4
- package/dist/native/ssr/server/prebuilt-runtime.js +14 -14
- package/dist/native/ssr/server/primitives.js +2 -2
- package/dist/native/ssr/server/request-context.js +2 -2
- package/dist/native/ssr/server/route-handler.js +1 -1
- package/dist/native/ssr/server/rsc-error-envelope.js +1 -1
- package/dist/native/ssr/server/ssr-form-state.js +2 -2
- package/dist/native/ssr/server/ssr-wrappers.js +1 -1
- package/dist/native/ssr/server/traced-access.js +1 -1
- package/dist/native/ssr/server/tracing.js +10 -0
- package/dist/native/ssr/server/tracing.js.map +1 -1
- package/dist/native/ssr/shared/dev-span.js +11 -4
- package/dist/native/ssr/shared/dev-span.js.map +1 -1
- package/dist/native/ssr/shared/href.js +1 -1
- package/dist/native/ssr/shared/span-waterfall.js +90 -0
- package/dist/native/ssr/shared/span-waterfall.js.map +1 -0
- package/dist/plugins/dev-await.d.ts +3 -0
- package/dist/plugins/dev-await.d.ts.map +1 -1
- package/dist/plugins/dev-precompile.d.ts +84 -0
- package/dist/plugins/dev-precompile.d.ts.map +1 -0
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/native-runtime.d.ts +2 -2
- package/dist/plugins/native-runtime.d.ts.map +1 -1
- package/dist/plugins/plugin-rsc-package.d.ts +35 -0
- package/dist/plugins/plugin-rsc-package.d.ts.map +1 -0
- package/dist/plugins/virtual-ids.d.ts +16 -0
- package/dist/plugins/virtual-ids.d.ts.map +1 -0
- package/dist/routes/index.js +1 -1
- package/dist/routing/index.js +3 -3
- package/dist/search-params/index.js +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +14 -14
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/shared/dev-span.d.ts +21 -3
- package/dist/shared/dev-span.d.ts.map +1 -1
- package/dist/shared/span-waterfall.d.ts +88 -0
- package/dist/shared/span-waterfall.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/client/dev-pill/index.ts +5 -2
- package/src/client/dev-pill/store.ts +5 -64
- package/src/client/dev-pill/view.ts +175 -53
- package/src/dev-tools/await-span.ts +32 -13
- package/src/dev-tools/instrumentation.ts +44 -6
- package/src/dev-tools/logger.ts +230 -155
- package/src/dev-tools/span-sink.ts +34 -3
- package/src/index.ts +24 -21
- package/src/plugins/dev-await.ts +61 -3
- package/src/plugins/dev-precompile.ts +168 -0
- package/src/plugins/dev-server.ts +16 -3
- package/src/plugins/entries.ts +1 -11
- package/src/plugins/native-runtime.ts +4 -3
- package/src/plugins/plugin-rsc-package.ts +81 -0
- package/src/plugins/virtual-ids.ts +15 -0
- package/src/server/tracing.ts +29 -0
- package/src/shared/dev-span.ts +29 -6
- package/src/shared/span-waterfall.ts +227 -0
- package/dist/_chunks/chains-KblEfYzm.js +0 -1
- package/dist/_chunks/dev-server-L8biS7Az.js +0 -1
- package/dist/_chunks/dev-server-Rq659RR1.js.map +0 -1
- package/dist/_chunks/dev-span-_NzMX-au.js.map +0 -1
- package/dist/_chunks/logger-YtMSKfft.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as swallow } from "./logger-
|
|
1
|
+
import { b as swallow } from "./logger-DDLtp5e-.js";
|
|
2
2
|
// src/cache/sizeof.ts
|
|
3
3
|
/**
|
|
4
4
|
* Lightweight byte-size estimation for cache entries.
|
|
@@ -32,4 +32,4 @@ function estimateByteSize(value) {
|
|
|
32
32
|
}
|
|
33
33
|
export { estimateByteSize as t };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=sizeof-
|
|
35
|
+
//# sourceMappingURL=sizeof-DVhEVN_y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizeof-
|
|
1
|
+
{"version":3,"file":"sizeof-DVhEVN_y.js","names":[],"sources":["../../src/cache/sizeof.ts"],"sourcesContent":["/**\n * Lightweight byte-size estimation for cache entries.\n *\n * Estimates the in-memory byte cost of a JavaScript value using\n * JSON.stringify().length * 2 (UTF-16 char width). This is a rough\n * approximation — it doesn't account for V8 object overhead, Map\n * metadata, or non-serializable values — but it's fast and good\n * enough for cache budget enforcement.\n *\n * Values that fail JSON serialization (circular references, BigInt,\n * etc.) return 0, allowing the entry to be cached without counting\n * toward the byte budget. This is a conservative choice: it's better\n * to cache and undercount than to reject the entry.\n */\n\nimport { swallow } from '../server/logger.ts';\n\n/**\n * Estimate the byte size of a value.\n *\n * Uses `JSON.stringify(value).length * 2` to approximate UTF-16\n * in-memory size. Returns 0 if the value is not serializable.\n */\nexport function estimateByteSize(value: unknown): number {\n try {\n const json = JSON.stringify(value);\n if (json === undefined) return 0;\n // Each JS string character is 2 bytes (UTF-16)\n return json.length * 2;\n } catch (e) {\n // Circular reference or non-serializable value\n swallow(e, 'sizeof estimation failed', { level: 'debug' });\n return 0;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,iBAAiB,OAAwB;CACvD,IAAI;EACF,MAAM,OAAO,KAAK,UAAU,KAAK;EACjC,IAAI,SAAS,KAAA,GAAW,OAAO;EAE/B,OAAO,KAAK,SAAS;CACvB,SAAS,GAAG;EAEV,QAAQ,GAAG,4BAA4B,EAAE,OAAO,QAAQ,CAAC;EACzD,OAAO;CACT;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as classifyUrlSegment } from "./segment-classify-Ho8jXWeC.js";
|
|
2
|
-
import { u as readFileCached } from "./scanner-
|
|
3
|
-
import { a as parseExistingSchemaKeys, r as findSchemaFile } from "./cli-schema-sync-
|
|
2
|
+
import { u as readFileCached } from "./scanner-CrB_h6FA.js";
|
|
3
|
+
import { a as parseExistingSchemaKeys, r as findSchemaFile } from "./cli-schema-sync-B2ldclRO.js";
|
|
4
4
|
// src/routing/schema-validation.ts
|
|
5
5
|
/**
|
|
6
6
|
* Schema key/value validation against the filesystem route tree.
|
|
@@ -139,4 +139,4 @@ function walk(node, chain, result, includeSlots) {
|
|
|
139
139
|
}
|
|
140
140
|
export { collectDynamicSegmentsFromTree as n, validateSchemaAgainstRoutes as r, collectLeafRoutes as t };
|
|
141
141
|
|
|
142
|
-
//# sourceMappingURL=walkers-
|
|
142
|
+
//# sourceMappingURL=walkers-BUvpsb2Q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walkers-D_QHR_nf.js","names":[],"sources":["../../src/routing/schema-validation.ts","../../src/routing/walkers.ts"],"sourcesContent":["/**\n * Schema key/value validation against the filesystem route tree.\n *\n * Runs at codegen time (build + dev) to catch mismatches between\n * app/schema.ts keys and the actual dynamic segments on disk.\n *\n * Design doc: design/41-global-params.md\n */\n\nimport { readFileCached } from './file-cache.ts';\nimport type { RouteTree, SegmentNode } from './types.ts';\nimport { findSchemaFile, parseExistingSchemaKeys } from '../cli-schema-sync.ts';\nimport { classifyUrlSegment } from './segment-classify.ts';\n\nexport interface SchemaWarning {\n type: 'stale-key' | 'missing-key' | 'bracket-mismatch';\n key: string;\n message: string;\n filesystemKey?: string;\n}\n\n/**\n * Collect all unique bracket-keyed dynamic segment names from a route tree.\n * Returns entries like '[artistSlug]', '[...slug]', '[[...topic]]'.\n */\nexport function collectDynamicSegmentsFromTree(tree: RouteTree): Set<string> {\n const segments = new Set<string>();\n walkTree(tree.root, segments);\n return segments;\n}\n\nfunction walkTree(node: SegmentNode, segments: Set<string>): void {\n if (node.paramName && node.segmentName) {\n const classified = classifyUrlSegment(node.segmentName);\n if (classified.kind !== 'static') {\n // Use bare bracket form for schema keys — affixed segments like\n // `img-[id].png` register as `[id]`, matching runtime codec lookup.\n if (classified.kind === 'dynamic' && (classified.prefix || classified.suffix)) {\n segments.add(`[${classified.name}]`);\n } else {\n segments.add(node.segmentName);\n }\n }\n }\n for (const child of node.children) {\n walkTree(child, segments);\n }\n for (const slot of Object.values(node.slots)) {\n walkTree(slot, segments);\n }\n}\n\n/**\n * Extract the param name from a bracket key.\n * '[id]' → 'id', '[...slug]' → 'slug', '[[...topic]]' → 'topic'\n */\nfunction extractParamName(bracketKey: string): string | null {\n const seg = classifyUrlSegment(bracketKey);\n if (seg.kind === 'static') return null;\n return seg.name;\n}\n\n/**\n * Validate schema keys against the filesystem route tree.\n *\n * Returns warnings for:\n * - Stale keys: schema keys that don't match any filesystem segment\n * - Bracket form mismatches: same param name, different bracket form\n * - Missing keys: filesystem segments not registered in schema (informational)\n */\nexport function validateSchemaAgainstRoutes(tree: RouteTree, appDir: string): SchemaWarning[] {\n const schemaPath = findSchemaFile(appDir);\n if (!schemaPath) return [];\n\n const content = readFileCached(schemaPath);\n const schemaKeys = parseExistingSchemaKeys(content);\n\n if (schemaKeys.length === 0) return [];\n\n const filesystemSegments = collectDynamicSegmentsFromTree(tree);\n\n return validateKeys(schemaKeys, filesystemSegments);\n}\n\n/**\n * Core validation: compare schema keys against filesystem segments.\n * Exported separately for testing without filesystem dependencies.\n */\nexport function validateKeys(\n schemaKeys: string[],\n filesystemSegments: Set<string>\n): SchemaWarning[] {\n const warnings: SchemaWarning[] = [];\n\n // Build a map of param name → bracket form for filesystem segments\n const fsParamToKey = new Map<string, string>();\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name) {\n fsParamToKey.set(name, fsKey);\n }\n }\n\n // Build a set of schema param names for the missing-key check\n const schemaParamNames = new Set<string>();\n\n for (const schemaKey of schemaKeys) {\n const schemaParamName = extractParamName(schemaKey);\n if (!schemaParamName) continue;\n\n schemaParamNames.add(schemaParamName);\n\n if (filesystemSegments.has(schemaKey)) {\n // Exact match — no issue\n continue;\n }\n\n // Check if the param name exists but with a different bracket form\n const fsKey = fsParamToKey.get(schemaParamName);\n if (fsKey) {\n warnings.push({\n type: 'bracket-mismatch',\n key: schemaKey,\n filesystemKey: fsKey,\n message:\n `Schema key '${schemaKey}' does not match filesystem bracket form '${fsKey}'. ` +\n `Update the schema key to '${fsKey}'.`,\n });\n } else {\n warnings.push({\n type: 'stale-key',\n key: schemaKey,\n message:\n `Schema key '${schemaKey}' does not match any dynamic segment in the filesystem. ` +\n `Remove it from app/schema.ts or create the corresponding route segment.`,\n });\n }\n }\n\n // Check for filesystem segments not in schema (informational)\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name && !schemaParamNames.has(name)) {\n warnings.push({\n type: 'missing-key',\n key: fsKey,\n message:\n `Dynamic segment '${fsKey}' has no codec in app/schema.ts (defaults to string). ` +\n `Run: timber schema sync`,\n });\n }\n }\n\n return warnings;\n}\n","/**\n * Shared route-tree walkers (TIM-848).\n *\n * Tiny helpers that walk a `SegmentNode<TFile>` tree generically. Both the\n * build-time tree (`SegmentNode<RouteFile>`) and the runtime manifest\n * tree (`SegmentNode<ManifestFile>`) flow through these helpers because\n * the walker only reads the structural fields shared by both shapes\n * (`children`, `slots`, `page`, `route`, `urlPath`).\n *\n * Before this module, three near-identical `collectRoutes` functions\n * lived in `plugins/dev-404-page.ts`, `plugins/build-report.ts`, and\n * `routing/codegen.ts`. The codegen one is special-purpose (it\n * accumulates `ParamEntry[]` and resolves codec chains) and stays\n * local; the other two now share `collectLeafRoutes` from this file.\n */\n\nimport type { SegmentNode } from './types.ts';\n\n/** A leaf route discovered while walking the segment tree. */\nexport interface LeafRoute<TFile> {\n /** URL path of the leaf (root is \"/\"). */\n urlPath: string;\n /** Segment chain from root to this leaf, inclusive. */\n segments: SegmentNode<TFile>[];\n /** The page file at this leaf, if any. */\n page?: TFile;\n /** The route handler file at this leaf, if any. */\n route?: TFile;\n}\n\n/** Options for `collectLeafRoutes`. */\nexport interface CollectLeafRoutesOptions {\n /**\n * If true, recurse into parallel slots and emit slot leaves alongside\n * the main route tree. Defaults to `false` because slots render\n * alongside their parent at the same URL and are not separately\n * URL-addressable. The build report excludes slots; route-listing\n * UIs that want to show \"all leaves with a page handler\" can opt in.\n */\n includeSlots?: boolean;\n}\n\n/**\n * Walk a segment tree and collect every leaf with a `page` or `route`\n * handler. Generic over `TFile` so it works on both the build-time\n * scanner output and the runtime manifest tree.\n *\n * - Pages and route handlers at the same URL produce two distinct\n * entries (the build report deduplicates by URL afterward).\n * - Parallel slots are skipped unless `includeSlots: true` (slots\n * share their parent's URL and are not addressable on their own).\n * - Intercepting subtrees are skipped unconditionally. They render only\n * on soft navigation and add no URL depth, so their computed `urlPath`s\n * are not addresses — listing them would advertise routes (`/[year]`)\n * that no request can reach. This matches every other consumer of the\n * tree that produces URLs: the sitemap generator, the static generator,\n * prerendering and the prebuilt-payload builder all skip them too.\n * - Result is sorted by `urlPath` for deterministic output.\n */\nexport function collectLeafRoutes<TFile>(\n root: SegmentNode<TFile>,\n options: CollectLeafRoutesOptions = {}\n): LeafRoute<TFile>[] {\n const { includeSlots = false } = options;\n const result: LeafRoute<TFile>[] = [];\n walk(root, [], result, includeSlots);\n result.sort((a, b) => a.urlPath.localeCompare(b.urlPath));\n return result;\n}\n\nfunction walk<TFile>(\n node: SegmentNode<TFile>,\n chain: SegmentNode<TFile>[],\n result: LeafRoute<TFile>[],\n includeSlots: boolean\n): void {\n if (node.segmentType === 'intercepting') return;\n\n const currentChain = [...chain, node];\n const path = node.urlPath || '/';\n\n if (node.page) {\n result.push({ urlPath: path, segments: currentChain, page: node.page });\n }\n if (node.route) {\n result.push({ urlPath: path, segments: currentChain, route: node.route });\n }\n\n for (const child of node.children) {\n walk(child, currentChain, result, includeSlots);\n }\n\n if (includeSlots) {\n for (const slotNode of Object.values(node.slots)) {\n walk(slotNode, currentChain, result, includeSlots);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAAgB,+BAA+B,MAA8B;CAC3E,MAAM,2BAAW,IAAI,IAAY;CACjC,SA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
{"version":3,"file":"walkers-BUvpsb2Q.js","names":[],"sources":["../../src/routing/schema-validation.ts","../../src/routing/walkers.ts"],"sourcesContent":["/**\n * Schema key/value validation against the filesystem route tree.\n *\n * Runs at codegen time (build + dev) to catch mismatches between\n * app/schema.ts keys and the actual dynamic segments on disk.\n *\n * Design doc: design/41-global-params.md\n */\n\nimport { readFileCached } from './file-cache.ts';\nimport type { RouteTree, SegmentNode } from './types.ts';\nimport { findSchemaFile, parseExistingSchemaKeys } from '../cli-schema-sync.ts';\nimport { classifyUrlSegment } from './segment-classify.ts';\n\nexport interface SchemaWarning {\n type: 'stale-key' | 'missing-key' | 'bracket-mismatch';\n key: string;\n message: string;\n filesystemKey?: string;\n}\n\n/**\n * Collect all unique bracket-keyed dynamic segment names from a route tree.\n * Returns entries like '[artistSlug]', '[...slug]', '[[...topic]]'.\n */\nexport function collectDynamicSegmentsFromTree(tree: RouteTree): Set<string> {\n const segments = new Set<string>();\n walkTree(tree.root, segments);\n return segments;\n}\n\nfunction walkTree(node: SegmentNode, segments: Set<string>): void {\n if (node.paramName && node.segmentName) {\n const classified = classifyUrlSegment(node.segmentName);\n if (classified.kind !== 'static') {\n // Use bare bracket form for schema keys — affixed segments like\n // `img-[id].png` register as `[id]`, matching runtime codec lookup.\n if (classified.kind === 'dynamic' && (classified.prefix || classified.suffix)) {\n segments.add(`[${classified.name}]`);\n } else {\n segments.add(node.segmentName);\n }\n }\n }\n for (const child of node.children) {\n walkTree(child, segments);\n }\n for (const slot of Object.values(node.slots)) {\n walkTree(slot, segments);\n }\n}\n\n/**\n * Extract the param name from a bracket key.\n * '[id]' → 'id', '[...slug]' → 'slug', '[[...topic]]' → 'topic'\n */\nfunction extractParamName(bracketKey: string): string | null {\n const seg = classifyUrlSegment(bracketKey);\n if (seg.kind === 'static') return null;\n return seg.name;\n}\n\n/**\n * Validate schema keys against the filesystem route tree.\n *\n * Returns warnings for:\n * - Stale keys: schema keys that don't match any filesystem segment\n * - Bracket form mismatches: same param name, different bracket form\n * - Missing keys: filesystem segments not registered in schema (informational)\n */\nexport function validateSchemaAgainstRoutes(tree: RouteTree, appDir: string): SchemaWarning[] {\n const schemaPath = findSchemaFile(appDir);\n if (!schemaPath) return [];\n\n const content = readFileCached(schemaPath);\n const schemaKeys = parseExistingSchemaKeys(content);\n\n if (schemaKeys.length === 0) return [];\n\n const filesystemSegments = collectDynamicSegmentsFromTree(tree);\n\n return validateKeys(schemaKeys, filesystemSegments);\n}\n\n/**\n * Core validation: compare schema keys against filesystem segments.\n * Exported separately for testing without filesystem dependencies.\n */\nexport function validateKeys(\n schemaKeys: string[],\n filesystemSegments: Set<string>\n): SchemaWarning[] {\n const warnings: SchemaWarning[] = [];\n\n // Build a map of param name → bracket form for filesystem segments\n const fsParamToKey = new Map<string, string>();\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name) {\n fsParamToKey.set(name, fsKey);\n }\n }\n\n // Build a set of schema param names for the missing-key check\n const schemaParamNames = new Set<string>();\n\n for (const schemaKey of schemaKeys) {\n const schemaParamName = extractParamName(schemaKey);\n if (!schemaParamName) continue;\n\n schemaParamNames.add(schemaParamName);\n\n if (filesystemSegments.has(schemaKey)) {\n // Exact match — no issue\n continue;\n }\n\n // Check if the param name exists but with a different bracket form\n const fsKey = fsParamToKey.get(schemaParamName);\n if (fsKey) {\n warnings.push({\n type: 'bracket-mismatch',\n key: schemaKey,\n filesystemKey: fsKey,\n message:\n `Schema key '${schemaKey}' does not match filesystem bracket form '${fsKey}'. ` +\n `Update the schema key to '${fsKey}'.`,\n });\n } else {\n warnings.push({\n type: 'stale-key',\n key: schemaKey,\n message:\n `Schema key '${schemaKey}' does not match any dynamic segment in the filesystem. ` +\n `Remove it from app/schema.ts or create the corresponding route segment.`,\n });\n }\n }\n\n // Check for filesystem segments not in schema (informational)\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name && !schemaParamNames.has(name)) {\n warnings.push({\n type: 'missing-key',\n key: fsKey,\n message:\n `Dynamic segment '${fsKey}' has no codec in app/schema.ts (defaults to string). ` +\n `Run: timber schema sync`,\n });\n }\n }\n\n return warnings;\n}\n","/**\n * Shared route-tree walkers (TIM-848).\n *\n * Tiny helpers that walk a `SegmentNode<TFile>` tree generically. Both the\n * build-time tree (`SegmentNode<RouteFile>`) and the runtime manifest\n * tree (`SegmentNode<ManifestFile>`) flow through these helpers because\n * the walker only reads the structural fields shared by both shapes\n * (`children`, `slots`, `page`, `route`, `urlPath`).\n *\n * Before this module, three near-identical `collectRoutes` functions\n * lived in `plugins/dev-404-page.ts`, `plugins/build-report.ts`, and\n * `routing/codegen.ts`. The codegen one is special-purpose (it\n * accumulates `ParamEntry[]` and resolves codec chains) and stays\n * local; the other two now share `collectLeafRoutes` from this file.\n */\n\nimport type { SegmentNode } from './types.ts';\n\n/** A leaf route discovered while walking the segment tree. */\nexport interface LeafRoute<TFile> {\n /** URL path of the leaf (root is \"/\"). */\n urlPath: string;\n /** Segment chain from root to this leaf, inclusive. */\n segments: SegmentNode<TFile>[];\n /** The page file at this leaf, if any. */\n page?: TFile;\n /** The route handler file at this leaf, if any. */\n route?: TFile;\n}\n\n/** Options for `collectLeafRoutes`. */\nexport interface CollectLeafRoutesOptions {\n /**\n * If true, recurse into parallel slots and emit slot leaves alongside\n * the main route tree. Defaults to `false` because slots render\n * alongside their parent at the same URL and are not separately\n * URL-addressable. The build report excludes slots; route-listing\n * UIs that want to show \"all leaves with a page handler\" can opt in.\n */\n includeSlots?: boolean;\n}\n\n/**\n * Walk a segment tree and collect every leaf with a `page` or `route`\n * handler. Generic over `TFile` so it works on both the build-time\n * scanner output and the runtime manifest tree.\n *\n * - Pages and route handlers at the same URL produce two distinct\n * entries (the build report deduplicates by URL afterward).\n * - Parallel slots are skipped unless `includeSlots: true` (slots\n * share their parent's URL and are not addressable on their own).\n * - Intercepting subtrees are skipped unconditionally. They render only\n * on soft navigation and add no URL depth, so their computed `urlPath`s\n * are not addresses — listing them would advertise routes (`/[year]`)\n * that no request can reach. This matches every other consumer of the\n * tree that produces URLs: the sitemap generator, the static generator,\n * prerendering and the prebuilt-payload builder all skip them too.\n * - Result is sorted by `urlPath` for deterministic output.\n */\nexport function collectLeafRoutes<TFile>(\n root: SegmentNode<TFile>,\n options: CollectLeafRoutesOptions = {}\n): LeafRoute<TFile>[] {\n const { includeSlots = false } = options;\n const result: LeafRoute<TFile>[] = [];\n walk(root, [], result, includeSlots);\n result.sort((a, b) => a.urlPath.localeCompare(b.urlPath));\n return result;\n}\n\nfunction walk<TFile>(\n node: SegmentNode<TFile>,\n chain: SegmentNode<TFile>[],\n result: LeafRoute<TFile>[],\n includeSlots: boolean\n): void {\n if (node.segmentType === 'intercepting') return;\n\n const currentChain = [...chain, node];\n const path = node.urlPath || '/';\n\n if (node.page) {\n result.push({ urlPath: path, segments: currentChain, page: node.page });\n }\n if (node.route) {\n result.push({ urlPath: path, segments: currentChain, route: node.route });\n }\n\n for (const child of node.children) {\n walk(child, currentChain, result, includeSlots);\n }\n\n if (includeSlots) {\n for (const slotNode of Object.values(node.slots)) {\n walk(slotNode, currentChain, result, includeSlots);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAAgB,+BAA+B,MAA8B;CAC3E,MAAM,2BAAW,IAAI,IAAY;CACjC,SAAS,KAAK,MAAM,QAAQ;CAC5B,OAAO;AACT;AAEA,SAAS,SAAS,MAAmB,UAA6B;CAChE,IAAI,KAAK,aAAa,KAAK,aAAa;EACtC,MAAM,aAAa,mBAAmB,KAAK,WAAW;EACtD,IAAI,WAAW,SAAS,UAAU;GAGhC,IAAI,WAAW,SAAS,cAAc,WAAW,UAAU,WAAW,SACpE,SAAS,IAAI,IAAI,WAAW,KAAK,EAAE;QAEnC,SAAS,IAAI,KAAK,WAAW;EAEjC;CACF;CACA,KAAK,MAAM,SAAS,KAAK,UACvB,SAAS,OAAO,QAAQ;CAE1B,KAAK,MAAM,QAAQ,OAAO,OAAO,KAAK,KAAK,GACzC,SAAS,M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MAAM;EAE9B,CAAC;CAEL;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;;AC/FA,SAAgB,kBACd,MACA,UAAoC,CAAC,GACjB;CACpB,MAAM,EAAE,eAAe,UAAU;CACjC,MAAM,SAA6B,CAAC;CACpC,KAAK,MAAM,CAAC,GAAG,QAAQ,YAAY;CACnC,OAAO,MAAM,GAAG,MAAM,EAAE,QAAQ,cAAc,EAAE,OAAO,CAAC;CACxD,OAAO;AACT;AAEA,SAAS,KACP,MACA,OACA,QACA,cACM;CACN,IAAI,KAAK,gBAAgB,gBAAgB;CAEzC,MAAM,eAAe,CAAC,GAAG,OAAO,IAAI;CACpC,MAAM,OAAO,KAAK,WAAW;CAE7B,IAAI,KAAK,MACP,OAAO,KAAK;EAAE,SAAS;EAAM,UAAU;EAAc,MAAM,KAAK;CAAK,CAAC;CAExE,IAAI,KAAK,OACP,OAAO,KAAK;EAAE,SAAS;EAAM,UAAU;EAAc,OAAO,KAAK;CAAM,CAAC;CAG1E,KAAK,MAAM,SAAS,KAAK,UACvB,KAAK,OAAO,cAAc,QAAQ,YAAY;CAGhD,IAAI,cACF,KAAK,MAAM,YAAY,OAAO,OAAO,KAAK,KAAK,GAC7C,KAAK,UAAU,cAAc,QAAQ,YAAY;AAGvD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as getCloudflareBindings } from "../_chunks/cloudflare-Dk5Hqo-O.js";
|
|
2
|
+
import { t as warnLossyJsonValue } from "../_chunks/json-lossy-check-D47R9Fp5.js";
|
|
3
3
|
// src/adapters/cloudflare-kv-cache.ts
|
|
4
4
|
var LEGACY_GRACE_MS = 2592e6;
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateWorkerEntry, s as generateWranglerConfig, c as getCloudflareBindings, l as readPrebuiltData, u as readUserWranglerConfig, d as runWithBindings, f as stagePagesPreview } from "../_chunks/cloudflare-
|
|
1
|
+
export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateWorkerEntry, s as generateWranglerConfig, c as getCloudflareBindings, l as readPrebuiltData, u as readUserWranglerConfig, d as runWithBindings, f as stagePagesPreview } from "../_chunks/cloudflare-Dk5Hqo-O.js";
|
package/dist/adapters/nitro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { a as RUNTIME_INIT_MODULE, c as generateRuntimeInitModule, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as STATIC_CACHE, r as writeHeadersFile, s as adapterBase, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-5UsltK-S.js";
|
|
1
2
|
import { t as RSC_CONTENT_TYPE } from "../_chunks/rsc-media-type-m8jz9u6_.js";
|
|
2
3
|
import { a as REDIRECTS_FILE, i as HEADERS_FILE } from "../_chunks/fs-identity-BmQ_Agg-.js";
|
|
3
|
-
import { a as RUNTIME_INIT_MODULE, c as generateRuntimeInitModule, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as STATIC_CACHE, r as writeHeadersFile, s as adapterBase, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-5UsltK-S.js";
|
|
4
4
|
import { transformWithOxc } from "vite";
|
|
5
5
|
import { basename, dirname, join, relative, sep } from "node:path";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { i as detectDirective, r as classifyModules } from "../_chunks/classify-cmE0Gins.js";
|
|
1
2
|
import { i as scanProjectSourceFiles, n as isScannableSourceFile, t as buildSourceExtensions } from "../_chunks/scan-CyizcBiX.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as importSignals, r as poisoningsFor, t as collectImportSpecifiers } from "../_chunks/poison-scan-CRSP06Es.js";
|
|
3
|
+
import { n as stitchImportChains } from "../_chunks/chains-BsGKkMTK.js";
|
|
4
|
+
import { n as importSignals, r as poisoningsFor, t as collectImportSpecifiers } from "../_chunks/poison-scan-CJ9QfJWb.js";
|
|
5
|
+
import { s as isTimberPluginApi, u as resolveAppDir } from "../_chunks/plugin-context-BtaQcMuh.js";
|
|
6
6
|
import { normalizePath } from "vite";
|
|
7
7
|
import { join, resolve } from "node:path";
|
|
8
8
|
import { readFile, realpath, writeFile } from "node:fs/promises";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as readDevRecords, i as probeDevServer, t as DEV_PROBE_TIMEOUT_MS } from "../_chunks/dev-discovery-YnabkCKD.js";
|
|
2
|
-
import { r as normalizeSlashes } from "../_chunks/scan-CyizcBiX.js";
|
|
3
2
|
import { a as readGraphCache, i as hashFingerprintEntries, n as computeProjectFingerprint, o as writeGraphCache, r as fingerprintEntriesForFiles, t as collectBaseFingerprintEntries } from "../_chunks/graph-cache-B1LAg4t7.js";
|
|
3
|
+
import { r as normalizeSlashes } from "../_chunks/scan-CyizcBiX.js";
|
|
4
4
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
5
|
-
import { createRequire } from "node:module";
|
|
6
5
|
import { existsSync } from "node:fs";
|
|
7
6
|
import { fileURLToPath } from "node:url";
|
|
8
7
|
import { promisify } from "node:util";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
9
|
import { mkdir, readFile, realpath, rm } from "node:fs/promises";
|
|
10
10
|
import { execFile } from "node:child_process";
|
|
11
11
|
// src/analyze/graph-command.ts
|
|
@@ -97,7 +97,7 @@ function isDevServerGraphResponse(value) {
|
|
|
97
97
|
*/
|
|
98
98
|
async function resolveAppRoot(configFile) {
|
|
99
99
|
const { resolveConfig } = await import("vite");
|
|
100
|
-
const { isTimberPluginApi } = await import("../_chunks/plugin-context-
|
|
100
|
+
const { isTimberPluginApi } = await import("../_chunks/plugin-context-I1dvGccO.js");
|
|
101
101
|
const previousCwd = process.cwd();
|
|
102
102
|
process.chdir(dirname(configFile));
|
|
103
103
|
const stdoutWrite = process.stdout.write;
|
|
@@ -293,7 +293,7 @@ async function printSingleFile(input, target, module, answer, json) {
|
|
|
293
293
|
console.log(` environments: ${envs.length > 0 ? envs.join(", ") : "none"}`);
|
|
294
294
|
if (module.subtreeUnknown) console.log(" note: reachable, but its subtree is unknown (never transformed)");
|
|
295
295
|
if (module.chains.length > 0) {
|
|
296
|
-
const { formatChains } = await import("../_chunks/chains-
|
|
296
|
+
const { formatChains } = await import("../_chunks/chains-DHmoKxkO.js");
|
|
297
297
|
console.log(" import chains:");
|
|
298
298
|
console.log(formatChains(module.chains, root));
|
|
299
299
|
}
|
|
@@ -312,7 +312,7 @@ async function printDevServerText(data, configDir) {
|
|
|
312
312
|
console.log(` environments: ${envList.length > 0 ? envList.join(", ") : "none"}`);
|
|
313
313
|
if (data.subtreeUnknown) console.log(" note: reachable, but its subtree is unknown (never transformed)");
|
|
314
314
|
if (data.chains.length > 0) {
|
|
315
|
-
const { formatChains } = await import("../_chunks/chains-
|
|
315
|
+
const { formatChains } = await import("../_chunks/chains-DHmoKxkO.js");
|
|
316
316
|
console.log(" import chains:");
|
|
317
317
|
console.log(formatChains(data.chains, configDir));
|
|
318
318
|
}
|
package/dist/cache/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { b as setCacheHandler, v as getCacheHandler } from "../_chunks/dev-store-BvdqtHvK.js";
|
|
2
|
-
import { f as MemoryCacheHandler, h as setDefaultSingleflightTimeout, m as RedisCacheHandler, p as TagAwareCacheHandler, t as cache } from "../_chunks/cache-api-
|
|
3
|
-
import { t as estimateByteSize } from "../_chunks/sizeof-
|
|
2
|
+
import { f as MemoryCacheHandler, h as setDefaultSingleflightTimeout, m as RedisCacheHandler, p as TagAwareCacheHandler, t as cache } from "../_chunks/cache-api-Bo8c7XVF.js";
|
|
3
|
+
import { t as estimateByteSize } from "../_chunks/sizeof-DVhEVN_y.js";
|
|
4
4
|
export { MemoryCacheHandler, RedisCacheHandler, TagAwareCacheHandler, cache, estimateByteSize, getCacheHandler, setCacheHandler, setDefaultSingleflightTimeout };
|
package/dist/cli.js
CHANGED
|
@@ -88,7 +88,7 @@ function parseArgs(args) {
|
|
|
88
88
|
async function runDev(options, _deps) {
|
|
89
89
|
if (process.env.__TIMBER_DEV_WORKER) {
|
|
90
90
|
const server = await (_deps?.createServer ?? (await import("vite")).createServer)({ configFile: options.config });
|
|
91
|
-
const { hasTimberPlugin } = await import("./_chunks/cli-context-
|
|
91
|
+
const { hasTimberPlugin } = await import("./_chunks/cli-context-BbwVqarO.js");
|
|
92
92
|
if (!hasTimberPlugin(server.config.plugins)) {
|
|
93
93
|
await server.close();
|
|
94
94
|
const where = server.config.configFile ?? `no Vite config found in ${server.config.root}`;
|
|
@@ -99,7 +99,7 @@ async function runDev(options, _deps) {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
const { fork } = await import("node:child_process");
|
|
102
|
-
const { RESTART_EXIT_CODE } = await import("./_chunks/dev-server-
|
|
102
|
+
const { RESTART_EXIT_CODE } = await import("./_chunks/dev-server-BGGGhHXx.js");
|
|
103
103
|
while (true) {
|
|
104
104
|
const result = await new Promise((resolve) => {
|
|
105
105
|
const child = fork(process.argv[1], process.argv.slice(2), {
|
|
@@ -151,8 +151,8 @@ async function runBuild(options, _deps) {
|
|
|
151
151
|
* exists but fails to load throws, naming the file (TIM-1066).
|
|
152
152
|
*/
|
|
153
153
|
async function runPreview(options, _deps) {
|
|
154
|
-
const { resolveTimberContext } = await import("./_chunks/cli-context-
|
|
155
|
-
const { adapterConfig, contextAdapter } = await import("./_chunks/plugin-context-
|
|
154
|
+
const { resolveTimberContext } = await import("./_chunks/cli-context-BbwVqarO.js");
|
|
155
|
+
const { adapterConfig, contextAdapter } = await import("./_chunks/plugin-context-I1dvGccO.js");
|
|
156
156
|
const ctx = await resolveTimberContext("preview", options.config, _deps?.resolveViteConfig);
|
|
157
157
|
const adapter = contextAdapter(ctx);
|
|
158
158
|
if (typeof adapter?.preview !== "function") {
|
|
@@ -179,7 +179,7 @@ async function runPreview(options, _deps) {
|
|
|
179
179
|
* `--project` names the tsconfig handed to tsgo.
|
|
180
180
|
*/
|
|
181
181
|
async function runCheck(options, _deps) {
|
|
182
|
-
const { checkRoutes, runTypeCheck } = await import("./_chunks/cli-check-
|
|
182
|
+
const { checkRoutes, runTypeCheck } = await import("./_chunks/cli-check-BwiahbTC.js");
|
|
183
183
|
const { root } = await checkRoutes({ viteConfigFile: options.config }, _deps);
|
|
184
184
|
await runTypeCheck({
|
|
185
185
|
root,
|
|
@@ -195,7 +195,7 @@ async function runCheck(options, _deps) {
|
|
|
195
195
|
async function runSchema(args) {
|
|
196
196
|
const subcommand = args[0];
|
|
197
197
|
if (subcommand !== "sync") throw new Error(`Unknown schema subcommand: ${subcommand ?? "(none)"}. Usage: timber schema sync`);
|
|
198
|
-
const { runSchemaSync, defaultCodecForSegment } = await import("./_chunks/cli-schema-sync-
|
|
198
|
+
const { runSchemaSync, defaultCodecForSegment } = await import("./_chunks/cli-schema-sync-Brw7kTmm.js");
|
|
199
199
|
const result = runSchemaSync(process.cwd());
|
|
200
200
|
if (result.filesystemSegments.length === 0) {
|
|
201
201
|
console.log("[timber] No dynamic segments found in app/.");
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dev request pill — wiring. Feeds the store from three places:
|
|
3
3
|
*
|
|
4
|
-
* - HMR `timber:span` events:
|
|
4
|
+
* - HMR `timber:span` events: finished server spans, batched per trace and
|
|
5
|
+
* event-loop turn as they end, and a trace's buffered spans on replay.
|
|
5
6
|
* - The document's navigation timing entry, whose `serverTiming` carries the
|
|
6
7
|
* page's trace ID (the one response header page JS can read for the
|
|
7
8
|
* document itself).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAGpE,KAAK,GAAG,GAAG;IACT,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,IAAI,CAYpC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AActD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA6DxE"}
|
|
@@ -35,15 +35,6 @@ export interface TraceSummary {
|
|
|
35
35
|
slow: boolean;
|
|
36
36
|
error: boolean;
|
|
37
37
|
}
|
|
38
|
-
/** Every span, or only the I/O: awaits and fetches. */
|
|
39
|
-
export type WaterfallView = 'all' | 'awaits';
|
|
40
|
-
export interface WaterfallRow {
|
|
41
|
-
span: DevSpanPayload;
|
|
42
|
-
depth: number;
|
|
43
|
-
/** Milliseconds from the trace's start. */
|
|
44
|
-
offsetMs: number;
|
|
45
|
-
durationMs: number;
|
|
46
|
-
}
|
|
47
38
|
/**
|
|
48
39
|
* The page a URL addresses, comparable across the address bar and a payload
|
|
49
40
|
* URL: `_rsc` dropped, and the query re-serialized by `URLSearchParams` on
|
|
@@ -84,15 +75,6 @@ export declare class DevPillStore {
|
|
|
84
75
|
select(traceId: string): void;
|
|
85
76
|
spans(traceId: string): readonly DevSpanPayload[];
|
|
86
77
|
summary(traceId: string): TraceSummary;
|
|
87
|
-
/**
|
|
88
|
-
* Spans in tree order (parent before children, siblings by start).
|
|
89
|
-
*
|
|
90
|
-
* `view: 'awaits'` keeps only awaits and fetches — the I/O — each nested
|
|
91
|
-
* under its nearest kept ancestor, so hiding framework phases leaves no
|
|
92
|
-
* gaps in the indentation. The time axis still starts at the request's
|
|
93
|
-
* first span.
|
|
94
|
-
*/
|
|
95
|
-
waterfall(traceId: string, view?: WaterfallView): WaterfallRow[];
|
|
96
78
|
/**
|
|
97
79
|
* Keep the newest requests, and always the selected one: a page that polls
|
|
98
80
|
* a route handler would otherwise push its own trace out, leaving the pill
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/E,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5E,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,UA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1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/view.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAoN3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA6NtD"}
|
package/dist/client/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { n as resolveSegmentParams, t as mergePreservedSearchParams } from "../_chunks/merge-search-params-7o_5yX0L.js";
|
|
2
|
+
import { n as interpolateParams, r as resolveHref } from "../_chunks/href-8l5VD23D.js";
|
|
4
3
|
import { i as validateNavigationHref, n as isInternalHref } from "../_chunks/href-validation-DNg-zV7u.js";
|
|
5
|
-
import "../_chunks/param-value-DqlGfF57.js";
|
|
6
|
-
import { n as interpolateParams, r as resolveHref } from "../_chunks/href-BtspoNc9.js";
|
|
7
4
|
import { l as getRouterOrNull, n as usePendingNavigation, o as useNavigationContext, s as createGlobalContext } from "../_chunks/navigation-root-Cvb7P1ud.js";
|
|
8
5
|
import { t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
|
|
6
|
+
import { n as resolveSegmentParams, t as mergePreservedSearchParams } from "../_chunks/merge-search-params-7o_5yX0L.js";
|
|
7
|
+
import { c as stripRscCacheKey } from "../_chunks/rsc-cache-key-D0cb0Gmc.js";
|
|
9
8
|
import { n as useSegmentContext } from "../_chunks/segment-context-GAyTjjtS.js";
|
|
9
|
+
import "../_chunks/param-value-DqlGfF57.js";
|
|
10
10
|
import { n as useQueryStates } from "../_chunks/use-query-states-D3MMl-KM.js";
|
|
11
11
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
12
12
|
import { flushSync } from "react-dom";
|
package/dist/client/internal.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as cachedSearchParams, s as cachedSearch, t as _setCachedSearch } from "../_chunks/state-B-EBjeER.js";
|
|
1
|
+
import { _ as readPayloadTree, a as createSpaExits, c as createRenderOwner, d as fetchRscPayload, f as createNavigationCommitter, g as prefetchScopeOf, h as SegmentCache, i as createScrollEffects, l as isClientStale, m as PrefetchCache, n as TimberErrorBoundary, o as runAsHandle, p as isPartialNavigation, r as createNavigationRecovery, s as recordSkew, u as NonRscResponse, v as readPublishedParams } from "../_chunks/error-boundary-Bh-egWUI.js";
|
|
3
2
|
import { a as NavigationProvider, c as getRouter, i as routerUrlKey, l as getRouterOrNull, o as useNavigationContext, r as parseRouterUrl, u as setGlobalRouter } from "../_chunks/navigation-root-Cvb7P1ud.js";
|
|
3
|
+
import { t as SingleflightTimeoutError } from "../_chunks/singleflight-CzoOVB9Y.js";
|
|
4
4
|
import { n as registerSsrDataProvider, t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
|
|
5
5
|
import { n as useSegmentContext, t as SegmentProvider } from "../_chunks/segment-context-GAyTjjtS.js";
|
|
6
|
-
import {
|
|
6
|
+
import { c as cachedSearchParams, s as cachedSearch, t as _setCachedSearch } from "../_chunks/state-B-EBjeER.js";
|
|
7
7
|
import { t as bindUseQueryStates } from "../_chunks/use-query-states-D3MMl-KM.js";
|
|
8
8
|
// src/client/history.ts
|
|
9
9
|
/**
|
package/dist/cookies/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as assertValidCookieName, r as stringifySetCookie, t as parseCookie } from "../_chunks/dist-C1Rjlo6s.js";
|
|
2
1
|
import { a as resolveCodecOrSchema } from "../_chunks/schema-bridge-DyRs3cqy.js";
|
|
2
|
+
import { i as assertValidCookieName, r as stringifySetCookie, t as parseCookie } from "../_chunks/dist-C1Rjlo6s.js";
|
|
3
3
|
import { t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { getCookieJar } from "@timber-js/app/server";
|
|
@@ -7,7 +7,18 @@
|
|
|
7
7
|
*
|
|
8
8
|
* See design/50-dev-request-pill.md §"Phase 2".
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* `startsNoWork`: the transform saw an operand that only reads existing
|
|
12
|
+
* promises (`await call`, `await Promise.all([a, b])`).
|
|
13
|
+
*/
|
|
14
|
+
export type DevAwaitWrapper = (thunk: () => unknown, label: string, location: string, startsNoWork?: boolean) => unknown;
|
|
15
|
+
/**
|
|
16
|
+
* Record a promise whose work another span already shows, so an await of it
|
|
17
|
+
* is a wait. The dev fetch patch calls this for a body read
|
|
18
|
+
* (`res.text()`): the read is drawn as a `timber.fetch.body` span under
|
|
19
|
+
* the fetch, and `await res.text()` would draw the same time again.
|
|
20
|
+
*/
|
|
21
|
+
export declare function noteTracedWork(promise: Promise<unknown>): void;
|
|
11
22
|
/**
|
|
12
23
|
* Install the wrapper on `globalThis[DEV_AWAIT_KEY]`. Transformed modules
|
|
13
24
|
* look it up per call, so a module evaluated before this ran still gets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"await-span.d.ts","sourceRoot":"","sources":["../../src/dev-tools/await-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"await-span.d.ts","sourceRoot":"","sources":["../../src/dev-tools/await-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,KAAK,EAAE,MAAM,OAAO,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,OAAO,KACnB,OAAO,CAAC;AA+Bb;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAkBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/dev-tools/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/dev-tools/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAYrB,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAazC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAyDpD;AAiED;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACpD;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IAEjD,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,MAAM,EAAE,eAAe,EAGlC;IAED,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE5C;IAED,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAkC9B;IAED,OAAO,CAAC,MAAM;IASR,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhC;CACF;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA6BhE"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* the single source of truth — no separate event system needed.
|
|
6
6
|
*
|
|
7
7
|
* Supports five modes:
|
|
8
|
-
* - tree (default) — indented tree per request
|
|
9
|
-
*
|
|
8
|
+
* - tree (default) — indented tree per request; explained waits hidden,
|
|
9
|
+
* pass-through awaits folded (the dev pill's reading rules)
|
|
10
|
+
* - verbose — the same tree with every span as is
|
|
10
11
|
* - summary — one line per request
|
|
11
12
|
* - json — chronological NDJSON dump of all spans
|
|
12
13
|
* - quiet — no output
|
|
@@ -28,6 +29,11 @@ export interface DevLoggerConfig {
|
|
|
28
29
|
export declare function resolveLogMode(config?: DevLoggerConfig): DevLogMode;
|
|
29
30
|
/**
|
|
30
31
|
* Format spans as a full indented tree string for stderr.
|
|
32
|
+
*
|
|
33
|
+
* Tree mode applies the dev pill's reading rules (shared/span-waterfall.ts):
|
|
34
|
+
* waits whose work other rows already show are left out, and an await that
|
|
35
|
+
* only wraps one other await or fetch folds into it. Verbose mode prints
|
|
36
|
+
* every span as is.
|
|
31
37
|
*/
|
|
32
38
|
export declare function formatSpanTree(spans: ReadableSpan[], config?: DevLoggerConfig): string;
|
|
33
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/dev-tools/logger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/dev-tools/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAYlE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAqJD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,UAAU,CAMnE;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,CAgFtF;AA4ID;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,CAc1F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CA6BxD"}
|
|
@@ -26,7 +26,15 @@ export interface SpanSinkChannel {
|
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Install the sink that broadcasts spans on the dev server's HMR channel,
|
|
29
|
-
* and answers replay requests from it.
|
|
29
|
+
* and answers replay requests from it. Every message is an array of spans
|
|
30
|
+
* of one trace, in the order they ended.
|
|
31
|
+
*
|
|
32
|
+
* Spans are batched: one send per trace per event-loop turn, not one per
|
|
33
|
+
* span. The sink is called inside the request, and each `hot.send` makes
|
|
34
|
+
* promises there, for each of which React's dev async debug hook captures a
|
|
35
|
+
* stack (~6µs a span; ~6ms on a 213-span trace). So the flush is scheduled
|
|
36
|
+
* from an `AsyncLocalStorage.snapshot()` taken here, at install, where no
|
|
37
|
+
* request is in scope: the send runs outside every request (TIM-1627).
|
|
30
38
|
*
|
|
31
39
|
* Broadcasting alone loses most of a document load: the root span ends when
|
|
32
40
|
* the pipeline returns its Response, tens of milliseconds in, and the page's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span-sink.d.ts","sourceRoot":"","sources":["../../src/dev-tools/span-sink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"span-sink.d.ts","sourceRoot":"","sources":["../../src/dev-tools/span-sink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAML,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAc/B,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAwBnE;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAUpD;AAKD,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,EAAE,CACA,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;QAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,KAAK,IAAI,GACtF,IAAI,CAAC;IACR,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;CAChE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,IAAI,CAkDhE"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAgDjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAa1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,MAAM;CAAG;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAgDjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAa1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,MAAM;CAAG;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE;AAmHD,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAqXhE;eAEc,MAAM"}
|