@timber-js/app 0.2.0-alpha.191 → 0.2.0-alpha.194

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 (672) hide show
  1. package/agent-skill.md +2 -0
  2. package/dist/_chunks/{actions-BjbbNRFN.js → actions-CWYtq6ii.js} +3 -3
  3. package/dist/_chunks/actions-CWYtq6ii.js.map +1 -0
  4. package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
  5. package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -1
  6. package/dist/_chunks/{build-output-helper-C3DrfzZR.js → build-output-helper-9dqCv1pZ.js} +3 -2
  7. package/dist/_chunks/build-output-helper-9dqCv1pZ.js.map +1 -0
  8. package/dist/_chunks/{cache-api-DllJ-Lyw.js → cache-api-CQeYzA5g.js} +6 -8
  9. package/dist/_chunks/cache-api-CQeYzA5g.js.map +1 -0
  10. package/dist/_chunks/chains-h7EO-u3n.js +412 -0
  11. package/dist/_chunks/chains-h7EO-u3n.js.map +1 -0
  12. package/dist/_chunks/{cli-check-DJZDc22E.js → cli-check-BVthpfLS.js} +43 -6
  13. package/dist/_chunks/cli-check-BVthpfLS.js.map +1 -0
  14. package/dist/_chunks/{cli-schema-sync-D4_AZVUb.js → cli-schema-sync-ZwM9u_ob.js} +6 -5
  15. package/dist/_chunks/{cli-schema-sync-D4_AZVUb.js.map → cli-schema-sync-ZwM9u_ob.js.map} +1 -1
  16. package/dist/_chunks/{cloudflare-CGP6BZKO.js → cloudflare-BKJC3SC_.js} +28 -22
  17. package/dist/_chunks/{cloudflare-CGP6BZKO.js.map → cloudflare-BKJC3SC_.js.map} +1 -1
  18. package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -1
  19. package/dist/_chunks/{convention-lint-CpteIpTm.js → convention-lint-DO10_pVl.js} +93 -7
  20. package/dist/_chunks/convention-lint-DO10_pVl.js.map +1 -0
  21. package/dist/_chunks/dist-DtrJyBbw.js +386 -0
  22. package/dist/_chunks/dist-DtrJyBbw.js.map +1 -0
  23. package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -1
  24. package/dist/_chunks/{file-cache-DmX7OqZP.js → file-cache-Dw6BJPG7.js} +5 -1
  25. package/dist/_chunks/{file-cache-DmX7OqZP.js.map → file-cache-Dw6BJPG7.js.map} +1 -1
  26. package/dist/_chunks/{format-CfwjgPz9.js → format-BKclgVbk.js} +3 -3
  27. package/dist/_chunks/{format-CfwjgPz9.js.map → format-BKclgVbk.js.map} +1 -1
  28. package/dist/_chunks/graph-cache-CP4GEmf9.js +304 -0
  29. package/dist/_chunks/graph-cache-CP4GEmf9.js.map +1 -0
  30. package/dist/_chunks/href-validation-CMc5JRls.js.map +1 -1
  31. package/dist/_chunks/live-graph-Bx4HodF1.js +150 -0
  32. package/dist/_chunks/live-graph-Bx4HodF1.js.map +1 -0
  33. package/dist/_chunks/{logger-CH7IcMmg.js → logger-pumCm3Il.js} +25 -7
  34. package/dist/_chunks/{logger-CH7IcMmg.js.map → logger-pumCm3Il.js.map} +1 -1
  35. package/dist/_chunks/{mdx-file-C005ay-P.js → mdx-file-CXyHGUpS.js} +3 -3
  36. package/dist/_chunks/mdx-file-CXyHGUpS.js.map +1 -0
  37. package/dist/_chunks/{plugin-context-rCinWLiE.js → plugin-context-8idfR3UZ.js} +2 -2
  38. package/dist/_chunks/plugin-context-8idfR3UZ.js.map +1 -0
  39. package/dist/_chunks/poison-rules-DoEhbqaY.js +110 -0
  40. package/dist/_chunks/poison-rules-DoEhbqaY.js.map +1 -0
  41. package/dist/_chunks/poison-scan-BAxfTT5L.js +101 -0
  42. package/dist/_chunks/poison-scan-BAxfTT5L.js.map +1 -0
  43. package/dist/_chunks/resolve-schema-CBR6Lm4i.js.map +1 -1
  44. package/dist/_chunks/rolldown-runtime-D7D4PA-g.js +13 -0
  45. package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -1
  46. package/dist/_chunks/{rsc-media-type-DRqE_lD_.js → rsc-media-type-DDc7duTD.js} +17 -2
  47. package/dist/_chunks/{rsc-media-type-DRqE_lD_.js.map → rsc-media-type-DDc7duTD.js.map} +1 -1
  48. package/dist/_chunks/scan-BoP17W3w.js +140 -0
  49. package/dist/_chunks/scan-BoP17W3w.js.map +1 -0
  50. package/dist/_chunks/{scanner-CAietmj4.js → scanner-BRIOmHE2.js} +43 -4
  51. package/dist/_chunks/scanner-BRIOmHE2.js.map +1 -0
  52. package/dist/_chunks/schema-bridge-C83xa9lT.js.map +1 -1
  53. package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -1
  54. package/dist/_chunks/{segment-keys-BawYuNFO.js → segment-keys-BhqoHiLc.js} +14 -2
  55. package/dist/_chunks/{segment-keys-BawYuNFO.js.map → segment-keys-BhqoHiLc.js.map} +1 -1
  56. package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -1
  57. package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -1
  58. package/dist/_chunks/use-query-states-I3JMng6J.js.map +1 -1
  59. package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -1
  60. package/dist/_chunks/{walkers-BsVLmD1S.js → walkers-uCu3WW6_.js} +9 -6
  61. package/dist/_chunks/{walkers-BsVLmD1S.js.map → walkers-uCu3WW6_.js.map} +1 -1
  62. package/dist/adapters/build-output-helper.d.ts +1 -1
  63. package/dist/adapters/build-output-helper.d.ts.map +1 -1
  64. package/dist/adapters/cloudflare-dev.d.ts.map +1 -1
  65. package/dist/adapters/cloudflare-dev.js +2 -1
  66. package/dist/adapters/cloudflare-dev.js.map +1 -1
  67. package/dist/adapters/cloudflare-kv-cache.d.ts +1 -1
  68. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -1
  69. package/dist/adapters/cloudflare-kv-cache.js +7 -8
  70. package/dist/adapters/cloudflare-kv-cache.js.map +1 -1
  71. package/dist/adapters/cloudflare.d.ts +1 -1
  72. package/dist/adapters/cloudflare.d.ts.map +1 -1
  73. package/dist/adapters/cloudflare.js +1 -1
  74. package/dist/adapters/nitro-presets.d.ts +37 -0
  75. package/dist/adapters/nitro-presets.d.ts.map +1 -0
  76. package/dist/adapters/nitro-preview.d.ts +32 -0
  77. package/dist/adapters/nitro-preview.d.ts.map +1 -0
  78. package/dist/adapters/nitro.d.ts +28 -51
  79. package/dist/adapters/nitro.d.ts.map +1 -1
  80. package/dist/adapters/nitro.js +224 -171
  81. package/dist/adapters/nitro.js.map +1 -1
  82. package/dist/analyze/chains.d.ts +124 -0
  83. package/dist/analyze/chains.d.ts.map +1 -0
  84. package/dist/analyze/classify.d.ts +150 -0
  85. package/dist/analyze/classify.d.ts.map +1 -0
  86. package/dist/analyze/crawl-entry.d.ts +17 -0
  87. package/dist/analyze/crawl-entry.d.ts.map +1 -0
  88. package/dist/analyze/crawl-entry.js +313 -0
  89. package/dist/analyze/crawl-entry.js.map +1 -0
  90. package/dist/analyze/crawl.d.ts +134 -0
  91. package/dist/analyze/crawl.d.ts.map +1 -0
  92. package/dist/analyze/graph-cache.d.ts +104 -0
  93. package/dist/analyze/graph-cache.d.ts.map +1 -0
  94. package/dist/analyze/graph-command.d.ts +43 -0
  95. package/dist/analyze/graph-command.d.ts.map +1 -0
  96. package/dist/analyze/graph-command.js +472 -0
  97. package/dist/analyze/graph-command.js.map +1 -0
  98. package/dist/analyze/live-graph.d.ts +81 -0
  99. package/dist/analyze/live-graph.d.ts.map +1 -0
  100. package/dist/analyze/poison-rules.d.ts +72 -0
  101. package/dist/analyze/poison-rules.d.ts.map +1 -0
  102. package/dist/analyze/poison-scan.d.ts +48 -0
  103. package/dist/analyze/poison-scan.d.ts.map +1 -0
  104. package/dist/analyze/scan.d.ts +73 -0
  105. package/dist/analyze/scan.d.ts.map +1 -0
  106. package/dist/cache/cache-api.d.ts +2 -2
  107. package/dist/cache/cache-api.d.ts.map +1 -1
  108. package/dist/cache/index.d.ts +8 -8
  109. package/dist/cache/index.d.ts.map +1 -1
  110. package/dist/cache/index.js +1 -1
  111. package/dist/cache/redis-handler.d.ts +1 -1
  112. package/dist/cache/redis-handler.d.ts.map +1 -1
  113. package/dist/cache/stores/cloudflare-kv.d.ts +1 -1
  114. package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -1
  115. package/dist/cache/stores/cloudflare-kv.js.map +1 -1
  116. package/dist/cache/stores/memory.d.ts +1 -1
  117. package/dist/cache/stores/memory.d.ts.map +1 -1
  118. package/dist/cache/stores/memory.js.map +1 -1
  119. package/dist/cache/stores/redis.d.ts +1 -1
  120. package/dist/cache/stores/redis.d.ts.map +1 -1
  121. package/dist/cache/stores/redis.js.map +1 -1
  122. package/dist/cache/stores/vercel.d.ts +1 -1
  123. package/dist/cache/stores/vercel.d.ts.map +1 -1
  124. package/dist/cache/stores/vercel.js.map +1 -1
  125. package/dist/cache/tag-aware-handler.d.ts +2 -2
  126. package/dist/cache/tag-aware-handler.d.ts.map +1 -1
  127. package/dist/cache/timber-cache.d.ts +1 -1
  128. package/dist/cache/timber-cache.d.ts.map +1 -1
  129. package/dist/cdn/cloudflare-purge.d.ts +1 -1
  130. package/dist/cdn/cloudflare-purge.d.ts.map +1 -1
  131. package/dist/cdn/cloudflare-purge.js.map +1 -1
  132. package/dist/cdn/fastly-purge.d.ts +1 -1
  133. package/dist/cdn/fastly-purge.d.ts.map +1 -1
  134. package/dist/cdn/fastly-purge.js.map +1 -1
  135. package/dist/cdn/index.d.ts +4 -4
  136. package/dist/cdn/index.d.ts.map +1 -1
  137. package/dist/cdn/workers-cache-purge.d.ts +5 -1
  138. package/dist/cdn/workers-cache-purge.d.ts.map +1 -1
  139. package/dist/cdn/workers-cache-purge.js.map +1 -1
  140. package/dist/cli-check.d.ts +10 -0
  141. package/dist/cli-check.d.ts.map +1 -1
  142. package/dist/cli.d.ts +12 -4
  143. package/dist/cli.d.ts.map +1 -1
  144. package/dist/cli.js +30 -6
  145. package/dist/cli.js.map +1 -1
  146. package/dist/client/browser-entry/hydrate.d.ts +2 -2
  147. package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
  148. package/dist/client/browser-entry/post-hydration.d.ts +2 -2
  149. package/dist/client/browser-entry/router-init.d.ts +2 -2
  150. package/dist/client/browser-entry/rsc-stream.d.ts +1 -1
  151. package/dist/client/form.d.ts +2 -2
  152. package/dist/client/form.d.ts.map +1 -1
  153. package/dist/client/history.d.ts +2 -2
  154. package/dist/client/index.d.ts +18 -18
  155. package/dist/client/index.d.ts.map +1 -1
  156. package/dist/client/index.js.map +1 -1
  157. package/dist/client/internal.d.ts +19 -19
  158. package/dist/client/internal.d.ts.map +1 -1
  159. package/dist/client/internal.js +11 -15
  160. package/dist/client/internal.js.map +1 -1
  161. package/dist/client/link.d.ts +3 -3
  162. package/dist/client/navigation-commit.d.ts +5 -5
  163. package/dist/client/navigation-root.d.ts +1 -1
  164. package/dist/client/navigation-root.d.ts.map +1 -1
  165. package/dist/client/params-context.d.ts +3 -3
  166. package/dist/client/router-pipeline.d.ts +7 -7
  167. package/dist/client/router-ref.d.ts +1 -1
  168. package/dist/client/router-types.d.ts +6 -6
  169. package/dist/client/router-types.d.ts.map +1 -1
  170. package/dist/client/router.d.ts +1 -1
  171. package/dist/client/rsc-fetch.d.ts +4 -4
  172. package/dist/client/rsc-fetch.d.ts.map +1 -1
  173. package/dist/client/segment-cache.d.ts +2 -2
  174. package/dist/client/slot-provider.d.ts +1 -1
  175. package/dist/client/ssr-data.d.ts +2 -2
  176. package/dist/client/state.d.ts +4 -4
  177. package/dist/client/use-query-states.d.ts +1 -1
  178. package/dist/client/use-segment-params.d.ts +3 -3
  179. package/dist/codec.d.ts +2 -2
  180. package/dist/codec.js.map +1 -1
  181. package/dist/config-types.d.ts +24 -6
  182. package/dist/config-types.d.ts.map +1 -1
  183. package/dist/config-validation.d.ts +1 -1
  184. package/dist/cookies/define-cookie.d.ts +3 -3
  185. package/dist/cookies/index.d.ts +3 -3
  186. package/dist/cookies/index.js +3 -4
  187. package/dist/cookies/index.js.map +1 -1
  188. package/dist/cookies/json-cookie.d.ts +1 -1
  189. package/dist/dev-tools/404-page.d.ts +2 -2
  190. package/dist/dev-tools/error-page.d.ts +2 -2
  191. package/dist/dev-tools/index.d.ts +12 -12
  192. package/dist/dev-tools/instrumentation.d.ts +1 -1
  193. package/dist/dev-tools/logs.d.ts +1 -1
  194. package/dist/dev-tools/overlay.d.ts +2 -2
  195. package/dist/dev-tools/terminal.d.ts +1 -1
  196. package/dist/fonts/ast.d.ts +4 -4
  197. package/dist/fonts/bundle.d.ts +3 -3
  198. package/dist/fonts/css.d.ts +1 -1
  199. package/dist/fonts/dev-middleware.d.ts +1 -1
  200. package/dist/fonts/google.d.ts +1 -1
  201. package/dist/fonts/local.d.ts +1 -1
  202. package/dist/fonts/pipeline.d.ts +3 -3
  203. package/dist/fonts/transform.d.ts +2 -2
  204. package/dist/fonts/types.d.ts +1 -1
  205. package/dist/fonts/virtual-modules.d.ts +1 -1
  206. package/dist/index.d.ts +3 -3
  207. package/dist/index.d.ts.map +1 -1
  208. package/dist/index.js +816 -310
  209. package/dist/index.js.map +1 -1
  210. package/dist/params/codec-registry.d.ts +1 -1
  211. package/dist/params/define-schema.d.ts +2 -2
  212. package/dist/params/index.d.ts +4 -4
  213. package/dist/params/index.js.map +1 -1
  214. package/dist/params/resolve-schema.d.ts +1 -1
  215. package/dist/plugin-context.d.ts +9 -9
  216. package/dist/plugin-context.d.ts.map +1 -1
  217. package/dist/plugins/adapter-build.d.ts +2 -2
  218. package/dist/plugins/build-manifest.d.ts +2 -2
  219. package/dist/plugins/build-report.d.ts +5 -5
  220. package/dist/plugins/cache.d.ts +1 -1
  221. package/dist/plugins/callsite-jsx.d.ts +2 -2
  222. package/dist/plugins/chunks.d.ts +1 -1
  223. package/dist/plugins/chunks.d.ts.map +1 -1
  224. package/dist/plugins/cloudflare-wasm.d.ts +1 -1
  225. package/dist/plugins/content.d.ts +1 -1
  226. package/dist/plugins/content.d.ts.map +1 -1
  227. package/dist/plugins/dev-discovery.d.ts +123 -0
  228. package/dist/plugins/dev-discovery.d.ts.map +1 -0
  229. package/dist/plugins/dev-server.d.ts +1 -1
  230. package/dist/plugins/dev-server.d.ts.map +1 -1
  231. package/dist/plugins/entries.d.ts +1 -1
  232. package/dist/plugins/fonts.d.ts +3 -3
  233. package/dist/plugins/fonts.d.ts.map +1 -1
  234. package/dist/plugins/graph-endpoint.d.ts +112 -0
  235. package/dist/plugins/graph-endpoint.d.ts.map +1 -0
  236. package/dist/plugins/mdx.d.ts +18 -5
  237. package/dist/plugins/mdx.d.ts.map +1 -1
  238. package/dist/plugins/prebuilt-capture.d.ts +2 -2
  239. package/dist/plugins/prebuilt-options-analysis.d.ts +1 -1
  240. package/dist/plugins/prebuilt.d.ts +1 -1
  241. package/dist/plugins/prerender-sugar.d.ts +11 -14
  242. package/dist/plugins/prerender-sugar.d.ts.map +1 -1
  243. package/dist/plugins/request-dep/analysis.d.ts +1 -1
  244. package/dist/plugins/request-dep/index.d.ts +5 -5
  245. package/dist/plugins/request-dep/origin.d.ts +1 -1
  246. package/dist/plugins/routing.d.ts +1 -1
  247. package/dist/plugins/routing.d.ts.map +1 -1
  248. package/dist/plugins/server-bundle.d.ts.map +1 -1
  249. package/dist/plugins/shims.d.ts +1 -1
  250. package/dist/plugins/shims.d.ts.map +1 -1
  251. package/dist/plugins/static-build.d.ts +5 -5
  252. package/dist/routing/codegen-shared.d.ts +1 -1
  253. package/dist/routing/codegen-write.d.ts +1 -1
  254. package/dist/routing/codegen.d.ts +1 -1
  255. package/dist/routing/collision-probe.d.ts +1 -1
  256. package/dist/routing/collision-spaces.d.ts +1 -1
  257. package/dist/routing/convention-lint.d.ts +1 -1
  258. package/dist/routing/convention-lint.d.ts.map +1 -1
  259. package/dist/routing/index.d.ts +13 -13
  260. package/dist/routing/index.js +3 -3
  261. package/dist/routing/interception.d.ts +1 -1
  262. package/dist/routing/interception.d.ts.map +1 -1
  263. package/dist/routing/link-codegen.d.ts +1 -1
  264. package/dist/routing/manifest-codegen.d.ts +1 -1
  265. package/dist/routing/scanner.d.ts +14 -1
  266. package/dist/routing/scanner.d.ts.map +1 -1
  267. package/dist/routing/schema-validation.d.ts +1 -1
  268. package/dist/routing/segment-classify.d.ts +1 -1
  269. package/dist/routing/segment-codegen.d.ts +1 -1
  270. package/dist/routing/segment-keys.d.ts +1 -1
  271. package/dist/routing/slot-placement.d.ts +1 -1
  272. package/dist/routing/walkers.d.ts +1 -1
  273. package/dist/rsc-runtime/transforms.d.ts +13 -0
  274. package/dist/rsc-runtime/transforms.d.ts.map +1 -0
  275. package/dist/schema-bridge.d.ts +1 -1
  276. package/dist/search-params/define.d.ts +3 -3
  277. package/dist/search-params/index.d.ts +3 -3
  278. package/dist/search-params/index.js.map +1 -1
  279. package/dist/search-params/wrappers.d.ts +1 -1
  280. package/dist/server/access-gate.d.ts +1 -1
  281. package/dist/server/action-client.d.ts +1 -1
  282. package/dist/server/action-handler.d.ts +5 -5
  283. package/dist/server/actions.d.ts +2 -2
  284. package/dist/server/als-registry.d.ts +8 -8
  285. package/dist/server/asset-headers.d.ts +1 -1
  286. package/dist/server/chain-url-parts.d.ts +3 -3
  287. package/dist/server/children-interception.d.ts +2 -2
  288. package/dist/server/cookie-context.d.ts +1 -1
  289. package/dist/server/cookie-parsing.d.ts +2 -2
  290. package/dist/server/default-logger.d.ts +1 -1
  291. package/dist/server/deny-boundary.d.ts +2 -2
  292. package/dist/server/deny-renderer.d.ts +5 -5
  293. package/dist/server/early-hints.d.ts +1 -1
  294. package/dist/server/error-boundary-wrapper.d.ts +2 -4
  295. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  296. package/dist/server/fallback-error.d.ts +5 -5
  297. package/dist/server/flight-injection-state.d.ts +1 -1
  298. package/dist/server/form-flash.d.ts +1 -1
  299. package/dist/server/html-injector-core.d.ts +2 -2
  300. package/dist/server/html-injectors.d.ts +1 -1
  301. package/dist/server/index.d.ts +18 -18
  302. package/dist/server/index.d.ts.map +1 -1
  303. package/dist/server/index.js +33 -32
  304. package/dist/server/index.js.map +1 -1
  305. package/dist/server/instrumentation.d.ts +1 -1
  306. package/dist/server/internal.d.ts +50 -50
  307. package/dist/server/internal.d.ts.map +1 -1
  308. package/dist/server/internal.js +1023 -1025
  309. package/dist/server/internal.js.map +1 -1
  310. package/dist/server/metadata-collector.d.ts +2 -2
  311. package/dist/server/metadata-platform.d.ts +2 -2
  312. package/dist/server/metadata-render.d.ts +2 -2
  313. package/dist/server/metadata-routes.d.ts +3 -3
  314. package/dist/server/metadata-social.d.ts +2 -2
  315. package/dist/server/metadata.d.ts +2 -2
  316. package/dist/server/middleware-runner.d.ts +1 -1
  317. package/dist/server/node-stream-transforms.d.ts +1 -1
  318. package/dist/server/param-coercion.d.ts +4 -4
  319. package/dist/server/pipeline-helpers.d.ts +3 -3
  320. package/dist/server/pipeline-interception.d.ts +1 -1
  321. package/dist/server/pipeline-metadata.d.ts +1 -1
  322. package/dist/server/pipeline-outcome.d.ts +2 -2
  323. package/dist/server/pipeline-phases.d.ts +3 -3
  324. package/dist/server/pipeline-phases.d.ts.map +1 -1
  325. package/dist/server/pipeline.d.ts +9 -9
  326. package/dist/server/prebuilt/cache-key.d.ts +1 -1
  327. package/dist/server/prebuilt/capture-state.d.ts +1 -1
  328. package/dist/server/prebuilt/key-discipline.d.ts +1 -1
  329. package/dist/server/prebuilt/manifest-tag-index.d.ts +1 -1
  330. package/dist/server/prebuilt/overlay.d.ts +2 -2
  331. package/dist/server/prebuilt/payload-source.d.ts +1 -1
  332. package/dist/server/prebuilt/slots.d.ts +1 -1
  333. package/dist/server/prebuilt/synthetic-store.d.ts +2 -2
  334. package/dist/server/prebuilt-builder.d.ts +2 -2
  335. package/dist/server/primitives.d.ts +2 -2
  336. package/dist/server/publish-params.d.ts +1 -1
  337. package/dist/server/request-context.d.ts +3 -3
  338. package/dist/server/route-element-builder.d.ts +16 -6
  339. package/dist/server/route-element-builder.d.ts.map +1 -1
  340. package/dist/server/route-handler.d.ts +1 -1
  341. package/dist/server/route-matcher.d.ts +4 -4
  342. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -1
  343. package/dist/server/rsc-entry/action-middleware-runner.d.ts +2 -2
  344. package/dist/server/rsc-entry/api-handler.d.ts +1 -1
  345. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  346. package/dist/server/rsc-entry/deny-fallback.d.ts +3 -3
  347. package/dist/server/rsc-entry/error-renderer.d.ts +4 -4
  348. package/dist/server/rsc-entry/helpers.d.ts +6 -6
  349. package/dist/server/rsc-entry/index.d.ts +7 -6
  350. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  351. package/dist/server/rsc-entry/render-route.d.ts +4 -4
  352. package/dist/server/rsc-entry/revalidate-renderer.d.ts +4 -4
  353. package/dist/server/rsc-entry/rsc-payload.d.ts +4 -4
  354. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  355. package/dist/server/rsc-entry/rsc-stream.d.ts +3 -3
  356. package/dist/server/rsc-entry/ssr-bridge.d.ts +1 -1
  357. package/dist/server/rsc-entry/ssr-renderer.d.ts +7 -7
  358. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +5 -5
  359. package/dist/server/sitemap-generator.d.ts +2 -2
  360. package/dist/server/sitemap-handler.d.ts +1 -1
  361. package/dist/server/skippable-prefix.d.ts +3 -3
  362. package/dist/server/slot-interception.d.ts +2 -2
  363. package/dist/server/slot-resolver.d.ts +3 -7
  364. package/dist/server/slot-resolver.d.ts.map +1 -1
  365. package/dist/server/ssr-bridge-types.d.ts +2 -2
  366. package/dist/server/ssr-entry.d.ts +1 -1
  367. package/dist/server/static-generator.d.ts +1 -1
  368. package/dist/server/static-not-found.d.ts +1 -1
  369. package/dist/server/status-code-resolver.d.ts +1 -1
  370. package/dist/server/tracing.d.ts +3 -3
  371. package/dist/server/tree-builder.d.ts +3 -3
  372. package/dist/server/tree-match.d.ts +1 -1
  373. package/dist/server/types.d.ts +2 -2
  374. package/dist/server/utils/mdx-file.d.ts +2 -0
  375. package/dist/server/utils/mdx-file.d.ts.map +1 -1
  376. package/dist/server/workers-cache-bridge.d.ts +1 -1
  377. package/dist/shared/als-slots.d.ts +1 -1
  378. package/dist/shared/payload-root.d.ts +2 -2
  379. package/dist/shared/rsc-media-type.d.ts +12 -0
  380. package/dist/shared/rsc-media-type.d.ts.map +1 -1
  381. package/dist/shared/slot-params.d.ts +1 -1
  382. package/dist/shims/font-google.d.ts +1 -1
  383. package/dist/shims/font-google.js.map +1 -1
  384. package/dist/shims/font-local.d.ts +1 -1
  385. package/dist/shims/font-local.js.map +1 -1
  386. package/dist/shims/navigation-client.d.ts +4 -4
  387. package/dist/shims/navigation.d.ts +2 -2
  388. package/docs/api/34-api-config.mdx +9 -8
  389. package/docs/api/36-cli.mdx +23 -3
  390. package/docs/learn/11-error-handling.mdx +11 -0
  391. package/docs/more/01-advanced-routing.mdx +1 -0
  392. package/docs/more/04b-mdx.mdx +38 -18
  393. package/package.json +23 -18
  394. package/src/adapters/build-output-helper.ts +4 -4
  395. package/src/adapters/cloudflare-dev.ts +7 -1
  396. package/src/adapters/cloudflare-kv-cache.ts +11 -8
  397. package/src/adapters/cloudflare.ts +21 -15
  398. package/src/adapters/compress-module.ts +2 -2
  399. package/src/adapters/nitro-presets.ts +139 -0
  400. package/src/adapters/nitro-preview.ts +340 -0
  401. package/src/adapters/nitro.ts +100 -465
  402. package/src/adapters/shared.ts +1 -1
  403. package/src/analyze/chains.ts +411 -0
  404. package/src/analyze/classify.ts +258 -0
  405. package/src/analyze/crawl-entry.ts +68 -0
  406. package/src/analyze/crawl.ts +500 -0
  407. package/src/analyze/graph-cache.ts +332 -0
  408. package/src/analyze/graph-command.ts +762 -0
  409. package/src/analyze/live-graph.ts +232 -0
  410. package/src/analyze/poison-rules.ts +165 -0
  411. package/src/analyze/poison-scan.ts +162 -0
  412. package/src/analyze/scan.ts +149 -0
  413. package/src/cache/cache-api.ts +7 -7
  414. package/src/cache/index.ts +9 -9
  415. package/src/cache/redis-handler.ts +2 -2
  416. package/src/cache/stores/cloudflare-kv.ts +1 -1
  417. package/src/cache/stores/memory.ts +2 -2
  418. package/src/cache/stores/redis.ts +1 -1
  419. package/src/cache/stores/vercel.ts +1 -1
  420. package/src/cache/tag-aware-handler.ts +2 -2
  421. package/src/cache/timber-cache.ts +8 -8
  422. package/src/cdn/cloudflare-purge.ts +1 -1
  423. package/src/cdn/fastly-purge.ts +1 -1
  424. package/src/cdn/index.ts +10 -4
  425. package/src/cdn/workers-cache-purge.ts +6 -2
  426. package/src/cli-check.ts +53 -4
  427. package/src/cli-schema-sync.ts +3 -3
  428. package/src/cli.ts +50 -11
  429. package/src/client/browser-dev.ts +1 -1
  430. package/src/client/browser-entry/action-dispatch.ts +5 -5
  431. package/src/client/browser-entry/hmr.ts +1 -1
  432. package/src/client/browser-entry/hydrate.ts +9 -9
  433. package/src/client/browser-entry/index.ts +10 -10
  434. package/src/client/browser-entry/post-hydration.ts +5 -5
  435. package/src/client/browser-entry/router-init.ts +9 -9
  436. package/src/client/browser-entry/rsc-stream.ts +3 -3
  437. package/src/client/error-boundary.tsx +4 -4
  438. package/src/client/form.tsx +7 -2
  439. package/src/client/history.ts +2 -2
  440. package/src/client/index.ts +21 -18
  441. package/src/client/internal.ts +19 -19
  442. package/src/client/link.tsx +9 -9
  443. package/src/client/navigation-api.ts +1 -1
  444. package/src/client/navigation-commit.ts +5 -5
  445. package/src/client/navigation-context.ts +1 -1
  446. package/src/client/navigation-root.tsx +1 -1
  447. package/src/client/nuqs-adapter.tsx +2 -2
  448. package/src/client/params-context.ts +4 -4
  449. package/src/client/router-effects.ts +3 -3
  450. package/src/client/router-lifecycle.ts +2 -2
  451. package/src/client/router-pipeline.ts +10 -10
  452. package/src/client/router-ref.ts +2 -2
  453. package/src/client/router-skew.ts +2 -2
  454. package/src/client/router-types.ts +6 -6
  455. package/src/client/router.ts +13 -13
  456. package/src/client/rsc-fetch.ts +11 -16
  457. package/src/client/segment-cache.ts +2 -2
  458. package/src/client/segment-outlet.tsx +1 -1
  459. package/src/client/shallow-url.ts +1 -1
  460. package/src/client/slot-outlet.tsx +1 -1
  461. package/src/client/slot-provider.tsx +1 -1
  462. package/src/client/ssr-data.ts +3 -3
  463. package/src/client/stale-client.ts +1 -1
  464. package/src/client/state.ts +4 -4
  465. package/src/client/top-loader.tsx +1 -1
  466. package/src/client/unload-guard.ts +1 -1
  467. package/src/client/use-cookie.ts +2 -2
  468. package/src/client/use-pathname.ts +2 -2
  469. package/src/client/use-pending-navigation.ts +1 -1
  470. package/src/client/use-query-states.ts +3 -3
  471. package/src/client/use-router.ts +2 -2
  472. package/src/client/use-search-params.ts +3 -3
  473. package/src/client/use-segment-params.ts +6 -6
  474. package/src/client/use-selected-layout-segment.ts +2 -2
  475. package/src/codec.ts +2 -2
  476. package/src/config-types.ts +27 -7
  477. package/src/config-validation.ts +1 -1
  478. package/src/cookies/define-cookie.ts +6 -6
  479. package/src/cookies/index.ts +3 -3
  480. package/src/cookies/json-cookie.ts +1 -1
  481. package/src/dev-tools/404-page.ts +4 -4
  482. package/src/dev-tools/dev-page-shell.ts +1 -1
  483. package/src/dev-tools/error-page.ts +4 -4
  484. package/src/dev-tools/index.ts +12 -12
  485. package/src/dev-tools/instrumentation.ts +1 -1
  486. package/src/dev-tools/logs.ts +1 -1
  487. package/src/dev-tools/overlay.ts +3 -3
  488. package/src/dev-tools/terminal.ts +2 -2
  489. package/src/fonts/ast.ts +5 -5
  490. package/src/fonts/bundle.ts +5 -5
  491. package/src/fonts/css.ts +1 -1
  492. package/src/fonts/dev-middleware.ts +2 -2
  493. package/src/fonts/google.ts +2 -2
  494. package/src/fonts/local.ts +4 -4
  495. package/src/fonts/pipeline.ts +8 -8
  496. package/src/fonts/transform.ts +5 -5
  497. package/src/fonts/types.ts +1 -1
  498. package/src/fonts/virtual-modules.ts +1 -1
  499. package/src/index.ts +46 -37
  500. package/src/params/codec-registry.ts +1 -1
  501. package/src/params/define-schema.ts +2 -2
  502. package/src/params/index.ts +4 -4
  503. package/src/params/resolve-schema.ts +2 -2
  504. package/src/plugin-context.ts +10 -10
  505. package/src/plugins/adapter-build.ts +5 -5
  506. package/src/plugins/build-manifest.ts +4 -4
  507. package/src/plugins/build-report.ts +6 -6
  508. package/src/plugins/cache.ts +3 -3
  509. package/src/plugins/callsite-ast.ts +1 -1
  510. package/src/plugins/callsite-jsx.ts +2 -2
  511. package/src/plugins/chunks.ts +1 -1
  512. package/src/plugins/cloudflare-wasm.ts +1 -1
  513. package/src/plugins/content.ts +5 -1
  514. package/src/plugins/dev-discovery.ts +218 -0
  515. package/src/plugins/dev-server.ts +97 -12
  516. package/src/plugins/entries.ts +1 -1
  517. package/src/plugins/fonts.ts +17 -10
  518. package/src/plugins/graph-endpoint.ts +532 -0
  519. package/src/plugins/mdx.ts +73 -38
  520. package/src/plugins/prebuilt-capture.ts +3 -3
  521. package/src/plugins/prebuilt-options-analysis.ts +1 -1
  522. package/src/plugins/prebuilt.ts +7 -7
  523. package/src/plugins/prerender-sugar.ts +11 -19
  524. package/src/plugins/request-dep/analysis.ts +1 -1
  525. package/src/plugins/request-dep/index.ts +8 -8
  526. package/src/plugins/request-dep/origin.ts +1 -1
  527. package/src/plugins/routing.ts +12 -7
  528. package/src/plugins/server-bundle.ts +11 -3
  529. package/src/plugins/shims.ts +16 -31
  530. package/src/plugins/static-build.ts +10 -10
  531. package/src/routing/codegen-shared.ts +1 -1
  532. package/src/routing/codegen-write.ts +3 -3
  533. package/src/routing/codegen.ts +14 -5
  534. package/src/routing/collision-probe.ts +3 -3
  535. package/src/routing/collision-spaces.ts +3 -3
  536. package/src/routing/convention-lint.ts +136 -6
  537. package/src/routing/export-detect.ts +1 -1
  538. package/src/routing/index.ts +13 -13
  539. package/src/routing/interception.ts +41 -4
  540. package/src/routing/link-codegen.ts +3 -3
  541. package/src/routing/manifest-codegen.ts +2 -2
  542. package/src/routing/scanner.ts +33 -9
  543. package/src/routing/schema-validation.ts +4 -4
  544. package/src/routing/segment-classify.ts +2 -2
  545. package/src/routing/segment-codegen.ts +1 -1
  546. package/src/routing/segment-keys.ts +1 -1
  547. package/src/routing/slot-placement.ts +1 -1
  548. package/src/routing/walkers.ts +1 -1
  549. package/src/rsc-runtime/transforms.ts +13 -0
  550. package/src/rsc-runtime/vendor-types.d.ts +12 -0
  551. package/src/schema-bridge.ts +1 -1
  552. package/src/search-params/define.ts +8 -8
  553. package/src/search-params/index.ts +3 -3
  554. package/src/search-params/wrappers.ts +3 -3
  555. package/src/server/access-gate.tsx +6 -6
  556. package/src/server/action-client.ts +5 -5
  557. package/src/server/action-handler.ts +16 -16
  558. package/src/server/actions.ts +5 -5
  559. package/src/server/als-registry.ts +8 -8
  560. package/src/server/asset-headers.ts +2 -2
  561. package/src/server/chain-url-parts.ts +5 -5
  562. package/src/server/children-interception.ts +4 -4
  563. package/src/server/compress.ts +1 -1
  564. package/src/server/cookie-context.ts +4 -4
  565. package/src/server/cookie-parsing.ts +2 -2
  566. package/src/server/default-logger.ts +3 -3
  567. package/src/server/deny-boundary.ts +10 -10
  568. package/src/server/deny-renderer.ts +38 -25
  569. package/src/server/early-hints-sender.ts +2 -2
  570. package/src/server/early-hints.ts +2 -2
  571. package/src/server/error-boundary-wrapper.ts +4 -12
  572. package/src/server/fallback-error.ts +13 -13
  573. package/src/server/flight-injection-state.ts +1 -1
  574. package/src/server/form-flash.ts +2 -2
  575. package/src/server/html-injector-core.ts +4 -4
  576. package/src/server/html-injectors.ts +5 -5
  577. package/src/server/index.ts +18 -18
  578. package/src/server/instrumentation.ts +1 -1
  579. package/src/server/internal.ts +50 -50
  580. package/src/server/logger.ts +4 -4
  581. package/src/server/metadata-collector.ts +7 -7
  582. package/src/server/metadata-platform.ts +2 -2
  583. package/src/server/metadata-render.ts +4 -4
  584. package/src/server/metadata-routes.ts +3 -3
  585. package/src/server/metadata-social.ts +2 -2
  586. package/src/server/metadata.ts +2 -2
  587. package/src/server/middleware-runner.ts +1 -1
  588. package/src/server/node-stream-transforms.ts +4 -4
  589. package/src/server/param-coercion.ts +8 -8
  590. package/src/server/pipeline-helpers.ts +7 -7
  591. package/src/server/pipeline-interception.ts +2 -2
  592. package/src/server/pipeline-metadata.ts +1 -1
  593. package/src/server/pipeline-outcome.ts +8 -8
  594. package/src/server/pipeline-phases.ts +24 -28
  595. package/src/server/pipeline.ts +22 -22
  596. package/src/server/prebuilt/cache-key.ts +1 -1
  597. package/src/server/prebuilt/capture-state.ts +1 -1
  598. package/src/server/prebuilt/key-discipline.ts +1 -1
  599. package/src/server/prebuilt/manifest-tag-index.ts +1 -1
  600. package/src/server/prebuilt/overlay.ts +6 -6
  601. package/src/server/prebuilt/payload-source.ts +2 -2
  602. package/src/server/prebuilt/slots.ts +5 -5
  603. package/src/server/prebuilt/synthetic-store.ts +2 -2
  604. package/src/server/prebuilt-builder.ts +16 -16
  605. package/src/server/prebuilt-runtime.ts +12 -12
  606. package/src/server/primitives.ts +7 -7
  607. package/src/server/publish-params.ts +3 -3
  608. package/src/server/request-context.ts +7 -7
  609. package/src/server/route-element-builder.ts +108 -50
  610. package/src/server/route-handler.ts +4 -4
  611. package/src/server/route-matcher.ts +5 -5
  612. package/src/server/rsc-cache-key-guard.ts +3 -5
  613. package/src/server/rsc-entry/action-middleware-runner.ts +7 -7
  614. package/src/server/rsc-entry/api-handler.ts +18 -9
  615. package/src/server/rsc-entry/deny-fallback.ts +10 -10
  616. package/src/server/rsc-entry/error-renderer.ts +27 -27
  617. package/src/server/rsc-entry/helpers.ts +10 -10
  618. package/src/server/rsc-entry/index.ts +51 -47
  619. package/src/server/rsc-entry/render-route.ts +20 -20
  620. package/src/server/rsc-entry/revalidate-renderer.ts +12 -12
  621. package/src/server/rsc-entry/rsc-payload.ts +19 -15
  622. package/src/server/rsc-entry/rsc-stream.ts +8 -8
  623. package/src/server/rsc-entry/ssr-bridge.ts +3 -3
  624. package/src/server/rsc-entry/ssr-renderer.ts +23 -23
  625. package/src/server/rsc-entry/wrap-action-dispatch.ts +9 -9
  626. package/src/server/rsc-prop-warnings.ts +1 -1
  627. package/src/server/sensitive-fields.ts +1 -1
  628. package/src/server/server-timing.ts +1 -1
  629. package/src/server/sitemap-generator.ts +3 -3
  630. package/src/server/sitemap-handler.ts +3 -3
  631. package/src/server/skippable-prefix.ts +7 -7
  632. package/src/server/slot-interception.ts +5 -5
  633. package/src/server/slot-resolver.ts +20 -28
  634. package/src/server/ssr-bridge-types.ts +2 -2
  635. package/src/server/ssr-entry.ts +18 -18
  636. package/src/server/ssr-render.ts +4 -4
  637. package/src/server/ssr-wrappers.tsx +1 -1
  638. package/src/server/state-tree-diff.ts +1 -1
  639. package/src/server/static-generator.ts +6 -6
  640. package/src/server/static-not-found.ts +3 -3
  641. package/src/server/status-code-resolver.ts +1 -1
  642. package/src/server/tracing.ts +5 -5
  643. package/src/server/tree-builder.ts +4 -4
  644. package/src/server/tree-match.ts +1 -1
  645. package/src/server/types.ts +2 -2
  646. package/src/server/utils/mdx-file.ts +2 -2
  647. package/src/server/waituntil-bridge.ts +1 -1
  648. package/src/server/workers-cache-bridge.ts +2 -2
  649. package/src/shared/als-slots.ts +1 -1
  650. package/src/shared/payload-root.ts +2 -2
  651. package/src/shared/rsc-media-type.ts +16 -0
  652. package/src/shared/slot-params.ts +1 -1
  653. package/src/shims/font-google.ts +1 -1
  654. package/src/shims/font-local.ts +1 -1
  655. package/src/shims/navigation-client.ts +5 -5
  656. package/src/shims/navigation.ts +2 -2
  657. package/LICENSE +0 -8
  658. package/dist/_chunks/actions-BjbbNRFN.js.map +0 -1
  659. package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +0 -1
  660. package/dist/_chunks/cache-api-DllJ-Lyw.js.map +0 -1
  661. package/dist/_chunks/cli-check-DJZDc22E.js.map +0 -1
  662. package/dist/_chunks/convention-lint-CpteIpTm.js.map +0 -1
  663. package/dist/_chunks/dist-BA3u1z3W.js +0 -423
  664. package/dist/_chunks/dist-BA3u1z3W.js.map +0 -1
  665. package/dist/_chunks/mdx-file-C005ay-P.js.map +0 -1
  666. package/dist/_chunks/plugin-context-rCinWLiE.js.map +0 -1
  667. package/dist/_chunks/scanner-CAietmj4.js.map +0 -1
  668. package/dist/content/index.d.ts +0 -2
  669. package/dist/content/index.d.ts.map +0 -1
  670. package/dist/content/index.js +0 -0
  671. package/src/content/index.ts +0 -5
  672. package/src/shims/server-only-noop.js +0 -6
@@ -0,0 +1,149 @@
1
+ /**
2
+ * scan — project source-file disk scan shared by the crawl and the
3
+ * graph cache.
4
+ *
5
+ * One walker, one rule set: the crawl uses it to find files no graph
6
+ * reached (the provisional/pending set) and to bound graph membership,
7
+ * and the mtime-keyed graph cache fingerprints exactly the same file
8
+ * set — the three can never disagree about what "the project" is (a
9
+ * file the crawl classifies but the fingerprint ignores would make the
10
+ * cache silently stale).
11
+ *
12
+ * Skip rules are deliberately shallow: timber's router excludes only
13
+ * `_`-prefixed directories, so `app/.well-known/page.tsx` and
14
+ * `app/dist/page.tsx` are REAL routes — a rule that skipped `dist` or
15
+ * dot-directories at any depth would hide legitimate route files from
16
+ * the scan while the module graph still reached them (codex review,
17
+ * PR #1056). Therefore:
18
+ *
19
+ * - `node_modules` is skipped at ANY depth (never project source, and
20
+ * graph membership excludes it identically)
21
+ * - dot-prefixed and build-output directories (`dist`, `coverage`, …)
22
+ * are skipped only as the FIRST path segment under the root — that
23
+ * is where `.git`, `.timber`, `.wrangler`, and real build outputs
24
+ * live; deeper occurrences are walked
25
+ *
26
+ * Deliberately vite-free: the cache-hit path of `timber graph` reads
27
+ * this module without booting (or even importing) Vite.
28
+ *
29
+ * Design docs: 47-module-environment-tooling.md §2, §Cold-path policy.
30
+ */
31
+
32
+ import { readdir } from 'node:fs/promises';
33
+ import { join } from 'node:path';
34
+
35
+ /**
36
+ * Slash-normalize a Windows path — Vite's `normalizePath` for the
37
+ * vite-free callers (the graph cache-hit path must not import Vite).
38
+ * Same platform guard as Vite's: posix paths pass through untouched,
39
+ * so a filename containing a literal backslash is never corrupted.
40
+ */
41
+ export const normalizeSlashes: (path: string) => string =
42
+ process.platform === 'win32' ? (path) => path.replace(/\\/g, '/') : (path) => path;
43
+
44
+ /** A scan failure the caller records instead of swallowing. */
45
+ export interface ScanFailure {
46
+ dir: string;
47
+ message: string;
48
+ }
49
+
50
+ /**
51
+ * Directories never scanned when they are the first path segment under
52
+ * the root. `node_modules` is additionally skipped at any depth.
53
+ */
54
+ export const SCAN_IGNORED_DIRS = new Set(['node_modules', 'dist', 'test-results', 'coverage']);
55
+
56
+ /**
57
+ * Single source of truth for builtin source extensions. Includes mdx —
58
+ * timber supports page.mdx via pageExtensions, so an unreferenced MDX
59
+ * page must not vanish from --all output.
60
+ */
61
+ const BUILTIN_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'mts', 'cts', 'mdx'] as const;
62
+
63
+ /** Regex form of BUILTIN_EXTENSIONS for file-basename matching. */
64
+ export const SOURCE_EXTENSIONS = new RegExp(`\\.(?:${BUILTIN_EXTENSIONS.join('|')})$`);
65
+
66
+ /** Set form for O(1) membership checks. */
67
+ const BUILTIN_EXTENSION_SET = new Set<string>(BUILTIN_EXTENSIONS);
68
+
69
+ /**
70
+ * Build a regex that matches SOURCE_EXTENSIONS plus any extra
71
+ * extensions from the user's pageExtensions config. Returns the
72
+ * builtin regex unchanged when nothing new is added.
73
+ */
74
+ export function buildSourceExtensions(pageExtensions?: readonly string[]): RegExp {
75
+ if (!pageExtensions) return SOURCE_EXTENSIONS;
76
+ const extras = pageExtensions.filter((ext) => !BUILTIN_EXTENSION_SET.has(ext));
77
+ if (extras.length === 0) return SOURCE_EXTENSIONS;
78
+ const escaped = extras.map((ext) => ext.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
79
+ return new RegExp(`\\.(?:${BUILTIN_EXTENSIONS.join('|')}|${escaped.join('|')})$`);
80
+ }
81
+
82
+ /** Whether a directory SEGMENT is skipped at the given depth (0 = root child). */
83
+ function isSkippedDirSegment(segment: string, depth: number): boolean {
84
+ if (segment === 'node_modules') return true;
85
+ if (depth === 0 && (segment.startsWith('.') || SCAN_IGNORED_DIRS.has(segment))) return true;
86
+ return false;
87
+ }
88
+
89
+ /** Whether a file basename is admitted as project source. */
90
+ function isSourceBasename(base: string, depth: number, extensions?: RegExp): boolean {
91
+ if (depth === 0 && base.startsWith('.')) return false;
92
+ if (!(extensions ?? SOURCE_EXTENSIONS).test(base)) return false;
93
+ // Declaration files are types-only — they never run in any environment.
94
+ if (/\.d\.[mc]?ts$/.test(base)) return false;
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Whether an absolute, slash-normalized path is one the scanner WOULD
100
+ * admit — the same segment rules the walker applies, so a
101
+ * directly-addressed path (`package.json`, `<root>/dist/generated.js`,
102
+ * `types.d.ts`, a nested node_modules file) is answered exactly the
103
+ * way the scan-based sweep would answer it: by exclusion. Existence
104
+ * and is-a-file checks remain the caller's (this is pure path logic).
105
+ */
106
+ export function isScannableSourceFile(file: string, root: string, extensions?: RegExp): boolean {
107
+ if (!file.startsWith(root + '/')) return false;
108
+ const segments = file.slice(root.length + 1).split('/');
109
+ const base = segments[segments.length - 1];
110
+ for (let depth = 0; depth < segments.length - 1; depth++) {
111
+ if (isSkippedDirSegment(segments[depth], depth)) return false;
112
+ }
113
+ return isSourceBasename(base, segments.length - 1, extensions);
114
+ }
115
+
116
+ /**
117
+ * Recursively list project source files on disk.
118
+ *
119
+ * Unreadable directories are reported through `onFailure`, not thrown
120
+ * and not swallowed — this walker exists to keep files from silently
121
+ * vanishing, so a directory it cannot see must be visible too.
122
+ */
123
+ export async function scanProjectSourceFiles(
124
+ dir: string,
125
+ out: string[],
126
+ onFailure: (failure: ScanFailure) => void,
127
+ depth = 0,
128
+ extensions?: RegExp
129
+ ): Promise<void> {
130
+ let entries;
131
+ try {
132
+ entries = await readdir(dir, { withFileTypes: true });
133
+ } catch (error) {
134
+ onFailure({
135
+ dir,
136
+ message: `directory scan failed: ${error instanceof Error ? error.message : String(error)}`,
137
+ });
138
+ return;
139
+ }
140
+ for (const entry of entries) {
141
+ const full = join(dir, entry.name);
142
+ if (entry.isDirectory()) {
143
+ if (isSkippedDirSegment(entry.name, depth)) continue;
144
+ await scanProjectSourceFiles(full, out, onFailure, depth + 1, extensions);
145
+ } else if (entry.isFile() && isSourceBasename(entry.name, depth, extensions)) {
146
+ out.push(full);
147
+ }
148
+ }
149
+ }
@@ -1,10 +1,10 @@
1
- import type { CacheOptions } from './index';
2
- import type { PrebuiltComponentOptions } from '../server/prebuilt-runtime';
3
- import { createCache } from './timber-cache';
4
- import { getCacheHandler } from './handler-store';
5
- import { recordInvalidation } from './invalidation-epoch';
6
- import { writeTombstonesForTag } from '../server/prebuilt/overlay.js';
7
- import { getCdnPurgeHandler } from '../cdn/purge-store.js';
1
+ import type { CacheOptions } from './index.ts';
2
+ import type { PrebuiltComponentOptions } from '../server/prebuilt-runtime.ts';
3
+ import { createCache } from './timber-cache.ts';
4
+ import { getCacheHandler } from './handler-store.ts';
5
+ import { recordInvalidation } from './invalidation-epoch.ts';
6
+ import { writeTombstonesForTag } from '../server/prebuilt/overlay.ts';
7
+ import { getCdnPurgeHandler } from '../cdn/purge-store.ts';
8
8
 
9
9
  const componentFallbackWarned = new WeakSet<object>();
10
10
 
@@ -1,6 +1,6 @@
1
1
  // @timber-js/app/cache — Caching primitives
2
2
 
3
- import { estimateByteSize } from './sizeof.js';
3
+ import { estimateByteSize } from './sizeof.ts';
4
4
 
5
5
  export interface CacheHandler {
6
6
  get(key: string): Promise<{ value: unknown; stale: boolean } | null>;
@@ -166,18 +166,18 @@ export class MemoryCacheHandler implements CacheHandler {
166
166
  }
167
167
  }
168
168
 
169
- export { RedisCacheHandler } from './redis-handler';
170
- export type { RedisClient, RedisWriteOp } from './redis-handler';
171
- export { cache } from './cache-api';
172
- export { setCacheHandler, getCacheHandler } from './handler-store';
173
- export { setDefaultSingleflightTimeout } from './timber-cache';
169
+ export { RedisCacheHandler } from './redis-handler.ts';
170
+ export type { RedisClient, RedisWriteOp } from './redis-handler.ts';
171
+ export { cache } from './cache-api.ts';
172
+ export { setCacheHandler, getCacheHandler } from './handler-store.ts';
173
+ export { setDefaultSingleflightTimeout } from './timber-cache.ts';
174
174
  // NOTE: registerCachedFunction (runtime for 'use cache' directive) removed.
175
175
  // Future feature pending design doc. See design/06-caching.md.
176
- export { estimateByteSize } from './sizeof';
176
+ export { estimateByteSize } from './sizeof.ts';
177
177
 
178
178
  // --- Cache Store layering (design/46) ---
179
- export { TagAwareCacheHandler } from './tag-aware-handler';
180
- export type { CacheStore } from './store';
179
+ export { TagAwareCacheHandler } from './tag-aware-handler.ts';
180
+ export type { CacheStore } from './store.ts';
181
181
  // stableStringify, createSingleflight, and SingleflightTimeoutError are
182
182
  // internal utilities used by the cache implementation. They are not
183
183
  // re-exported here — import directly from the source files if needed
@@ -1,5 +1,5 @@
1
- import type { CacheHandler } from './index';
2
- import { warnLossyJsonValue } from './json-lossy-check.js';
1
+ import type { CacheHandler } from './index.ts';
2
+ import { warnLossyJsonValue } from './json-lossy-check.ts';
3
3
 
4
4
  /**
5
5
  * Minimal Redis client contract for `RedisCacheHandler`.
@@ -12,7 +12,7 @@
12
12
  * consistency model (use short TTLs for security-critical invalidation).
13
13
  */
14
14
 
15
- import type { CacheStore } from '../store';
15
+ import type { CacheStore } from '../store.ts';
16
16
 
17
17
  export interface CloudflareKVNamespace {
18
18
  get(key: string, options?: { type?: string }): Promise<string | null>;
@@ -12,8 +12,8 @@
12
12
  * set size on invalidation, not to memory — stale memberships are just strings.
13
13
  */
14
14
 
15
- import type { CacheStore } from '../store';
16
- import { estimateByteSize } from '../sizeof.js';
15
+ import type { CacheStore } from '../store.ts';
16
+ import { estimateByteSize } from '../sizeof.ts';
17
17
 
18
18
  export interface MemoryStoreOptions {
19
19
  maxEntries?: number;
@@ -5,7 +5,7 @@
5
5
  * because this store provides sadd/smembers/srem/sdel.
6
6
  */
7
7
 
8
- import type { CacheStore } from '../store';
8
+ import type { CacheStore } from '../store.ts';
9
9
 
10
10
  /**
11
11
  * Minimal Redis client contract. Same philosophy as the old RedisClient
@@ -9,7 +9,7 @@
9
9
  * simultaneously. Available on all plans.
10
10
  */
11
11
 
12
- import type { CacheStore } from '../store';
12
+ import type { CacheStore } from '../store.ts';
13
13
 
14
14
  /**
15
15
  * Vercel Runtime Cache contract — the subset we depend on.
@@ -19,8 +19,8 @@
19
19
  * Implements the CacheHandler interface consumed by timber-cache.ts.
20
20
  */
21
21
 
22
- import type { CacheHandler } from './index';
23
- import type { CacheStore } from './store';
22
+ import type { CacheHandler } from './index.ts';
23
+ import type { CacheStore } from './store.ts';
24
24
 
25
25
  const DATA_PREFIX = 'd:';
26
26
  const TAG_SET_PREFIX = 'ts:';
@@ -1,15 +1,15 @@
1
- import type { CacheHandler, CacheOptions } from './index';
2
- import { stableStringify } from './stable-stringify';
3
- import { createSingleflight } from './singleflight';
1
+ import type { CacheHandler, CacheOptions } from './index.ts';
2
+ import { stableStringify } from './stable-stringify.ts';
3
+ import { createSingleflight } from './singleflight.ts';
4
4
  import {
5
5
  currentInvalidationEpoch,
6
6
  lastInvalidationEpochFor,
7
7
  wasInvalidatedSince,
8
- } from './invalidation-epoch';
9
- import { addSpanEventSync } from '../server/tracing.js';
10
- import { logSwrRefetchFailed, swallow } from '../server/logger.js';
11
- import { getWaitUntil } from '../server/waituntil-bridge.js';
12
- import { fnv1aHash } from './fast-hash.js';
8
+ } from './invalidation-epoch.ts';
9
+ import { addSpanEventSync } from '../server/tracing.ts';
10
+ import { logSwrRefetchFailed, swallow } from '../server/logger.ts';
11
+ import { getWaitUntil } from '../server/waituntil-bridge.ts';
12
+ import { fnv1aHash } from './fast-hash.ts';
13
13
 
14
14
  let defaultSingleflight = createSingleflight();
15
15
 
@@ -5,7 +5,7 @@
5
5
  * See https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/
6
6
  */
7
7
 
8
- import type { CdnPurgeHandler } from './purge-store';
8
+ import type { CdnPurgeHandler } from './purge-store.ts';
9
9
 
10
10
  export interface CloudflarePurgeOptions {
11
11
  /** Cloudflare zone ID. */
@@ -4,7 +4,7 @@
4
4
  * See https://www.fastly.com/documentation/reference/api/purging/
5
5
  */
6
6
 
7
- import type { CdnPurgeHandler } from './purge-store';
7
+ import type { CdnPurgeHandler } from './purge-store.ts';
8
8
 
9
9
  export interface FastlyPurgeOptions {
10
10
  /** Fastly service ID. */
package/src/cdn/index.ts CHANGED
@@ -3,11 +3,17 @@
3
3
  // Header utilities and purge handler for CDN caching. Developer-elected,
4
4
  // never automatic. See design/25-production-deployments.md §Layer 2.
5
5
 
6
- export { cacheControl, surrogateKey, surrogateControl, cdnCacheControl, cacheTag } from './headers';
7
- export type { CacheControlOptions, SurrogateControlOptions } from './headers';
6
+ export {
7
+ cacheControl,
8
+ surrogateKey,
9
+ surrogateControl,
10
+ cdnCacheControl,
11
+ cacheTag,
12
+ } from './headers.ts';
13
+ export type { CacheControlOptions, SurrogateControlOptions } from './headers.ts';
8
14
 
9
- export { setCdnPurgeHandler, getCdnPurgeHandler } from './purge-store';
10
- export type { CdnPurgeHandler } from './purge-store';
15
+ export { setCdnPurgeHandler, getCdnPurgeHandler } from './purge-store.ts';
16
+ export type { CdnPurgeHandler } from './purge-store.ts';
11
17
 
12
18
  // Platform-specific purge handlers are at their own entry points:
13
19
  // @timber-js/app/cdn/cloudflare → CloudflarePurge (REST API, Enterprise)
@@ -5,13 +5,17 @@
5
5
  * Available on ALL Cloudflare plans (no Enterprise requirement).
6
6
  * No API token needed — uses the Workers runtime's built-in cache API.
7
7
  *
8
+ * ctx.cache.purge() operates on the same underlying Cloudflare CDN cache
9
+ * as caches.default — entries stored via cache.put() with matching
10
+ * Cache-Tag headers are purged (TIM-1172). See design/25 §TIM-1172.
11
+ *
8
12
  * Auto-wired by the Cloudflare adapter when no user-configured CDN
9
13
  * purge handler is set. Uses the Workers Cache ALS bridge to access
10
14
  * ctx.cache from within the request context.
11
15
  */
12
16
 
13
- import type { CdnPurgeHandler } from './purge-store';
14
- import { getWorkersCachePurgeCtx } from '../server/workers-cache-bridge.js';
17
+ import type { CdnPurgeHandler } from './purge-store.ts';
18
+ import { getWorkersCachePurgeCtx } from '../server/workers-cache-bridge.ts';
15
19
 
16
20
  export class WorkersCachePurge implements CdnPurgeHandler {
17
21
  async purgeTags(tags: string[]): Promise<void> {
package/src/cli-check.ts CHANGED
@@ -31,11 +31,12 @@
31
31
  */
32
32
 
33
33
  import { createRequire } from 'node:module';
34
+ import { existsSync, readFileSync } from 'node:fs';
34
35
  import { dirname, join, resolve } from 'node:path';
35
- import { scanRoutes } from './routing/scanner.js';
36
- import { lintConventions, formatConventionWarnings } from './routing/convention-lint.js';
37
- import { writeRouteCodegen, CODEGEN_OUTPUT, ENV_DTS_FILENAME } from './routing/codegen-write.js';
38
- import { isTimberPluginApi } from './plugin-context.js';
36
+ import { scanRoutes } from './routing/scanner.ts';
37
+ import { lintConventions, formatConventionWarnings } from './routing/convention-lint.ts';
38
+ import { writeRouteCodegen, CODEGEN_OUTPUT, ENV_DTS_FILENAME } from './routing/codegen-write.ts';
39
+ import { isTimberPluginApi } from './plugin-context.ts';
39
40
 
40
41
  /** The plugin that publishes timber's resolved context on its Vite `api`. */
41
42
  const TIMBER_ROOT_SYNC_PLUGIN = 'timber-root-sync';
@@ -292,10 +293,58 @@ export async function checkRoutes(
292
293
  );
293
294
  }
294
295
 
296
+ verifyCodegenImports(root);
297
+
295
298
  // Returned so the type pass runs against the same root these files landed in.
296
299
  return inputs;
297
300
  }
298
301
 
302
+ /**
303
+ * Verify that the import specifiers in the generated route types resolve on the
304
+ * filesystem. A `.d.ts` whose import fails does NOT produce a TypeScript error —
305
+ * every type that depends on it silently becomes `any`. The generated file
306
+ * contains type-level `_AssertSchemaNotAny` / `_AssertCodecTypeNotAny` guards
307
+ * that catch this at typecheck time, but a diagnostic here fires earlier and
308
+ * names the exact import that is broken rather than leaving the user to decode
309
+ * a constraint error.
310
+ */
311
+ export function verifyCodegenImports(root: string): void {
312
+ const dtsPath = join(root, CODEGEN_OUTPUT);
313
+ let content: string;
314
+ try {
315
+ content = readFileSync(dtsPath, 'utf-8');
316
+ } catch {
317
+ return;
318
+ }
319
+
320
+ const dtsDir = dirname(dtsPath);
321
+
322
+ // Check relative imports (default imports only — the generated codegen uses
323
+ // `import type schema from '...'` for relative paths). Named imports from
324
+ // relative paths are not emitted today; if codegen adds them, extend this.
325
+ const RELATIVE_IMPORT_RE = /^import\s+type\s+\w+\s+from\s+'(\.\.?\/[^']+)'/gm;
326
+ const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '/index.ts', '/index.tsx'];
327
+ let match;
328
+ while ((match = RELATIVE_IMPORT_RE.exec(content)) !== null) {
329
+ const specifier = match[1];
330
+ const base = join(dtsDir, specifier);
331
+ const resolves = existsSync(base) || EXTENSIONS.some((ext) => existsSync(base + ext));
332
+ if (!resolves) {
333
+ process.stderr.write(
334
+ `[timber] WARNING: the generated ${CODEGEN_OUTPUT} imports '${specifier}',\n` +
335
+ ` but no file resolves at ${base}{${EXTENSIONS.join(',')}}.\n` +
336
+ ` Every type that depends on this import will silently become \`any\`.\n\n` +
337
+ ` Check that your app/ directory is where timber expects it.\n\n`
338
+ );
339
+ }
340
+ }
341
+
342
+ // Bare-specifier imports (`@timber-js/app/params`) are NOT checked here.
343
+ // They are all dependencies of @timber-js/app itself — if timber is installed,
344
+ // they resolve. And createRequire uses CJS resolution which cannot follow
345
+ // ESM-only subpath exports, producing false warnings (TIM-1348 review).
346
+ }
347
+
299
348
  /**
300
349
  * The production `RunTsgo`: spawn the compiler with its stdio inherited, so its
301
350
  * diagnostics stream to the terminal as they are produced (and are not capped
@@ -8,9 +8,9 @@
8
8
 
9
9
  import { readFileSync, writeFileSync, existsSync } from 'node:fs';
10
10
  import { join } from 'node:path';
11
- import { scanRoutes } from './routing/scanner.js';
12
- import type { SegmentNode } from './routing/types.js';
13
- import { resolveAppDir } from './plugin-context.js';
11
+ import { scanRoutes } from './routing/scanner.ts';
12
+ import type { SegmentNode } from './routing/types.ts';
13
+ import { resolveAppDir } from './plugin-context.ts';
14
14
 
15
15
  function toBracketKey(node: SegmentNode): string {
16
16
  if (node.paramPrefix || node.paramSuffix) return `[${node.paramName}]`;
package/src/cli.ts CHANGED
@@ -10,14 +10,15 @@
10
10
  // timber build — Run multi-environment build via createBuilder/buildApp
11
11
  // timber preview — Serve the production build
12
12
  // timber check — Validate types + routes without building
13
+ // timber graph — Classify a file's module environment(s) (design/47)
13
14
 
14
15
  // Type-only — the implementation is imported dynamically inside runCheck so the
15
16
  // CLI's other commands never load the route scanner.
16
- import type { CheckDeps } from './cli-check.js';
17
+ import type { CheckDeps } from './cli-check.ts';
17
18
 
18
19
  export type { CheckDeps };
19
20
 
20
- const COMMANDS = ['dev', 'build', 'preview', 'check', 'schema', 'init'] as const;
21
+ const COMMANDS = ['dev', 'build', 'preview', 'check', 'schema', 'init', 'graph'] as const;
21
22
  type Command = (typeof COMMANDS)[number];
22
23
 
23
24
  export interface ParsedArgs {
@@ -25,7 +26,11 @@ export interface ParsedArgs {
25
26
  config: string | undefined;
26
27
  /** `--project`: the tsconfig `timber check` passes to tsgo. */
27
28
  project: string | undefined;
28
- /** Positional arguments after the command (used by `timber schema sync`). */
29
+ /** `timber graph` only: emit the machine-readable JSON contract. */
30
+ json: boolean;
31
+ /** `timber graph` only: classify the whole project. */
32
+ all: boolean;
33
+ /** Positional arguments after the command (`schema sync`, `graph <file>`). */
29
34
  rest: string[];
30
35
  }
31
36
 
@@ -54,11 +59,15 @@ export interface CommandOptions {
54
59
  * starting on the default port would contradict fail-loudly. The surface stays
55
60
  * deliberately small (design/11-platform.md §CLI); port selection goes through
56
61
  * the PORT env var or server.port in vite.config.ts.
62
+ *
63
+ * Each subcommand declares its exact flags (the `check --project` precedent,
64
+ * TIM-1332): `graph` additionally accepts a file positional plus `--json` and
65
+ * `--all`, and those two are rejected everywhere else.
57
66
  */
58
67
  export function parseArgs(args: string[]): ParsedArgs {
59
68
  if (args.length === 0) {
60
69
  throw new Error(
61
- 'No command provided. Usage: timber <dev|build|preview|check|schema|init> [--config <path>]'
70
+ 'No command provided. Usage: timber <dev|build|preview|check|schema|init|graph> [--config <path>]'
62
71
  );
63
72
  }
64
73
 
@@ -69,6 +78,8 @@ export function parseArgs(args: string[]): ParsedArgs {
69
78
 
70
79
  let config: string | undefined;
71
80
  let project: string | undefined;
81
+ let json = false;
82
+ let all = false;
72
83
  const rest: string[] = [];
73
84
  for (let i = 1; i < args.length; i++) {
74
85
  const arg = args[i];
@@ -77,6 +88,14 @@ export function parseArgs(args: string[]): ParsedArgs {
77
88
  if (!config) {
78
89
  throw new Error('--config requires a path argument');
79
90
  }
91
+ } else if (arg === '--json' || arg === '--all') {
92
+ if (command !== 'graph') {
93
+ throw new Error(
94
+ `${arg} is only valid for \`timber graph\` (the module-environment query).`
95
+ );
96
+ }
97
+ if (arg === '--json') json = true;
98
+ else all = true;
80
99
  } else if (arg === '--project') {
81
100
  if (command !== 'check') {
82
101
  throw new Error(
@@ -98,14 +117,20 @@ export function parseArgs(args: string[]): ParsedArgs {
98
117
  `Unknown option: ${arg}. The timber CLI accepts --config <path>` +
99
118
  ` (and --project <path> for \`check\`).${portHint}`
100
119
  );
101
- } else if (command === 'schema' || command === 'init') {
120
+ } else if (command === 'schema' || command === 'init' || command === 'graph') {
102
121
  rest.push(arg);
103
122
  } else {
104
123
  throw new Error(`Unexpected argument: ${arg}. Usage: timber ${command} [--config <path>]`);
105
124
  }
106
125
  }
107
126
 
108
- return { command: command as Command, config, project, rest };
127
+ if (command === 'graph' && rest.length > 1) {
128
+ throw new Error(
129
+ `timber graph takes one file. Usage: timber graph <file> [--json], or timber graph --all --json`
130
+ );
131
+ }
132
+
133
+ return { command: command as Command, config, project, json, all, rest };
109
134
  }
110
135
 
111
136
  // ─── Command Implementations ─────────────────────────────────────────────────
@@ -153,7 +178,7 @@ export async function runBuild(options: CommandOptions, _deps?: ViteDeps): Promi
153
178
  * Exported for testing — the actual runPreview function uses this internally.
154
179
  */
155
180
  export function resolvePreviewStrategy(
156
- adapter: import('./adapters/types').TimberPlatformAdapter | undefined
181
+ adapter: import('./adapters/types.ts').TimberPlatformAdapter | undefined
157
182
  ): 'adapter' | 'vite' {
158
183
  if (adapter && typeof adapter.preview === 'function') {
159
184
  return 'adapter';
@@ -172,11 +197,13 @@ export function resolvePreviewStrategy(
172
197
  * Vite preview. See TIM-1066.
173
198
  */
174
199
  export async function runPreview(options: CommandOptions, _deps?: ViteDeps): Promise<void> {
175
- const { loadTimberConfigFile, resolveBuildDir } = await import('./plugin-context.js');
200
+ const { loadTimberConfigFile, resolveBuildDir } = await import('./plugin-context.ts');
176
201
 
177
202
  const root = process.cwd();
178
203
  const config = loadTimberConfigFile(root);
179
- const adapter = config?.adapter as import('./adapters/types').TimberPlatformAdapter | undefined;
204
+ const adapter = config?.adapter as
205
+ | import('./adapters/types.ts').TimberPlatformAdapter
206
+ | undefined;
180
207
 
181
208
  if (resolvePreviewStrategy(adapter) === 'adapter') {
182
209
  const buildDir = resolveBuildDir(root, config?.buildDir);
@@ -208,7 +235,7 @@ export async function runPreview(options: CommandOptions, _deps?: ViteDeps): Pro
208
235
  * `--project` names the tsconfig handed to tsgo.
209
236
  */
210
237
  export async function runCheck(options: CommandOptions, _deps?: CheckDeps): Promise<void> {
211
- const { checkRoutes, runTypeCheck } = await import('./cli-check.js');
238
+ const { checkRoutes, runTypeCheck } = await import('./cli-check.ts');
212
239
  const { root } = await checkRoutes({ viteConfigFile: options.config }, _deps);
213
240
  // tsgo runs from the root the route pass resolved, not from cwd — that is
214
241
  // where it just wrote the declarations tsgo has to read.
@@ -232,7 +259,7 @@ export async function runSchema(args: string[]): Promise<void> {
232
259
  );
233
260
  }
234
261
 
235
- const { runSchemaSync, defaultCodecForSegment } = await import('./cli-schema-sync.js');
262
+ const { runSchemaSync, defaultCodecForSegment } = await import('./cli-schema-sync.ts');
236
263
  const result = runSchemaSync(process.cwd());
237
264
 
238
265
  if (result.filesystemSegments.length === 0) {
@@ -361,6 +388,18 @@ async function main(): Promise<void> {
361
388
  case 'init':
362
389
  await runInit();
363
390
  break;
391
+ case 'graph': {
392
+ // Lazy import — the graph implementation (and, on a cache miss,
393
+ // Vite + the crawl child) never loads for the other commands.
394
+ const { runGraph } = await import('./analyze/graph-command.ts');
395
+ await runGraph({
396
+ file: parsed.rest[0],
397
+ config: parsed.config,
398
+ json: parsed.json,
399
+ all: parsed.all,
400
+ });
401
+ break;
402
+ }
364
403
  }
365
404
  }
366
405
 
@@ -8,7 +8,7 @@
8
8
  * See design/21-dev-server.md §"HMR Wiring"
9
9
  */
10
10
 
11
- import { isPageUnloading } from './unload-guard.js';
11
+ import { isPageUnloading } from './unload-guard.ts';
12
12
 
13
13
  // ─── HMR Hot Interface ──────────────────────────────────────────────
14
14
 
@@ -14,12 +14,12 @@
14
14
  * See design/08-forms-and-actions.md §"Client-Side Form Mechanics"
15
15
  */
16
16
 
17
- import { setServerCallback, encodeReply, createFromFetch } from '../../rsc-runtime/browser.js';
17
+ import { setServerCallback, encodeReply, createFromFetch } from '../../rsc-runtime/browser.ts';
18
18
  import { getRouter, getRouterOrNull } from '#client-internal';
19
- import { setHardNavigating } from '../navigation-root.js';
20
- import { getClientDeploymentId, DEPLOYMENT_ID_HEADER, RELOAD_HEADER } from '../rsc-fetch.js';
21
- import { markClientStale } from '../stale-client.js';
22
- import { RSC_CONTENT_TYPE } from '../../shared/rsc-media-type.js';
19
+ import { setHardNavigating } from '../navigation-root.tsx';
20
+ import { getClientDeploymentId, DEPLOYMENT_ID_HEADER, RELOAD_HEADER } from '../rsc-fetch.ts';
21
+ import { markClientStale } from '../stale-client.ts';
22
+ import { RSC_CONTENT_TYPE } from '../../shared/rsc-media-type.ts';
23
23
  export function setupServerActions(): void {
24
24
  setServerCallback(async (id: string, args: unknown[]) => {
25
25
  const body = await encodeReply(args);
@@ -16,7 +16,7 @@ import {
16
16
  setupClientErrorForwarding,
17
17
  showCompilingOverlay,
18
18
  hideCompilingOverlay,
19
- } from '../browser-dev.js';
19
+ } from '../browser-dev.ts';
20
20
 
21
21
  type HotApi = {
22
22
  on(event: string, cb: (...args: unknown[]) => void): void;