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: 'Carry types from your database schema through route handlers and page loaders to the UI.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -61,14 +62,46 @@ export const loader = defineHandler(async (c) => {
|
|
|
61
62
|
});
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
::: code-group
|
|
66
|
+
|
|
67
|
+
```tsx [React]
|
|
68
|
+
// pages/users/index.tsx
|
|
69
|
+
import type { Props } from './index.server';
|
|
70
|
+
|
|
71
|
+
export default function UsersPage({ users }: Props) {
|
|
72
|
+
// users: { id: number; name: string; ... }[]
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```vue [Vue]
|
|
65
77
|
<!-- pages/users/index.vue -->
|
|
66
78
|
<script setup lang="ts">
|
|
67
79
|
import type { Props } from './index.server';
|
|
68
|
-
|
|
80
|
+
|
|
81
|
+
const { users } = defineProps<Props>(); // users: { id: number; name: string; ... }[]
|
|
82
|
+
</script>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```svelte [Svelte]
|
|
86
|
+
<!-- pages/users/index.svelte -->
|
|
87
|
+
<script lang="ts">
|
|
88
|
+
import type { Props } from './index.server';
|
|
89
|
+
|
|
90
|
+
let { users }: Props = $props(); // users: { id: number; name: string; ... }[]
|
|
69
91
|
</script>
|
|
70
92
|
```
|
|
71
93
|
|
|
94
|
+
```tsx [Solid]
|
|
95
|
+
// pages/users/index.tsx
|
|
96
|
+
import type { Props } from './index.server';
|
|
97
|
+
|
|
98
|
+
export default function UsersPage(props: Props) {
|
|
99
|
+
// props.users: { id: number; name: string; ... }[]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
:::
|
|
104
|
+
|
|
72
105
|
No manual interface is needed. Props stay in sync with whatever the loader returns.
|
|
73
106
|
|
|
74
107
|
## Action → useForm
|
|
@@ -95,8 +128,8 @@ form.errors.foo; // ✗ TypeScript error
|
|
|
95
128
|
[Named actions](./pages-routing/actions-and-forms#named-actions) work the same way. The `?actionName` suffix selects the right types for that action:
|
|
96
129
|
|
|
97
130
|
```ts
|
|
98
|
-
const updateForm = useForm('/users
|
|
99
|
-
const deleteForm = useForm('/users
|
|
131
|
+
const updateForm = useForm('/users/[id]?update', { name: '' }, { params: { id } });
|
|
132
|
+
const deleteForm = useForm('/users/[id]?delete', { id: '' }, { params: { id } });
|
|
100
133
|
// Each form's data and errors are typed from their respective validators
|
|
101
134
|
```
|
|
102
135
|
|
|
@@ -104,12 +137,12 @@ The `action()` helper gets the same type checking. See [Actions & Forms](./pages
|
|
|
104
137
|
|
|
105
138
|
## Typed URLs and Navigation
|
|
106
139
|
|
|
107
|
-
Use `routeUrl()` from `void/routes` to build URLs from your app's page, HTTP, and WebSocket route patterns. For a page at `pages/users/[id].tsx`, the pattern is `/users
|
|
140
|
+
Use `routeUrl()` from `void/routes` to build URLs from your app's page, HTTP, and WebSocket route patterns. For a page at `pages/users/[id].tsx`, `.vue`, or `.svelte`, the pattern is `/users/[id]`:
|
|
108
141
|
|
|
109
142
|
```ts
|
|
110
143
|
import { routeUrl } from 'void/routes';
|
|
111
144
|
|
|
112
|
-
const url = routeUrl('/users
|
|
145
|
+
const url = routeUrl('/users/[id]', {
|
|
113
146
|
params: { id: 42 },
|
|
114
147
|
query: { tab: 'activity' },
|
|
115
148
|
hash: 'details',
|
|
@@ -119,13 +152,15 @@ const url = routeUrl('/users/:id', {
|
|
|
119
152
|
|
|
120
153
|
Your editor autocompletes route patterns and parameter names. TypeScript checks that the route exists and all required parameters are supplied. Parameter values accept strings or numbers; Void encodes them for the URL. Query keys are chosen by your app, and values can be strings, numbers, booleans, or arrays of those values. Arrays become repeated query parameters; `null` and `undefined` values are omitted.
|
|
121
154
|
|
|
155
|
+
Use bracket patterns with `routeUrl()`, typed `fetch()`, WebSocket `connect()`, page actions, and `useParams()`.
|
|
156
|
+
|
|
122
157
|
Pass the returned string to `Link`, a plain `<a>`, or `c.redirect()`. For programmatic navigation and `c.rewrite()`, you can pass a destination object directly:
|
|
123
158
|
|
|
124
159
|
```ts
|
|
125
160
|
import type { RouteDestination } from 'void/routes';
|
|
126
161
|
|
|
127
162
|
const profile = {
|
|
128
|
-
pathname: '/users
|
|
163
|
+
pathname: '/users/[id]',
|
|
129
164
|
params: { id: 42 },
|
|
130
165
|
query: { tab: 'activity' },
|
|
131
166
|
hash: 'details',
|
|
@@ -134,16 +169,109 @@ const profile = {
|
|
|
134
169
|
|
|
135
170
|
Destination objects use the same parameter checking and URL encoding as `routeUrl()`. See [Pages Routing](./pages-routing/overview.md#typed-navigation) for links and router methods, and [Rewrites](../reference/api/rewrites.md#c-rewrite-destination) for server navigation.
|
|
136
171
|
|
|
137
|
-
For a catch-all page such as `pages/files/[...path].tsx`, use `/files
|
|
172
|
+
For a catch-all page such as `pages/files/[...path].tsx`, `.vue`, or `.svelte`, use `/files/[...path]` and pass the full path as one value:
|
|
138
173
|
|
|
139
174
|
```ts
|
|
140
|
-
routeUrl('/files
|
|
175
|
+
routeUrl('/files/[...path]', { params: { path: 'docs/get started' } });
|
|
141
176
|
// /files/docs/get%20started
|
|
142
177
|
```
|
|
143
178
|
|
|
179
|
+
For an unnamed catch-all (`[...]`), pass its value under the `'*'` key:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
routeUrl('/files/[...]', { params: { '*': 'docs/get started' } });
|
|
183
|
+
// /files/docs/get%20started
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Page params
|
|
187
|
+
|
|
188
|
+
Pass a page's URL pattern as the type argument of `useParams()` to type the params it reads. For a page at `pages/users/[id].tsx`, `.vue`, or `.svelte`, the pattern is `/users/[id]`:
|
|
189
|
+
|
|
190
|
+
::: code-group
|
|
191
|
+
|
|
192
|
+
```tsx [React]
|
|
193
|
+
import { useParams } from '@void/react';
|
|
194
|
+
|
|
195
|
+
const { id } = useParams<'/users/[id]'>(); // id: string
|
|
196
|
+
useParams<'/users/[id]'>().idd; // Type error: no such param
|
|
197
|
+
useParams<'/userz/[id]'>(); // Type error: no page matches
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```vue [Vue]
|
|
201
|
+
<script setup lang="ts">
|
|
202
|
+
import { useParams } from '@void/vue';
|
|
203
|
+
|
|
204
|
+
const params = useParams<'/users/[id]'>();
|
|
205
|
+
params.id; // string
|
|
206
|
+
params.idd; // Type error: no such param
|
|
207
|
+
useParams<'/userz/[id]'>(); // Type error: no page matches
|
|
208
|
+
</script>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```svelte [Svelte]
|
|
212
|
+
<script lang="ts">
|
|
213
|
+
import { useParams } from '@void/svelte';
|
|
214
|
+
|
|
215
|
+
const params = useParams<'/users/[id]'>();
|
|
216
|
+
params.id; // string
|
|
217
|
+
params.idd; // Type error: no such param
|
|
218
|
+
useParams<'/userz/[id]'>(); // Type error: no page matches
|
|
219
|
+
</script>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
```tsx [Solid]
|
|
223
|
+
import { useParams } from '@void/solid';
|
|
224
|
+
|
|
225
|
+
const params = useParams<'/users/[id]'>();
|
|
226
|
+
params.id; // string
|
|
227
|
+
params.idd; // Type error: no such param
|
|
228
|
+
useParams<'/userz/[id]'>(); // Type error: no page matches
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
:::
|
|
232
|
+
|
|
233
|
+
The pattern must be one of your pages; HTTP and WebSocket routes are not accepted. A catch-all page such as `pages/files/[...path].tsx`, `.vue`, or `.svelte` gives `{ path: string }`. An unnamed catch-all (`[...].tsx`, `[...].vue`, or `[...].svelte`) has no params.
|
|
234
|
+
|
|
235
|
+
The pattern is checked by TypeScript only. Pass the pattern of the page the component renders in; without a pattern, `useParams()` returns `Record<string, string>`.
|
|
236
|
+
|
|
237
|
+
On the server, `c.req.param('slug')` accepts any name. Read the params object through `PageParams` so a missing or misspelled name is a type error:
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
import type { PageParams } from 'void/routes';
|
|
241
|
+
|
|
242
|
+
const { slug } = c.req.param() as PageParams<'/posts/[slug]'>;
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Prerender paths
|
|
246
|
+
|
|
247
|
+
On a dynamic page, annotate `getPrerenderPaths()` with `PageParams` for that page's URL pattern. Each returned object must then include the page's params, and a missing or misspelled key is a type error. Void does not infer this type from the filename, so the check applies only when the annotation is present:
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
// pages/blog/[slug].server.ts
|
|
251
|
+
import type { PageParams } from 'void/routes';
|
|
252
|
+
|
|
253
|
+
export async function getPrerenderPaths(): Promise<PageParams<'/blog/[slug]'>[]> {
|
|
254
|
+
return [{ slug: 'hello-world' }];
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
In custom SSR mode the function returns full path strings, so annotate it as `Promise<string[]>`. See [Edge Prerendering](./edge/prerendering.md#dynamic-pages-with-params) and [Static Site Generation](./ssg.md#per-page-overrides).
|
|
259
|
+
|
|
260
|
+
`routing.prerender` is a list of plain strings. Annotate the array with `satisfies RouteUrl[]` so each path has to match a route. The check applies when [`routing.typedRoutes`](../reference/config.md#routing-typedroutes) is on; otherwise `RouteUrl` is `string`:
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
// void.config.ts
|
|
264
|
+
import { defineConfig } from 'void/config';
|
|
265
|
+
import type { RouteUrl } from 'void/routes';
|
|
266
|
+
|
|
267
|
+
export default defineConfig({
|
|
268
|
+
routing: { prerender: ['/', '/blog/hello-world'] satisfies RouteUrl[] },
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
|
|
144
272
|
### Checked URL strings
|
|
145
273
|
|
|
146
|
-
[`routing.typedRoutes`](../reference/config.md#routing-typedroutes) checks plain URL strings in `Link`'s `href`, `router.visit()`, `router.prefetch()`, `router.flush()`,
|
|
274
|
+
[`routing.typedRoutes`](../reference/config.md#routing-typedroutes) checks plain URL strings in `Link`'s `href`, `router.visit()`, `router.prefetch()`, `router.flush()`, `c.rewrite()`, `c.redirect()`, `revalidate({ paths })`, `connectEventStream()`, `connectLiveStream()`, and `useIslandForm()`'s `post()`, `put()`, `patch()`, `delete()`, and `submit()`. Apps created with `void init` have it on. To turn it on in an existing app:
|
|
147
275
|
|
|
148
276
|
```ts
|
|
149
277
|
// void.config.ts
|
|
@@ -156,44 +284,156 @@ export default defineConfig({
|
|
|
156
284
|
|
|
157
285
|
A string must then match one of your routes, optionally followed by a query string or hash:
|
|
158
286
|
|
|
159
|
-
|
|
287
|
+
::: code-group
|
|
288
|
+
|
|
289
|
+
```tsx [React]
|
|
290
|
+
import { Link } from '@void/react';
|
|
291
|
+
import { routeUrl } from 'void/routes';
|
|
292
|
+
|
|
293
|
+
<Link href="/about">About</Link>
|
|
294
|
+
<Link href={`/users/${user.id}?tab=activity`}>Profile</Link>
|
|
295
|
+
<Link href={routeUrl('/users/[id]', { params: { id } })}>Profile</Link>
|
|
296
|
+
<Link href="/abuot">About</Link> // Type error: no route matches
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
```vue [Vue]
|
|
300
|
+
<script setup lang="ts">
|
|
301
|
+
import { Link } from '@void/vue';
|
|
302
|
+
import { routeUrl } from 'void/routes';
|
|
303
|
+
</script>
|
|
304
|
+
|
|
305
|
+
<template>
|
|
306
|
+
<Link href="/about">About</Link>
|
|
307
|
+
<Link :href="`/users/${user.id}?tab=activity`">Profile</Link>
|
|
308
|
+
<Link :href="routeUrl('/users/[id]', { params: { id } })">Profile</Link>
|
|
309
|
+
<!-- Type error: no route matches -->
|
|
310
|
+
<Link href="/abuot">About</Link>
|
|
311
|
+
</template>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
```svelte [Svelte]
|
|
315
|
+
<script lang="ts">
|
|
316
|
+
import { Link } from '@void/svelte';
|
|
317
|
+
import { routeUrl } from 'void/routes';
|
|
318
|
+
</script>
|
|
319
|
+
|
|
160
320
|
<Link href="/about">About</Link>
|
|
161
321
|
<Link href={`/users/${user.id}?tab=activity`}>Profile</Link>
|
|
162
|
-
<Link href={routeUrl('/users
|
|
322
|
+
<Link href={routeUrl('/users/[id]', { params: { id } })}>Profile</Link>
|
|
323
|
+
<!-- Type error: no route matches -->
|
|
324
|
+
<Link href="/abuot">About</Link>
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
```tsx [Solid]
|
|
328
|
+
import { Link } from '@void/solid';
|
|
329
|
+
import { routeUrl } from 'void/routes';
|
|
330
|
+
|
|
331
|
+
<Link href="/about">About</Link>
|
|
332
|
+
<Link href={`/users/${user.id}?tab=activity`}>Profile</Link>
|
|
333
|
+
<Link href={routeUrl('/users/[id]', { params: { id } })}>Profile</Link>
|
|
163
334
|
<Link href="/abuot">About</Link> // Type error: no route matches
|
|
164
335
|
```
|
|
165
336
|
|
|
166
|
-
|
|
337
|
+
:::
|
|
338
|
+
|
|
339
|
+
Links can also point to the current page (`?page=2`, `#comments`) and to `http://`, `https://`, `mailto:`, and `tel:` URLs. Relative paths such as `../settings` are rejected; use the absolute path. A fixed part with spaces or non-ASCII characters can be written as is (`/café menu`) or percent-encoded in uppercase, as `routeUrl()` returns it (`/caf%C3%A9%20menu`). A dynamic segment matches any text, including none, so `/users/[id]` also accepts `/users/` and `/users/42/edit`. With a root dynamic page such as `pages/[slug].tsx`, `.vue`, or `.svelte`, a protocol-relative URL like `//example.com` passes too.
|
|
340
|
+
|
|
341
|
+
The [SSE](./sse.md#client) and [live stream](./live.md#subscribe-from-the-browser) clients, `connectEventStream()` and `connectLiveStream()`, take one of your routes or an `http://` or `https://` URL for a stream on another origin. They reject same-page, `mailto:`, `tel:`, and `ws://` URLs. Cast a stream URL that TypeScript can't check with `as RouteUrl`; the cast turns off the check for that URL.
|
|
342
|
+
|
|
343
|
+
`c.redirect()` uses the same check as links. With `routing.typedRoutes` on, the location is a route URL, a same-page query or hash (`?page=2`, `#comments`), or an `http://`, `https://`, `mailto:`, or `tel:` URL. A path that matches no route is a type error. An external `https://` literal needs no cast. A `URL` or a destination object is accepted too. Cast a string TypeScript cannot check, such as a URL from a provider SDK, your CMS, or a file in `public/`, with `as Href`:
|
|
344
|
+
|
|
345
|
+
```ts
|
|
346
|
+
import { routeUrl, type Href } from 'void/routes';
|
|
347
|
+
|
|
348
|
+
declare const id: string;
|
|
349
|
+
declare const dynamic: string;
|
|
350
|
+
|
|
351
|
+
c.redirect('/about');
|
|
352
|
+
c.redirect(routeUrl('/users/[id]', { params: { id } }));
|
|
353
|
+
c.redirect({ pathname: '/users/[id]', params: { id } });
|
|
354
|
+
c.redirect('https://example.com/login');
|
|
355
|
+
c.redirect(new URL('https://example.com/login'));
|
|
356
|
+
c.redirect(dynamic as Href);
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The cast turns the check off, so cast only URLs you trust. Check a URL from the request, such as a `?redirectTo=` parameter, before redirecting to it. See [`c.redirect()`](../reference/api/rewrites.md#c-rewrite-destination).
|
|
167
360
|
|
|
168
361
|
`void/routes` exports two types for these strings:
|
|
169
362
|
|
|
170
|
-
- `RouteUrl`: the URL of one of your routes. `routeUrl()` returns it, and `c.rewrite()`
|
|
171
|
-
- `Href`: anything a link can point to: a `RouteUrl`, a same-page query or hash, or an external URL.
|
|
363
|
+
- `RouteUrl`: the URL of one of your routes. `routeUrl()` returns it, and `c.rewrite()`, `useIslandForm()`, and `revalidate({ paths })` accept it. Annotate a `routing.prerender` list with it.
|
|
364
|
+
- `Href`: anything a link or `c.redirect()` can point to: a `RouteUrl`, a same-page query or hash, or an external URL.
|
|
365
|
+
|
|
366
|
+
Cast a string that TypeScript can't check, such as a path from your CMS or a file in `public/`. The cast turns the check off for that string:
|
|
367
|
+
|
|
368
|
+
::: code-group
|
|
369
|
+
|
|
370
|
+
```tsx [React]
|
|
371
|
+
import { Link } from '@void/react';
|
|
372
|
+
import type { Href, RouteUrl } from 'void/routes';
|
|
373
|
+
|
|
374
|
+
<Link href={post.path as RouteUrl}>{post.title}</Link>
|
|
375
|
+
<Link href={user.website as Href}>Website</Link>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
```vue [Vue]
|
|
379
|
+
<script setup lang="ts">
|
|
380
|
+
import { Link } from '@void/vue';
|
|
381
|
+
import type { Href, RouteUrl } from 'void/routes';
|
|
382
|
+
|
|
383
|
+
const postHref = post.path as RouteUrl;
|
|
384
|
+
const website = user.website as Href;
|
|
385
|
+
</script>
|
|
172
386
|
|
|
173
|
-
|
|
387
|
+
<template>
|
|
388
|
+
<Link :href="postHref">{{ post.title }}</Link>
|
|
389
|
+
<Link :href="website">Website</Link>
|
|
390
|
+
</template>
|
|
391
|
+
```
|
|
174
392
|
|
|
175
|
-
```
|
|
393
|
+
```svelte [Svelte]
|
|
394
|
+
<script lang="ts">
|
|
395
|
+
import { Link } from '@void/svelte';
|
|
396
|
+
import type { Href, RouteUrl } from 'void/routes';
|
|
397
|
+
|
|
398
|
+
const postHref = post.path as RouteUrl;
|
|
399
|
+
const website = user.website as Href;
|
|
400
|
+
</script>
|
|
401
|
+
|
|
402
|
+
<Link href={postHref}>{post.title}</Link>
|
|
403
|
+
<Link href={website}>Website</Link>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
```tsx [Solid]
|
|
407
|
+
import { Link } from '@void/solid';
|
|
176
408
|
import type { Href, RouteUrl } from 'void/routes';
|
|
177
409
|
|
|
178
410
|
<Link href={post.path as RouteUrl}>{post.title}</Link>
|
|
179
411
|
<Link href={user.website as Href}>Website</Link>
|
|
180
412
|
```
|
|
181
413
|
|
|
414
|
+
:::
|
|
415
|
+
|
|
182
416
|
Restart the dev server or run `void prepare` after changing `routing.typedRoutes`.
|
|
183
417
|
|
|
184
418
|
Route types update with the dev server. For CI or standalone typechecking, run `void prepare` and follow [Setup](#setup). The [API reference](../reference/api/types.md#void-routes) lists the URL helper and route types.
|
|
185
419
|
|
|
186
420
|
## What Gets Checked
|
|
187
421
|
|
|
188
|
-
| Layer
|
|
189
|
-
|
|
|
190
|
-
| Database
|
|
191
|
-
| Handlers
|
|
192
|
-
| Fetch client
|
|
193
|
-
| Navigation
|
|
194
|
-
| Links
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
422
|
+
| Layer | What's type-checked |
|
|
423
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
424
|
+
| Database | Table columns, value types, insert/update shapes from Drizzle schema |
|
|
425
|
+
| Handlers | `c.env` bindings, validator input, return type |
|
|
426
|
+
| Fetch client | Route paths, HTTP methods, `body`/`query`/`params`, response type |
|
|
427
|
+
| Navigation | Route patterns and required parameter names and values in `routeUrl()` and destination objects |
|
|
428
|
+
| Links | With `routing.typedRoutes`, URL strings in `Link`, router methods, `c.rewrite()`, `useIslandForm()`, and SSE and live stream clients |
|
|
429
|
+
| `c.redirect` | With `routing.typedRoutes`, route URLs, same-page queries and hashes, destination objects, `URL` values, and `http://`, `https://`, `mailto:`, and `tel:` literals. A string TypeScript cannot check needs `as Href`. |
|
|
430
|
+
| `useParams` | Page patterns and the names of the params they return |
|
|
431
|
+
| `c.req.param` | Page param names, when the result is annotated with `PageParams` |
|
|
432
|
+
| `getPrerenderPaths` | Page param names, when the return type is annotated with `PageParams` |
|
|
433
|
+
| `revalidate` | With `routing.typedRoutes`, URL strings in `paths` |
|
|
434
|
+
| `routing.prerender` | Paths, when the array is annotated with `satisfies RouteUrl[]` |
|
|
435
|
+
| `useForm` | Action URLs, `data` fields, `errors` keys, `reset()` args (including `{ initial: true }`), `params`, `resetOnSuccess` |
|
|
436
|
+
| `action()` | Action URLs, `data` payload, `params` |
|
|
197
437
|
|
|
198
438
|
## Serialization
|
|
199
439
|
|
|
@@ -227,6 +467,48 @@ export default defineMiddleware(async (c, next) => {
|
|
|
227
467
|
|
|
228
468
|
Now `c.get("requestId")` returns `string` everywhere, with no assertion needed. Multiple augmentations across files are [merged together](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).
|
|
229
469
|
|
|
470
|
+
## Custom Binding Types
|
|
471
|
+
|
|
472
|
+
On the Cloudflare target, Void generates types for bindings declared under `cloudflare` in `void.config.ts`. For example, configure a [Cloudflare rate limiter](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/):
|
|
473
|
+
|
|
474
|
+
```ts
|
|
475
|
+
// void.config.ts
|
|
476
|
+
import { defineConfig } from 'void/config';
|
|
477
|
+
|
|
478
|
+
export default defineConfig({
|
|
479
|
+
cloudflare: {
|
|
480
|
+
ratelimits: [
|
|
481
|
+
{ name: 'MY_RATE_LIMITER', namespace_id: '1001', simple: { limit: 10, period: 60 } },
|
|
482
|
+
],
|
|
483
|
+
},
|
|
484
|
+
});
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
Run `void prepare`, or start the dev server, to use the binding without a type assertion:
|
|
488
|
+
|
|
489
|
+
```ts
|
|
490
|
+
import { defineHandler } from 'void';
|
|
491
|
+
|
|
492
|
+
export const GET = defineHandler(async (c) => {
|
|
493
|
+
const { success } = await c.env.MY_RATE_LIMITER.limit({ key: 'example' });
|
|
494
|
+
return { success };
|
|
495
|
+
});
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
Service bindings use `Fetcher`, Durable Objects use `DurableObjectNamespace`, and other bindings use their standard Cloudflare types. For RPC methods or other specialized types, augment `CloudBindings` in a file included by your tsconfig:
|
|
499
|
+
|
|
500
|
+
```ts
|
|
501
|
+
import type {} from 'void';
|
|
502
|
+
|
|
503
|
+
declare module 'void' {
|
|
504
|
+
interface CloudBindings {
|
|
505
|
+
AUTH: Fetcher & { check(): Promise<boolean> };
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
The declaration can refine a generated binding or type a binding that is not declared in `cloudflare`. Fixed values and secrets declared in `env.ts` retain their schema types. These types apply to Void's `c.env`; use your framework's Cloudflare type setup when accessing bindings through `cloudflare:workers`.
|
|
511
|
+
|
|
230
512
|
## Setup
|
|
231
513
|
|
|
232
514
|
Extend the generated tsconfig in your project:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Call your API from the client with a typed fetch that checks paths, request bodies, and response types.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -21,11 +22,13 @@ await fetch('/api/users', {
|
|
|
21
22
|
});
|
|
22
23
|
|
|
23
24
|
// Dynamic params interpolated from the route pattern
|
|
24
|
-
const user = await fetch('/api/users
|
|
25
|
+
const user = await fetch('/api/users/[id]', {
|
|
25
26
|
params: { id: '42' },
|
|
26
27
|
});
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
Route patterns use the same brackets as your filenames.
|
|
31
|
+
|
|
29
32
|
## What Gets Type-Checked
|
|
30
33
|
|
|
31
34
|
The client constrains every part of the request:
|
|
@@ -35,6 +38,8 @@ The client constrains every part of the request:
|
|
|
35
38
|
- **Body, query, params:** when your handler uses [`defineHandler.withValidator()`](./server-routing.md#validation), validator schemas become the input types and the client enforces them at the call site.
|
|
36
39
|
- **Response type:** the return type matches what your handler returns after [JSON serialization](./type-safety.md#serialization).
|
|
37
40
|
|
|
41
|
+
Omitting `method` sends GET. For a route without a GET handler, specify a supported method, such as `{ method: 'POST' }`.
|
|
42
|
+
|
|
38
43
|
## Query Parameters
|
|
39
44
|
|
|
40
45
|
Pass `query` for GET requests with search parameters:
|
|
@@ -62,7 +67,7 @@ Non-2xx responses throw a `FetchError`:
|
|
|
62
67
|
import { fetch, FetchError } from 'void/client';
|
|
63
68
|
|
|
64
69
|
try {
|
|
65
|
-
await fetch('/api/users
|
|
70
|
+
await fetch('/api/users/[id]', { params: { id: '999' } });
|
|
66
71
|
} catch (e) {
|
|
67
72
|
if (e instanceof FetchError) {
|
|
68
73
|
console.log(e.status); // 404
|
|
@@ -79,7 +84,7 @@ try {
|
|
|
79
84
|
| `method` | `string` | HTTP method. Defaults to `"GET"`. |
|
|
80
85
|
| `body` | `object` | Request body (auto-serialized as JSON). |
|
|
81
86
|
| `query` | `Record<string, string>` | Query string parameters. |
|
|
82
|
-
| `params` | `Record<string, string>` | URL path parameters (
|
|
87
|
+
| `params` | `Record<string, string>` | URL path parameters (`[id]` segments). |
|
|
83
88
|
| `headers` | `HeadersInit` | Additional request headers. |
|
|
84
89
|
| `signal` | `AbortSignal` | Abort signal. |
|
|
85
90
|
| `baseURL` | `string` | Base URL prepended to the path. Useful for external calls. |
|
package/docs/guide/websockets.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Send typed messages between the server and connected clients. Each route keeps its state in a Durable Object.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -27,7 +28,7 @@ Use `.ws.tsx` or `.ws.jsx` when a handler contains JSX, such as rendering HTML f
|
|
|
27
28
|
Filename rules match regular server routes:
|
|
28
29
|
|
|
29
30
|
- `index.ws.ts` becomes the parent path
|
|
30
|
-
- `[id].ws.ts`
|
|
31
|
+
- `[id].ws.ts` adds a dynamic `[id]` segment
|
|
31
32
|
- `[...slug].ws.ts` becomes a catch-all
|
|
32
33
|
- route groups like `(marketing)/chat.ws.ts` are ignored in the URL
|
|
33
34
|
- `chat.dev.ws.ts` / `chat.prod.ws.ts` restrict the route to one environment
|
|
@@ -122,7 +123,7 @@ Use `connect()` from `void/ws` on the client:
|
|
|
122
123
|
```ts
|
|
123
124
|
import { connect } from 'void/ws';
|
|
124
125
|
|
|
125
|
-
const socket = connect('/chat
|
|
126
|
+
const socket = connect('/chat/[room]', {
|
|
126
127
|
params: { room: 'general' },
|
|
127
128
|
});
|
|
128
129
|
|
|
@@ -200,13 +201,13 @@ export default defineRoom({
|
|
|
200
201
|
});
|
|
201
202
|
```
|
|
202
203
|
|
|
203
|
-
Move the file to `routes/rooms/[room].ws.ts`, update clients to connect to `/rooms
|
|
204
|
+
Move the file to `routes/rooms/[room].ws.ts`, update clients to connect to `/rooms/[room]`, and deploy normally. Keep the same parameter names and values: room `general` still uses its existing storage. The Worker class, binding, and migration history stay the same on both Cloudflare and Void platform deployments.
|
|
204
205
|
|
|
205
206
|
Both `defineRoom()` and `defineWebSocket()` accept optional `name`. Use a static string, inline or in a local `const`. Each route must produce a distinct Worker class; changing the name selects a different resource. If you already moved a route, `void info` also shows unmatched identities recorded in `void.lock.json`. Identify the original resource before adopting its suggested name; otherwise restore the original source and discover the name there.
|
|
206
207
|
|
|
207
208
|
### Rename a route parameter
|
|
208
209
|
|
|
209
|
-
By default, the instance key includes parameter names. `/chat
|
|
210
|
+
By default, the instance key includes parameter names. `/chat/[room]` with `room: 'general'` uses `room=general`; a route without parameters uses `default`. Multiple parameters are joined in route order, for example `team=acme&room=general`. If a multi-parameter route has a value containing `&`, its key uses a versioned encoding to keep rooms separate.
|
|
210
211
|
|
|
211
212
|
If you also rename `[room]` to `[id]`, preserve the old key explicitly:
|
|
212
213
|
|
|
@@ -220,7 +221,7 @@ export default defineRoom({
|
|
|
220
221
|
});
|
|
221
222
|
```
|
|
222
223
|
|
|
223
|
-
Clients now connect to `/rooms
|
|
224
|
+
Clients now connect to `/rooms/[id]` with `params: { id: 'general' }`. The key remains `room=general`, so storage and `ctx.id` stay the same. Returning only `params.id` would select a different instance.
|
|
224
225
|
|
|
225
226
|
`key` is optional on both WebSocket helpers. It must return a string synchronously and consistently for the same parameters. Preserve the complete old key when migrating multiple parameters. Keep the callback stable after deployment.
|
|
226
227
|
|
package/docs/index.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Deploy to Cloudflare Workers. Void detects the resources your app uses, creates bindings, and publishes the Worker.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -42,7 +43,7 @@ Add `void/env` to your TypeScript types:
|
|
|
42
43
|
}
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
This provides binding types and Workers runtime types.
|
|
46
|
+
This provides binding types and Workers runtime types. Custom bindings declared in `cloudflare` in `void.config.ts` are typed on `c.env` after `void prepare` or starting a dev server or build. See [Custom Binding Types](../guide/type-safety.md#custom-binding-types) to add RPC methods to service or Durable Object bindings.
|
|
46
47
|
|
|
47
48
|
### Available bindings
|
|
48
49
|
|
|
@@ -133,14 +134,14 @@ Apps using email need `email.from` in `void.config.ts`. Void reviews the domain'
|
|
|
133
134
|
|
|
134
135
|
Set these CI secrets and variables as needed:
|
|
135
136
|
|
|
136
|
-
| Name | When needed
|
|
137
|
-
| ------------------------------------------------ |
|
|
138
|
-
| `CLOUDFLARE_API_TOKEN` | Required. Workers Scripts: Edit, read access to bound resources, and edit access to products Void provisions.
|
|
139
|
-
| `CLOUDFLARE_ACCOUNT_ID` | When the token can access several accounts.
|
|
140
|
-
| `DATABASE_URL` | PostgreSQL and MySQL provisioning and migrations.
|
|
141
|
-
| `CLOUDFLARE_WORKERS_SUBDOMAIN` | When the
|
|
142
|
-
| `CF_ACCESS_CLIENT_ID`, `CF_ACCESS_CLIENT_SECRET` | When Cloudflare Access protects the readiness URL.
|
|
143
|
-
| `CF_ACCESS_READINESS_ORIGIN` | When Access protects a route or Custom Domain and `workers_dev` is `false`. See [Cloudflare Access](#cloudflare-access).
|
|
137
|
+
| Name | When needed |
|
|
138
|
+
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
139
|
+
| `CLOUDFLARE_API_TOKEN` | Required. Workers Scripts: Edit, read access to bound resources, and edit access to products Void provisions. |
|
|
140
|
+
| `CLOUDFLARE_ACCOUNT_ID` | When the token can access several accounts. |
|
|
141
|
+
| `DATABASE_URL` | PostgreSQL and MySQL provisioning and migrations. |
|
|
142
|
+
| `CLOUDFLARE_WORKERS_SUBDOMAIN` | When workers.dev is enabled and the version has no preview URL. Use `my-team` or `my-team.workers.dev`. An account subdomain does not create a readiness URL when `workers_dev` is false. |
|
|
143
|
+
| `CF_ACCESS_CLIENT_ID`, `CF_ACCESS_CLIENT_SECRET` | When Cloudflare Access protects the readiness URL. |
|
|
144
|
+
| `CF_ACCESS_READINESS_ORIGIN` | When Access protects a route or Custom Domain and `workers_dev` is `false`. See [Cloudflare Access](#cloudflare-access). |
|
|
144
145
|
|
|
145
146
|
For email, run `void email setup --platform cloudflare` locally, commit `void.lock.json`, and pass `--require-email` in CI. The token also needs Email Routing Edit and Email Sending Edit.
|
|
146
147
|
|
|
@@ -174,7 +175,7 @@ Set production server values with `void secret put <NAME>`. Void preserves exist
|
|
|
174
175
|
|
|
175
176
|
### Readiness and rollback
|
|
176
177
|
|
|
177
|
-
Void normally verifies an uploaded version before sending it traffic. If readiness or trigger updates fail, it restores the previous deployment. Finish or cancel any gradual rollout in Cloudflare before deploying through Void.
|
|
178
|
+
Void normally verifies an uploaded version before sending it traffic. A Worker with workers.dev turned off and no route or Custom Domain has no URL Void can check, so that deploy skips the readiness check and activates the uploaded version. If readiness or trigger updates fail, it restores the previous deployment. If trigger updates fail and Void cannot restore the previous version's triggers, for example because another tool deployed it or it is an empty draft, the new version stays live and the error says which version is serving traffic. Finish or cancel any gradual rollout in Cloudflare before deploying through Void.
|
|
178
179
|
|
|
179
180
|
For an existing Durable Object Worker that Cloudflare cannot stage, review the changes and use:
|
|
180
181
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Add Void to a Nuxt app for resource detection, typed database queries, migrations, and deployment.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -48,6 +49,8 @@ export default defineNuxtConfig({
|
|
|
48
49
|
|
|
49
50
|
The `void/nitro` module gives Nuxt server routes your app's `void/db` and `@schema`. The top-level `alias` lets `nuxi typecheck` resolve `@schema`, because Nuxt also checks server routes with the app's types. `cloudflare.dev` gives the development server the bindings from Void's generated Cloudflare config; Nuxt runs it in development when `compatibilityDate` is `2025-07-15` or later.
|
|
50
51
|
|
|
52
|
+
The database module supports Nitro 2 and Nitro 3 prereleases. Keep your Nuxt version's Cloudflare development configuration; Nitro 3 manages local Workers through its development runner.
|
|
53
|
+
|
|
51
54
|
### 4. Create `void.config.ts`
|
|
52
55
|
|
|
53
56
|
Void generates the Cloudflare config used by Nuxt's development runtime:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: "Keep your framework's routes and rendering, and use Void for databases, storage, jobs, and deployment."
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -25,6 +26,8 @@ TanStack Start and React Router use the Cloudflare Vite plugin provided by Void.
|
|
|
25
26
|
|
|
26
27
|
Detection is automatic. The CLI reads your `package.json` dependencies.
|
|
27
28
|
|
|
29
|
+
In vinext apps, `middleware.ts` and `proxy.ts` also apply to files in `public/`. When either file is present, static requests go through the Worker and count toward its request usage. Apps without middleware keep static asset delivery.
|
|
30
|
+
|
|
28
31
|
## Feature Support
|
|
29
32
|
|
|
30
33
|
With `voidPlugin()` added to the framework's Vite config, frameworks get most of the same backend/platform features as [Void apps](../../guide/app-types.md#void-apps):
|