@timber-js/app 0.2.0-alpha.120 → 0.2.0-alpha.121
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-Cw-7NfJJ.js → actions-Dy8vOjFt.js} +6 -6
- package/dist/_chunks/{actions-Cw-7NfJJ.js.map → actions-Dy8vOjFt.js.map} +1 -1
- package/dist/_chunks/{build-output-helper-DhxiT18k.js → build-output-helper-B1n0sUqj.js} +1 -1
- package/dist/_chunks/{build-output-helper-DhxiT18k.js.map → build-output-helper-B1n0sUqj.js.map} +1 -1
- package/dist/_chunks/cli-schema-sync-ByZPGGmS.js +724 -0
- package/dist/_chunks/cli-schema-sync-ByZPGGmS.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-DHQLjFu3.js +2 -0
- package/dist/_chunks/{codec-registry-V7ARyeLN.js → codec-registry-G9hD5LOq.js} +1 -1
- package/dist/_chunks/{codec-registry-V7ARyeLN.js.map → codec-registry-G9hD5LOq.js.map} +1 -1
- package/dist/_chunks/{define-zQX6e1tN.js → define-CPVQaWbx.js} +3 -3
- package/dist/_chunks/{define-zQX6e1tN.js.map → define-CPVQaWbx.js.map} +1 -1
- package/dist/_chunks/{define-8zQ8Vm7x.js → define-jeHDXZGq.js} +3 -3
- package/dist/_chunks/{define-8zQ8Vm7x.js.map → define-jeHDXZGq.js.map} +1 -1
- package/dist/_chunks/{format-CR6v1pWE.js → format-BjN9HLu9.js} +1 -1
- package/dist/_chunks/{format-CR6v1pWE.js.map → format-BjN9HLu9.js.map} +1 -1
- package/dist/_chunks/{handler-store-iqnt2ghN.js → handler-store-CcwNX-gk.js} +1 -1
- package/dist/_chunks/{handler-store-iqnt2ghN.js.map → handler-store-CcwNX-gk.js.map} +1 -1
- package/dist/_chunks/{merge-search-params-CwxJzBLS.js → merge-search-params-az6ZiBeU.js} +1 -1
- package/dist/_chunks/{merge-search-params-CwxJzBLS.js.map → merge-search-params-az6ZiBeU.js.map} +1 -1
- package/dist/_chunks/{navigation-root-DKsJ5Di7.js → navigation-root-DoRTeBm5.js} +2 -2
- package/dist/_chunks/{navigation-root-DKsJ5Di7.js.map → navigation-root-DoRTeBm5.js.map} +1 -1
- package/dist/_chunks/{registry-Dp_hJL4s.js → registry-BI9cgCt7.js} +1 -1
- package/dist/_chunks/{registry-Dp_hJL4s.js.map → registry-BI9cgCt7.js.map} +1 -1
- package/dist/_chunks/{resolve-schema-23Mc8aLi.js → resolve-schema-Bf8eC6q6.js} +11 -3
- package/dist/_chunks/resolve-schema-Bf8eC6q6.js.map +1 -0
- package/dist/_chunks/{router-ref-sektkr-t.js → router-ref-CpvjBqdu.js} +2 -2
- package/dist/_chunks/{router-ref-sektkr-t.js.map → router-ref-CpvjBqdu.js.map} +1 -1
- package/dist/_chunks/{schema-bridge-eL5vQDSA.js → schema-bridge-o0SwFtXW.js} +1 -1
- package/dist/_chunks/{schema-bridge-eL5vQDSA.js.map → schema-bridge-o0SwFtXW.js.map} +1 -1
- package/dist/_chunks/{segment-context-Bg0pFbLT.js → segment-context-EsfQpS--.js} +1 -1
- package/dist/_chunks/{segment-context-Bg0pFbLT.js.map → segment-context-EsfQpS--.js.map} +1 -1
- package/dist/_chunks/{ssr-data-BO5OvEvg.js → ssr-data-m9-cNEIw.js} +1 -1
- package/dist/_chunks/{ssr-data-BO5OvEvg.js.map → ssr-data-m9-cNEIw.js.map} +1 -1
- package/dist/_chunks/{stale-reload-BCPRG0Cv.js → stale-reload-BN2kcE06.js} +1 -1
- package/dist/_chunks/{stale-reload-BCPRG0Cv.js.map → stale-reload-BN2kcE06.js.map} +1 -1
- package/dist/_chunks/{use-query-states-D9SBlAfp.js → use-query-states-C9G6LP0F.js} +2 -2
- package/dist/_chunks/{use-query-states-D9SBlAfp.js.map → use-query-states-C9G6LP0F.js.map} +1 -1
- package/dist/_chunks/{use-segment-params-CskiK-59.js → use-segment-params-CtIAjqK0.js} +2 -2
- package/dist/_chunks/{use-segment-params-CskiK-59.js.map → use-segment-params-CtIAjqK0.js.map} +1 -1
- package/dist/_chunks/{validation-Bm3Je-09.js → validation-BMU5MPzP.js} +1 -1
- package/dist/_chunks/{validation-Bm3Je-09.js.map → validation-BMU5MPzP.js.map} +1 -1
- package/dist/_chunks/{walkers-DgOXkTts.js → walkers-DNp9tHyV.js} +116 -6
- package/dist/_chunks/walkers-DNp9tHyV.js.map +1 -0
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/nitro.js +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/error-boundary.js +2 -2
- package/dist/client/index.js +9 -9
- package/dist/client/internal.js +7 -7
- package/dist/codec.d.ts +18 -0
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +30 -1
- package/dist/codec.js.map +1 -1
- package/dist/cookies/index.js +3 -3
- package/dist/index.js +30 -21
- package/dist/index.js.map +1 -1
- package/dist/params/define-schema.d.ts +32 -4
- package/dist/params/define-schema.d.ts.map +1 -1
- package/dist/params/index.d.ts +1 -1
- package/dist/params/index.d.ts.map +1 -1
- package/dist/params/index.js +2 -2
- package/dist/params/index.js.map +1 -1
- package/dist/params/resolve-schema.d.ts.map +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/routing/index.d.ts +2 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +3 -3
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/schema-validation.d.ts +35 -0
- package/dist/routing/schema-validation.d.ts.map +1 -0
- package/dist/search-params/index.js +3 -3
- package/dist/segment-params/index.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +3 -3
- package/package.json +7 -6
- package/src/cli.ts +0 -0
- package/src/codec.ts +51 -1
- package/src/params/define-schema.ts +46 -5
- package/src/params/index.ts +7 -1
- package/src/params/resolve-schema.ts +13 -0
- package/src/plugins/routing.ts +30 -33
- package/src/routing/codegen.ts +54 -5
- package/src/routing/index.ts +5 -0
- package/src/routing/scanner.ts +58 -0
- package/src/routing/schema-validation.ts +149 -0
- package/LICENSE +0 -8
- package/dist/_chunks/cli-schema-sync-XV0I47Gj.js +0 -2
- package/dist/_chunks/cli-schema-sync-q2wB0DyJ.js +0 -358
- package/dist/_chunks/cli-schema-sync-q2wB0DyJ.js.map +0 -1
- package/dist/_chunks/resolve-schema-23Mc8aLi.js.map +0 -1
- package/dist/_chunks/scanner-DmfoB7iK.js +0 -336
- package/dist/_chunks/scanner-DmfoB7iK.js.map +0 -1
- package/dist/_chunks/walkers-DgOXkTts.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { n as setViteServer } from "./_chunks/warnings-B30wpfaS.js";
|
|
2
2
|
import { h as swallow } from "./_chunks/logger-DDmK5skc.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as formatSize } from "./_chunks/format-CR6v1pWE.js";
|
|
3
|
+
import { a as DEFAULT_BUILD_DIR, c as mergeFileConfig, d as resolveClientJavascript, f as createNoopTimer, l as resolveAppDir, o as createPluginContext, p as scanRoutes, s as loadTimberConfigFile, u as resolveBuildDir } from "./_chunks/cli-schema-sync-ByZPGGmS.js";
|
|
4
|
+
import { a as generateRouteMap, i as collectInterceptionRewrites, r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-DNp9tHyV.js";
|
|
5
|
+
import { t as formatSize } from "./_chunks/format-BjN9HLu9.js";
|
|
7
6
|
import { dirname, extname, join, normalize, resolve } from "node:path";
|
|
8
7
|
import { createRequire } from "node:module";
|
|
9
8
|
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
|
|
@@ -2349,7 +2348,7 @@ function timberRouting(ctx) {
|
|
|
2349
2348
|
ctx.timer.end("route-scan");
|
|
2350
2349
|
dirToRoute = buildDirToRouteMap(ctx.routeTree, ctx.appDir);
|
|
2351
2350
|
writeCodegen(ctx);
|
|
2352
|
-
|
|
2351
|
+
warnSchemaValidation(ctx);
|
|
2353
2352
|
const newConventionWarnings = lintConventions(ctx.routeTree, ctx.appDir).filter((w) => !warnedFiles.has(w.id));
|
|
2354
2353
|
if (newConventionWarnings.length > 0) {
|
|
2355
2354
|
for (const w of newConventionWarnings) warnedFiles.add(w.id);
|
|
@@ -2443,22 +2442,32 @@ function timberRouting(ctx) {
|
|
|
2443
2442
|
* When the route tree changes, any environment that has imported the manifest
|
|
2444
2443
|
* needs to be invalidated so the next request/transform picks up the new tree.
|
|
2445
2444
|
*/
|
|
2446
|
-
/** Set of
|
|
2447
|
-
var
|
|
2448
|
-
/**
|
|
2449
|
-
*
|
|
2450
|
-
*
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
if (!
|
|
2455
|
-
const
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2445
|
+
/** Set of warning keys we've already emitted — avoid repeating on every rescan. */
|
|
2446
|
+
var _warnedKeys = /* @__PURE__ */ new Set();
|
|
2447
|
+
/**
|
|
2448
|
+
* Validate schema keys against the filesystem route tree.
|
|
2449
|
+
* Warns on stale keys, bracket form mismatches, and missing keys.
|
|
2450
|
+
* Uses the already-scanned route tree instead of re-scanning.
|
|
2451
|
+
*/
|
|
2452
|
+
function warnSchemaValidation(ctx) {
|
|
2453
|
+
if (!ctx.routeTree) return;
|
|
2454
|
+
const warnings = validateSchemaAgainstRoutes(ctx.routeTree, ctx.appDir);
|
|
2455
|
+
for (const w of warnings) {
|
|
2456
|
+
const warnKey = `${w.type}:${w.key}`;
|
|
2457
|
+
if (_warnedKeys.has(warnKey)) continue;
|
|
2458
|
+
_warnedKeys.add(warnKey);
|
|
2459
|
+
switch (w.type) {
|
|
2460
|
+
case "stale-key":
|
|
2461
|
+
console.warn(`[timber] ${w.message}`);
|
|
2462
|
+
break;
|
|
2463
|
+
case "bracket-mismatch":
|
|
2464
|
+
console.warn(`[timber] ${w.message}`);
|
|
2465
|
+
break;
|
|
2466
|
+
case "missing-key":
|
|
2467
|
+
console.warn(`[timber] ${w.message}`);
|
|
2468
|
+
break;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2462
2471
|
}
|
|
2463
2472
|
function invalidateManifest(server) {
|
|
2464
2473
|
for (const envName of Object.keys(server.environments)) {
|