@timber-js/app 0.2.0-alpha.121 → 0.2.0-alpha.122

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.
Files changed (89) hide show
  1. package/dist/_chunks/actions-Dy8vOjFt.js.map +1 -1
  2. package/dist/_chunks/{build-output-helper-B1n0sUqj.js → build-output-helper-DYOWsPjZ.js} +47 -6
  3. package/dist/_chunks/build-output-helper-DYOWsPjZ.js.map +1 -0
  4. package/dist/_chunks/cli-schema-sync-4HcQIziG.js +2 -0
  5. package/dist/_chunks/{cli-schema-sync-ByZPGGmS.js → cli-schema-sync-VcCf1TFY.js} +17 -3
  6. package/dist/_chunks/{cli-schema-sync-ByZPGGmS.js.map → cli-schema-sync-VcCf1TFY.js.map} +1 -1
  7. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-DESG8uk5.js} +32 -19
  8. package/dist/_chunks/metadata-routes-DESG8uk5.js.map +1 -0
  9. package/dist/_chunks/{resolve-schema-Bf8eC6q6.js → resolve-schema-cURaYvaD.js} +5 -1
  10. package/dist/_chunks/resolve-schema-cURaYvaD.js.map +1 -0
  11. package/dist/_chunks/{segment-classify-CnfLLvir.js → segment-classify-BjfuctV2.js} +1 -1
  12. package/dist/_chunks/{segment-classify-CnfLLvir.js.map → segment-classify-BjfuctV2.js.map} +1 -1
  13. package/dist/_chunks/{walkers-DNp9tHyV.js → walkers-tkw7sDlj.js} +12 -9
  14. package/dist/_chunks/walkers-tkw7sDlj.js.map +1 -0
  15. package/dist/adapters/build-output-helper.d.ts.map +1 -1
  16. package/dist/adapters/cloudflare.js +1 -1
  17. package/dist/adapters/nitro.js +1 -1
  18. package/dist/cli-schema-sync.d.ts.map +1 -1
  19. package/dist/cli.js +1 -1
  20. package/dist/client/index.js +1 -1
  21. package/dist/client/index.js.map +1 -1
  22. package/dist/client/link.d.ts +9 -5
  23. package/dist/client/link.d.ts.map +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +101 -9
  26. package/dist/index.js.map +1 -1
  27. package/dist/params/index.js +1 -1
  28. package/dist/params/resolve-schema.d.ts.map +1 -1
  29. package/dist/plugins/build-manifest.d.ts.map +1 -1
  30. package/dist/plugins/cloudflare-wasm.d.ts +18 -0
  31. package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
  32. package/dist/plugins/dev-server.d.ts.map +1 -1
  33. package/dist/routing/codegen-shared.d.ts +5 -4
  34. package/dist/routing/codegen-shared.d.ts.map +1 -1
  35. package/dist/routing/index.js +3 -3
  36. package/dist/server/actions.d.ts +3 -8
  37. package/dist/server/actions.d.ts.map +1 -1
  38. package/dist/server/build-manifest.d.ts +6 -0
  39. package/dist/server/build-manifest.d.ts.map +1 -1
  40. package/dist/server/internal.d.ts +1 -1
  41. package/dist/server/internal.d.ts.map +1 -1
  42. package/dist/server/internal.js +13 -4
  43. package/dist/server/internal.js.map +1 -1
  44. package/dist/server/metadata-routes.d.ts +23 -7
  45. package/dist/server/metadata-routes.d.ts.map +1 -1
  46. package/dist/server/pipeline-phases.d.ts.map +1 -1
  47. package/dist/server/request-context.d.ts.map +1 -1
  48. package/dist/server/route-element-builder.d.ts +1 -1
  49. package/dist/server/route-element-builder.d.ts.map +1 -1
  50. package/dist/server/route-matcher.d.ts +4 -2
  51. package/dist/server/route-matcher.d.ts.map +1 -1
  52. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  53. package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
  54. package/dist/server/ssr-entry.d.ts.map +1 -1
  55. package/dist/server/tree-match.d.ts +12 -4
  56. package/dist/server/tree-match.d.ts.map +1 -1
  57. package/dist/server/types.d.ts +2 -2
  58. package/package.json +1 -1
  59. package/src/adapters/build-output-helper.ts +67 -5
  60. package/src/cli-schema-sync.ts +25 -4
  61. package/src/client/browser-entry/index.ts +1 -1
  62. package/src/client/link.tsx +9 -9
  63. package/src/index.ts +2 -0
  64. package/src/params/resolve-schema.ts +15 -0
  65. package/src/plugins/build-manifest.ts +57 -5
  66. package/src/plugins/cloudflare-wasm.ts +103 -0
  67. package/src/plugins/dev-server.ts +4 -2
  68. package/src/plugins/routing.ts +1 -1
  69. package/src/routing/codegen-shared.ts +8 -5
  70. package/src/routing/codegen.ts +5 -0
  71. package/src/routing/link-codegen.ts +1 -1
  72. package/src/server/actions.ts +4 -14
  73. package/src/server/build-manifest.ts +7 -0
  74. package/src/server/internal.ts +7 -1
  75. package/src/server/metadata-routes.ts +44 -19
  76. package/src/server/pipeline-phases.ts +8 -0
  77. package/src/server/request-context.ts +0 -4
  78. package/src/server/route-element-builder.ts +57 -11
  79. package/src/server/route-matcher.ts +81 -49
  80. package/src/server/rsc-entry/index.ts +7 -1
  81. package/src/server/rsc-entry/render-route.ts +7 -1
  82. package/src/server/ssr-entry.ts +6 -0
  83. package/src/server/tree-match.ts +23 -11
  84. package/src/server/types.ts +2 -2
  85. package/dist/_chunks/build-output-helper-B1n0sUqj.js.map +0 -1
  86. package/dist/_chunks/cli-schema-sync-DHQLjFu3.js +0 -2
  87. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
  88. package/dist/_chunks/resolve-schema-Bf8eC6q6.js.map +0 -1
  89. package/dist/_chunks/walkers-DNp9tHyV.js.map +0 -1
@@ -18,7 +18,7 @@ export interface MetadataRouteInfo {
18
18
  /** Whether this route can appear in nested segments (not just app root). */
19
19
  nestable: boolean;
20
20
  }
21
- export type MetadataRouteType = 'sitemap' | 'robots' | 'manifest' | 'favicon' | 'icon' | 'opengraph-image' | 'twitter-image' | 'apple-icon';
21
+ export type MetadataRouteType = 'sitemap' | 'robots' | 'manifest' | 'favicon' | 'icon' | 'opengraph-image' | 'apple-icon';
22
22
  /**
23
23
  * All recognized metadata route file conventions.
24
24
  *
@@ -78,17 +78,33 @@ export declare function classifyMetadataRoute(fileName: string): MetadataRouteIn
78
78
  * @returns The URL path fragment this route serves at
79
79
  */
80
80
  export declare function getMetadataRouteServePath(type: MetadataRouteType): string;
81
+ export declare function isMetadataRouteServePath(pathname: string): boolean;
82
+ /** A <link> auto-link tag. */
83
+ export interface AutoLinkLink {
84
+ tag: 'link';
85
+ rel: string;
86
+ href: string;
87
+ type?: string;
88
+ }
89
+ /** A <meta> auto-link tag. */
90
+ export interface AutoLinkMeta {
91
+ tag: 'meta';
92
+ property?: string;
93
+ name?: string;
94
+ content: string;
95
+ }
96
+ export type AutoLinkTag = AutoLinkLink | AutoLinkMeta;
81
97
  /**
82
98
  * Get the auto-link tags to inject into <head> for metadata route files
83
99
  * discovered in a segment.
84
100
  *
101
+ * Returns link tags for icon/apple-icon/manifest, and meta tags for
102
+ * opengraph-image (emits both og:image and twitter:image). Returns null
103
+ * for types that don't auto-link (favicon, sitemap, robots).
104
+ *
85
105
  * @param type - The metadata route type
86
106
  * @param href - The resolved URL path to the metadata route
87
- * @returns An object with tag/attrs for the <head>, or null if no auto-link
107
+ * @returns Tag descriptor(s) for the <head>, or null if no auto-link
88
108
  */
89
- export declare function getMetadataRouteAutoLink(type: MetadataRouteType, href: string): {
90
- rel: string;
91
- href: string;
92
- type?: string;
93
- } | null;
109
+ export declare function getMetadataRouteAutoLink(type: MetadataRouteType, href: string): AutoLinkTag[];
94
110
  //# sourceMappingURL=metadata-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-routes.d.ts","sourceRoot":"","sources":["../../src/server/metadata-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,YAAY,CAAC;AAIjB;;;;;;;;GAQG;AAC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;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAMhF;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GACxC,IAAI,CAKN;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI/D;AAkBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAG/C;AAID;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,OAAO,EACP,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,MAAM,CAAC,QAAQ,CACnF,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAmBrE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmBhE"}
@@ -95,5 +95,5 @@ export declare class RouteSignalWithContext extends Error {
95
95
  * AccessPreRunner during renderToReadableStream so that access.ts and
96
96
  * render components share the same React.cache scope (TIM-662).
97
97
  */
98
- export declare function buildRouteElement(req: Request, match: RouteMatch, interception?: InterceptionContext, clientStateTree?: Set<string> | null): Promise<RouteElementResult>;
98
+ export declare function buildRouteElement(req: Request, match: RouteMatch, interception?: InterceptionContext, clientStateTree?: Set<string> | null, metadataRouteHashes?: Record<string, string>): Promise<RouteElementResult>;
99
99
  //# sourceMappingURL=route-element-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAa7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAezD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAM7D;AAID;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAID,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,2CAA2C;IAC3C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,wDAAwD;IACxD,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,4DAA4D;IAC5D,gBA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M,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,2CAA2C;IAC3C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,wDAAwD;IACxD,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;aAE7B,MAAM,EAAE,UAAU,GAAG,cAAc;aACnC,gBAAgB,EAAE,oBAAoB,EAAE;aACxC,QAAQ,EAAE,mBAAmB,EAAE;gBAF/B,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,gBAAgB,EAAE,oBAAoB,EAAE,EACxC,QAAQ,EAAE,mBAAmB,EAAE;CAIlD;AA8DD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,mBAAmB,EAClC,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CA0Y7B"}
@@ -57,12 +57,14 @@ export interface MetadataRouteMatch {
57
57
  * that should be served from disk rather than executed as a handler.
58
58
  */
59
59
  isStatic: boolean;
60
+ /** Extracted segment params from dynamic segments in the URL prefix. */
61
+ segmentParams: Record<string, string | string[]>;
60
62
  }
61
63
  /**
62
64
  * Create a metadata route matcher from a manifest.
63
65
  *
64
- * Walks the segment tree and builds a map from serve paths to handler modules.
65
- * Metadata routes are matched by exact pathname (e.g., /sitemap.xml, /blog/sitemap.xml).
66
+ * Uses dynamic tree matching to resolve metadata routes, supporting
67
+ * dynamic segments like /docs/[slug]/opengraph-image.
66
68
  *
67
69
  * See design/16-metadata.md §"Metadata Routes"
68
70
  */
@@ -1 +1 @@
1
- {"version":3,"file":"route-matcher.d.ts","sourceRoot":"","sources":["../../src/server/route-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAY9B,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,GACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAEzC;AAsCD,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,IAAI,EAAE,iBAAiB,CAAC;IACxB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,0DA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;IAC7B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAClD;AAQD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,GACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,CAEjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AAuBA,OAAO,uCAAuC,CAAC;AAqB/C,OAAO,KAAK,EAAuB,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAqCtF;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAE5E;AA8WD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,QAAA,MAAiB,QAAQ,qCAGxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAkB,CAAC;AAE9C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AAuBA,OAAO,uCAAuC,CAAC;AAqB/C,OAAO,KAAK,EAAuB,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAqCtF;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAE5E;AAoXD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,QAAA,MAAiB,QAAQ,qCAGxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAkB,CAAC;AAE9C,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAU1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAkB/D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,qBAAqB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,eAAe,EACrB,YAAY,CAAC,EAAE,mBAAmB,GACjC,OAAO,CAAC,QAAQ,CAAC,CAkOnB"}
1
+ {"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAU1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE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AM,CAAC,CAAC;IACrC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qEAAqE;IACrE,SAAS,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACvC;;;0DAGsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;iFAE6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;4DACwD;IACxD,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE;QACZ,gFAAgF;QAChF,QAAQ,EAAE,MAAM,CAAC;QACjB,uDAAuD;QACvD,OAAO,EAAE,MAAM,CAAC;QAChB,gEAAgE;QAChE,MAAM,EAAE,MAAM,CAAC;QACf,wEAAwE;QACxE,UAAU,EAAE,MAAM,CAAC;QACnB,+CAA+C;QAC/C,OAAO,EAAE,MAAM,CAAC;QAChB,sDAAsD;QACtD,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;IAEF;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,QAAQ,CAAC,CA6LnB;AAED,eAAe,SAAS,CAAC"}
@@ -22,6 +22,14 @@ export interface TreeMatchResult<TFile> {
22
22
  /** Collected params, keyed by param name. Catch-all params are string[]. */
23
23
  params: Record<string, string | string[]>;
24
24
  }
25
+ export interface TreeMatchOptions {
26
+ /**
27
+ * When true (default), only match if the leaf node has a page or route
28
+ * handler. Set to false for metadata route matching, where we just need
29
+ * to find the owning segment regardless of whether it has a page.
30
+ */
31
+ requireTerminal?: boolean;
32
+ }
25
33
  /**
26
34
  * Match URL path parts against a segment tree.
27
35
  *
@@ -29,13 +37,13 @@ export interface TreeMatchResult<TFile> {
29
37
  * ordering globally across group boundaries. Returns the matched
30
38
  * segment chain and collected params, or null if no route matches.
31
39
  *
32
- * A match requires a terminal node (one with `page` or `route`) at
33
- * the leaf. Catch-all and optional-catch-all segments only match if
34
- * they are terminal.
40
+ * By default, a match requires a terminal node (one with `page` or
41
+ * `route`) at the leaf. Pass `{ requireTerminal: false }` to match
42
+ * any segment (used by metadata route matching).
35
43
  *
36
44
  * @param root The root segment node to start matching from.
37
45
  * @param parts URL path parts (e.g. ['blog', 'hello-world']).
38
46
  * Empty array matches the root itself (if terminal).
39
47
  */
40
- export declare function matchUrlParts<TFile>(root: SegmentNode<TFile>, parts: string[]): TreeMatchResult<TFile> | null;
48
+ export declare function matchUrlParts<TFile>(root: SegmentNode<TFile>, parts: string[], options?: TreeMatchOptions): TreeMatchResult<TFile> | null;
41
49
  //# sourceMappingURL=tree-match.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree-match.d.ts","sourceRoot":"","sources":["../../src/server/tree-match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,2DAA2D;AAC3D,MAAM,WAAW,eAAe,CAAC,KAAK;IACpC,0DAA0D;IAC1D,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EACjC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,MAAM,EAAE,GACd,eAAe,CAAC,KAAK,CAAC,GAAG,IAAI,CAQ/B"}
1
+ {"version":3,"file":"tree-match.d.ts","sourceRoot":"","sources":["../../src/server/tree-match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,2DAA2D;AAC3D,MAAM,WAAW,eAAe,CAAC,KAAK;IACpC,0DAA0D;IAC1D,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EACjC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,gBAAgB,GACzB,eAAe,CAAC,KAAK,CAAC,GAAG,IAAI,CAS/B"}
@@ -250,7 +250,7 @@ export declare namespace MetadataRoute {
250
250
  * This is a structural union — the pipeline dispatches on the shape at
251
251
  * request time (see `pipeline-phases.ts`):
252
252
  * - `Response` → returned as-is (e.g. `ImageResponse`, `Response.redirect()`).
253
- * Used by `icon.tsx`, `opengraph-image.tsx`, `twitter-image.tsx`,
253
+ * Used by `icon.tsx`, `opengraph-image.tsx`,
254
254
  * `apple-icon.tsx`.
255
255
  * - `string` → written as the response body verbatim. Used by `robots.ts`
256
256
  * and by any handler that wants to emit a pre-serialized payload.
@@ -265,7 +265,7 @@ export type MetadataResult = Response | string | MetadataRoute.Sitemap | Metadat
265
265
  /**
266
266
  * Default export signature for a dynamic metadata route file
267
267
  * (`sitemap.ts`, `robots.ts`, `manifest.ts`, `icon.tsx`,
268
- * `opengraph-image.tsx`, `twitter-image.tsx`, `apple-icon.tsx`).
268
+ * `opengraph-image.tsx`, `apple-icon.tsx`).
269
269
  *
270
270
  * Parameterize `TResult` to narrow the return type for a specific route:
271
271
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.121",
3
+ "version": "0.2.0-alpha.122",
4
4
  "description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -11,8 +11,8 @@
11
11
  // IMPORTANT: This module must remain a leaf — no imports from ../server/,
12
12
  // ../client/, or Vite-dependent code. See adapters/shared.ts header.
13
13
 
14
- import { writeFile, mkdir, cp } from 'node:fs/promises';
15
- import { join } from 'node:path';
14
+ import { writeFile, mkdir, cp, readdir, readFile } from 'node:fs/promises';
15
+ import { join, basename } from 'node:path';
16
16
  import { generateHeadersFile } from './shared.js';
17
17
  import type { TimberConfig } from './types';
18
18
 
@@ -54,11 +54,23 @@ export async function runSharedBuildSteps(opts: BuildOutputBaseOptions): Promise
54
54
  const clientDir = join(buildDir, 'client');
55
55
  const publicDir = join(outDir, publicDirName);
56
56
  await mkdir(publicDir, { recursive: true });
57
+ // Find WASM files that are referenced by client JS (legitimate client WASM)
58
+ // vs orphaned server-only WASM (e.g. @takumi-rs for OG image generation).
59
+ // Only strip orphaned WASM to avoid breaking client-side WASM usage.
60
+ const referencedWasm = await findReferencedWasm(clientDir);
61
+
57
62
  await cp(clientDir, publicDir, {
58
63
  recursive: true,
59
- filter: config.clientJavascriptDisabled ? (src: string) => !src.endsWith('.js') : undefined,
60
- }).catch(() => {
64
+ filter: (src: string) => {
65
+ if (src.endsWith('.wasm') && !referencedWasm.has(basename(src))) {
66
+ return false;
67
+ }
68
+ if (config.clientJavascriptDisabled && src.endsWith('.js')) return false;
69
+ return true;
70
+ },
71
+ }).catch((e: NodeJS.ErrnoException) => {
61
72
  // Client dir may not exist when client JavaScript is disabled
73
+ if (e.code !== 'ENOENT') throw e;
62
74
  });
63
75
 
64
76
  // 3. Write _headers file for static asset cache control.
@@ -66,7 +78,12 @@ export async function runSharedBuildSteps(opts: BuildOutputBaseOptions): Promise
66
78
 
67
79
  // 4. Copy RSC + SSR server bundles into the output directory.
68
80
  await cp(join(buildDir, 'rsc'), join(outDir, 'rsc'), { recursive: true });
69
- await cp(join(buildDir, 'ssr'), join(outDir, 'ssr'), { recursive: true }).catch(() => {});
81
+ await cp(join(buildDir, 'ssr'), join(outDir, 'ssr'), { recursive: true }).catch(
82
+ (e: NodeJS.ErrnoException) => {
83
+ // SSR dir may not exist for static-only builds
84
+ if (e.code !== 'ENOENT') throw e;
85
+ }
86
+ );
70
87
 
71
88
  // 5. Write manifest-init module if present.
72
89
  if (config.manifestInit) {
@@ -75,3 +92,48 @@ export async function runSharedBuildSteps(opts: BuildOutputBaseOptions): Promise
75
92
 
76
93
  return publicDir;
77
94
  }
95
+
96
+ /**
97
+ * Scan client JS files for references to .wasm filenames.
98
+ * Returns the set of WASM basenames that are actually imported/referenced
99
+ * by client code and must be preserved in the static output.
100
+ */
101
+ async function findReferencedWasm(clientDir: string): Promise<Set<string>> {
102
+ const referenced = new Set<string>();
103
+
104
+ let files: string[];
105
+ try {
106
+ files = await collectFiles(clientDir);
107
+ } catch {
108
+ return referenced;
109
+ }
110
+
111
+ const jsFiles = files.filter((f) => f.endsWith('.js'));
112
+ const wasmFiles = files.filter((f) => f.endsWith('.wasm')).map((f) => basename(f));
113
+ if (wasmFiles.length === 0) return referenced;
114
+
115
+ for (const jsFile of jsFiles) {
116
+ const content = await readFile(jsFile, 'utf-8');
117
+ for (const wasmName of wasmFiles) {
118
+ if (content.includes(wasmName)) {
119
+ referenced.add(wasmName);
120
+ }
121
+ }
122
+ }
123
+
124
+ return referenced;
125
+ }
126
+
127
+ async function collectFiles(dir: string): Promise<string[]> {
128
+ const result: string[] = [];
129
+ const entries = await readdir(dir, { withFileTypes: true });
130
+ for (const entry of entries) {
131
+ const fullPath = join(dir, entry.name);
132
+ if (entry.isDirectory()) {
133
+ result.push(...(await collectFiles(fullPath)));
134
+ } else {
135
+ result.push(fullPath);
136
+ }
137
+ }
138
+ return result;
139
+ }
@@ -89,11 +89,32 @@ function generateNewSchema(segments: string[]): string {
89
89
  * Append missing segment entries to an existing schema file.
90
90
  * Inserts new entries before the closing `}` of segmentParams.
91
91
  */
92
+ const CODEC_IMPORT = "import { codec } from '@timber-js/app/codec';";
93
+
94
+ function hasCodecImport(content: string): boolean {
95
+ return /import\s+\{[^}]*\bcodec\b[^}]*\}\s+from\s+['"]@timber-js\/app\/codec['"]/.test(content);
96
+ }
97
+
98
+ function ensureCodecImport(content: string): string {
99
+ if (hasCodecImport(content)) return content;
100
+
101
+ // Insert after the last existing import statement
102
+ const lines = content.split('\n');
103
+ let lastImportIndex = -1;
104
+ for (let i = 0; i < lines.length; i++) {
105
+ if (/^\s*import\s/.test(lines[i])) lastImportIndex = i;
106
+ }
107
+
108
+ if (lastImportIndex === -1) {
109
+ return CODEC_IMPORT + '\n' + content;
110
+ }
111
+
112
+ lines.splice(lastImportIndex + 1, 0, CODEC_IMPORT);
113
+ return lines.join('\n');
114
+ }
115
+
92
116
  function appendToSchema(content: string, newSegments: string[]): string {
93
- // Find the closing brace of segmentParams object.
94
- // Strategy: find the last entry in segmentParams block, insert after it.
95
- // Look for the pattern: segmentParams: { ... }
96
- // We find the closing `},` or `}` that ends segmentParams.
117
+ content = ensureCodecImport(content);
97
118
 
98
119
  // Find "segmentParams" key position
99
120
  const spIndex = content.indexOf('segmentParams');
@@ -39,7 +39,7 @@ import 'virtual:timber-search-params-registry';
39
39
  // @ts-expect-error — virtual module provided by timber-routing plugin
40
40
  import schemaCodecs from 'virtual:timber-schema';
41
41
  import { setLinkCodecs } from '../../params/codec-registry.js';
42
- if (schemaCodecs) setLinkCodecs(schemaCodecs);
42
+ setLinkCodecs(schemaCodecs);
43
43
 
44
44
  import { setClientDeploymentId } from '../rsc-fetch.js';
45
45
  import {
@@ -143,6 +143,9 @@ export type LinkSegmentParams<T> = {
143
143
  // because there is no way to look up a definition from a computed string.
144
144
  //
145
145
  // `resolveHref` discriminates at runtime by presence of a `definition` key.
146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
+ export type ParamValue = string | number | string[] | { toString(): string; [key: string]: any };
148
+
146
149
  type WrappedSearchParamsProp = {
147
150
  definition: SearchParamsDefinition<Record<string, unknown>>;
148
151
  values: Record<string, unknown>;
@@ -156,7 +159,7 @@ type LinkSearchParamsProp = WrappedSearchParamsProp | FlatSearchParamsProp;
156
159
  */
157
160
  interface LinkRuntimeProps extends LinkBaseProps {
158
161
  href: string;
159
- segmentParams?: Record<string, string | number | string[]>;
162
+ segmentParams?: Record<string, ParamValue>;
160
163
  searchParams?: LinkSearchParamsProp;
161
164
  }
162
165
 
@@ -167,7 +170,7 @@ export type LinkPropsWithHref = LinkBaseProps & {
167
170
  searchParams?: LinkSearchParamsProp;
168
171
  };
169
172
  export type LinkPropsWithParams = LinkRuntimeProps & {
170
- segmentParams: Record<string, string | number | string[]>;
173
+ segmentParams: Record<string, ParamValue>;
171
174
  };
172
175
  export type LinkProps = LinkRuntimeProps;
173
176
 
@@ -232,7 +235,7 @@ export function parseSegments(pattern: string): UrlSegment[] {
232
235
  */
233
236
  function resolveSegment(
234
237
  seg: UrlSegment,
235
- params: Record<string, string | number | string[]>,
238
+ params: Record<string, ParamValue>,
236
239
  pattern: string
237
240
  ): string | null {
238
241
  switch (seg.kind) {
@@ -313,10 +316,7 @@ function splitPatternSuffix(pattern: string): [path: string, suffix: string] {
313
316
  return [path, suffix];
314
317
  }
315
318
 
316
- export function interpolateParams(
317
- pattern: string,
318
- params: Record<string, string | number | string[]>
319
- ): string {
319
+ export function interpolateParams(pattern: string, params: Record<string, ParamValue>): string {
320
320
  const [pathPart, suffix] = splitPatternSuffix(pattern);
321
321
 
322
322
  const resolved = parseSegments(pathPart)
@@ -346,7 +346,7 @@ function isWrappedSearchParamsProp(sp: LinkSearchParamsProp): sp is WrappedSearc
346
346
 
347
347
  export function resolveHref(
348
348
  href: string,
349
- params?: Record<string, string | number | string[]>,
349
+ params?: Record<string, ParamValue>,
350
350
  searchParams?: LinkSearchParamsProp
351
351
  ): string {
352
352
  let resolvedPath = href;
@@ -416,7 +416,7 @@ interface LinkOutputProps {
416
416
  */
417
417
  export function buildLinkProps(
418
418
  props: Pick<LinkPropsWithHref, 'href'> & {
419
- params?: Record<string, string | number | string[]>;
419
+ params?: Record<string, ParamValue>;
420
420
  searchParams?: LinkSearchParamsProp;
421
421
  }
422
422
  ): LinkOutputProps {
package/src/index.ts CHANGED
@@ -29,6 +29,7 @@ import { timberReactProd } from './plugins/react-prod';
29
29
  import { timberChunks } from './plugins/chunks';
30
30
  import { clientChunkGroup } from './plugins/client-chunks';
31
31
  import { timberServerBundle } from './plugins/server-bundle';
32
+ import { timberCloudflareWasm } from './plugins/cloudflare-wasm';
32
33
  import { timberAdapterBuild } from './plugins/adapter-build';
33
34
  import { timberBuildReport } from './plugins/build-report';
34
35
  import { createNoopTimer } from './utils/startup-timer';
@@ -531,6 +532,7 @@ export function timber(config?: TimberUserConfig): PluginOption[] {
531
532
  timberMdx(ctx),
532
533
  timberContent(ctx),
533
534
  timberServerBundle(), // Bundle all deps in server environments for prod
535
+ timberCloudflareWasm(ctx), // Externalize WASM for Cloudflare Workers
534
536
  timberChunks(),
535
537
  timberBuildReport(ctx), // Post-build: route table with bundle sizes
536
538
  timberAdapterBuild(ctx), // Post-build: invoke adapter.buildOutput()
@@ -70,6 +70,10 @@ function isCatchAllKey(key: string): boolean {
70
70
  return CATCH_ALL_RE.test(key) || OPTIONAL_CATCH_ALL_RE.test(key);
71
71
  }
72
72
 
73
+ function isOptionalCatchAllKey(key: string): boolean {
74
+ return OPTIONAL_CATCH_ALL_RE.test(key);
75
+ }
76
+
73
77
  /**
74
78
  * Resolve the global schema's segmentParams into a map of bracket-keyed
75
79
  * param name → resolved Codec.
@@ -94,6 +98,17 @@ export function resolveSchemaCodecs(
94
98
  `(e.g. codec.catchAll(codec.string)). Got a scalar codec.`
95
99
  );
96
100
  }
101
+ if (
102
+ isOptionalCatchAllKey(bracketName) &&
103
+ isCodec(value) &&
104
+ '__catchAll' in value &&
105
+ !('__optional' in value)
106
+ ) {
107
+ throw new Error(
108
+ `[timber] Schema error: '${bracketName}' is an optional catch-all segment and requires codec.optionalCatchAll() ` +
109
+ `(e.g. codec.optionalCatchAll(codec.string)). Got a non-optional catch-all codec.`
110
+ );
111
+ }
97
112
  resolved[bracketName] = resolveCodec(bracketName, value);
98
113
  }
99
114
 
@@ -16,10 +16,13 @@
16
16
  * Design docs: 18-build-system.md §"Build Manifest", 02-rendering-pipeline.md §"Early Hints"
17
17
  */
18
18
 
19
- import { randomUUID } from 'node:crypto';
19
+ import { randomUUID, createHash } from 'node:crypto';
20
+ import { readFileSync } from 'node:fs';
20
21
  import type { Plugin, ResolvedConfig } from 'vite';
21
22
  import type { PluginContext } from '../plugin-context.js';
22
23
  import type { BuildManifest } from '../server/build-manifest.js';
24
+ import type { SegmentNode, RouteFile } from '../routing/types.js';
25
+ import { isDynamicMetadataExtension } from '../server/metadata-routes.js';
23
26
 
24
27
  // Rollup types used by generateBundle hook — imported from vite which re-exports them.
25
28
  // We define minimal interfaces here to avoid a direct 'rollup' dependency.
@@ -84,7 +87,7 @@ export function parseViteManifest(
84
87
  modulepreload[inputPath] = collectTransitiveDeps(inputPath, viteManifest, base);
85
88
  }
86
89
 
87
- return { css, js, modulepreload, fonts: {} };
90
+ return { css, js, modulepreload, fonts: {}, metadataRouteHashes: {} };
88
91
  }
89
92
 
90
93
  /**
@@ -197,7 +200,7 @@ export function buildManifestFromBundle(
197
200
  css['_global'] = allCss;
198
201
  }
199
202
 
200
- return { css, js, modulepreload, fonts: {} };
203
+ return { css, js, modulepreload, fonts: {}, metadataRouteHashes: {} };
201
204
  }
202
205
 
203
206
  /**
@@ -228,6 +231,50 @@ function collectTransitiveBundleDeps(
228
231
  return result;
229
232
  }
230
233
 
234
+ /**
235
+ * Walk the route tree and compute short content hashes for metadata route files
236
+ * (opengraph-image, icon, apple-icon) used for cache-busting
237
+ * the auto-linked URLs in <head>.
238
+ */
239
+ function computeMetadataRouteHashes(node: SegmentNode<RouteFile>): Record<string, string> {
240
+ const hashes: Record<string, string> = {};
241
+
242
+ if (node.metadataRoutes) {
243
+ for (const [baseName, file] of Object.entries(node.metadataRoutes)) {
244
+ if (!isDynamicMetadataExtension(baseName, file.extension)) {
245
+ // For static files, hash the file content
246
+ try {
247
+ const content = readFileSync(file.filePath);
248
+ const hash = createHash('sha256').update(content).digest('hex').slice(0, 8);
249
+ hashes[file.filePath] = hash;
250
+ } catch {
251
+ // File unreadable — skip hash, DEV_NONCE fallback applies
252
+ }
253
+ } else {
254
+ // For dynamic files (.ts/.tsx), hash the source file as a reasonable
255
+ // approximation — the output depends on runtime data too, but the
256
+ // source change is the best build-time signal we have.
257
+ try {
258
+ const content = readFileSync(file.filePath);
259
+ const hash = createHash('sha256').update(content).digest('hex').slice(0, 8);
260
+ hashes[file.filePath] = hash;
261
+ } catch {
262
+ // File unreadable — skip
263
+ }
264
+ }
265
+ }
266
+ }
267
+
268
+ for (const child of node.children) {
269
+ Object.assign(hashes, computeMetadataRouteHashes(child));
270
+ }
271
+ for (const slot of Object.values(node.slots)) {
272
+ Object.assign(hashes, computeMetadataRouteHashes(slot));
273
+ }
274
+
275
+ return hashes;
276
+ }
277
+
231
278
  /**
232
279
  * Create the timber-build-manifest Vite plugin.
233
280
  *
@@ -278,7 +325,7 @@ export function timberBuildManifest(ctx: PluginContext): Plugin {
278
325
  '// Auto-generated build manifest — do not edit.',
279
326
  '// Dev mode: empty manifest (Vite HMR handles CSS/JS).',
280
327
  '',
281
- 'const manifest = { css: {}, js: {}, modulepreload: {}, fonts: {} };',
328
+ 'const manifest = { css: {}, js: {}, modulepreload: {}, fonts: {}, metadataRouteHashes: {} };',
282
329
  '',
283
330
  'export default manifest;',
284
331
  ].join('\n');
@@ -292,7 +339,7 @@ export function timberBuildManifest(ctx: PluginContext): Plugin {
292
339
  '// Auto-generated build manifest — do not edit.',
293
340
  '// Production: reads manifest from globalThis (set by _timber-manifest-init.js).',
294
341
  '',
295
- 'const manifest = globalThis.__TIMBER_BUILD_MANIFEST__ ?? { css: {}, js: {}, modulepreload: {}, fonts: {} };',
342
+ 'const manifest = globalThis.__TIMBER_BUILD_MANIFEST__ ?? { css: {}, js: {}, modulepreload: {}, fonts: {}, metadataRouteHashes: {} };',
296
343
  '',
297
344
  'export default manifest;',
298
345
  ].join('\n');
@@ -309,6 +356,11 @@ export function timberBuildManifest(ctx: PluginContext): Plugin {
309
356
  if (envName === 'client') {
310
357
  ctx.buildManifest = buildManifestFromBundle(bundle, resolvedBase, ctx.root);
311
358
 
359
+ // Compute cache-busting hashes for metadata route files
360
+ if (ctx.routeTree) {
361
+ ctx.buildManifest.metadataRouteHashes = computeMetadataRouteHashes(ctx.routeTree.root);
362
+ }
363
+
312
364
  // When client JavaScript is disabled, strip JS chunks from the bundle
313
365
  // so Rollup never writes them to disk. CSS assets are preserved —
314
366
  // they're still needed for server-rendered HTML.