@timber-js/app 0.1.0

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 (310) hide show
  1. package/bin/timber.mjs +5 -0
  2. package/dist/_chunks/error-boundary-dj-WO5uq.js +121 -0
  3. package/dist/_chunks/error-boundary-dj-WO5uq.js.map +1 -0
  4. package/dist/_chunks/format-DNt20Kt8.js +163 -0
  5. package/dist/_chunks/format-DNt20Kt8.js.map +1 -0
  6. package/dist/_chunks/interception-DIaZN1bF.js +669 -0
  7. package/dist/_chunks/interception-DIaZN1bF.js.map +1 -0
  8. package/dist/_chunks/metadata-routes-BDnswgRO.js +141 -0
  9. package/dist/_chunks/metadata-routes-BDnswgRO.js.map +1 -0
  10. package/dist/_chunks/registry-DUIpYD_x.js +20 -0
  11. package/dist/_chunks/registry-DUIpYD_x.js.map +1 -0
  12. package/dist/_chunks/request-context-D6XHINkR.js +330 -0
  13. package/dist/_chunks/request-context-D6XHINkR.js.map +1 -0
  14. package/dist/_chunks/tracing-BtOwb8O6.js +174 -0
  15. package/dist/_chunks/tracing-BtOwb8O6.js.map +1 -0
  16. package/dist/_chunks/use-cookie-8ZlA0rr3.js +125 -0
  17. package/dist/_chunks/use-cookie-8ZlA0rr3.js.map +1 -0
  18. package/dist/adapters/cloudflare.d.ts +92 -0
  19. package/dist/adapters/cloudflare.d.ts.map +1 -0
  20. package/dist/adapters/cloudflare.js +188 -0
  21. package/dist/adapters/cloudflare.js.map +1 -0
  22. package/dist/adapters/nitro.d.ts +72 -0
  23. package/dist/adapters/nitro.d.ts.map +1 -0
  24. package/dist/adapters/nitro.js +217 -0
  25. package/dist/adapters/nitro.js.map +1 -0
  26. package/dist/adapters/types.d.ts +53 -0
  27. package/dist/adapters/types.d.ts.map +1 -0
  28. package/dist/cache/index.d.ts +52 -0
  29. package/dist/cache/index.d.ts.map +1 -0
  30. package/dist/cache/index.js +283 -0
  31. package/dist/cache/index.js.map +1 -0
  32. package/dist/cache/redis-handler.d.ts +45 -0
  33. package/dist/cache/redis-handler.d.ts.map +1 -0
  34. package/dist/cache/register-cached-function.d.ts +17 -0
  35. package/dist/cache/register-cached-function.d.ts.map +1 -0
  36. package/dist/cache/singleflight.d.ts +11 -0
  37. package/dist/cache/singleflight.d.ts.map +1 -0
  38. package/dist/cache/stable-stringify.d.ts +7 -0
  39. package/dist/cache/stable-stringify.d.ts.map +1 -0
  40. package/dist/cache/timber-cache.d.ts +21 -0
  41. package/dist/cache/timber-cache.d.ts.map +1 -0
  42. package/dist/cli.d.ts +44 -0
  43. package/dist/cli.d.ts.map +1 -0
  44. package/dist/cli.js +135 -0
  45. package/dist/cli.js.map +1 -0
  46. package/dist/client/browser-entry.d.ts +22 -0
  47. package/dist/client/browser-entry.d.ts.map +1 -0
  48. package/dist/client/error-boundary.d.ts +42 -0
  49. package/dist/client/error-boundary.d.ts.map +1 -0
  50. package/dist/client/form.d.ts +115 -0
  51. package/dist/client/form.d.ts.map +1 -0
  52. package/dist/client/head.d.ts +16 -0
  53. package/dist/client/head.d.ts.map +1 -0
  54. package/dist/client/history.d.ts +29 -0
  55. package/dist/client/history.d.ts.map +1 -0
  56. package/dist/client/index.d.ts +32 -0
  57. package/dist/client/index.d.ts.map +1 -0
  58. package/dist/client/index.js +1218 -0
  59. package/dist/client/index.js.map +1 -0
  60. package/dist/client/link-navigate-interceptor.d.ts +28 -0
  61. package/dist/client/link-navigate-interceptor.d.ts.map +1 -0
  62. package/dist/client/link-status-provider.d.ts +11 -0
  63. package/dist/client/link-status-provider.d.ts.map +1 -0
  64. package/dist/client/link.d.ts +119 -0
  65. package/dist/client/link.d.ts.map +1 -0
  66. package/dist/client/nuqs-adapter.d.ts +11 -0
  67. package/dist/client/nuqs-adapter.d.ts.map +1 -0
  68. package/dist/client/router-ref.d.ts +11 -0
  69. package/dist/client/router-ref.d.ts.map +1 -0
  70. package/dist/client/router.d.ts +85 -0
  71. package/dist/client/router.d.ts.map +1 -0
  72. package/dist/client/segment-cache.d.ts +88 -0
  73. package/dist/client/segment-cache.d.ts.map +1 -0
  74. package/dist/client/segment-context.d.ts +32 -0
  75. package/dist/client/segment-context.d.ts.map +1 -0
  76. package/dist/client/ssr-data.d.ts +64 -0
  77. package/dist/client/ssr-data.d.ts.map +1 -0
  78. package/dist/client/types.d.ts +5 -0
  79. package/dist/client/types.d.ts.map +1 -0
  80. package/dist/client/unload-guard.d.ts +18 -0
  81. package/dist/client/unload-guard.d.ts.map +1 -0
  82. package/dist/client/use-cookie.d.ts +37 -0
  83. package/dist/client/use-cookie.d.ts.map +1 -0
  84. package/dist/client/use-link-status.d.ts +35 -0
  85. package/dist/client/use-link-status.d.ts.map +1 -0
  86. package/dist/client/use-navigation-pending.d.ts +26 -0
  87. package/dist/client/use-navigation-pending.d.ts.map +1 -0
  88. package/dist/client/use-params.d.ts +50 -0
  89. package/dist/client/use-params.d.ts.map +1 -0
  90. package/dist/client/use-pathname.d.ts +20 -0
  91. package/dist/client/use-pathname.d.ts.map +1 -0
  92. package/dist/client/use-query-states.d.ts +36 -0
  93. package/dist/client/use-query-states.d.ts.map +1 -0
  94. package/dist/client/use-router.d.ts +39 -0
  95. package/dist/client/use-router.d.ts.map +1 -0
  96. package/dist/client/use-search-params.d.ts +24 -0
  97. package/dist/client/use-search-params.d.ts.map +1 -0
  98. package/dist/client/use-selected-layout-segment.d.ts +68 -0
  99. package/dist/client/use-selected-layout-segment.d.ts.map +1 -0
  100. package/dist/content/index.d.ts +11 -0
  101. package/dist/content/index.d.ts.map +1 -0
  102. package/dist/content/index.js +2 -0
  103. package/dist/cookies/define-cookie.d.ts +61 -0
  104. package/dist/cookies/define-cookie.d.ts.map +1 -0
  105. package/dist/cookies/index.d.ts +3 -0
  106. package/dist/cookies/index.d.ts.map +1 -0
  107. package/dist/cookies/index.js +82 -0
  108. package/dist/cookies/index.js.map +1 -0
  109. package/dist/fonts/ast.d.ts +38 -0
  110. package/dist/fonts/ast.d.ts.map +1 -0
  111. package/dist/fonts/css.d.ts +43 -0
  112. package/dist/fonts/css.d.ts.map +1 -0
  113. package/dist/fonts/fallbacks.d.ts +36 -0
  114. package/dist/fonts/fallbacks.d.ts.map +1 -0
  115. package/dist/fonts/google.d.ts +122 -0
  116. package/dist/fonts/google.d.ts.map +1 -0
  117. package/dist/fonts/local.d.ts +76 -0
  118. package/dist/fonts/local.d.ts.map +1 -0
  119. package/dist/fonts/types.d.ts +85 -0
  120. package/dist/fonts/types.d.ts.map +1 -0
  121. package/dist/index.d.ts +150 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +14701 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/plugins/adapter-build.d.ts +18 -0
  126. package/dist/plugins/adapter-build.d.ts.map +1 -0
  127. package/dist/plugins/build-manifest.d.ts +79 -0
  128. package/dist/plugins/build-manifest.d.ts.map +1 -0
  129. package/dist/plugins/build-report.d.ts +63 -0
  130. package/dist/plugins/build-report.d.ts.map +1 -0
  131. package/dist/plugins/cache-transform.d.ts +36 -0
  132. package/dist/plugins/cache-transform.d.ts.map +1 -0
  133. package/dist/plugins/chunks.d.ts +45 -0
  134. package/dist/plugins/chunks.d.ts.map +1 -0
  135. package/dist/plugins/content.d.ts +19 -0
  136. package/dist/plugins/content.d.ts.map +1 -0
  137. package/dist/plugins/dev-error-overlay.d.ts +60 -0
  138. package/dist/plugins/dev-error-overlay.d.ts.map +1 -0
  139. package/dist/plugins/dev-logs.d.ts +46 -0
  140. package/dist/plugins/dev-logs.d.ts.map +1 -0
  141. package/dist/plugins/dev-server.d.ts +22 -0
  142. package/dist/plugins/dev-server.d.ts.map +1 -0
  143. package/dist/plugins/dynamic-transform.d.ts +72 -0
  144. package/dist/plugins/dynamic-transform.d.ts.map +1 -0
  145. package/dist/plugins/entries.d.ts +21 -0
  146. package/dist/plugins/entries.d.ts.map +1 -0
  147. package/dist/plugins/fonts.d.ts +77 -0
  148. package/dist/plugins/fonts.d.ts.map +1 -0
  149. package/dist/plugins/mdx.d.ts +21 -0
  150. package/dist/plugins/mdx.d.ts.map +1 -0
  151. package/dist/plugins/react-prod.d.ts +18 -0
  152. package/dist/plugins/react-prod.d.ts.map +1 -0
  153. package/dist/plugins/routing.d.ts +13 -0
  154. package/dist/plugins/routing.d.ts.map +1 -0
  155. package/dist/plugins/server-action-exports.d.ts +26 -0
  156. package/dist/plugins/server-action-exports.d.ts.map +1 -0
  157. package/dist/plugins/server-bundle.d.ts +15 -0
  158. package/dist/plugins/server-bundle.d.ts.map +1 -0
  159. package/dist/plugins/shims.d.ts +18 -0
  160. package/dist/plugins/shims.d.ts.map +1 -0
  161. package/dist/plugins/static-build.d.ts +55 -0
  162. package/dist/plugins/static-build.d.ts.map +1 -0
  163. package/dist/routing/codegen.d.ts +29 -0
  164. package/dist/routing/codegen.d.ts.map +1 -0
  165. package/dist/routing/index.d.ts +8 -0
  166. package/dist/routing/index.d.ts.map +1 -0
  167. package/dist/routing/index.js +2 -0
  168. package/dist/routing/interception.d.ts +46 -0
  169. package/dist/routing/interception.d.ts.map +1 -0
  170. package/dist/routing/scanner.d.ts +28 -0
  171. package/dist/routing/scanner.d.ts.map +1 -0
  172. package/dist/routing/status-file-lint.d.ts +33 -0
  173. package/dist/routing/status-file-lint.d.ts.map +1 -0
  174. package/dist/routing/types.d.ts +81 -0
  175. package/dist/routing/types.d.ts.map +1 -0
  176. package/dist/search-params/analyze.d.ts +54 -0
  177. package/dist/search-params/analyze.d.ts.map +1 -0
  178. package/dist/search-params/codecs.d.ts +53 -0
  179. package/dist/search-params/codecs.d.ts.map +1 -0
  180. package/dist/search-params/create.d.ts +106 -0
  181. package/dist/search-params/create.d.ts.map +1 -0
  182. package/dist/search-params/index.d.ts +7 -0
  183. package/dist/search-params/index.d.ts.map +1 -0
  184. package/dist/search-params/index.js +300 -0
  185. package/dist/search-params/index.js.map +1 -0
  186. package/dist/search-params/registry.d.ts +20 -0
  187. package/dist/search-params/registry.d.ts.map +1 -0
  188. package/dist/server/access-gate.d.ts +42 -0
  189. package/dist/server/access-gate.d.ts.map +1 -0
  190. package/dist/server/action-client.d.ts +190 -0
  191. package/dist/server/action-client.d.ts.map +1 -0
  192. package/dist/server/action-handler.d.ts +48 -0
  193. package/dist/server/action-handler.d.ts.map +1 -0
  194. package/dist/server/actions.d.ts +108 -0
  195. package/dist/server/actions.d.ts.map +1 -0
  196. package/dist/server/asset-headers.d.ts +42 -0
  197. package/dist/server/asset-headers.d.ts.map +1 -0
  198. package/dist/server/body-limits.d.ts +30 -0
  199. package/dist/server/body-limits.d.ts.map +1 -0
  200. package/dist/server/build-manifest.d.ts +120 -0
  201. package/dist/server/build-manifest.d.ts.map +1 -0
  202. package/dist/server/canonicalize.d.ts +30 -0
  203. package/dist/server/canonicalize.d.ts.map +1 -0
  204. package/dist/server/client-module-map.d.ts +47 -0
  205. package/dist/server/client-module-map.d.ts.map +1 -0
  206. package/dist/server/csrf.d.ts +34 -0
  207. package/dist/server/csrf.d.ts.map +1 -0
  208. package/dist/server/deny-renderer.d.ts +49 -0
  209. package/dist/server/deny-renderer.d.ts.map +1 -0
  210. package/dist/server/dev-logger.d.ts +44 -0
  211. package/dist/server/dev-logger.d.ts.map +1 -0
  212. package/dist/server/dev-span-processor.d.ts +29 -0
  213. package/dist/server/dev-span-processor.d.ts.map +1 -0
  214. package/dist/server/dev-warnings.d.ts +129 -0
  215. package/dist/server/dev-warnings.d.ts.map +1 -0
  216. package/dist/server/early-hints-sender.d.ts +38 -0
  217. package/dist/server/early-hints-sender.d.ts.map +1 -0
  218. package/dist/server/early-hints.d.ts +83 -0
  219. package/dist/server/early-hints.d.ts.map +1 -0
  220. package/dist/server/error-boundary-wrapper.d.ts +17 -0
  221. package/dist/server/error-boundary-wrapper.d.ts.map +1 -0
  222. package/dist/server/error-formatter.d.ts +17 -0
  223. package/dist/server/error-formatter.d.ts.map +1 -0
  224. package/dist/server/flush.d.ts +74 -0
  225. package/dist/server/flush.d.ts.map +1 -0
  226. package/dist/server/form-data.d.ts +60 -0
  227. package/dist/server/form-data.d.ts.map +1 -0
  228. package/dist/server/form-flash.d.ts +78 -0
  229. package/dist/server/form-flash.d.ts.map +1 -0
  230. package/dist/server/html-injectors.d.ts +101 -0
  231. package/dist/server/html-injectors.d.ts.map +1 -0
  232. package/dist/server/index.d.ts +54 -0
  233. package/dist/server/index.d.ts.map +1 -0
  234. package/dist/server/index.js +2925 -0
  235. package/dist/server/index.js.map +1 -0
  236. package/dist/server/instrumentation.d.ts +61 -0
  237. package/dist/server/instrumentation.d.ts.map +1 -0
  238. package/dist/server/logger.d.ts +83 -0
  239. package/dist/server/logger.d.ts.map +1 -0
  240. package/dist/server/manifest-status-resolver.d.ts +58 -0
  241. package/dist/server/manifest-status-resolver.d.ts.map +1 -0
  242. package/dist/server/metadata-render.d.ts +20 -0
  243. package/dist/server/metadata-render.d.ts.map +1 -0
  244. package/dist/server/metadata-routes.d.ts +67 -0
  245. package/dist/server/metadata-routes.d.ts.map +1 -0
  246. package/dist/server/metadata.d.ts +67 -0
  247. package/dist/server/metadata.d.ts.map +1 -0
  248. package/dist/server/middleware-runner.d.ts +21 -0
  249. package/dist/server/middleware-runner.d.ts.map +1 -0
  250. package/dist/server/nuqs-ssr-provider.d.ts +28 -0
  251. package/dist/server/nuqs-ssr-provider.d.ts.map +1 -0
  252. package/dist/server/pipeline.d.ts +81 -0
  253. package/dist/server/pipeline.d.ts.map +1 -0
  254. package/dist/server/prerender.d.ts +77 -0
  255. package/dist/server/prerender.d.ts.map +1 -0
  256. package/dist/server/primitives.d.ts +131 -0
  257. package/dist/server/primitives.d.ts.map +1 -0
  258. package/dist/server/proxy.d.ts +23 -0
  259. package/dist/server/proxy.d.ts.map +1 -0
  260. package/dist/server/request-context.d.ts +175 -0
  261. package/dist/server/request-context.d.ts.map +1 -0
  262. package/dist/server/route-element-builder.d.ts +66 -0
  263. package/dist/server/route-element-builder.d.ts.map +1 -0
  264. package/dist/server/route-handler.d.ts +35 -0
  265. package/dist/server/route-handler.d.ts.map +1 -0
  266. package/dist/server/route-matcher.d.ts +78 -0
  267. package/dist/server/route-matcher.d.ts.map +1 -0
  268. package/dist/server/rsc-entry/api-handler.d.ts +11 -0
  269. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -0
  270. package/dist/server/rsc-entry/error-renderer.d.ts +30 -0
  271. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -0
  272. package/dist/server/rsc-entry/helpers.d.ts +73 -0
  273. package/dist/server/rsc-entry/helpers.d.ts.map +1 -0
  274. package/dist/server/rsc-entry/index.d.ts +11 -0
  275. package/dist/server/rsc-entry/index.d.ts.map +1 -0
  276. package/dist/server/rsc-entry/ssr-bridge.d.ts +6 -0
  277. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -0
  278. package/dist/server/slot-resolver.d.ts +34 -0
  279. package/dist/server/slot-resolver.d.ts.map +1 -0
  280. package/dist/server/ssr-entry.d.ts +73 -0
  281. package/dist/server/ssr-entry.d.ts.map +1 -0
  282. package/dist/server/ssr-render.d.ts +67 -0
  283. package/dist/server/ssr-render.d.ts.map +1 -0
  284. package/dist/server/status-code-resolver.d.ts +77 -0
  285. package/dist/server/status-code-resolver.d.ts.map +1 -0
  286. package/dist/server/tracing.d.ts +99 -0
  287. package/dist/server/tracing.d.ts.map +1 -0
  288. package/dist/server/tree-builder.d.ts +116 -0
  289. package/dist/server/tree-builder.d.ts.map +1 -0
  290. package/dist/server/types.d.ts +231 -0
  291. package/dist/server/types.d.ts.map +1 -0
  292. package/dist/shims/font-google.d.ts +41 -0
  293. package/dist/shims/font-google.d.ts.map +1 -0
  294. package/dist/shims/headers.d.ts +11 -0
  295. package/dist/shims/headers.d.ts.map +1 -0
  296. package/dist/shims/image.d.ts +328 -0
  297. package/dist/shims/image.d.ts.map +1 -0
  298. package/dist/shims/link.d.ts +9 -0
  299. package/dist/shims/link.d.ts.map +1 -0
  300. package/dist/shims/navigation-client.d.ts +25 -0
  301. package/dist/shims/navigation-client.d.ts.map +1 -0
  302. package/dist/shims/navigation.d.ts +25 -0
  303. package/dist/shims/navigation.d.ts.map +1 -0
  304. package/dist/utils/directive-parser.d.ts +70 -0
  305. package/dist/utils/directive-parser.d.ts.map +1 -0
  306. package/dist/utils/format.d.ts +6 -0
  307. package/dist/utils/format.d.ts.map +1 -0
  308. package/dist/utils/startup-timer.d.ts +34 -0
  309. package/dist/utils/startup-timer.d.ts.map +1 -0
  310. package/package.json +140 -0
@@ -0,0 +1,18 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Redirect React's CJS development bundles to production bundles.
4
+ *
5
+ * React packages use a runtime `process.env.NODE_ENV` check in their CJS
6
+ * entry points to conditionally require either `*.development.js` or
7
+ * `*.production.js`. Rollup's CJS plugin resolves both branches statically
8
+ * before the `define` replacement can eliminate the dead branch, causing
9
+ * development React code to be included in production builds.
10
+ *
11
+ * This plugin intercepts `resolveId` and rewrites any `*.development.js`
12
+ * import under `react/cjs/`, `react-dom/cjs/`, or `scheduler/cjs/` to
13
+ * its `*.production.js` counterpart.
14
+ *
15
+ * Only active in production builds. Has no effect in dev mode.
16
+ */
17
+ export declare function timberReactProd(): Plugin;
18
+ //# sourceMappingURL=react-prod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-prod.d.ts","sourceRoot":"","sources":["../../src/plugins/react-prod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAsCxC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * timber-routing — Vite sub-plugin for route manifest generation.
3
+ *
4
+ * Bridges the route scanner with Vite's module graph. Scans app/ at startup,
5
+ * watches for file changes in dev, and serves the virtual:timber-route-manifest
6
+ * module that entry files consume.
7
+ *
8
+ * Design docs: 18-build-system.md §"Virtual Modules", 07-routing.md
9
+ */
10
+ import type { Plugin } from 'vite';
11
+ import type { PluginContext } from '#/index.js';
12
+ export declare function timberRouting(ctx: PluginContext): Plugin;
13
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/plugins/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA2DhD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA2GxD"}
@@ -0,0 +1,26 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Rewrite 'use server' module exports to bypass RSC plugin AST validation.
4
+ *
5
+ * The RSC plugin's client/SSR proxy transform (transformProxyExport) requires
6
+ * all `export const` initializers to be `async ArrowFunctionExpression`. But
7
+ * `createActionClient().action()` and `validated()` return async functions via
8
+ * CallExpressions — valid at runtime but rejected by the static AST check.
9
+ *
10
+ * This plugin rewrites non-function-expression exports from:
11
+ *
12
+ * export const foo = someCall();
13
+ *
14
+ * to:
15
+ *
16
+ * const foo = someCall();
17
+ * export { foo };
18
+ *
19
+ * The `export { name }` form bypasses the RSC plugin's validation without
20
+ * changing runtime semantics. Function expression exports (async arrows,
21
+ * async function expressions) are left untouched.
22
+ *
23
+ * See design/08-forms-and-actions.md §"Middleware for Server Actions"
24
+ */
25
+ export declare function timberServerActionExports(): Plugin;
26
+ //# sourceMappingURL=server-action-exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-action-exports.d.ts","sourceRoot":"","sources":["../../src/plugins/server-action-exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAOnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAelD"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * timber-server-bundle — Bundle all dependencies for server environments.
3
+ *
4
+ * In production builds, sets `resolve.noExternal: true` for the rsc and ssr
5
+ * environments. This ensures all npm dependencies are bundled into the output,
6
+ * which is required for platforms like Cloudflare Workers that don't have
7
+ * access to node_modules at runtime.
8
+ *
9
+ * In dev mode, Vite's default externalization is preserved for fast HMR.
10
+ *
11
+ * Design docs: design/11-platform.md, design/25-production-deployments.md
12
+ */
13
+ import type { Plugin } from 'vite';
14
+ export declare function timberServerBundle(): Plugin[];
15
+ //# sourceMappingURL=server-bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/server-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAiG7C"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * timber-shims — Vite sub-plugin for next/* → timber shim resolution.
3
+ *
4
+ * Intercepts imports of next/* modules and redirects them to timber.js
5
+ * shim implementations. This enables Next.js-compatible libraries
6
+ * (nuqs, next-intl, etc.) to work unmodified.
7
+ *
8
+ * Design doc: 18-build-system.md §"Shim Map"
9
+ */
10
+ import type { Plugin } from 'vite';
11
+ import type { PluginContext } from '#/index.js';
12
+ /**
13
+ * Create the timber-shims Vite plugin.
14
+ *
15
+ * Hooks: resolveId, load
16
+ */
17
+ export declare function timberShims(_ctx: PluginContext): Plugin;
18
+ //# sourceMappingURL=shims.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../../src/plugins/shims.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoEhD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAiFvD"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * timber-static-build — Vite sub-plugin for static output mode.
3
+ *
4
+ * When `output: 'static'` is set in timber.config.ts, this plugin:
5
+ * 1. Validates that no dynamic APIs (cookies(), headers()) are used
6
+ * 2. When client JavaScript is disabled, rejects 'use client' and 'use server' directives
7
+ * 3. Coordinates build-time rendering of all pages
8
+ *
9
+ * Design doc: design/15-future-prerendering.md
10
+ */
11
+ import type { Plugin } from 'vite';
12
+ import type { PluginContext } from '#/index.js';
13
+ export interface StaticValidationError {
14
+ type: 'dynamic-api' | 'nojs-directive';
15
+ file: string;
16
+ message: string;
17
+ line?: number;
18
+ }
19
+ export interface StaticOptions {
20
+ clientJavascriptDisabled: boolean;
21
+ }
22
+ /**
23
+ * Detect usage of dynamic per-request APIs (cookies(), headers())
24
+ * that cannot work at build time in static mode.
25
+ *
26
+ * Returns an array of validation errors.
27
+ */
28
+ export declare function detectDynamicApis(code: string, fileId: string): StaticValidationError[];
29
+ /**
30
+ * Detect 'use client' and 'use server' directives using AST-based parsing.
31
+ * When client JavaScript is disabled, both are hard build errors — no React
32
+ * runtime or server actions are allowed in the output.
33
+ *
34
+ * When client JavaScript is enabled, these are allowed (client components
35
+ * hydrate, server actions get extracted to API endpoints).
36
+ */
37
+ export declare function detectDirectives(code: string, fileId: string, options: StaticOptions): StaticValidationError[];
38
+ /**
39
+ * Run all static mode validations on a source file.
40
+ *
41
+ * Combines:
42
+ * - Dynamic API detection (cookies, headers) — always in static mode
43
+ * - Directive detection ('use client', 'use server') — only when client JS is disabled
44
+ */
45
+ export declare function validateStaticMode(code: string, fileId: string, options: StaticOptions): StaticValidationError[];
46
+ /**
47
+ * Create the timber-static-build Vite plugin.
48
+ *
49
+ * Only active when output: 'static' is configured.
50
+ *
51
+ * Hooks:
52
+ * - transform: Validates source files for static mode violations
53
+ */
54
+ export declare function timberStaticBuild(ctx: PluginContext): Plugin;
55
+ //# sourceMappingURL=static-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-build.d.ts","sourceRoot":"","sources":["../../src/plugins/static-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,aAAa,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,wBAAwB,EAAE,OAAO,CAAC;CACnC;AAiBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,CA2BvF;AAMD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,qBAAqB,EAAE,CA8BzB;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,qBAAqB,EAAE,CAOzB;AAMD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0C5D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Route map codegen.
3
+ *
4
+ * Walks the scanned RouteTree and generates a TypeScript declaration file
5
+ * mapping every route to its params and searchParams shapes.
6
+ *
7
+ * This runs at build time and in dev (regenerated on file changes).
8
+ * No runtime overhead — purely static type generation.
9
+ */
10
+ import type { RouteTree } from './types.js';
11
+ /** Options for route map generation. */
12
+ export interface CodegenOptions {
13
+ /** Absolute path to the app/ directory. Required for search-params.ts detection. */
14
+ appDir?: string;
15
+ /**
16
+ * Absolute path to the directory where the .d.ts file will be written.
17
+ * Used to compute correct relative import paths for search-params.ts files.
18
+ * Defaults to appDir when not provided (preserves backward compat for tests).
19
+ */
20
+ outputDir?: string;
21
+ }
22
+ /**
23
+ * Generate a TypeScript declaration file string from a scanned route tree.
24
+ *
25
+ * The output is a `declare module '@timber/app'` block containing the Routes
26
+ * interface that maps every route path to its params and searchParams shape.
27
+ */
28
+ export declare function generateRouteMap(tree: RouteTree, options?: CodegenOptions): string;
29
+ //# sourceMappingURL=codegen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/routing/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAqBzD,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,CAWtF"}
@@ -0,0 +1,8 @@
1
+ export { scanRoutes, classifySegment } from './scanner.js';
2
+ export { generateRouteMap } from './codegen.js';
3
+ export type { CodegenOptions } from './codegen.js';
4
+ export type { RouteTree, SegmentNode, SegmentType, RouteFile, ScannerConfig, InterceptionMarker, } from './types.js';
5
+ export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS } from './types.js';
6
+ export { collectInterceptionRewrites } from './interception.js';
7
+ export type { InterceptionRewrite } from './interception.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { a as DEFAULT_PAGE_EXTENSIONS, i as scanRoutes, n as generateRouteMap, o as INTERCEPTION_MARKERS, r as classifySegment, t as collectInterceptionRewrites } from "../_chunks/interception-DIaZN1bF.js";
2
+ export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, collectInterceptionRewrites, generateRouteMap, scanRoutes };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Intercepting route utilities.
3
+ *
4
+ * Computes rewrite rules from the route tree that enable intercepting routes
5
+ * to conditionally render when navigating via client-side (soft) navigation.
6
+ *
7
+ * The mechanism: at build time, each intercepting route directory generates a
8
+ * conditional rewrite. On soft navigation, the client sends an `X-Timber-URL`
9
+ * header with the current pathname. The server checks if any rewrite's source
10
+ * (the intercepted URL) matches the target pathname AND the header matches
11
+ * the intercepting route's parent URL. If both match, the intercepting route
12
+ * renders instead of the normal route.
13
+ *
14
+ * On hard navigation (no header), no rewrite matches, and the normal route
15
+ * renders.
16
+ *
17
+ * See design/07-routing.md §"Intercepting Routes"
18
+ */
19
+ import type { SegmentNode } from './types.js';
20
+ /** A conditional rewrite rule generated from an intercepting route. */
21
+ export interface InterceptionRewrite {
22
+ /**
23
+ * The URL pattern that this rewrite intercepts (the target of navigation).
24
+ * E.g., "/photo/[id]" for a (.)photo/[id] interception.
25
+ */
26
+ interceptedPattern: string;
27
+ /**
28
+ * The URL prefix that the client must be navigating FROM for this rewrite
29
+ * to apply. Matched against the X-Timber-URL header.
30
+ * E.g., "/feed" for a (.)photo/[id] inside /feed/@modal/.
31
+ */
32
+ interceptingPrefix: string;
33
+ /**
34
+ * Segments chain from root → intercepting leaf. Used to build the element
35
+ * tree when the interception is active.
36
+ */
37
+ segmentPath: SegmentNode[];
38
+ }
39
+ /**
40
+ * Collect all interception rewrite rules from the route tree.
41
+ *
42
+ * Walks the tree recursively. For each intercepting segment, computes the
43
+ * intercepted URL based on the marker and the segment's position.
44
+ */
45
+ export declare function collectInterceptionRewrites(root: SegmentNode): InterceptionRewrite[];
46
+ //# sourceMappingURL=interception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interception.d.ts","sourceRoot":"","sources":["../../src/routing/interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,YAAY,CAAC;AAElE,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,WAAW,EAAE,WAAW,EAAE,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAIpF"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Route discovery scanner.
3
+ *
4
+ * Pure function: (appDir, config) → RouteTree
5
+ *
6
+ * Scans the app/ directory and builds a segment tree recognizing all
7
+ * timber.js file conventions. Does NOT handle request matching — this
8
+ * is discovery only.
9
+ */
10
+ import type { RouteTree, SegmentType, ScannerConfig, InterceptionMarker } from './types.js';
11
+ /**
12
+ * Scan the app/ directory and build the route tree.
13
+ *
14
+ * @param appDir - Absolute path to the app/ directory
15
+ * @param config - Scanner configuration
16
+ * @returns The complete route tree
17
+ */
18
+ export declare function scanRoutes(appDir: string, config?: ScannerConfig): RouteTree;
19
+ /**
20
+ * Classify a directory name into its segment type.
21
+ */
22
+ export declare function classifySegment(dirName: string): {
23
+ type: SegmentType;
24
+ paramName?: string;
25
+ interceptionMarker?: InterceptionMarker;
26
+ interceptedSegmentName?: string;
27
+ };
28
+ //# sourceMappingURL=scanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/routing/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,SAAS,EAET,WAAW,EAEX,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AA6CpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,SAAS,CAwBhF;AAyBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAChD,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CA8CA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Lint status files and error.tsx for missing 'use client' directive.
3
+ *
4
+ * Status files (error.tsx, 404.tsx, 4xx.tsx, 5xx.tsx, NNN.tsx) and legacy
5
+ * compat files (not-found.tsx, forbidden.tsx, unauthorized.tsx) are passed
6
+ * as fallbackComponent to TimberErrorBoundary — a 'use client' component.
7
+ * RSC forbids passing server component functions as props to client
8
+ * components, causing a hard-to-debug runtime error.
9
+ *
10
+ * This module provides a build/dev-time check that warns when these files
11
+ * are missing the 'use client' directive.
12
+ *
13
+ * See design/10-error-handling.md §"Status-Code Files".
14
+ */
15
+ import type { RouteTree } from './types.js';
16
+ export interface StatusFileLintWarning {
17
+ filePath: string;
18
+ fileType: string;
19
+ }
20
+ /**
21
+ * Walk the route tree and check all status files and error files for
22
+ * the 'use client' directive. Returns an array of warnings for files
23
+ * that are missing it.
24
+ *
25
+ * MDX and JSON status files are excluded — MDX files are server components
26
+ * by design, and JSON files are data, not components.
27
+ */
28
+ export declare function lintStatusFileDirectives(tree: RouteTree): StatusFileLintWarning[];
29
+ /**
30
+ * Format warnings into human-readable console output.
31
+ */
32
+ export declare function formatStatusFileLintWarnings(warnings: StatusFileLintWarning[]): string;
33
+ //# sourceMappingURL=status-file-lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-file-lint.d.ts","sourceRoot":"","sources":["../../src/routing/status-file-lint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAMzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,EAAE,CAIjF;AAoDD;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAmBtF"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Route tree types for timber.js file-system routing.
3
+ *
4
+ * The route tree is built by scanning the app/ directory and recognizing
5
+ * file conventions (page.*, layout.*, middleware.ts, access.ts, route.ts, etc.).
6
+ */
7
+ /** Segment type classification */
8
+ export type SegmentType = 'static' | 'dynamic' | 'catch-all' | 'optional-catch-all' | 'group' | 'slot' | 'intercepting' | 'private';
9
+ /**
10
+ * Intercepting route marker — indicates how many levels up to resolve the
11
+ * intercepted route from the intercepting route's location.
12
+ *
13
+ * See design/07-routing.md §"Intercepting Routes"
14
+ */
15
+ export type InterceptionMarker = '(.)' | '(..)' | '(...)' | '(..)(..)';
16
+ /** All recognized interception markers, ordered longest-first for parsing. */
17
+ export declare const INTERCEPTION_MARKERS: InterceptionMarker[];
18
+ /** A single file discovered in a route segment */
19
+ export interface RouteFile {
20
+ /** Absolute path to the file */
21
+ filePath: string;
22
+ /** File extension without leading dot (e.g. "tsx", "ts", "mdx") */
23
+ extension: string;
24
+ }
25
+ /** A node in the segment tree */
26
+ export interface SegmentNode {
27
+ /** The raw directory name (e.g. "dashboard", "[id]", "(auth)", "@sidebar") */
28
+ segmentName: string;
29
+ /** Classified segment type */
30
+ segmentType: SegmentType;
31
+ /** The dynamic param name, if dynamic (e.g. "id" for "[id]", "slug" for "[...slug]") */
32
+ paramName?: string;
33
+ /** The URL path prefix at this segment level (e.g. "/dashboard") */
34
+ urlPath: string;
35
+ /** For intercepting segments: the marker used, e.g. "(.)". */
36
+ interceptionMarker?: InterceptionMarker;
37
+ /**
38
+ * For intercepting segments: the segment name after stripping the marker.
39
+ * E.g., for "(.)photo" this is "photo".
40
+ */
41
+ interceptedSegmentName?: string;
42
+ page?: RouteFile;
43
+ layout?: RouteFile;
44
+ middleware?: RouteFile;
45
+ access?: RouteFile;
46
+ route?: RouteFile;
47
+ error?: RouteFile;
48
+ default?: RouteFile;
49
+ /** Status-code files: 4xx.tsx, 5xx.tsx, {status}.tsx (component format) */
50
+ statusFiles?: Map<string, RouteFile>;
51
+ /** JSON status-code files: 4xx.json, 5xx.json, {status}.json */
52
+ jsonStatusFiles?: Map<string, RouteFile>;
53
+ /** denied.tsx — slot-only denial rendering */
54
+ denied?: RouteFile;
55
+ /** Legacy compat: not-found.tsx (maps to 404), forbidden.tsx (403), unauthorized.tsx (401) */
56
+ legacyStatusFiles?: Map<string, RouteFile>;
57
+ /** prerender.ts — signals build-time pre-rendering for this segment's shell */
58
+ prerender?: RouteFile;
59
+ /** search-params.ts — typed search params definition for this route */
60
+ searchParams?: RouteFile;
61
+ /** Metadata route files (sitemap.ts, robots.ts, icon.tsx, etc.) keyed by base name */
62
+ metadataRoutes?: Map<string, RouteFile>;
63
+ children: SegmentNode[];
64
+ /** Parallel route slots (keyed by slot name without @) */
65
+ slots: Map<string, SegmentNode>;
66
+ }
67
+ /** The full route tree output from the scanner */
68
+ export interface RouteTree {
69
+ /** The root segment node (representing app/) */
70
+ root: SegmentNode;
71
+ /** All discovered proxy.ts files (should be at most one, in app/) */
72
+ proxy?: RouteFile;
73
+ }
74
+ /** Configuration passed to the scanner */
75
+ export interface ScannerConfig {
76
+ /** Recognized page/layout extensions (without dots). Default: ['tsx', 'ts', 'jsx', 'js'] */
77
+ pageExtensions?: string[];
78
+ }
79
+ /** Default page extensions */
80
+ export declare const DEFAULT_PAGE_EXTENSIONS: string[];
81
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/routing/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kCAAkC;AAClC,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,SAAS,GACT,WAAW,GACX,oBAAoB,GACpB,OAAO,GACP,MAAM,GACN,cAAc,GACd,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,EAAyC,CAAC;AAE/F,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAGhC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrC,gEAAgE;IAChE,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACzC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3C,+EAA+E;IAC/E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uEAAuE;IACvE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,sFAAsF;IACtF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAGxC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,0DAA0D;IAC1D,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACjC;AAED,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,IAAI,EAAE,WAAW,CAAC;IAClB,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,8BAA8B;AAC9B,eAAO,MAAM,uBAAuB,UAA6B,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Static analyzability checker for search-params.ts files.
3
+ *
4
+ * Validates that a search-params.ts file's default export is statically
5
+ * analyzable — a createSearchParams() call or a chain of .extend()/.pick()
6
+ * calls on a SearchParamsDefinition.
7
+ *
8
+ * Non-analyzable files produce a hard build error with a diagnostic.
9
+ *
10
+ * Design doc: design/09-typescript.md §"Static Analyzability"
11
+ */
12
+ /** Result of analyzing a search-params.ts file. */
13
+ export interface AnalyzeResult {
14
+ /** Whether the file is statically analyzable. */
15
+ valid: boolean;
16
+ /** Error details when valid is false. */
17
+ error?: AnalyzeError;
18
+ }
19
+ /** Diagnostic error for non-analyzable search-params.ts. */
20
+ export interface AnalyzeError {
21
+ /** Absolute file path. */
22
+ filePath: string;
23
+ /** Description of the non-analyzable expression. */
24
+ expression: string;
25
+ /** Suggested fix. */
26
+ suggestion: string;
27
+ }
28
+ /**
29
+ * Patterns that indicate a valid default export:
30
+ *
31
+ * 1. `export default createSearchParams(...)`
32
+ * 2. `export default someVar.extend(...)`
33
+ * 3. `export default someVar.pick(...)`
34
+ * 4. `export default someVar.extend(...).extend(...)` (chained)
35
+ * 5. `export default someVar.extend(...).pick(...)` (chained)
36
+ * 6. `export default createSearchParams(...).extend(...)`
37
+ *
38
+ * Invalid patterns:
39
+ * - `export default someFunction(...)` (arbitrary factory)
40
+ * - `export default condition ? a : b` (runtime conditional)
41
+ * - `export default variable` (opaque reference without call)
42
+ */
43
+ /**
44
+ * Analyze a search-params.ts file source for static analyzability.
45
+ *
46
+ * @param source - The file content as a string
47
+ * @param filePath - Absolute path to the file (for diagnostics)
48
+ */
49
+ export declare function analyzeSearchParams(source: string, filePath: string): AnalyzeResult;
50
+ /**
51
+ * Format an AnalyzeError into a human-readable build error message.
52
+ */
53
+ export declare function formatAnalyzeError(error: AnalyzeError): string;
54
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/search-params/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,KAAK,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAYD;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAmCnF;AA0ED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAa9D"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Built-in codecs and the fromSchema bridge for Standard Schema-compatible
3
+ * validation libraries (Zod, Valibot, ArkType).
4
+ *
5
+ * Design doc: design/09-typescript.md §"The SearchParamCodec Protocol"
6
+ */
7
+ import type { SearchParamCodec } from './create.js';
8
+ interface StandardSchemaV1<Output = unknown> {
9
+ '~standard': {
10
+ validate(value: unknown): StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
11
+ };
12
+ }
13
+ type StandardSchemaResult<Output> = {
14
+ value: Output;
15
+ issues?: undefined;
16
+ } | {
17
+ value?: undefined;
18
+ issues: ReadonlyArray<{
19
+ message: string;
20
+ }>;
21
+ };
22
+ /**
23
+ * Bridge a Standard Schema-compatible schema (Zod, Valibot, ArkType) to a
24
+ * SearchParamCodec.
25
+ *
26
+ * Parse: coerces the raw URL string through the schema. On validation failure,
27
+ * parses `undefined` to get the schema's default value (the schema should have
28
+ * a `.default()` call). If that also fails, returns `undefined`.
29
+ *
30
+ * Serialize: uses `String()` for primitives, `null` for null/undefined.
31
+ *
32
+ * ```ts
33
+ * import { fromSchema } from '@timber/app/search-params'
34
+ * import { z } from 'zod/v4'
35
+ *
36
+ * const pageCodec = fromSchema(z.coerce.number().int().min(1).default(1))
37
+ * ```
38
+ */
39
+ export declare function fromSchema<T>(schema: StandardSchemaV1<T>): SearchParamCodec<T>;
40
+ /**
41
+ * Bridge a Standard Schema for array values. Handles both single strings
42
+ * and repeated query keys (`?tag=a&tag=b`).
43
+ *
44
+ * ```ts
45
+ * import { fromArraySchema } from '@timber/app/search-params'
46
+ * import { z } from 'zod/v4'
47
+ *
48
+ * const tagsCodec = fromArraySchema(z.array(z.string()).default([]))
49
+ * ```
50
+ */
51
+ export declare function fromArraySchema<T>(schema: StandardSchemaV1<T>): SearchParamCodec<T>;
52
+ export {};
53
+ //# sourceMappingURL=codecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../src/search-params/codecs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAUpD,UAAU,gBAAgB,CAAC,MAAM,GAAG,OAAO;IACzC,WAAW,EAAE;QACX,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;KAChG,CAAC;CACH;AAED,KAAK,oBAAoB,CAAC,MAAM,IAC5B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACrC;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AA6BtE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CA6B9E;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAmCnF"}