@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
+ /**
2
+ * timber-adapter-build — Invoke the adapter's buildOutput after vite build.
3
+ *
4
+ * After all environments are built and the RSC plugin has written its
5
+ * asset manifests, calls `adapter.buildOutput()` to transform the output
6
+ * into a deployable artifact (e.g., Cloudflare Workers entry + wrangler.jsonc).
7
+ *
8
+ * Uses a `buildApp` hook with `order: 'post'` so that Vite calls the
9
+ * RSC plugin's buildApp (which orchestrates all environment builds and
10
+ * writes asset manifests) first, then runs this handler after everything
11
+ * is complete.
12
+ *
13
+ * Design docs: design/11-platform.md, design/25-production-deployments.md
14
+ */
15
+ import type { Plugin } from 'vite';
16
+ import type { PluginContext } from '#/index.js';
17
+ export declare function timberAdapterBuild(ctx: PluginContext): Plugin;
18
+ //# sourceMappingURL=adapter-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-build.d.ts","sourceRoot":"","sources":["../../src/plugins/adapter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAoD7D"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * timber-build-manifest — Vite sub-plugin for build asset manifest generation.
3
+ *
4
+ * Provides `virtual:timber-build-manifest` which exports a BuildManifest
5
+ * mapping route segment file paths to their CSS, JS, and modulepreload
6
+ * output chunks.
7
+ *
8
+ * - Dev mode: exports an empty manifest (Vite HMR handles CSS/JS).
9
+ * - Build mode: virtual module reads from globalThis.__TIMBER_BUILD_MANIFEST__
10
+ * at runtime. The actual manifest data is injected by the adapter via a
11
+ * _timber-manifest-init.js module that runs before the RSC handler.
12
+ *
13
+ * The generateBundle hook (client env only) extracts CSS/JS/modulepreload
14
+ * data from the Rollup bundle and populates ctx.buildManifest.
15
+ *
16
+ * Design docs: 18-build-system.md §"Build Manifest", 02-rendering-pipeline.md §"Early Hints"
17
+ */
18
+ import type { Plugin } from 'vite';
19
+ import type { PluginContext } from '#/index.js';
20
+ import type { BuildManifest } from '#/server/build-manifest.js';
21
+ interface OutputChunk {
22
+ type: 'chunk';
23
+ fileName: string;
24
+ facadeModuleId: string | null;
25
+ imports: string[];
26
+ name: string;
27
+ code: string;
28
+ viteMetadata?: {
29
+ importedCss?: Set<string>;
30
+ };
31
+ }
32
+ interface OutputAsset {
33
+ type: 'asset';
34
+ fileName: string;
35
+ }
36
+ type OutputBundle = Record<string, OutputChunk | OutputAsset>;
37
+ /**
38
+ * Vite's manifest.json entry shape (subset we need).
39
+ * See https://vite.dev/guide/backend-integration.html
40
+ */
41
+ interface ViteManifestEntry {
42
+ file: string;
43
+ css?: string[];
44
+ imports?: string[];
45
+ }
46
+ /**
47
+ * Parse Vite's .vite/manifest.json into a BuildManifest.
48
+ *
49
+ * Walks each entry and collects:
50
+ * - `css`: CSS output URLs per input file (transitive CSS included by Vite)
51
+ * - `js`: Hashed JS chunk URL per input file
52
+ * - `modulepreload`: Transitive JS dependency URLs per input file
53
+ *
54
+ * Keys are input file paths (relative to project root).
55
+ */
56
+ export declare function parseViteManifest(viteManifest: Record<string, ViteManifestEntry>, base: string): BuildManifest;
57
+ /**
58
+ * Build a BuildManifest from a Rollup output bundle.
59
+ *
60
+ * Unlike parseViteManifest (which reads Vite's manifest.json), this
61
+ * works directly with the Rollup bundle output. This is necessary because
62
+ * the RSC plugin doesn't produce a standard Vite manifest.json.
63
+ *
64
+ * Walks each chunk in the bundle and collects:
65
+ * - `css`: CSS files imported by each chunk (via viteMetadata.importedCss)
66
+ * - `js`: The output filename for each chunk with a facadeModuleId
67
+ * - `modulepreload`: Transitive JS imports for each entry chunk
68
+ *
69
+ * Keys are input file paths relative to root.
70
+ */
71
+ export declare function buildManifestFromBundle(bundle: OutputBundle, base: string, root: string): BuildManifest;
72
+ /**
73
+ * Create the timber-build-manifest Vite plugin.
74
+ *
75
+ * Hooks: configResolved, resolveId, load, generateBundle (client env only)
76
+ */
77
+ export declare function timberBuildManifest(ctx: PluginContext): Plugin;
78
+ export {};
79
+ //# sourceMappingURL=build-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../src/plugins/build-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;CAC9C;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;AAK9D;;;GAGG;AACH,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC/C,IAAI,EAAE,MAAM,GACX,aAAa,CAmBf;AAqCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,aAAa,CA0Df;AA8BD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwF9D"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * timber-build-report — Post-build route summary table.
3
+ *
4
+ * After a production build, logs a per-route table showing:
5
+ * - Route type (○ static, λ dynamic, ƒ function)
6
+ * - Route-specific client JS size
7
+ * - First-load JS size (gzip) — route-specific + shared chunks
8
+ *
9
+ * Only active during production builds. Sizes are computed from the
10
+ * already-generated Vite client bundle — no extra analysis passes.
11
+ *
12
+ * Design docs: 18-build-system.md §"Build Pipeline", 07-routing.md
13
+ * Task: TIM-287
14
+ */
15
+ import type { Plugin } from 'vite';
16
+ import type { PluginContext } from '#/index.js';
17
+ import type { SegmentNode, RouteTree } from '#/routing/types.js';
18
+ import { formatSize } from '#/utils/format.js';
19
+ export type RouteType = 'static' | 'dynamic' | 'function';
20
+ export interface RouteEntry {
21
+ path: string;
22
+ type: RouteType;
23
+ /** Route-specific client JS size in bytes (raw). */
24
+ size: number;
25
+ /** Total first-load JS in bytes (gzip): route-specific + shared. */
26
+ firstLoadSize: number;
27
+ }
28
+ /**
29
+ * Classify a route by its segment chain and output mode.
30
+ *
31
+ * In server mode (default), all pages are dynamic (rendered per-request).
32
+ * In static mode, only pages with dynamic/catch-all segments are dynamic.
33
+ * API routes (route.ts) are always classified as function.
34
+ */
35
+ export declare function classifyRoute(segments: SegmentNode[], outputMode?: 'server' | 'static'): RouteType;
36
+ export { formatSize };
37
+ interface RouteInfo {
38
+ path: string;
39
+ segments: SegmentNode[];
40
+ entryFilePath: string | null;
41
+ }
42
+ /** Walk the route tree and collect all leaf routes (pages + API endpoints). */
43
+ export declare function collectRoutes(tree: RouteTree): RouteInfo[];
44
+ /** Produce formatted report lines for the Vite logger. */
45
+ export declare function buildRouteReport(entries: RouteEntry[], sharedSize: number): string[];
46
+ interface ChunkSize {
47
+ raw: number;
48
+ gzip: number;
49
+ }
50
+ interface OutputChunkLike {
51
+ type: 'chunk' | 'asset';
52
+ fileName: string;
53
+ code?: string;
54
+ source?: string | Uint8Array;
55
+ modules?: Record<string, unknown>;
56
+ facadeModuleId?: string | null;
57
+ }
58
+ /** Measure raw + gzip sizes for all JS chunks and CSS assets in a bundle. */
59
+ export declare function collectChunkSizes(bundle: Record<string, OutputChunkLike>): Map<string, ChunkSize>;
60
+ /** Find the output chunk that contains a given input file. */
61
+ export declare function findChunkForFile(filePath: string, bundle: Record<string, OutputChunkLike>): string | null;
62
+ export declare function timberBuildReport(ctx: PluginContext): Plugin;
63
+ //# sourceMappingURL=build-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-report.d.ts","sourceRoot":"","sources":["../../src/plugins/build-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB;AAUD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,GAAE,QAAQ,GAAG,QAAmB,GACzC,SAAS,CAYX;AAID,OAAO,EAAE,UAAU,EAAE,CAAC;AAQtB,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,CAoB1D;AAID,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAyCpF;AAcD,UAAU,SAAS;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAYjG;AAOD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,MAAM,GAAG,IAAI,CAOf;AAwED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwE5D"}
@@ -0,0 +1,36 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Parse a cacheLife duration string to seconds.
4
+ * Supports: '30s', '5m', '1h', '2d', '1w', or a plain number (seconds).
5
+ */
6
+ export declare function parseCacheLife(value: string | number): number;
7
+ export interface CacheTransformWarning {
8
+ message: string;
9
+ functionName: string;
10
+ }
11
+ interface TransformResult {
12
+ code: string;
13
+ map?: null;
14
+ warnings?: CacheTransformWarning[];
15
+ }
16
+ /**
17
+ * Check if a 'use cache' function in a dynamic route page/layout receives
18
+ * Promise-typed params, which are not serializable as cache keys.
19
+ */
20
+ export declare function detectPromiseParamsWarning(declaration: string, functionName: string, fileId: string): CacheTransformWarning | null;
21
+ /**
22
+ * Transform source code containing 'use cache' directives into
23
+ * registerCachedFunction() calls.
24
+ *
25
+ * Returns null if no transformations were made.
26
+ */
27
+ export declare function transformUseCache(code: string, fileId: string): TransformResult | null;
28
+ /**
29
+ * Vite plugin: timber-cache
30
+ *
31
+ * Transforms 'use cache' directives into registerCachedFunction() calls.
32
+ * Only runs in the RSC environment.
33
+ */
34
+ export declare function cacheTransformPlugin(): Plugin;
35
+ export {};
36
+ //# sourceMappingURL=cache-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-transform.d.ts","sourceRoot":"","sources":["../../src/plugins/cache-transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAc7D;AAKD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACpC;AAmDD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,qBAAqB,GAAG,IAAI,CAW9B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAuDtF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAsB7C"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * timber-chunks — Vite sub-plugin for intelligent client chunk splitting.
3
+ *
4
+ * Splits client bundles into cache tiers based on update frequency:
5
+ *
6
+ * Tier 1: vendor-react — react, react-dom, scheduler (changes rarely)
7
+ * Tier 2: vendor-timber — timber runtime, RSC runtime (changes per framework update)
8
+ * Tier 3: [route]-* — per-route app code (changes per deploy, handled by Vite defaults)
9
+ *
10
+ * Server environments (RSC, SSR) are left to Vite's default chunking since
11
+ * Cloudflare Workers load all code from a single deployment bundle with no
12
+ * benefit from cache-tier separation.
13
+ *
14
+ * Design docs: 27-chunking-strategy.md
15
+ */
16
+ import type { Plugin } from 'vite';
17
+ /**
18
+ * Categorize a module ID into a cache tier chunk name.
19
+ *
20
+ * Returns a chunk name for vendor modules, or undefined to let
21
+ * Rollup's default splitting handle app/route code.
22
+ */
23
+ export declare function assignChunk(id: string): string | undefined;
24
+ /**
25
+ * Group timber's internal 'use client' modules into the vendor-timber chunk.
26
+ *
27
+ * The RSC plugin creates separate entry points for each 'use client' module,
28
+ * which manualChunks can't merge. This function is passed as the RSC plugin's
29
+ * `clientChunks` callback to group timber internals into a single chunk.
30
+ * User and third-party client components are left to default per-route splitting.
31
+ */
32
+ export declare function assignClientChunk(meta: {
33
+ id: string;
34
+ normalizedId: string;
35
+ serverChunk: string;
36
+ }): string | undefined;
37
+ /**
38
+ * Create the timber-chunks Vite plugin.
39
+ *
40
+ * Uses Vite's per-environment config to apply manualChunks only to
41
+ * the client build. The config hook runs before environments are
42
+ * created, so we use `environments.client` to target the client.
43
+ */
44
+ export declare function timberChunks(): Plugin;
45
+ //# sourceMappingURL=chunks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/plugins/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoB1D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,GAAG,SAAS,CAErB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAoBrC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * timber-content — Vite sub-plugin for content collections.
3
+ *
4
+ * Wraps @content-collections/vite to provide content collection support.
5
+ * Activates only when a content-collections.ts config file exists at the
6
+ * project root.
7
+ *
8
+ * Design doc: 20-content-collections.md §"Content Collections"
9
+ */
10
+ import type { Plugin } from 'vite';
11
+ import type { PluginContext } from '#/index.js';
12
+ /**
13
+ * Create the timber-content Vite plugin.
14
+ *
15
+ * Delegates all content scanning, validation, code generation, and file watching
16
+ * to @content-collections/vite. This plugin only handles detection and activation.
17
+ */
18
+ export declare function timberContent(ctx: PluginContext): Plugin;
19
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/plugins/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoBhD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAgGxD"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Dev error overlay — formats and sends errors to Vite's browser overlay and stderr.
3
+ *
4
+ * Integrates with Vite's built-in error overlay (`server.ssrFixStacktrace` +
5
+ * `server.hot.send`) rather than implementing a custom overlay.
6
+ *
7
+ * Design doc: 21-dev-server.md §"Error Overlay"
8
+ */
9
+ import type { ViteDevServer } from 'vite';
10
+ /** The phase of the pipeline where the error occurred. */
11
+ export type ErrorPhase = 'module-transform' | 'proxy' | 'middleware' | 'access' | 'render' | 'handler';
12
+ export type FrameType = 'app' | 'framework' | 'internal';
13
+ /**
14
+ * Classify a stack frame line by origin.
15
+ *
16
+ * - 'app': user application code (in project root, not node_modules)
17
+ * - 'framework': timber-app internal code
18
+ * - 'internal': node_modules, Node.js internals
19
+ */
20
+ export declare function classifyFrame(frameLine: string, projectRoot: string): FrameType;
21
+ /**
22
+ * Extract the React component stack from an error, if present.
23
+ * React attaches this as `componentStack` during renderToReadableStream errors.
24
+ */
25
+ export declare function extractComponentStack(error: unknown): string | null;
26
+ interface SourceLocation {
27
+ file: string;
28
+ line: number;
29
+ column: number;
30
+ }
31
+ /**
32
+ * Parse the first application frame from a stack trace.
33
+ * Returns file/line/column for the overlay's `loc` field.
34
+ */
35
+ export declare function parseFirstAppFrame(stack: string, projectRoot: string): SourceLocation | null;
36
+ /**
37
+ * Classify the error phase by inspecting the error's stack trace.
38
+ * Falls back to 'render' if no specific phase can be determined.
39
+ */
40
+ export declare function classifyErrorPhase(error: Error, projectRoot: string): ErrorPhase;
41
+ /**
42
+ * Format an error for terminal output.
43
+ *
44
+ * - Red for the error message and phase label
45
+ * - Dim for framework-internal frames
46
+ * - Normal for application frames
47
+ * - Separate section for component stack (if present)
48
+ */
49
+ export declare function formatTerminalError(error: Error, phase: ErrorPhase, projectRoot: string): string;
50
+ /**
51
+ * Send an error to Vite's browser overlay and log it to stderr.
52
+ *
53
+ * Uses `server.ssrFixStacktrace()` to map stack traces back to source,
54
+ * then sends the error via `server.hot.send()` for the browser overlay.
55
+ *
56
+ * The dev server remains running — errors are handled, not fatal.
57
+ */
58
+ export declare function sendErrorToOverlay(server: ViteDevServer, error: Error, phase: ErrorPhase, projectRoot: string): void;
59
+ export {};
60
+ //# sourceMappingURL=dev-error-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-error-overlay.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-error-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAI1C,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAcd,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,CAU/E;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAUnE;AAID,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAqB5F;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAehF;AAUD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAiChG;AAID;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,MAAM,GAClB,IAAI,CAgCN"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * timber-dev-logs — Pipes server console output to the browser console in dev.
3
+ *
4
+ * Patches `console.log/warn/error/debug/info` on the server side and
5
+ * forwards messages to connected browsers via Vite's HMR WebSocket.
6
+ * The browser entry replays them in the browser console with the
7
+ * correct log level and a "[server]" prefix.
8
+ *
9
+ * Dev-only: this plugin only runs during `vite dev` (apply: 'serve').
10
+ * No runtime overhead in production.
11
+ *
12
+ * Design docs: 18-build-system.md §"Dev Server", 02-rendering-pipeline.md
13
+ */
14
+ import type { Plugin } from 'vite';
15
+ import type { PluginContext } from '#/index.js';
16
+ /** Log levels that are patched and forwarded. */
17
+ export type ServerLogLevel = 'log' | 'warn' | 'error' | 'debug' | 'info';
18
+ /** Payload sent over Vite's HMR WebSocket. */
19
+ export interface ServerLogPayload {
20
+ level: ServerLogLevel;
21
+ args: unknown[];
22
+ /** Server-side source location (file:line:col) if available. */
23
+ location: string | null;
24
+ /** Timestamp in ms (Date.now()) */
25
+ timestamp: number;
26
+ }
27
+ /**
28
+ * Check if the calling code is from timber's internal plugin/adapter plumbing.
29
+ *
30
+ * Only filters logs from `plugins/` and `adapters/` directories — these are
31
+ * framework operational noise (request summaries, codegen warnings, adapter
32
+ * setup). Logs from `server/` are preserved because they surface user errors
33
+ * (render errors, action errors, route handler errors, etc.).
34
+ *
35
+ * Handles both monorepo paths (timber-app/src/plugins/) and installed
36
+ * package paths (@timber/app/dist/plugins/).
37
+ */
38
+ export declare function isFrameworkInternalCaller(): boolean;
39
+ /**
40
+ * Create the timber-dev-logs Vite plugin.
41
+ *
42
+ * Patches console methods when the dev server starts and restores them
43
+ * when the server closes. Only active during `vite dev`.
44
+ */
45
+ export declare function timberDevLogs(_ctx: PluginContext): Plugin;
46
+ //# sourceMappingURL=dev-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-logs.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-logs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAIzE,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB;AA2ID;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAsBnD;AAoDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAiBzD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * timber-dev-server — Vite sub-plugin for dev server request handling.
3
+ *
4
+ * Registers a configureServer middleware that intercepts requests and
5
+ * routes them through the timber pipeline:
6
+ * proxy.ts → canonicalize → route match → middleware → access → render → flush
7
+ *
8
+ * The RSC entry module is loaded via Vite's ssrLoadModule, which uses
9
+ * Vite's dev module graph instead of built bundles. The full pipeline
10
+ * (including proxy.ts) runs on every request.
11
+ *
12
+ * Design docs: 18-build-system.md §"Dev Server", 02-rendering-pipeline.md
13
+ */
14
+ import type { Plugin } from 'vite';
15
+ import type { PluginContext } from '#/index.js';
16
+ /**
17
+ * Create the timber-dev-server Vite plugin.
18
+ *
19
+ * Hook: configureServer (returns post-hook to register after Vite's middleware)
20
+ */
21
+ export declare function timberDevServer(ctx: PluginContext): Plugin;
22
+ //# sourceMappingURL=dev-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAIlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiChD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAmD1D"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * timber-dynamic-transform — Vite sub-plugin for 'use dynamic' directive.
3
+ *
4
+ * Detects `'use dynamic'` directives in server component function bodies
5
+ * and transforms them into `markDynamic()` runtime calls. The directive
6
+ * declares a dynamic boundary — the component and its subtree opt out of
7
+ * the pre-rendered shell and render per-request.
8
+ *
9
+ * - In `output: 'static'` mode, `'use dynamic'` is a build error.
10
+ * - In standard SSR routes (no prerender.ts), the directive is a no-op
11
+ * (everything is already per-request), but the transform still runs
12
+ * so the runtime can skip unnecessary work.
13
+ *
14
+ * Design doc: design/15-future-prerendering.md §"'use dynamic'"
15
+ */
16
+ import type { Plugin } from 'vite';
17
+ import type { PluginContext } from '#/index.js';
18
+ /**
19
+ * Quick check: does this source file contain 'use dynamic' anywhere?
20
+ * Used as a fast bail-out before doing expensive AST parsing.
21
+ */
22
+ export declare function containsUseDynamic(code: string): boolean;
23
+ interface TransformResult {
24
+ code: string;
25
+ map?: null;
26
+ }
27
+ /**
28
+ * Find function declarations/expressions containing 'use dynamic' and
29
+ * transform them into markDynamic() calls.
30
+ *
31
+ * Input:
32
+ * ```tsx
33
+ * export default async function AddToCartButton({ productId }) {
34
+ * 'use dynamic'
35
+ * const user = await getUser()
36
+ * return <button>Add to cart</button>
37
+ * }
38
+ * ```
39
+ *
40
+ * Output:
41
+ * ```tsx
42
+ * import { markDynamic as __markDynamic } from '@timber/app/runtime';
43
+ * export default async function AddToCartButton({ productId }) {
44
+ * __markDynamic();
45
+ * const user = await getUser()
46
+ * return <button>Add to cart</button>
47
+ * }
48
+ * ```
49
+ *
50
+ * The markDynamic() call registers the component boundary as dynamic
51
+ * at render time. The pre-render pass uses this to know which subtrees
52
+ * to skip and leave as holes for per-request rendering.
53
+ */
54
+ export declare function transformUseDynamic(code: string): TransformResult | null;
55
+ /**
56
+ * In `output: 'static'` mode, `'use dynamic'` is a build error.
57
+ * Static mode renders everything at build time — there is no per-request
58
+ * rendering to opt into.
59
+ */
60
+ export declare function validateNoDynamicInStaticMode(code: string): {
61
+ message: string;
62
+ line?: number;
63
+ } | null;
64
+ /**
65
+ * Create the timber-dynamic-transform Vite plugin.
66
+ *
67
+ * In server mode: transforms 'use dynamic' into markDynamic() calls.
68
+ * In static mode: rejects 'use dynamic' as a build error.
69
+ */
70
+ export declare function timberDynamicTransform(ctx: PluginContext): Plugin;
71
+ export {};
72
+ //# sourceMappingURL=dynamic-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-transform.d.ts","sourceRoot":"","sources":["../../src/plugins/dynamic-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAMD,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAoBxE;AAMD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,GACX;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAa3C;AAMD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAkCjE"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * timber-entries — Vite sub-plugin for entry virtual module resolution.
3
+ *
4
+ * Resolves virtual:timber-rsc-entry, virtual:timber-ssr-entry,
5
+ * virtual:timber-browser-entry to real TypeScript files, and generates
6
+ * virtual:timber-config as serialized runtime config.
7
+ *
8
+ * Entry modules are real .ts files — NOT codegen strings. The only
9
+ * generated code is virtual:timber-config (serialized runtime config).
10
+ *
11
+ * Design docs: 18-build-system.md §"Entry Generation", §"Virtual Modules"
12
+ */
13
+ import type { Plugin } from 'vite';
14
+ import type { PluginContext } from '#/index.js';
15
+ /**
16
+ * Create the timber-entries Vite plugin.
17
+ *
18
+ * Hooks: resolveId, load
19
+ */
20
+ export declare function timberEntries(ctx: PluginContext): Plugin;
21
+ //# sourceMappingURL=entries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA2FhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA2FxD"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * timber-fonts — Vite sub-plugin for build-time font processing.
3
+ *
4
+ * Handles:
5
+ * - Virtual module resolution for `@timber/fonts/google` and `@timber/fonts/local`
6
+ * - Static analysis of font function calls during `transform`
7
+ * - @font-face CSS generation and scoped class output
8
+ * - Size-adjusted fallback font generation
9
+ *
10
+ * Does NOT handle (separate tasks):
11
+ * - Google Fonts downloading/caching (timber-nk5)
12
+ * - Build manifest / Early Hints integration (timber-qnx)
13
+ *
14
+ * Design doc: 24-fonts.md
15
+ */
16
+ import type { Plugin } from 'vite';
17
+ import type { PluginContext } from '#/index.js';
18
+ import type { ExtractedFont, GoogleFontConfig } from '#/fonts/types.js';
19
+ /**
20
+ * Registry of fonts extracted during transform.
21
+ * Keyed by a unique font ID derived from family + config.
22
+ */
23
+ export type FontRegistry = Map<string, ExtractedFont>;
24
+ /**
25
+ * Extract static font config from a font function call in source code.
26
+ *
27
+ * Parses patterns like:
28
+ * const inter = Inter({ subsets: ['latin'], weight: '400', display: 'swap', variable: '--font-sans' })
29
+ *
30
+ * Returns null if the call cannot be statically analyzed.
31
+ *
32
+ * Uses acorn AST parsing for robust handling of comments, trailing commas,
33
+ * and multi-line configs.
34
+ */
35
+ export declare function extractFontConfig(callSource: string): GoogleFontConfig | null;
36
+ /**
37
+ * Detect if a source file contains dynamic/computed font function calls
38
+ * that cannot be statically analyzed.
39
+ *
40
+ * Returns the offending expression if found, null if all calls are static.
41
+ *
42
+ * Uses acorn AST parsing for accurate detection.
43
+ */
44
+ export declare function detectDynamicFontCall(source: string, importedNames: string[]): string | null;
45
+ /**
46
+ * Parse import specifiers from a source file that imports from
47
+ * `@timber/fonts/google` or `next/font/google`.
48
+ *
49
+ * Returns the list of imported font names (e.g. ['Inter', 'JetBrains_Mono']).
50
+ */
51
+ export declare function parseGoogleFontImports(source: string): string[];
52
+ /**
53
+ * Parse the original (remote) font family names from imports.
54
+ *
55
+ * Returns a map of local name → family name.
56
+ * e.g. { Inter: 'Inter', JetBrains_Mono: 'JetBrains Mono' }
57
+ */
58
+ export declare function parseGoogleFontFamilies(source: string): Map<string, string>;
59
+ /**
60
+ * Generate the CSS output for all extracted fonts.
61
+ *
62
+ * Includes @font-face rules, fallback @font-face rules, and scoped classes.
63
+ */
64
+ export declare function generateAllFontCss(registry: FontRegistry): string;
65
+ /**
66
+ * Parse the local name used for the default import of `@timber/fonts/local`.
67
+ *
68
+ * Handles:
69
+ * import localFont from '@timber/fonts/local'
70
+ * import myLoader from '@timber/fonts/local'
71
+ */
72
+ export declare function parseLocalFontImportName(source: string): string | null;
73
+ /**
74
+ * Create the timber-fonts Vite plugin.
75
+ */
76
+ export declare function timberFonts(ctx: PluginContext): Plugin;
77
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkBxE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AA4CtD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAE5F;AAUD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB3E;AAwED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAiBjE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKtE;AAqED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAoOtD"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * timber-mdx — Vite sub-plugin for MDX page rendering.
3
+ *
4
+ * Wires @mdx-js/rollup into the Vite pipeline when MDX is activated.
5
+ * MDX is activated when pageExtensions includes 'mdx' or 'md', or
6
+ * when a content/ directory exists at the project root.
7
+ *
8
+ * Design doc: 20-content-collections.md §"The timber-mdx Plugin"
9
+ */
10
+ import type { Plugin } from 'vite';
11
+ import type { PluginContext } from '#/index.js';
12
+ /**
13
+ * Create the timber-mdx Vite plugin.
14
+ *
15
+ * Uses the transform and resolveId hooks to delegate MDX compilation
16
+ * to @mdx-js/rollup. The inner plugin is loaded lazily on first activation.
17
+ *
18
+ * Hooks: buildStart (loads @mdx-js/rollup), resolveId, load, transform
19
+ */
20
+ export declare function timberMdx(ctx: PluginContext): Plugin;
21
+ //# sourceMappingURL=mdx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../src/plugins/mdx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmDhD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0GpD"}