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
|
@@ -68,7 +68,21 @@ type PageScanResult = {
|
|
|
68
68
|
pages: Array<PageDefinition>;
|
|
69
69
|
layouts: Array<LayoutDefinition>;
|
|
70
70
|
namedLayouts: Array<NamedLayoutDefinition>;
|
|
71
|
+
boundaries?: Array<PageBoundaryDefinition>;
|
|
71
72
|
};
|
|
73
|
+
type PageBoundaryDefinition = {
|
|
74
|
+
kind: "error" | "not-found";
|
|
75
|
+
directory: string;
|
|
76
|
+
componentId: string;
|
|
77
|
+
filePath: string;
|
|
78
|
+
};
|
|
79
|
+
type PageError = Readonly<{
|
|
80
|
+
status: number;
|
|
81
|
+
message: string;
|
|
82
|
+
}>;
|
|
83
|
+
type ErrorPageProps = Readonly<{
|
|
84
|
+
error: PageError;
|
|
85
|
+
}>;
|
|
72
86
|
type DevCssAsset = {
|
|
73
87
|
/** Vite client URL used to request the CSS module. */
|
|
74
88
|
url: string;
|
|
@@ -77,4 +91,4 @@ type DevCssAsset = {
|
|
|
77
91
|
/** CSS bytes returned by Vite's client environment transform with ?inline. */
|
|
78
92
|
css: string;
|
|
79
93
|
};
|
|
80
|
-
export {
|
|
94
|
+
export { PageDefinition as a, PageScanResult as c, NamedLayoutDefinition as i, RouteEnvironment as l, ErrorPageProps as n, PageError as o, LayoutDefinition as r, PageRenderMode as s, DevCssAsset as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/pages/url.ts
|
|
2
|
+
function isSameOrigin(url, origin) {
|
|
3
|
+
if (url.protocol === "capacitor:") {
|
|
4
|
+
const current = new URL(origin);
|
|
5
|
+
return current.protocol === "capacitor:" && url.host !== "" && url.host === current.host;
|
|
6
|
+
}
|
|
7
|
+
return url.origin === origin;
|
|
8
|
+
}
|
|
9
|
+
function isHexDigit(char) {
|
|
10
|
+
return char !== void 0 && (char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F");
|
|
11
|
+
}
|
|
12
|
+
function tryDecodeURI(text) {
|
|
13
|
+
try {
|
|
14
|
+
return decodeURI(text);
|
|
15
|
+
} catch {
|
|
16
|
+
return text;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The path a page is matched on, decoded the way the server (Hono's getPath)
|
|
21
|
+
* decodes it: `/caf%C3%A9` becomes `/café`, while `%25`, reserved escapes such
|
|
22
|
+
* as `%2F` and malformed escapes stay encoded.
|
|
23
|
+
*/
|
|
24
|
+
function decodePagePath(path) {
|
|
25
|
+
if (!path.includes("%")) return path;
|
|
26
|
+
const escaped = path.split("%25").join("%2525");
|
|
27
|
+
try {
|
|
28
|
+
return decodeURI(escaped);
|
|
29
|
+
} catch {}
|
|
30
|
+
let decoded = "";
|
|
31
|
+
let index = 0;
|
|
32
|
+
while (index < escaped.length) {
|
|
33
|
+
let end = index;
|
|
34
|
+
while (escaped[end] === "%" && isHexDigit(escaped[end + 1]) && isHexDigit(escaped[end + 2])) end += 3;
|
|
35
|
+
if (end === index) decoded += escaped[index++];
|
|
36
|
+
else {
|
|
37
|
+
decoded += tryDecodeURI(escaped.slice(index, end));
|
|
38
|
+
index = end;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return decoded;
|
|
42
|
+
}
|
|
43
|
+
export { isSameOrigin as n, decodePagePath as t };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// src/runtime/validator.ts
|
|
2
|
+
function flattenIssues(issues) {
|
|
3
|
+
return Array.from(issues, (issue) => ({
|
|
4
|
+
message: issue.message,
|
|
5
|
+
path: issue.path?.map((p) => typeof p === "object" ? p.key : p).join(".")
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
async function validateSlot(schema, value) {
|
|
9
|
+
const result = await schema["~standard"].validate(value);
|
|
10
|
+
if (result.issues) return {
|
|
11
|
+
ok: false,
|
|
12
|
+
issues: result.issues
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
ok: true,
|
|
16
|
+
value: result.value
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const MAX_FORM_DEPTH = 32;
|
|
20
|
+
const MAX_FORM_NODES = 1e4;
|
|
21
|
+
const MAX_FORM_INDEX = 1e4;
|
|
22
|
+
function isFormContentType(contentType) {
|
|
23
|
+
const mediaType = contentType?.split(";", 1)[0]?.trim().toLowerCase();
|
|
24
|
+
return mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `objectToFormData` writes nested fields as `a[b]`, array items as `a[0]`,
|
|
28
|
+
* and file lists as `a[]`. Split one of those keys into path segments.
|
|
29
|
+
* A key that is not entirely bracket-encoded stays a single literal segment.
|
|
30
|
+
*/
|
|
31
|
+
function formKeySegments(key) {
|
|
32
|
+
const bracket = key.indexOf("[");
|
|
33
|
+
if (bracket <= 0 || !key.endsWith("]")) return [key];
|
|
34
|
+
const segments = [key.slice(0, bracket)];
|
|
35
|
+
const rest = key.slice(bracket);
|
|
36
|
+
const pattern = /\[([^[\]]*)\]/g;
|
|
37
|
+
let consumed = 0;
|
|
38
|
+
let match;
|
|
39
|
+
while ((match = pattern.exec(rest)) !== null) {
|
|
40
|
+
if (match.index !== consumed) return [key];
|
|
41
|
+
segments.push(match[1] ?? "");
|
|
42
|
+
consumed = pattern.lastIndex;
|
|
43
|
+
if (segments.length > MAX_FORM_DEPTH) throw new Error("Form field is nested too deeply");
|
|
44
|
+
}
|
|
45
|
+
if (consumed !== rest.length) return [key];
|
|
46
|
+
return segments;
|
|
47
|
+
}
|
|
48
|
+
function arrayIndex(segment) {
|
|
49
|
+
if (segment !== "0" && !/^[1-9]\d*$/.test(segment)) return null;
|
|
50
|
+
if (segment.length > 5) throw new Error("Form field index is out of range");
|
|
51
|
+
const index = Number(segment);
|
|
52
|
+
if (index > MAX_FORM_INDEX) throw new Error("Form field index is out of range");
|
|
53
|
+
return index;
|
|
54
|
+
}
|
|
55
|
+
function isContainerRecord(value) {
|
|
56
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Blob);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Rebuild the object `objectToFormData` flattened. Numeric segments and `[]`
|
|
60
|
+
* become arrays. Scalars are left as the client encoded them.
|
|
61
|
+
*/
|
|
62
|
+
function formRecordToObject(record) {
|
|
63
|
+
const root = {};
|
|
64
|
+
let nodes = 0;
|
|
65
|
+
const reserveNodes = (count) => {
|
|
66
|
+
nodes += count;
|
|
67
|
+
if (nodes > MAX_FORM_NODES) throw new Error("Form field has too many nested values");
|
|
68
|
+
};
|
|
69
|
+
const createContainer = (asArray) => {
|
|
70
|
+
reserveNodes(1);
|
|
71
|
+
return asArray ? [] : {};
|
|
72
|
+
};
|
|
73
|
+
const read = (parent, segment) => {
|
|
74
|
+
if (Array.isArray(parent)) return segment === "" ? void 0 : parent[Number(segment)];
|
|
75
|
+
return Object.hasOwn(parent, segment) ? parent[segment] : void 0;
|
|
76
|
+
};
|
|
77
|
+
const write = (parent, segment, value) => {
|
|
78
|
+
if (Array.isArray(parent)) {
|
|
79
|
+
const index = segment === "" ? parent.length : arrayIndex(segment);
|
|
80
|
+
if (index === null) throw new Error("Form field shape is inconsistent");
|
|
81
|
+
reserveNodes(Math.max(0, index + 1 - parent.length));
|
|
82
|
+
parent[index] = value;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
Object.defineProperty(parent, segment, {
|
|
86
|
+
value,
|
|
87
|
+
writable: true,
|
|
88
|
+
enumerable: true,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const assign = (segments, value) => {
|
|
93
|
+
let parent = root;
|
|
94
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
95
|
+
const segment = segments[i];
|
|
96
|
+
const next = segments[i + 1];
|
|
97
|
+
const nextIsArray = next === "" || arrayIndex(next) !== null;
|
|
98
|
+
const child = read(parent, segment);
|
|
99
|
+
const childIsContainer = nextIsArray ? Array.isArray(child) : isContainerRecord(child);
|
|
100
|
+
const container = childIsContainer ? child : createContainer(nextIsArray);
|
|
101
|
+
if (!childIsContainer) write(parent, segment, container);
|
|
102
|
+
parent = container;
|
|
103
|
+
}
|
|
104
|
+
write(parent, segments[segments.length - 1], value);
|
|
105
|
+
};
|
|
106
|
+
for (const [key, raw] of Object.entries(record)) {
|
|
107
|
+
const segments = formKeySegments(key);
|
|
108
|
+
const values = Array.isArray(raw) ? raw : [raw];
|
|
109
|
+
for (const value of values) assign(segments, value);
|
|
110
|
+
}
|
|
111
|
+
return root;
|
|
112
|
+
}
|
|
113
|
+
async function readBody(c) {
|
|
114
|
+
if (!isFormContentType(c.req.header("content-type"))) return c.req.json();
|
|
115
|
+
return formRecordToObject(await c.req.parseBody());
|
|
116
|
+
}
|
|
117
|
+
async function runValidation(validators, c) {
|
|
118
|
+
const input = {};
|
|
119
|
+
const allIssues = [];
|
|
120
|
+
if (validators.params) {
|
|
121
|
+
const raw = c.req.param();
|
|
122
|
+
const result = await validateSlot(validators.params, raw);
|
|
123
|
+
if (result.ok) input.params = result.value;
|
|
124
|
+
else allIssues.push({
|
|
125
|
+
slot: "params",
|
|
126
|
+
issues: flattenIssues(result.issues)
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (validators.query) {
|
|
130
|
+
const raw = Object.fromEntries(Object.entries(c.req.queries()).map(([key, values]) => [key, values.length === 1 ? values[0] : values]));
|
|
131
|
+
const result = await validateSlot(validators.query, raw);
|
|
132
|
+
if (result.ok) input.query = result.value;
|
|
133
|
+
else allIssues.push({
|
|
134
|
+
slot: "query",
|
|
135
|
+
issues: flattenIssues(result.issues)
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (validators.body) {
|
|
139
|
+
let raw;
|
|
140
|
+
const formBody = isFormContentType(c.req.header("content-type"));
|
|
141
|
+
try {
|
|
142
|
+
raw = await readBody(c);
|
|
143
|
+
} catch {
|
|
144
|
+
return {
|
|
145
|
+
ok: false,
|
|
146
|
+
response: Response.json({ error: formBody ? "Invalid form body" : "Invalid JSON body" }, { status: 400 })
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const result = await validateSlot(validators.body, raw);
|
|
150
|
+
if (result.ok) input.body = result.value;
|
|
151
|
+
else allIssues.push({
|
|
152
|
+
slot: "body",
|
|
153
|
+
issues: flattenIssues(result.issues)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (allIssues.length > 0) return {
|
|
157
|
+
ok: false,
|
|
158
|
+
response: Response.json({
|
|
159
|
+
error: "Validation failed",
|
|
160
|
+
issues: allIssues
|
|
161
|
+
}, { status: 400 })
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
ok: true,
|
|
165
|
+
input
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export { runValidation as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
-
import { l as bindingNamesForField, p as findBindingNameOwner } from "./wrangler-
|
|
2
|
+
import { l as bindingNamesForField, p as findBindingNameOwner } from "./wrangler-k40T7XTQ.mjs";
|
|
3
3
|
// src/shared/untrusted-env.ts
|
|
4
4
|
/** Authentication inputs that Wrangler may consume from the environment. */
|
|
5
5
|
const WRANGLER_AUTH_CREDENTIAL_ENV_VARS = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as readRootWranglerConfig } from "./wrangler-k40T7XTQ.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, c as resolve, n as dirname, o as normalize, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { a as persistCloudflareConfig, i as materializeCloudflareConfig, r as ignoreMaterializedCloudflareConfig } from "./cloudflare-config-DtOGAbeB.mjs";
|
|
2
3
|
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-G0yut6Zz.mjs";
|
|
3
|
-
import { h as validateConfig, p as readConfig } from "./config-
|
|
4
|
-
import { a as persistCloudflareConfig, i as materializeCloudflareConfig, r as ignoreMaterializedCloudflareConfig } from "./cloudflare-config-Ce8j5S7V.mjs";
|
|
4
|
+
import { h as validateConfig, p as readConfig } from "./config-5oSQhZNj.mjs";
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { parseSync } from "vite";
|
|
7
7
|
import { appendSqliteClassMigration, isRecord } from "@void/deploy-core";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as join, l as toSlash, n as dirname, r as extname } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { l as getDatabaseDialect, p as readConfig } from "./config-5oSQhZNj.mjs";
|
|
3
|
+
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-CCiaAnSK.mjs";
|
|
2
4
|
import { n as readProjectPaths } from "./project-paths-G0yut6Zz.mjs";
|
|
3
|
-
import { l as getDatabaseDialect, p as readConfig } from "./config-hL-S-Y9D.mjs";
|
|
4
|
-
import { n as isIdentifier, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
|
|
5
|
-
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
6
|
-
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-DM4Xdd2l.mjs";
|
|
7
5
|
import { t as WORKER_CONDITIONS } from "./worker-conditions-CBZ0RYsZ.mjs";
|
|
6
|
+
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
7
|
+
import { n as isIdentifier, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { build, parseSync } from "vite";
|
|
@@ -127,10 +127,13 @@ async function generateWrapper(workerDir, workerMain, root, features) {
|
|
|
127
127
|
config,
|
|
128
128
|
sqlDriver: (dialect, entry) => bundleWorkerSqlDriver(dialect, entry, join(tmpDir, "sql-driver"))
|
|
129
129
|
})],
|
|
130
|
-
resolve: {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
resolve: {
|
|
131
|
+
conditions: [...WORKER_CONDITIONS, "production"],
|
|
132
|
+
alias: [{
|
|
133
|
+
find: /^void$/,
|
|
134
|
+
replacement: fileURLToPath(import.meta.resolve("void/handler"))
|
|
135
|
+
}]
|
|
136
|
+
},
|
|
134
137
|
build: {
|
|
135
138
|
outDir,
|
|
136
139
|
emptyOutDir: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as StandardSchemaV1 } from "./standard-schema-CuDawHOC.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as CloudEnv } from "./handler-
|
|
2
|
+
import { i as AuthUser } from "./auth-Bk9VGtQW.mjs";
|
|
3
|
+
import { a as CloudEnv } from "./handler-BO7Od-z9.mjs";
|
|
4
4
|
import { WebSocketRouteMap } from "void/routes";
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
6
6
|
type ParamsRecord = Record<string, string>;
|
package/docs/guide/ai.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Run Workers AI models and provider APIs from server code. Provider requests go through Cloudflare AI Gateway.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -28,6 +29,8 @@ account shown by `void cloudflare status`, or set `CLOUDFLARE_API_TOKEN`.
|
|
|
28
29
|
|
|
29
30
|
For a team platform, use `void connect <platform-url>` and link your project.
|
|
30
31
|
Development requests use that platform's account and usage limits.
|
|
32
|
+
If the platform reports that AI is disabled, ask your administrator to enable it.
|
|
33
|
+
This also applies to model listing, Markdown conversion, and provider-native requests.
|
|
31
34
|
|
|
32
35
|
## Basic Usage
|
|
33
36
|
|
package/docs/guide/app-types.md
CHANGED
package/docs/guide/auth.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Add Better Auth to your app, including its database, API routes, and client. Start with email and password or a social provider.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -118,9 +119,71 @@ import { getSession, getUser, requireAuth } from 'void/auth';
|
|
|
118
119
|
- `getUser()` returns the current `AuthUser | null`
|
|
119
120
|
- `getSession()` returns `{ user, session } | null`
|
|
120
121
|
- `requireAuth(c)` returns the authenticated user or throws `401`
|
|
122
|
+
- [`getAuth(c)`](../reference/api/auth.md#getauth-c) returns the request's Better Auth instance, with plugin APIs inferred from `auth.ts`, for use with Better Auth helpers.
|
|
121
123
|
|
|
122
124
|
Import `AuthUser` and `AuthSession` from `void/auth` for type annotations. They include the fields your Better Auth plugins and `user.additionalFields` add, such as `role` from `admin()`. See their fields in the [API reference](../reference/api/auth.md#authuser).
|
|
123
125
|
|
|
126
|
+
## Querying Authentication Tables
|
|
127
|
+
|
|
128
|
+
When authentication is enabled, Void generates the Better Auth Drizzle schema in `.void/better-auth-schema.ts`.
|
|
129
|
+
The generated file exports the core authentication tables:
|
|
130
|
+
|
|
131
|
+
- `userTable`
|
|
132
|
+
- `sessionTable`
|
|
133
|
+
- `accountTable`
|
|
134
|
+
- `verificationTable`
|
|
135
|
+
|
|
136
|
+
Configured Better Auth plugins may also contribute additional tables.
|
|
137
|
+
|
|
138
|
+
The generated file path and core table export names are documented integration points. You can import these exports directly rather than recreating the tables in your application.
|
|
139
|
+
|
|
140
|
+
To import these tables into your application, add a TypeScript path alias to your root `tsconfig.json`:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"compilerOptions": {
|
|
145
|
+
"paths": {
|
|
146
|
+
"@auth-schema": ["./.void/better-auth-schema.ts"]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If your `tsconfig.json` already has a `paths` mapping, add `@auth-schema` to the existing mapping rather than replacing it.
|
|
153
|
+
|
|
154
|
+
If your project extends `.void/tsconfig.json` and defines its own `paths`, make sure to retain any mappings from the generated configuration that your project uses, such as `@schema`.
|
|
155
|
+
|
|
156
|
+
You can now import and query authentication tables:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
import { userTable } from '@auth-schema';
|
|
160
|
+
import { db, desc } from 'void/db';
|
|
161
|
+
|
|
162
|
+
export function listUsers() {
|
|
163
|
+
return db.select().from(userTable).orderBy(desc(userTable.createdAt));
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
You can also reference authentication tables when defining your own Drizzle tables:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import { userTable } from '@auth-schema';
|
|
171
|
+
import { sqliteTable, text } from 'void/schema-d1';
|
|
172
|
+
|
|
173
|
+
export const postTable = sqliteTable('post', {
|
|
174
|
+
id: text('id').primaryKey(),
|
|
175
|
+
userId: text('user_id')
|
|
176
|
+
.notNull()
|
|
177
|
+
.references(() => userTable.id, { onDelete: 'cascade' }),
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
This example assumes the default text ID strategy. If you configure `advanced.database.generateId: 'serial'`, use an integer foreign-key column to match the generated user ID.
|
|
182
|
+
|
|
183
|
+
The example above uses SQLite/D1. For PostgreSQL and MySQL, use the corresponding schema modules: `void/schema-pg` and `void/schema-mysql`.
|
|
184
|
+
|
|
185
|
+
The generated schema is managed by Void. Do not edit `.void/better-auth-schema.ts` manually, as Void may regenerate it during its build or preparation process.
|
|
186
|
+
|
|
124
187
|
## Behavior
|
|
125
188
|
|
|
126
189
|
Auth sessions use the same database as your app. Void creates `BETTER_AUTH_SECRET` on deploy if it is missing and reuses it on later deploys.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: "Use Cloudflare D1, Void's default SQLite database. Void runs it locally and provisions it when you deploy."
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -42,7 +43,21 @@ await db.batch([
|
|
|
42
43
|
|
|
43
44
|
Void enables [D1 read replication](https://developers.cloudflare.com/d1/best-practices/read-replication/) when it provisions a database. To enable it on an existing database, run `void deploy --platform cloudflare --provision`. Queries through `db` from `void/db` use a D1 session for each Void request, so reads can run near the request and later queries in that request see at least the same data. Framework handlers without Void's request scope start each database operation on the primary. `createDb` starts a replica-capable session for the binding you pass it.
|
|
44
45
|
|
|
45
|
-
Replicas can lag between requests. Authentication session checks start on the primary so a revoked session is not accepted because of replica lag.
|
|
46
|
+
Replicas can lag between requests. Authentication session checks start on the primary so a revoked session is not accepted because of replica lag. For another read that needs the latest primary data, create a Drizzle client inside that request with `createDb(env.DB, { session: 'first-primary' })`:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { users } from '@schema';
|
|
50
|
+
import { env } from 'cloudflare:workers';
|
|
51
|
+
import { defineHandler } from 'void';
|
|
52
|
+
import { createDb } from 'void/db';
|
|
53
|
+
|
|
54
|
+
export const GET = defineHandler(async () => {
|
|
55
|
+
const primaryDb = createDb(env.DB, { session: 'first-primary' });
|
|
56
|
+
return primaryDb.select().from(users).all();
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The first query uses the primary; subsequent queries in that session see at least the same data. Without this option, `createDb()` uses `'first-unconstrained'`, allowing its first query to use a replica. Other query libraries and raw D1 calls need their own `withSession()` to use replicas; a bare D1 binding reads from the primary.
|
|
46
61
|
|
|
47
62
|
## Alternative Query Layers
|
|
48
63
|
|
package/docs/guide/database.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Define tables in TypeScript and query them with Drizzle. Use the same schema with D1, PostgreSQL, or MySQL.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -385,6 +386,39 @@ npm install arktype
|
|
|
385
386
|
|
|
386
387
|
See the [CLI reference](../reference/cli/database.md#database) for connection setup, SQL execution, Studio, exports, and other commands.
|
|
387
388
|
|
|
389
|
+
## Adopt an existing Drizzle PostgreSQL database {#adopt-existing-drizzle}
|
|
390
|
+
|
|
391
|
+
You can keep a PostgreSQL database that Drizzle has already migrated. Void tracks applied files separately, so record the existing history before the first Void deployment.
|
|
392
|
+
|
|
393
|
+
1. Back up the database and pause deployments. Try the procedure on a restored copy first.
|
|
394
|
+
2. Set `database: 'pg'` in `void.config.ts`. Keep your existing schema, SQL filenames, and `db/migrations/meta/` directory. Do not regenerate or rename migrations during adoption.
|
|
395
|
+
3. Check the database's Drizzle history against `meta/_journal.json` and your SQL files. Match each applied row's `created_at` to the journal entry's `when`, and its `hash` to the SHA-256 of the corresponding SQL file. Drizzle normally stores this history in `drizzle.__drizzle_migrations`; use your configured schema and table if different. If a file cannot be verified, resolve the discrepancy before continuing.
|
|
396
|
+
|
|
397
|
+
```sql
|
|
398
|
+
SELECT hash, created_at FROM drizzle.__drizzle_migrations ORDER BY created_at;
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
4. Save the following as `adopt-void.sql`, replacing the example filenames with **only the migrations verified as already applied to this database**, including `.sql`. Leave new, unapplied files out of the list.
|
|
402
|
+
|
|
403
|
+
```sql [adopt-void.sql]
|
|
404
|
+
BEGIN;
|
|
405
|
+
CREATE TABLE IF NOT EXISTS _void_migrations (
|
|
406
|
+
name TEXT PRIMARY KEY,
|
|
407
|
+
applied_at TEXT NOT NULL
|
|
408
|
+
);
|
|
409
|
+
INSERT INTO _void_migrations (name, applied_at)
|
|
410
|
+
VALUES
|
|
411
|
+
('0000_create_users.sql', CURRENT_TIMESTAMP::text),
|
|
412
|
+
('0001_add_email.sql', CURRENT_TIMESTAMP::text)
|
|
413
|
+
ON CONFLICT (name) DO NOTHING;
|
|
414
|
+
COMMIT;
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
5. Run the file against the existing database with your PostgreSQL client, stopping on errors. Use the same database and PostgreSQL search path that Void will use. This records the verified filenames without executing their SQL or changing Drizzle's history.
|
|
418
|
+
6. Configure Void's connection to that database and run `void db status`. Verify that only new migrations are pending, then deploy. For direct Cloudflare deployments, provide that database's `DATABASE_URL` in the shell or CI environment running `void deploy`.
|
|
419
|
+
|
|
420
|
+
Repeat the verification and adoption separately for each database. An entry in one environment's history does not prove that another environment has applied it. Leave Drizzle's history table intact, and use Void for subsequent migrations.
|
|
421
|
+
|
|
388
422
|
## Hand-written migrations {#hand-written-migrations}
|
|
389
423
|
|
|
390
424
|
Deploy compares your Drizzle schema with the snapshots in `db/migrations/meta/`. If you have SQL migrations without this metadata, running `void db generate` would create another migration for the same tables.
|
package/docs/guide/deployment.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Deploy with void deploy. It builds your app, provisions resources, applies migrations, and publishes to Cloudflare or a team platform.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -35,6 +36,14 @@ void db generate
|
|
|
35
36
|
|
|
36
37
|
Review and commit the SQL, then deploy again. Rollback does not reverse database migrations. See [Database](./database.md) for the local workflow.
|
|
37
38
|
|
|
39
|
+
When migrations run in a separate release step, or a preview shares an existing database, deploy code without applying application or authentication SQL migrations:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
void deploy --skip-migrations
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This works with both deployment destinations. Ensure the app supports the database's current schema. Migration files and schema checks still apply, and the next normal deploy applies any pending migrations. See [the deploy options](../reference/cli/deploy.md#void-deploy) and [`void db migrate`](../reference/cli/database.md#void-db-migrate) for supported ways to apply migrations separately.
|
|
46
|
+
|
|
38
47
|
For D1 on your own Cloudflare account, deploy saves a restore point before applying migrations and prints a [`void db restore`](../reference/cli/database.md#void-db-restore) command. Use it to recover from a bad migration, then fix the migration before deploying again. A restore discards writes made after that point; check that your deployed code works with the restored schema. See the command reference for the recovery steps and retention limits.
|
|
39
48
|
|
|
40
49
|
### Environment variables
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Prerender pages at deploy time so the first visitor receives cached HTML.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -22,18 +23,21 @@ Pages without dynamic params do not need `getPrerenderPaths()`.
|
|
|
22
23
|
|
|
23
24
|
## Dynamic pages (with params)
|
|
24
25
|
|
|
25
|
-
For pages with URL params, also export `getPrerenderPaths()` to specify which param combinations to prerender
|
|
26
|
+
For pages with URL params, also export `getPrerenderPaths()` to specify which param combinations to prerender. Annotate the return type with [`PageParams`](../../reference/api/types.md#route-types) for that page's URL pattern, such as `/blog/:slug` for `pages/blog/[slug].server.ts`. TypeScript then requires each object to include those params, so a missing or misspelled key is a type error. Void does not infer this type from the filename.
|
|
26
27
|
|
|
27
28
|
```ts
|
|
28
29
|
// pages/blog/[slug].server.ts
|
|
30
|
+
import type { PageParams } from 'void/routes';
|
|
31
|
+
|
|
29
32
|
export const prerender = true;
|
|
30
33
|
|
|
31
|
-
export async function getPrerenderPaths() {
|
|
32
|
-
// Return param objects matching the URL pattern
|
|
34
|
+
export async function getPrerenderPaths(): Promise<PageParams<'/blog/:slug'>[]> {
|
|
33
35
|
return [{ slug: 'hello-world' }, { slug: 'getting-started' }];
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
Each object must include every param in the page path. Values can be strings or numbers, and Void URL-encodes them. A single-segment param such as `[slug]` cannot contain `/`. For nested paths, use a catch-all page such as `pages/docs/[...slug]` and return `{ slug: 'guides/intro' }`. If an entry is invalid, `void deploy` fails. The error names the server file and the entry index.
|
|
40
|
+
|
|
37
41
|
## Custom SSR
|
|
38
42
|
|
|
39
43
|
In custom SSR mode (`src/main.ssr.ts`), export `getPrerenderPaths()` at the top level. Since there's no file-based routing, return full path strings:
|
|
@@ -42,11 +46,13 @@ In custom SSR mode (`src/main.ssr.ts`), export `getPrerenderPaths()` at the top
|
|
|
42
46
|
// src/main.ssr.ts
|
|
43
47
|
export const prerender = true;
|
|
44
48
|
|
|
45
|
-
export async function getPrerenderPaths() {
|
|
49
|
+
export async function getPrerenderPaths(): Promise<string[]> {
|
|
46
50
|
return ['/', '/about', '/blog/hello-world'];
|
|
47
51
|
}
|
|
48
52
|
```
|
|
49
53
|
|
|
54
|
+
Annotate this return type as an array of path strings. Use `PageParams` on file-based pages, where the function returns param objects.
|
|
55
|
+
|
|
50
56
|
## Relationship to revalidation
|
|
51
57
|
|
|
52
58
|
Setting `routing.isr: false` in `void.config.ts` disables ISR and this edge-prerendering behavior, including per-page exports. It does not disable build-time HTML generation with `output: "static"`.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Cache rendered pages and refresh them in the background, so visitors keep reading while a new version renders.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -61,6 +62,8 @@ export const loader = defineHandler(async (c) => {
|
|
|
61
62
|
});
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
Use a whole-number literal such as `3600`. Void reads the value without running the file, so it ignores an expression such as `60 * 60` or a value re-exported from another module, and prints a warning.
|
|
66
|
+
|
|
64
67
|
Per-page values take precedence over `void.config.ts` patterns.
|
|
65
68
|
|
|
66
69
|
A page's `revalidate` export also applies to `routes/` handlers whose URLs match the page pattern. For example, if `pages/[...slug].server.ts` exports `revalidate`, Void can also cache the `GET` response of `routes/now.ts`. Void never caches paths under `/api`. To keep a route handler's response out of the cache, set `x-revalidate: 0` on it. See [Per-response TTL override](#per-response-ttl-override).
|
|
@@ -119,6 +122,7 @@ Purge the destination pathname with `revalidate({ paths })`. Purging `/en/docs/f
|
|
|
119
122
|
You can purge ISR cache entries programmatically from a route handler:
|
|
120
123
|
|
|
121
124
|
```ts
|
|
125
|
+
import { defineHandler } from 'void';
|
|
122
126
|
import { revalidate } from 'void/isr';
|
|
123
127
|
|
|
124
128
|
export const POST = defineHandler(async (c) => {
|
|
@@ -133,3 +137,5 @@ export const POST = defineHandler(async (c) => {
|
|
|
133
137
|
return c.json({ ok: true });
|
|
134
138
|
});
|
|
135
139
|
```
|
|
140
|
+
|
|
141
|
+
With [`routing.typedRoutes`](../../reference/config.md#routing-typedroutes) on, each path must match one of your routes. Cast a path that TypeScript can't check, such as one from a webhook payload, with `as RouteUrl` from `void/routes`. The cast turns the check off for that path.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Receive mail with handlers in email/. Inbound email is available in native Void apps.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -105,7 +106,7 @@ Test inbound handlers locally with `createInboundTestHarness` below.
|
|
|
105
106
|
Use `createInboundTestHarness` to capture replies, forwards, and rejections. For shared platform mail, pass the full address including the project prefix, such as `acme+support+abc-123@acme.dev`. For direct Cloudflare mail, set `slug: null` and use `support+abc-123@mail.acme.com`.
|
|
106
107
|
|
|
107
108
|
```ts
|
|
108
|
-
import { describe, it, expect } from '
|
|
109
|
+
import { describe, it, expect } from 'vite-plus/test';
|
|
109
110
|
import { createInboundTestHarness } from 'void/email/testing';
|
|
110
111
|
import defaultHandler from './email/_default';
|
|
111
112
|
import support from './email/support+[ticket]';
|
|
@@ -138,4 +139,4 @@ describe('email handlers', () => {
|
|
|
138
139
|
});
|
|
139
140
|
```
|
|
140
141
|
|
|
141
|
-
The harness matches handlers in the same order as deployed email routes.
|
|
142
|
+
The harness matches handlers in the same order as deployed email routes. [Testing](../testing.md) explains how to run tests and how to test code that uses other bindings.
|