void 1.6.2 → 1.8.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 (361) hide show
  1. package/dist/{account-cmd-D903EEWQ.mjs → account-cmd-CZKntRH2.mjs} +6 -6
  2. package/dist/action-key-ByZ6DDld.mjs +64 -0
  3. package/dist/{application-analysis-DlUG-XNT.mjs → application-analysis-CyTagJQM.mjs} +31 -10
  4. package/dist/{application-routing-GCBSwXA9.mjs → application-routing-BLrMVpqi.mjs} +2 -1
  5. package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
  6. package/dist/{auth-CH4PLAX1.d.mts → auth-Bk9VGtQW.d.mts} +9 -2
  7. package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
  8. package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
  9. package/dist/{auth-link-g9J7MSmP.mjs → auth-link-BOaQWMKw.mjs} +6 -6
  10. package/dist/{auth-router-DMZbG9Qn.mjs → auth-router-D0-VcmDs.mjs} +3 -3
  11. package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
  12. package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
  13. package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
  14. package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-JTsXXf2F.mjs} +5 -5
  15. package/dist/{cache-2khBO1MR.mjs → cache-D0m3Z_Xf.mjs} +5 -5
  16. package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-Ce6Os4fa.mjs} +4 -4
  17. package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
  18. package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
  19. package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
  20. package/dist/cli/cli.mjs +68 -1868
  21. package/dist/cli/cloudflare-operation-process.mjs +101 -26
  22. package/dist/cli/env-schema-probe.d.mts +1 -1
  23. package/dist/cli/env-schema-probe.mjs +3 -3
  24. package/dist/cli-main-rkrJy2Ge.mjs +1889 -0
  25. package/dist/client-D1Vz1Zep.mjs +1 -0
  26. package/dist/{client-CoxPEhJq.mjs → client-SZPyj4X_.mjs} +10 -4
  27. package/dist/{cloudflare-auth-CuS42-9A.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
  28. package/dist/{cloudflare-cmd-DTF19-j-.mjs → cloudflare-cmd-ChPLQcTP.mjs} +5 -5
  29. package/dist/{cloudflare-config-Ce8j5S7V.mjs → cloudflare-config-DtOGAbeB.mjs} +2 -2
  30. package/dist/{cloudflare-connect-BN4dHp8i.mjs → cloudflare-connect-Co93VYTo.mjs} +3 -3
  31. package/dist/{cloudflare-operations-DrZGzQap.mjs → cloudflare-operations-CXaDKYj2.mjs} +6 -6
  32. package/dist/{cloudflare-operations-laxRA8HN.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
  33. package/dist/{cloudflare-process-D9aC-jXr.mjs → cloudflare-process-DmTxZR-N.mjs} +2 -2
  34. package/dist/{config-hL-S-Y9D.mjs → config-5oSQhZNj.mjs} +3 -1
  35. package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
  36. package/dist/{config-CNDjO-15.mjs → config-DcqUBGCb.mjs} +1 -1
  37. package/dist/config-entry.d.mts +1 -1
  38. package/dist/{config-DMR0i3Z2.mjs → config-wo2EaH0X.mjs} +1 -1
  39. package/dist/{connect-DHepM7Xs.mjs → connect-DlvXt1JR.mjs} +7 -7
  40. package/dist/{create-project-Bq0M8MtO.mjs → create-project-CC_7hmYJ.mjs} +5 -5
  41. package/dist/{create-project-BiMmR5wA.mjs → create-project-DzY05xqC.mjs} +1 -1
  42. package/dist/{db-CqfT6lhV.mjs → db-FhyYGcJJ.mjs} +39 -39
  43. package/dist/{db-types-DRmxBJ2K.mjs → db-types-sVwEpyPR.mjs} +4 -2
  44. package/dist/{delete-CY4L8fi2.mjs → delete-CModjyOC.mjs} +5 -5
  45. package/dist/{deploy-La_Ly8g_.mjs → deploy-Cz9TEzZy.mjs} +502 -110
  46. package/dist/deploy-DMieisRu.mjs +2 -0
  47. package/dist/{deploy-managed-static-CESLfKHN.mjs → deploy-managed-static-DlxxXkAM.mjs} +16 -16
  48. package/dist/{deploy-transport-DcI6LXhY.mjs → deploy-transport-DUvm6-CR.mjs} +3 -3
  49. package/dist/deploy.mjs +8 -8
  50. package/dist/{dispatch-DM4Xdd2l.mjs → dispatch-CCiaAnSK.mjs} +7 -7
  51. package/dist/{dist-eV_Ep60B.mjs → dist-Cp4b1_T9.mjs} +1 -1
  52. package/dist/{dist-D23AAMxT.mjs → dist-STQXl8ck.mjs} +86 -138
  53. package/dist/{domain-BD1KOQL3.mjs → domain-DvdZPA50.mjs} +6 -6
  54. package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
  55. package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
  56. package/dist/{email-XAspopcj.mjs → email-ASpNrfLd.mjs} +10 -10
  57. package/dist/{email-cloudflare-RxIQoPc9.mjs → email-cloudflare-kqoN9jst.mjs} +25 -16
  58. package/dist/{entry-DFBca6aS.mjs → entry-BweGTCgj.mjs} +1 -1
  59. package/dist/{env-DrYUh55t.mjs → env-Bpkg3G5i.mjs} +7 -7
  60. package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
  61. package/dist/env-mask-D31Qztl9.mjs +46 -0
  62. package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
  63. package/dist/{env-validation-Del3C8AY.mjs → env-validation-BpCCQE_6.mjs} +6 -6
  64. package/dist/{env-validation-Bosj7EVg.mjs → env-validation-CN386Utu.mjs} +1 -1
  65. package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
  66. package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
  67. package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
  68. package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
  69. package/dist/gen-M5fNQKfH.mjs +1 -0
  70. package/dist/{gen-DSkScMIz.mjs → gen-upKJChvd.mjs} +7 -7
  71. package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-BvMOlb8Z.mjs} +6 -6
  72. package/dist/{handler-BR6Tvjkp.d.mts → handler-BO7Od-z9.d.mts} +22 -8
  73. package/dist/{handler-DnI_au0K.mjs → handler-C9SnmeW1.mjs} +5 -4
  74. package/dist/{headers--cbz6iZ8.mjs → headers-COGEDoMN.mjs} +11 -2
  75. package/dist/help-CItQVDL4.mjs +1 -0
  76. package/dist/{help-1OCFDsRr.mjs → help-TPCjTu6e.mjs} +7 -3
  77. package/dist/index.d.mts +5 -5
  78. package/dist/index.mjs +379 -265
  79. package/dist/{info-BpxpsX0B.mjs → info-EsDyihwf.mjs} +4 -4
  80. package/dist/{init-DpVXO5S-.mjs → init-a4lVagrb.mjs} +33 -32
  81. package/dist/{link-DAXOT-G_.mjs → link-CE55DDzS.mjs} +6 -6
  82. package/dist/{list-BFQ0gcML.mjs → list-CxRthQks.mjs} +7 -7
  83. package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
  84. package/dist/{live-0xrcVpyq.d.mts → live-Kc55iuOQ.d.mts} +2 -2
  85. package/dist/{local-d1-CLVPP6v7.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
  86. package/dist/{login-RIw7ffPe.mjs → login-AfcSGSmE.mjs} +5 -5
  87. package/dist/login-ZHsAm-I6.mjs +1 -0
  88. package/dist/{logs-B2OeLS4X.mjs → logs-BgRJuvb1.mjs} +6 -6
  89. package/dist/{migrate-DiI50Chz.mjs → migrate-BNAh6m_C.mjs} +5 -5
  90. package/dist/migrate-BflbbZQK.mjs +1 -0
  91. package/dist/nitro.d.mts +5 -0
  92. package/dist/nitro.mjs +27 -8
  93. package/dist/{node-Bc-dBAGL.mjs → node-CXFUw0Uz.mjs} +5 -5
  94. package/dist/{operator-args-D79WQP70.mjs → operator-args-DGTuCdSE.mjs} +9 -1
  95. package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
  96. package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
  97. package/dist/{operator-cmd-CEI5Aaza.mjs → operator-cmd-C-viB7Si.mjs} +7 -7
  98. package/dist/operator-cmd-D6qNuJ_z.mjs +1 -0
  99. package/dist/output-BsdnNpxa.mjs +1 -0
  100. package/dist/{output-BCdLioKP.mjs → output-DNVILSz2.mjs} +1 -1
  101. package/dist/pages/client.d.mts +43 -15
  102. package/dist/pages/client.mjs +165 -80
  103. package/dist/pages/index.d.mts +6 -4
  104. package/dist/pages/index.mjs +6 -6
  105. package/dist/pages/islands-plugin.d.mts +1 -1
  106. package/dist/pages/islands-plugin.mjs +13 -2
  107. package/dist/pages/protocol.d.mts +2 -2
  108. package/dist/pages/protocol.mjs +1 -1
  109. package/dist/pages/serialize.d.mts +2 -2
  110. package/dist/pages/serialize.mjs +1 -1
  111. package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-CiYeZmc5.mjs} +1 -1
  112. package/dist/platform-args-DJvF1-kl.mjs +1 -0
  113. package/dist/{platform-auth-config-ZrYm8KVs.mjs → platform-auth-config-Dt2qEc2w.mjs} +10 -10
  114. package/dist/{platform-auth-protection-t6mdY4nn.mjs → platform-auth-protection-B7TaF-PZ.mjs} +8 -8
  115. package/dist/{platform-auth-recovery-XeBmPTXx.mjs → platform-auth-recovery-suXSteJ6.mjs} +7 -7
  116. package/dist/{platform-cmd-EXehmSYA.mjs → platform-cmd-9rvYBBtr.mjs} +9 -9
  117. package/dist/{platform-cmd-C7BevP9b.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
  118. package/dist/{platform-domain-DR263ObA.mjs → platform-domain-DhH_vDr6.mjs} +5 -5
  119. package/dist/{platform-lifecycle-CN4aXldN.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
  120. package/dist/{platform-lifecycle-BvU_TNji.mjs → platform-lifecycle-CXmXe2xt.mjs} +17 -17
  121. package/dist/{platform-management-_UE1_GM8.mjs → platform-management-BBCHfwji.mjs} +4 -4
  122. package/dist/{platform-management-yS2sve3V.mjs → platform-management-PdrgDQTe.mjs} +1 -1
  123. package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-BGwkXYDM.mjs} +5 -5
  124. package/dist/{platform-recovery-CPVk9-Q4.mjs → platform-recovery-C8NxXGRR.mjs} +3 -3
  125. package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-Casiffqj.mjs} +3 -3
  126. package/dist/{plugin-inference-bQ1Be840.mjs → plugin-inference-CErfTgEx.mjs} +4 -4
  127. package/dist/{prepare-D8L9AQbw.mjs → prepare-BDKWZgfL.mjs} +12 -9
  128. package/dist/{prepare-BkRhDnxw.mjs → prepare-BLrzXjIl.mjs} +3 -3
  129. package/dist/prepare-a1_5usAn.mjs +1 -0
  130. package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BAdYhivW.mjs} +44 -15
  131. package/dist/prerender-render.d.mts +12 -2
  132. package/dist/prerender-render.mjs +1 -1
  133. package/dist/{project-cmd-DH3CuFC6.mjs → project-cmd-DzGvxXKH.mjs} +18 -18
  134. package/dist/{project-team-MjT5K4rQ.mjs → project-team-C5XtHbZk.mjs} +5 -5
  135. package/dist/{project-token-BKHGwY3k.mjs → project-token-B4D5yhHQ.mjs} +5 -5
  136. package/dist/{project-tsconfig-BMveFb4b.mjs → project-tsconfig-nhnTWO_Y.mjs} +3 -1
  137. package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust--0LvktDg.mjs} +5 -5
  138. package/dist/{protocol-COyySMki.mjs → protocol-B1Tvc9-x.mjs} +232 -74
  139. package/dist/{protocol-CkwjASep.d.mts → protocol-Cg2I81NA.d.mts} +13 -4
  140. package/dist/{provision-B0HqoRuI.mjs → provision-C3yiHdld.mjs} +2 -2
  141. package/dist/{provision-CYhZR_Mn.mjs → provision-CAcrauvr.mjs} +1 -1
  142. package/dist/{requests-daJmVpjk.mjs → requests-CrRiTgQA.mjs} +4 -4
  143. package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
  144. package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
  145. package/dist/{rollback-AVwiMAkk.mjs → rollback-BsmQyj-Q.mjs} +7 -7
  146. package/dist/{route-types-e69EqY88.mjs → route-types-CgtlFCDz.mjs} +268 -14
  147. package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
  148. package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
  149. package/dist/routes-stub.d.mts +14 -4
  150. package/dist/routes-stub.mjs +1 -1
  151. package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
  152. package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
  153. package/dist/runtime/ai.mjs +1 -1
  154. package/dist/runtime/auth.d.mts +2 -2
  155. package/dist/runtime/auth.mjs +1 -1
  156. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  157. package/dist/runtime/better-auth-mysql.mjs +1 -1
  158. package/dist/runtime/better-auth-pg.d.mts +1 -1
  159. package/dist/runtime/better-auth-pg.mjs +1 -1
  160. package/dist/runtime/better-auth.d.mts +1 -1
  161. package/dist/runtime/better-auth.mjs +1 -1
  162. package/dist/runtime/client-react.d.mts +3 -3
  163. package/dist/runtime/client-react.mjs +2 -2
  164. package/dist/runtime/client-solid.d.mts +3 -3
  165. package/dist/runtime/client-solid.mjs +2 -2
  166. package/dist/runtime/client-svelte.d.mts +3 -3
  167. package/dist/runtime/client-svelte.mjs +2 -2
  168. package/dist/runtime/client-vue.d.mts +3 -3
  169. package/dist/runtime/client-vue.mjs +2 -2
  170. package/dist/runtime/client.d.mts +3 -3
  171. package/dist/runtime/client.mjs +2 -2
  172. package/dist/runtime/db.d.mts +6 -3
  173. package/dist/runtime/db.mjs +2 -2
  174. package/dist/runtime/email/testing.mjs +2 -2
  175. package/dist/runtime/email.mjs +3 -3
  176. package/dist/runtime/env-public.d.mts +1 -1
  177. package/dist/runtime/env-public.mjs +55 -85
  178. package/dist/runtime/fetch-server.d.mts +1 -1
  179. package/dist/runtime/fetch-server.mjs +1 -1
  180. package/dist/runtime/fetch-stream.d.mts +2 -2
  181. package/dist/runtime/fetch-stream.mjs +1 -1
  182. package/dist/runtime/fetch.d.mts +1 -1
  183. package/dist/runtime/fetch.mjs +1 -1
  184. package/dist/runtime/handler.d.mts +1 -1
  185. package/dist/runtime/handler.mjs +1 -1
  186. package/dist/runtime/isr.d.mts +3 -1
  187. package/dist/runtime/live-client.d.mts +11 -2
  188. package/dist/runtime/live-client.mjs +8 -0
  189. package/dist/runtime/live-server.mjs +1 -1
  190. package/dist/runtime/live.d.mts +1 -1
  191. package/dist/runtime/live.mjs +1 -1
  192. package/dist/runtime/log.mjs +1 -1
  193. package/dist/runtime/remote/index.mjs +1 -1
  194. package/dist/runtime/route-url.d.mts +2 -2
  195. package/dist/runtime/route-url.mjs +1 -1
  196. package/dist/runtime/routing.d.mts +21 -5
  197. package/dist/runtime/routing.mjs +251 -29
  198. package/dist/runtime/sandbox.mjs +1 -1
  199. package/dist/runtime/sse-client.d.mts +9 -1
  200. package/dist/runtime/sse-client.mjs +7 -0
  201. package/dist/runtime/validator.d.mts +1 -1
  202. package/dist/runtime/validator.mjs +1 -1
  203. package/dist/runtime/ws-server.d.mts +3 -3
  204. package/dist/runtime/ws-server.mjs +1 -1
  205. package/dist/runtime/ws.d.mts +1 -1
  206. package/dist/runtime/ws.mjs +1 -1
  207. package/dist/{scan-F0psanp7.mjs → scan-BJ3bj6aP.mjs} +236 -32
  208. package/dist/{secret-szNdoeKa.mjs → secret-D0g5oBsP.mjs} +7 -7
  209. package/dist/serialize-DN-envGQ.d.mts +18 -0
  210. package/dist/serialize-Pf-CIQK_.mjs +39 -0
  211. package/dist/{skills-D393E4lB.mjs → skills-CoBB9_Ao.mjs} +1 -1
  212. package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
  213. package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
  214. package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
  215. package/dist/url-CuoEn0o3.mjs +43 -0
  216. package/dist/validator-8-NZs2Xr.mjs +168 -0
  217. package/dist/{version-metadata-BC3LK7Y-.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
  218. package/dist/wrangler-R3kMdJfw.mjs +1 -0
  219. package/dist/{wrangler-Gn4EoY4-.mjs → wrangler-k40T7XTQ.mjs} +2 -2
  220. package/dist/{wrapper-B9W9RE8z.mjs → wrapper-CVMZarxf.mjs} +11 -8
  221. package/dist/{ws-Dmjg5NH2.d.mts → ws--U7QicYy.d.mts} +2 -2
  222. package/docs/guide/ai.md +3 -0
  223. package/docs/guide/app-types.md +1 -0
  224. package/docs/guide/auth.md +63 -0
  225. package/docs/guide/database/d1.md +16 -1
  226. package/docs/guide/database/mysql.md +1 -0
  227. package/docs/guide/database/postgresql.md +1 -0
  228. package/docs/guide/database.md +34 -0
  229. package/docs/guide/deployment.md +9 -0
  230. package/docs/guide/durable-state.md +1 -0
  231. package/docs/guide/edge/headers.md +1 -0
  232. package/docs/guide/edge/prerendering.md +10 -4
  233. package/docs/guide/edge/redirects.md +1 -0
  234. package/docs/guide/edge/revalidation.md +6 -0
  235. package/docs/guide/edge/rewrites.md +1 -0
  236. package/docs/guide/edge/static-assets.md +1 -0
  237. package/docs/guide/email/domains.md +1 -0
  238. package/docs/guide/email/receiving.md +3 -2
  239. package/docs/guide/email/sending.md +3 -2
  240. package/docs/guide/email.md +1 -0
  241. package/docs/guide/env-vars.md +4 -0
  242. package/docs/guide/index.md +1 -0
  243. package/docs/guide/jobs.md +1 -0
  244. package/docs/guide/kv.md +1 -0
  245. package/docs/guide/live.md +3 -0
  246. package/docs/guide/pages-routing/actions-and-forms.md +51 -28
  247. package/docs/guide/pages-routing/errors.md +101 -0
  248. package/docs/guide/pages-routing/head.md +4 -1
  249. package/docs/guide/pages-routing/islands.md +2 -1
  250. package/docs/guide/pages-routing/layouts.md +3 -0
  251. package/docs/guide/pages-routing/loaders.md +3 -0
  252. package/docs/guide/pages-routing/markdown.md +3 -3
  253. package/docs/guide/pages-routing/overview.md +142 -10
  254. package/docs/guide/pages-routing/view-transitions.md +1 -0
  255. package/docs/guide/platform/administration/access.md +1 -0
  256. package/docs/guide/platform/administration/connected-apps.md +4 -0
  257. package/docs/guide/platform/administration/email.md +1 -0
  258. package/docs/guide/platform/administration/operations.md +1 -0
  259. package/docs/guide/platform/administration/plans.md +1 -0
  260. package/docs/guide/platform/administration/projects.md +11 -0
  261. package/docs/guide/platform/administration/zero-trust.md +1 -0
  262. package/docs/guide/platform/development/local.md +1 -0
  263. package/docs/guide/platform/development/runtime.md +1 -0
  264. package/docs/guide/platform/development/schema-ci.md +1 -0
  265. package/docs/guide/platform/installation/ci.md +1 -0
  266. package/docs/guide/platform/installation/credentials.md +1 -0
  267. package/docs/guide/platform/installation/domains.md +1 -0
  268. package/docs/guide/platform/installation/first-deployment.md +1 -0
  269. package/docs/guide/platform/installation/maintenance.md +1 -0
  270. package/docs/guide/platform/installation/prerequisites.md +1 -0
  271. package/docs/guide/platform/installation/setup.md +1 -0
  272. package/docs/guide/platform/installation/uninstall.md +1 -0
  273. package/docs/guide/platform-administration.md +1 -0
  274. package/docs/guide/platform-development.md +1 -0
  275. package/docs/guide/project-collaboration.md +1 -0
  276. package/docs/guide/queues.md +3 -0
  277. package/docs/guide/quickstart.md +4 -2
  278. package/docs/guide/remote-dev.md +1 -0
  279. package/docs/guide/sandboxes.md +1 -0
  280. package/docs/guide/self-hosted-platform.md +1 -0
  281. package/docs/guide/server-routing.md +1 -0
  282. package/docs/guide/sse.md +3 -0
  283. package/docs/guide/ssg.md +24 -2
  284. package/docs/guide/ssr.md +1 -0
  285. package/docs/guide/storage.md +7 -2
  286. package/docs/guide/testing.md +62 -0
  287. package/docs/guide/type-safety.md +308 -26
  288. package/docs/guide/typed-fetch.md +8 -3
  289. package/docs/guide/websockets.md +6 -5
  290. package/docs/index.md +1 -0
  291. package/docs/integrations/agents.md +1 -0
  292. package/docs/integrations/cloudflare.md +11 -10
  293. package/docs/integrations/frameworks/analog.md +1 -0
  294. package/docs/integrations/frameworks/astro.md +1 -0
  295. package/docs/integrations/frameworks/nuxt.md +3 -0
  296. package/docs/integrations/frameworks/overview.md +3 -0
  297. package/docs/integrations/frameworks/react-router.md +1 -0
  298. package/docs/integrations/frameworks/sveltekit.md +1 -0
  299. package/docs/integrations/frameworks/tanstack-start.md +1 -0
  300. package/docs/integrations/hono.md +1 -0
  301. package/docs/integrations/nodejs-bun-deno.md +66 -0
  302. package/docs/reference/api/auth.md +20 -0
  303. package/docs/reference/api/client.md +7 -4
  304. package/docs/reference/api/database.md +24 -1
  305. package/docs/reference/api/deploy.md +4 -0
  306. package/docs/reference/api/durable.md +1 -0
  307. package/docs/reference/api/env.md +1 -0
  308. package/docs/reference/api/handlers.md +4 -1
  309. package/docs/reference/api/pages.md +30 -12
  310. package/docs/reference/api/plugin.md +1 -0
  311. package/docs/reference/api/resources.md +4 -1
  312. package/docs/reference/api/rewrites.md +18 -5
  313. package/docs/reference/api/types.md +10 -2
  314. package/docs/reference/api.md +1 -0
  315. package/docs/reference/cli/auth.md +1 -0
  316. package/docs/reference/cli/database.md +3 -0
  317. package/docs/reference/cli/deploy.md +18 -11
  318. package/docs/reference/cli/domains.md +1 -0
  319. package/docs/reference/cli/email.md +1 -0
  320. package/docs/reference/cli/generate.md +1 -0
  321. package/docs/reference/cli/github.md +1 -0
  322. package/docs/reference/cli/platform-config.md +1 -0
  323. package/docs/reference/cli/platform-email.md +1 -0
  324. package/docs/reference/cli/platform-installation.md +1 -0
  325. package/docs/reference/cli/platform-operations.md +1 -0
  326. package/docs/reference/cli/platform-users.md +23 -0
  327. package/docs/reference/cli/platform-zero-trust.md +1 -0
  328. package/docs/reference/cli/platform.md +1 -0
  329. package/docs/reference/cli/project.md +1 -0
  330. package/docs/reference/cli/secrets.md +1 -0
  331. package/docs/reference/cli/setup.md +1 -0
  332. package/docs/reference/cli.md +6 -0
  333. package/docs/reference/config.md +25 -2
  334. package/docs/reference/resource-inference.md +1 -0
  335. package/docs/reference/structure.md +1 -0
  336. package/package.json +27 -25
  337. package/schema.json +4 -0
  338. package/skills/void/SKILL.md +7 -0
  339. package/dist/action-key-XtKKbbsi.mjs +0 -25
  340. package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
  341. package/dist/client-CEtr5UOR.mjs +0 -1
  342. package/dist/deploy-DMhOyebt.mjs +0 -2
  343. package/dist/gen-BbT1Ku1P.mjs +0 -1
  344. package/dist/help-Ba8Dq5-r.mjs +0 -1
  345. package/dist/login-BX2gzHUt.mjs +0 -1
  346. package/dist/migrate-CUGMGaIM.mjs +0 -1
  347. package/dist/operator-cmd-oTT2MA9G.mjs +0 -1
  348. package/dist/output-E6gecbbV.mjs +0 -1
  349. package/dist/platform-args-C7XUw9mw.mjs +0 -1
  350. package/dist/prepare-CZRVGNld.mjs +0 -1
  351. package/dist/resolve-project-CgfjtOwz.mjs +0 -1
  352. package/dist/serialize-DUuYuaY3.mjs +0 -29
  353. package/dist/serialize-I4EmS-Wf.d.mts +0 -16
  354. package/dist/validator-CTfmzZYb.mjs +0 -69
  355. package/dist/wrangler-CQ5c-MtJ.mjs +0 -1
  356. package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
  357. package/dist/{config-s6TkpSat.mjs → config-eeDzKBS9.mjs} +1 -1
  358. package/dist/{env-types-Bd8DkQhl.mjs → env-types-Dz9qkiOn.mjs} +1 -1
  359. package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
  360. package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
  361. package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
@@ -1,8 +1,10 @@
1
- import { f as toUrlString, u as interpolateRouteParams } from "../route-url-C_YIH_zO.mjs";
2
- import { t as PageObject } from "../protocol-CkwjASep.mjs";
1
+ import { d as interpolateRouteParams, p as toUrlString } from "../route-url-C3JwYrER.mjs";
2
+ import { t as PageObject } from "../protocol-Cg2I81NA.mjs";
3
+ import { t as BoundaryManifest } from "../boundary-plans-CRmWH68v.mjs";
3
4
  import { a as LinkPrefetchValue, i as LinkPrefetchStrategy, n as CacheForInput, r as CacheForResult } from "../prefetch-NdNeubbH.mjs";
5
+ import { n as ErrorPageProps, o as PageError } from "../types-IPut3_Yx.mjs";
4
6
  import { UsageLimitData } from "@void/edge";
5
- import { ActionUrl, Href, ResolveActionBody, ResolveActionParams, RouteUrlInput } from "void/routes";
7
+ import { ActionUrl, Href, ResolveActionBody, ResolveActionParams, RouteUrl, RouteUrlInput } from "void/routes";
6
8
  type ActionErrorHandlingScope = "callSite" | "boundary";
7
9
  type ActionResult<T = PageObject | undefined> = {
8
10
  ok: true;
@@ -53,6 +55,8 @@ type VisitOptions = {
53
55
  _popstate?: boolean;
54
56
  /** @internal Used by router.refresh() to refetch the current URL even when it has a hash */
55
57
  _refresh?: boolean;
58
+ /** @internal Used by actions: the page query they added to the URL, which redirects leave out */
59
+ _preservedQuery?: string;
56
60
  };
57
61
  type PrefetchOptions = {
58
62
  method?: string;
@@ -66,12 +70,15 @@ type VoidRouterAdapter$1 = {
66
70
  onDeferredUpdate?(props: Record<string, unknown>): void;
67
71
  };
68
72
  type PageNavigationEngineConfig = {
73
+ boundaryManifest?: BoundaryManifest;
74
+ dev?: boolean;
69
75
  adapter: VoidRouterAdapter$1;
70
76
  components: Record<string, () => Promise<PageComponentModule>>;
71
77
  layoutTree: Record<string, Array<string>>;
72
78
  routeMeta: Record<string, {
73
79
  island?: boolean;
74
80
  prerender?: boolean;
81
+ boundary?: boolean;
75
82
  }>;
76
83
  /** Page id for a decoded pathname (see `decodePagePath`). */
77
84
  matchRoute(path: string): string | null;
@@ -95,6 +102,8 @@ type PageNavigationResource = {
95
102
  url: string;
96
103
  fetchUrl: string;
97
104
  hash: string;
105
+ /** Destination after redirects, including its query and hash. */
106
+ readonly resolvedUrl?: string;
98
107
  method: string;
99
108
  options: VisitOptions;
100
109
  immediate: boolean;
@@ -173,16 +182,18 @@ export declare function linkPrefetchStrategies(props: Pick<BaseLinkProps, "prefe
173
182
  /**
174
183
  * Marks a GET link to the current page. Pathnames compare the way the server
175
184
  * matches pages: case-sensitive, trailing slash significant, decoded like Hono's
176
- * getPath. The query and hash are ignored. `prefix` also matches nested pages by
177
- * whole segment, except for `/`, but only an exact match is `aria-current`.
178
- * Spread the result before the user's attributes so theirs win.
185
+ * getPath. A link with a query also needs each of its params, with the same value,
186
+ * in the current URL, which may have more params in any order. GET data counts as
187
+ * query, and the hash is ignored. `prefix` also matches nested pages by whole
188
+ * segment, except for `/`, comparing only the path, but only an exact match is
189
+ * `aria-current`. Spread the result before the user's attributes so theirs win.
179
190
  */
180
191
  export declare function linkActiveAttributes(router: VoidRouter | null | undefined, link: ResolvedLink, match?: LinkActiveMatch): LinkActiveAttributes;
181
192
  /**
182
193
  * Marks a link while a visit to its destination is loading: the visit uses the link's
183
- * method and goes to its path, query and hash. Unlike active links, the query counts,
184
- * so `?page=2` isn't pending during a visit to `?page=3`. Every link to the destination
185
- * is marked, not only the one that was clicked.
194
+ * method and goes to its path, query and hash. Unlike active links, the whole query and
195
+ * the hash count, so `?tab=open` isn't pending during a visit to `?tab=open&page=2`.
196
+ * Every link to the destination is marked, not only the one that was clicked.
186
197
  * Spread the result before the user's attributes so theirs win.
187
198
  */
188
199
  export declare function linkPendingAttributes(router: VoidRouter | null | undefined, navigation: NavigationState | null | undefined, link: ResolvedLink): LinkPendingAttributes;
@@ -268,21 +279,36 @@ type FormState<TData, TEditing extends FormEditing> = FormStatus & FormFields<TD
268
279
  /**
269
280
  * The `useIslandForm()` contract every adapter shares. Errors are keyed by whatever names the
270
281
  * action returns, not only the default fields. Submit methods take the action URL.
282
+ * That URL is a `RouteUrl`: any string, unless `routing.typedRoutes` is on.
271
283
  */
272
284
  type IslandFormState<TData, TEditing extends FormEditing> = FormStatus & FormFields<TData, Partial<Record<string, string>>, TEditing> & Readonly<{
273
285
  reset(...fields: ReadonlyArray<keyof TData & string>): void;
274
286
  clearErrors(...fields: ReadonlyArray<string>): void;
275
287
  clearError(): void;
276
- post(url: string): Promise<void>;
277
- put(url: string): Promise<void>;
278
- patch(url: string): Promise<void>;
279
- delete(url: string): Promise<void>;
288
+ post(url: RouteUrl): Promise<void>;
289
+ put(url: RouteUrl): Promise<void>;
290
+ patch(url: RouteUrl): Promise<void>;
291
+ delete(url: RouteUrl): Promise<void>;
280
292
  }>;
281
293
  export declare function formErrorMessage(form: Pick<FormModel, "error" | "errors">): string | null;
282
294
  export declare function formRetryMessage(error: VoidActionError | null): string | null;
283
295
  export declare function formSubmissionBlocked(form: Pick<FormModel, "pending" | "error">, now?: number): boolean;
284
296
  /** One deadline, capped for browser timers; no polling and no automatic submission. */
285
297
  export declare function scheduleFormRetry(error: VoidActionError | null, ready: () => void): () => void;
298
+ type ClientPageBoundary = {
299
+ id: string;
300
+ key: string;
301
+ depth: number;
302
+ load: () => Promise<{
303
+ default: unknown;
304
+ }>;
305
+ };
306
+ export declare function pageBoundarySlots(manifest: BoundaryManifest | undefined, component: string, components: Record<string, () => Promise<{
307
+ default: unknown;
308
+ }>>): Array<ClientPageBoundary>;
309
+ export declare function clientPageError(error: unknown, dev?: boolean): PageError;
310
+ /** Terminal recovery cannot depend on the failed adapter, imports, or component tree. */
311
+ export declare function showTerminalPageError(url?: string): void;
286
312
  export type NavigationStateType = "idle" | "loading" | "submitting";
287
313
  export type NavigationMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
288
314
  export type NavigationState = {
@@ -320,7 +346,9 @@ export declare function createSsrRouter(url?: string, params?: Record<string, st
320
346
  export declare const ssrProxy: VoidRouter;
321
347
  /** Refetch the current page in place: same history entry, URL hash, state and scroll. */
322
348
  export declare function refreshPage(router: Pick<VoidRouter, "visit">, options?: VisitOptions): Promise<unknown>;
323
- export declare function submitAction(router: VoidRouter, url: string, options: VisitOptions): Promise<ActionResult>;
349
+ export declare function submitAction(router: VoidRouter, url: string, options: VisitOptions, errorOptions?: {
350
+ throwOnError?: boolean;
351
+ }): Promise<ActionResult>;
324
352
  type ActionMethod = "POST" | "PUT" | "PATCH" | "DELETE";
325
353
  type HasParams<U extends string> = [ResolveActionParams<U>] extends [never] ? false : true;
326
354
  type ActionOptions<U extends string> = {
@@ -348,4 +376,4 @@ export declare function createVoidRouter(config: VoidRouterConfig): Promise<{
348
376
  }>;
349
377
  export declare function scheduleHydration(el: Element, loader: () => Promise<unknown>, props: Record<string, unknown>, strategy: string, hydrateFn: (el: Element, mod: unknown, props: Record<string, unknown>) => void | Promise<void>): void;
350
378
  export declare function initIslands(islands: Record<string, () => Promise<unknown>>, hydrateFn: (el: Element, mod: unknown, props: Record<string, unknown>, frontmatter: Record<string, unknown>) => void | Promise<void>): void;
351
- export { type ActionErrorHandlingScope, type ActionResult, type BaseLinkProps, type FormMethod, type FormModel, type FormResetOptions, type FormState, type FormSubmitOptions, type IslandActionResult, type IslandFormState, type LinkActiveAttributes, type LinkActiveMatch, type LinkNavigateEvent, type LinkPendingAttributes, type LinkPrefetchStrategy, type LinkPrefetchValue, type PageNavigationEngine, type PageNavigationResource, type PageNavigationResult, type PrefetchOptions, type ResolvedLink, type VisitOptions, interpolateRouteParams, toUrlString };
379
+ export { type ActionErrorHandlingScope, type ActionResult, type BaseLinkProps, type BoundaryManifest, type ClientPageBoundary, type ErrorPageProps, type FormMethod, type FormModel, type FormResetOptions, type FormState, type FormSubmitOptions, type IslandActionResult, type IslandFormState, type LinkActiveAttributes, type LinkActiveMatch, type LinkNavigateEvent, type LinkPendingAttributes, type LinkPrefetchStrategy, type LinkPrefetchValue, type PageError, type PageNavigationEngine, type PageNavigationResource, type PageNavigationResult, type PrefetchOptions, type ResolvedLink, type VisitOptions, interpolateRouteParams, toUrlString };
@@ -1,8 +1,9 @@
1
- import { i as searchWithoutActionKey } from "../action-key-XtKKbbsi.mjs";
2
- import { t as ISLAND_FRONTMATTER_ID } from "../serialize-DUuYuaY3.mjs";
3
- import { r as toUrlString, t as interpolateRouteParams } from "../route-url-CRDF-I0I.mjs";
1
+ import { r as toUrlString, t as interpolateRouteParams } from "../route-url-CfCR4oMj.mjs";
2
+ import { c as withPageQuery, o as searchWithoutActionKey, t as PRESERVED_QUERY_HEADER } from "../action-key-ByZ6DDld.mjs";
4
3
  import { r as parseCacheFor, t as PrefetchCache } from "../prefetch-Dx2jIbtg.mjs";
5
- import { readUsageLimit } from "@void/edge";
4
+ import { a as serializePageData, n as decodePageData, r as deserializePageData, t as ISLAND_FRONTMATTER_ID } from "../serialize-Pf-CIQK_.mjs";
5
+ import { n as isSameOrigin, t as decodePagePath } from "../url-CuoEn0o3.mjs";
6
+ import { PAGES_PROTOCOL_VERSION, readUsageLimit } from "@void/edge";
6
7
  // src/pages/action-result.ts
7
8
  var VoidActionError = class extends Error {
8
9
  body;
@@ -70,6 +71,52 @@ async function createActionErrorFromResponse(response, url) {
70
71
  url
71
72
  });
72
73
  }
74
+ // src/pages/boundary-client.ts
75
+ function pageBoundarySlots(manifest, component, components) {
76
+ if (!manifest) return [];
77
+ const current = manifest.plans[component];
78
+ const source = current?.source ?? component;
79
+ return (manifest.pages[source]?.catches ?? []).filter((c) => {
80
+ const plan = manifest.plans[c.plan];
81
+ return !current || (current.kind === "not-found" ? plan.directory.length <= current.directory.length : plan.directory.length < current.directory.length);
82
+ }).map((c) => ({
83
+ id: c.plan,
84
+ key: manifest.plans[c.plan].componentId,
85
+ depth: Math.min(c.depth, current?.layouts.length ?? Infinity),
86
+ load: components[c.plan]
87
+ }));
88
+ }
89
+ function clientPageError(error, dev = false) {
90
+ if (isVoidActionError(error)) return {
91
+ status: error.status,
92
+ message: error.message
93
+ };
94
+ return {
95
+ status: 500,
96
+ message: dev && error instanceof Error ? error.message : "Internal Server Error"
97
+ };
98
+ }
99
+ /** Terminal recovery cannot depend on the failed adapter, imports, or component tree. */
100
+ function showTerminalPageError(url = window.location.href) {
101
+ const target = new URL(url, window.location.href);
102
+ if (target.origin !== window.location.origin) throw new Error("Invalid error page destination");
103
+ try {
104
+ history.replaceState(history.state, "", target.href);
105
+ } catch {}
106
+ const main = document.createElement("main");
107
+ const heading = document.createElement("h1");
108
+ heading.textContent = "Something went wrong";
109
+ main.appendChild(heading);
110
+ for (const [label, href] of [["Try again", target.href], ["Go home", "/"]]) {
111
+ const link = document.createElement("a");
112
+ link.textContent = label;
113
+ link.href = href;
114
+ link.style.marginRight = "1rem";
115
+ main.appendChild(link);
116
+ }
117
+ main.style.cssText = "font-family:system-ui,sans-serif;padding:2rem";
118
+ document.body.replaceChildren(main);
119
+ }
73
120
  // src/pages/head-client.ts
74
121
  const ATTR = "data-void-head";
75
122
  function elementDescriptorSignature(descriptor) {
@@ -255,48 +302,6 @@ function createScrollRestoration() {
255
302
  }
256
303
  };
257
304
  }
258
- // src/pages/url.ts
259
- function isSameOrigin(url, origin) {
260
- if (url.protocol === "capacitor:") {
261
- const current = new URL(origin);
262
- return current.protocol === "capacitor:" && url.host !== "" && url.host === current.host;
263
- }
264
- return url.origin === origin;
265
- }
266
- function isHexDigit(char) {
267
- return char !== void 0 && (char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F");
268
- }
269
- function tryDecodeURI(text) {
270
- try {
271
- return decodeURI(text);
272
- } catch {
273
- return text;
274
- }
275
- }
276
- /**
277
- * The path a page is matched on, decoded the way the server (Hono's getPath)
278
- * decodes it: `/caf%C3%A9` becomes `/café`, while `%25`, reserved escapes such
279
- * as `%2F` and malformed escapes stay encoded.
280
- */
281
- function decodePagePath(path) {
282
- if (!path.includes("%")) return path;
283
- const escaped = path.split("%25").join("%2525");
284
- try {
285
- return decodeURI(escaped);
286
- } catch {}
287
- let decoded = "";
288
- let index = 0;
289
- while (index < escaped.length) {
290
- let end = index;
291
- while (escaped[end] === "%" && isHexDigit(escaped[end + 1]) && isHexDigit(escaped[end + 2])) end += 3;
292
- if (end === index) decoded += escaped[index++];
293
- else {
294
- decoded += tryDecodeURI(escaped.slice(index, end));
295
- index = end;
296
- }
297
- }
298
- return decoded;
299
- }
300
305
  // src/pages/navigation-engine.ts
301
306
  /**
302
307
  * The server leaves a named action's key out of the page URL. When the page URL
@@ -338,18 +343,18 @@ function objectToFormData(source, form, parentKey) {
338
343
  return form;
339
344
  }
340
345
  function clonePageData(pageData) {
341
- return JSON.parse(JSON.stringify(pageData));
346
+ return deserializePageData(serializePageData(pageData));
342
347
  }
343
348
  function readInitialPageData() {
344
349
  const scriptEl = document.getElementById(PAGE_DATA_SCRIPT_ID);
345
- if (scriptEl?.textContent) return JSON.parse(scriptEl.textContent);
350
+ if (scriptEl?.textContent) return deserializePageData(scriptEl.textContent);
346
351
  throw new Error("pages: Missing initial page payload.");
347
352
  }
348
353
  function parsePageDataFromHtml(html) {
349
354
  const scriptEl = new DOMParser().parseFromString(html, "text/html").getElementById(PAGE_DATA_SCRIPT_ID);
350
355
  if (!scriptEl?.textContent) return null;
351
356
  try {
352
- return JSON.parse(scriptEl.textContent);
357
+ return deserializePageData(scriptEl.textContent);
353
358
  } catch {
354
359
  return null;
355
360
  }
@@ -374,7 +379,9 @@ async function fetchPageResponse(fetchUrl, init) {
374
379
  async function createPageNavigationEngine(config) {
375
380
  const { adapter, components, layoutTree, routeMeta, staticPageData: STATIC_PAGE_DATA_ENABLED = false, staticPageDataFastPath: STATIC_PAGE_DATA_FAST_PATH = STATIC_PAGE_DATA_ENABLED, prefetchHoverDelay: PREFETCH_HOVER_DELAY, prefetchDefaultCacheFor: PREFETCH_DEFAULT_CACHE_FOR, prefetchDefaultStrategy: PREFETCH_DEFAULT_STRATEGY = false, cacheVisitedPageData: CACHE_VISITED_PAGE_DATA = false } = config;
376
381
  const matchRoute = (url) => config.matchRoute(decodePagePath(new URL(url, "http://x").pathname));
382
+ const hasBoundaries = Object.keys(config.boundaryManifest?.plans ?? {}).length > 0;
377
383
  const _prefetchCache = new PrefetchCache();
384
+ const uncachedPayloads = /* @__PURE__ */ new WeakSet();
378
385
  let _nextNavigationId = 0;
379
386
  let _urlNavigationId = 0;
380
387
  let _pendingResource = null;
@@ -395,10 +402,32 @@ async function createPageNavigationEngine(config) {
395
402
  const ids = layoutTree[componentId] || [];
396
403
  return Promise.all(ids.map(async (id) => (await components[id]()).default));
397
404
  }
405
+ async function recoverImportFailure(page, error) {
406
+ for (const boundary of pageBoundarySlots(config.boundaryManifest, page.component, components)) {
407
+ const pageData = {
408
+ ...page,
409
+ component: boundary.id,
410
+ props: { error: clientPageError(error, config.dev) },
411
+ deferred: void 0,
412
+ deferredKeys: void 0,
413
+ deferredErrors: void 0,
414
+ errors: null
415
+ };
416
+ try {
417
+ const [component, layouts] = await Promise.all([resolveComponent(boundary.id), resolveLayouts(boundary.id)]);
418
+ return {
419
+ pageData,
420
+ component,
421
+ layouts
422
+ };
423
+ } catch {}
424
+ }
425
+ throw error;
426
+ }
398
427
  function getStaticPageDataUrl(url) {
399
428
  const { pathname } = new URL(url || "/", window.location.origin);
400
429
  const filePath = pathname === "/" ? "index" : pathname.replace(/^\/+/, "");
401
- return `${STATIC_PAGE_DATA_PREFIX}/${filePath}.json`;
430
+ return `${STATIC_PAGE_DATA_PREFIX}/${filePath}${pathname !== "/" && pathname.endsWith("/") ? "index" : ""}.json`;
402
431
  }
403
432
  function isUsablePageData(pageData, matchedId) {
404
433
  return typeof pageData === "object" && pageData !== null && "component" in pageData && typeof pageData.component === "string" && "props" in pageData && typeof pageData.props === "object" && pageData.props !== null && pageData.component === matchedId && !routeMeta[pageData.component]?.island && Boolean(components[pageData.component]);
@@ -523,7 +552,7 @@ async function createPageNavigationEngine(config) {
523
552
  signal
524
553
  });
525
554
  if (pageDataResponse.ok) {
526
- const pageData = await pageDataResponse.json();
555
+ const pageData = decodePageData(await pageDataResponse.json());
527
556
  if (isUsablePageData(pageData, matchedId)) return {
528
557
  pageData,
529
558
  resolvedDeferred: true
@@ -562,6 +591,7 @@ async function createPageNavigationEngine(config) {
562
591
  function fetchPrefetchPageData(url) {
563
592
  const headers = {
564
593
  "X-VoidPages": "true",
594
+ "X-VoidPages-Version": PAGES_PROTOCOL_VERSION,
565
595
  Accept: "application/json",
566
596
  Purpose: "prefetch"
567
597
  };
@@ -573,7 +603,9 @@ async function createPageNavigationEngine(config) {
573
603
  }).then(async (r) => {
574
604
  if (!r || r.redirected) return null;
575
605
  if (!r.headers.get("X-VoidPages")) return (await loadStaticPageData(url, r, void 0, !STATIC_PAGE_DATA_FAST_PATH))?.pageData ?? null;
576
- return r.json();
606
+ const data = decodePageData(await r.json());
607
+ if (!r.ok || /no-store/i.test(r.headers.get("Cache-Control") ?? "")) uncachedPayloads.add(data);
608
+ return data;
577
609
  });
578
610
  });
579
611
  }
@@ -592,7 +624,7 @@ async function createPageNavigationEngine(config) {
592
624
  window.scrollTo(0, 0);
593
625
  }
594
626
  const deferredWindow = window;
595
- deferredWindow.__resolveDeferred = (group, data) => _htmlDeferredRegistry?.resolve(group, data, void 0);
627
+ deferredWindow.__resolveDeferred = (group, data, serialized) => _htmlDeferredRegistry?.resolve(group, serialized ? decodePageData(data) : data, void 0);
596
628
  deferredWindow.__rejectDeferred = (group, error) => _htmlDeferredRegistry?.resolve(group, void 0, error);
597
629
  function commitHashNavigation(effectiveFetchUrl, hash, options, writeHistory) {
598
630
  if (writeHistory) scrollRestoration.writeHistory(effectiveFetchUrl + hash, !!options.replace);
@@ -614,8 +646,10 @@ async function createPageNavigationEngine(config) {
614
646
  preloadComponentPromise?.catch(() => {});
615
647
  const headers = {
616
648
  "X-VoidPages": "true",
649
+ "X-VoidPages-Version": PAGES_PROTOCOL_VERSION,
617
650
  Accept: "application/json"
618
651
  };
652
+ if (options._preservedQuery && method !== "GET") headers[PRESERVED_QUERY_HEADER] = options._preservedQuery;
619
653
  const fetchOptions = {
620
654
  method,
621
655
  headers,
@@ -629,6 +663,7 @@ async function createPageNavigationEngine(config) {
629
663
  }
630
664
  }
631
665
  let pageData;
666
+ if (options._refresh) _prefetchCache.flush(fetchUrl, method);
632
667
  const cacheEntry = method === "GET" ? _prefetchCache.get(fetchUrl, method) : null;
633
668
  if (cacheEntry) {
634
669
  const cachedPageData = await cacheEntry.response;
@@ -639,11 +674,12 @@ async function createPageNavigationEngine(config) {
639
674
  }
640
675
  pageData = clonePageData(cachedPageData);
641
676
  deferredRegistry.setup(pageData, true);
642
- if (!_prefetchCache.isFresh(cacheEntry)) {
643
- const bgFetch = fetchPrefetchPageData(fetchUrl);
644
- _prefetchCache.flush(fetchUrl, method);
645
- _prefetchCache.set(fetchUrl, method, bgFetch, PREFETCH_DEFAULT_CACHE_FOR);
646
- }
677
+ if (!_prefetchCache.isFresh(cacheEntry)) fetchPrefetchPageData(fetchUrl).then((data) => {
678
+ if (data && typeof data === "object" && !uncachedPayloads.has(data) && _prefetchCache.get(fetchUrl, method) === cacheEntry) {
679
+ _prefetchCache.flush(fetchUrl, method);
680
+ _prefetchCache.set(fetchUrl, method, Promise.resolve(data), PREFETCH_DEFAULT_CACHE_FOR);
681
+ }
682
+ }).catch(() => {});
647
683
  } else {
648
684
  if (method === "GET" && STATIC_PAGE_DATA_ENABLED && STATIC_PAGE_DATA_FAST_PATH) {
649
685
  const staticPageData = await loadStaticPageDataFile(fetchUrl, signal);
@@ -700,11 +736,11 @@ async function createPageNavigationEngine(config) {
700
736
  buffer = buffer.slice(newlineIdx + 1);
701
737
  if (!line) continue;
702
738
  if (firstLine) {
703
- pageData = JSON.parse(line);
739
+ pageData = deserializePageData(line);
704
740
  deferredRegistry.setup(pageData);
705
741
  firstLine = false;
706
742
  } else {
707
- const msg = JSON.parse(line);
743
+ const msg = deserializePageData(line);
708
744
  if (msg.__deferred) deferredRegistry.resolve(msg.__deferred, msg.data, msg.error);
709
745
  }
710
746
  }
@@ -728,17 +764,36 @@ async function createPageNavigationEngine(config) {
728
764
  }
729
765
  })();
730
766
  } else {
731
- pageData = await response.json();
767
+ pageData = decodePageData(await response.json());
732
768
  deferredRegistry.setup(pageData);
733
769
  }
734
- if (CACHE_VISITED_PAGE_DATA && method === "GET" && response?.ok && response.headers.get("X-VoidPages") && pageData?.component === matchRoute(fetchUrl) && !pageData.deferredKeys) _prefetchCache.set(fetchUrl, method, Promise.resolve(clonePageData(pageData)), PREFETCH_DEFAULT_CACHE_FOR);
770
+ if (CACHE_VISITED_PAGE_DATA && method === "GET" && response?.ok && !/no-store/i.test(response.headers.get("Cache-Control") ?? "") && response.headers.get("X-VoidPages") && pageData?.component === matchRoute(fetchUrl) && !pageData.deferredKeys) _prefetchCache.set(fetchUrl, method, Promise.resolve(clonePageData(pageData)), PREFETCH_DEFAULT_CACHE_FOR);
735
771
  }
736
772
  if (!pageData) throw new Error("pages: Missing page payload.");
737
773
  if (method !== "GET") {
738
774
  deferredRegistry.preserveValuesFrom(_committedDeferredRegistry, pageData);
739
775
  commitTarget.fetchUrl = withoutActionKey(fetchUrl, pageData.url);
740
776
  }
741
- const [component, layouts] = await Promise.race([matchedComponentId === pageData.component && preloadComponentPromise ? preloadComponentPromise : Promise.all([resolveComponent(pageData.component), resolveLayouts(pageData.component)]), abortSignalPromise(signal)]);
777
+ if (!components[pageData.component]) {
778
+ window.location.href = url;
779
+ return;
780
+ }
781
+ let component;
782
+ let layouts;
783
+ try {
784
+ [component, layouts] = await Promise.race([matchedComponentId === pageData.component && preloadComponentPromise ? preloadComponentPromise : Promise.all([resolveComponent(pageData.component), resolveLayouts(pageData.component)]), abortSignalPromise(signal)]);
785
+ } catch (error) {
786
+ if (isAbortError(error) || signal.aborted || method !== "GET" || !hasBoundaries) throw error;
787
+ _prefetchCache.flush(fetchUrl);
788
+ try {
789
+ const recovered = await Promise.race([recoverImportFailure(pageData, error), abortSignalPromise(signal)]);
790
+ ({pageData, component, layouts} = recovered);
791
+ deferredRegistry.setup(pageData);
792
+ } catch (failure) {
793
+ if (!signal.aborted && !isAbortError(failure)) showTerminalPageError(url);
794
+ throw failure;
795
+ }
796
+ }
742
797
  if (id !== _nextNavigationId && signal.aborted) throw abortError();
743
798
  return {
744
799
  pageData,
@@ -794,8 +849,17 @@ async function createPageNavigationEngine(config) {
794
849
  return true;
795
850
  };
796
851
  }
797
- const initialPageData = readInitialPageData();
798
- const [initialComponent, initialLayouts] = await Promise.all([resolveComponent(initialPageData.component), resolveLayouts(initialPageData.component)]);
852
+ let initialPageData = readInitialPageData();
853
+ let initialComponent;
854
+ let initialLayouts;
855
+ try {
856
+ [initialComponent, initialLayouts] = await Promise.all([resolveComponent(initialPageData.component), resolveLayouts(initialPageData.component)]);
857
+ } catch (error) {
858
+ if (!hasBoundaries) throw error;
859
+ const recovered = await recoverImportFailure(initialPageData, error);
860
+ ({pageData: initialPageData, component: initialComponent, layouts: initialLayouts} = recovered);
861
+ document.getElementById("app")?.setAttribute("data-void-ssr", "false");
862
+ }
799
863
  if (CACHE_VISITED_PAGE_DATA && initialPageData.url === _currentFetchUrl && initialPageData.component === matchRoute(_currentFetchUrl) && initialPageData.errors === null && !initialPageData.deferredKeys) _prefetchCache.set(_currentFetchUrl, "GET", Promise.resolve(clonePageData(initialPageData)), PREFETCH_DEFAULT_CACHE_FOR);
800
864
  const initialDeferredRegistry = new DeferredRegistry();
801
865
  initialDeferredRegistry.setup(initialPageData);
@@ -861,6 +925,9 @@ async function createPageNavigationEngine(config) {
861
925
  url,
862
926
  fetchUrl: effectiveFetchUrl,
863
927
  hash,
928
+ get resolvedUrl() {
929
+ return commitTarget.fetchUrl + commitTarget.hash;
930
+ },
864
931
  method,
865
932
  options,
866
933
  immediate: false,
@@ -899,7 +966,10 @@ async function createPageNavigationEngine(config) {
899
966
  const existing = _prefetchCache.get(prefetchUrl, method);
900
967
  if (existing) return existing.response;
901
968
  const ttl = options.cacheFor ? parseCacheFor(options.cacheFor) : PREFETCH_DEFAULT_CACHE_FOR;
902
- const fetchPromise = fetchPrefetchPageData(prefetchUrl);
969
+ const fetchPromise = fetchPrefetchPageData(prefetchUrl).then((data) => {
970
+ if (data && typeof data === "object" && uncachedPayloads.has(data) && _prefetchCache.get(prefetchUrl, method)?.response === fetchPromise) _prefetchCache.flush(prefetchUrl, method);
971
+ return data;
972
+ });
903
973
  _prefetchCache.set(prefetchUrl, method, fetchPromise, ttl);
904
974
  return fetchPromise;
905
975
  },
@@ -924,7 +994,7 @@ async function createPageNavigationEngine(config) {
924
994
  initClientHead(initialPageData.head);
925
995
  if (deferredWindow.__deferredQueue) {
926
996
  for (const entry of deferredWindow.__deferredQueue) if (entry.length === 3) _htmlDeferredRegistry?.resolve(entry[0], void 0, entry[2]);
927
- else _htmlDeferredRegistry?.resolve(entry[0], entry[1], void 0);
997
+ else _htmlDeferredRegistry?.resolve(entry[0], entry.length === 4 ? decodePageData(entry[1]) : entry[1], void 0);
928
998
  delete deferredWindow.__deferredQueue;
929
999
  }
930
1000
  window.addEventListener("popstate", (e) => {
@@ -1013,9 +1083,11 @@ function linkPrefetchStrategies(props, link, defaultStrategy = false) {
1013
1083
  /**
1014
1084
  * Marks a GET link to the current page. Pathnames compare the way the server
1015
1085
  * matches pages: case-sensitive, trailing slash significant, decoded like Hono's
1016
- * getPath. The query and hash are ignored. `prefix` also matches nested pages by
1017
- * whole segment, except for `/`, but only an exact match is `aria-current`.
1018
- * Spread the result before the user's attributes so theirs win.
1086
+ * getPath. A link with a query also needs each of its params, with the same value,
1087
+ * in the current URL, which may have more params in any order. GET data counts as
1088
+ * query, and the hash is ignored. `prefix` also matches nested pages by whole
1089
+ * segment, except for `/`, comparing only the path, but only an exact match is
1090
+ * `aria-current`. Spread the result before the user's attributes so theirs win.
1019
1091
  */
1020
1092
  function linkActiveAttributes(router, link, match = "exact") {
1021
1093
  if (!router || !link.isGet) return {};
@@ -1024,10 +1096,10 @@ function linkActiveAttributes(router, link, match = "exact") {
1024
1096
  if (!target) return {};
1025
1097
  const currentPath = decodePagePath(current.pathname);
1026
1098
  const linkPath = decodePagePath(target.pathname);
1027
- if (linkPath === currentPath) return {
1099
+ if (linkPath === currentPath) return hasQueryParams(current.searchParams, target.searchParams) ? {
1028
1100
  "aria-current": "page",
1029
1101
  "data-void-active": ""
1030
- };
1102
+ } : {};
1031
1103
  if (match === "prefix" && linkPath !== "/") {
1032
1104
  const parent = linkPath.endsWith("/") ? linkPath : `${linkPath}/`;
1033
1105
  if (currentPath.startsWith(parent)) return { "data-void-active": "" };
@@ -1036,9 +1108,9 @@ function linkActiveAttributes(router, link, match = "exact") {
1036
1108
  }
1037
1109
  /**
1038
1110
  * Marks a link while a visit to its destination is loading: the visit uses the link's
1039
- * method and goes to its path, query and hash. Unlike active links, the query counts,
1040
- * so `?page=2` isn't pending during a visit to `?page=3`. Every link to the destination
1041
- * is marked, not only the one that was clicked.
1111
+ * method and goes to its path, query and hash. Unlike active links, the whole query and
1112
+ * the hash count, so `?tab=open` isn't pending during a visit to `?tab=open&page=2`.
1113
+ * Every link to the destination is marked, not only the one that was clicked.
1042
1114
  * Spread the result before the user's attributes so theirs win.
1043
1115
  */
1044
1116
  function linkPendingAttributes(router, navigation, link) {
@@ -1048,6 +1120,11 @@ function linkPendingAttributes(router, navigation, link) {
1048
1120
  if (target && target.host === destination.host && target.protocol === destination.protocol && decodePagePath(target.pathname) === decodePagePath(destination.pathname) && target.search === destination.search && target.hash === destination.hash) return { "data-void-pending": "" };
1049
1121
  return {};
1050
1122
  }
1123
+ /** Each of `params` has the same value in `current`. Extra params in `current` are allowed. */
1124
+ function hasQueryParams(current, params) {
1125
+ for (const [key, value] of params) if (!current.getAll(key).includes(value)) return false;
1126
+ return true;
1127
+ }
1051
1128
  /** Resolves `href` against `base`, or returns `null` for a malformed or other-origin href. */
1052
1129
  function resolveSameOrigin(href, base) {
1053
1130
  let target;
@@ -1350,7 +1427,15 @@ function refreshPage(router, options = {}) {
1350
1427
  _refresh: true
1351
1428
  });
1352
1429
  }
1353
- async function submitAction(router, url, options) {
1430
+ async function submitAction(router, url, options, errorOptions) {
1431
+ const page = withPageQuery(url, window.location);
1432
+ if (page.preserved) {
1433
+ url = page.url;
1434
+ options = {
1435
+ ...options,
1436
+ _preservedQuery: page.preserved
1437
+ };
1438
+ }
1354
1439
  try {
1355
1440
  const pageData = await router.visit(url, options);
1356
1441
  if (typeof pageData === "object" && pageData !== null && "errors" in pageData && pageData.errors) return {
@@ -1367,7 +1452,7 @@ async function submitAction(router, url, options) {
1367
1452
  pageData
1368
1453
  };
1369
1454
  } catch (error) {
1370
- if (isCallSiteActionError(error)) return {
1455
+ if (isCallSiteActionError(error) || errorOptions?.throwOnError === false && isVoidActionError(error)) return {
1371
1456
  ok: false,
1372
1457
  error
1373
1458
  };
@@ -1551,14 +1636,14 @@ function scheduleHydration(el, loader, props, strategy, hydrateFn) {
1551
1636
  }
1552
1637
  function initIslands(islands, hydrateFn) {
1553
1638
  const frontmatterText = document.getElementById(ISLAND_FRONTMATTER_ID)?.textContent;
1554
- const frontmatter = frontmatterText ? JSON.parse(frontmatterText) : {};
1639
+ const frontmatter = frontmatterText ? deserializePageData(frontmatterText) : {};
1555
1640
  const hydrate = (el, mod, props) => hydrateFn(el, mod, props, frontmatter);
1556
1641
  document.querySelectorAll("[data-island]").forEach((el) => {
1557
1642
  const id = el.getAttribute("data-island");
1558
- const props = JSON.parse(el.getAttribute("data-props") || "{}");
1643
+ const props = deserializePageData(el.getAttribute("data-props") || "{}");
1559
1644
  const strategy = el.getAttribute("data-hydrate") || "load";
1560
1645
  const loader = islands[id];
1561
1646
  if (loader) scheduleHydration(el, loader, props, strategy, hydrate);
1562
1647
  });
1563
1648
  }
1564
- export { VoidActionError, categorizeActionError, cloneFormValue, createActionClient, createPageNavigationEngine, createRouterFacade, createSsrRouter, createVoidRouter, formErrorMessage, formRetryMessage, formSubmissionBlocked, getValidationErrors, handleLinkClick, hasFiles, idleNavigationState, initIslands, interpolateRouteParams, isAbortError, isCallSiteActionError, isEqualFormValue, isFile, isFormResetOptions, isModifiedEvent, isVoidActionError, linkActiveAttributes, linkPendingAttributes, linkPrefetchStrategies, mergeDataIntoHref, objectToFormData, observeLinkVisible, parseFormResetArgs, prefetchLink, refreshPage, resolveLink, scheduleFormRetry, scheduleHydration, ssrProxy, submitAction, submitIslandAction, toUrlString };
1649
+ export { VoidActionError, categorizeActionError, clientPageError, cloneFormValue, createActionClient, createPageNavigationEngine, createRouterFacade, createSsrRouter, createVoidRouter, formErrorMessage, formRetryMessage, formSubmissionBlocked, getValidationErrors, handleLinkClick, hasFiles, idleNavigationState, initIslands, interpolateRouteParams, isAbortError, isCallSiteActionError, isEqualFormValue, isFile, isFormResetOptions, isModifiedEvent, isVoidActionError, linkActiveAttributes, linkPendingAttributes, linkPrefetchStrategies, mergeDataIntoHref, objectToFormData, observeLinkVisible, pageBoundarySlots, parseFormResetArgs, prefetchLink, refreshPage, resolveLink, scheduleFormRetry, scheduleHydration, showTerminalPageError, ssrProxy, submitAction, submitIslandAction, toUrlString };
@@ -1,8 +1,9 @@
1
+ import "../config-CTlUaXWZ.mjs";
2
+ import { a as PageDefinition, c as PageScanResult, i as NamedLayoutDefinition, l as RouteEnvironment, n as ErrorPageProps, o as PageError, r as LayoutDefinition } from "../types-IPut3_Yx.mjs";
1
3
  import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-MeF_5M_3.mjs";
2
- import "../config-CPxJmt4M.mjs";
3
- import { i as PageDefinition, n as LayoutDefinition, o as PageScanResult, r as NamedLayoutDefinition, s as RouteEnvironment } from "../types-agfx0alu.mjs";
4
4
  import { a as LinkPrefetchValue, n as CacheForInput } from "../prefetch-NdNeubbH.mjs";
5
- import { r as serializePageData } from "../serialize-I4EmS-Wf.mjs";
5
+ import { a as serializePageData } from "../serialize-DN-envGQ.mjs";
6
+ import { t as BoundaryManifest } from "../boundary-plans-CRmWH68v.mjs";
6
7
  import { Plugin, UserConfig } from "vite";
7
8
  type ProjectPaths = {
8
9
  root: string;
@@ -35,6 +36,7 @@ export declare function resolveEffectiveLayoutChain(page: {
35
36
  layout?: string | false;
36
37
  }, layouts: Array<LayoutDefinition>, namedLayouts: Array<NamedLayoutDefinition>): Array<LayoutDefinition | NamedLayoutDefinition>;
37
38
  type PageScanOptions = {
39
+ trailingSlash?: boolean;
38
40
  output?: "server" | "static";
39
41
  paths?: ProjectPaths;
40
42
  pagesDir?: string;
@@ -100,4 +102,4 @@ type CreatePagesPluginOptions = {
100
102
  };
101
103
  /** Shared Vite lifecycle; adapters own their generated code and environment configuration. */
102
104
  export declare function createPagesPlugin(pagesDir: string, options: CreatePagesPluginOptions): Plugin;
103
- export { type HeadConfig, type HeadDescriptor, type LayoutDefinition, type NamedLayoutDefinition, type PageDefinition, type PageScanResult, type PagesPluginOptions, type PrefetchConfig, type StaticPageDataBuildOptions, renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead, serializePageData };
105
+ export { type BoundaryManifest, type ErrorPageProps, type HeadConfig, type HeadDescriptor, type LayoutDefinition, type NamedLayoutDefinition, type PageDefinition, type PageError, type PageScanResult, type PagesPluginOptions, type PrefetchConfig, type StaticPageDataBuildOptions, renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead, serializePageData };
@@ -1,11 +1,11 @@
1
- import { a as join, n as dirname } from "../dist-DMYe8CZJ.mjs";
2
- import { r as resolvePagesDir } from "../project-paths-G0yut6Zz.mjs";
3
- import { p as readConfig } from "../config-hL-S-Y9D.mjs";
4
- import { a as resolveLayoutChain, i as resolveEffectiveLayoutChain, n as scanPages, r as generateComponentManifest, s as resolveNamedLayout, t as pageFileEnvironment } from "../scan-F0psanp7.mjs";
5
- import { r as parseRedirectsFile } from "../headers--cbz6iZ8.mjs";
1
+ import { l as resolveNamedLayout, n as scanPages, o as resolveEffectiveLayoutChain, r as generateComponentManifest, s as resolveLayoutChain, t as pageFileEnvironment } from "../scan-BJ3bj6aP.mjs";
6
2
  import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-5XPcnG-j.mjs";
7
- import { r as serializePageData } from "../serialize-DUuYuaY3.mjs";
3
+ import { a as join, n as dirname } from "../dist-DMYe8CZJ.mjs";
8
4
  import { n as assertLinkPrefetchValue } from "../prefetch-Dx2jIbtg.mjs";
5
+ import { r as parseRedirectsFile } from "../headers-COGEDoMN.mjs";
6
+ import { p as readConfig } from "../config-5oSQhZNj.mjs";
7
+ import { a as serializePageData } from "../serialize-Pf-CIQK_.mjs";
8
+ import { r as resolvePagesDir } from "../project-paths-G0yut6Zz.mjs";
9
9
  import { existsSync } from "node:fs";
10
10
  import { normalizePath } from "vite";
11
11
  // src/pages/static-data.ts
@@ -1,4 +1,4 @@
1
- import { o as PageScanResult } from "../types-agfx0alu.mjs";
1
+ import { c as PageScanResult } from "../types-IPut3_Yx.mjs";
2
2
  import { Plugin, ResolvedConfig, UserConfig, ViteDevServer } from "vite";
3
3
  //#region src/SourceMap.d.ts
4
4
  interface SourceMapOptions {