void 1.6.1 → 1.7.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 (276) hide show
  1. package/dist/{account-cmd-DRhmCWcm.mjs → account-cmd-BfkJ_1PC.mjs} +6 -6
  2. package/dist/{application-analysis-HRFsZOv3.mjs → application-analysis-OV0CBJ80.mjs} +8 -19
  3. package/dist/{application-routing-P4TggvWp.mjs → application-routing-QpyC5G8z.mjs} +2 -1
  4. package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
  5. package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
  6. package/dist/{auth-CH4PLAX1.d.mts → auth-CZrthGxs.d.mts} +8 -1
  7. package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
  8. package/dist/{auth-link-CVXP1G6G.mjs → auth-link-CW1Zh6FM.mjs} +6 -6
  9. package/dist/{auth-router-D1pGdbvB.mjs → auth-router-CNBKnEZi.mjs} +3 -3
  10. package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-C-0uZg8-.d.mts} +1 -1
  11. package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
  12. package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-C9qOKW9W.mjs} +5 -5
  13. package/dist/{cache-2khBO1MR.mjs → cache-DVBBbWQL.mjs} +5 -5
  14. package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-COavnjud.mjs} +4 -4
  15. package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
  16. package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
  17. package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
  18. package/dist/cli/cli.mjs +68 -1868
  19. package/dist/cli/cloudflare-operation-process.mjs +10 -8
  20. package/dist/cli/env-schema-probe.mjs +3 -3
  21. package/dist/cli-main-DFteHrJI.mjs +1889 -0
  22. package/dist/client-BAxLpSKv.mjs +1 -0
  23. package/dist/{client-CoxPEhJq.mjs → client-BEZmTP6p.mjs} +10 -4
  24. package/dist/{cloudflare-auth-CEu-1Ps_.mjs → cloudflare-auth-DGIivpTb.mjs} +1 -1
  25. package/dist/{cloudflare-cmd-fZ6AMSWk.mjs → cloudflare-cmd-DJaxC-bc.mjs} +5 -5
  26. package/dist/{cloudflare-config-eQunqX6A.mjs → cloudflare-config-DtOGAbeB.mjs} +3 -3
  27. package/dist/{cloudflare-connect-9OZe4XVQ.mjs → cloudflare-connect-BjpWmglw.mjs} +3 -3
  28. package/dist/{cloudflare-operations-oLvAd9Nd.mjs → cloudflare-operations-CZkjFrzH.mjs} +1 -1
  29. package/dist/{cloudflare-operations-CrskD4_O.mjs → cloudflare-operations-k7wYUv56.mjs} +6 -6
  30. package/dist/{cloudflare-process-DjJ638A-.mjs → cloudflare-process-BcPvlMFd.mjs} +3 -3
  31. package/dist/{config-BITKQ3O6.mjs → config-5oSQhZNj.mjs} +7 -5
  32. package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
  33. package/dist/{config-BBlVXZCU.mjs → config-DcqUBGCb.mjs} +3 -3
  34. package/dist/{config-WlvEcL82.mjs → config-eeDzKBS9.mjs} +2 -2
  35. package/dist/config-entry.d.mts +1 -1
  36. package/dist/{config-BgysUhnm.mjs → config-wo2EaH0X.mjs} +1 -1
  37. package/dist/{connect-CKvmkl2R.mjs → connect-j1F1C_rW.mjs} +7 -7
  38. package/dist/{create-project-Bq0M8MtO.mjs → create-project-CE3jOmd5.mjs} +5 -5
  39. package/dist/{create-project-BiMmR5wA.mjs → create-project-DZH3aYGQ.mjs} +1 -1
  40. package/dist/{db-DjtGAcOz.mjs → db-DyLzzxvM.mjs} +39 -39
  41. package/dist/{db-types-C_8amnB0.mjs → db-types-DdHHUVPy.mjs} +1 -1
  42. package/dist/{delete-CY4L8fi2.mjs → delete-Dey6YoMA.mjs} +5 -5
  43. package/dist/{deploy-D_gEojD2.mjs → deploy-Ccw2D2lw.mjs} +507 -122
  44. package/dist/deploy-DEZkUS77.mjs +2 -0
  45. package/dist/{deploy-managed-static-BHVbB_-A.mjs → deploy-managed-static-BBVtpuGv.mjs} +18 -18
  46. package/dist/{deploy-transport-DEyOUfac.mjs → deploy-transport-Dt0IvSVW.mjs} +2 -2
  47. package/dist/deploy.mjs +8 -8
  48. package/dist/discover-1DJD4YXD.mjs +1 -0
  49. package/dist/{discover-Dhkzxgdt.mjs → discover-CVFCWU7W.mjs} +1 -1
  50. package/dist/{dispatch-BNLB5_Gm.mjs → dispatch-pYaww76u.mjs} +6 -6
  51. package/dist/{dist-D23AAMxT.mjs → dist-BQdgCVQF.mjs} +1 -1
  52. package/dist/{dist-eV_Ep60B.mjs → dist-DeTdhbZc.mjs} +1 -1
  53. package/dist/{domain-BlH90Ods.mjs → domain-Dh3mG8Vs.mjs} +6 -6
  54. package/dist/{email-Bkq8ZL1p.mjs → email-DKyMjOYM.mjs} +11 -11
  55. package/dist/{email-cloudflare-MvJIxrwx.mjs → email-cloudflare-CTt2n_W2.mjs} +13 -9
  56. package/dist/{entry-CBZsCy3O.mjs → entry-Bw-G1VVx.mjs} +2 -2
  57. package/dist/{env-AvuCSeCH.mjs → env-DkZzh_Dd.mjs} +7 -7
  58. package/dist/env-mask-D31Qztl9.mjs +46 -0
  59. package/dist/{env-types-DqzVBKnS.mjs → env-types-Dz9qkiOn.mjs} +1 -1
  60. package/dist/{env-validation-GV1oD4EV.mjs → env-validation-1snjKtDX.mjs} +4 -4
  61. package/dist/{env-validation-C8Cmvas0.mjs → env-validation-C8NL3lEH.mjs} +1 -1
  62. package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
  63. package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
  64. package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
  65. package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
  66. package/dist/{gen-B9bCV5qu.mjs → gen-BZmFOGDQ.mjs} +7 -7
  67. package/dist/gen-C6iknRdI.mjs +1 -0
  68. package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-7Oky9qgH.mjs} +6 -6
  69. package/dist/{handler-CKeTtYID.mjs → handler-C9SnmeW1.mjs} +6 -5
  70. package/dist/{handler-BR6Tvjkp.d.mts → handler-DjqciiDc.d.mts} +20 -7
  71. package/dist/{headers-CuTEdP9C.mjs → headers-CimYIfQI.mjs} +1 -1
  72. package/dist/{help-1OCFDsRr.mjs → help-CNuUb47C.mjs} +7 -3
  73. package/dist/help-C_cqTByy.mjs +1 -0
  74. package/dist/index.d.mts +4 -4
  75. package/dist/index.mjs +155 -110
  76. package/dist/{info-CJxua_db.mjs → info-DwB8IWIx.mjs} +4 -4
  77. package/dist/{init-B-4CluYx.mjs → init-CUGSmcED.mjs} +34 -32
  78. package/dist/{link-DAXOT-G_.mjs → link-BlRTGHan.mjs} +6 -6
  79. package/dist/{list-BYSOo9fm.mjs → list-iCg7d5Pa.mjs} +7 -7
  80. package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
  81. package/dist/{live-0xrcVpyq.d.mts → live-zKGbRT4h.d.mts} +2 -2
  82. package/dist/{local-d1-BLgsNUj9.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
  83. package/dist/login-C4q1S-5b.mjs +1 -0
  84. package/dist/{login-CJopTWX4.mjs → login-TA51e5Fw.mjs} +5 -5
  85. package/dist/{logs-DE0weBsR.mjs → logs-BlyAxlvx.mjs} +6 -6
  86. package/dist/{migrate-ChHHZBTi.mjs → migrate-BH6LCr00.mjs} +6 -6
  87. package/dist/migrate-CVBsSFhC.mjs +1 -0
  88. package/dist/nitro.d.mts +5 -0
  89. package/dist/nitro.mjs +27 -8
  90. package/dist/{node-CZ6lGNLn.mjs → node-B0otYjDv.mjs} +4 -4
  91. package/dist/{operator-args-D79WQP70.mjs → operator-args-DuKAQ3Ks.mjs} +1 -1
  92. package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
  93. package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
  94. package/dist/{operator-cmd-BUqsdk2K.mjs → operator-cmd-CoHlJjcT.mjs} +7 -7
  95. package/dist/operator-cmd-DnaCnCSP.mjs +1 -0
  96. package/dist/output-CNsMDEd2.mjs +1 -0
  97. package/dist/{output-BCdLioKP.mjs → output-CXJTIAtF.mjs} +1 -1
  98. package/dist/pages/client.d.mts +18 -13
  99. package/dist/pages/client.mjs +40 -69
  100. package/dist/pages/index.d.mts +4 -3
  101. package/dist/pages/index.mjs +11 -7
  102. package/dist/pages/islands-plugin.mjs +1 -1
  103. package/dist/pages/protocol.d.mts +2 -2
  104. package/dist/pages/protocol.mjs +1 -1
  105. package/dist/pages/serialize.d.mts +2 -2
  106. package/dist/pages/serialize.mjs +1 -1
  107. package/dist/platform-args-B7-wQ0_B.mjs +1 -0
  108. package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-DfT8yQBF.mjs} +1 -1
  109. package/dist/{platform-auth-config-K4m_LE8b.mjs → platform-auth-config-MO0VdVs9.mjs} +10 -10
  110. package/dist/{platform-auth-protection-KF5Vo-1I.mjs → platform-auth-protection-Dv208eyL.mjs} +8 -8
  111. package/dist/{platform-auth-recovery-BOdFrl7R.mjs → platform-auth-recovery-DvAQ674F.mjs} +7 -7
  112. package/dist/{platform-cmd-DpCHawGF.mjs → platform-cmd-BpUA19r_.mjs} +1 -1
  113. package/dist/{platform-cmd-Ds3EAV5t.mjs → platform-cmd-dlSxrcQ7.mjs} +9 -9
  114. package/dist/{platform-domain-rWJshybd.mjs → platform-domain-DSO4eUEw.mjs} +5 -5
  115. package/dist/{platform-lifecycle-D9RdGub1.mjs → platform-lifecycle-BSvsyB_x.mjs} +17 -17
  116. package/dist/{platform-lifecycle-BH34I0rh.mjs → platform-lifecycle-CfcFygHb.mjs} +1 -1
  117. package/dist/{platform-management-BfLW0Zlo.mjs → platform-management-BMdyt667.mjs} +1 -1
  118. package/dist/{platform-management-BRefdHGD.mjs → platform-management-CrP1XhVd.mjs} +4 -4
  119. package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-CgDiwflR.mjs} +5 -5
  120. package/dist/{platform-recovery-DZuZGJtt.mjs → platform-recovery-CHWwXVZ6.mjs} +3 -3
  121. package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-BTQVbnTC.mjs} +3 -3
  122. package/dist/{plugin-inference-CdLbxZL_.mjs → plugin-inference-g66Q1Mx9.mjs} +5 -8
  123. package/dist/prepare-Bx4a8cb1.mjs +1 -0
  124. package/dist/{prepare-BuNbuFlA.mjs → prepare-DJYHjpzq.mjs} +3 -3
  125. package/dist/{prepare-BerOZiD4.mjs → prepare-DXduEwQp.mjs} +12 -9
  126. package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BN9Lmebs.mjs} +29 -13
  127. package/dist/prerender-render.d.mts +10 -2
  128. package/dist/prerender-render.mjs +1 -1
  129. package/dist/{project-cmd-B_bUyZ3J.mjs → project-cmd-Dfb1Sg8w.mjs} +18 -18
  130. package/dist/{project-paths-CdGv9Tmi.mjs → project-paths-G0yut6Zz.mjs} +12 -8
  131. package/dist/{project-team-MjT5K4rQ.mjs → project-team-BO2dyc7S.mjs} +5 -5
  132. package/dist/{project-token-BKHGwY3k.mjs → project-token-ByO2mEI2.mjs} +5 -5
  133. package/dist/{project-tsconfig-Cf2NFjlM.mjs → project-tsconfig-nhnTWO_Y.mjs} +4 -2
  134. package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust-CoQfwRBR.mjs} +5 -5
  135. package/dist/{protocol-CkwjASep.d.mts → protocol-xZMvWsrg.d.mts} +5 -3
  136. package/dist/{protocol-COyySMki.mjs → protocol-yxdHxFLN.mjs} +47 -11
  137. package/dist/{provision-DQF6Kw-6.mjs → provision-CMH4-8ri.mjs} +1 -1
  138. package/dist/{provision-BbCzpbXs.mjs → provision-D5q-ptD3.mjs} +2 -2
  139. package/dist/{requests-daJmVpjk.mjs → requests-CPOiDkjh.mjs} +4 -4
  140. package/dist/resolve-project-BALVa9q0.mjs +1 -0
  141. package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-ClvLMTI9.mjs} +1 -1
  142. package/dist/{rollback-BgL0wY1J.mjs → rollback-BfCs2la4.mjs} +7 -7
  143. package/dist/{route-types-CZc1YXjF.mjs → route-types-Cl3x0Q8B.mjs} +265 -12
  144. package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
  145. package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
  146. package/dist/routes-stub.d.mts +10 -1
  147. package/dist/routes-stub.mjs +1 -1
  148. package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
  149. package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
  150. package/dist/runtime/ai.mjs +1 -1
  151. package/dist/runtime/auth.d.mts +2 -2
  152. package/dist/runtime/auth.mjs +1 -1
  153. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  154. package/dist/runtime/better-auth-mysql.mjs +1 -1
  155. package/dist/runtime/better-auth-pg.d.mts +1 -1
  156. package/dist/runtime/better-auth-pg.mjs +1 -1
  157. package/dist/runtime/better-auth.d.mts +1 -1
  158. package/dist/runtime/better-auth.mjs +1 -1
  159. package/dist/runtime/client-react.d.mts +3 -3
  160. package/dist/runtime/client-react.mjs +2 -2
  161. package/dist/runtime/client-solid.d.mts +3 -3
  162. package/dist/runtime/client-solid.mjs +2 -2
  163. package/dist/runtime/client-svelte.d.mts +3 -3
  164. package/dist/runtime/client-svelte.mjs +2 -2
  165. package/dist/runtime/client-vue.d.mts +3 -3
  166. package/dist/runtime/client-vue.mjs +2 -2
  167. package/dist/runtime/client.d.mts +3 -3
  168. package/dist/runtime/client.mjs +2 -2
  169. package/dist/runtime/email/testing.mjs +2 -2
  170. package/dist/runtime/email.mjs +3 -3
  171. package/dist/runtime/env-public.mjs +2 -46
  172. package/dist/runtime/fetch-server.d.mts +1 -1
  173. package/dist/runtime/fetch-server.mjs +1 -1
  174. package/dist/runtime/fetch-stream.d.mts +2 -2
  175. package/dist/runtime/fetch-stream.mjs +1 -1
  176. package/dist/runtime/fetch.d.mts +1 -1
  177. package/dist/runtime/fetch.mjs +1 -1
  178. package/dist/runtime/handler.d.mts +1 -1
  179. package/dist/runtime/handler.mjs +1 -1
  180. package/dist/runtime/isr.d.mts +3 -1
  181. package/dist/runtime/live-client.d.mts +11 -2
  182. package/dist/runtime/live-client.mjs +8 -0
  183. package/dist/runtime/live-server.mjs +1 -1
  184. package/dist/runtime/live.d.mts +1 -1
  185. package/dist/runtime/live.mjs +1 -1
  186. package/dist/runtime/log.mjs +1 -1
  187. package/dist/runtime/remote/index.mjs +1 -1
  188. package/dist/runtime/route-url.d.mts +2 -2
  189. package/dist/runtime/route-url.mjs +1 -1
  190. package/dist/runtime/routing.d.mts +15 -4
  191. package/dist/runtime/routing.mjs +94 -12
  192. package/dist/runtime/sandbox.mjs +1 -1
  193. package/dist/runtime/sse-client.d.mts +9 -1
  194. package/dist/runtime/sse-client.mjs +7 -0
  195. package/dist/runtime/validator.d.mts +1 -1
  196. package/dist/runtime/validator.mjs +1 -1
  197. package/dist/runtime/ws-server.d.mts +3 -3
  198. package/dist/runtime/ws-server.mjs +1 -1
  199. package/dist/runtime/ws.d.mts +1 -1
  200. package/dist/runtime/ws.mjs +1 -1
  201. package/dist/{scan-X2rDDRNa.mjs → scan-L8OSv1f7.mjs} +68 -19
  202. package/dist/{secret-CPq-B_vp.mjs → secret-CuI6LTpD.mjs} +7 -7
  203. package/dist/serialize-DN-envGQ.d.mts +18 -0
  204. package/dist/serialize-Pf-CIQK_.mjs +39 -0
  205. package/dist/{skills-D393E4lB.mjs → skills-BBO9wMjB.mjs} +1 -1
  206. package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-BZMnCA8T.mjs} +2 -2
  207. package/dist/url-CuoEn0o3.mjs +43 -0
  208. package/dist/validator-8-NZs2Xr.mjs +168 -0
  209. package/dist/{version-metadata-C8hLzQkv.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
  210. package/dist/wrangler-R3kMdJfw.mjs +1 -0
  211. package/dist/{wrangler-DESSbN8L.mjs → wrangler-k40T7XTQ.mjs} +3 -3
  212. package/dist/{wrapper-C9SUxoj7.mjs → wrapper-BGsi_uHs.mjs} +12 -9
  213. package/dist/{ws-Dmjg5NH2.d.mts → ws-DB8Feytg.d.mts} +2 -2
  214. package/docs/guide/ai.md +2 -0
  215. package/docs/guide/auth.md +62 -0
  216. package/docs/guide/database.md +33 -0
  217. package/docs/guide/deployment.md +8 -0
  218. package/docs/guide/edge/headers.md +3 -1
  219. package/docs/guide/edge/prerendering.md +9 -4
  220. package/docs/guide/edge/redirects.md +1 -0
  221. package/docs/guide/edge/revalidation.md +3 -0
  222. package/docs/guide/edge/static-assets.md +1 -1
  223. package/docs/guide/live.md +2 -0
  224. package/docs/guide/pages-routing/actions-and-forms.md +29 -10
  225. package/docs/guide/pages-routing/head.md +3 -1
  226. package/docs/guide/pages-routing/islands.md +1 -1
  227. package/docs/guide/pages-routing/loaders.md +2 -0
  228. package/docs/guide/pages-routing/markdown.md +2 -2
  229. package/docs/guide/pages-routing/overview.md +139 -10
  230. package/docs/guide/quickstart.md +1 -0
  231. package/docs/guide/server-routing.md +14 -0
  232. package/docs/guide/sse.md +2 -0
  233. package/docs/guide/ssg.md +23 -2
  234. package/docs/guide/storage.md +6 -2
  235. package/docs/guide/type-safety.md +307 -26
  236. package/docs/guide/typed-fetch.md +7 -3
  237. package/docs/guide/websockets.md +5 -5
  238. package/docs/integrations/cloudflare.md +10 -10
  239. package/docs/integrations/frameworks/nuxt.md +2 -0
  240. package/docs/integrations/frameworks/overview.md +2 -0
  241. package/docs/integrations/nodejs-bun-deno.md +65 -0
  242. package/docs/reference/api/auth.md +19 -0
  243. package/docs/reference/api/client.md +6 -4
  244. package/docs/reference/api/handlers.md +3 -1
  245. package/docs/reference/api/pages.md +16 -8
  246. package/docs/reference/api/resources.md +3 -1
  247. package/docs/reference/api/rewrites.md +19 -5
  248. package/docs/reference/api/types.md +9 -2
  249. package/docs/reference/cli/database.md +2 -0
  250. package/docs/reference/cli/deploy.md +17 -11
  251. package/docs/reference/cli.md +3 -0
  252. package/docs/reference/config.md +24 -2
  253. package/package.json +25 -23
  254. package/schema.json +4 -0
  255. package/skills/void/SKILL.md +5 -0
  256. package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
  257. package/dist/client-CEtr5UOR.mjs +0 -1
  258. package/dist/deploy-B029oHlE.mjs +0 -2
  259. package/dist/discover-D4mQthao.mjs +0 -1
  260. package/dist/gen-cCxrFp9L.mjs +0 -1
  261. package/dist/help-Ba8Dq5-r.mjs +0 -1
  262. package/dist/login-BpbYeu-n.mjs +0 -1
  263. package/dist/migrate-HdA6Kh2p.mjs +0 -1
  264. package/dist/operator-cmd-wBYyp8iQ.mjs +0 -1
  265. package/dist/output-E6gecbbV.mjs +0 -1
  266. package/dist/platform-args-C7XUw9mw.mjs +0 -1
  267. package/dist/prepare-Cz18kLkF.mjs +0 -1
  268. package/dist/resolve-project-CgfjtOwz.mjs +0 -1
  269. package/dist/serialize-DUuYuaY3.mjs +0 -29
  270. package/dist/serialize-I4EmS-Wf.d.mts +0 -16
  271. package/dist/validator-CTfmzZYb.mjs +0 -69
  272. package/dist/wrangler-DUB3MGHV.mjs +0 -1
  273. package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
  274. package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
  275. package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
  276. package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
@@ -1,11 +1,12 @@
1
- import { n as createClientAssetTags, r as createManifestLoader, t as ASSET_EXTENSIONS } from "../routing-assets-DJIVOrCh.mjs";
2
- import { t as renderDefaultErrorPage } from "../error-pages-COVBnzK7.mjs";
3
- import { t as convertReturnValue } from "../response-HmNjB30w.mjs";
4
1
  import { i as searchWithoutActionKey, n as hasActionKey, r as markActionKey, t as actionKeySegment } from "../action-key-XtKKbbsi.mjs";
5
- import { n as handlePageGet, r as handlePageMutation } from "../protocol-COyySMki.mjs";
6
- import { t as VoidAssetRewriteError } from "../handler-CKeTtYID.mjs";
7
2
  import { i as authDependentRequests, n as markStaticAsset, r as SHARED_CACHE_HEADERS, t as isUnchangedStaticAsset } from "../static-asset-marker-DsQKz6lt.mjs";
8
- import { r as toUrlString } from "../route-url-CRDF-I0I.mjs";
3
+ import { t as VoidAssetRewriteError } from "../handler-C9SnmeW1.mjs";
4
+ import { t as convertReturnValue } from "../response-HmNjB30w.mjs";
5
+ import { r as toUrlString, t as interpolateRouteParams } from "../route-url-CfCR4oMj.mjs";
6
+ import { n as createClientAssetTags, r as createManifestLoader, t as ASSET_EXTENSIONS } from "../routing-assets-DJIVOrCh.mjs";
7
+ import { n as handlePageGet, r as handlePageMutation } from "../protocol-yxdHxFLN.mjs";
8
+ import { t as decodePagePath } from "../url-CuoEn0o3.mjs";
9
+ import { t as renderDefaultErrorPage } from "../error-pages-COVBnzK7.mjs";
9
10
  import { AsyncLocalStorage } from "node:async_hooks";
10
11
  import { compilePattern, matchPattern, matchPatternCaptures, mergeQueryIntoLocation, redirectToHttps, substituteParams } from "@void/edge";
11
12
  // src/runtime/routing-worker.ts
@@ -105,6 +106,17 @@ function filterInternalBindings(env, prefixes, exactNames = []) {
105
106
  getOwnPropertyDescriptor: (target, prop) => hidden(prop) ? void 0 : Reflect.getOwnPropertyDescriptor(target, prop)
106
107
  });
107
108
  }
109
+ /**
110
+ * Answer the prerender runner. A getPrerenderPaths() error is returned in the
111
+ * body so the build can show which page and entry to fix, not only HTTP 500.
112
+ */
113
+ async function prerenderPathsResponse(collect) {
114
+ try {
115
+ return Response.json({ paths: await collect() });
116
+ } catch (error) {
117
+ return Response.json({ error: error instanceof Error ? error.message : String(error) }, { status: 500 });
118
+ }
119
+ }
108
120
  function createWorkerFetch(options) {
109
121
  return async (request, originalEnv, ctx) => {
110
122
  const url = new URL(request.url);
@@ -126,7 +138,7 @@ function createWorkerFetch(options) {
126
138
  }
127
139
  const internal = await options.internalRoute(request, env, ctx);
128
140
  if (internal) return internal;
129
- if (discovery) return Response.json({ paths: await options.collectPrerenderPaths(request, env, ctx) });
141
+ if (discovery) return prerenderPathsResponse(() => options.collectPrerenderPaths(request, env, ctx));
130
142
  if (options.alwaysUseHttps) {
131
143
  const redirect = redirectToHttps(request);
132
144
  if (redirect) return redirect;
@@ -142,6 +154,16 @@ function createWorkerFetch(options) {
142
154
  };
143
155
  }
144
156
  // src/runtime/routing-pages.ts
157
+ function preparePageRequest(c, options) {
158
+ if (!options.trailingSlash) return true;
159
+ if (!c.req.path.endsWith("/")) return false;
160
+ if (options.catchAllParam) {
161
+ const params = c.req.param();
162
+ params[options.catchAllParam] = params[options.catchAllParam].slice(0, -1);
163
+ c.req.param = ((key) => key ? params[key] : { ...params });
164
+ }
165
+ return true;
166
+ }
145
167
  function actionNameOf(url) {
146
168
  return new URL(url).searchParams.keys().next().value;
147
169
  }
@@ -169,12 +191,14 @@ function createNamedActionMarker(matchedRoutes) {
169
191
  }
170
192
  function createPageGetHandler(options) {
171
193
  return markRouteHandler(async (context) => {
194
+ if (!preparePageRequest(context, options)) return context.notFound();
172
195
  const mod = options.load ? await options.load() : { head: options.head };
173
196
  return handlePageGet(mod.loader, mod.head, context, options.componentId, options.render, options.assets, options.headConfig ?? void 0, options.renderOptions);
174
197
  });
175
198
  }
176
199
  function createPageMutationHandler(options) {
177
200
  const mutationHandler = async (context) => {
201
+ if (!preparePageRequest(context, options)) return context.notFound();
178
202
  const mod = options.load ? await options.load() : {};
179
203
  const actionName = options.namedActions ? actionNameOf(context.req.url) : void 0;
180
204
  const name = actionName || "default";
@@ -195,13 +219,34 @@ function createPagesFallback(options) {
195
219
  if (path === "/api" || path.startsWith("/api/") || c.req.method !== "GET" && c.req.method !== "HEAD") return c.text("Not Found", 404);
196
220
  const assets = c.env?.ASSETS;
197
221
  const assetResponse = assets && typeof assets.fetch === "function" ? await assets.fetch(c.req.raw) : options.routing.markNoMatch(c.req.raw, new Response("Not Found", { status: 404 }));
222
+ const filePath = path.includes("/.") || path.substring(path.lastIndexOf("/") + 1).includes(".");
223
+ const pageNeedsSlash = options.trailingSlash && !path.endsWith("/") && options.pagePatterns?.some((pattern) => pattern.test(decodePagePath(`${path}/`)));
224
+ let directoryIndex = false;
225
+ if (pageNeedsSlash && assetResponse.status === 200 && assetResponse.headers.get("Content-Type")?.split(";")[0] === "text/html" && assets) {
226
+ const url = new URL(c.req.url);
227
+ url.pathname += "/";
228
+ const index = await assets.fetch(new Request(url, {
229
+ method: c.req.method,
230
+ headers: c.req.raw.headers,
231
+ redirect: c.req.raw.redirect,
232
+ signal: c.req.raw.signal
233
+ }));
234
+ directoryIndex = index.status === 200;
235
+ await index.body?.cancel();
236
+ }
237
+ if (pageNeedsSlash && (assetResponse.status === 404 || directoryIndex)) {
238
+ await assetResponse.body?.cancel();
239
+ const url = new URL(c.req.url);
240
+ url.pathname += "/";
241
+ return Response.redirect(url.href, 301);
242
+ }
198
243
  if (assetResponse.status !== 404) return markStaticAsset(c, await cachePolicy(c.req.raw, c.env, assetResponse));
199
244
  const fallback = options.fallbackRules ? await options.routing.applyFallback(c, options.fallbackRules) : void 0;
200
245
  if (fallback) return fallback;
201
- if (path.includes("/.") || path.substring(path.lastIndexOf("/") + 1).includes(".")) return options.errors.serveCustomPage(c, 404, "Not Found");
202
- if (path !== "/" && path.endsWith("/")) {
246
+ if (filePath) return options.errors.serveCustomPage(c, 404, "Not Found");
247
+ if (path !== "/" && (options.trailingSlash ? !path.endsWith("/") : path.endsWith("/"))) {
203
248
  const url = new URL(c.req.url);
204
- url.pathname = path.slice(0, -1);
249
+ url.pathname = options.trailingSlash ? `${path}/` : path.slice(0, -1);
205
250
  return Response.redirect(url.href, 301);
206
251
  }
207
252
  return options.routing.markNoMatch(c.req.raw, await options.errors.serveCustomPage(c, 404, "Not Found"));
@@ -742,6 +787,43 @@ function createErrorRenderer(options) {
742
787
  }
743
788
  };
744
789
  }
790
+ // src/runtime/prerender-path.ts
791
+ const ROUTE_TOKEN = /(?:^|\/)(?::([^/{}]+)(\{\.\+\})?|\*)(?=\/|$)/g;
792
+ function describeValue(value) {
793
+ if (value === null) return "null";
794
+ if (Array.isArray(value)) return "an array";
795
+ if (value === void 0) return "undefined";
796
+ return typeof value === "object" ? "an object" : `a ${typeof value}`;
797
+ }
798
+ /** Validate one `getPrerenderPaths()` entry and convert the values its pattern uses to strings. */
799
+ function routeParams(pattern, params) {
800
+ if (typeof params !== "object" || params === null || Array.isArray(params)) throw new TypeError(`Expected an object of route params, got ${describeValue(params)}.`);
801
+ const values = Object.create(null);
802
+ for (const [, paramName, catchAll] of pattern.matchAll(ROUTE_TOKEN)) {
803
+ const name = paramName ?? "*";
804
+ if (!Object.hasOwn(params, name)) continue;
805
+ const value = params[name];
806
+ if (typeof value !== "string" && typeof value !== "number") throw new TypeError(`Route param "${name}" must be a string or number.`);
807
+ const text = String(value);
808
+ if (paramName !== void 0 && !catchAll && text.includes("/")) throw new TypeError(`Route param "${name}" cannot contain "/". Use a catch-all page ([...${name}]) for nested paths.`);
809
+ values[name] = text;
810
+ }
811
+ return values;
812
+ }
813
+ /**
814
+ * Build the URL for one entry a page's `getPrerenderPaths()` returned. Values
815
+ * are percent-encoded like `routeUrl()`. Errors name the server file and the
816
+ * entry index, and fail the build: a wrong entry must not silently produce a
817
+ * missing or misplaced page.
818
+ */
819
+ function buildPrerenderPath(pattern, params, file, index) {
820
+ try {
821
+ return interpolateRouteParams(pattern, routeParams(pattern, params), true);
822
+ } catch (error) {
823
+ const message = error instanceof Error ? error.message : String(error);
824
+ throw new TypeError(`${file} getPrerenderPaths()[${index}]: ${message}`);
825
+ }
826
+ }
745
827
  // src/runtime/routing.ts
746
828
  /** One state owner per generated app: recursive dispatch shares rewrite and fallback guards. */
747
829
  function createRoutingRuntime(app, options = {}) {
@@ -838,7 +920,7 @@ function createRoutingRuntime(app, options = {}) {
838
920
  const redirect = context.redirect.bind(context);
839
921
  c.redirect = (destination, status) => {
840
922
  const location = toUrlString(destination);
841
- if (location.startsWith("/") && !location.startsWith("//")) return redirect(redirectLocation(c.req.raw, location, status), status);
923
+ if (location.startsWith("/") && !location.startsWith("//") && hasActionKey(c.req.raw)) return redirect(redirectLocation(c.req.raw, location, status), status);
842
924
  return redirect(location, status);
843
925
  };
844
926
  c.originalUrl = () => originalUrls.get(c.req.raw) ?? null;
@@ -954,4 +1036,4 @@ function createModuleLoader(load, cache = true) {
954
1036
  return module;
955
1037
  };
956
1038
  }
957
- export { createAssetFallback, createAssetNotFound, createClientAssetTags, createErrorRenderer, createHttpRouteHandler, createManifestLoader, createModuleLoader, createNamedActionMarker, createPageGetHandler, createPageMutationHandler, createPagesFallback, createRoutingRuntime, createSsrFallback, createWorkerFetch, filterInternalBindings, markNoMatch, markRouteHandler };
1039
+ export { buildPrerenderPath, createAssetFallback, createAssetNotFound, createClientAssetTags, createErrorRenderer, createHttpRouteHandler, createManifestLoader, createModuleLoader, createNamedActionMarker, createPageGetHandler, createPageMutationHandler, createPagesFallback, createRoutingRuntime, createSsrFallback, createWorkerFetch, filterInternalBindings, markNoMatch, markRouteHandler, prerenderPathsResponse };
@@ -1,6 +1,6 @@
1
1
  import { a as getRawRuntimeEnv } from "../env-raw-e8qgqAzQ.mjs";
2
- import { t as UsageLimit } from "../limits-CrHLm5Tk.mjs";
3
2
  import { a as requireRuntimeBinding } from "../env-DtKg5G26.mjs";
3
+ import { t as UsageLimit } from "../limits-CrHLm5Tk.mjs";
4
4
  import { i as validateSandboxOptions, n as SANDBOX_PORT_HEADER, r as SandboxContainer } from "../sandbox-container-BuxhwCgt.mjs";
5
5
  export * from "@cloudflare/sandbox";
6
6
  // src/runtime/sandbox.ts
@@ -1,3 +1,4 @@
1
+ import { n as RequestUrl } from "../route-url-C3JwYrER.mjs";
1
2
  export type SseClientEvent<T = unknown> = {
2
3
  data: T;
3
4
  event: string;
@@ -20,4 +21,11 @@ export type ConnectEventStreamOptions = {
20
21
  events?: Array<string>;
21
22
  parse?: "json" | "text" | ((data: string) => unknown);
22
23
  };
23
- export declare function connectEventStream<Events extends SseEventMap = SseEventMap>(url: string | URL, options?: ConnectEventStreamOptions): SseClient<Events>;
24
+ /**
25
+ * Open an `EventSource` to a route that returns `eventStream()`.
26
+ *
27
+ * With `routing.typedRoutes`, a string `url` must match one of the app's routes
28
+ * or be an absolute `http://`/`https://` URL. Cast a path built at runtime with
29
+ * `as RouteUrl`.
30
+ */
31
+ export declare function connectEventStream<Events extends SseEventMap = SseEventMap>(url: RequestUrl | URL, options?: ConnectEventStreamOptions): SseClient<Events>;
@@ -1,4 +1,11 @@
1
1
  // src/runtime/sse-client.ts
2
+ /**
3
+ * Open an `EventSource` to a route that returns `eventStream()`.
4
+ *
5
+ * With `routing.typedRoutes`, a string `url` must match one of the app's routes
6
+ * or be an absolute `http://`/`https://` URL. Cast a path built at runtime with
7
+ * `as RouteUrl`.
8
+ */
2
9
  function connectEventStream(url, options = {}) {
3
10
  const EventSourceCtor = globalThis.EventSource;
4
11
  if (!EventSourceCtor) throw new Error("sse: EventSource is not available in this runtime.");
@@ -1,2 +1,2 @@
1
- import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-BR6Tvjkp.mjs";
1
+ import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-DjqciiDc.mjs";
2
2
  export { HandlerInput, ValidatorSlots, runValidation };
@@ -1 +1 @@
1
- export { t as runValidation } from "../validator-CTfmzZYb.mjs";
1
+ export { t as runValidation } from "../validator-8-NZs2Xr.mjs";
@@ -1,6 +1,6 @@
1
- import { n as AuthState } from "../auth-CH4PLAX1.mjs";
2
- import { r as VoidAuthRuntimeOptions, t as VoidAuthEnv } from "../better-auth-shared-BJyG2mH0.mjs";
3
- import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws-Dmjg5NH2.mjs";
1
+ import { r as AuthState } from "../auth-CZrthGxs.mjs";
2
+ import { r as VoidAuthRuntimeOptions, t as VoidAuthEnv } from "../better-auth-shared-C-0uZg8-.mjs";
3
+ import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws-DB8Feytg.mjs";
4
4
  export type WebSocketRouteMeta = {
5
5
  name?: string;
6
6
  key?: WebSocketInstanceKey;
@@ -1,4 +1,4 @@
1
- import { t as authContext } from "../auth-YVjBX5NY.mjs";
1
+ import { t as authContext } from "../auth-DyWp-fSo.mjs";
2
2
  import { o as withRuntimeEnv } from "../env-DtKg5G26.mjs";
3
3
  // src/runtime/ws-server.ts
4
4
  function matchRoute(pattern, pathname) {
@@ -1,2 +1,2 @@
1
- import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws-Dmjg5NH2.mjs";
1
+ import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws-DB8Feytg.mjs";
2
2
  export { AnyWebSocketDefinition, ConnectCommonOptions, RoomContext, RoomController, RoomDefinition, SocketContext, SocketDefinition, VoidSocket, VoidSocketCloseEvent, WebSocketBaseContext, WebSocketConnection, WebSocketInstanceKey, connect, defineRoom, defineWebSocket };
@@ -1,5 +1,5 @@
1
1
  import { t as isResourceName } from "../resource-name-DlJ9QXzg.mjs";
2
- import { t as interpolateRouteParams } from "../route-url-CRDF-I0I.mjs";
2
+ import { t as interpolateRouteParams } from "../route-url-CfCR4oMj.mjs";
3
3
  // src/runtime/ws.ts
4
4
  function defineRoom(definition) {
5
5
  assertResourceName(definition.name);
@@ -1,9 +1,10 @@
1
1
  import { a as join, l as toSlash, n as dirname, r as extname, t as basename } from "./dist-DMYe8CZJ.mjs";
2
- import { n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
3
2
  import { t as glob } from "./dist-BWNkVq50.mjs";
4
- import { n as isIdentifier, o as moduleExportName, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
5
- import { a as staticLiteral, i as staticExportInitializers, t as bindingNames } from "./ast-bindings-BkivMJIo.mjs";
3
+ import { p as readConfig } from "./config-5oSQhZNj.mjs";
6
4
  import { i as voidWarn } from "./log-D9hwSySP.mjs";
5
+ import { n as readProjectPaths } from "./project-paths-G0yut6Zz.mjs";
6
+ import { a as staticLiteral, i as staticExportInitializers, t as bindingNames } from "./ast-bindings-BkivMJIo.mjs";
7
+ import { n as isIdentifier, o as moduleExportName, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
7
8
  import { t as MagicString } from "./dist-B6eN80gc.mjs";
8
9
  import { existsSync, readFileSync, statSync } from "node:fs";
9
10
  import { parseSync } from "vite";
@@ -86,6 +87,51 @@ function parseWebSocketFilename(relativePath) {
86
87
  function isRouteEnabledForEnvironment(route, environment) {
87
88
  return environment === void 0 || route.env === null || route.env === environment;
88
89
  }
90
+ // src/router/route-order.ts
91
+ /**
92
+ * Classify one segment of a route pattern. `*` and `:name{.+}` match the rest of the path,
93
+ * `:name` matches one segment, and anything else matches as written. Pages match with the
94
+ * same rules on the client (see `patternToRegex`), so ranking and matching agree.
95
+ */
96
+ function routeSegmentKind(segment) {
97
+ if (segment === "*") return "rest";
98
+ if (segment.length < 2 || segment[0] !== ":") return "static";
99
+ const name = segment.endsWith("{.+}") ? segment.slice(1, -4) : "";
100
+ return name && !name.includes("{") && !name.includes("}") ? "rest" : "param";
101
+ }
102
+ const SEGMENT_RANK = {
103
+ static: 0,
104
+ param: 1,
105
+ rest: 2
106
+ };
107
+ /**
108
+ * Order routes so that, of any two that match the same URL, the more specific one comes first.
109
+ * Hono and the Pages client matcher both use the first match.
110
+ *
111
+ * Catch-all routes come last and fully static routes first. Otherwise the first segment that
112
+ * differs decides: static before `:param` before catch-all. Parameter names never decide, so
113
+ * `/:lang/about` ranks ahead of `/:category/:item`. Two different static segments can't match
114
+ * the same URL, so their text only keeps the order stable.
115
+ */
116
+ function compareRouteSpecificity(a, b) {
117
+ if (a.catchAll !== b.catchAll) return a.catchAll ? 1 : -1;
118
+ const aSegments = a.pattern.split("/");
119
+ const bSegments = b.pattern.split("/");
120
+ const aKinds = aSegments.map(routeSegmentKind);
121
+ const bKinds = bSegments.map(routeSegmentKind);
122
+ const aStatic = aKinds.every((kind) => kind === "static");
123
+ if (aStatic !== bKinds.every((kind) => kind === "static")) return aStatic ? -1 : 1;
124
+ const shared = Math.min(aSegments.length, bSegments.length);
125
+ for (let i = 0; i < shared; i++) {
126
+ const rank = SEGMENT_RANK[aKinds[i]] - SEGMENT_RANK[bKinds[i]];
127
+ if (rank !== 0) return rank;
128
+ if (aKinds[i] === "static" && aSegments[i] !== bSegments[i]) return compareText$1(aSegments[i], bSegments[i]);
129
+ }
130
+ return aSegments.length - bSegments.length || compareText$1(a.pattern, b.pattern);
131
+ }
132
+ function compareText$1(left, right) {
133
+ return left < right ? -1 : left > right ? 1 : 0;
134
+ }
89
135
  // src/shared/source-analysis-cache.ts
90
136
  /**
91
137
  * How long after a file changes its stat is trusted to identify its contents.
@@ -340,7 +386,12 @@ for (const [pattern, id, load, chain] of __voidDynamicRoutes) {
340
386
  }`);
341
387
  for (const layout of [...scan.layouts, ...scan.namedLayouts]) lines.push(`components[${JSON.stringify(layoutKey(toLayoutId(layout)))}] = ${load(layout.filePath)};`);
342
388
  lines.push("const routeMeta = {");
343
- for (const page of scan.pages) if (page.island) lines.push(` ${JSON.stringify(page.componentId)}: { island: true },`);
389
+ for (const page of scan.pages) {
390
+ const flags = [];
391
+ if (page.island) flags.push("island: true");
392
+ if (page.prerender === false) flags.push("prerender: false");
393
+ if (flags.length > 0) lines.push(` ${JSON.stringify(page.componentId)}: { ${flags.join(", ")} },`);
394
+ }
344
395
  lines.push("};");
345
396
  lines.push(`function matchRoute(path) {
346
397
  const id = __voidStaticRouteIds.get(path);
@@ -355,24 +406,26 @@ for (const [pattern, id, load, chain] of __voidDynamicRoutes) {
355
406
  const REGEX_SYNTAX = ".*+?^${}()|[]\\";
356
407
  /** The capture group for `*`, `:name{.+}` and `:name`; other segments match as written. */
357
408
  function captureGroup(segment) {
358
- if (segment === "*") return "(.*)";
359
- if (segment.length < 2 || segment[0] !== ":") return;
360
- const name = segment.endsWith("{.+}") ? segment.slice(1, -4) : "";
361
- return name && !name.includes("{") && !name.includes("}") ? "(.+)" : "([^\\/]+)";
409
+ switch (routeSegmentKind(segment)) {
410
+ case "rest": return segment === "*" ? "(.*)" : "(.+)";
411
+ case "param": return "([^\\/]+)";
412
+ case "static": return;
413
+ }
362
414
  }
363
415
  /** Whether `patternToRegex` matches only the pattern's own text. */
364
416
  function isStaticPattern(pattern) {
365
- return pattern.split("/").every((segment) => captureGroup(segment) === void 0);
417
+ return pattern.split("/").every((segment) => routeSegmentKind(segment) === "static");
366
418
  }
367
419
  /** The RegExp literal a page pattern matches with, the same on the client and the server. */
368
420
  function patternToRegex(pattern) {
369
- return `/^${pattern.split("/").map((segment) => {
421
+ const trailingWildcard = pattern.endsWith("/*/");
422
+ return `/^${(trailingWildcard ? pattern.slice(0, -2) : pattern).split("/").map((segment) => {
370
423
  const group = captureGroup(segment);
371
424
  if (group) return group;
372
425
  let literal = "";
373
426
  for (const char of segment) literal += REGEX_SYNTAX.includes(char) ? "\\" + char : char;
374
427
  return literal;
375
- }).join("\\/")}$/`;
428
+ }).join("\\/")}${trailingWildcard ? "(?:(.*)\\/)?" : ""}$/`;
376
429
  }
377
430
  // src/pages/scan.ts
378
431
  const COMPONENT_EXTENSIONS = [
@@ -492,6 +545,7 @@ function pageFileEnvironment(relativePath) {
492
545
  return base.endsWith(".dev") ? "dev" : base.endsWith(".prod") ? "prod" : null;
493
546
  }
494
547
  async function scanPages(root, options) {
548
+ const trailingSlash = options?.trailingSlash ?? readConfig(root).routing?.trailingSlash;
495
549
  const pagesDir = options?.pagesDir ?? options?.paths?.pagesDir ?? readProjectPaths(root).pagesDir;
496
550
  if (!existsSync(pagesDir)) return {
497
551
  pages: [],
@@ -583,7 +637,7 @@ async function scanPages(root, options) {
583
637
  })));
584
638
  } else layout = deriveFromSource(join(pagesDir, file), "page-layout", (source) => componentLayout(source, file));
585
639
  pages.push({
586
- pattern: route.pattern,
640
+ pattern: trailingSlash && route.pattern !== "/" ? `${route.pattern}/` : route.pattern,
587
641
  params: route.params,
588
642
  catchAll: route.catchAll,
589
643
  componentPath: file,
@@ -601,12 +655,7 @@ async function scanPages(root, options) {
601
655
  ...route.env ? { env: route.env } : {}
602
656
  });
603
657
  }
604
- pages.sort((a, b) => {
605
- if (a.catchAll !== b.catchAll) return a.catchAll ? 1 : -1;
606
- const aDynamic = a.pattern.includes(":");
607
- if (aDynamic !== b.pattern.includes(":")) return aDynamic ? 1 : -1;
608
- return a.pattern.localeCompare(b.pattern);
609
- });
658
+ pages.sort(compareRouteSpecificity);
610
659
  if (options?.checkRoutes !== false) {
611
660
  const environments = options?.environment ? [options.environment] : ["dev", "prod"];
612
661
  for (const environment of environments) {
@@ -717,4 +766,4 @@ function extractFrontmatterLayout(source, matter) {
717
766
  if (value === false || value === "false") return false;
718
767
  return typeof value === "string" ? value : JSON.stringify(value);
719
768
  }
720
- export { resolveLayoutChain as a, editIslandSource as c, deriveFromSource as d, invalidateSourceAnalysis as f, ROUTE_EXTENSIONS as g, parseWebSocketFilename as h, resolveEffectiveLayoutChain as i, findIslandImports as l, parseRouteFilename as m, scanPages as n, resolveLayoutIds as o, isRouteEnabledForEnvironment as p, generateComponentManifest as r, resolveNamedLayout as s, pageFileEnvironment as t, findStaticCssImports as u };
769
+ export { parseWebSocketFilename as _, resolveEffectiveLayoutChain as a, resolveNamedLayout as c, findStaticCssImports as d, deriveFromSource as f, parseRouteFilename as g, isRouteEnabledForEnvironment as h, patternToRegex as i, editIslandSource as l, compareRouteSpecificity as m, scanPages as n, resolveLayoutChain as o, invalidateSourceAnalysis as p, generateComponentManifest as r, resolveLayoutIds as s, pageFileEnvironment as t, findIslandImports as u, ROUTE_EXTENSIONS as v };
@@ -1,10 +1,10 @@
1
+ import { A as confirm, H as outro, L as log, O as cancel, U as password, tt as isCancel } from "./dist-BQdgCVQF.mjs";
2
+ import { c as getToken } from "./auth-CCk9Seol.mjs";
3
+ import { r as PlatformClient } from "./client-BEZmTP6p.mjs";
4
+ import { _ as validateSecretValues } from "./env-validation-1snjKtDX.mjs";
5
+ import { m as printSuccess, o as formatCount, p as note } from "./output-CXJTIAtF.mjs";
1
6
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-CLwxcEdq.mjs";
2
- import { c as getToken } from "./auth-Dy8svcqQ.mjs";
3
- import { A as confirm, H as outro, L as log, O as cancel, U as password, tt as isCancel } from "./dist-D23AAMxT.mjs";
4
- import { r as PlatformClient } from "./client-CoxPEhJq.mjs";
5
- import { m as printSuccess, o as formatCount, p as note } from "./output-BCdLioKP.mjs";
6
- import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
7
- import { _ as validateSecretValues } from "./env-validation-GV1oD4EV.mjs";
7
+ import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-ClvLMTI9.mjs";
8
8
  import { readFileSync } from "node:fs";
9
9
  import { parseEnv } from "node:util";
10
10
  // src/cli/secret.ts
@@ -97,7 +97,7 @@ async function resolveSecretBackend(root, args) {
97
97
  }
98
98
  async function resolveCloudflareSecretBackend(root, args) {
99
99
  if (args.projectName) throw new Error("secret: --project selects a Void platform project and is not used for direct Cloudflare apps.");
100
- const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-oLvAd9Nd.mjs");
100
+ const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-CZkjFrzH.mjs");
101
101
  const context = resolveCloudflareOperationContext(root);
102
102
  return {
103
103
  target: "Cloudflare Worker",
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Serialize Pages data without losing supported JavaScript values. The envelope
3
+ * keeps deferred metadata visible to existing ISR caches, which must not cache
4
+ * an initial payload whose deferred groups still need to stream.
5
+ */
6
+ declare function serializePageData(pageObj: unknown): string;
7
+ /** Decode a parsed Pages payload, also accepting cached pre-devalue JSON. */
8
+ declare function decodePageData<T = unknown>(value: unknown): T;
9
+ declare function deserializePageData<T = unknown>(text: string): T;
10
+ /** Element id of the Markdown page frontmatter that islands read when they hydrate. */
11
+ declare const ISLAND_FRONTMATTER_ID = "__void_frontmatter";
12
+ /**
13
+ * Script tag that carries a Markdown page's frontmatter to its islands, so
14
+ * `useFrontmatter()` returns the same value in the browser as on the server.
15
+ * Empty when the page has no frontmatter.
16
+ */
17
+ declare function islandFrontmatterScript(frontmatter: Record<string, unknown> | undefined): string;
18
+ export { serializePageData as a, islandFrontmatterScript as i, decodePageData as n, deserializePageData as r, ISLAND_FRONTMATTER_ID as t };
@@ -0,0 +1,39 @@
1
+ import { stringify, unflatten } from "devalue";
2
+ // src/pages/script-json.ts
3
+ const UNSAFE_SCRIPT_CHARS = /[<>&\u2028\u2029]/g;
4
+ function escapeScriptJson(json) {
5
+ return json.replace(UNSAFE_SCRIPT_CHARS, (c) => {
6
+ return `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`;
7
+ });
8
+ }
9
+ // src/pages/serialize.ts
10
+ /**
11
+ * Serialize Pages data without losing supported JavaScript values. The envelope
12
+ * keeps deferred metadata visible to existing ISR caches, which must not cache
13
+ * an initial payload whose deferred groups still need to stream.
14
+ */
15
+ function serializePageData(pageObj) {
16
+ const { deferred, deferredKeys } = pageObj ?? {};
17
+ const pending = deferred !== void 0 || deferredKeys !== void 0;
18
+ return escapeScriptJson(`{"__void":"devalue","data":${stringify(pageObj)}${pending ? ",\"deferred\":true" : ""}}`);
19
+ }
20
+ /** Decode a parsed Pages payload, also accepting cached pre-devalue JSON. */
21
+ function decodePageData(value) {
22
+ if (value && typeof value === "object" && "__void" in value && value.__void === "devalue" && "data" in value) return unflatten(value.data);
23
+ return value;
24
+ }
25
+ function deserializePageData(text) {
26
+ return decodePageData(JSON.parse(text));
27
+ }
28
+ /** Element id of the Markdown page frontmatter that islands read when they hydrate. */
29
+ const ISLAND_FRONTMATTER_ID = "__void_frontmatter";
30
+ /**
31
+ * Script tag that carries a Markdown page's frontmatter to its islands, so
32
+ * `useFrontmatter()` returns the same value in the browser as on the server.
33
+ * Empty when the page has no frontmatter.
34
+ */
35
+ function islandFrontmatterScript(frontmatter) {
36
+ if (!frontmatter || Object.keys(frontmatter).length === 0) return "";
37
+ return `<script type="application/json" id="${ISLAND_FRONTMATTER_ID}">${serializePageData(frontmatter)}<\/script>`;
38
+ }
39
+ export { serializePageData as a, islandFrontmatterScript as i, decodePageData as n, escapeScriptJson as o, deserializePageData as r, ISLAND_FRONTMATTER_ID as t };
@@ -1,5 +1,5 @@
1
+ import { L as log } from "./dist-BQdgCVQF.mjs";
1
2
  import { a as join, s as relative } from "./dist-DMYe8CZJ.mjs";
2
- import { L as log } from "./dist-D23AAMxT.mjs";
3
3
  import { r as getPackageDir } from "./agents-DRo8gzni.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, readlinkSync, symlinkSync } from "node:fs";
5
5
  // src/cli/skills.ts
@@ -1,5 +1,5 @@
1
- import { $ as wrapTextWithPrefix, G as promptTitle, M as getGuide, V as optionText, b as S_RADIO_ACTIVE, d as S_CHECKBOX_SELECTED, i as S_BAR_END, it as wrapAnsi, j as formatInstructionFooter, n as SELECT_INSTRUCTIONS, r as S_BAR, t as MULTISELECT_INSTRUCTIONS, u as S_CHECKBOX_INACTIVE, w as S_STEP_SUBMIT } from "./dist-D23AAMxT.mjs";
2
- import { f as import_picocolors } from "./output-BCdLioKP.mjs";
1
+ import { $ as wrapTextWithPrefix, G as promptTitle, M as getGuide, V as optionText, b as S_RADIO_ACTIVE, d as S_CHECKBOX_SELECTED, i as S_BAR_END, it as wrapAnsi, j as formatInstructionFooter, n as SELECT_INSTRUCTIONS, r as S_BAR, t as MULTISELECT_INSTRUCTIONS, u as S_CHECKBOX_INACTIVE, w as S_STEP_SUBMIT } from "./dist-BQdgCVQF.mjs";
2
+ import { f as import_picocolors } from "./output-CXJTIAtF.mjs";
3
3
  // src/cli/subcommand-prompt.ts
4
4
  const isUpKey = (key) => key === "\x1B[A" || key === "\x1BOA";
5
5
  const isDownKey = (key) => key === "\x1B[B" || key === "\x1BOB";
@@ -0,0 +1,43 @@
1
+ // src/pages/url.ts
2
+ function isSameOrigin(url, origin) {
3
+ if (url.protocol === "capacitor:") {
4
+ const current = new URL(origin);
5
+ return current.protocol === "capacitor:" && url.host !== "" && url.host === current.host;
6
+ }
7
+ return url.origin === origin;
8
+ }
9
+ function isHexDigit(char) {
10
+ return char !== void 0 && (char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F");
11
+ }
12
+ function tryDecodeURI(text) {
13
+ try {
14
+ return decodeURI(text);
15
+ } catch {
16
+ return text;
17
+ }
18
+ }
19
+ /**
20
+ * The path a page is matched on, decoded the way the server (Hono's getPath)
21
+ * decodes it: `/caf%C3%A9` becomes `/café`, while `%25`, reserved escapes such
22
+ * as `%2F` and malformed escapes stay encoded.
23
+ */
24
+ function decodePagePath(path) {
25
+ if (!path.includes("%")) return path;
26
+ const escaped = path.split("%25").join("%2525");
27
+ try {
28
+ return decodeURI(escaped);
29
+ } catch {}
30
+ let decoded = "";
31
+ let index = 0;
32
+ while (index < escaped.length) {
33
+ let end = index;
34
+ while (escaped[end] === "%" && isHexDigit(escaped[end + 1]) && isHexDigit(escaped[end + 2])) end += 3;
35
+ if (end === index) decoded += escaped[index++];
36
+ else {
37
+ decoded += tryDecodeURI(escaped.slice(index, end));
38
+ index = end;
39
+ }
40
+ }
41
+ return decoded;
42
+ }
43
+ export { isSameOrigin as n, decodePagePath as t };