@timber-js/app 0.2.0-alpha.222 → 0.2.0-alpha.223

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 (354) hide show
  1. package/agent-skill.md +21 -5
  2. package/dist/_chunks/{actions-vBHr2vqd.js → actions-7dTXYJfu.js} +53 -24
  3. package/dist/_chunks/actions-7dTXYJfu.js.map +1 -0
  4. package/dist/_chunks/{als-registry-BZqHCtq-.js → als-registry-DpygwCp0.js} +2 -3
  5. package/dist/_chunks/{als-registry-BZqHCtq-.js.map → als-registry-DpygwCp0.js.map} +1 -1
  6. package/dist/_chunks/{als-slots-BEEIPKYm.js → als-slots-kbQrHTzm.js} +2 -3
  7. package/dist/_chunks/{als-slots-BEEIPKYm.js.map → als-slots-kbQrHTzm.js.map} +1 -1
  8. package/dist/_chunks/{base-path-DaQrzbez.js → base-path-DDIx0FXe.js} +2 -3
  9. package/dist/_chunks/{base-path-DaQrzbez.js.map → base-path-DDIx0FXe.js.map} +1 -1
  10. package/dist/_chunks/{build-manifest-DWppEdLB.js → build-manifest-Y4jl7nwU.js} +2 -3
  11. package/dist/_chunks/{build-manifest-DWppEdLB.js.map → build-manifest-Y4jl7nwU.js.map} +1 -1
  12. package/dist/_chunks/{build-output-helper-RV_BRcF1.js → build-output-helper-B7wWGTfR.js} +14 -10
  13. package/dist/_chunks/build-output-helper-B7wWGTfR.js.map +1 -0
  14. package/dist/_chunks/{cache-api-DdcDLpBj.js → cache-api-TDZ4hlDc.js} +190 -38
  15. package/dist/_chunks/cache-api-TDZ4hlDc.js.map +1 -0
  16. package/dist/_chunks/{canonicalize-BAWkWiKK.js → canonicalize-CqK135BN.js} +29 -4
  17. package/dist/_chunks/{canonicalize-BAWkWiKK.js.map → canonicalize-CqK135BN.js.map} +1 -1
  18. package/dist/_chunks/chains-CwOr3Myj.js +1 -0
  19. package/dist/_chunks/{chains-BchW_AtW.js → chains-Dgm3PrMe.js} +3 -4
  20. package/dist/_chunks/{chains-BchW_AtW.js.map → chains-Dgm3PrMe.js.map} +1 -1
  21. package/dist/_chunks/{classify-IqzMpxMs.js → classify--_kINHQV.js} +4 -5
  22. package/dist/_chunks/{classify-IqzMpxMs.js.map → classify--_kINHQV.js.map} +1 -1
  23. package/dist/_chunks/{cli-check-DQne_YhU.js → cli-check-Dv3f8d2j.js} +5 -6
  24. package/dist/_chunks/{cli-check-DQne_YhU.js.map → cli-check-Dv3f8d2j.js.map} +1 -1
  25. package/dist/_chunks/{cli-context-_mPttGGY.js → cli-context-CbZp32SK.js} +3 -4
  26. package/dist/_chunks/{cli-context-_mPttGGY.js.map → cli-context-CbZp32SK.js.map} +1 -1
  27. package/dist/_chunks/cli-context-n5hmkdla.js +1 -0
  28. package/dist/_chunks/cli-dev-status-prPMLU8G.js +138 -0
  29. package/dist/_chunks/cli-dev-status-prPMLU8G.js.map +1 -0
  30. package/dist/_chunks/cli-init-BoXOYYil.js +196 -0
  31. package/dist/_chunks/cli-init-BoXOYYil.js.map +1 -0
  32. package/dist/_chunks/{cli-schema-sync-BS-RFGE2.js → cli-schema-sync-DIPurq7X.js} +4 -5
  33. package/dist/_chunks/{cli-schema-sync-BS-RFGE2.js.map → cli-schema-sync-DIPurq7X.js.map} +1 -1
  34. package/dist/_chunks/{cli-schema-sync-v872sHms.js → cli-schema-sync-uq72EZmD.js} +1 -1
  35. package/dist/_chunks/{client-dep-entries-BJyP9SIu.js → client-dep-entries-CP7AkMCM.js} +4 -5
  36. package/dist/_chunks/{client-dep-entries-BJyP9SIu.js.map → client-dep-entries-CP7AkMCM.js.map} +1 -1
  37. package/dist/_chunks/{cloudflare-Byxl8FWP.js → cloudflare-B75X6u4O.js} +10 -13
  38. package/dist/_chunks/{cloudflare-Byxl8FWP.js.map → cloudflare-B75X6u4O.js.map} +1 -1
  39. package/dist/_chunks/{codec-registry-oOUxugz3.js → codec-registry-CPc6bjVl.js} +2 -3
  40. package/dist/_chunks/{codec-registry-oOUxugz3.js.map → codec-registry-CPc6bjVl.js.map} +1 -1
  41. package/dist/_chunks/{codegen-Bps1sLKJ.js → codegen-B9oWkWGf.js} +5 -8
  42. package/dist/_chunks/{codegen-Bps1sLKJ.js.map → codegen-B9oWkWGf.js.map} +1 -1
  43. package/dist/_chunks/{convention-lint-VwzrtjIt.js → convention-lint-hZwz5wd4.js} +8 -11
  44. package/dist/_chunks/{convention-lint-VwzrtjIt.js.map → convention-lint-hZwz5wd4.js.map} +1 -1
  45. package/dist/_chunks/dev-discovery-YnabkCKD.js +238 -0
  46. package/dist/_chunks/dev-discovery-YnabkCKD.js.map +1 -0
  47. package/dist/_chunks/{dev-server-BNr5drEO.js → dev-server-C61GWpGg.js} +369 -55
  48. package/dist/_chunks/dev-server-C61GWpGg.js.map +1 -0
  49. package/dist/_chunks/dev-server-CBvvM7Lr.js +1 -0
  50. package/dist/_chunks/{dev-store-BOa304m_.js → dev-store-BvdqtHvK.js} +82 -38
  51. package/dist/_chunks/dev-store-BvdqtHvK.js.map +1 -0
  52. package/dist/_chunks/{dist-DtrJyBbw.js → dist-C1Rjlo6s.js} +3 -5
  53. package/dist/_chunks/{dist-DtrJyBbw.js.map → dist-C1Rjlo6s.js.map} +1 -1
  54. package/dist/_chunks/{error-boundary-Bc8QPZuq.js → error-boundary-DRQXGWCp.js} +20 -27
  55. package/dist/_chunks/{error-boundary-Bc8QPZuq.js.map → error-boundary-DRQXGWCp.js.map} +1 -1
  56. package/dist/_chunks/{fast-hash-C-tVYrLb.js → fast-hash-DddxkU5Y.js} +2 -3
  57. package/dist/_chunks/{fast-hash-C-tVYrLb.js.map → fast-hash-DddxkU5Y.js.map} +1 -1
  58. package/dist/_chunks/{flight-source-node-BdHUOUqg.js → flight-source-node-0Tp6evlz.js} +6 -8
  59. package/dist/_chunks/flight-source-node-0Tp6evlz.js.map +1 -0
  60. package/dist/_chunks/{format-BKclgVbk.js → format-DuPOoXUP.js} +2 -3
  61. package/dist/_chunks/{format-BKclgVbk.js.map → format-DuPOoXUP.js.map} +1 -1
  62. package/dist/_chunks/{fs-identity-BRKuL215.js → fs-identity-BmQ_Agg-.js} +3 -5
  63. package/dist/_chunks/{fs-identity-BRKuL215.js.map → fs-identity-BmQ_Agg-.js.map} +1 -1
  64. package/dist/_chunks/{global-context-B9PFncvb.js → global-context-DbxNWeBP.js} +2 -3
  65. package/dist/_chunks/{global-context-B9PFncvb.js.map → global-context-DbxNWeBP.js.map} +1 -1
  66. package/dist/_chunks/{graph-cache-CYiUS2aS.js → graph-cache-B1LAg4t7.js} +5 -89
  67. package/dist/_chunks/graph-cache-B1LAg4t7.js.map +1 -0
  68. package/dist/_chunks/{href-validation-BIrxavIy.js → href-validation-CEZy1V-k.js} +4 -7
  69. package/dist/_chunks/{href-validation-BIrxavIy.js.map → href-validation-CEZy1V-k.js.map} +1 -1
  70. package/dist/_chunks/{json-lossy-check-C3Sht92C.js → json-lossy-check-DVkLUlfC.js} +3 -4
  71. package/dist/_chunks/{json-lossy-check-C3Sht92C.js.map → json-lossy-check-DVkLUlfC.js.map} +1 -1
  72. package/dist/_chunks/{live-graph-DEu_GWbc.js → live-graph-BcVjQ1Te.js} +6 -7
  73. package/dist/_chunks/{live-graph-DEu_GWbc.js.map → live-graph-BcVjQ1Te.js.map} +1 -1
  74. package/dist/_chunks/{logger-CI_hThfy.js → logger-CWk44DLp.js} +89 -47
  75. package/dist/_chunks/logger-CWk44DLp.js.map +1 -0
  76. package/dist/_chunks/{metadata-routes-B3XJNyIH.js → metadata-routes-BL26HCDd.js} +2 -3
  77. package/dist/_chunks/{metadata-routes-B3XJNyIH.js.map → metadata-routes-BL26HCDd.js.map} +1 -1
  78. package/dist/_chunks/{navigation-root-BQfo1-kG.js → navigation-root-M3B2ZrdO.js} +6 -10
  79. package/dist/_chunks/{navigation-root-BQfo1-kG.js.map → navigation-root-M3B2ZrdO.js.map} +1 -1
  80. package/dist/_chunks/{node-response-bF0bKoig.js → node-response-B9aviPDa.js} +43 -9
  81. package/dist/_chunks/node-response-B9aviPDa.js.map +1 -0
  82. package/dist/_chunks/{param-value-C8TNYchQ.js → param-value-DqlGfF57.js} +2 -3
  83. package/dist/_chunks/{param-value-C8TNYchQ.js.map → param-value-DqlGfF57.js.map} +1 -1
  84. package/dist/_chunks/{plugin-context-uDHFqHHJ.js → plugin-context-BfSRKJfz.js} +1 -1
  85. package/dist/_chunks/{plugin-context-DxMMvjUt.js → plugin-context-FCkaNLUB.js} +4 -6
  86. package/dist/_chunks/plugin-context-FCkaNLUB.js.map +1 -0
  87. package/dist/_chunks/{poison-rules-DoEhbqaY.js → poison-rules-Bmz-lCPi.js} +2 -3
  88. package/dist/_chunks/{poison-rules-DoEhbqaY.js.map → poison-rules-Bmz-lCPi.js.map} +1 -1
  89. package/dist/_chunks/{poison-scan-DTWIfNgD.js → poison-scan-DJYxZc_7.js} +4 -5
  90. package/dist/_chunks/{poison-scan-DTWIfNgD.js.map → poison-scan-DJYxZc_7.js.map} +1 -1
  91. package/dist/_chunks/{purge-store-WZaxu-3m.js → purge-store-8BqLAYZ1.js} +2 -3
  92. package/dist/_chunks/{purge-store-WZaxu-3m.js.map → purge-store-8BqLAYZ1.js.map} +1 -1
  93. package/dist/_chunks/{render-timeout-Ln_u7fX-.js → render-timeout-MrrqD1wd.js} +2 -3
  94. package/dist/_chunks/{render-timeout-Ln_u7fX-.js.map → render-timeout-MrrqD1wd.js.map} +1 -1
  95. package/dist/_chunks/{resolve-schema-CkAInout.js → resolve-schema-B-aCuTu3.js} +3 -4
  96. package/dist/_chunks/{resolve-schema-CkAInout.js.map → resolve-schema-B-aCuTu3.js.map} +1 -1
  97. package/dist/_chunks/{rsc-cache-key-ClUiXQnK.js → rsc-cache-key-D0cb0Gmc.js} +2 -3
  98. package/dist/_chunks/{rsc-cache-key-ClUiXQnK.js.map → rsc-cache-key-D0cb0Gmc.js.map} +1 -1
  99. package/dist/_chunks/{rsc-media-type-DDc7duTD.js → rsc-media-type-m8jz9u6_.js} +2 -3
  100. package/dist/_chunks/{rsc-media-type-DDc7duTD.js.map → rsc-media-type-m8jz9u6_.js.map} +1 -1
  101. package/dist/_chunks/{rsc-payload-path-dffcs4jp.js → rsc-payload-path-EphpDB-J.js} +2 -3
  102. package/dist/_chunks/{rsc-payload-path-dffcs4jp.js.map → rsc-payload-path-EphpDB-J.js.map} +1 -1
  103. package/dist/_chunks/{scan-BoP17W3w.js → scan-CyizcBiX.js} +2 -3
  104. package/dist/_chunks/{scan-BoP17W3w.js.map → scan-CyizcBiX.js.map} +1 -1
  105. package/dist/_chunks/{scanner-C8fdKvKG.js → scanner-CJC-ScJU.js} +15 -23
  106. package/dist/_chunks/{scanner-C8fdKvKG.js.map → scanner-CJC-ScJU.js.map} +1 -1
  107. package/dist/_chunks/{schema-bridge-DpOmvZlI.js → schema-bridge-DyRs3cqy.js} +2 -3
  108. package/dist/_chunks/{schema-bridge-DpOmvZlI.js.map → schema-bridge-DyRs3cqy.js.map} +1 -1
  109. package/dist/_chunks/{segment-classify-C539Pa2O.js → segment-classify-Ho8jXWeC.js} +3 -5
  110. package/dist/_chunks/{segment-classify-C539Pa2O.js.map → segment-classify-Ho8jXWeC.js.map} +1 -1
  111. package/dist/_chunks/{segment-context-D3DNxKFq.js → segment-context-CYiGTi3K.js} +4 -6
  112. package/dist/_chunks/{segment-context-D3DNxKFq.js.map → segment-context-CYiGTi3K.js.map} +1 -1
  113. package/dist/_chunks/{segment-keys-D5hu1hz4.js → segment-keys-Y60KNc8C.js} +2 -3
  114. package/dist/_chunks/{segment-keys-D5hu1hz4.js.map → segment-keys-Y60KNc8C.js.map} +1 -1
  115. package/dist/_chunks/{singleflight-BeVMMKi0.js → singleflight-BChPMjwH.js} +2 -3
  116. package/dist/_chunks/{singleflight-BeVMMKi0.js.map → singleflight-BChPMjwH.js.map} +1 -1
  117. package/dist/_chunks/{sizeof-CO3dk0V1.js → sizeof-DG4W40lv.js} +3 -4
  118. package/dist/_chunks/{sizeof-CO3dk0V1.js.map → sizeof-DG4W40lv.js.map} +1 -1
  119. package/dist/_chunks/{ssr-data-nA3I70_n.js → ssr-data-9hPtcNOr.js} +3 -4
  120. package/dist/_chunks/{ssr-data-nA3I70_n.js.map → ssr-data-9hPtcNOr.js.map} +1 -1
  121. package/dist/_chunks/{state-BhNGPsdi.js → state-B-EBjeER.js} +2 -3
  122. package/dist/_chunks/{state-BhNGPsdi.js.map → state-B-EBjeER.js.map} +1 -1
  123. package/dist/_chunks/{status-page-marker-BRX9Ib-d.js → status-page-marker-XIQXlTOb.js} +8 -13
  124. package/dist/_chunks/{status-page-marker-BRX9Ib-d.js.map → status-page-marker-XIQXlTOb.js.map} +1 -1
  125. package/dist/_chunks/{tree-match-6yihorhk.js → tree-match-Bqdr9szG.js} +2 -3
  126. package/dist/_chunks/{tree-match-6yihorhk.js.map → tree-match-Bqdr9szG.js.map} +1 -1
  127. package/dist/_chunks/{use-query-states-I3JMng6J.js → use-query-states-pkDV-jSg.js} +4 -7
  128. package/dist/_chunks/{use-query-states-I3JMng6J.js.map → use-query-states-pkDV-jSg.js.map} +1 -1
  129. package/dist/_chunks/{walkers-BqzxnwGC.js → walkers-DIE203ir.js} +6 -8
  130. package/dist/_chunks/{walkers-BqzxnwGC.js.map → walkers-DIE203ir.js.map} +1 -1
  131. package/dist/_chunks/{write-file-atomic-D1qWqHb4.js → write-file-atomic-DW8m_Atv.js} +2 -3
  132. package/dist/_chunks/{write-file-atomic-D1qWqHb4.js.map → write-file-atomic-DW8m_Atv.js.map} +1 -1
  133. package/dist/adapters/build-output-helper.d.ts +10 -1
  134. package/dist/adapters/build-output-helper.d.ts.map +1 -1
  135. package/dist/adapters/cloudflare-dev.js +2 -3
  136. package/dist/adapters/cloudflare-kv-cache.js +3 -4
  137. package/dist/adapters/cloudflare.d.ts.map +1 -1
  138. package/dist/adapters/cloudflare.js +1 -1
  139. package/dist/adapters/nitro-presets.d.ts +6 -0
  140. package/dist/adapters/nitro-presets.d.ts.map +1 -1
  141. package/dist/adapters/nitro-preview.d.ts.map +1 -1
  142. package/dist/adapters/nitro.d.ts.map +1 -1
  143. package/dist/adapters/nitro.js +94 -57
  144. package/dist/adapters/nitro.js.map +1 -1
  145. package/dist/analyze/crawl-entry.js +7 -9
  146. package/dist/analyze/crawl-entry.js.map +1 -1
  147. package/dist/analyze/graph-command.d.ts.map +1 -1
  148. package/dist/analyze/graph-command.js +19 -105
  149. package/dist/analyze/graph-command.js.map +1 -1
  150. package/dist/cache/index.js +3 -3
  151. package/dist/cache/key-discipline.d.ts +61 -0
  152. package/dist/cache/key-discipline.d.ts.map +1 -0
  153. package/dist/cache/stores/cloudflare-kv.js +1 -2
  154. package/dist/cache/stores/memory.js +2 -3
  155. package/dist/cache/stores/redis.js +1 -2
  156. package/dist/cache/stores/vercel.js +1 -2
  157. package/dist/cache/timber-cache.d.ts +5 -1
  158. package/dist/cache/timber-cache.d.ts.map +1 -1
  159. package/dist/cdn/cloudflare-purge.js +1 -2
  160. package/dist/cdn/fastly-purge.js +1 -2
  161. package/dist/cdn/index.js +2 -3
  162. package/dist/cdn/workers-cache-purge.js +3 -5
  163. package/dist/cdn/workers-cache-purge.js.map +1 -1
  164. package/dist/cli-dev-status.d.ts +75 -0
  165. package/dist/cli-dev-status.d.ts.map +1 -0
  166. package/dist/cli-init.d.ts +72 -0
  167. package/dist/cli-init.d.ts.map +1 -0
  168. package/dist/cli.d.ts +4 -12
  169. package/dist/cli.d.ts.map +1 -1
  170. package/dist/cli.js +27 -54
  171. package/dist/cli.js.map +1 -1
  172. package/dist/client/error-boundary.d.ts.map +1 -1
  173. package/dist/client/error-boundary.js +1 -1
  174. package/dist/client/index.js +22 -34
  175. package/dist/client/index.js.map +1 -1
  176. package/dist/client/internal.js +13 -18
  177. package/dist/client/internal.js.map +1 -1
  178. package/dist/client/use-cookie.d.ts +18 -5
  179. package/dist/client/use-cookie.d.ts.map +1 -1
  180. package/dist/codec.js +2 -3
  181. package/dist/config-types.d.ts +22 -5
  182. package/dist/config-types.d.ts.map +1 -1
  183. package/dist/config-validation.d.ts.map +1 -1
  184. package/dist/cookies/define-cookie.d.ts.map +1 -1
  185. package/dist/cookies/index.js +40 -67
  186. package/dist/cookies/index.js.map +1 -1
  187. package/dist/cookies/json-cookie.d.ts +4 -4
  188. package/dist/index.js +266 -229
  189. package/dist/index.js.map +1 -1
  190. package/dist/params/index.js +3 -4
  191. package/dist/plugin-context.d.ts +7 -0
  192. package/dist/plugin-context.d.ts.map +1 -1
  193. package/dist/plugins/dev-discovery.d.ts +69 -5
  194. package/dist/plugins/dev-discovery.d.ts.map +1 -1
  195. package/dist/plugins/dev-hostname.d.ts +152 -0
  196. package/dist/plugins/dev-hostname.d.ts.map +1 -0
  197. package/dist/plugins/dev-server.d.ts +5 -1
  198. package/dist/plugins/dev-server.d.ts.map +1 -1
  199. package/dist/plugins/dev-store-clear.d.ts +59 -4
  200. package/dist/plugins/dev-store-clear.d.ts.map +1 -1
  201. package/dist/plugins/graph-endpoint.d.ts +4 -2
  202. package/dist/plugins/graph-endpoint.d.ts.map +1 -1
  203. package/dist/plugins/prebuilt.d.ts.map +1 -1
  204. package/dist/routing/index.js +4 -4
  205. package/dist/rsc-runtime/rsc.d.ts +2 -1
  206. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  207. package/dist/rsc-runtime/server-references.d.ts +8 -0
  208. package/dist/rsc-runtime/server-references.d.ts.map +1 -0
  209. package/dist/search-params/index.js +5 -7
  210. package/dist/search-params/index.js.map +1 -1
  211. package/dist/server/access-gate.d.ts +12 -0
  212. package/dist/server/access-gate.d.ts.map +1 -1
  213. package/dist/server/canonicalize.d.ts +21 -0
  214. package/dist/server/canonicalize.d.ts.map +1 -1
  215. package/dist/server/cookie-context.d.ts +8 -1
  216. package/dist/server/cookie-context.d.ts.map +1 -1
  217. package/dist/server/flight-source-node.d.ts.map +1 -1
  218. package/dist/server/flight-source.d.ts.map +1 -1
  219. package/dist/server/index.d.ts +1 -1
  220. package/dist/server/index.d.ts.map +1 -1
  221. package/dist/server/index.js +8 -13
  222. package/dist/server/index.js.map +1 -1
  223. package/dist/server/interception-gates.d.ts +49 -0
  224. package/dist/server/interception-gates.d.ts.map +1 -0
  225. package/dist/server/internal.js +1061 -943
  226. package/dist/server/internal.js.map +1 -1
  227. package/dist/server/logger.d.ts +17 -0
  228. package/dist/server/logger.d.ts.map +1 -1
  229. package/dist/server/param-coercion.d.ts +8 -0
  230. package/dist/server/param-coercion.d.ts.map +1 -1
  231. package/dist/server/pipeline-interception.d.ts +34 -4
  232. package/dist/server/pipeline-interception.d.ts.map +1 -1
  233. package/dist/server/pipeline-metadata-route.d.ts +24 -0
  234. package/dist/server/pipeline-metadata-route.d.ts.map +1 -0
  235. package/dist/server/pipeline-metadata.d.ts +3 -2
  236. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  237. package/dist/server/pipeline-phases.d.ts +9 -3
  238. package/dist/server/pipeline-phases.d.ts.map +1 -1
  239. package/dist/server/pipeline.d.ts +18 -0
  240. package/dist/server/pipeline.d.ts.map +1 -1
  241. package/dist/server/prebuilt/dev-store.d.ts +68 -22
  242. package/dist/server/prebuilt/dev-store.d.ts.map +1 -1
  243. package/dist/server/prebuilt/overlay.d.ts +8 -0
  244. package/dist/server/prebuilt/overlay.d.ts.map +1 -1
  245. package/dist/server/prebuilt-runtime.d.ts.map +1 -1
  246. package/dist/server/primitives.d.ts +13 -0
  247. package/dist/server/primitives.d.ts.map +1 -1
  248. package/dist/server/render-utils.d.ts +21 -0
  249. package/dist/server/render-utils.d.ts.map +1 -1
  250. package/dist/server/request-context.d.ts +14 -0
  251. package/dist/server/request-context.d.ts.map +1 -1
  252. package/dist/server/route-element-builder.d.ts.map +1 -1
  253. package/dist/server/route-handler.d.ts +7 -0
  254. package/dist/server/route-handler.d.ts.map +1 -1
  255. package/dist/server/route-matcher.d.ts +14 -3
  256. package/dist/server/route-matcher.d.ts.map +1 -1
  257. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  258. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  259. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  260. package/dist/server/signal-identity.d.ts +6 -0
  261. package/dist/server/signal-identity.d.ts.map +1 -1
  262. package/dist/server/traced-access.d.ts +18 -0
  263. package/dist/server/traced-access.d.ts.map +1 -0
  264. package/dist/server/tracing.d.ts.map +1 -1
  265. package/dist/server/types.d.ts +5 -4
  266. package/dist/server/types.d.ts.map +1 -1
  267. package/dist/shims/font-google.js +1 -2
  268. package/dist/shims/font-local.js +1 -2
  269. package/dist/shims/headers.d.ts +11 -4
  270. package/dist/shims/headers.d.ts.map +1 -1
  271. package/docs/api/30-api-server.mdx +3 -1
  272. package/docs/api/32-api-cache.mdx +1 -1
  273. package/docs/api/34-api-config.mdx +22 -0
  274. package/docs/api/36-cli.mdx +72 -6
  275. package/docs/learn/01-quick-start.mdx +1 -1
  276. package/docs/learn/06-typed-params.mdx +2 -2
  277. package/docs/learn/10-caching.mdx +26 -5
  278. package/llms.txt +1 -1
  279. package/package.json +12 -12
  280. package/src/adapters/build-output-helper.ts +26 -4
  281. package/src/adapters/cloudflare.ts +1 -0
  282. package/src/adapters/nitro-presets.ts +15 -0
  283. package/src/adapters/nitro-preview.ts +66 -34
  284. package/src/adapters/nitro.ts +14 -6
  285. package/src/analyze/graph-command.ts +25 -133
  286. package/src/cache/key-discipline.ts +218 -0
  287. package/src/cache/timber-cache.ts +42 -5
  288. package/src/cli-dev-status.ts +196 -0
  289. package/src/cli-init.ts +278 -0
  290. package/src/cli.ts +33 -79
  291. package/src/client/error-boundary.tsx +19 -2
  292. package/src/client/use-cookie.ts +33 -21
  293. package/src/config-types.ts +22 -5
  294. package/src/config-validation.ts +17 -0
  295. package/src/cookies/define-cookie.ts +10 -46
  296. package/src/cookies/json-cookie.ts +4 -4
  297. package/src/plugin-context.ts +7 -0
  298. package/src/plugins/dev-discovery.ts +216 -6
  299. package/src/plugins/dev-hostname.ts +322 -0
  300. package/src/plugins/dev-server.ts +96 -37
  301. package/src/plugins/dev-store-clear.ts +105 -7
  302. package/src/plugins/graph-endpoint.ts +15 -3
  303. package/src/plugins/prebuilt.ts +9 -0
  304. package/src/rsc-runtime/rsc.ts +7 -3
  305. package/src/rsc-runtime/server-references.ts +73 -0
  306. package/src/rsc-runtime/vendor-types.d.ts +9 -0
  307. package/src/server/access-gate.tsx +32 -20
  308. package/src/server/action-handler.ts +40 -34
  309. package/src/server/canonicalize.ts +27 -0
  310. package/src/server/cookie-context.ts +11 -3
  311. package/src/server/flight-source-node.ts +5 -2
  312. package/src/server/flight-source.ts +4 -3
  313. package/src/server/index.ts +6 -1
  314. package/src/server/interception-gates.ts +94 -0
  315. package/src/server/logger.ts +23 -0
  316. package/src/server/param-coercion.ts +22 -0
  317. package/src/server/pipeline-interception.ts +64 -4
  318. package/src/server/pipeline-metadata-route.ts +242 -0
  319. package/src/server/pipeline-metadata.ts +7 -5
  320. package/src/server/pipeline-phases.ts +71 -131
  321. package/src/server/pipeline.ts +20 -2
  322. package/src/server/prebuilt/dev-store.ts +113 -34
  323. package/src/server/prebuilt/overlay.ts +18 -0
  324. package/src/server/prebuilt-runtime.ts +43 -44
  325. package/src/server/primitives.ts +14 -0
  326. package/src/server/render-utils.ts +25 -0
  327. package/src/server/request-context.ts +27 -3
  328. package/src/server/route-element-builder.ts +15 -2
  329. package/src/server/route-handler.ts +3 -2
  330. package/src/server/route-matcher.ts +48 -33
  331. package/src/server/rsc-entry/api-handler.ts +2 -33
  332. package/src/server/rsc-entry/index.ts +8 -3
  333. package/src/server/rsc-entry/rsc-stream.ts +7 -1
  334. package/src/server/signal-identity.ts +30 -12
  335. package/src/server/traced-access.ts +50 -0
  336. package/src/server/tracing.ts +18 -1
  337. package/src/server/types.ts +5 -4
  338. package/src/shims/headers.ts +12 -4
  339. package/dist/_chunks/actions-vBHr2vqd.js.map +0 -1
  340. package/dist/_chunks/build-output-helper-RV_BRcF1.js.map +0 -1
  341. package/dist/_chunks/cache-api-DdcDLpBj.js.map +0 -1
  342. package/dist/_chunks/chains-B8TCLved.js +0 -1
  343. package/dist/_chunks/cli-context-BJQB6rtF.js +0 -1
  344. package/dist/_chunks/dev-server-BNr5drEO.js.map +0 -1
  345. package/dist/_chunks/dev-server-CUg7Mqh_.js +0 -1
  346. package/dist/_chunks/dev-store-BOa304m_.js.map +0 -1
  347. package/dist/_chunks/flight-source-node-BdHUOUqg.js.map +0 -1
  348. package/dist/_chunks/graph-cache-CYiUS2aS.js.map +0 -1
  349. package/dist/_chunks/logger-CI_hThfy.js.map +0 -1
  350. package/dist/_chunks/node-response-bF0bKoig.js.map +0 -1
  351. package/dist/_chunks/plugin-context-DxMMvjUt.js.map +0 -1
  352. package/dist/server/prebuilt/key-discipline.d.ts +0 -52
  353. package/dist/server/prebuilt/key-discipline.d.ts.map +0 -1
  354. package/src/server/prebuilt/key-discipline.ts +0 -122
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { rename, rm, writeFile } from "node:fs/promises";
3
- //#region src/utils/write-file-atomic.ts
3
+ // src/utils/write-file-atomic.ts
4
4
  /**
5
5
  * Replace a file's contents in one step: write a uniquely named temp sibling,
6
6
  * then `rename()` it over the target.
@@ -26,7 +26,6 @@ async function writeFileAtomic(path, data) {
26
26
  throw err;
27
27
  }
28
28
  }
29
- //#endregion
30
29
  export { writeFileAtomic as t };
31
30
 
32
- //# sourceMappingURL=write-file-atomic-D1qWqHb4.js.map
31
+ //# sourceMappingURL=write-file-atomic-DW8m_Atv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"write-file-atomic-D1qWqHb4.js","names":[],"sources":["../../src/utils/write-file-atomic.ts"],"sourcesContent":["/**\n * Replace a file's contents in one step: write a uniquely named temp sibling,\n * then `rename()` it over the target.\n *\n * `writeFile()` opens its target with `O_TRUNC`, so for the length of the write\n * a concurrent reader sees an empty or half-written file under the real name.\n * `rename()` within one directory swaps the name atomically, so a reader sees\n * either the old file or the new one — never a torn one — and a crashed\n * writer leaves no partial artifact under the final name.\n *\n * The temp name is unique per call, not a fixed `${path}.tmp`: two writers of\n * the same path (a dev server and a `vite build` rewriting the same route\n * types, parallel CLI invocations sharing a cache) would otherwise write into\n * one temp file and rename each other's half-written bytes into place.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { rename, rm, writeFile } from 'node:fs/promises';\n\nexport async function writeFileAtomic(path: string, data: Uint8Array | string): Promise<void> {\n const tmp = `${path}.${randomUUID()}.tmp`;\n try {\n await writeFile(tmp, data);\n await rename(tmp, path);\n } catch (err) {\n // Best-effort cleanup. If the directory refuses the write it may refuse\n // the rm too, and that error — naming a random temp path — must not\n // replace the one that says what actually failed.\n await rm(tmp, { force: true }).catch(() => {});\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAAgB,MAAc,MAA0C;CAC5F,MAAM,MAAM,GAAG,KAAK,GAAG,WAAW,EAAE;CACpC,IAAI;EACF,MAAM,UAAU,KAAK,IAAI;EACzB,MAAM,OAAO,KAAK,IAAI;CACxB,SAAS,KAAK;EAIZ,MAAM,GAAG,KAAK,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;EAC7C,MAAM;CACR;AACF"}
1
+ {"version":3,"file":"write-file-atomic-DW8m_Atv.js","names":[],"sources":["../../src/utils/write-file-atomic.ts"],"sourcesContent":["/**\n * Replace a file's contents in one step: write a uniquely named temp sibling,\n * then `rename()` it over the target.\n *\n * `writeFile()` opens its target with `O_TRUNC`, so for the length of the write\n * a concurrent reader sees an empty or half-written file under the real name.\n * `rename()` within one directory swaps the name atomically, so a reader sees\n * either the old file or the new one — never a torn one — and a crashed\n * writer leaves no partial artifact under the final name.\n *\n * The temp name is unique per call, not a fixed `${path}.tmp`: two writers of\n * the same path (a dev server and a `vite build` rewriting the same route\n * types, parallel CLI invocations sharing a cache) would otherwise write into\n * one temp file and rename each other's half-written bytes into place.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { rename, rm, writeFile } from 'node:fs/promises';\n\nexport async function writeFileAtomic(path: string, data: Uint8Array | string): Promise<void> {\n const tmp = `${path}.${randomUUID()}.tmp`;\n try {\n await writeFile(tmp, data);\n await rename(tmp, path);\n } catch (err) {\n // Best-effort cleanup. If the directory refuses the write it may refuse\n // the rm too, and that error — naming a random temp path — must not\n // replace the one that says what actually failed.\n await rm(tmp, { force: true }).catch(() => {});\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAAgB,MAAc,MAA0C;CAC5F,MAAM,MAAM,GAAG,KAAK,GAAG,WAAW,EAAE;CACpC,IAAI;EACF,MAAM,UAAU,KAAK,IAAI;EACzB,MAAM,OAAO,KAAK,IAAI;CACxB,SAAS,KAAK;EAIZ,MAAM,GAAG,KAAK,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;EAC7C,MAAM;CACR;AACF"}
@@ -12,13 +12,22 @@ export interface BuildOutputBaseOptions {
12
12
  * Nitro uses 'public', Cloudflare uses 'static'.
13
13
  */
14
14
  publicDirName: string;
15
+ /**
16
+ * Whether the platform reads `_headers` and `_redirects` from the public
17
+ * directory (Cloudflare, Netlify). When false, the output has neither — no
18
+ * generated `_headers`, and not the user's `public/_headers` or
19
+ * `public/_redirects`, which Vite copies into the client output: on a host
20
+ * that does not read them they are plain files, served to anyone who asks
21
+ * for `/_headers` (TIM-1605).
22
+ */
23
+ platformFiles: boolean;
15
24
  }
16
25
  /**
17
26
  * Run the platform-agnostic build output steps shared by all adapters:
18
27
  *
19
28
  * 1. Create the output directory
20
29
  * 2. Copy client assets to the public/static directory
21
- * 3. Write the `_headers` file for static asset cache control
30
+ * 3. Write the `_headers` file for static asset cache control, if `platformFiles`
22
31
  * 4. Copy RSC and SSR server bundles into the output directory
23
32
  * 5. Write the manifest-init module if present
24
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"build-output-helper.d.ts","sourceRoot":"","sources":["../../src/adapters/build-output-helper.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,iDAAiD;AACjD,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,+BAA+B;IAC/B,SAAS,EAAE,oBAAoB,CAAC;IAChC,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDvF;AA8BD,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CA2BnB;AA2BD;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,oBAAoB,EAC/B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAcf;AAoBD;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1F"}
1
+ {"version":3,"file":"build-output-helper.d.ts","sourceRoot":"","sources":["../../src/adapters/build-output-helper.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,iDAAiD;AACjD,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,+BAA+B;IAC/B,SAAS,EAAE,oBAAoB,CAAC;IAChC,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkEvF;AA8BD,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CA2BnB;AA2BD;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,oBAAoB,EAC/B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAcf;AAoBD;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1F"}
@@ -1,5 +1,5 @@
1
- import { f as runWithBindings } from "../_chunks/cloudflare-Byxl8FWP.js";
2
- //#region src/adapters/cloudflare-dev.ts
1
+ import { f as runWithBindings } from "../_chunks/cloudflare-B75X6u4O.js";
2
+ // src/adapters/cloudflare-dev.ts
3
3
  /**
4
4
  * Dynamically import wrangler. Extracted as a named export so tests
5
5
  * can mock it without needing wrangler installed.
@@ -68,7 +68,6 @@ function cloudflareDevBindings(options = {}) {
68
68
  }
69
69
  };
70
70
  }
71
- //#endregion
72
71
  export { DEV_REQUEST_WRAPPER_KEY, cloudflareDevBindings, loadWrangler };
73
72
 
74
73
  //# sourceMappingURL=cloudflare-dev.js.map
@@ -1,6 +1,6 @@
1
- import { t as warnLossyJsonValue } from "../_chunks/json-lossy-check-C3Sht92C.js";
2
- import { l as getCloudflareBindings } from "../_chunks/cloudflare-Byxl8FWP.js";
3
- //#region src/adapters/cloudflare-kv-cache.ts
1
+ import { t as warnLossyJsonValue } from "../_chunks/json-lossy-check-DVkLUlfC.js";
2
+ import { l as getCloudflareBindings } from "../_chunks/cloudflare-B75X6u4O.js";
3
+ // src/adapters/cloudflare-kv-cache.ts
4
4
  var LEGACY_GRACE_MS = 2592e6;
5
5
  /**
6
6
  * Parse a tag index value, handling both the old format (string[]) and the
@@ -117,7 +117,6 @@ var CloudflareKVCacheHandler = class {
117
117
  }
118
118
  }
119
119
  };
120
- //#endregion
121
120
  export { CloudflareKVCacheHandler };
122
121
 
123
122
  //# sourceMappingURL=cloudflare-kv-cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../src/adapters/cloudflare.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACb,MAAM,YAAY,CAAC;AA0CpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAUtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE/E;AAMD,wFAAwF;AACxF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CAC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AAI,CAAC;IAC3C,sBAAsB,IAAI,IAAI,CAAC;CAChC"}
@@ -1 +1 @@
1
- export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateRuntimeInitModule, s as generateWorkerEntry, c as generateWranglerConfig, l as getCloudflareBindings, u as readPrebuiltData, d as readUserWranglerConfig, f as runWithBindings, p as stagePagesPreview } from "../_chunks/cloudflare-Byxl8FWP.js";
1
+ export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateRuntimeInitModule, s as generateWorkerEntry, c as generateWranglerConfig, l as getCloudflareBindings, u as readPrebuiltData, d as readUserWranglerConfig, f as runWithBindings, p as stagePagesPreview } from "../_chunks/cloudflare-B75X6u4O.js";
@@ -15,6 +15,12 @@ export interface PresetConfig {
15
15
  supportsWaitUntil: boolean;
16
16
  /** Whether the runtime supports application-level 103 Early Hints. */
17
17
  supportsEarlyHints: boolean;
18
+ /**
19
+ * Whether the platform reads `_headers` and `_redirects` from the public
20
+ * directory. Everywhere else they are just public files anyone can fetch,
21
+ * so the build leaves them out (TIM-1605).
22
+ */
23
+ readsPlatformFiles: boolean;
18
24
  /** Value for TIMBER_RUNTIME env var. See design/25-production-deployments.md. */
19
25
  runtimeName: string;
20
26
  /** Additional nitro.config fields for this preset. */
@@ -1 +1 @@
1
- {"version":3,"file":"nitro-presets.d.ts","sourceRoot":"","sources":["../../src/adapters/nitro-presets.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,aAAa,GACb,SAAS,GACT,cAAc,GACd,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,KAAK,CAAC;AAEV,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;I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AgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAEjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"nitro-preview.d.ts","sourceRoot":"","sources":["../../src/adapters/nitro-preview.ts"],"names":[],"mappings":"AAuEA,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,0BAA0B,CAAC;AAE3F,UAAU,wBAAwB;IAChC;;;;OAIG;IACH,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oEAAoE;AACpE,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;IAC1E,MAAM,EAAE,QAAQ,CAAC;IACjB,6EAA6E;IAC7E,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD;AAED,iFAAiF;AACjF,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;IAC1E,MAAM,EAAE,QAAQ,CAAC;IACjB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAkS3E;AAED,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7F;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CA8FnD"}
1
+ {"version":3,"file":"nitro-preview.d.ts","sourceRoot":"","sources":["../../src/adapters/nitro-preview.ts"],"names":[],"mappings":"AAuEA,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,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AAkBD,sCAAsC;AACtC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,GAAE,SAAS,MAAM,EAAmC,GAC3D,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,CAAC,EAAE;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,EAAE,CAKX;AAED,4EAA4E;AAC5E,UAAU,gBAAgB;IACxB,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACzD;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,GAAE,SAAS,MAAM,EAAmC,GAC3D,gBAAgB,CAAC,SAAS,CAAC,CAS7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAInE;AAED,UAAU,gBAAgB;IACxB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,UAAU,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAgE3B;AAGD;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -1,14 +1,14 @@
1
- import { t as RSC_CONTENT_TYPE } from "../_chunks/rsc-media-type-DDc7duTD.js";
2
- import { a as STATIC_CACHE, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as adapterBase, r as writeHeadersFile, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-RV_BRcF1.js";
1
+ import { t as RSC_CONTENT_TYPE } from "../_chunks/rsc-media-type-m8jz9u6_.js";
2
+ import { a as REDIRECTS_FILE, i as HEADERS_FILE } from "../_chunks/fs-identity-BmQ_Agg-.js";
3
+ import { a as STATIC_CACHE, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as adapterBase, r as writeHeadersFile, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-B7wWGTfR.js";
3
4
  import { transformWithOxc } from "vite";
4
5
  import { basename, dirname, join, relative, sep } from "node:path";
5
6
  import { existsSync } from "node:fs";
6
- import { cp, glob, readFile, writeFile } from "node:fs/promises";
7
+ import { cp, glob, readFile, rm, writeFile } from "node:fs/promises";
7
8
  import { execFile } from "node:child_process";
8
- //#region src/server/compress.ts?raw
9
+ // src/server/compress.ts?raw
9
10
  var compress_default = "// Response compression for self-hosted deployments (dev server, Nitro preview).\n//\n// Gzips with node:zlib, flushing per chunk; a Node body stays a Node stream. Brotli is intentionally\n// left to CDNs and reverse proxies — at streaming-friendly quality levels its\n// ratio advantage is marginal, and node:zlib's brotli transform buffers output\n// internally, breaking streaming. Cloudflare Workers auto-compress at the edge —\n// this module is only used on Node.js/Bun.\n//\n// See design/25-production-deployments.md.\n//\n// This module is also emitted standalone as `_compress.mjs` by\n// `adapters/compress-module.ts`, which strips types but does not bundle. Its\n// imports must therefore be interpolated there — a new import that is not\n// fails the build with an explanatory error rather than resolving to nothing\n// on the deployed server.\n\nimport { RSC_CONTENT_TYPE } from '../shared/rsc-media-type.ts';\n\n// ─── Constants ────────────────────────────────────────────────────────────\n\n/**\n * MIME types that benefit from compression.\n * text/* is handled via prefix matching; these are the specific\n * application/* and image/* types that are compressible.\n */\nexport const COMPRESSIBLE_TYPES = new Set([\n 'text/html',\n 'text/css',\n 'text/plain',\n 'text/xml',\n 'text/javascript',\n RSC_CONTENT_TYPE,\n 'application/json',\n 'application/javascript',\n 'application/xml',\n 'application/xhtml+xml',\n 'application/rss+xml',\n 'application/atom+xml',\n 'image/svg+xml',\n]);\n\n/**\n * Status codes that should never be compressed (no body or special semantics).\n */\nconst NO_COMPRESS_STATUSES = new Set([204, 304]);\n\n// ─── Encoding Negotiation ─────────────────────────────────────────────────\n\n/**\n * Parse Accept-Encoding and return the best supported encoding.\n * Returns 'gzip' if the client accepts it, null otherwise.\n *\n * Brotli (br) is intentionally not handled at the application level.\n * At the streaming-friendly quality levels (0–4), brotli's compression\n * ratio advantage over gzip is marginal, and node:zlib's brotli transform\n * buffers output internally — turning smooth streaming responses into\n * large infrequent bursts. Brotli's real wins come from offline/static\n * compression at higher quality levels (5–11), which CDNs and reverse\n * proxies (Cloudflare, nginx, Caddy) apply on cached responses.\n *\n * See design/25-production-deployments.md.\n */\nexport function negotiateEncoding(acceptEncoding: string): 'gzip' | null {\n if (!acceptEncoding) return null;\n\n // Parse tokens with quality values from the Accept-Encoding header.\n // Per RFC 9110 §12.5.3, q=0 means \"not acceptable\" — the client explicitly\n // rejects that encoding. Tokens without a q-value default to q=1.\n // e.g. \"gzip;q=1.0, br;q=0\" → gzip is acceptable, br is rejected.\n const parts = acceptEncoding.split(',');\n for (const part of parts) {\n const [token, ...params] = part.split(';');\n const name = token.trim().toLowerCase();\n if (name !== 'gzip') continue;\n\n // Check for q=0 (explicitly disabled)\n let qValue = 1; // default quality is 1\n for (const param of params) {\n const trimmed = param.trim().toLowerCase();\n if (trimmed.startsWith('q=')) {\n qValue = parseFloat(trimmed.slice(2));\n if (Number.isNaN(qValue)) qValue = 1;\n break;\n }\n }\n\n if (qValue > 0) return 'gzip';\n }\n\n return null;\n}\n\n// ─── Compressibility Check ────────────────────────────────────────────────\n\n/**\n * Determine if a response should be compressed.\n *\n * Returns false for:\n * - Responses without a body (204, 304, null body)\n * - Already-encoded responses (Content-Encoding set)\n * - Non-compressible content types (images, binary)\n * - SSE streams (text/event-stream — must not be buffered)\n */\nexport function shouldCompress(response: Response): boolean {\n // No body to compress. A Node-body response is asked whether it owns one\n // (a null-body status does not) without reading `.body`, which would\n // convert it to a Web stream.\n const nodeBody = nodeBodyThrough(response);\n if (nodeBody ? !nodeBody.hasBody : !response.body) return false;\n if (NO_COMPRESS_STATUSES.has(response.status)) return false;\n\n // Already compressed\n if (response.headers.has('Content-Encoding')) return false;\n\n // Check content type\n const contentType = response.headers.get('Content-Type');\n if (!contentType) return false;\n\n // Extract the MIME type (strip charset and other parameters)\n const mimeType = contentType.split(';')[0].trim().toLowerCase();\n\n // SSE must not be compressed — it relies on chunk-by-chunk delivery\n if (mimeType === 'text/event-stream') return false;\n\n return COMPRESSIBLE_TYPES.has(mimeType);\n}\n\n// ─── Compression ──────────────────────────────────────────────────────────\n\n/**\n * Compress a Web Response if the client supports it and the content is compressible.\n *\n * Returns the original response unchanged if compression is not applicable.\n * Returns a new Response with the compressed body, Content-Encoding, and Vary headers.\n *\n * The body is piped through a compression stream — no buffering of the full response.\n * This preserves streaming behavior for HTML shell + deferred Suspense chunks.\n */\nexport function compressResponse(request: Request, response: Response): Response {\n // Check if response is compressible\n if (!shouldCompress(response)) return response;\n\n // Negotiate encoding with the client\n const acceptEncoding = request.headers.get('Accept-Encoding') ?? '';\n const encoding = negotiateEncoding(acceptEncoding);\n if (!encoding) return response;\n\n // Build new headers: copy originals, add compression headers, remove Content-Length\n // (compressed size is unknown until streaming completes).\n const headers = new Headers(response.headers);\n headers.set('Content-Encoding', encoding);\n headers.delete('Content-Length');\n\n // Append to Vary header (preserve existing Vary values)\n const existingVary = headers.get('Vary');\n if (existingVary) {\n if (!existingVary.toLowerCase().includes('accept-encoding')) {\n headers.set('Vary', `${existingVary}, Accept-Encoding`);\n }\n } else {\n headers.set('Vary', 'Accept-Encoding');\n }\n\n const init = { status: response.status, statusText: response.statusText, headers };\n // A Node body is gzipped as a Node stream and stays one to the socket.\n const nodeBody = nodeBodyThrough(response);\n if (nodeBody) return nodeBody.through(createSyncFlushGzip(), init);\n return new Response(compressWithGzip(response.body!), init);\n}\n\n// ─── Node bodies ──────────────────────────────────────────────────────────\n//\n// A response with a Node body (SSR and Flight payloads on Node) carries its\n// operations under a registry symbol (server/node-response.ts). This module is\n// emitted standalone and cannot import that one, so it repeats the key;\n// tests/node-body-response.test.ts holds the two to the same string.\n\n/** Registry key of the Node-body brand; must equal `NODE_BODY` in node-response.ts. */\nexport const NODE_BODY_KEY = 'timber.response.nodeBody';\n\n/** The Node-body operations compression needs. */\ninterface NodeBodyThrough {\n readonly hasBody: boolean;\n through(stream: import('node:stream').Duplex, init: ResponseInit): Response;\n}\n\nfunction isNodeBodyThrough(value: unknown): value is NodeBodyThrough {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'through' in value &&\n typeof value.through === 'function' &&\n 'hasBody' in value &&\n typeof value.hasBody === 'boolean'\n );\n}\n\nfunction nodeBodyThrough(response: Response): NodeBodyThrough | null {\n const ops: unknown = Reflect.get(response, Symbol.for(NODE_BODY_KEY));\n return isNodeBodyThrough(ops) ? ops : null;\n}\n\n// ─── Gzip (node:zlib with Z_SYNC_FLUSH) ──────────────────────────────────\n//\n// Uses node:zlib's createGzip with Z_SYNC_FLUSH so each chunk is flushed\n// to the output immediately. The Web Platform CompressionStream API buffers\n// internally and does NOT flush per-chunk — this kills streaming because\n// the browser doesn't receive the HTML shell until the gzip stream closes\n// (i.e. after all Suspense boundaries resolve).\n//\n// Z_SYNC_FLUSH adds ~2–5% size overhead vs Z_NO_FLUSH but preserves\n// correct streaming behavior: the shell renders instantly, Suspense\n// fallbacks are visible immediately, and streamed content appears\n// progressively.\n\nimport { createGzip, constants } from 'node:zlib';\nimport { Readable, pipeline } from 'node:stream';\n\n/** gzip that flushes every chunk as it arrives. */\nfunction createSyncFlushGzip(): ReturnType<typeof createGzip> {\n return createGzip({ flush: constants.Z_SYNC_FLUSH });\n}\n\n/**\n * Compress a ReadableStream with gzip, flushing each chunk immediately.\n *\n * Uses node:zlib's createGzip with Z_SYNC_FLUSH to ensure each HTML chunk\n * (shell, Suspense resolution, RSC payload) is delivered to the browser\n * as soon as it's available — preserving streaming semantics.\n */\nfunction compressWithGzip(body: ReadableStream<Uint8Array>): ReadableStream<Uint8Array> {\n const gzip = createSyncFlushGzip();\n const nodeInput = Readable.fromWeb(body as import('stream/web').ReadableStream);\n\n // pipeline() instead of bare pipe(): pipe() does not forward source errors,\n // so an erroring body (streaming route handler, dropped upstream fetch)\n // would emit an unhandled 'error' event and crash the process. pipeline()\n // destroys gzip on source error — the returned web stream rejects — and\n // tears down nodeInput when the consumer cancels the web stream, which\n // cancels the source body via fromWeb. The error reaches the consumer\n // through the web stream; the callback only marks it handled at the Node\n // layer.\n pipeline(nodeInput, gzip, () => {});\n\n return Readable.toWeb(gzip) as ReadableStream<Uint8Array>;\n}\n";
10
- //#endregion
11
- //#region src/adapters/compress-module.ts
11
+ // src/adapters/compress-module.ts
12
12
  /**
13
13
  * The one import `server/compress.ts` is allowed to carry, and its inlined
14
14
  * form.
@@ -82,11 +82,9 @@ function assertStandalone(code, source, emitted) {
82
82
  async function generateCompressModule() {
83
83
  return "// Generated by @timber-js/app — compiled from server/compress.ts.\n// Do not edit — this file is regenerated on each build.\n" + inlineCompressImports((await transformWithOxc(compress_default, "compress.ts", { lang: "ts" })).code);
84
84
  }
85
- //#endregion
86
- //#region src/server/canonicalize.ts?raw
87
- var canonicalize_default = "/**\n * URL canonicalization — runs once at the request boundary.\n *\n * Every layer (proxy.ts, middleware.ts, access.ts, components) sees the same\n * canonical path. No re-decoding occurs at any later stage.\n *\n * See design/07-routing.md §\"URL Canonicalization & Security\"\n */\n\n/** Result of canonicalization — either a clean path or a rejection. */\nexport type CanonicalizeResult = { ok: true; pathname: string } | { ok: false; status: 400 };\n\n/**\n * Encoded separators that produce a 400 rejection.\n * %2f (/) and %5c (\\) cause path-confusion attacks.\n *\n * Shared between the runtime canonicalizer and the build-time route scanner\n * to ensure both enforce identical security rules. See design/13-security.md.\n */\nexport const ENCODED_SEPARATOR_RE = /%2f|%5c/i;\n\n/** Null byte — rejected. Shared with the route scanner. */\nexport const NULL_BYTE_RE = /%00/i;\n\n/**\n * Canonicalize a URL pathname.\n *\n * 1. Reject encoded separators (%2f, %5c) and null bytes (%00)\n * 2. Single percent-decode\n * 3. Collapse // → /\n * 4. Resolve .. segments (reject if escaping root)\n * 5. Strip trailing slash (except root \"/\")\n *\n * @param rawPathname - The raw pathname from the request URL (percent-encoded)\n * @param stripTrailingSlash - Whether to strip trailing slashes. Default: true.\n */\nexport function canonicalize(rawPathname: string, stripTrailingSlash = true): CanonicalizeResult {\n // Step 1: Reject dangerous encoded sequences BEFORE decoding.\n // This must happen on the raw input so %252f doesn't bypass after a single decode.\n if (ENCODED_SEPARATOR_RE.test(rawPathname)) {\n return { ok: false, status: 400 };\n }\n if (NULL_BYTE_RE.test(rawPathname)) {\n return { ok: false, status: 400 };\n }\n\n // Step 2: Single percent-decode.\n // Double-encoded input (%2561 → %61) stays as %61 — not decoded again.\n let decoded: string;\n try {\n decoded = decodeURIComponent(rawPathname);\n } catch {\n // Malformed percent-encoding → 400\n return { ok: false, status: 400 };\n }\n\n // Reject null bytes that appeared after decoding (from valid %00-like sequences\n // that weren't caught above — belt and suspenders).\n if (decoded.includes('\\0')) {\n return { ok: false, status: 400 };\n }\n\n // Backslash is NOT a path separator — keep as literal character.\n // But reject if it would create // after normalization (e.g., /\\evil.com).\n // We do NOT convert \\ to / — it stays as a literal.\n\n // Step 3: Collapse consecutive slashes.\n let pathname = decoded.replace(/\\/\\/+/g, '/');\n\n // Step 4: Resolve .. and . segments.\n const segments = pathname.split('/');\n const resolved: string[] = [];\n for (const seg of segments) {\n if (seg === '..') {\n if (resolved.length <= 1) {\n // Trying to escape root — 400\n return { ok: false, status: 400 };\n }\n resolved.pop();\n } else if (seg !== '.') {\n resolved.push(seg);\n }\n }\n\n pathname = resolved.join('/') || '/';\n\n // Step 5: Strip trailing slash (except root \"/\").\n if (stripTrailingSlash && pathname.length > 1 && pathname.endsWith('/')) {\n pathname = pathname.slice(0, -1);\n }\n\n return { ok: true, pathname };\n}\n\n/**\n * The path a safe request for `rawPathname` should be redirected to — or\n * `rawPathname` itself when it is already canonical.\n *\n * Applies the structural steps of `canonicalize()` — collapse `//` (step 3)\n * and strip the trailing slash (step 5) — to the **encoded** path, without\n * decoding. That is what the browser will send back, so the redirect is\n * idempotent: `/%61dmin` differs from its canonical form `/admin` only by\n * percent-encoding, and redirecting it to `/admin` would compare against the\n * decoded form forever. Decoding cannot introduce a `/` (`%2f` is rejected),\n * so the structure is the same before and after decoding.\n *\n * Dot segments are not handled here: the request URL is parsed by the WHATWG\n * URL parser, which has already resolved `.`, `..` and their encoded forms.\n *\n * Only meaningful for a path `canonicalize()` accepted. The collapse also\n * means the result can never start with `//`, so it is never a\n * protocol-relative redirect target.\n *\n * See design/07-routing.md §\"Non-Canonical URLs Redirect\"\n */\nexport function canonicalRequestPath(rawPathname: string, stripTrailingSlash = true): string {\n let pathname = rawPathname.replace(/\\/\\/+/g, '/');\n if (stripTrailingSlash && pathname.length > 1 && pathname.endsWith('/')) {\n pathname = pathname.slice(0, -1);\n }\n return pathname;\n}\n";
88
- //#endregion
89
- //#region src/adapters/canonicalize-module.ts
85
+ // src/server/canonicalize.ts?raw
86
+ var canonicalize_default = "/**\n * URL canonicalization — runs once at the request boundary.\n *\n * Every layer (proxy.ts, middleware.ts, access.ts, components) sees the same\n * canonical path. No re-decoding occurs at any later stage.\n *\n * See design/07-routing.md §\"URL Canonicalization & Security\"\n */\n\n/** Result of canonicalization — either a clean path or a rejection. */\nexport type CanonicalizeResult = { ok: true; pathname: string } | { ok: false; status: 400 };\n\n/**\n * Encoded separators that produce a 400 rejection.\n * %2f (/) and %5c (\\) cause path-confusion attacks.\n *\n * Shared between the runtime canonicalizer and the build-time route scanner\n * to ensure both enforce identical security rules. See design/13-security.md.\n */\nexport const ENCODED_SEPARATOR_RE = /%2f|%5c/i;\n\n/** Null byte — rejected. Shared with the route scanner. */\nexport const NULL_BYTE_RE = /%00/i;\n\n/**\n * Canonicalize a URL pathname.\n *\n * 1. Reject encoded separators (%2f, %5c) and null bytes (%00)\n * 2. Single percent-decode\n * 3. Collapse // → /\n * 4. Resolve .. segments (reject if escaping root)\n * 5. Strip trailing slash (except root \"/\")\n *\n * @param rawPathname - The raw pathname from the request URL (percent-encoded)\n * @param stripTrailingSlash - Whether to strip trailing slashes. Default: true.\n */\nexport function canonicalize(rawPathname: string, stripTrailingSlash = true): CanonicalizeResult {\n // Step 1: Reject dangerous encoded sequences BEFORE decoding.\n // This must happen on the raw input so %252f doesn't bypass after a single decode.\n if (ENCODED_SEPARATOR_RE.test(rawPathname)) {\n return { ok: false, status: 400 };\n }\n if (NULL_BYTE_RE.test(rawPathname)) {\n return { ok: false, status: 400 };\n }\n\n // Step 2: Single percent-decode.\n // Double-encoded input (%2561 → %61) stays as %61 — not decoded again.\n let decoded: string;\n try {\n decoded = decodeURIComponent(rawPathname);\n } catch {\n // Malformed percent-encoding → 400\n return { ok: false, status: 400 };\n }\n\n // Reject null bytes that appeared after decoding (from valid %00-like sequences\n // that weren't caught above — belt and suspenders).\n if (decoded.includes('\\0')) {\n return { ok: false, status: 400 };\n }\n\n // Backslash is NOT a path separator — keep as literal character.\n // But reject if it would create // after normalization (e.g., /\\evil.com).\n // We do NOT convert \\ to / — it stays as a literal.\n\n // Step 3: Collapse consecutive slashes.\n let pathname = decoded.replace(/\\/\\/+/g, '/');\n\n // Step 4: Resolve .. and . segments.\n const segments = pathname.split('/');\n const resolved: string[] = [];\n for (const seg of segments) {\n if (seg === '..') {\n if (resolved.length <= 1) {\n // Trying to escape root — 400\n return { ok: false, status: 400 };\n }\n resolved.pop();\n } else if (seg !== '.') {\n resolved.push(seg);\n }\n }\n\n pathname = resolved.join('/') || '/';\n\n // Step 5: Strip trailing slash (except root \"/\").\n if (stripTrailingSlash && pathname.length > 1 && pathname.endsWith('/')) {\n pathname = pathname.slice(0, -1);\n }\n\n return { ok: true, pathname };\n}\n\n/**\n * The path a safe request for `rawPathname` should be redirected to — or\n * `rawPathname` itself when it is already canonical.\n *\n * Applies the structural steps of `canonicalize()` — collapse `//` (step 3)\n * and strip the trailing slash (step 5) — to the **encoded** path, without\n * decoding. That is what the browser will send back, so the redirect is\n * idempotent: `/%61dmin` differs from its canonical form `/admin` only by\n * percent-encoding, and redirecting it to `/admin` would compare against the\n * decoded form forever. Decoding cannot introduce a `/` (`%2f` is rejected),\n * so the structure is the same before and after decoding.\n *\n * Dot segments are not handled here: the request URL is parsed by the WHATWG\n * URL parser, which has already resolved `.`, `..` and their encoded forms.\n *\n * Only meaningful for a path `canonicalize()` accepted. The collapse also\n * means the result can never start with `//`, so it is never a\n * protocol-relative redirect target.\n *\n * See design/07-routing.md §\"Non-Canonical URLs Redirect\"\n */\nexport function canonicalRequestPath(rawPathname: string, stripTrailingSlash = true): string {\n let pathname = rawPathname.replace(/\\/\\/+/g, '/');\n if (stripTrailingSlash && pathname.length > 1 && pathname.endsWith('/')) {\n pathname = pathname.slice(0, -1);\n }\n return pathname;\n}\n\n/**\n * Build a request's URL from its origin and its raw request target, or\n * return null when the result is not a URL (the caller answers 400).\n *\n * An origin-form target (`/path`) is concatenated, not resolved against the\n * origin: resolved as a relative reference, `//evil.com/` names another host,\n * and the pipeline would see `/` instead of the path it must redirect to\n * `/evil.com` (TIM-1571). Any other form is resolved against the origin:\n * the asterisk-form `OPTIONS *` becomes `/*`, and an absolute-form target\n * (`GET http://host/a`) keeps only its path and query. Its scheme and\n * authority are the client's word, not the connection's: they would stand in\n * for the Host that the dev server's allowedHosts check and CSRF read, and a\n * non-http scheme (`foo://x/`) makes an opaque origin the pipeline cannot\n * build URLs from, so that is null too.\n *\n * Shared by the dev server and the Nitro preview server (which ships this\n * file as `_canonicalize.mjs`), so the two cannot disagree about which path a\n * request target names. Production adapters build the URL in their own\n * runtime (srvx for Nitro).\n */\nexport function requestTargetUrl(origin: string, target: string): URL | null {\n if (target.startsWith('/')) return URL.parse(origin + target);\n const resolved = URL.parse(target, origin);\n if (resolved?.protocol !== 'http:' && resolved?.protocol !== 'https:') return null;\n return URL.parse(origin + resolved.pathname + resolved.search);\n}\n";
87
+ // src/adapters/canonicalize-module.ts
90
88
  /**
91
89
  * Compile server/canonicalize.ts into a standalone ESM module exporting
92
90
  * `canonicalize`.
@@ -98,8 +96,7 @@ async function generateCanonicalizeModule() {
98
96
  assertStandalone(result.code, "server/canonicalize.ts", "_canonicalize.mjs");
99
97
  return "// Generated by @timber-js/app — compiled from server/canonicalize.ts.\n// Do not edit — this file is regenerated on each build.\n" + result.code;
100
98
  }
101
- //#endregion
102
- //#region src/adapters/nitro-immutable-assets.ts
99
+ // src/adapters/nitro-immutable-assets.ts
103
100
  /** The generated module, written beside the Nitro entry that imports it. */
104
101
  var IMMUTABLE_ASSETS_MODULE = "_immutable-assets.mjs";
105
102
  /**
@@ -196,14 +193,14 @@ export default function immutableAssets(nitroApp) {
196
193
  }
197
194
  `;
198
195
  }
199
- //#endregion
200
- //#region src/adapters/nitro-presets.ts
196
+ // src/adapters/nitro-presets.ts
201
197
  var PRESET_CONFIGS = {
202
198
  "vercel": {
203
199
  nitroPreset: "vercel",
204
200
  outputDir: ".vercel/output",
205
201
  supportsWaitUntil: true,
206
202
  supportsEarlyHints: false,
203
+ readsPlatformFiles: false,
207
204
  runtimeName: "vercel",
208
205
  extraConfig: { vercel: { functions: { maxDuration: 30 } } }
209
206
  },
@@ -212,6 +209,7 @@ var PRESET_CONFIGS = {
212
209
  outputDir: ".vercel/output",
213
210
  supportsWaitUntil: true,
214
211
  supportsEarlyHints: false,
212
+ readsPlatformFiles: false,
215
213
  runtimeName: "vercel-edge"
216
214
  },
217
215
  "netlify": {
@@ -219,6 +217,7 @@ var PRESET_CONFIGS = {
219
217
  outputDir: ".netlify/functions-internal",
220
218
  supportsWaitUntil: false,
221
219
  supportsEarlyHints: false,
220
+ readsPlatformFiles: true,
222
221
  runtimeName: "netlify"
223
222
  },
224
223
  "netlify-edge": {
@@ -226,6 +225,7 @@ var PRESET_CONFIGS = {
226
225
  outputDir: ".netlify/edge-functions",
227
226
  supportsWaitUntil: true,
228
227
  supportsEarlyHints: false,
228
+ readsPlatformFiles: true,
229
229
  runtimeName: "netlify-edge"
230
230
  },
231
231
  "aws-lambda": {
@@ -233,6 +233,7 @@ var PRESET_CONFIGS = {
233
233
  outputDir: ".output",
234
234
  supportsWaitUntil: false,
235
235
  supportsEarlyHints: false,
236
+ readsPlatformFiles: false,
236
237
  runtimeName: "aws-lambda"
237
238
  },
238
239
  "deno-deploy": {
@@ -240,6 +241,7 @@ var PRESET_CONFIGS = {
240
241
  outputDir: ".output",
241
242
  supportsWaitUntil: true,
242
243
  supportsEarlyHints: false,
244
+ readsPlatformFiles: false,
243
245
  runtimeName: "deno-deploy"
244
246
  },
245
247
  "azure-functions": {
@@ -247,6 +249,7 @@ var PRESET_CONFIGS = {
247
249
  outputDir: ".output",
248
250
  supportsWaitUntil: false,
249
251
  supportsEarlyHints: false,
252
+ readsPlatformFiles: false,
250
253
  runtimeName: "azure-functions"
251
254
  },
252
255
  "node-server": {
@@ -254,6 +257,7 @@ var PRESET_CONFIGS = {
254
257
  outputDir: ".output",
255
258
  supportsWaitUntil: true,
256
259
  supportsEarlyHints: false,
260
+ readsPlatformFiles: false,
257
261
  runtimeName: "node-server"
258
262
  },
259
263
  "bun": {
@@ -261,13 +265,13 @@ var PRESET_CONFIGS = {
261
265
  outputDir: ".output",
262
266
  supportsWaitUntil: true,
263
267
  supportsEarlyHints: false,
268
+ readsPlatformFiles: false,
264
269
  runtimeName: "bun"
265
270
  }
266
271
  };
267
272
  /** Presets that produce a locally-runnable server entry. */
268
273
  var LOCALLY_PREVIEWABLE = /* @__PURE__ */ new Set(["node-server", "bun"]);
269
- //#endregion
270
- //#region src/adapters/nitro-preview.ts
274
+ // src/adapters/nitro-preview.ts
271
275
  /**
272
276
  * Content-Type by file extension for the preview server. Static hosts decide
273
277
  * this themselves; the table covers the file types a web build ships so the
@@ -442,7 +446,7 @@ import { createServer } from 'node:http';
442
446
  import { readFile, stat } from 'node:fs/promises';
443
447
  import { join, extname, sep } from 'node:path';
444
448
  import { fileURLToPath } from 'node:url';
445
- import { canonicalize } from './_canonicalize.mjs';
449
+ import { canonicalize, requestTargetUrl } from './_canonicalize.mjs';
446
450
 
447
451
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
448
452
 
@@ -513,6 +517,9 @@ const envPort = process.env.PORT ? parseInt(process.env.PORT, 10) : null;
513
517
  const portIsExplicit = envPort != null && Number.isFinite(envPort) && envPort > 0;
514
518
  const startPort = portIsExplicit ? envPort : 3000;
515
519
  const host = process.env.HOST || 'localhost';
520
+ // An IPv6 HOST ('::', '::1') binds as is but needs brackets in a URL;
521
+ // unbracketed, every request URL is unparseable and answered 400.
522
+ const urlHost = host.includes(':') && !host.startsWith('[') ? \`[\${host}]\` : host;
516
523
 
517
524
  // Set after listenWithBump() resolves so request handlers can build
518
525
  // absolute URLs from the actual bound port (which may differ from
@@ -527,16 +534,17 @@ const server = createServer(async (req, res) => {
527
534
  // connection it would be attacker-controlled. The CSRF layer honors it
528
535
  // separately for reverse-proxy deployments.
529
536
  const scheme = req.socket?.encrypted ? 'https' : 'http';
530
- // An origin-form target ('/path') is concatenated, not resolved against
531
- // the base: resolved as a relative reference, '//evil.com/' names another
532
- // host, and the pipeline would see '/' instead of the path it must
533
- // redirect to '/evil.com' (TIM-1571). Any other form — 'OPTIONS *', an
534
- // absolute-form target — is resolved as before: concatenating '*' makes
535
- // an invalid URL, and this callback has no catch around it, so the
536
- // rejection would take the preview process down.
537
- const origin = \`\${scheme}://\${host}:\${boundPort}\`;
538
- const target = req.url || '/';
539
- const url = target.startsWith('/') ? new URL(origin + target) : new URL(target, origin);
537
+ // requestTargetUrl() (server/canonicalize.ts) concatenates an origin-form
538
+ // target and resolves any other form, so '//evil.com/' stays a path the
539
+ // pipeline redirects (TIM-1571) and 'OPTIONS *' is '/*'. A target that
540
+ // names no URL is answered here: thrown in this callback, which has no
541
+ // catch around it, the rejection would take the preview process down.
542
+ const url = requestTargetUrl(\`\${scheme}://\${urlHost}:\${boundPort}\`, req.url || '/');
543
+ if (!url) {
544
+ res.writeHead(400, { 'Content-Type': 'text/plain' });
545
+ res.end('Bad Request');
546
+ return;
547
+ }
540
548
 
541
549
  // The runtime's own request-boundary canonicalizer (_canonicalize.mjs,
542
550
  // compiled from server/canonicalize.ts): one decode, and the same 400s for
@@ -640,44 +648,63 @@ export function sendNodeResponse(nodeRes, webRes) {
640
648
  // pipe it straight to the socket, no Web Streams round trip. pipe() rather
641
649
  // than pipeline(), which allocates an AbortController and an error on every
642
650
  // finish; a client that disconnects early destroys the body (aborting the
643
- // render), and a body that errors destroys the socket.
651
+ // render), and a body that errors mid-stream destroys the socket.
652
+ //
653
+ // As srvx's pipeBody does, the status line waits until the body is
654
+ // readable: a body that errors before its first chunk answers a bare 500
655
+ // instead of closing the socket with nothing written (TIM-1602).
644
656
  if (typeof webRes._toNodeResponse === 'function') {
645
657
  const res = webRes._toNodeResponse();
646
658
  if (res.body && typeof res.body.pipe === 'function') {
647
- if (!nodeRes.headersSent) {
648
- if (nodeRes.req?.httpVersion === '2.0') {
649
- nodeRes.writeHead(res.status, res.headers);
650
- } else {
651
- nodeRes.writeHead(res.status, res.statusText, res.headers);
652
- }
653
- }
654
659
  const body = res.body;
655
660
  // The client already left: 'close' has fired and will not again.
656
661
  if (nodeRes.destroyed) {
657
662
  body.destroy();
658
663
  return;
659
664
  }
665
+ // Already failed: its 'error' has fired and 'readable' never will.
666
+ if (body.destroyed) {
667
+ writeHead(nodeRes, 500, 'Internal Server Error', []);
668
+ return new Promise((resolve) => nodeRes.end(resolve));
669
+ }
660
670
  return new Promise((resolve) => {
661
- nodeRes.once('close', () => {
662
- if (!body.readableEnded) body.destroy();
671
+ function cleanup() {
672
+ body.off('error', onEarlyError);
673
+ body.off('readable', onReadable);
674
+ nodeRes.off('close', onEarlyClose);
675
+ }
676
+ function onEarlyError() {
677
+ cleanup();
678
+ body.destroy();
679
+ writeHead(nodeRes, 500, 'Internal Server Error', []);
680
+ nodeRes.end(resolve);
681
+ }
682
+ function onEarlyClose() {
683
+ cleanup();
684
+ body.destroy();
663
685
  resolve();
664
- });
665
- nodeRes.on('error', () => body.destroy());
666
- body.once('error', (error) => nodeRes.destroy(error));
667
- body.pipe(nodeRes);
686
+ }
687
+ function onReadable() {
688
+ cleanup();
689
+ writeHead(nodeRes, res.status, res.statusText, res.headers);
690
+ nodeRes.once('close', () => {
691
+ if (!body.readableEnded) body.destroy();
692
+ resolve();
693
+ });
694
+ nodeRes.on('error', () => body.destroy());
695
+ body.once('error', (error) => nodeRes.destroy(error));
696
+ body.pipe(nodeRes);
697
+ }
698
+ body.once('error', onEarlyError);
699
+ body.once('readable', onReadable);
700
+ nodeRes.once('close', onEarlyClose);
668
701
  });
669
702
  }
670
703
  webRes = new Response(res.body, { status: res.status, statusText: res.statusText, headers: pairs(res.headers) });
671
704
  }
672
- const rawHeaders = [...webRes.headers];
673
- const writeHeaders = rawHeaders.flat();
674
- if (!nodeRes.headersSent) {
675
- if (nodeRes.req?.httpVersion === '2.0') {
676
- nodeRes.writeHead(webRes.status, writeHeaders);
677
- } else {
678
- nodeRes.writeHead(webRes.status, webRes.statusText, writeHeaders);
679
- }
680
- }
705
+ // A Web body's status line goes out before its first read, as in srvx:
706
+ // one that errors before its first chunk closes the socket unanswered.
707
+ writeHead(nodeRes, webRes.status, webRes.statusText, [...webRes.headers].flat());
681
708
  if (!webRes.body) {
682
709
  return new Promise((resolve) => nodeRes.end(resolve));
683
710
  }
@@ -714,6 +741,15 @@ export function sendNodeResponse(nodeRes, webRes) {
714
741
  });
715
742
  }
716
743
 
744
+ function writeHead(nodeRes, status, statusText, headers) {
745
+ if (nodeRes.headersSent) return;
746
+ if (nodeRes.req?.httpVersion === '2.0') {
747
+ nodeRes.writeHead(status, headers);
748
+ } else {
749
+ nodeRes.writeHead(status, statusText, headers);
750
+ }
751
+ }
752
+
717
753
  function pairs(flat) {
718
754
  const out = [];
719
755
  for (let i = 0; i < flat.length; i += 2) out.push([flat[i], flat[i + 1]]);
@@ -721,8 +757,7 @@ function pairs(flat) {
721
757
  }
722
758
  `;
723
759
  }
724
- //#endregion
725
- //#region src/adapters/nitro.ts
760
+ // src/adapters/nitro.ts
726
761
  /**
727
762
  * Create a Nitro-based adapter for multi-platform deployment.
728
763
  *
@@ -749,7 +784,8 @@ function nitro(options = {}) {
749
784
  if (artifacts.output === "static") {
750
785
  await buildStaticDirectoryOutput(config, artifacts, outDir, "public");
751
786
  const publicDir = join(outDir, "public");
752
- await writeHeadersFile(publicDir, config, artifacts);
787
+ const target = options.staticTarget ?? "generic";
788
+ if (target !== "github-pages") await writeHeadersFile(publicDir, config, artifacts);
753
789
  await writeFile(join(outDir, CANONICALIZE_MODULE), await generateCanonicalizeModule());
754
790
  await writeFile(join(outDir, PREVIEW_SCRIPT), generatePreviewScript({
755
791
  output: "static",
@@ -757,11 +793,12 @@ function nitro(options = {}) {
757
793
  base: adapterBase(config),
758
794
  contentTypes: artifacts.contentTypes
759
795
  }));
760
- if ((options.staticTarget ?? "generic") === "github-pages") {
796
+ if (target === "github-pages") {
761
797
  await writeFile(join(publicDir, ".nojekyll"), "");
762
798
  try {
763
799
  if ((await readFile(join(publicDir, "_redirects"), "utf-8")).trim().length > 0) console.warn("[timber] Warning: GitHub Pages does not support _redirects files. Redirect rules from middleware/proxy will not work on this platform.");
764
800
  } catch {}
801
+ for (const name of [HEADERS_FILE, REDIRECTS_FILE]) await rm(join(publicDir, name), { force: true });
765
802
  }
766
803
  return;
767
804
  }
@@ -769,7 +806,8 @@ function nitro(options = {}) {
769
806
  config,
770
807
  artifacts,
771
808
  outDir,
772
- publicDirName: "public"
809
+ publicDirName: "public",
810
+ platformFiles: PRESET_CONFIGS[preset].readsPlatformFiles
773
811
  });
774
812
  await writeFile(join(outDir, "_compress.mjs"), await generateCompressModule());
775
813
  await writeFile(join(outDir, "_send-response.mjs"), generateSendResponseModule());
@@ -992,7 +1030,6 @@ async function copyPrebuiltToVercelFuncClones(functionsDir, prebuiltSrc, baseFun
992
1030
  }
993
1031
  await Promise.all(funcDirs.map((dir) => cp(prebuiltSrc, join(dir, "prebuilt"), { recursive: true })));
994
1032
  }
995
- //#endregion
996
1033
  export { copyPrebuiltToVercelFuncClones, generateNitroEntry, getPostBuildHint, isSuppressedNitroHint, nitro, runNitroBuild, selectSuppressedHintPrefixes, wrapNitroLoggerForBuild };
997
1034
 
998
1035
  //# sourceMappingURL=nitro.js.map