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.
- package/dist/{account-cmd-D903EEWQ.mjs → account-cmd-CZKntRH2.mjs} +6 -6
- package/dist/action-key-ByZ6DDld.mjs +64 -0
- package/dist/{application-analysis-DlUG-XNT.mjs → application-analysis-CyTagJQM.mjs} +31 -10
- package/dist/{application-routing-GCBSwXA9.mjs → application-routing-BLrMVpqi.mjs} +2 -1
- package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
- package/dist/{auth-CH4PLAX1.d.mts → auth-Bk9VGtQW.d.mts} +9 -2
- package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
- package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
- package/dist/{auth-link-g9J7MSmP.mjs → auth-link-BOaQWMKw.mjs} +6 -6
- package/dist/{auth-router-DMZbG9Qn.mjs → auth-router-D0-VcmDs.mjs} +3 -3
- package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
- package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
- package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
- package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-JTsXXf2F.mjs} +5 -5
- package/dist/{cache-2khBO1MR.mjs → cache-D0m3Z_Xf.mjs} +5 -5
- package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-Ce6Os4fa.mjs} +4 -4
- package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
- package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
- package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
- package/dist/cli/cli.mjs +68 -1868
- package/dist/cli/cloudflare-operation-process.mjs +101 -26
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/cli-main-rkrJy2Ge.mjs +1889 -0
- package/dist/client-D1Vz1Zep.mjs +1 -0
- package/dist/{client-CoxPEhJq.mjs → client-SZPyj4X_.mjs} +10 -4
- package/dist/{cloudflare-auth-CuS42-9A.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
- package/dist/{cloudflare-cmd-DTF19-j-.mjs → cloudflare-cmd-ChPLQcTP.mjs} +5 -5
- package/dist/{cloudflare-config-Ce8j5S7V.mjs → cloudflare-config-DtOGAbeB.mjs} +2 -2
- package/dist/{cloudflare-connect-BN4dHp8i.mjs → cloudflare-connect-Co93VYTo.mjs} +3 -3
- package/dist/{cloudflare-operations-DrZGzQap.mjs → cloudflare-operations-CXaDKYj2.mjs} +6 -6
- package/dist/{cloudflare-operations-laxRA8HN.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
- package/dist/{cloudflare-process-D9aC-jXr.mjs → cloudflare-process-DmTxZR-N.mjs} +2 -2
- package/dist/{config-hL-S-Y9D.mjs → config-5oSQhZNj.mjs} +3 -1
- package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
- package/dist/{config-CNDjO-15.mjs → config-DcqUBGCb.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-DMR0i3Z2.mjs → config-wo2EaH0X.mjs} +1 -1
- package/dist/{connect-DHepM7Xs.mjs → connect-DlvXt1JR.mjs} +7 -7
- package/dist/{create-project-Bq0M8MtO.mjs → create-project-CC_7hmYJ.mjs} +5 -5
- package/dist/{create-project-BiMmR5wA.mjs → create-project-DzY05xqC.mjs} +1 -1
- package/dist/{db-CqfT6lhV.mjs → db-FhyYGcJJ.mjs} +39 -39
- package/dist/{db-types-DRmxBJ2K.mjs → db-types-sVwEpyPR.mjs} +4 -2
- package/dist/{delete-CY4L8fi2.mjs → delete-CModjyOC.mjs} +5 -5
- package/dist/{deploy-La_Ly8g_.mjs → deploy-Cz9TEzZy.mjs} +502 -110
- package/dist/deploy-DMieisRu.mjs +2 -0
- package/dist/{deploy-managed-static-CESLfKHN.mjs → deploy-managed-static-DlxxXkAM.mjs} +16 -16
- package/dist/{deploy-transport-DcI6LXhY.mjs → deploy-transport-DUvm6-CR.mjs} +3 -3
- package/dist/deploy.mjs +8 -8
- package/dist/{dispatch-DM4Xdd2l.mjs → dispatch-CCiaAnSK.mjs} +7 -7
- package/dist/{dist-eV_Ep60B.mjs → dist-Cp4b1_T9.mjs} +1 -1
- package/dist/{dist-D23AAMxT.mjs → dist-STQXl8ck.mjs} +86 -138
- package/dist/{domain-BD1KOQL3.mjs → domain-DvdZPA50.mjs} +6 -6
- package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
- package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
- package/dist/{email-XAspopcj.mjs → email-ASpNrfLd.mjs} +10 -10
- package/dist/{email-cloudflare-RxIQoPc9.mjs → email-cloudflare-kqoN9jst.mjs} +25 -16
- package/dist/{entry-DFBca6aS.mjs → entry-BweGTCgj.mjs} +1 -1
- package/dist/{env-DrYUh55t.mjs → env-Bpkg3G5i.mjs} +7 -7
- package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
- package/dist/env-mask-D31Qztl9.mjs +46 -0
- package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
- package/dist/{env-validation-Del3C8AY.mjs → env-validation-BpCCQE_6.mjs} +6 -6
- package/dist/{env-validation-Bosj7EVg.mjs → env-validation-CN386Utu.mjs} +1 -1
- package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
- package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
- package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
- package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
- package/dist/gen-M5fNQKfH.mjs +1 -0
- package/dist/{gen-DSkScMIz.mjs → gen-upKJChvd.mjs} +7 -7
- package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-BvMOlb8Z.mjs} +6 -6
- package/dist/{handler-BR6Tvjkp.d.mts → handler-BO7Od-z9.d.mts} +22 -8
- package/dist/{handler-DnI_au0K.mjs → handler-C9SnmeW1.mjs} +5 -4
- package/dist/{headers--cbz6iZ8.mjs → headers-COGEDoMN.mjs} +11 -2
- package/dist/help-CItQVDL4.mjs +1 -0
- package/dist/{help-1OCFDsRr.mjs → help-TPCjTu6e.mjs} +7 -3
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +379 -265
- package/dist/{info-BpxpsX0B.mjs → info-EsDyihwf.mjs} +4 -4
- package/dist/{init-DpVXO5S-.mjs → init-a4lVagrb.mjs} +33 -32
- package/dist/{link-DAXOT-G_.mjs → link-CE55DDzS.mjs} +6 -6
- package/dist/{list-BFQ0gcML.mjs → list-CxRthQks.mjs} +7 -7
- package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
- package/dist/{live-0xrcVpyq.d.mts → live-Kc55iuOQ.d.mts} +2 -2
- package/dist/{local-d1-CLVPP6v7.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
- package/dist/{login-RIw7ffPe.mjs → login-AfcSGSmE.mjs} +5 -5
- package/dist/login-ZHsAm-I6.mjs +1 -0
- package/dist/{logs-B2OeLS4X.mjs → logs-BgRJuvb1.mjs} +6 -6
- package/dist/{migrate-DiI50Chz.mjs → migrate-BNAh6m_C.mjs} +5 -5
- package/dist/migrate-BflbbZQK.mjs +1 -0
- package/dist/nitro.d.mts +5 -0
- package/dist/nitro.mjs +27 -8
- package/dist/{node-Bc-dBAGL.mjs → node-CXFUw0Uz.mjs} +5 -5
- package/dist/{operator-args-D79WQP70.mjs → operator-args-DGTuCdSE.mjs} +9 -1
- package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
- package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
- package/dist/{operator-cmd-CEI5Aaza.mjs → operator-cmd-C-viB7Si.mjs} +7 -7
- package/dist/operator-cmd-D6qNuJ_z.mjs +1 -0
- package/dist/output-BsdnNpxa.mjs +1 -0
- package/dist/{output-BCdLioKP.mjs → output-DNVILSz2.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -15
- package/dist/pages/client.mjs +165 -80
- package/dist/pages/index.d.mts +6 -4
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +13 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.d.mts +2 -2
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-CiYeZmc5.mjs} +1 -1
- package/dist/platform-args-DJvF1-kl.mjs +1 -0
- package/dist/{platform-auth-config-ZrYm8KVs.mjs → platform-auth-config-Dt2qEc2w.mjs} +10 -10
- package/dist/{platform-auth-protection-t6mdY4nn.mjs → platform-auth-protection-B7TaF-PZ.mjs} +8 -8
- package/dist/{platform-auth-recovery-XeBmPTXx.mjs → platform-auth-recovery-suXSteJ6.mjs} +7 -7
- package/dist/{platform-cmd-EXehmSYA.mjs → platform-cmd-9rvYBBtr.mjs} +9 -9
- package/dist/{platform-cmd-C7BevP9b.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
- package/dist/{platform-domain-DR263ObA.mjs → platform-domain-DhH_vDr6.mjs} +5 -5
- package/dist/{platform-lifecycle-CN4aXldN.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
- package/dist/{platform-lifecycle-BvU_TNji.mjs → platform-lifecycle-CXmXe2xt.mjs} +17 -17
- package/dist/{platform-management-_UE1_GM8.mjs → platform-management-BBCHfwji.mjs} +4 -4
- package/dist/{platform-management-yS2sve3V.mjs → platform-management-PdrgDQTe.mjs} +1 -1
- package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-BGwkXYDM.mjs} +5 -5
- package/dist/{platform-recovery-CPVk9-Q4.mjs → platform-recovery-C8NxXGRR.mjs} +3 -3
- package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-Casiffqj.mjs} +3 -3
- package/dist/{plugin-inference-bQ1Be840.mjs → plugin-inference-CErfTgEx.mjs} +4 -4
- package/dist/{prepare-D8L9AQbw.mjs → prepare-BDKWZgfL.mjs} +12 -9
- package/dist/{prepare-BkRhDnxw.mjs → prepare-BLrzXjIl.mjs} +3 -3
- package/dist/prepare-a1_5usAn.mjs +1 -0
- package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BAdYhivW.mjs} +44 -15
- package/dist/prerender-render.d.mts +12 -2
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-DH3CuFC6.mjs → project-cmd-DzGvxXKH.mjs} +18 -18
- package/dist/{project-team-MjT5K4rQ.mjs → project-team-C5XtHbZk.mjs} +5 -5
- package/dist/{project-token-BKHGwY3k.mjs → project-token-B4D5yhHQ.mjs} +5 -5
- package/dist/{project-tsconfig-BMveFb4b.mjs → project-tsconfig-nhnTWO_Y.mjs} +3 -1
- package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust--0LvktDg.mjs} +5 -5
- package/dist/{protocol-COyySMki.mjs → protocol-B1Tvc9-x.mjs} +232 -74
- package/dist/{protocol-CkwjASep.d.mts → protocol-Cg2I81NA.d.mts} +13 -4
- package/dist/{provision-B0HqoRuI.mjs → provision-C3yiHdld.mjs} +2 -2
- package/dist/{provision-CYhZR_Mn.mjs → provision-CAcrauvr.mjs} +1 -1
- package/dist/{requests-daJmVpjk.mjs → requests-CrRiTgQA.mjs} +4 -4
- package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
- package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
- package/dist/{rollback-AVwiMAkk.mjs → rollback-BsmQyj-Q.mjs} +7 -7
- package/dist/{route-types-e69EqY88.mjs → route-types-CgtlFCDz.mjs} +268 -14
- package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
- package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
- package/dist/routes-stub.d.mts +14 -4
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
- package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/auth.mjs +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/db.d.mts +6 -3
- package/dist/runtime/db.mjs +2 -2
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +55 -85
- package/dist/runtime/fetch-server.d.mts +1 -1
- package/dist/runtime/fetch-server.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.d.mts +3 -1
- package/dist/runtime/live-client.d.mts +11 -2
- package/dist/runtime/live-client.mjs +8 -0
- package/dist/runtime/live-server.mjs +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.mjs +1 -1
- package/dist/runtime/remote/index.mjs +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/route-url.mjs +1 -1
- package/dist/runtime/routing.d.mts +21 -5
- package/dist/runtime/routing.mjs +251 -29
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/sse-client.d.mts +9 -1
- package/dist/runtime/sse-client.mjs +7 -0
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +1 -1
- package/dist/{scan-F0psanp7.mjs → scan-BJ3bj6aP.mjs} +236 -32
- package/dist/{secret-szNdoeKa.mjs → secret-D0g5oBsP.mjs} +7 -7
- package/dist/serialize-DN-envGQ.d.mts +18 -0
- package/dist/serialize-Pf-CIQK_.mjs +39 -0
- package/dist/{skills-D393E4lB.mjs → skills-CoBB9_Ao.mjs} +1 -1
- package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
- package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
- package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
- package/dist/url-CuoEn0o3.mjs +43 -0
- package/dist/validator-8-NZs2Xr.mjs +168 -0
- package/dist/{version-metadata-BC3LK7Y-.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
- package/dist/wrangler-R3kMdJfw.mjs +1 -0
- package/dist/{wrangler-Gn4EoY4-.mjs → wrangler-k40T7XTQ.mjs} +2 -2
- package/dist/{wrapper-B9W9RE8z.mjs → wrapper-CVMZarxf.mjs} +11 -8
- package/dist/{ws-Dmjg5NH2.d.mts → ws--U7QicYy.d.mts} +2 -2
- package/docs/guide/ai.md +3 -0
- package/docs/guide/app-types.md +1 -0
- package/docs/guide/auth.md +63 -0
- package/docs/guide/database/d1.md +16 -1
- package/docs/guide/database/mysql.md +1 -0
- package/docs/guide/database/postgresql.md +1 -0
- package/docs/guide/database.md +34 -0
- package/docs/guide/deployment.md +9 -0
- package/docs/guide/durable-state.md +1 -0
- package/docs/guide/edge/headers.md +1 -0
- package/docs/guide/edge/prerendering.md +10 -4
- package/docs/guide/edge/redirects.md +1 -0
- package/docs/guide/edge/revalidation.md +6 -0
- package/docs/guide/edge/rewrites.md +1 -0
- package/docs/guide/edge/static-assets.md +1 -0
- package/docs/guide/email/domains.md +1 -0
- package/docs/guide/email/receiving.md +3 -2
- package/docs/guide/email/sending.md +3 -2
- package/docs/guide/email.md +1 -0
- package/docs/guide/env-vars.md +4 -0
- package/docs/guide/index.md +1 -0
- package/docs/guide/jobs.md +1 -0
- package/docs/guide/kv.md +1 -0
- package/docs/guide/live.md +3 -0
- package/docs/guide/pages-routing/actions-and-forms.md +51 -28
- package/docs/guide/pages-routing/errors.md +101 -0
- package/docs/guide/pages-routing/head.md +4 -1
- package/docs/guide/pages-routing/islands.md +2 -1
- package/docs/guide/pages-routing/layouts.md +3 -0
- package/docs/guide/pages-routing/loaders.md +3 -0
- package/docs/guide/pages-routing/markdown.md +3 -3
- package/docs/guide/pages-routing/overview.md +142 -10
- package/docs/guide/pages-routing/view-transitions.md +1 -0
- package/docs/guide/platform/administration/access.md +1 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -0
- package/docs/guide/platform/administration/email.md +1 -0
- package/docs/guide/platform/administration/operations.md +1 -0
- package/docs/guide/platform/administration/plans.md +1 -0
- package/docs/guide/platform/administration/projects.md +11 -0
- package/docs/guide/platform/administration/zero-trust.md +1 -0
- package/docs/guide/platform/development/local.md +1 -0
- package/docs/guide/platform/development/runtime.md +1 -0
- package/docs/guide/platform/development/schema-ci.md +1 -0
- package/docs/guide/platform/installation/ci.md +1 -0
- package/docs/guide/platform/installation/credentials.md +1 -0
- package/docs/guide/platform/installation/domains.md +1 -0
- package/docs/guide/platform/installation/first-deployment.md +1 -0
- package/docs/guide/platform/installation/maintenance.md +1 -0
- package/docs/guide/platform/installation/prerequisites.md +1 -0
- package/docs/guide/platform/installation/setup.md +1 -0
- package/docs/guide/platform/installation/uninstall.md +1 -0
- package/docs/guide/platform-administration.md +1 -0
- package/docs/guide/platform-development.md +1 -0
- package/docs/guide/project-collaboration.md +1 -0
- package/docs/guide/queues.md +3 -0
- package/docs/guide/quickstart.md +4 -2
- package/docs/guide/remote-dev.md +1 -0
- package/docs/guide/sandboxes.md +1 -0
- package/docs/guide/self-hosted-platform.md +1 -0
- package/docs/guide/server-routing.md +1 -0
- package/docs/guide/sse.md +3 -0
- package/docs/guide/ssg.md +24 -2
- package/docs/guide/ssr.md +1 -0
- package/docs/guide/storage.md +7 -2
- package/docs/guide/testing.md +62 -0
- package/docs/guide/type-safety.md +308 -26
- package/docs/guide/typed-fetch.md +8 -3
- package/docs/guide/websockets.md +6 -5
- package/docs/index.md +1 -0
- package/docs/integrations/agents.md +1 -0
- package/docs/integrations/cloudflare.md +11 -10
- package/docs/integrations/frameworks/analog.md +1 -0
- package/docs/integrations/frameworks/astro.md +1 -0
- package/docs/integrations/frameworks/nuxt.md +3 -0
- package/docs/integrations/frameworks/overview.md +3 -0
- package/docs/integrations/frameworks/react-router.md +1 -0
- package/docs/integrations/frameworks/sveltekit.md +1 -0
- package/docs/integrations/frameworks/tanstack-start.md +1 -0
- package/docs/integrations/hono.md +1 -0
- package/docs/integrations/nodejs-bun-deno.md +66 -0
- package/docs/reference/api/auth.md +20 -0
- package/docs/reference/api/client.md +7 -4
- package/docs/reference/api/database.md +24 -1
- package/docs/reference/api/deploy.md +4 -0
- package/docs/reference/api/durable.md +1 -0
- package/docs/reference/api/env.md +1 -0
- package/docs/reference/api/handlers.md +4 -1
- package/docs/reference/api/pages.md +30 -12
- package/docs/reference/api/plugin.md +1 -0
- package/docs/reference/api/resources.md +4 -1
- package/docs/reference/api/rewrites.md +18 -5
- package/docs/reference/api/types.md +10 -2
- package/docs/reference/api.md +1 -0
- package/docs/reference/cli/auth.md +1 -0
- package/docs/reference/cli/database.md +3 -0
- package/docs/reference/cli/deploy.md +18 -11
- package/docs/reference/cli/domains.md +1 -0
- package/docs/reference/cli/email.md +1 -0
- package/docs/reference/cli/generate.md +1 -0
- package/docs/reference/cli/github.md +1 -0
- package/docs/reference/cli/platform-config.md +1 -0
- package/docs/reference/cli/platform-email.md +1 -0
- package/docs/reference/cli/platform-installation.md +1 -0
- package/docs/reference/cli/platform-operations.md +1 -0
- package/docs/reference/cli/platform-users.md +23 -0
- package/docs/reference/cli/platform-zero-trust.md +1 -0
- package/docs/reference/cli/platform.md +1 -0
- package/docs/reference/cli/project.md +1 -0
- package/docs/reference/cli/secrets.md +1 -0
- package/docs/reference/cli/setup.md +1 -0
- package/docs/reference/cli.md +6 -0
- package/docs/reference/config.md +25 -2
- package/docs/reference/resource-inference.md +1 -0
- package/docs/reference/structure.md +1 -0
- package/package.json +27 -25
- package/schema.json +4 -0
- package/skills/void/SKILL.md +7 -0
- package/dist/action-key-XtKKbbsi.mjs +0 -25
- package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
- package/dist/client-CEtr5UOR.mjs +0 -1
- package/dist/deploy-DMhOyebt.mjs +0 -2
- package/dist/gen-BbT1Ku1P.mjs +0 -1
- package/dist/help-Ba8Dq5-r.mjs +0 -1
- package/dist/login-BX2gzHUt.mjs +0 -1
- package/dist/migrate-CUGMGaIM.mjs +0 -1
- package/dist/operator-cmd-oTT2MA9G.mjs +0 -1
- package/dist/output-E6gecbbV.mjs +0 -1
- package/dist/platform-args-C7XUw9mw.mjs +0 -1
- package/dist/prepare-CZRVGNld.mjs +0 -1
- package/dist/resolve-project-CgfjtOwz.mjs +0 -1
- package/dist/serialize-DUuYuaY3.mjs +0 -29
- package/dist/serialize-I4EmS-Wf.d.mts +0 -16
- package/dist/validator-CTfmzZYb.mjs +0 -69
- package/dist/wrangler-CQ5c-MtJ.mjs +0 -1
- package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
- package/dist/{config-s6TkpSat.mjs → config-eeDzKBS9.mjs} +1 -1
- package/dist/{env-types-Bd8DkQhl.mjs → env-types-Dz9qkiOn.mjs} +1 -1
- package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
- package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
- package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Build a Void server for Node.js, Bun, or Deno, and run it on your own machine, in a container, or with another host.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -160,3 +161,68 @@ console.log(await response.json()); // { message: "Hello from Node.js!" }
|
|
|
160
161
|
```
|
|
161
162
|
|
|
162
163
|
This is useful for testing, embedding in Express/Fastify, or running in serverless environments that accept a `fetch` handler.
|
|
164
|
+
|
|
165
|
+
### Serving the client build from somewhere else
|
|
166
|
+
|
|
167
|
+
By default, `app.js` serves the client build from `dist/client`, next to `dist/ssr`. To serve it from elsewhere, such as from inside a [single executable application](https://nodejs.org/api/single-executable-applications.html), pass an `ASSETS` object with a `fetch(request)` method in the env. Void then reads the client manifest, scripts, styles and `public/` files through it, and doesn't look for `dist/client`.
|
|
168
|
+
|
|
169
|
+
This server reads the client build from a single executable's assets, stored under their URL paths (`/.vite/manifest.json`, `/assets/…`, and `public/` files):
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { getAsset } from 'node:sea';
|
|
173
|
+
import { serve } from '@hono/node-server';
|
|
174
|
+
import app from './dist/ssr/app.js';
|
|
175
|
+
|
|
176
|
+
const types: Record<string, string> = {
|
|
177
|
+
'.js': 'text/javascript',
|
|
178
|
+
'.css': 'text/css',
|
|
179
|
+
'.json': 'application/json',
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const ASSETS = {
|
|
183
|
+
async fetch(request: Request): Promise<Response> {
|
|
184
|
+
const { pathname } = new URL(request.url);
|
|
185
|
+
try {
|
|
186
|
+
const type = types[pathname.slice(pathname.lastIndexOf('.'))] ?? 'application/octet-stream';
|
|
187
|
+
return new Response(getAsset(pathname), { headers: { 'content-type': type } });
|
|
188
|
+
} catch {
|
|
189
|
+
return new Response('Not Found', { status: 404 });
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
serve({ fetch: (request, env) => app.fetch(request, { ...env, ASSETS }), port: 3000 });
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Keep the env the server passes in: on Node.js it carries the incoming request, which `getConnInfo()` reads.
|
|
198
|
+
|
|
199
|
+
With Bun, `bun build --compile` embeds a file only when the code imports it with `{ type: 'file' }`. Listing `dist/client` files as extra entry points doesn't work, because Bun bundles JavaScript entry points as code. Client file names change with every build, so write the imports into a module after `vite build`, one per file in `dist/client`:
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
// client-files.ts, written after each `vite build`
|
|
203
|
+
import manifest from './dist/client/.vite/manifest.json' with { type: 'file' };
|
|
204
|
+
import pagesClient from './dist/client/assets/pages-client-BZk7n9j7.js' with { type: 'file' };
|
|
205
|
+
|
|
206
|
+
const files: Record<string, string> = {
|
|
207
|
+
'/.vite/manifest.json': manifest,
|
|
208
|
+
'/assets/pages-client-BZk7n9j7.js': pagesClient,
|
|
209
|
+
};
|
|
210
|
+
export default files;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Then serve them from the compiled executable, passing Bun's `Server` as `server` so `getConnInfo()` still works:
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
import files from './client-files.ts';
|
|
217
|
+
// server.ts, compiled with `bun build --compile server.ts --outfile server`
|
|
218
|
+
import app from './dist/ssr/app.js';
|
|
219
|
+
|
|
220
|
+
const ASSETS = {
|
|
221
|
+
async fetch(request: Request): Promise<Response> {
|
|
222
|
+
const path = files[new URL(request.url).pathname];
|
|
223
|
+
return path ? new Response(Bun.file(path)) : new Response('Not Found', { status: 404 });
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
Bun.serve({ fetch: (request, server) => app.fetch(request, { server, ASSETS }), port: 3000 });
|
|
228
|
+
```
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Sessions, users, and auth clients from void/auth, plus the browser helpers in void/client.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -57,6 +58,25 @@ const state = getSession();
|
|
|
57
58
|
function getSession(): AuthState | null;
|
|
58
59
|
```
|
|
59
60
|
|
|
61
|
+
## `getAuth(c)` {#getauth-c}
|
|
62
|
+
|
|
63
|
+
Returns the Better Auth instance for the current request, including plugin APIs inferred from `auth.ts`. Use it with Better Auth plugin helpers or to forward requests to `auth.handler`.
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { defineHandler } from 'void';
|
|
67
|
+
import { getAuth } from 'void/auth';
|
|
68
|
+
|
|
69
|
+
export const GET = defineHandler((c) => getAuth(c).handler(c.req.raw));
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Requires [authentication](../../guide/auth.md) to be enabled. Throws if no instance is available on the request. It is available to anonymous requests too; use `requireAuth(c)` when a route requires a signed-in user.
|
|
73
|
+
|
|
74
|
+
**Signature:**
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
function getAuth(c: CloudContext): AuthInstance;
|
|
78
|
+
```
|
|
79
|
+
|
|
60
80
|
## `requireAuth(c)` {#requireauth-c}
|
|
61
81
|
|
|
62
82
|
Extracts the authenticated user from the request context. Throws a 401 `HTTPException` if no session is present.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Call your routes from client code with a typed fetch. Paths and response types come from the generated route map.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -15,7 +16,7 @@ import { fetch } from 'void/client';
|
|
|
15
16
|
|
|
16
17
|
// Types are fully inferred from your route handlers
|
|
17
18
|
const users = await fetch('/api/users');
|
|
18
|
-
const user = await fetch('/api/users
|
|
19
|
+
const user = await fetch('/api/users/[id]', {
|
|
19
20
|
params: { id: '1' },
|
|
20
21
|
});
|
|
21
22
|
```
|
|
@@ -36,13 +37,15 @@ function fetch<P extends keyof RouteMap, M extends MethodsOf<P>>(
|
|
|
36
37
|
| `method` | `string` | HTTP method. Defaults to `"GET"`. |
|
|
37
38
|
| `body` | `unknown` | Request body (auto-serialized as JSON). |
|
|
38
39
|
| `query` | `Record<string, string>` | Query string parameters. |
|
|
39
|
-
| `params` | `Record<string, string>` | URL path parameters (
|
|
40
|
+
| `params` | `Record<string, string>` | URL path parameters (`[id]` segments). |
|
|
40
41
|
| `headers` | `HeadersInit` | Additional request headers. |
|
|
41
42
|
| `signal` | `AbortSignal` | Abort signal. |
|
|
42
43
|
| `baseURL` | `string` | Base URL prepended to the path. Useful for external calls. |
|
|
43
44
|
| `retry` | `number` | Number of retry attempts (ofetch default: 1 for GET). |
|
|
44
45
|
| `timeout` | `number` | Request timeout in milliseconds. |
|
|
45
46
|
|
|
47
|
+
Omitting `method` sends GET. Non-GET calls require an explicit `method`, including calls that specify the method as a generic type argument.
|
|
48
|
+
|
|
46
49
|
Returns the parsed JSON response body, or `undefined` for 204 responses. Throws `FetchError` on non-2xx responses.
|
|
47
50
|
|
|
48
51
|
## `FetchError` {#fetcherror}
|
|
@@ -53,7 +56,7 @@ Error class thrown by `fetch` on non-2xx responses.
|
|
|
53
56
|
import { fetch, FetchError } from 'void/client';
|
|
54
57
|
|
|
55
58
|
try {
|
|
56
|
-
await fetch('/api/users
|
|
59
|
+
await fetch('/api/users/[id]', { params: { id: '999' } });
|
|
57
60
|
} catch (e) {
|
|
58
61
|
if (e instanceof FetchError) {
|
|
59
62
|
console.log(e.status); // 404
|
|
@@ -78,7 +81,7 @@ The typed client is built on [ofetch](https://github.com/unjs/ofetch) with a typ
|
|
|
78
81
|
| ---------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
79
82
|
| **Return type** | `Promise<Response>`, so you call `.json()` yourself | `Promise<T>`, which auto-parses JSON and returns the typed result directly (`undefined` for `204`) |
|
|
80
83
|
| **Error handling** | Resolves on any HTTP status; you check `response.ok` | Throws `FetchError` on non-2xx responses |
|
|
81
|
-
| **URL construction** | Raw URL string | Route path with
|
|
84
|
+
| **URL construction** | Raw URL string | Route path with `[param]` interpolation from `options.params` + query string from `options.query` |
|
|
82
85
|
| **Body serialization** | Manual `JSON.stringify()` + `Content-Type` header | Auto-serializes `options.body` as JSON and sets `Content-Type: application/json` |
|
|
83
86
|
| **Type safety** | Accepts any URL or method | Constrains paths to `RouteMap` keys and methods to those defined per route. Invalid combinations fail at compile time. |
|
|
84
87
|
| **Retry** | None | Auto-retries on 408, 429, and 5xx (configurable via `retry` option) |
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Query D1, PostgreSQL, or MySQL with the Drizzle client from void/db, and seed data from a script.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -36,6 +37,8 @@ import { createDb } from 'void/db';
|
|
|
36
37
|
const db = createDb(env.MY_OTHER_DB);
|
|
37
38
|
```
|
|
38
39
|
|
|
40
|
+
Pass `{ session: 'first-primary' }` to start the D1 session with a query on the primary, keeping your app's schema and query types. Create this client inside the request that needs a fresh read. The default is `'first-unconstrained'`, which allows the first query to use a replica. See [read replication](../../guide/database/d1.md#read-replication).
|
|
41
|
+
|
|
39
42
|
For PostgreSQL and MySQL projects, pass a connection string.
|
|
40
43
|
|
|
41
44
|
```ts
|
|
@@ -48,7 +51,10 @@ const db = createDb('postgres://user:password@host:5432/app');
|
|
|
48
51
|
|
|
49
52
|
```ts
|
|
50
53
|
// D1
|
|
51
|
-
function createDb(
|
|
54
|
+
function createDb(
|
|
55
|
+
d1: D1Database,
|
|
56
|
+
options?: { session?: D1SessionConstraint },
|
|
57
|
+
): DrizzleD1Database<Schema>;
|
|
52
58
|
|
|
53
59
|
// PostgreSQL
|
|
54
60
|
function createDb(connectionString: string): NodePgDatabase<Schema>;
|
|
@@ -67,6 +73,23 @@ import { db, eq, and, or, desc, like, inArray, sql } from 'void/db';
|
|
|
67
73
|
|
|
68
74
|
**Full list:** `sql`, `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `and`, `or`, `not`, `desc`, `asc`, `like`, `ilike`, `notLike`, `inArray`, `notInArray`, `isNull`, `isNotNull`, `between`, `notBetween`, `exists`, `notExists`, `count`, `sum`, `avg`, `min`, `max`.
|
|
69
75
|
|
|
76
|
+
It also exports the Drizzle types `SQL`, `SQLWrapper`, `AnyColumn`, and `BatchItem` for helpers that take part of a query:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { posts } from '@schema';
|
|
80
|
+
import { db, sql, type BatchItem, type SQL, type SQLWrapper } from 'void/db';
|
|
81
|
+
|
|
82
|
+
function contains(column: SQLWrapper, text: string): SQL {
|
|
83
|
+
return sql`instr(${column}, ${text}) > 0`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// D1 only: `db.batch()` takes at least one query.
|
|
87
|
+
const writes: [BatchItem<'sqlite'>, ...Array<BatchItem<'sqlite'>>] = [
|
|
88
|
+
db.update(posts).set({ published: true }).where(contains(posts.title, 'void')),
|
|
89
|
+
];
|
|
90
|
+
await db.batch(writes);
|
|
91
|
+
```
|
|
92
|
+
|
|
70
93
|
## Seeding {#seeding}
|
|
71
94
|
|
|
72
95
|
Imported from `"void/seed"`.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Prepare a built app, SPA, or static site for a managed platform deployment without platform credentials.'
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Deployment artifacts
|
|
2
6
|
|
|
3
7
|
Use `void/deploy` from Node.js to prepare a built Void app, SPA, or static site for a managed platform deployment without platform credentials.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Define HTTP handlers, middleware, validation, scheduled jobs, queues, and rendering.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -228,11 +229,13 @@ Type-safe wrapper for the page `head()` export in `.server.ts` files. Provides [
|
|
|
228
229
|
```ts
|
|
229
230
|
import { defineHandler, defineHead } from 'void';
|
|
230
231
|
import type { InferProps } from 'void';
|
|
232
|
+
import type { PageParams } from 'void/routes';
|
|
231
233
|
|
|
232
234
|
export type Props = InferProps<typeof loader>;
|
|
233
235
|
|
|
234
236
|
export const loader = defineHandler(async (c) => {
|
|
235
|
-
const
|
|
237
|
+
const { slug } = c.req.param() as PageParams<'/posts/[slug]'>;
|
|
238
|
+
const post = await getPost(slug);
|
|
236
239
|
return { post };
|
|
237
240
|
});
|
|
238
241
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Vite plugins and client runtimes for React, Vue, Svelte, and Solid pages.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -6,6 +7,17 @@ outline: deep
|
|
|
6
7
|
|
|
7
8
|
Framework adaptors for [Pages Routing](../../guide/pages-routing/overview). Each adaptor provides a Vite plugin and client-side runtime.
|
|
8
9
|
|
|
10
|
+
## Error components
|
|
11
|
+
|
|
12
|
+
All four adapters export `PageError` and `ErrorPageProps` for [`_not-found` and `_error` components](../../guide/pages-routing/errors):
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// Also exported by @void/react, @void/vue, @void/svelte, and @void/solid.
|
|
16
|
+
import type { ErrorPageProps, PageError } from 'void/pages';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`PageError` has a numeric `status` and a string `message`. `ErrorPageProps` contains `{ error: PageError }`.
|
|
20
|
+
|
|
9
21
|
## Navigation destinations {#navigation-destinations}
|
|
10
22
|
|
|
11
23
|
All four adapters support typed URLs through [`routeUrl()`](./types.md#routeurl-path-options). Pass the returned string to `Link`'s `href`, which has the type [`Href`](./types.md#route-types).
|
|
@@ -86,13 +98,14 @@ Imported from `"@void/vue"`.
|
|
|
86
98
|
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
99
|
| `Link` | Vue component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
88
100
|
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
89
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
101
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. Pass the page's pattern as the type argument, such as `useParams<'/users/[id]'>()`, to type them. |
|
|
90
102
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
91
103
|
| `useForm(url, defaults, options?)` | Typed reactive form helper bound to a page action URL. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
92
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
93
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult
|
|
104
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. With [`routing.typedRoutes`](../config.md#routing-typedroutes), the URL is a [`RouteUrl`](./types.md#route-types). |
|
|
105
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an [`ActionResult`](../../guide/pages-routing/actions-and-forms.md#action-helper). |
|
|
94
106
|
| `isVoidActionError(error)` | Returns `true` when `error` is a `VoidActionError` at any status, such as a thrown `401`, `403`, or `500`. Narrows `error` to `VoidActionError`. See [handling thrown errors](../../guide/pages-routing/actions-and-forms.md#validation-errors). |
|
|
95
107
|
| `isCallSiteActionError(error)` | Returns `true` only for the expected `VoidActionError` statuses that `action()` returns, such as `409` or `422`. |
|
|
108
|
+
| `getValidationErrors(body)` | Returns the field-error map from a failed action's `error.body`, or `null` when the body has no field errors. Use it to show validation errors from `action()`. |
|
|
96
109
|
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
97
110
|
|
|
98
111
|
Vue `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
@@ -141,13 +154,14 @@ Imported from `"@void/react"`.
|
|
|
141
154
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
142
155
|
| `Link` | React component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
143
156
|
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. React navigations are scheduled as transitions. |
|
|
144
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
157
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. Pass the page's pattern as the type argument, such as `useParams<'/users/[id]'>()`, to type them. |
|
|
145
158
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
146
159
|
| `useForm(url, defaults, options?)` | Form helper hook. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
147
|
-
| `useIslandForm(defaults)` | Form helper hook for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
148
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult
|
|
160
|
+
| `useIslandForm(defaults)` | Form helper hook for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. With [`routing.typedRoutes`](../config.md#routing-typedroutes), the URL is a [`RouteUrl`](./types.md#route-types). |
|
|
161
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an [`ActionResult`](../../guide/pages-routing/actions-and-forms.md#action-helper). |
|
|
149
162
|
| `isVoidActionError(error)` | Returns `true` when `error` is a `VoidActionError` at any status, such as a thrown `401`, `403`, or `500`. Narrows `error` to `VoidActionError`. See [handling thrown errors](../../guide/pages-routing/actions-and-forms.md#validation-errors). |
|
|
150
163
|
| `isCallSiteActionError(error)` | Returns `true` only for the expected `VoidActionError` statuses that `action()` returns, such as `409` or `422`. |
|
|
164
|
+
| `getValidationErrors(body)` | Returns the field-error map from a failed action's `error.body`, or `null` when the body has no field errors. Use it to show validation errors from `action()`. |
|
|
151
165
|
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
152
166
|
| `Deferred<T>` | React-only prop type for `defer()` results. It is `Promise<T>` and is consumed with React `use()`. |
|
|
153
167
|
|
|
@@ -223,13 +237,14 @@ Imported from `"@void/svelte"`.
|
|
|
223
237
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
224
238
|
| `Link` | Svelte component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
225
239
|
| `useForm(url, defaults, options?)` | Form helper using Svelte 5 runes. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
226
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
227
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult
|
|
240
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. With [`routing.typedRoutes`](../config.md#routing-typedroutes), the URL is a [`RouteUrl`](./types.md#route-types). |
|
|
241
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an [`ActionResult`](../../guide/pages-routing/actions-and-forms.md#action-helper). |
|
|
228
242
|
| `isVoidActionError(error)` | Returns `true` when `error` is a `VoidActionError` at any status, such as a thrown `401`, `403`, or `500`. Narrows `error` to `VoidActionError`. See [handling thrown errors](../../guide/pages-routing/actions-and-forms.md#validation-errors). |
|
|
229
243
|
| `isCallSiteActionError(error)` | Returns `true` only for the expected `VoidActionError` statuses that `action()` returns, such as `409` or `422`. |
|
|
244
|
+
| `getValidationErrors(body)` | Returns the field-error map from a failed action's `error.body`, or `null` when the body has no field errors. Use it to show validation errors from `action()`. |
|
|
230
245
|
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
231
246
|
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
232
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
247
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. Pass the page's pattern as the type argument, such as `useParams<'/users/[id]'>()`, to type them. |
|
|
233
248
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
234
249
|
|
|
235
250
|
Svelte `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
@@ -276,13 +291,14 @@ Imported from `"@void/solid"`.
|
|
|
276
291
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
277
292
|
| `Link` | Solid component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
278
293
|
| `useForm(url, defaults, options?)` | Form helper using Solid stores. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
279
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
280
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult
|
|
294
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. With [`routing.typedRoutes`](../config.md#routing-typedroutes), the URL is a [`RouteUrl`](./types.md#route-types). |
|
|
295
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an [`ActionResult`](../../guide/pages-routing/actions-and-forms.md#action-helper). |
|
|
281
296
|
| `isVoidActionError(error)` | Returns `true` when `error` is a `VoidActionError` at any status, such as a thrown `401`, `403`, or `500`. Narrows `error` to `VoidActionError`. See [handling thrown errors](../../guide/pages-routing/actions-and-forms.md#validation-errors). |
|
|
282
297
|
| `isCallSiteActionError(error)` | Returns `true` only for the expected `VoidActionError` statuses that `action()` returns, such as `409` or `422`. |
|
|
298
|
+
| `getValidationErrors(body)` | Returns the field-error map from a failed action's `error.body`, or `null` when the body has no field errors. Use it to show validation errors from `action()`. |
|
|
283
299
|
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
284
300
|
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
285
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
301
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. Pass the page's pattern as the type argument, such as `useParams<'/users/[id]'>()`, to type them. |
|
|
286
302
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
287
303
|
|
|
288
304
|
Solid `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
@@ -316,3 +332,5 @@ See [Markdown Pages](../../guide/pages-routing/markdown.md) for setup and framew
|
|
|
316
332
|
## Form
|
|
317
333
|
|
|
318
334
|
Each Pages adapter exports `Form`. Pass the object returned by `useForm()` as `form`; `method` defaults to `post`. It renders validation and action errors, preserves controlled input, and respects known quota retry deadlines without submitting automatically. `renderError` customizes action-error presentation; Svelte uses a snippet. See [Actions and Forms](../../guide/pages-routing/actions-and-forms.md).
|
|
335
|
+
|
|
336
|
+
All four adapters accept `{ throwOnError: false }` in the third argument to `useForm()`. Authentication and server HTTP failures then populate `form.error` instead of throwing; validation failures still populate `form.errors`. React also calls `onError`. Unexpected failures still throw, and cancelled submissions do not set a form error. The default HTTP error handling is unchanged. See [handling action errors](../../guide/pages-routing/actions-and-forms.md#validation-errors).
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Clients for KV, object storage, AI, cache revalidation, and logs.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -109,10 +110,12 @@ await revalidate({ paths: ['/', '/blog/hello'] });
|
|
|
109
110
|
await revalidate({ all: true });
|
|
110
111
|
```
|
|
111
112
|
|
|
113
|
+
With [`routing.typedRoutes`](../config.md#routing-typedroutes) on, each path in `paths` must match one of your routes; otherwise `RouteUrl` is `string`. Cast a path that TypeScript can't check with `as RouteUrl`. The cast turns the check off for that path.
|
|
114
|
+
|
|
112
115
|
**Signature:**
|
|
113
116
|
|
|
114
117
|
```ts
|
|
115
|
-
function revalidate(options: { paths?:
|
|
118
|
+
function revalidate(options: { paths?: RouteUrl[]; all?: boolean }): Promise<void>;
|
|
116
119
|
```
|
|
117
120
|
|
|
118
121
|
## Logging {#logging}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Serve another route without changing the browser URL, and read the URL that was originally requested.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -14,7 +15,7 @@ Pass a [`RouteDestination`](./types.md#route-types) object to check the route pa
|
|
|
14
15
|
|
|
15
16
|
```ts
|
|
16
17
|
return c.rewrite({
|
|
17
|
-
pathname: '/users
|
|
18
|
+
pathname: '/users/[id]',
|
|
18
19
|
params: { id: 42 },
|
|
19
20
|
query: { tab: 'activity' },
|
|
20
21
|
});
|
|
@@ -22,17 +23,29 @@ return c.rewrite({
|
|
|
22
23
|
|
|
23
24
|
With [`routing.typedRoutes`](../config.md#routing-typedroutes), a string destination must be a [`RouteUrl`](./types.md#route-types): a URL that matches one of your routes. Cast a path built at runtime, such as ``c.rewrite(`/${locale}${path}` as RouteUrl)``.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
With [`routing.typedRoutes`](../config.md#routing-typedroutes), `c.redirect()` checks its location the same way as a link. A string must be a route URL, a same-page query or hash, or an `http://`, `https://`, `mailto:`, or `tel:` URL. An external `https://` literal needs no cast. A `URL`, a [`routeUrl()`](./types.md#routeurl-path-options) string, or a destination object is accepted. Cast a string TypeScript cannot check, such as a checkout URL from a payment provider's SDK, with `as Href`:
|
|
26
27
|
|
|
27
28
|
```ts
|
|
28
|
-
import { routeUrl } from 'void/routes';
|
|
29
|
+
import { routeUrl, type Href } from 'void/routes';
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
declare const checkoutUrl: string;
|
|
32
|
+
|
|
33
|
+
return c.redirect(routeUrl('/users/[id]', { params: { id: 42 } }));
|
|
34
|
+
return c.redirect({ pathname: '/users/[id]', params: { id: 42 } });
|
|
35
|
+
return c.redirect('https://example.com/login');
|
|
36
|
+
return c.redirect(checkoutUrl as Href);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The cast turns the check off for that value, and Void does not check the location at runtime, so cast only URLs you trust. A URL from the request, such as a `?redirectTo=` parameter, can point to another site. Resolve it against the request URL and redirect only when the origin matches:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const requested = new URL(c.req.query('redirectTo') ?? '/', c.req.url);
|
|
43
|
+
return c.redirect(requested.origin === new URL(c.req.url).origin ? requested : '/');
|
|
31
44
|
```
|
|
32
45
|
|
|
33
46
|
`c.redirect()` sends the location it is given. The request query is not added to an internal path, a protocol-relative URL, or an absolute URL, so `c.redirect('/notes')` from `/sign-in?redirectTo=/notes` goes to `/notes`. [`routing.redirects`](../../guide/edge/redirects.md) still merge the request query into the destination.
|
|
34
47
|
|
|
35
|
-
A [named action](../../guide/pages-routing/actions-and-forms.md#named-actions) is the exception. Redirecting it to a GET page drops the action key and keeps the page's other query parameters: `POST /users/42?delete&tab=profile` with `c.redirect('/users/42')` goes to `/users/42?tab=profile`. Redirects that preserve the request method keep the action key: `307` and `308`, or `301` and `302` after a `PUT`, `PATCH`, or `DELETE`.
|
|
48
|
+
A [named action](../../guide/pages-routing/actions-and-forms.md#named-actions) is the exception. Redirecting it to a GET page drops the action key and keeps the page's other query parameters: `POST /users/42?delete&tab=profile` with `c.redirect('/users/42')` goes to `/users/42?tab=profile`. Redirects that preserve the request method keep the action key: `307` and `308`, or `301` and `302` after a `PUT`, `PATCH`, or `DELETE`. Only the action URL's own parameters are kept: the [current page's query](../../guide/pages-routing/actions-and-forms.md#query-parameters-after-submission) that `action()` and forms add is left out.
|
|
36
49
|
|
|
37
50
|
```ts
|
|
38
51
|
import { defineHandler } from 'void';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Shared types for handler context, routes, URLs, and head metadata.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -88,6 +89,8 @@ interface HeadDescriptor {
|
|
|
88
89
|
|
|
89
90
|
Generated route types used by the typed `fetch` client. Contains each route’s methods, inputs, and outputs.
|
|
90
91
|
|
|
92
|
+
Keys use route patterns such as `/api/users/[id]` and `/docs/[...slug]`.
|
|
93
|
+
|
|
91
94
|
```ts
|
|
92
95
|
import type { RouteMap } from 'void/routes';
|
|
93
96
|
```
|
|
@@ -101,7 +104,7 @@ Build a relative URL string from a known page, HTTP, or WebSocket route pattern:
|
|
|
101
104
|
```ts
|
|
102
105
|
import { routeUrl } from 'void/routes';
|
|
103
106
|
|
|
104
|
-
routeUrl('/users
|
|
107
|
+
routeUrl('/users/[id]', {
|
|
105
108
|
params: { id: 42 },
|
|
106
109
|
query: { tab: 'activity' },
|
|
107
110
|
hash: 'details',
|
|
@@ -127,12 +130,17 @@ Import these types from `void/routes`:
|
|
|
127
130
|
| --------------------- | ------------------------------------------------------------------------------------------------- |
|
|
128
131
|
| `RoutePathMap` | Generated map of page, HTTP, and WebSocket route patterns to their parameter names. |
|
|
129
132
|
| `RoutePath` | Union of the known route patterns in `RoutePathMap`. |
|
|
133
|
+
| `PagePathMap` | Generated map of page patterns to their parameter names. |
|
|
134
|
+
| `PagePath` | Union of the page patterns in `PagePathMap`; accepted by `useParams()`. |
|
|
135
|
+
| `PageParams<P>` | The params page `P` receives, such as `{ id: string }` for `/users/[id]`. |
|
|
130
136
|
| `RouteOptions<P>` | Options for a route pattern `P`, including its required `params`, optional `query`, and `hash`. |
|
|
131
137
|
| `RouteDestination<P>` | `{ pathname: P }` with `RouteOptions<P>`. Defaults to all known routes when `P` is omitted. |
|
|
132
138
|
| `RouteUrl` | The URL of one of your routes, returned by `routeUrl()`. `string` unless `typedRoutes` is on. |
|
|
133
139
|
| `Href` | A `RouteUrl`, a same-page query or hash, or an external URL. `string` unless `typedRoutes` is on. |
|
|
134
|
-
| `RouteUrlInput` | `Href`, `URL`, or `RouteDestination`; accepted by router navigation methods.
|
|
140
|
+
| `RouteUrlInput` | `Href`, `URL`, or `RouteDestination`; accepted by router navigation methods and `c.redirect()`. |
|
|
135
141
|
| `RouteQuery` | Query keys mapped to `RouteQueryValue` or readonly arrays of those values. |
|
|
136
142
|
| `RouteQueryValue` | `string`, `number`, `boolean`, `null`, or `undefined`. |
|
|
137
143
|
|
|
144
|
+
Annotate a dynamic page's `getPrerenderPaths()` as `Promise<PageParams<P>[]>` so TypeScript checks those param names. See [Prerender paths](../../guide/type-safety.md#prerender-paths).
|
|
145
|
+
|
|
138
146
|
`typedRoutes` is [`routing.typedRoutes`](../config.md#routing-typedroutes). See [Checked URL strings](../../guide/type-safety.md#checked-url-strings).
|
package/docs/reference/api.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Generate migrations, apply them, and update the local database from your Drizzle schema.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -130,6 +131,8 @@ The command saves `DATABASE_URL` in `.env`. When authenticated with a linked Voi
|
|
|
130
131
|
|
|
131
132
|
Provider-created credentials are never printed. For direct Cloudflare deploys, configure the same URL as a protected `DATABASE_URL` in the shell or CI environment that runs deploy.
|
|
132
133
|
|
|
134
|
+
For an existing PostgreSQL database migrated by Drizzle, [adopt its applied migration history](../../guide/database.md#adopt-existing-drizzle) before the first Void deployment.
|
|
135
|
+
|
|
133
136
|
## `void db set-url` {#void-db-set-url}
|
|
134
137
|
|
|
135
138
|
Update the PostgreSQL or MySQL connection string for deployment. Available for projects with `"database": "pg"` or `"database": "mysql"`.
|