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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (760) hide show
  1. package/dist/_chunks/actions-Dy8vOjFt.js +1101 -0
  2. package/dist/_chunks/actions-Dy8vOjFt.js.map +1 -0
  3. package/dist/_chunks/build-output-helper-B1n0sUqj.js +61 -0
  4. package/dist/_chunks/build-output-helper-B1n0sUqj.js.map +1 -0
  5. package/dist/_chunks/cli-schema-sync-ByZPGGmS.js +724 -0
  6. package/dist/_chunks/cli-schema-sync-ByZPGGmS.js.map +1 -0
  7. package/dist/_chunks/cli-schema-sync-DHQLjFu3.js +2 -0
  8. package/dist/_chunks/codec-registry-G9hD5LOq.js +21 -0
  9. package/dist/_chunks/codec-registry-G9hD5LOq.js.map +1 -0
  10. package/dist/_chunks/define-CPVQaWbx.js +124 -0
  11. package/dist/_chunks/define-CPVQaWbx.js.map +1 -0
  12. package/dist/_chunks/define-jeHDXZGq.js +195 -0
  13. package/dist/_chunks/define-jeHDXZGq.js.map +1 -0
  14. package/dist/_chunks/format-BjN9HLu9.js +14 -0
  15. package/dist/_chunks/format-BjN9HLu9.js.map +1 -0
  16. package/dist/_chunks/handler-store-CcwNX-gk.js +54 -0
  17. package/dist/_chunks/handler-store-CcwNX-gk.js.map +1 -0
  18. package/dist/_chunks/logger-DDmK5skc.js +291 -0
  19. package/dist/_chunks/logger-DDmK5skc.js.map +1 -0
  20. package/dist/_chunks/merge-search-params-az6ZiBeU.js +41 -0
  21. package/dist/_chunks/merge-search-params-az6ZiBeU.js.map +1 -0
  22. package/dist/_chunks/navigation-root-DoRTeBm5.js +96 -0
  23. package/dist/_chunks/navigation-root-DoRTeBm5.js.map +1 -0
  24. package/dist/_chunks/registry-BI9cgCt7.js +20 -0
  25. package/dist/_chunks/registry-BI9cgCt7.js.map +1 -0
  26. package/dist/_chunks/resolve-schema-Bf8eC6q6.js +73 -0
  27. package/dist/_chunks/resolve-schema-Bf8eC6q6.js.map +1 -0
  28. package/dist/_chunks/router-ref-CpvjBqdu.js +28 -0
  29. package/dist/_chunks/router-ref-CpvjBqdu.js.map +1 -0
  30. package/dist/_chunks/schema-bridge-o0SwFtXW.js +86 -0
  31. package/dist/_chunks/schema-bridge-o0SwFtXW.js.map +1 -0
  32. package/dist/_chunks/segment-classify-CnfLLvir.js +137 -0
  33. package/dist/_chunks/segment-classify-CnfLLvir.js.map +1 -0
  34. package/dist/_chunks/segment-context-EsfQpS--.js +34 -0
  35. package/dist/_chunks/segment-context-EsfQpS--.js.map +1 -0
  36. package/dist/_chunks/{ssr-data-MjmprTmO.js → ssr-data-m9-cNEIw.js} +1 -1
  37. package/dist/_chunks/ssr-data-m9-cNEIw.js.map +1 -0
  38. package/dist/_chunks/stale-reload-BN2kcE06.js +64 -0
  39. package/dist/_chunks/stale-reload-BN2kcE06.js.map +1 -0
  40. package/dist/_chunks/tracing-DvKLzCFa.js +329 -0
  41. package/dist/_chunks/tracing-DvKLzCFa.js.map +1 -0
  42. package/dist/_chunks/{use-query-states-D5KaffOK.js → use-query-states-C9G6LP0F.js} +7 -20
  43. package/dist/_chunks/use-query-states-C9G6LP0F.js.map +1 -0
  44. package/dist/_chunks/use-segment-params-CtIAjqK0.js +185 -0
  45. package/dist/_chunks/use-segment-params-CtIAjqK0.js.map +1 -0
  46. package/dist/_chunks/validation-BMU5MPzP.js +84 -0
  47. package/dist/_chunks/validation-BMU5MPzP.js.map +1 -0
  48. package/dist/_chunks/walkers-DNp9tHyV.js +719 -0
  49. package/dist/_chunks/walkers-DNp9tHyV.js.map +1 -0
  50. package/dist/_chunks/{format-DviM89f0.js → warnings-B30wpfaS.js} +6 -45
  51. package/dist/_chunks/warnings-B30wpfaS.js.map +1 -0
  52. package/dist/adapters/build-output-helper.d.ts +28 -0
  53. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  54. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  55. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  56. package/dist/adapters/cloudflare-dev.js +73 -0
  57. package/dist/adapters/cloudflare-dev.js.map +1 -0
  58. package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
  59. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  60. package/dist/adapters/cloudflare-kv-cache.js +95 -0
  61. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  62. package/dist/adapters/cloudflare.d.ts +148 -12
  63. package/dist/adapters/cloudflare.d.ts.map +1 -1
  64. package/dist/adapters/cloudflare.js +142 -38
  65. package/dist/adapters/cloudflare.js.map +1 -1
  66. package/dist/adapters/compress-module.d.ts.map +1 -1
  67. package/dist/adapters/nitro.d.ts +17 -1
  68. package/dist/adapters/nitro.d.ts.map +1 -1
  69. package/dist/adapters/nitro.js +143 -45
  70. package/dist/adapters/nitro.js.map +1 -1
  71. package/dist/adapters/shared.d.ts +16 -0
  72. package/dist/adapters/shared.d.ts.map +1 -0
  73. package/dist/cache/cache-api.d.ts +24 -0
  74. package/dist/cache/cache-api.d.ts.map +1 -0
  75. package/dist/cache/handler-store.d.ts +31 -0
  76. package/dist/cache/handler-store.d.ts.map +1 -0
  77. package/dist/cache/index.d.ts +23 -7
  78. package/dist/cache/index.d.ts.map +1 -1
  79. package/dist/cache/index.js +151 -81
  80. package/dist/cache/index.js.map +1 -1
  81. package/dist/cache/singleflight.d.ts +18 -1
  82. package/dist/cache/singleflight.d.ts.map +1 -1
  83. package/dist/cache/sizeof.d.ts +22 -0
  84. package/dist/cache/sizeof.d.ts.map +1 -0
  85. package/dist/cache/timber-cache.d.ts +1 -1
  86. package/dist/cache/timber-cache.d.ts.map +1 -1
  87. package/dist/cli-schema-sync.d.ts +37 -0
  88. package/dist/cli-schema-sync.d.ts.map +1 -0
  89. package/dist/cli.d.ts +14 -2
  90. package/dist/cli.d.ts.map +1 -1
  91. package/dist/cli.js +42 -6
  92. package/dist/cli.js.map +1 -1
  93. package/dist/client/browser-dev.d.ts +34 -1
  94. package/dist/client/browser-dev.d.ts.map +1 -1
  95. package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
  96. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  97. package/dist/client/browser-entry/hmr.d.ts +21 -0
  98. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  99. package/dist/client/browser-entry/hydrate.d.ts +46 -0
  100. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  101. package/dist/client/browser-entry/index.d.ts +30 -0
  102. package/dist/client/browser-entry/index.d.ts.map +1 -0
  103. package/dist/client/browser-entry/post-hydration.d.ts +26 -0
  104. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  105. package/dist/client/browser-entry/router-init.d.ts +23 -0
  106. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  107. package/dist/client/browser-entry/rsc-stream.d.ts +24 -0
  108. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  109. package/dist/client/browser-entry/scroll.d.ts +19 -0
  110. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  111. package/dist/client/error-boundary.d.ts +12 -5
  112. package/dist/client/error-boundary.d.ts.map +1 -1
  113. package/dist/client/error-boundary.js +29 -6
  114. package/dist/client/error-boundary.js.map +1 -1
  115. package/dist/client/error-reconstituter.d.ts +54 -0
  116. package/dist/client/error-reconstituter.d.ts.map +1 -0
  117. package/dist/client/form.d.ts +16 -27
  118. package/dist/client/form.d.ts.map +1 -1
  119. package/dist/client/history.d.ts +19 -4
  120. package/dist/client/history.d.ts.map +1 -1
  121. package/dist/client/index.d.ts +9 -24
  122. package/dist/client/index.d.ts.map +1 -1
  123. package/dist/client/index.js +172 -1100
  124. package/dist/client/index.js.map +1 -1
  125. package/dist/client/internal.d.ts +19 -0
  126. package/dist/client/internal.d.ts.map +1 -0
  127. package/dist/client/internal.js +964 -0
  128. package/dist/client/internal.js.map +1 -0
  129. package/dist/client/link-pending-store.d.ts +63 -0
  130. package/dist/client/link-pending-store.d.ts.map +1 -0
  131. package/dist/client/link.d.ts +62 -55
  132. package/dist/client/link.d.ts.map +1 -1
  133. package/dist/client/nav-link-store.d.ts +36 -0
  134. package/dist/client/nav-link-store.d.ts.map +1 -0
  135. package/dist/client/navigation-api-types.d.ts +90 -0
  136. package/dist/client/navigation-api-types.d.ts.map +1 -0
  137. package/dist/client/navigation-api.d.ts +115 -0
  138. package/dist/client/navigation-api.d.ts.map +1 -0
  139. package/dist/client/navigation-context.d.ts +13 -2
  140. package/dist/client/navigation-context.d.ts.map +1 -1
  141. package/dist/client/{transition-root.d.ts → navigation-root.d.ts} +42 -8
  142. package/dist/client/navigation-root.d.ts.map +1 -0
  143. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  144. package/dist/client/router-ref.d.ts +1 -1
  145. package/dist/client/router.d.ts +70 -4
  146. package/dist/client/router.d.ts.map +1 -1
  147. package/dist/client/rsc-fetch.d.ts +38 -3
  148. package/dist/client/rsc-fetch.d.ts.map +1 -1
  149. package/dist/client/segment-cache.d.ts +1 -1
  150. package/dist/client/segment-cache.d.ts.map +1 -1
  151. package/dist/client/segment-outlet.d.ts +63 -0
  152. package/dist/client/segment-outlet.d.ts.map +1 -0
  153. package/dist/client/ssr-data.d.ts +13 -4
  154. package/dist/client/ssr-data.d.ts.map +1 -1
  155. package/dist/client/stale-reload.d.ts +15 -0
  156. package/dist/client/stale-reload.d.ts.map +1 -1
  157. package/dist/client/state.d.ts +1 -1
  158. package/dist/client/top-loader.d.ts +5 -5
  159. package/dist/client/top-loader.d.ts.map +1 -1
  160. package/dist/client/use-cookie.d.ts +12 -0
  161. package/dist/client/use-cookie.d.ts.map +1 -1
  162. package/dist/client/use-link-status.d.ts +5 -5
  163. package/dist/client/use-link-status.d.ts.map +1 -1
  164. package/dist/client/{use-navigation-pending.d.ts → use-pending-navigation.d.ts} +4 -4
  165. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  166. package/dist/client/use-query-states.d.ts +1 -1
  167. package/dist/client/use-query-states.d.ts.map +1 -1
  168. package/dist/client/use-router.d.ts +1 -1
  169. package/dist/client/{use-params.d.ts → use-segment-params.d.ts} +8 -6
  170. package/dist/client/use-segment-params.d.ts.map +1 -0
  171. package/dist/codec.d.ts +69 -0
  172. package/dist/codec.d.ts.map +1 -0
  173. package/dist/codec.js +75 -0
  174. package/dist/codec.js.map +1 -0
  175. package/dist/config-types.d.ts +294 -0
  176. package/dist/config-types.d.ts.map +1 -0
  177. package/dist/config-validation.d.ts +51 -0
  178. package/dist/config-validation.d.ts.map +1 -0
  179. package/dist/content/index.d.ts +1 -10
  180. package/dist/content/index.d.ts.map +1 -1
  181. package/dist/content/index.js +0 -2
  182. package/dist/cookies/define-cookie.d.ts +58 -25
  183. package/dist/cookies/define-cookie.d.ts.map +1 -1
  184. package/dist/cookies/index.d.ts +2 -1
  185. package/dist/cookies/index.d.ts.map +1 -1
  186. package/dist/cookies/index.js +251 -36
  187. package/dist/cookies/index.js.map +1 -1
  188. package/dist/cookies/json-cookie.d.ts +64 -0
  189. package/dist/cookies/json-cookie.d.ts.map +1 -0
  190. package/dist/cookies/validation.d.ts +46 -0
  191. package/dist/cookies/validation.d.ts.map +1 -0
  192. package/dist/dev-tools/404-page.d.ts +46 -0
  193. package/dist/dev-tools/404-page.d.ts.map +1 -0
  194. package/dist/dev-tools/browser-logs.d.ts +84 -0
  195. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  196. package/dist/dev-tools/error-page.d.ts +58 -0
  197. package/dist/dev-tools/error-page.d.ts.map +1 -0
  198. package/dist/dev-tools/holding-server.d.ts +54 -0
  199. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  200. package/dist/dev-tools/index.d.ts +31 -0
  201. package/dist/dev-tools/index.d.ts.map +1 -0
  202. package/dist/{server/dev-span-processor.d.ts → dev-tools/instrumentation.d.ts} +26 -6
  203. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  204. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  205. package/dist/dev-tools/logger.d.ts.map +1 -0
  206. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +2 -2
  207. package/dist/dev-tools/logs.d.ts.map +1 -0
  208. package/dist/dev-tools/overlay.d.ts +91 -0
  209. package/dist/dev-tools/overlay.d.ts.map +1 -0
  210. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  211. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  212. package/dist/dev-tools/terminal.d.ts +28 -0
  213. package/dist/dev-tools/terminal.d.ts.map +1 -0
  214. package/dist/{server/dev-warnings.d.ts → dev-tools/warnings.d.ts} +2 -22
  215. package/dist/dev-tools/warnings.d.ts.map +1 -0
  216. package/dist/fonts/ast.d.ts +98 -6
  217. package/dist/fonts/ast.d.ts.map +1 -1
  218. package/dist/fonts/bundle.d.ts +48 -0
  219. package/dist/fonts/bundle.d.ts.map +1 -0
  220. package/dist/fonts/dev-middleware.d.ts +22 -0
  221. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  222. package/dist/fonts/local.d.ts +1 -1
  223. package/dist/fonts/pipeline.d.ts +167 -0
  224. package/dist/fonts/pipeline.d.ts.map +1 -0
  225. package/dist/fonts/transform.d.ts +78 -0
  226. package/dist/fonts/transform.d.ts.map +1 -0
  227. package/dist/fonts/types.d.ts +45 -1
  228. package/dist/fonts/types.d.ts.map +1 -1
  229. package/dist/fonts/virtual-modules.d.ts +94 -0
  230. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  231. package/dist/index.d.ts +46 -190
  232. package/dist/index.d.ts.map +1 -1
  233. package/dist/index.js +4807 -12729
  234. package/dist/index.js.map +1 -1
  235. package/dist/params/codec-registry.d.ts +26 -0
  236. package/dist/params/codec-registry.d.ts.map +1 -0
  237. package/dist/params/define-schema.d.ts +81 -0
  238. package/dist/params/define-schema.d.ts.map +1 -0
  239. package/dist/params/index.d.ts +5 -0
  240. package/dist/params/index.d.ts.map +1 -0
  241. package/dist/params/index.js +34 -0
  242. package/dist/params/index.js.map +1 -0
  243. package/dist/params/resolve-schema.d.ts +34 -0
  244. package/dist/params/resolve-schema.d.ts.map +1 -0
  245. package/dist/plugin-context.d.ts +107 -0
  246. package/dist/plugin-context.d.ts.map +1 -0
  247. package/dist/plugins/adapter-build.d.ts +1 -1
  248. package/dist/plugins/adapter-build.d.ts.map +1 -1
  249. package/dist/plugins/build-manifest.d.ts +2 -2
  250. package/dist/plugins/build-manifest.d.ts.map +1 -1
  251. package/dist/plugins/build-report.d.ts +9 -7
  252. package/dist/plugins/build-report.d.ts.map +1 -1
  253. package/dist/plugins/client-chunks.d.ts +32 -0
  254. package/dist/plugins/client-chunks.d.ts.map +1 -0
  255. package/dist/plugins/content.d.ts +1 -1
  256. package/dist/plugins/content.d.ts.map +1 -1
  257. package/dist/plugins/dev-server.d.ts +1 -1
  258. package/dist/plugins/dev-server.d.ts.map +1 -1
  259. package/dist/plugins/entries.d.ts +1 -1
  260. package/dist/plugins/entries.d.ts.map +1 -1
  261. package/dist/plugins/fonts.d.ts +17 -73
  262. package/dist/plugins/fonts.d.ts.map +1 -1
  263. package/dist/plugins/mdx.d.ts +1 -1
  264. package/dist/plugins/mdx.d.ts.map +1 -1
  265. package/dist/plugins/routing.d.ts +1 -1
  266. package/dist/plugins/routing.d.ts.map +1 -1
  267. package/dist/plugins/server-bundle.d.ts.map +1 -1
  268. package/dist/plugins/shims.d.ts +6 -5
  269. package/dist/plugins/shims.d.ts.map +1 -1
  270. package/dist/plugins/static-build.d.ts +5 -26
  271. package/dist/plugins/static-build.d.ts.map +1 -1
  272. package/dist/routing/codegen-shared.d.ts +63 -0
  273. package/dist/routing/codegen-shared.d.ts.map +1 -0
  274. package/dist/routing/codegen-types.d.ts +60 -0
  275. package/dist/routing/codegen-types.d.ts.map +1 -0
  276. package/dist/routing/codegen.d.ts +7 -2
  277. package/dist/routing/codegen.d.ts.map +1 -1
  278. package/dist/routing/convention-lint.d.ts +41 -0
  279. package/dist/routing/convention-lint.d.ts.map +1 -0
  280. package/dist/routing/index.d.ts +7 -1
  281. package/dist/routing/index.d.ts.map +1 -1
  282. package/dist/routing/index.js +4 -2
  283. package/dist/routing/link-codegen.d.ts +90 -0
  284. package/dist/routing/link-codegen.d.ts.map +1 -0
  285. package/dist/routing/scanner.d.ts +1 -10
  286. package/dist/routing/scanner.d.ts.map +1 -1
  287. package/dist/routing/schema-validation.d.ts +35 -0
  288. package/dist/routing/schema-validation.d.ts.map +1 -0
  289. package/dist/routing/segment-classify.d.ts +75 -0
  290. package/dist/routing/segment-classify.d.ts.map +1 -0
  291. package/dist/routing/segment-codegen.d.ts +38 -0
  292. package/dist/routing/segment-codegen.d.ts.map +1 -0
  293. package/dist/routing/types.d.ts +77 -25
  294. package/dist/routing/types.d.ts.map +1 -1
  295. package/dist/routing/walkers.d.ts +51 -0
  296. package/dist/routing/walkers.d.ts.map +1 -0
  297. package/dist/rsc-runtime/rsc.d.ts +1 -1
  298. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  299. package/dist/rsc-runtime/ssr.d.ts +12 -0
  300. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  301. package/dist/schema-bridge.d.ts +76 -0
  302. package/dist/schema-bridge.d.ts.map +1 -0
  303. package/dist/search-params/define.d.ts +157 -0
  304. package/dist/search-params/define.d.ts.map +1 -0
  305. package/dist/search-params/index.d.ts +4 -7
  306. package/dist/search-params/index.d.ts.map +1 -1
  307. package/dist/search-params/index.js +34 -441
  308. package/dist/search-params/index.js.map +1 -1
  309. package/dist/search-params/registry.d.ts +2 -2
  310. package/dist/search-params/registry.d.ts.map +1 -1
  311. package/dist/search-params/wrappers.d.ts +53 -0
  312. package/dist/search-params/wrappers.d.ts.map +1 -0
  313. package/dist/segment-params/define.d.ts +95 -0
  314. package/dist/segment-params/define.d.ts.map +1 -0
  315. package/dist/segment-params/index.d.ts +3 -0
  316. package/dist/segment-params/index.d.ts.map +1 -0
  317. package/dist/segment-params/index.js +2 -0
  318. package/dist/server/access-gate.d.ts +8 -3
  319. package/dist/server/access-gate.d.ts.map +1 -1
  320. package/dist/server/action-client.d.ts +41 -6
  321. package/dist/server/action-client.d.ts.map +1 -1
  322. package/dist/server/action-encryption.d.ts +76 -0
  323. package/dist/server/action-encryption.d.ts.map +1 -0
  324. package/dist/server/action-handler.d.ts +35 -1
  325. package/dist/server/action-handler.d.ts.map +1 -1
  326. package/dist/server/actions.d.ts +3 -6
  327. package/dist/server/actions.d.ts.map +1 -1
  328. package/dist/server/als-registry.d.ts +53 -5
  329. package/dist/server/als-registry.d.ts.map +1 -1
  330. package/dist/server/asset-headers.d.ts +1 -15
  331. package/dist/server/asset-headers.d.ts.map +1 -1
  332. package/dist/server/build-manifest.d.ts +2 -2
  333. package/dist/server/build-manifest.d.ts.map +1 -1
  334. package/dist/server/coalesce-tick.d.ts +40 -0
  335. package/dist/server/coalesce-tick.d.ts.map +1 -0
  336. package/dist/server/cookie-context.d.ts +170 -0
  337. package/dist/server/cookie-context.d.ts.map +1 -0
  338. package/dist/server/cookie-parsing.d.ts +51 -0
  339. package/dist/server/cookie-parsing.d.ts.map +1 -0
  340. package/dist/server/debug.d.ts +1 -1
  341. package/dist/server/default-logger.d.ts +22 -0
  342. package/dist/server/default-logger.d.ts.map +1 -0
  343. package/dist/server/deny-boundary.d.ts +90 -0
  344. package/dist/server/deny-boundary.d.ts.map +1 -0
  345. package/dist/server/deny-renderer.d.ts.map +1 -1
  346. package/dist/server/dev-source-map.d.ts +22 -0
  347. package/dist/server/dev-source-map.d.ts.map +1 -0
  348. package/dist/server/early-hints-sender.d.ts.map +1 -1
  349. package/dist/server/early-hints.d.ts +13 -5
  350. package/dist/server/early-hints.d.ts.map +1 -1
  351. package/dist/server/error-boundary-wrapper.d.ts +7 -1
  352. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  353. package/dist/server/fallback-error.d.ts +12 -7
  354. package/dist/server/fallback-error.d.ts.map +1 -1
  355. package/dist/server/flight-injection-state.d.ts +66 -0
  356. package/dist/server/flight-injection-state.d.ts.map +1 -0
  357. package/dist/server/flight-scripts.d.ts +42 -0
  358. package/dist/server/flight-scripts.d.ts.map +1 -0
  359. package/dist/server/flush.d.ts.map +1 -1
  360. package/dist/server/form-data.d.ts +29 -0
  361. package/dist/server/form-data.d.ts.map +1 -1
  362. package/dist/server/html-injector-core.d.ts +213 -0
  363. package/dist/server/html-injector-core.d.ts.map +1 -0
  364. package/dist/server/html-injectors.d.ts +81 -41
  365. package/dist/server/html-injectors.d.ts.map +1 -1
  366. package/dist/server/index.d.ts +10 -46
  367. package/dist/server/index.d.ts.map +1 -1
  368. package/dist/server/index.js +155 -2905
  369. package/dist/server/index.js.map +1 -1
  370. package/dist/server/internal.d.ts +48 -0
  371. package/dist/server/internal.d.ts.map +1 -0
  372. package/dist/server/internal.js +2947 -0
  373. package/dist/server/internal.js.map +1 -0
  374. package/dist/server/logger.d.ts +39 -7
  375. package/dist/server/logger.d.ts.map +1 -1
  376. package/dist/server/middleware-runner.d.ts +36 -4
  377. package/dist/server/middleware-runner.d.ts.map +1 -1
  378. package/dist/server/node-stream-transforms.d.ts +112 -0
  379. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  380. package/dist/server/param-coercion.d.ts +54 -0
  381. package/dist/server/param-coercion.d.ts.map +1 -0
  382. package/dist/server/pipeline-helpers.d.ts +95 -0
  383. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  384. package/dist/server/pipeline-interception.d.ts +1 -1
  385. package/dist/server/pipeline-interception.d.ts.map +1 -1
  386. package/dist/server/pipeline-metadata.d.ts +6 -0
  387. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  388. package/dist/server/pipeline-outcome.d.ts +49 -0
  389. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  390. package/dist/server/pipeline-phases.d.ts +52 -0
  391. package/dist/server/pipeline-phases.d.ts.map +1 -0
  392. package/dist/server/pipeline.d.ts +118 -23
  393. package/dist/server/pipeline.d.ts.map +1 -1
  394. package/dist/server/port-resolution.d.ts +117 -0
  395. package/dist/server/port-resolution.d.ts.map +1 -0
  396. package/dist/server/primitives.d.ts +69 -18
  397. package/dist/server/primitives.d.ts.map +1 -1
  398. package/dist/server/render-timeout.d.ts +51 -0
  399. package/dist/server/render-timeout.d.ts.map +1 -0
  400. package/dist/server/request-context.d.ts +62 -107
  401. package/dist/server/request-context.d.ts.map +1 -1
  402. package/dist/server/route-element-builder.d.ts +27 -1
  403. package/dist/server/route-element-builder.d.ts.map +1 -1
  404. package/dist/server/route-handler.d.ts.map +1 -1
  405. package/dist/server/route-matcher.d.ts +21 -34
  406. package/dist/server/route-matcher.d.ts.map +1 -1
  407. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  408. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  409. package/dist/server/rsc-entry/api-handler.d.ts +2 -2
  410. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  411. package/dist/server/rsc-entry/error-renderer.d.ts +26 -13
  412. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  413. package/dist/server/rsc-entry/helpers.d.ts +49 -6
  414. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  415. package/dist/server/rsc-entry/index.d.ts +19 -8
  416. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  417. package/dist/server/rsc-entry/render-route.d.ts +50 -0
  418. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  419. package/dist/server/rsc-entry/rsc-payload.d.ts +3 -3
  420. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  421. package/dist/server/rsc-entry/rsc-stream.d.ts +17 -1
  422. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  423. package/dist/server/rsc-entry/ssr-bridge.d.ts +1 -1
  424. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  425. package/dist/server/rsc-entry/ssr-renderer.d.ts +19 -4
  426. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  427. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +119 -0
  428. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -0
  429. package/dist/server/safe-load.d.ts +46 -0
  430. package/dist/server/safe-load.d.ts.map +1 -0
  431. package/dist/server/sensitive-fields.d.ts +74 -0
  432. package/dist/server/sensitive-fields.d.ts.map +1 -0
  433. package/dist/server/sitemap-generator.d.ts +129 -0
  434. package/dist/server/sitemap-generator.d.ts.map +1 -0
  435. package/dist/server/sitemap-handler.d.ts +22 -0
  436. package/dist/server/sitemap-handler.d.ts.map +1 -0
  437. package/dist/server/slot-resolver.d.ts +1 -1
  438. package/dist/server/slot-resolver.d.ts.map +1 -1
  439. package/dist/server/ssr-entry.d.ts +30 -0
  440. package/dist/server/ssr-entry.d.ts.map +1 -1
  441. package/dist/server/ssr-render.d.ts +39 -21
  442. package/dist/server/ssr-render.d.ts.map +1 -1
  443. package/dist/server/ssr-wrappers.d.ts +50 -0
  444. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  445. package/dist/server/state-tree-diff.d.ts.map +1 -1
  446. package/dist/server/status-code-resolver.d.ts +16 -11
  447. package/dist/server/status-code-resolver.d.ts.map +1 -1
  448. package/dist/server/stream-utils.d.ts +36 -0
  449. package/dist/server/stream-utils.d.ts.map +1 -0
  450. package/dist/server/tracing.d.ts +5 -5
  451. package/dist/server/tracing.d.ts.map +1 -1
  452. package/dist/server/tree-builder.d.ts +62 -30
  453. package/dist/server/tree-builder.d.ts.map +1 -1
  454. package/dist/server/tree-match.d.ts +41 -0
  455. package/dist/server/tree-match.d.ts.map +1 -0
  456. package/dist/server/types.d.ts +49 -4
  457. package/dist/server/types.d.ts.map +1 -1
  458. package/dist/server/utils/escape-html.d.ts +14 -0
  459. package/dist/server/utils/escape-html.d.ts.map +1 -0
  460. package/dist/server/version-skew.d.ts +61 -0
  461. package/dist/server/version-skew.d.ts.map +1 -0
  462. package/dist/shared/merge-search-params.d.ts +22 -0
  463. package/dist/shared/merge-search-params.d.ts.map +1 -0
  464. package/dist/shims/font-google.d.ts +1 -1
  465. package/dist/shims/font-google.d.ts.map +1 -1
  466. package/dist/shims/font-google.js +42 -0
  467. package/dist/shims/font-google.js.map +1 -0
  468. package/dist/shims/font-local.d.ts +26 -0
  469. package/dist/shims/font-local.d.ts.map +1 -0
  470. package/dist/shims/font-local.js +20 -0
  471. package/dist/shims/font-local.js.map +1 -0
  472. package/dist/shims/headers.d.ts +2 -1
  473. package/dist/shims/headers.d.ts.map +1 -1
  474. package/dist/shims/navigation-client.d.ts +3 -1
  475. package/dist/shims/navigation-client.d.ts.map +1 -1
  476. package/dist/shims/navigation.d.ts +11 -5
  477. package/dist/shims/navigation.d.ts.map +1 -1
  478. package/dist/utils/state-machine.d.ts +80 -0
  479. package/dist/utils/state-machine.d.ts.map +1 -0
  480. package/package.json +62 -21
  481. package/src/adapters/build-output-helper.ts +77 -0
  482. package/src/adapters/cloudflare-dev.ts +177 -0
  483. package/src/adapters/cloudflare-kv-cache.ts +142 -0
  484. package/src/adapters/cloudflare.ts +350 -76
  485. package/src/adapters/compress-module.ts +24 -4
  486. package/src/adapters/nitro.ts +142 -59
  487. package/src/adapters/shared.ts +40 -0
  488. package/src/adapters/wrangler.d.ts +7 -0
  489. package/src/cache/cache-api.ts +38 -0
  490. package/src/cache/handler-store.ts +68 -0
  491. package/src/cache/index.ts +81 -18
  492. package/src/cache/singleflight.ts +62 -4
  493. package/src/cache/sizeof.ts +33 -0
  494. package/src/cache/timber-cache.ts +25 -20
  495. package/src/cli-schema-sync.ts +207 -0
  496. package/src/cli.ts +65 -8
  497. package/src/client/browser-dev.ts +153 -1
  498. package/src/client/browser-entry/action-dispatch.ts +126 -0
  499. package/src/client/browser-entry/hmr.ts +81 -0
  500. package/src/client/browser-entry/hydrate.ts +145 -0
  501. package/src/client/browser-entry/index.ts +149 -0
  502. package/src/client/browser-entry/post-hydration.ts +119 -0
  503. package/src/client/browser-entry/router-init.ts +193 -0
  504. package/src/client/browser-entry/rsc-stream.ts +157 -0
  505. package/src/client/browser-entry/scroll.ts +27 -0
  506. package/src/client/error-boundary.tsx +99 -22
  507. package/src/client/error-reconstituter.tsx +65 -0
  508. package/src/client/form.tsx +31 -32
  509. package/src/client/history.ts +26 -4
  510. package/src/client/index.ts +69 -44
  511. package/src/client/internal.ts +58 -0
  512. package/src/client/link-pending-store.ts +111 -0
  513. package/src/client/link.tsx +366 -113
  514. package/src/client/nav-link-store.ts +47 -0
  515. package/src/client/navigation-api-types.ts +112 -0
  516. package/src/client/navigation-api.ts +332 -0
  517. package/src/client/navigation-context.ts +31 -6
  518. package/src/client/navigation-root.tsx +342 -0
  519. package/src/client/nuqs-adapter.tsx +16 -3
  520. package/src/client/router-ref.ts +1 -1
  521. package/src/client/router.ts +300 -73
  522. package/src/client/rsc-fetch.ts +112 -8
  523. package/src/client/segment-cache.ts +1 -1
  524. package/src/client/segment-outlet.tsx +86 -0
  525. package/src/client/ssr-data.ts +13 -5
  526. package/src/client/stale-reload.ts +72 -3
  527. package/src/client/state.ts +2 -2
  528. package/src/client/top-loader.tsx +18 -6
  529. package/src/client/use-cookie.ts +31 -2
  530. package/src/client/use-link-status.ts +7 -7
  531. package/src/client/{use-navigation-pending.ts → use-pending-navigation.ts} +6 -6
  532. package/src/client/use-query-states.ts +9 -3
  533. package/src/client/use-router.ts +1 -1
  534. package/src/client/{use-params.ts → use-segment-params.ts} +8 -6
  535. package/src/codec.ts +147 -0
  536. package/src/config-types.ts +292 -0
  537. package/src/config-validation.ts +303 -0
  538. package/src/content/index.ts +5 -13
  539. package/src/cookies/define-cookie.ts +233 -53
  540. package/src/cookies/index.ts +12 -1
  541. package/src/cookies/json-cookie.ts +105 -0
  542. package/src/cookies/validation.ts +134 -0
  543. package/src/dev-tools/404-page.ts +387 -0
  544. package/src/dev-tools/browser-logs.ts +291 -0
  545. package/src/dev-tools/error-page.ts +506 -0
  546. package/src/dev-tools/holding-server.ts +187 -0
  547. package/src/dev-tools/index.ts +90 -0
  548. package/src/dev-tools/instrumentation.ts +176 -0
  549. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +9 -5
  550. package/src/dev-tools/overlay.ts +469 -0
  551. package/src/dev-tools/stack-classifier.ts +75 -0
  552. package/src/dev-tools/terminal.ts +183 -0
  553. package/src/{server/dev-warnings.ts → dev-tools/warnings.ts} +5 -50
  554. package/src/fonts/ast.ts +525 -16
  555. package/src/fonts/bundle.ts +142 -0
  556. package/src/fonts/dev-middleware.ts +74 -0
  557. package/src/fonts/local.ts +1 -1
  558. package/src/fonts/pipeline.ts +314 -0
  559. package/src/fonts/transform.ts +317 -0
  560. package/src/fonts/types.ts +50 -1
  561. package/src/fonts/virtual-modules.ts +233 -0
  562. package/src/index.ts +409 -357
  563. package/src/params/codec-registry.ts +34 -0
  564. package/src/params/define-schema.ts +114 -0
  565. package/src/params/index.ts +17 -0
  566. package/src/params/resolve-schema.ts +101 -0
  567. package/src/plugin-context.ts +240 -0
  568. package/src/plugins/adapter-build.ts +12 -4
  569. package/src/plugins/build-manifest.ts +13 -2
  570. package/src/plugins/build-report.ts +16 -25
  571. package/src/plugins/client-chunks.ts +65 -0
  572. package/src/plugins/content.ts +1 -1
  573. package/src/plugins/dev-server.ts +175 -35
  574. package/src/plugins/entries.ts +111 -9
  575. package/src/plugins/fonts.ts +157 -654
  576. package/src/plugins/mdx.ts +47 -10
  577. package/src/plugins/routing.ts +371 -45
  578. package/src/plugins/server-bundle.ts +32 -1
  579. package/src/plugins/shims.ts +136 -35
  580. package/src/plugins/static-build.ts +15 -89
  581. package/src/routing/codegen-shared.ts +109 -0
  582. package/src/routing/codegen-types.ts +61 -0
  583. package/src/routing/codegen.ts +316 -177
  584. package/src/routing/convention-lint.ts +357 -0
  585. package/src/routing/index.ts +10 -1
  586. package/src/routing/interception.ts +1 -1
  587. package/src/routing/link-codegen.ts +308 -0
  588. package/src/routing/scanner.ts +165 -110
  589. package/src/routing/schema-validation.ts +149 -0
  590. package/src/routing/segment-classify.ts +188 -0
  591. package/src/routing/segment-codegen.ts +98 -0
  592. package/src/routing/types.ts +78 -25
  593. package/src/routing/walkers.ts +90 -0
  594. package/src/rsc-runtime/rsc.ts +2 -0
  595. package/src/rsc-runtime/ssr.ts +50 -0
  596. package/src/rsc-runtime/vendor-types.d.ts +7 -0
  597. package/src/{search-params/codecs.ts → schema-bridge.ts} +57 -20
  598. package/src/search-params/define.ts +538 -0
  599. package/src/search-params/index.ts +14 -20
  600. package/src/search-params/registry.ts +2 -2
  601. package/src/search-params/wrappers.ts +92 -0
  602. package/src/segment-params/define.ts +336 -0
  603. package/src/segment-params/index.ts +9 -0
  604. package/src/server/access-gate.tsx +76 -34
  605. package/src/server/action-client.ts +88 -15
  606. package/src/server/action-encryption.ts +144 -0
  607. package/src/server/action-handler.ts +112 -14
  608. package/src/server/actions.ts +10 -9
  609. package/src/server/als-registry.ts +55 -7
  610. package/src/server/asset-headers.ts +8 -34
  611. package/src/server/build-manifest.ts +10 -4
  612. package/src/server/coalesce-tick.ts +75 -0
  613. package/src/server/compress.ts +25 -7
  614. package/src/server/cookie-context.ts +468 -0
  615. package/src/server/cookie-parsing.ts +135 -0
  616. package/src/server/debug.ts +1 -1
  617. package/src/server/default-logger.ts +99 -0
  618. package/src/server/deny-boundary.ts +218 -0
  619. package/src/server/deny-renderer.ts +31 -50
  620. package/src/server/dev-source-map.ts +31 -0
  621. package/src/server/early-hints-sender.ts +3 -2
  622. package/src/server/early-hints.ts +36 -15
  623. package/src/server/error-boundary-wrapper.ts +74 -22
  624. package/src/server/fallback-error.ts +74 -102
  625. package/src/server/flight-injection-state.ts +113 -0
  626. package/src/server/flight-scripts.ts +62 -0
  627. package/src/server/flush.ts +2 -1
  628. package/src/server/form-data.ts +76 -0
  629. package/src/server/html-injector-core.ts +417 -0
  630. package/src/server/html-injectors.ts +235 -223
  631. package/src/server/index.ts +29 -183
  632. package/src/server/internal.ts +176 -0
  633. package/src/server/logger.ts +67 -36
  634. package/src/server/middleware-runner.ts +75 -4
  635. package/src/server/node-stream-transforms.ts +361 -0
  636. package/src/server/param-coercion.ts +206 -0
  637. package/src/server/pipeline-helpers.ts +204 -0
  638. package/src/server/pipeline-interception.ts +17 -16
  639. package/src/server/pipeline-metadata.ts +13 -0
  640. package/src/server/pipeline-outcome.ts +176 -0
  641. package/src/server/pipeline-phases.ts +460 -0
  642. package/src/server/pipeline.ts +154 -394
  643. package/src/server/port-resolution.ts +215 -0
  644. package/src/server/primitives.ts +111 -28
  645. package/src/server/render-timeout.ts +108 -0
  646. package/src/server/request-context.ts +168 -333
  647. package/src/server/route-element-builder.ts +309 -195
  648. package/src/server/route-handler.ts +24 -4
  649. package/src/server/route-matcher.ts +50 -231
  650. package/src/server/rsc-entry/action-middleware-runner.ts +167 -0
  651. package/src/server/rsc-entry/api-handler.ts +16 -17
  652. package/src/server/rsc-entry/error-renderer.ts +305 -89
  653. package/src/server/rsc-entry/helpers.ts +137 -12
  654. package/src/server/rsc-entry/index.ts +316 -352
  655. package/src/server/rsc-entry/render-route.ts +307 -0
  656. package/src/server/rsc-entry/rsc-payload.ts +65 -18
  657. package/src/server/rsc-entry/rsc-stream.ts +85 -13
  658. package/src/server/rsc-entry/ssr-bridge.ts +14 -5
  659. package/src/server/rsc-entry/ssr-renderer.ts +187 -38
  660. package/src/server/rsc-entry/wrap-action-dispatch.ts +449 -0
  661. package/src/server/safe-load.ts +60 -0
  662. package/src/server/sensitive-fields.ts +230 -0
  663. package/src/server/sitemap-generator.ts +338 -0
  664. package/src/server/sitemap-handler.ts +126 -0
  665. package/src/server/slot-resolver.ts +228 -246
  666. package/src/server/ssr-entry.ts +229 -32
  667. package/src/server/ssr-render.ts +289 -67
  668. package/src/server/ssr-wrappers.tsx +139 -0
  669. package/src/server/state-tree-diff.ts +4 -1
  670. package/src/server/status-code-resolver.ts +112 -128
  671. package/src/server/stream-utils.ts +213 -0
  672. package/src/server/tracing.ts +21 -10
  673. package/src/server/tree-builder.ts +202 -90
  674. package/src/server/tree-match.ts +198 -0
  675. package/src/server/types.ts +55 -6
  676. package/src/server/utils/escape-html.ts +20 -0
  677. package/src/server/version-skew.ts +104 -0
  678. package/src/shared/merge-search-params.ts +55 -0
  679. package/src/shims/font-google.ts +1 -1
  680. package/src/shims/font-local.ts +34 -0
  681. package/src/shims/headers.ts +5 -1
  682. package/src/shims/navigation-client.ts +4 -3
  683. package/src/shims/navigation.ts +14 -7
  684. package/src/utils/state-machine.ts +111 -0
  685. package/LICENSE +0 -8
  686. package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
  687. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  688. package/dist/_chunks/debug-gwlJkDuf.js +0 -108
  689. package/dist/_chunks/debug-gwlJkDuf.js.map +0 -1
  690. package/dist/_chunks/format-DviM89f0.js.map +0 -1
  691. package/dist/_chunks/interception-BOoWmLUA.js +0 -676
  692. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  693. package/dist/_chunks/request-context-DIkVh_jG.js +0 -330
  694. package/dist/_chunks/request-context-DIkVh_jG.js.map +0 -1
  695. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  696. package/dist/_chunks/tracing-CemImE6h.js +0 -187
  697. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  698. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  699. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  700. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  701. package/dist/cache/register-cached-function.d.ts +0 -17
  702. package/dist/cache/register-cached-function.d.ts.map +0 -1
  703. package/dist/client/browser-entry.d.ts +0 -21
  704. package/dist/client/browser-entry.d.ts.map +0 -1
  705. package/dist/client/link-status-provider.d.ts +0 -11
  706. package/dist/client/link-status-provider.d.ts.map +0 -1
  707. package/dist/client/transition-root.d.ts.map +0 -1
  708. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  709. package/dist/client/use-params.d.ts.map +0 -1
  710. package/dist/plugins/cache-transform.d.ts +0 -36
  711. package/dist/plugins/cache-transform.d.ts.map +0 -1
  712. package/dist/plugins/dev-error-overlay.d.ts +0 -60
  713. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  714. package/dist/plugins/dev-logs.d.ts.map +0 -1
  715. package/dist/plugins/dynamic-transform.d.ts +0 -72
  716. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  717. package/dist/plugins/server-action-exports.d.ts +0 -26
  718. package/dist/plugins/server-action-exports.d.ts.map +0 -1
  719. package/dist/routing/status-file-lint.d.ts +0 -33
  720. package/dist/routing/status-file-lint.d.ts.map +0 -1
  721. package/dist/search-params/analyze.d.ts +0 -54
  722. package/dist/search-params/analyze.d.ts.map +0 -1
  723. package/dist/search-params/builtin-codecs.d.ts +0 -105
  724. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  725. package/dist/search-params/codecs.d.ts +0 -53
  726. package/dist/search-params/codecs.d.ts.map +0 -1
  727. package/dist/search-params/create.d.ts +0 -106
  728. package/dist/search-params/create.d.ts.map +0 -1
  729. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  730. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  731. package/dist/server/dev-logger.d.ts.map +0 -1
  732. package/dist/server/dev-span-processor.d.ts.map +0 -1
  733. package/dist/server/dev-warnings.d.ts.map +0 -1
  734. package/dist/server/manifest-status-resolver.d.ts +0 -58
  735. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  736. package/dist/server/prerender.d.ts +0 -77
  737. package/dist/server/prerender.d.ts.map +0 -1
  738. package/dist/server/response-cache.d.ts +0 -54
  739. package/dist/server/response-cache.d.ts.map +0 -1
  740. package/dist/utils/directive-parser.d.ts +0 -70
  741. package/dist/utils/directive-parser.d.ts.map +0 -1
  742. package/src/cache/register-cached-function.ts +0 -103
  743. package/src/client/browser-entry.ts +0 -678
  744. package/src/client/link-status-provider.tsx +0 -30
  745. package/src/client/transition-root.tsx +0 -166
  746. package/src/plugins/cache-transform.ts +0 -199
  747. package/src/plugins/dev-error-overlay.ts +0 -230
  748. package/src/plugins/dynamic-transform.ts +0 -161
  749. package/src/plugins/server-action-exports.ts +0 -220
  750. package/src/routing/status-file-lint.ts +0 -112
  751. package/src/search-params/analyze.ts +0 -192
  752. package/src/search-params/builtin-codecs.ts +0 -228
  753. package/src/search-params/create.ts +0 -321
  754. package/src/server/dev-fetch-instrumentation.ts +0 -96
  755. package/src/server/dev-span-processor.ts +0 -78
  756. package/src/server/manifest-status-resolver.ts +0 -215
  757. package/src/server/prerender.ts +0 -139
  758. package/src/server/response-cache.ts +0 -410
  759. package/src/utils/directive-parser.ts +0 -529
  760. /package/src/{server/dev-logger.ts → dev-tools/logger.ts} +0 -0
@@ -22,8 +22,7 @@ export interface MiddlewareContext {
22
22
  req: Request;
23
23
  requestHeaders: Headers;
24
24
  headers: Headers;
25
- params: Record<string, string | string[]>;
26
- searchParams: unknown;
25
+ segmentParams: Record<string, string | string[]>;
27
26
  /** Declare early hints for critical resources. Appends Link headers. */
28
27
  earlyHints: (hints: EarlyHint[]) => void;
29
28
  }
@@ -35,10 +34,8 @@ export interface RouteContext {
35
34
  headers: Headers;
36
35
  }
37
36
 
38
- export interface AccessContext {
39
- params: Record<string, string | string[]>;
40
- searchParams: unknown;
41
- }
37
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
38
+ export interface AccessContext {}
42
39
 
43
40
  export interface Metadata {
44
41
  title?: string | { default?: string; template?: string; absolute?: string };
@@ -163,4 +160,56 @@ export namespace MetadataRoute {
163
160
  sitemap?: string | string[];
164
161
  host?: string;
165
162
  }
163
+ /**
164
+ * PWA Web App Manifest — serialized as `application/manifest+json`.
165
+ *
166
+ * Intentionally permissive: the manifest spec is large and evolving
167
+ * (W3C + browser-specific extensions). Users that want stricter typing
168
+ * can augment the return type with a library like `web-app-manifest`.
169
+ */
170
+ export type Manifest = Record<string, unknown>;
166
171
  }
172
+
173
+ /**
174
+ * The value a dynamic metadata route handler may return.
175
+ *
176
+ * This is a structural union — the pipeline dispatches on the shape at
177
+ * request time (see `pipeline-phases.ts`):
178
+ * - `Response` → returned as-is (e.g. `ImageResponse`, `Response.redirect()`).
179
+ * Used by `icon.tsx`, `opengraph-image.tsx`, `twitter-image.tsx`,
180
+ * `apple-icon.tsx`.
181
+ * - `string` → written as the response body verbatim. Used by `robots.ts`
182
+ * and by any handler that wants to emit a pre-serialized payload.
183
+ * - `MetadataRoute.Sitemap` → serialized via the sitemap XML writer. Used
184
+ * by `sitemap.ts`.
185
+ * - `MetadataRoute.Manifest` → serialized via `JSON.stringify`. Used by
186
+ * `manifest.ts`.
187
+ *
188
+ * See design/16-metadata.md §"Metadata Routes".
189
+ */
190
+ export type MetadataResult = Response | string | MetadataRoute.Sitemap | MetadataRoute.Manifest;
191
+
192
+ /**
193
+ * Default export signature for a dynamic metadata route file
194
+ * (`sitemap.ts`, `robots.ts`, `manifest.ts`, `icon.tsx`,
195
+ * `opengraph-image.tsx`, `twitter-image.tsx`, `apple-icon.tsx`).
196
+ *
197
+ * Parameterize `TResult` to narrow the return type for a specific route:
198
+ *
199
+ * ```ts
200
+ * // app/sitemap.ts
201
+ * import type { MetadataHandler, MetadataRoute } from '@timber-js/app/server';
202
+ *
203
+ * const sitemap: MetadataHandler<MetadataRoute.Sitemap> = async () => [
204
+ * { url: 'https://example.com/', changeFrequency: 'weekly', priority: 1 },
205
+ * ];
206
+ * export default sitemap;
207
+ * ```
208
+ *
209
+ * The handler is currently invoked with no arguments. Per-request context
210
+ * (`params`, `searchParams`, `Request`) is not yet wired through to metadata
211
+ * route handlers; when it is, this signature will grow a context parameter.
212
+ */
213
+ export type MetadataHandler<TResult extends MetadataResult = MetadataResult> = () =>
214
+ | TResult
215
+ | Promise<TResult>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared HTML escaping utility.
3
+ *
4
+ * Used by both dev-only paths (error pages, 404 page) and production
5
+ * paths (deny-renderer, RSC helpers). Lives in server/utils/ because
6
+ * it's not dev-only.
7
+ */
8
+
9
+ /**
10
+ * Escape a string for safe embedding in HTML content or attributes.
11
+ *
12
+ * Replaces `&`, `<`, `>`, and `"` with their HTML entity equivalents.
13
+ */
14
+ export function escapeHtml(str: string): string {
15
+ return str
16
+ .replace(/&/g, '&amp;')
17
+ .replace(/</g, '&lt;')
18
+ .replace(/>/g, '&gt;')
19
+ .replace(/"/g, '&quot;');
20
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Version Skew Detection — graceful recovery when stale clients hit new deployments.
3
+ *
4
+ * When a new version of the app is deployed, clients with open tabs still have
5
+ * the old JavaScript bundle. Without version skew handling, these stale clients
6
+ * will experience:
7
+ *
8
+ * 1. Server action calls that crash (action IDs are content-hashed)
9
+ * 2. Chunk load failures (old filenames gone from CDN)
10
+ * 3. RSC payload mismatches (component references differ between builds)
11
+ *
12
+ * This module implements deployment ID comparison:
13
+ * - A per-build deployment ID is generated at build time (see build-manifest.ts)
14
+ * - The client sends it via `X-Timber-Deployment-Id` header on every RSC/action request
15
+ * - The server compares it against the current build's ID
16
+ * - On mismatch: signal the client to reload (not crash)
17
+ *
18
+ * The deployment ID is always-on in production. Dev mode skips the check
19
+ * (HMR handles code updates without full reloads).
20
+ *
21
+ * See design/25-production-deployments.md, TIM-446
22
+ */
23
+
24
+ // ─── Constants ───────────────────────────────────────────────────
25
+
26
+ /** Header sent by the client with every RSC/action request. */
27
+ export const DEPLOYMENT_ID_HEADER = 'X-Timber-Deployment-Id';
28
+
29
+ /** Response header that signals the client to do a full page reload. */
30
+ export const RELOAD_HEADER = 'X-Timber-Reload';
31
+
32
+ // ─── Deployment ID ───────────────────────────────────────────────
33
+
34
+ /**
35
+ * The current build's deployment ID. Set at startup from the manifest init
36
+ * module (globalThis.__TIMBER_DEPLOYMENT_ID__). Null in dev mode.
37
+ */
38
+ let currentDeploymentId: string | null = null;
39
+
40
+ /**
41
+ * Set the current deployment ID. Called once at server startup from the
42
+ * manifest init module. In dev mode this is never called (deployment ID
43
+ * checks are skipped).
44
+ */
45
+ export function setDeploymentId(id: string): void {
46
+ currentDeploymentId = id;
47
+ }
48
+
49
+ /**
50
+ * Get the current deployment ID. Returns null in dev mode.
51
+ */
52
+ export function getDeploymentId(): string | null {
53
+ return currentDeploymentId;
54
+ }
55
+
56
+ // ─── Skew Detection ──────────────────────────────────────────────
57
+
58
+ /** Result of a version skew check. */
59
+ export interface SkewCheckResult {
60
+ /** Whether the client's deployment ID matches the server's. */
61
+ ok: boolean;
62
+ /** The client's deployment ID (null if header not sent — e.g., initial page load). */
63
+ clientId: string | null;
64
+ }
65
+
66
+ /**
67
+ * Check if a request's deployment ID matches the current build.
68
+ *
69
+ * Returns `{ ok: true }` when:
70
+ * - Dev mode (no deployment ID set — HMR handles updates)
71
+ * - No deployment ID header (initial page load, non-RSC request)
72
+ * - Deployment IDs match
73
+ *
74
+ * Returns `{ ok: false }` when:
75
+ * - Client sends a deployment ID that differs from the current build
76
+ */
77
+ export function checkVersionSkew(req: Request): SkewCheckResult {
78
+ // Dev mode — no deployment ID checks (HMR handles updates)
79
+ if (!currentDeploymentId) {
80
+ return { ok: true, clientId: null };
81
+ }
82
+
83
+ const clientId = req.headers.get(DEPLOYMENT_ID_HEADER);
84
+
85
+ // No header — initial page load or non-RSC request. Always OK.
86
+ if (!clientId) {
87
+ return { ok: true, clientId: null };
88
+ }
89
+
90
+ // Compare deployment IDs
91
+ if (clientId === currentDeploymentId) {
92
+ return { ok: true, clientId };
93
+ }
94
+
95
+ return { ok: false, clientId };
96
+ }
97
+
98
+ /**
99
+ * Apply version skew reload headers to a response.
100
+ * Sets X-Timber-Reload: 1 to signal the client to do a full page reload.
101
+ */
102
+ export function applyReloadHeaders(headers: Headers): void {
103
+ headers.set(RELOAD_HEADER, '1');
104
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Shared utility for merging preserved search params into a target URL.
3
+ *
4
+ * Used by both <Link> (client) and redirect() (server). Extracted to a shared
5
+ * module to avoid importing client code ('use client') from server modules.
6
+ */
7
+
8
+ /**
9
+ * Merge preserved search params from the current URL into a target href.
10
+ *
11
+ * When `preserve` is `true`, all current search params are merged.
12
+ * When `preserve` is a `string[]`, only the named params are merged.
13
+ *
14
+ * The target href's own search params take precedence — preserved params
15
+ * are only added if the target doesn't already define them.
16
+ *
17
+ * @param targetHref - The resolved target href (may already contain query string)
18
+ * @param currentSearch - The current URL's search string (e.g. "?private=access&page=2")
19
+ * @param preserve - `true` to preserve all, or `string[]` to preserve specific params
20
+ * @returns The target href with preserved search params merged in
21
+ */
22
+ export function mergePreservedSearchParams(
23
+ targetHref: string,
24
+ currentSearch: string,
25
+ preserve: true | string[]
26
+ ): string {
27
+ const currentParams = new URLSearchParams(currentSearch);
28
+ if (currentParams.size === 0) return targetHref;
29
+
30
+ // Split hash fragment from target before processing query params.
31
+ // Hash must come after query string: /path?query=value#hash
32
+ const hashIdx = targetHref.indexOf('#');
33
+ const hrefWithoutHash = hashIdx >= 0 ? targetHref.slice(0, hashIdx) : targetHref;
34
+ const hash = hashIdx >= 0 ? targetHref.slice(hashIdx) : '';
35
+
36
+ // Split target into path and existing query
37
+ const qIdx = hrefWithoutHash.indexOf('?');
38
+ const targetPath = qIdx >= 0 ? hrefWithoutHash.slice(0, qIdx) : hrefWithoutHash;
39
+ const targetParams = new URLSearchParams(qIdx >= 0 ? hrefWithoutHash.slice(qIdx + 1) : '');
40
+
41
+ // Collect params to preserve (that aren't already in the target)
42
+ const merged = new URLSearchParams(targetParams);
43
+ for (const [key, value] of currentParams) {
44
+ // Only preserve if: (a) not already in target, and (b) included in preserve list
45
+ if (!targetParams.has(key)) {
46
+ if (preserve === true || preserve.includes(key)) {
47
+ merged.append(key, value);
48
+ }
49
+ }
50
+ }
51
+
52
+ const qs = merged.toString();
53
+ const pathWithQuery = qs ? `${targetPath}?${qs}` : targetPath;
54
+ return pathWithQuery + hash;
55
+ }
@@ -17,7 +17,7 @@
17
17
  * Design doc: 24-fonts.md, "Next.js Font Compatibility"
18
18
  */
19
19
 
20
- import type { GoogleFontConfig, FontResult } from '#/fonts/types.js';
20
+ import type { GoogleFontConfig, FontResult } from '../fonts/types.js';
21
21
 
22
22
  export type { GoogleFontConfig, FontResult };
23
23
 
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Fallback shim for `next/font/local` → `@timber/fonts/local`.
3
+ *
4
+ * At build time, the timber-fonts plugin's transform hook replaces
5
+ * `localFont()` calls with static FontResult objects containing real
6
+ * class names and font stacks. This file serves two purposes:
7
+ *
8
+ * 1. **TypeScript resolution** — provides types for IDEs and `tsc` outside
9
+ * of Vite's module graph (where the virtual module handles it).
10
+ * 2. **Runtime fallback** — returns empty className/fontFamily values when
11
+ * the plugin hasn't processed a call (e.g. in tests or non-Vite environments).
12
+ *
13
+ * Design doc: 24-fonts.md, "Next.js Font Compatibility"
14
+ */
15
+
16
+ import type { LocalFontConfig, FontResult } from '../fonts/types.js';
17
+
18
+ export type { LocalFontConfig, FontResult };
19
+
20
+ /**
21
+ * Create a local font.
22
+ *
23
+ * The timber-fonts plugin replaces these calls at build time with real
24
+ * class names and font stacks. This stub ensures code that imports
25
+ * `localFont` outside of the build pipeline (tests, type-checking)
26
+ * gets a valid FontResult shape without runtime errors.
27
+ */
28
+ export default function localFont(config?: LocalFontConfig): FontResult {
29
+ return {
30
+ className: '',
31
+ style: { fontFamily: '' },
32
+ variable: config?.variable,
33
+ };
34
+ }
@@ -6,4 +6,8 @@
6
6
  * pipeline (both import from the same shared request-context chunk in dist/).
7
7
  */
8
8
 
9
- export { headers, cookies } from '@timber-js/app/server';
9
+ // Re-export timber's primary API
10
+ export { getHeaders, getCookieJar } from '@timber-js/app/server';
11
+
12
+ // Next.js compat aliases — libraries importing from 'next/headers' expect these names.
13
+ export { getHeaders as headers, getCookieJar as cookies } from '@timber-js/app/server';
@@ -16,11 +16,12 @@
16
16
  * See design/14-ecosystem.md §"next/navigation" for the full shim audit.
17
17
  */
18
18
 
19
- // Hooks — imported from the public barrel for module singleton consistency.
19
+ // Hooks — useSegmentParams and useSearchParams import from direct modules
20
+ // since they're no longer in @timber-js/app/client public exports.
21
+ export { useSegmentParams } from '../client/use-segment-params.js';
22
+ export { useSearchParams } from '../client/use-search-params.js';
20
23
  export {
21
- useParams,
22
24
  usePathname,
23
- useSearchParams,
24
25
  useRouter,
25
26
  useSelectedLayoutSegment,
26
27
  useSelectedLayoutSegments,
@@ -1,20 +1,27 @@
1
1
  /**
2
2
  * Shim: next/navigation → timber navigation primitives
3
3
  *
4
- * Client hooks import from @timber-js/app/client (the public barrel) so they
5
- * resolve to the same module instances as user code in Vite dev. Server
6
- * functions import from @timber-js/app/server for ALS singleton consistency.
4
+ * Client hooks import from their direct modules since useSegmentParams,
5
+ * useSearchParams, and useQueryStates are no longer part of
6
+ * @timber-js/app/client public exports (they live on define* factories).
7
+ * The shim re-exports them for next/navigation library compat (nuqs etc).
8
+ *
9
+ * Server functions import from @timber-js/app/server for ALS singleton consistency.
7
10
  */
8
11
 
9
- // Hooks (client-side — imported from public barrel for module singleton)
12
+ // Hooks re-exported for next/navigation compat
13
+ export { useSegmentParams, useSegmentParams as useParams } from '../client/use-segment-params.js';
14
+ export { useSearchParams } from '../client/use-search-params.js';
10
15
  export {
11
- useParams,
12
16
  usePathname,
13
- useSearchParams,
14
17
  useRouter,
15
18
  useSelectedLayoutSegment,
16
19
  useSelectedLayoutSegments,
17
20
  } from '@timber-js/app/client';
18
21
 
19
22
  // Functions (server-side)
20
- export { redirect, permanentRedirect, notFound, RedirectType } from '@timber-js/app/server';
23
+ export { redirect, redirectExternal, RedirectType } from '@timber-js/app/server';
24
+
25
+ // Next.js compat aliases — these are not part of timber's primary API.
26
+ // They exist so that libraries importing from 'next/navigation' still work.
27
+ export { permanentRedirect, notFound } from '../server/primitives.js';
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Tiny typed state machine utility.
3
+ *
4
+ * Enforces discriminated-union states, typed transitions with runtime
5
+ * guards, subscribe for external store integration, and assertPhase
6
+ * for function entry guards.
7
+ *
8
+ * Designed for 3–5 state consumers (stream transforms, client navigation,
9
+ * build phase sequencing). No async, no hierarchy, no history.
10
+ *
11
+ * Performance: send() is one object lookup + one function call.
12
+ * Equivalent cost to a boolean check after V8 inlining.
13
+ */
14
+
15
+ /** A state machine instance with typed state and events. */
16
+ export interface Machine<TState extends { phase: string }, TEvent extends { type: string }> {
17
+ /** Current state (discriminated union — narrowed by phase). */
18
+ readonly state: TState;
19
+
20
+ /** Transition with runtime guard. Throws on invalid source+event pair. */
21
+ send(event: TEvent): void;
22
+
23
+ /** Subscribe to state changes. Returns unsubscribe function. */
24
+ subscribe(listener: (state: TState) => void): () => void;
25
+
26
+ /** Throw if not in the expected phase. Entry guard for functions. */
27
+ assertPhase<P extends TState['phase']>(phase: P): void;
28
+ }
29
+
30
+ /**
31
+ * Transition map: `transitions[phase][eventType]` returns the next state.
32
+ *
33
+ * Each handler receives the current state (narrowed by phase context)
34
+ * and the event, returning the new state.
35
+ */
36
+ export type TransitionMap<TState extends { phase: string }, TEvent extends { type: string }> = {
37
+ [P in TState['phase']]?: {
38
+ [E in TEvent['type']]?: (
39
+ state: Extract<TState, { phase: P }>,
40
+ event: Extract<TEvent, { type: E }>
41
+ ) => TState;
42
+ };
43
+ };
44
+
45
+ export interface MachineConfig<TState extends { phase: string }, TEvent extends { type: string }> {
46
+ initial: TState;
47
+ transitions: TransitionMap<TState, TEvent>;
48
+ /** Fires after every valid transition. Use for side effects. */
49
+ onTransition?: (prev: TState, next: TState, event: TEvent) => void;
50
+ }
51
+
52
+ /**
53
+ * Create a state machine from a config.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * type State = { phase: 'idle' } | { phase: 'running'; pid: number };
58
+ * type Event = { type: 'START'; pid: number } | { type: 'STOP' };
59
+ *
60
+ * const m = createMachine<State, Event>({
61
+ * initial: { phase: 'idle' },
62
+ * transitions: {
63
+ * idle: { START: (_s, e) => ({ phase: 'running', pid: e.pid }) },
64
+ * running: { STOP: () => ({ phase: 'idle' }) },
65
+ * },
66
+ * });
67
+ * ```
68
+ */
69
+ export function createMachine<TState extends { phase: string }, TEvent extends { type: string }>(
70
+ config: MachineConfig<TState, TEvent>
71
+ ): Machine<TState, TEvent> {
72
+ let current: TState = config.initial;
73
+ const listeners = new Set<(state: TState) => void>();
74
+
75
+ return {
76
+ get state() {
77
+ return current;
78
+ },
79
+
80
+ send(event: TEvent): void {
81
+ const phaseHandlers = config.transitions[current.phase as TState['phase']];
82
+ const handler = phaseHandlers?.[event.type as TEvent['type']] as
83
+ | ((state: TState, event: TEvent) => TState)
84
+ | undefined;
85
+
86
+ if (!handler) {
87
+ throw new Error(`[state-machine] Invalid transition: ${current.phase} + ${event.type}`);
88
+ }
89
+
90
+ const prev = current;
91
+ current = handler(prev, event);
92
+
93
+ config.onTransition?.(prev, current, event);
94
+
95
+ for (const listener of listeners) {
96
+ listener(current);
97
+ }
98
+ },
99
+
100
+ subscribe(listener: (state: TState) => void): () => void {
101
+ listeners.add(listener);
102
+ return () => listeners.delete(listener);
103
+ },
104
+
105
+ assertPhase<P extends TState['phase']>(phase: P): void {
106
+ if (current.phase !== phase) {
107
+ throw new Error(`[state-machine] Expected phase "${phase}", got "${current.phase}"`);
108
+ }
109
+ },
110
+ };
111
+ }
package/LICENSE DELETED
@@ -1,8 +0,0 @@
1
- DONTFUCKINGUSE LICENSE
2
-
3
- Copyright (c) 2025 Daniel Saewitz
4
-
5
- This software may not be used, copied, modified, merged, published,
6
- distributed, sublicensed, or sold by anyone other than the copyright holder.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
@@ -1,41 +0,0 @@
1
- import { AsyncLocalStorage } from "node:async_hooks";
2
- //#region src/server/als-registry.ts
3
- /**
4
- * Centralized AsyncLocalStorage registry for server-side per-request state.
5
- *
6
- * ALL ALS instances used by the server framework live here. Individual
7
- * modules (request-context.ts, tracing.ts, actions.ts, etc.) import from
8
- * this registry and re-export public accessor functions.
9
- *
10
- * Why: ALS instances require singleton semantics — if two copies of the
11
- * same ALS exist (one from a relative import, one from a barrel import),
12
- * one module writes to its copy and another reads from an empty copy.
13
- * Centralizing ALS creation in a single module eliminates this class of bug.
14
- *
15
- * The `timber-shims` plugin ensures `@timber-js/app/server` resolves to
16
- * src/ in RSC and SSR environments, so all import paths converge here.
17
- *
18
- * DO NOT create ALS instances outside this file. If you need a new ALS,
19
- * add it here and import from `./als-registry.js` in the consuming module.
20
- *
21
- * See design/18-build-system.md §"Module Singleton Strategy" and
22
- * §"Singleton State Registry".
23
- */
24
- /** @internal — import via request-context.ts public API */
25
- var requestContextAls = new AsyncLocalStorage();
26
- /** @internal — import via tracing.ts public API */
27
- var traceAls = new AsyncLocalStorage();
28
- /** @internal — import via server-timing.ts public API */
29
- var timingAls = new AsyncLocalStorage();
30
- /** @internal — import via actions.ts public API */
31
- var revalidationAls = new AsyncLocalStorage();
32
- /** @internal — import via form-flash.ts public API */
33
- var formFlashAls = new AsyncLocalStorage();
34
- /** @internal — import via early-hints-sender.ts public API */
35
- var earlyHintsSenderAls = new AsyncLocalStorage();
36
- /** @internal — import via waituntil-bridge.ts public API */
37
- var waitUntilAls = new AsyncLocalStorage();
38
- //#endregion
39
- export { timingAls as a, revalidationAls as i, formFlashAls as n, traceAls as o, requestContextAls as r, waitUntilAls as s, earlyHintsSenderAls as t };
40
-
41
- //# sourceMappingURL=als-registry-B7DbZ2hS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"als-registry-B7DbZ2hS.js","names":[],"sources":["../../src/server/als-registry.ts"],"sourcesContent":["/**\n * Centralized AsyncLocalStorage registry for server-side per-request state.\n *\n * ALL ALS instances used by the server framework live here. Individual\n * modules (request-context.ts, tracing.ts, actions.ts, etc.) import from\n * this registry and re-export public accessor functions.\n *\n * Why: ALS instances require singleton semantics — if two copies of the\n * same ALS exist (one from a relative import, one from a barrel import),\n * one module writes to its copy and another reads from an empty copy.\n * Centralizing ALS creation in a single module eliminates this class of bug.\n *\n * The `timber-shims` plugin ensures `@timber-js/app/server` resolves to\n * src/ in RSC and SSR environments, so all import paths converge here.\n *\n * DO NOT create ALS instances outside this file. If you need a new ALS,\n * add it here and import from `./als-registry.js` in the consuming module.\n *\n * See design/18-build-system.md §\"Module Singleton Strategy\" and\n * §\"Singleton State Registry\".\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\n// ─── Request Context ──────────────────────────────────────────────────────\n// Used by: request-context.ts (headers(), cookies(), searchParams())\n// Design doc: design/04-authorization.md\n\n/** @internal — import via request-context.ts public API */\nexport const requestContextAls = new AsyncLocalStorage<RequestContextStore>();\n\nexport interface RequestContextStore {\n /** Incoming request headers (read-only view). */\n headers: Headers;\n /** Raw cookie header string, parsed lazily into a Map on first access. */\n cookieHeader: string;\n /** Lazily-parsed cookie map (mutable — reflects write-overlay from set()). */\n parsedCookies?: Map<string, string>;\n /** Original (pre-overlay) frozen headers, kept for overlay merging. */\n originalHeaders: Headers;\n /**\n * Promise resolving to the route's typed search params (when search-params.ts\n * exists) or to the raw URLSearchParams. Stored as a Promise so the framework\n * can later support partial pre-rendering where param resolution is deferred.\n */\n searchParamsPromise: Promise<URLSearchParams | Record<string, unknown>>;\n /** Outgoing Set-Cookie entries (name → serialized value + options). Last write wins. */\n cookieJar: Map<string, CookieEntry>;\n /** Whether the response has flushed (headers committed). */\n flushed: boolean;\n /** Whether the current context allows cookie mutation. */\n mutableContext: boolean;\n}\n\n/** A single outgoing cookie entry in the cookie jar. */\nexport interface CookieEntry {\n name: string;\n value: string;\n options: import('./request-context.js').CookieOptions;\n}\n\n// ─── Tracing ──────────────────────────────────────────────────────────────\n// Used by: tracing.ts (traceId(), spanId())\n// Design doc: design/17-logging.md\n\nexport interface TraceStore {\n /** 32-char lowercase hex trace ID (OTEL or UUID fallback). */\n traceId: string;\n /** OTEL span ID if available, undefined otherwise. */\n spanId?: string;\n}\n\n/** @internal — import via tracing.ts public API */\nexport const traceAls = new AsyncLocalStorage<TraceStore>();\n\n// ─── Server-Timing ────────────────────────────────────────────────────────\n// Used by: server-timing.ts (recordTiming(), withTiming())\n// Design doc: (dev-only performance instrumentation)\n\nexport interface TimingStore {\n entries: import('./server-timing.js').TimingEntry[];\n}\n\n/** @internal — import via server-timing.ts public API */\nexport const timingAls = new AsyncLocalStorage<TimingStore>();\n\n// ─── Revalidation ─────────────────────────────────────────────────────────\n// Used by: actions.ts (revalidatePath(), revalidateTag())\n// Design doc: design/08-forms-and-actions.md\n\nexport interface RevalidationState {\n /** Paths to re-render (populated by revalidatePath calls). */\n paths: string[];\n /** Tags to invalidate (populated by revalidateTag calls). */\n tags: string[];\n}\n\n/** @internal — import via actions.ts public API */\nexport const revalidationAls = new AsyncLocalStorage<RevalidationState>();\n\n// ─── Form Flash ───────────────────────────────────────────────────────────\n// Used by: form-flash.ts (getFormFlash())\n// Design doc: design/08-forms-and-actions.md §\"No-JS Error Round-Trip\"\n\n/** @internal — import via form-flash.ts public API */\nexport const formFlashAls = new AsyncLocalStorage<import('./form-flash.js').FormFlashData>();\n\n// ─── Early Hints Sender ──────────────────────────────────────────────────\n// Used by: early-hints-sender.ts (sendEarlyHints103())\n// Design doc: design/02-rendering-pipeline.md §\"Early Hints (103)\"\n\n/** Function that sends Link header values as a 103 Early Hints response. */\nexport type EarlyHintsSenderFn = (links: string[]) => void;\n\n/** @internal — import via early-hints-sender.ts public API */\nexport const earlyHintsSenderAls = new AsyncLocalStorage<EarlyHintsSenderFn>();\n\n// ─── waitUntil Bridge ────────────────────────────────────────────────────\n// Used by: waituntil-bridge.ts (waitUntil())\n// Design doc: design/11-platform.md §\"waitUntil()\"\n\n/** Function that extends the request lifecycle with a background promise. */\nexport type WaitUntilFn = (promise: Promise<unknown>) => void;\n\n/** @internal — import via waituntil-bridge.ts public API */\nexport const waitUntilAls = new AsyncLocalStorage<WaitUntilFn>();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,oBAAoB,IAAI,mBAAwC;;AA4C7E,IAAa,WAAW,IAAI,mBAA+B;;AAW3D,IAAa,YAAY,IAAI,mBAAgC;;AAc7D,IAAa,kBAAkB,IAAI,mBAAsC;;AAOzE,IAAa,eAAe,IAAI,mBAA4D;;AAU5F,IAAa,sBAAsB,IAAI,mBAAuC;;AAU9E,IAAa,eAAe,IAAI,mBAAgC"}
@@ -1,108 +0,0 @@
1
- //#region src/server/debug.ts
2
- /**
3
- * Runtime debug flag for timber.js.
4
- *
5
- * Two distinct functions for two distinct security levels:
6
- *
7
- * ## `isDebug()` — server-side logging only
8
- *
9
- * Returns true when timber's debug/warning messages should be written to
10
- * stderr / the server console. This NEVER affects what is sent to the
11
- * client (no error details, no timing headers, no stack traces).
12
- *
13
- * Active when any of:
14
- * - `NODE_ENV !== 'production'` (standard dev mode)
15
- * - `TIMBER_DEBUG` env var is set to a truthy value at runtime
16
- * - `timber.config.ts` has `debug: true`
17
- *
18
- * ## `isDevMode()` — client-visible dev behavior
19
- *
20
- * Returns true ONLY when `NODE_ENV !== 'production'`. This gates anything
21
- * that changes what clients can observe:
22
- * - Dev error pages with stack traces (fallback-error.ts)
23
- * - Detailed Server-Timing headers (pipeline.ts)
24
- * - Error messages in action INTERNAL_ERROR payloads (action-client.ts)
25
- * - Pipeline error handler wiring (Vite overlay)
26
- *
27
- * `isDevMode()` is statically replaced in production builds → the guarded
28
- * code is tree-shaken to zero bytes. TIMBER_DEBUG cannot enable it.
29
- *
30
- * Usage:
31
- * In Cloudflare Workers wrangler.toml:
32
- * [vars]
33
- * TIMBER_DEBUG = "1"
34
- *
35
- * In Node.js:
36
- * TIMBER_DEBUG=1 node server.js
37
- *
38
- * In timber.config.ts:
39
- * export default { debug: true }
40
- *
41
- * See design/13-security.md for the security taxonomy.
42
- * See design/18-build-system.md for build pipeline details.
43
- */
44
- /**
45
- * Check if the application is running in development mode.
46
- *
47
- * This is the ONLY function that should gate client-visible dev behavior:
48
- * - Dev error pages with stack traces
49
- * - Detailed Server-Timing response headers
50
- * - Error messages in action `INTERNAL_ERROR` payloads
51
- * - Pipeline error handler wiring (Vite overlay)
52
- *
53
- * Returns `process.env.NODE_ENV !== 'production'`, which is statically
54
- * replaced by the bundler in production builds. Code guarded by this
55
- * function is tree-shaken to zero bytes in production.
56
- *
57
- * TIMBER_DEBUG does NOT enable this — that would leak server internals
58
- * to clients. Use `isDebug()` for server-side-only logging.
59
- */
60
- function isDevMode() {
61
- return process.env.NODE_ENV !== "production";
62
- }
63
- /**
64
- * Config-level debug override. Set via `setDebugFromConfig()` during
65
- * initialization when timber.config.ts has `debug: true`.
66
- */
67
- var _configDebug = false;
68
- /**
69
- * Check if timber debug logging is active (server-side only).
70
- *
71
- * Returns true if ANY of these conditions hold:
72
- * - NODE_ENV is not 'production' (standard dev mode)
73
- * - TIMBER_DEBUG environment variable is set to a truthy value at runtime
74
- * - timber.config.ts has `debug: true`
75
- *
76
- * This function controls ONLY server-side logging — messages written to
77
- * stderr or the server console. It NEVER affects client-visible behavior
78
- * (error pages, response headers, action payloads). For client-visible
79
- * behavior, use `isDevMode()`.
80
- *
81
- * The TIMBER_DEBUG check is deliberately written as a dynamic property
82
- * access so bundlers cannot statically replace it.
83
- */
84
- function isDebug() {
85
- if (process.env.NODE_ENV !== "production") return true;
86
- if (_configDebug) return true;
87
- return _readTimberDebugEnv();
88
- }
89
- /**
90
- * Read TIMBER_DEBUG from the environment at runtime.
91
- *
92
- * Extracted to a separate function to:
93
- * 1. Prevent bundler inlining (cross-module function calls are not inlined)
94
- * 2. Handle platforms where `process` may not exist (Cloudflare Workers)
95
- * 3. Support globalThis.__TIMBER_DEBUG for programmatic control
96
- */
97
- function _readTimberDebugEnv() {
98
- if (globalThis.__TIMBER_DEBUG) return true;
99
- try {
100
- const val = typeof process !== "undefined" && process.env ? process.env["TIMBER_DEBUG"] : void 0;
101
- if (val && val !== "0" && val !== "false") return true;
102
- } catch {}
103
- return false;
104
- }
105
- //#endregion
106
- export { isDevMode as n, isDebug as t };
107
-
108
- //# sourceMappingURL=debug-gwlJkDuf.js.map