void 1.7.0 → 1.9.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-BfkJ_1PC.mjs → account-cmd-BEMOdwtl.mjs} +5 -5
- package/dist/{application-analysis-OV0CBJ80.mjs → application-analysis-3VVsflWZ.mjs} +28 -8
- package/dist/{application-routing-QpyC5G8z.mjs → application-routing-CJRlXCc2.mjs} +1 -1
- package/dist/{auth-CZrthGxs.d.mts → auth-CV9kXHKe.d.mts} +4 -2
- package/dist/{auth-DyWp-fSo.mjs → auth-aMuFOZeI.mjs} +8 -2
- package/dist/{auth-link-CW1Zh6FM.mjs → auth-link-B1IynRW5.mjs} +5 -5
- package/dist/{auth-router-CNBKnEZi.mjs → auth-router-DVaWJdRB.mjs} +3 -3
- package/dist/{better-auth-shared-CdVyCUou.mjs → better-auth-shared-C7LHvF4L.mjs} +1 -1
- package/dist/{better-auth-shared-C-0uZg8-.d.mts → better-auth-shared-ajs3LNrY.d.mts} +2 -2
- package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
- package/dist/{build-cmd-C9qOKW9W.mjs → build-cmd-Dq8tdqQG.mjs} +4 -4
- package/dist/{cache-DVBBbWQL.mjs → cache-DGMnskX7.mjs} +4 -4
- package/dist/{cancel-deploy-COavnjud.mjs → cancel-deploy-96S5hD1E.mjs} +3 -3
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +92 -19
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/{cli-main-DFteHrJI.mjs → cli-main-CQRLxZAu.mjs} +32 -32
- package/dist/client-66c0RLDM.mjs +1 -0
- package/dist/{client-BEZmTP6p.mjs → client-D6w5x7hM.mjs} +7 -7
- package/dist/{cloudflare-auth-DGIivpTb.mjs → cloudflare-auth-pNvmT6kL.mjs} +1 -1
- package/dist/{cloudflare-cmd-DJaxC-bc.mjs → cloudflare-cmd-BuuHUM4z.mjs} +5 -5
- package/dist/{cloudflare-config-DtOGAbeB.mjs → cloudflare-config-PxbinLLE.mjs} +2 -2
- package/dist/{cloudflare-connect-BjpWmglw.mjs → cloudflare-connect-D1QOosLd.mjs} +3 -3
- package/dist/{cloudflare-operations-k7wYUv56.mjs → cloudflare-operations-G5AObYzF.mjs} +6 -6
- package/dist/{cloudflare-operations-CZkjFrzH.mjs → cloudflare-operations-I4t3mt4R.mjs} +1 -1
- package/dist/{cloudflare-process-BcPvlMFd.mjs → cloudflare-process-wcnaQ5JG.mjs} +2 -2
- package/dist/{config-wo2EaH0X.mjs → config-C1DPf8EK.mjs} +1 -1
- package/dist/{config-CTlUaXWZ.d.mts → config-CCWVY7DY.d.mts} +1 -1
- package/dist/{config-5oSQhZNj.mjs → config-CzFdJYNA.mjs} +1 -1
- package/dist/{config-DcqUBGCb.mjs → config-DlWQ_hIJ.mjs} +3 -3
- package/dist/{config-eeDzKBS9.mjs → config-Do7gJI3T.mjs} +2 -2
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-j1F1C_rW.mjs → connect-4uImOwut.mjs} +6 -6
- package/dist/{create-project-CE3jOmd5.mjs → create-project-BaUzZnLZ.mjs} +4 -4
- package/dist/{create-project-DZH3aYGQ.mjs → create-project-CQMyzTvK.mjs} +1 -1
- package/dist/{db-DyLzzxvM.mjs → db-DEpDeDsi.mjs} +22 -22
- package/dist/{db-types-DdHHUVPy.mjs → db-types-BpPYAx0B.mjs} +4 -2
- package/dist/{delete-Dey6YoMA.mjs → delete-BVD2kI82.mjs} +4 -4
- package/dist/deploy-Dr_Qamzw.mjs +2 -0
- package/dist/{deploy-Ccw2D2lw.mjs → deploy-Dyeo5soA.mjs} +40 -81
- package/dist/{deploy-managed-static-BBVtpuGv.mjs → deploy-managed-static-Kn73R83A.mjs} +22 -22
- package/dist/{deploy-transport-Dt0IvSVW.mjs → deploy-transport-BpKBs_KR.mjs} +3 -3
- package/dist/deploy.mjs +6 -6
- package/dist/discover-Diq0l6TZ.mjs +1 -0
- package/dist/{discover-CVFCWU7W.mjs → discover-Vd18lHsj.mjs} +1 -1
- package/dist/{dispatch-pYaww76u.mjs → dispatch-BBfb519j.mjs} +8 -8
- package/dist/{dist-DeTdhbZc.mjs → dist-Cp4b1_T9.mjs} +1 -1
- package/dist/{dist-BQdgCVQF.mjs → dist-STQXl8ck.mjs} +86 -138
- package/dist/{domain-Dh3mG8Vs.mjs → domain-BTIdyUVk.mjs} +5 -5
- 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-DKyMjOYM.mjs → email-DvrS-I0U.mjs} +10 -10
- package/dist/{email-cloudflare-CTt2n_W2.mjs → email-cloudflare-DAGpgzY1.mjs} +16 -11
- package/dist/{entry-Bw-G1VVx.mjs → entry-DMgR7XOf.mjs} +2 -2
- package/dist/{env-DkZzh_Dd.mjs → env-D7vORwpn.mjs} +6 -6
- package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
- package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
- package/dist/{env-types-Dz9qkiOn.mjs → env-types-WEZw5D-r.mjs} +1 -1
- package/dist/{env-validation-C8NL3lEH.mjs → env-validation-DKDcpxbt.mjs} +1 -1
- package/dist/{env-validation-1snjKtDX.mjs → env-validation-DeYNRp1d.mjs} +5 -5
- package/dist/{gen-BZmFOGDQ.mjs → gen-DimkGNve.mjs} +6 -6
- package/dist/gen-DmEeVEs4.mjs +1 -0
- package/dist/{github-cmd-7Oky9qgH.mjs → github-cmd-D-zs6VQr.mjs} +4 -4
- package/dist/{handler-DjqciiDc.d.mts → handler-6fzr_ikp.d.mts} +5 -4
- package/dist/{head-MeF_5M_3.d.mts → head-CVO92KEx.d.mts} +14 -3
- package/dist/{head-5XPcnG-j.mjs → head-CWJhfUwV.mjs} +62 -3
- package/dist/{headers-CimYIfQI.mjs → headers-Q0kZDpk8.mjs} +11 -2
- package/dist/{help-CNuUb47C.mjs → help-Cgdcd-SG.mjs} +6 -6
- package/dist/help-Cp3K5m1w.mjs +1 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +257 -188
- package/dist/{info-DwB8IWIx.mjs → info-BbxQ34kk.mjs} +4 -4
- package/dist/{init-CUGSmcED.mjs → init-zyRj3QRw.mjs} +19 -20
- package/dist/{link-BlRTGHan.mjs → link-DAFXuIER.mjs} +5 -5
- package/dist/{list-iCg7d5Pa.mjs → list-BTIcC3W9.mjs} +5 -5
- package/dist/{live-zKGbRT4h.d.mts → live-DBybyDt0.d.mts} +2 -2
- package/dist/{live-CYJ4KGoR.mjs → live-Dw7NF1t2.mjs} +1 -1
- package/dist/load-user-env-ztmIyiLx.mjs +34 -0
- package/dist/{local-d1-CFcH9Bx3.mjs → local-d1-BnVb7Fem.mjs} +1 -1
- package/dist/login-DBs8JuSl.mjs +1 -0
- package/dist/{login-TA51e5Fw.mjs → login-DOE-MkeK.mjs} +4 -4
- package/dist/{logs-BlyAxlvx.mjs → logs-CUsjihc3.mjs} +4 -4
- package/dist/migrate-BYhoIK9R.mjs +1 -0
- package/dist/{migrate-BH6LCr00.mjs → migrate-DtoKdGas.mjs} +6 -6
- package/dist/nitro.mjs +3 -3
- package/dist/{node-B0otYjDv.mjs → node-D9dPyUr0.mjs} +4 -4
- package/dist/operator-ai-logging-DFTEp81Z.mjs +121 -0
- package/dist/{operator-args-DuKAQ3Ks.mjs → operator-args-BCCohcz3.mjs} +10 -1
- package/dist/{operator-cmd-CoHlJjcT.mjs → operator-cmd-CQOQrUiO.mjs} +27 -7
- package/dist/operator-cmd-xCACDtT1.mjs +1 -0
- package/dist/output-BsdnNpxa.mjs +1 -0
- package/dist/{output-CXJTIAtF.mjs → output-DNVILSz2.mjs} +1 -1
- package/dist/pages/client.d.mts +28 -3
- package/dist/pages/client.mjs +146 -27
- package/dist/pages/head.d.mts +2 -2
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +5 -4
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +6 -2
- package/dist/pages/islands-plugin.mjs +18 -3
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/platform-args-DSi4_M8n.mjs +1 -0
- package/dist/{platform-args-DfT8yQBF.mjs → platform-args-DtpHS_75.mjs} +1 -1
- package/dist/{platform-auth-config-MO0VdVs9.mjs → platform-auth-config-fLwIS5VG.mjs} +6 -6
- package/dist/{platform-auth-protection-Dv208eyL.mjs → platform-auth-protection-BTRI_YwD.mjs} +4 -4
- package/dist/{platform-auth-recovery-DvAQ674F.mjs → platform-auth-recovery-DPK2Mvmo.mjs} +4 -4
- package/dist/{platform-cmd-BpUA19r_.mjs → platform-cmd-BLy5uCa-.mjs} +1 -1
- package/dist/{platform-cmd-dlSxrcQ7.mjs → platform-cmd-HS_FSthn.mjs} +7 -7
- package/dist/{platform-domain-DSO4eUEw.mjs → platform-domain-CHpcq_qg.mjs} +4 -4
- package/dist/{platform-lifecycle-CfcFygHb.mjs → platform-lifecycle-B6LUBwjS.mjs} +1 -1
- package/dist/{platform-lifecycle-BSvsyB_x.mjs → platform-lifecycle-D2RS7DE0.mjs} +239 -29
- package/dist/{platform-management-BMdyt667.mjs → platform-management-C-T0ch4y.mjs} +1 -1
- package/dist/{platform-management-CrP1XhVd.mjs → platform-management-d3ETv3Dw.mjs} +15 -15
- package/dist/{platform-plans-config-CgDiwflR.mjs → platform-plans-config-B7yJQKf7.mjs} +116 -32
- package/dist/{platform-recovery-CHWwXVZ6.mjs → platform-recovery-DS5CAsly.mjs} +2 -2
- package/dist/{platform-setup-BTQVbnTC.mjs → platform-setup-Casiffqj.mjs} +2 -2
- package/dist/{plugin-inference-g66Q1Mx9.mjs → plugin-inference-DZHmVe1f.mjs} +4 -4
- package/dist/{prepare-DXduEwQp.mjs → prepare-AVM4Hj3T.mjs} +10 -10
- package/dist/prepare-BSXKz6m8.mjs +1 -0
- package/dist/{prepare-DJYHjpzq.mjs → prepare-DMk8NAO-.mjs} +3 -3
- package/dist/{prerender-render-BN9Lmebs.mjs → prerender-render-BAdYhivW.mjs} +15 -2
- package/dist/prerender-render.d.mts +2 -0
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-Dfb1Sg8w.mjs → project-cmd-TQKAOTMV.mjs} +17 -17
- package/dist/{project-paths-G0yut6Zz.mjs → project-paths-CUhCPMpK.mjs} +33 -2
- package/dist/{project-team-BO2dyc7S.mjs → project-team-B1OKeb-T.mjs} +4 -4
- package/dist/{project-token-ByO2mEI2.mjs → project-token-RW_wpmN-.mjs} +4 -4
- package/dist/{project-tsconfig-nhnTWO_Y.mjs → project-tsconfig-MyRJgufB.mjs} +1 -1
- package/dist/{project-zero-trust-CoQfwRBR.mjs → project-zero-trust-TNc66p0_.mjs} +4 -4
- package/dist/{protocol-yxdHxFLN.mjs → protocol-IPSWHolJ.mjs} +233 -76
- package/dist/{protocol-xZMvWsrg.d.mts → protocol-YS3tbxWE.d.mts} +10 -3
- package/dist/{provision-CMH4-8ri.mjs → provision-BLdkpFT4.mjs} +1 -1
- package/dist/{provision-D5q-ptD3.mjs → provision-bgQTi5QZ.mjs} +2 -2
- package/dist/redirect-Dqb4fEc5.mjs +80 -0
- package/dist/{requests-CPOiDkjh.mjs → requests-Cj15-yrI.mjs} +3 -3
- package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
- package/dist/{resolve-project-ClvLMTI9.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
- package/dist/{rollback-BfCs2la4.mjs → rollback-CYnkng7B.mjs} +4 -4
- package/dist/{route-types-Cl3x0Q8B.mjs → route-types-C6eAOmOj.mjs} +4 -3
- package/dist/routes-stub.d.mts +4 -3
- package/dist/runtime/auth.d.mts +1 -1
- 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 +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db.d.mts +6 -3
- package/dist/runtime/db.mjs +2 -2
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +53 -39
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- 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/routing.d.mts +8 -3
- package/dist/runtime/routing.mjs +164 -23
- package/dist/runtime/validator.d.mts +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/{scan-L8OSv1f7.mjs → scan-4YOxDaw2.mjs} +230 -29
- package/dist/{secret-CuI6LTpD.mjs → secret-BSf7dgg_.mjs} +6 -6
- package/dist/{skills-BBO9wMjB.mjs → skills-CoBB9_Ao.mjs} +1 -1
- package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
- package/dist/{subcommand-prompt-BZMnCA8T.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
- package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
- package/dist/url-DaehRGKR.mjs +106 -0
- package/dist/{version-metadata-eUd6Ar_U.mjs → version-metadata-CeftH0fQ.mjs} +1 -1
- package/dist/{wrangler-k40T7XTQ.mjs → wrangler-B1gkT_wC.mjs} +3 -3
- package/dist/wrangler-fNGvPTlO.mjs +1 -0
- package/dist/{wrapper-BGsi_uHs.mjs → wrapper-xJ4LP5A7.mjs} +3 -3
- package/dist/{ws-DB8Feytg.d.mts → ws-C2zy0QBf.d.mts} +2 -2
- package/docs/guide/ai.md +2 -1
- package/docs/guide/app-types.md +1 -0
- package/docs/guide/auth.md +23 -27
- package/docs/guide/database/d1.md +18 -1
- package/docs/guide/database/mysql.md +1 -0
- package/docs/guide/database/postgresql.md +1 -0
- package/docs/guide/database.md +30 -27
- package/docs/guide/deployment.md +3 -2
- package/docs/guide/durable-state.md +1 -0
- package/docs/guide/edge/headers.md +4 -3
- package/docs/guide/edge/prerendering.md +6 -5
- package/docs/guide/edge/redirects.md +2 -1
- package/docs/guide/edge/revalidation.md +6 -1
- package/docs/guide/edge/rewrites.md +2 -1
- package/docs/guide/edge/static-assets.md +5 -0
- package/docs/guide/email/domains.md +1 -0
- package/docs/guide/email/receiving.md +3 -2
- package/docs/guide/email/sending.md +7 -4
- 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 +2 -1
- package/docs/guide/pages-routing/actions-and-forms.md +58 -22
- package/docs/guide/pages-routing/errors.md +109 -0
- package/docs/guide/pages-routing/head.md +45 -1
- package/docs/guide/pages-routing/islands.md +4 -1
- package/docs/guide/pages-routing/layouts.md +4 -1
- package/docs/guide/pages-routing/loaders.md +4 -1
- package/docs/guide/pages-routing/markdown.md +6 -4
- package/docs/guide/pages-routing/overview.md +16 -20
- 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 +13 -2
- 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 +35 -1
- package/docs/guide/platform/administration/projects.md +16 -1
- 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 +12 -9
- 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 +8 -1
- package/docs/guide/platform/installation/prerequisites.md +1 -0
- package/docs/guide/platform/installation/setup.md +9 -7
- 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 +3 -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 +3 -2
- package/docs/guide/sse.md +2 -1
- package/docs/guide/ssg.md +18 -6
- package/docs/guide/ssr.md +1 -0
- package/docs/guide/storage.md +2 -1
- package/docs/guide/testing.md +64 -0
- package/docs/guide/type-safety.md +24 -21
- package/docs/guide/typed-fetch.md +1 -0
- package/docs/guide/websockets.md +1 -0
- package/docs/index.md +1 -0
- package/docs/integrations/agents.md +1 -0
- package/docs/integrations/cloudflare.md +7 -2
- package/docs/integrations/frameworks/analog.md +1 -0
- package/docs/integrations/frameworks/astro.md +1 -0
- package/docs/integrations/frameworks/nuxt.md +2 -1
- package/docs/integrations/frameworks/overview.md +1 -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 +22 -0
- package/docs/integrations/nodejs-bun-deno.md +5 -4
- package/docs/reference/api/auth.md +23 -4
- package/docs/reference/api/client.md +1 -0
- 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 +1 -0
- package/docs/reference/api/pages.md +38 -16
- package/docs/reference/api/plugin.md +1 -0
- package/docs/reference/api/resources.md +2 -1
- package/docs/reference/api/rewrites.md +9 -4
- package/docs/reference/api/types.md +1 -0
- package/docs/reference/api.md +2 -1
- package/docs/reference/cli/auth.md +1 -0
- package/docs/reference/cli/database.md +1 -0
- package/docs/reference/cli/deploy.md +5 -2
- 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 +4 -3
- 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 +71 -1
- 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 +3 -0
- package/docs/reference/config.md +8 -3
- package/docs/reference/resource-inference.md +1 -0
- package/docs/reference/structure.md +1 -0
- package/package.json +25 -25
- package/skills/void/SKILL.md +3 -1
- package/dist/action-key-XtKKbbsi.mjs +0 -25
- package/dist/client-BAxLpSKv.mjs +0 -1
- package/dist/deploy-DEZkUS77.mjs +0 -2
- package/dist/discover-1DJD4YXD.mjs +0 -1
- package/dist/gen-C6iknRdI.mjs +0 -1
- package/dist/help-C_cqTByy.mjs +0 -1
- package/dist/load-user-env-CSwdofj0.mjs +0 -48
- package/dist/login-C4q1S-5b.mjs +0 -1
- package/dist/migrate-CVBsSFhC.mjs +0 -1
- package/dist/operator-cmd-DnaCnCSP.mjs +0 -1
- package/dist/output-CNsMDEd2.mjs +0 -1
- package/dist/platform-args-B7-wQ0_B.mjs +0 -1
- package/dist/prepare-Bx4a8cb1.mjs +0 -1
- package/dist/resolve-project-BALVa9q0.mjs +0 -1
- package/dist/url-CuoEn0o3.mjs +0 -43
- package/dist/wrangler-R3kMdJfw.mjs +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/pages/action-key.ts
|
|
2
|
+
const actionKeyRequests = /* @__PURE__ */ new WeakSet();
|
|
3
|
+
function markActionKey(request) {
|
|
4
|
+
actionKeyRequests.add(request);
|
|
5
|
+
}
|
|
6
|
+
function hasActionKey(request) {
|
|
7
|
+
return actionKeyRequests.has(request);
|
|
8
|
+
}
|
|
9
|
+
/** The first non-empty segment of `search` as sent: `delete` in `?delete&page=2`. */
|
|
10
|
+
function actionKeySegment(search) {
|
|
11
|
+
let start = 1;
|
|
12
|
+
while (search[start] === "&") start++;
|
|
13
|
+
const end = search.indexOf("&", start);
|
|
14
|
+
return search.slice(start, end === -1 ? search.length : end);
|
|
15
|
+
}
|
|
16
|
+
/** `search` without its first non-empty segment; the rest is kept as sent. */
|
|
17
|
+
function searchWithoutActionKey(search) {
|
|
18
|
+
let start = 1;
|
|
19
|
+
while (search[start] === "&") start++;
|
|
20
|
+
let rest = search.indexOf("&", start);
|
|
21
|
+
if (rest === -1) return "";
|
|
22
|
+
while (search[rest] === "&") rest++;
|
|
23
|
+
return rest < search.length ? "?" + search.slice(rest) : "";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Names the page query that an action request carries only because it posts
|
|
27
|
+
* to the page it runs on. Redirects leave that query out.
|
|
28
|
+
*/
|
|
29
|
+
const PRESERVED_QUERY_HEADER = "X-VoidPages-Preserved-Query";
|
|
30
|
+
function queryKey(segment) {
|
|
31
|
+
return new URLSearchParams(segment).keys().next().value;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* For an action URL on the page's own path, `url` with the page's query
|
|
35
|
+
* parameters after its own. A key the action URL names wins over the page's.
|
|
36
|
+
* `preserved` is the query that was added, as sent.
|
|
37
|
+
*/
|
|
38
|
+
function withPageQuery(url, page) {
|
|
39
|
+
const hashIndex = url.indexOf("#");
|
|
40
|
+
const base = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
41
|
+
const q = base.indexOf("?");
|
|
42
|
+
if (!page.search || base.slice(0, q === -1 ? base.length : q) !== page.pathname) return {
|
|
43
|
+
url,
|
|
44
|
+
preserved: ""
|
|
45
|
+
};
|
|
46
|
+
const own = new Set(new URLSearchParams(q === -1 ? "" : base.slice(q + 1)).keys());
|
|
47
|
+
const preserved = page.search.slice(1).split("&").filter((segment) => segment !== "" && !own.has(queryKey(segment))).join("&");
|
|
48
|
+
if (!preserved) return {
|
|
49
|
+
url,
|
|
50
|
+
preserved
|
|
51
|
+
};
|
|
52
|
+
const query = q === -1 || q === base.length - 1 ? "?" : base.slice(q) + "&";
|
|
53
|
+
return {
|
|
54
|
+
url: base.slice(0, q === -1 ? base.length : q) + query + preserved + url.slice(base.length),
|
|
55
|
+
preserved
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** `search` without the page query that `withPageQuery()` added to its end. */
|
|
59
|
+
function searchWithoutPreservedQuery(search, preserved) {
|
|
60
|
+
if (!preserved) return search;
|
|
61
|
+
if (search === "?" + preserved) return "";
|
|
62
|
+
return search.endsWith("&" + preserved) ? search.slice(0, -preserved.length - 1) : search;
|
|
63
|
+
}
|
|
64
|
+
// src/pages/url.ts
|
|
65
|
+
function isSameOrigin(url, origin) {
|
|
66
|
+
if (url.protocol === "capacitor:") {
|
|
67
|
+
const current = new URL(origin);
|
|
68
|
+
return current.protocol === "capacitor:" && url.host !== "" && url.host === current.host;
|
|
69
|
+
}
|
|
70
|
+
return url.origin === origin;
|
|
71
|
+
}
|
|
72
|
+
function isHexDigit(char) {
|
|
73
|
+
return char !== void 0 && (char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F");
|
|
74
|
+
}
|
|
75
|
+
function tryDecodeURI(text) {
|
|
76
|
+
try {
|
|
77
|
+
return decodeURI(text);
|
|
78
|
+
} catch {
|
|
79
|
+
return text;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The path a page is matched on, decoded the way the server (Hono's getPath)
|
|
84
|
+
* decodes it: `/caf%C3%A9` becomes `/café`, while `%25`, reserved escapes such
|
|
85
|
+
* as `%2F` and malformed escapes stay encoded.
|
|
86
|
+
*/
|
|
87
|
+
function decodePagePath(path) {
|
|
88
|
+
if (!path.includes("%")) return path;
|
|
89
|
+
const escaped = path.split("%25").join("%2525");
|
|
90
|
+
try {
|
|
91
|
+
return decodeURI(escaped);
|
|
92
|
+
} catch {}
|
|
93
|
+
let decoded = "";
|
|
94
|
+
let index = 0;
|
|
95
|
+
while (index < escaped.length) {
|
|
96
|
+
let end = index;
|
|
97
|
+
while (escaped[end] === "%" && isHexDigit(escaped[end + 1]) && isHexDigit(escaped[end + 2])) end += 3;
|
|
98
|
+
if (end === index) decoded += escaped[index++];
|
|
99
|
+
else {
|
|
100
|
+
decoded += tryDecodeURI(escaped.slice(index, end));
|
|
101
|
+
index = end;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return decoded;
|
|
105
|
+
}
|
|
106
|
+
export { hasActionKey as a, searchWithoutActionKey as c, actionKeySegment as i, searchWithoutPreservedQuery as l, isSameOrigin as n, markActionKey as o, PRESERVED_QUERY_HEADER as r, queryKey as s, decodePagePath as t, withPageQuery as u };
|
|
@@ -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-B1gkT_wC.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 = [
|
|
@@ -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-
|
|
3
|
-
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-
|
|
4
|
-
import { h as validateConfig, p as readConfig } from "./config-
|
|
2
|
+
import { a as persistCloudflareConfig, i as materializeCloudflareConfig, r as ignoreMaterializedCloudflareConfig } from "./cloudflare-config-PxbinLLE.mjs";
|
|
3
|
+
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-CUhCPMpK.mjs";
|
|
4
|
+
import { h as validateConfig, p as readConfig } from "./config-CzFdJYNA.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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as readRootWranglerConfig } from "./wrangler-B1gkT_wC.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
3
|
-
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-
|
|
4
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
2
|
+
import { l as getDatabaseDialect, p as readConfig } from "./config-CzFdJYNA.mjs";
|
|
3
|
+
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-BBfb519j.mjs";
|
|
4
|
+
import { n as readProjectPaths } from "./project-paths-CUhCPMpK.mjs";
|
|
5
5
|
import { t as WORKER_CONDITIONS } from "./worker-conditions-CBZ0RYsZ.mjs";
|
|
6
6
|
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
7
7
|
import { n as isIdentifier, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as StandardSchemaV1 } from "./standard-schema-CuDawHOC.mjs";
|
|
2
|
-
import { i as AuthUser } from "./auth-
|
|
3
|
-
import { a as CloudEnv } from "./handler-
|
|
2
|
+
import { i as AuthUser } from "./auth-CV9kXHKe.mjs";
|
|
3
|
+
import { a as CloudEnv } from "./handler-6fzr_ikp.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
|
|
|
@@ -141,7 +142,7 @@ const result = await ai.run('google/gemini-2.5-flash', {
|
|
|
141
142
|
});
|
|
142
143
|
```
|
|
143
144
|
|
|
144
|
-
Pass AI Gateway options as the third argument: `ai.run(model, inputs, { gateway: { skipCache: true } })`. On a team platform, the platform chooses the gateway and sets its metadata and logging; options such as `skipCache` and `cacheTtl` still apply.
|
|
145
|
+
Pass AI Gateway options as the third argument: `ai.run(model, inputs, { gateway: { skipCache: true } })`. On a team platform, the platform chooses the gateway and sets its metadata and logging; options such as `skipCache` and `cacheTtl` still apply. The platform's logging setting also covers `void dev` in a linked project; an unlinked project uses your own Cloudflare account and its gateway settings.
|
|
145
146
|
|
|
146
147
|
For provider-native requests on a direct deployment, configure [`ai.gateway`](../integrations/cloudflare.md#ai-self-host).
|
|
147
148
|
|
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
|
|
|
@@ -37,9 +38,9 @@ await auth.signIn.email({
|
|
|
37
38
|
});
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
### 3. Protect a server route
|
|
41
|
+
### 3. Protect a server route {#protect-a-server-route}
|
|
41
42
|
|
|
42
|
-
Call `requireAuth` in a route handler or
|
|
43
|
+
Call `requireAuth` in a route handler or action to get the signed-in user or reject unauthenticated requests with `401`:
|
|
43
44
|
|
|
44
45
|
```ts
|
|
45
46
|
// routes/api/profile.ts
|
|
@@ -52,21 +53,29 @@ export const GET = defineHandler((c) => {
|
|
|
52
53
|
});
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
In a
|
|
56
|
+
In a page loader, pass `throwRedirect` to send unauthenticated visitors to your login page instead of a plain-text `401`:
|
|
56
57
|
|
|
57
58
|
```ts
|
|
58
59
|
// pages/dashboard.server.ts
|
|
59
60
|
import { defineHandler, type InferProps } from 'void';
|
|
60
|
-
import {
|
|
61
|
+
import { requireAuth } from 'void/auth';
|
|
61
62
|
|
|
62
63
|
export type Props = InferProps<typeof loader>;
|
|
63
64
|
|
|
64
|
-
export const loader = defineHandler(() => {
|
|
65
|
-
const user =
|
|
65
|
+
export const loader = defineHandler((c) => {
|
|
66
|
+
const user = requireAuth(c, {
|
|
67
|
+
throwRedirect: '/login',
|
|
68
|
+
});
|
|
66
69
|
return { user };
|
|
67
70
|
});
|
|
68
71
|
```
|
|
69
72
|
|
|
73
|
+
The same option works in actions and middleware. It throws a redirect, stopping execution: `302` for GET/HEAD requests and `303` for other methods. Document requests follow the redirect normally; Pages client navigation follows it without reloading the document.
|
|
74
|
+
|
|
75
|
+
Signing in does not replay a rejected action.
|
|
76
|
+
|
|
77
|
+
To allow unauthenticated access, use `getUser()` and return the nullable user. For custom guards, you can also [throw a redirect](../integrations/hono.md#redirects) from a helper.
|
|
78
|
+
|
|
70
79
|
### 4. Sign out
|
|
71
80
|
|
|
72
81
|
```tsx
|
|
@@ -118,25 +127,16 @@ import { getSession, getUser, requireAuth } from 'void/auth';
|
|
|
118
127
|
- `getUser()` returns the current `AuthUser | null`
|
|
119
128
|
- `getSession()` returns `{ user, session } | null`
|
|
120
129
|
- `requireAuth(c)` returns the authenticated user or throws `401`
|
|
130
|
+
- `requireAuth(c, { throwRedirect: '/login' })` returns the user or throws a login redirect
|
|
121
131
|
- [`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.
|
|
122
132
|
|
|
123
133
|
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).
|
|
124
134
|
|
|
125
135
|
## Querying Authentication Tables
|
|
126
136
|
|
|
127
|
-
|
|
128
|
-
The generated file exports the core authentication tables:
|
|
129
|
-
|
|
130
|
-
- `userTable`
|
|
131
|
-
- `sessionTable`
|
|
132
|
-
- `accountTable`
|
|
133
|
-
- `verificationTable`
|
|
137
|
+
To query users or reference them from your own tables, import Void's generated authentication schema. It exports `userTable`, `sessionTable`, `accountTable`, `verificationTable`, and any tables added by your Better Auth plugins.
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
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.
|
|
138
|
-
|
|
139
|
-
To import these tables into your application, add a TypeScript path alias to your root `tsconfig.json`:
|
|
139
|
+
Add an alias to your root `tsconfig.json`:
|
|
140
140
|
|
|
141
141
|
```json
|
|
142
142
|
{
|
|
@@ -148,11 +148,9 @@ To import these tables into your application, add a TypeScript path alias to you
|
|
|
148
148
|
}
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Keep your other path aliases, including any you use from `.void/tsconfig.json`, such as `@schema`.
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
You can now import and query authentication tables:
|
|
153
|
+
You can now query users with Drizzle:
|
|
156
154
|
|
|
157
155
|
```ts
|
|
158
156
|
import { userTable } from '@auth-schema';
|
|
@@ -163,7 +161,7 @@ export function listUsers() {
|
|
|
163
161
|
}
|
|
164
162
|
```
|
|
165
163
|
|
|
166
|
-
|
|
164
|
+
To associate a post with its author, reference `userTable.id`:
|
|
167
165
|
|
|
168
166
|
```ts
|
|
169
167
|
import { userTable } from '@auth-schema';
|
|
@@ -177,11 +175,9 @@ export const postTable = sqliteTable('post', {
|
|
|
177
175
|
});
|
|
178
176
|
```
|
|
179
177
|
|
|
180
|
-
This example
|
|
181
|
-
|
|
182
|
-
The example above uses SQLite/D1. For PostgreSQL and MySQL, use the corresponding schema modules: `void/schema-pg` and `void/schema-mysql`.
|
|
178
|
+
This example uses D1 and the default text IDs. For PostgreSQL or MySQL, use `void/schema-pg` or `void/schema-mysql`. With `advanced.database.generateId: 'serial'`, use an integer foreign key.
|
|
183
179
|
|
|
184
|
-
|
|
180
|
+
Void regenerates `.void/better-auth-schema.ts`. Configure authentication in `auth.ts` rather than editing the generated file.
|
|
185
181
|
|
|
186
182
|
## Behavior
|
|
187
183
|
|
|
@@ -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,23 @@ 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
|
|
46
|
+
Replicas can lag between requests. Authentication checks use the primary so a lagging replica can't accept a revoked session. For other reads that need the latest primary data, create a client inside the request:
|
|
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
|
+
With `session: 'first-primary'`, the first query reads from the primary and later queries see at least the same data. The default, `'first-unconstrained'`, allows the first query to use a replica.
|
|
61
|
+
|
|
62
|
+
For raw D1 calls or another query library, use `withSession()` to read from replicas. A bare D1 binding reads from the primary.
|
|
46
63
|
|
|
47
64
|
## Alternative Query Layers
|
|
48
65
|
|
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
|
|
|
@@ -387,36 +388,38 @@ See the [CLI reference](../reference/cli/database.md#database) for connection se
|
|
|
387
388
|
|
|
388
389
|
## Adopt an existing Drizzle PostgreSQL database {#adopt-existing-drizzle}
|
|
389
390
|
|
|
390
|
-
|
|
391
|
+
To use Void with a PostgreSQL database that Drizzle has already migrated, record its applied migrations before your first deployment:
|
|
391
392
|
|
|
392
393
|
1. Back up the database and pause deployments. Try the procedure on a restored copy first.
|
|
393
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.
|
|
394
|
-
3.
|
|
395
|
-
|
|
396
|
-
```sql
|
|
397
|
-
SELECT hash, created_at FROM drizzle.__drizzle_migrations ORDER BY created_at;
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
395
|
+
3. Read Drizzle's migration history. The default table is `drizzle.__drizzle_migrations`; use your configured schema and table if different.
|
|
396
|
+
|
|
397
|
+
```sql
|
|
398
|
+
SELECT hash, created_at FROM drizzle.__drizzle_migrations ORDER BY created_at;
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Match each row's `created_at` to `when` in `meta/_journal.json`, and its `hash` to the SQL file's SHA-256. Resolve any differences before continuing.
|
|
402
|
+
|
|
403
|
+
4. Save this as `adopt-void.sql`. Replace the example filenames with **only the migrations you verified as applied**, including `.sql`. Leave pending migrations out.
|
|
404
|
+
|
|
405
|
+
```sql [adopt-void.sql]
|
|
406
|
+
BEGIN;
|
|
407
|
+
CREATE TABLE IF NOT EXISTS _void_migrations (
|
|
408
|
+
name TEXT PRIMARY KEY,
|
|
409
|
+
applied_at TEXT NOT NULL
|
|
410
|
+
);
|
|
411
|
+
INSERT INTO _void_migrations (name, applied_at)
|
|
412
|
+
VALUES
|
|
413
|
+
('0000_create_users.sql', CURRENT_TIMESTAMP::text),
|
|
414
|
+
('0001_add_email.sql', CURRENT_TIMESTAMP::text)
|
|
415
|
+
ON CONFLICT (name) DO NOTHING;
|
|
416
|
+
COMMIT;
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
5. Run the file with your PostgreSQL client, stopping on errors. Use the database and search path Void will use. This records the filenames without running their SQL or changing Drizzle's history.
|
|
420
|
+
6. Connect Void to the database and run `void db status`. Only new migrations should be pending. For direct Cloudflare deployments, set `DATABASE_URL` in the shell or CI environment that runs `void deploy`.
|
|
421
|
+
|
|
422
|
+
Repeat these steps for each database; development and production may have different migration histories. Keep Drizzle's history table, and use Void for future migrations.
|
|
420
423
|
|
|
421
424
|
## Hand-written migrations {#hand-written-migrations}
|
|
422
425
|
|
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,13 +36,13 @@ 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
|
|
|
38
|
-
|
|
39
|
+
If you run migrations in a separate release step, or a preview shares your database, deploy without applying SQL migrations:
|
|
39
40
|
|
|
40
41
|
```sh
|
|
41
42
|
void deploy --skip-migrations
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
The app must work with the database's current schema. Both deployment destinations support this option, and the next deploy without it applies pending migrations. See [`--skip-migrations`](../reference/cli/deploy.md#void-deploy) for requirements and [`void db migrate`](../reference/cli/database.md#void-db-migrate) to apply migrations separately.
|
|
45
46
|
|
|
46
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.
|
|
47
48
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Set custom response headers from void.config.ts. Match URL patterns to header names and values.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -24,8 +25,8 @@ Define custom response headers in [`void.config.ts`](../../reference/config) usi
|
|
|
24
25
|
- **Header values** use `Name: value` format. The value may contain colons.
|
|
25
26
|
- All matching rules are merged. When multiple rules set the same header name, the **last match wins**.
|
|
26
27
|
- User-defined `Cache-Control` overrides the built-in default. The default still applies when no rule matches.
|
|
27
|
-
- With [authentication](../auth.md), responses to requests
|
|
28
|
-
- Rules apply to
|
|
28
|
+
- With [authentication](../auth.md), responses to requests with cookies or credentials stay private, and auth endpoints stay uncached, in development, on direct Cloudflare deployments, and on [other runtimes](../deployment.md#other-runtimes). On a [Void platform](../deployment.md#deploy-to-a-team-platform), header rules can replace those cache settings. Keep public cache rules away from signed-in pages and `/api/auth/*`.
|
|
29
|
+
- Rules also apply to errors, including 404s. Use immutable caching only for URLs that change with their content, so a missing file isn't cached under a permanent URL.
|
|
29
30
|
|
|
30
31
|
## Scope
|
|
31
32
|
|
|
@@ -47,4 +48,4 @@ During local development, with `void deploy --platform cloudflare`, and on [othe
|
|
|
47
48
|
|
|
48
49
|
On a Void platform, Void reads `_headers` files produced by supported frameworks. Your `routing.headers` rules run afterward, so they can override framework defaults.
|
|
49
50
|
|
|
50
|
-
For
|
|
51
|
+
For direct Cloudflare framework deployments, put `_headers` in your framework's public asset directory. Its rules apply to static files, including when a deployment preserves existing secrets. To set headers on Worker responses, use your framework's server code.
|
|
@@ -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,7 +23,7 @@ Pages without dynamic params do not need `getPrerenderPaths()`.
|
|
|
22
23
|
|
|
23
24
|
## Dynamic pages (with params)
|
|
24
25
|
|
|
25
|
-
For
|
|
26
|
+
For a dynamic page, export `getPrerenderPaths()` to choose which paths to render. Annotate its return type with [`PageParams`](../../reference/api/types.md#route-types) so TypeScript checks the parameter names:
|
|
26
27
|
|
|
27
28
|
```ts
|
|
28
29
|
// pages/blog/[slug].server.ts
|
|
@@ -30,12 +31,14 @@ import type { PageParams } from 'void/routes';
|
|
|
30
31
|
|
|
31
32
|
export const prerender = true;
|
|
32
33
|
|
|
33
|
-
export async function getPrerenderPaths(): Promise<PageParams<'/blog
|
|
34
|
+
export async function getPrerenderPaths(): Promise<PageParams<'/blog/[slug]'>[]> {
|
|
34
35
|
return [{ slug: 'hello-world' }, { slug: 'getting-started' }];
|
|
35
36
|
}
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
Return an object for each path, with every required parameter. Values can be strings or numbers; Void URL-encodes them. Use a catch-all page such as `pages/docs/[...slug]` for values containing `/`, for example `{ slug: 'guides/intro' }`.
|
|
40
|
+
|
|
41
|
+
The type annotation is required for TypeScript to check the keys. At deployment, Void reports invalid entries with their server filename and index.
|
|
39
42
|
|
|
40
43
|
## Custom SSR
|
|
41
44
|
|
|
@@ -50,8 +53,6 @@ export async function getPrerenderPaths(): Promise<string[]> {
|
|
|
50
53
|
}
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
Annotate this return type as an array of path strings. Use `PageParams` on file-based pages, where the function returns param objects.
|
|
54
|
-
|
|
55
56
|
## Relationship to revalidation
|
|
56
57
|
|
|
57
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: 'Redirect requests from void.config.ts. Map a source pattern to a destination and an optional status code.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -23,7 +24,7 @@ Define URL redirects in [`void.config.ts`](../../reference/config) using the `ro
|
|
|
23
24
|
- **Destinations** can be strings (default `302`) or objects with `to` and optional `status`. Supported statuses: `301`, `302`, `303`, `307`, `308`.
|
|
24
25
|
- `:splat` in the destination is replaced with the portion of the path matched by `*` in the source pattern.
|
|
25
26
|
- Destination query strings are merged into the `Location` header (the destination's parameters take precedence on per-key conflict). To drop the incoming query, write an explicit reset like `?`.
|
|
26
|
-
-
|
|
27
|
+
- For redirects from a handler, loader, or middleware, use [`c.redirect()`](../../reference/api/rewrites.md#c-rewrite-destination). It sends the location you provide without adding the request query. Named actions keep their own query parameters and drop the action key when redirecting to GET.
|
|
27
28
|
- When multiple rules match, the **first match wins**. Put specific patterns before catch-all patterns.
|
|
28
29
|
- Redirects are evaluated **before** the request reaches the worker, so they short-circuit static asset serving, ISR, and SSR.
|
|
29
30
|
|
|
@@ -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 such as `3600` directly in the export. Expressions such as `60 * 60` and re-exports are ignored with 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).
|
|
@@ -106,6 +109,8 @@ Responses that vary by request headers, such as `Vary: Accept-Language` or `Vary
|
|
|
106
109
|
|
|
107
110
|
Requests with `Cookie`, `Authorization`, or Cloudflare Access's `Cf-Access-Jwt-Assertion` header bypass the ISR cache entirely and always dispatch to the worker. Authenticated responses are not shared between users, including when Access authentication supplies no cookie.
|
|
108
111
|
|
|
112
|
+
A request that negotiates a representation other than the cached HTML document also bypasses the cache, because each path holds a single cached body. That covers `Accept: text/event-stream` and `Accept: text/markdown`, so middleware that answers those requests in another format runs on every request.
|
|
113
|
+
|
|
109
114
|
## Cache keys and rewrites
|
|
110
115
|
|
|
111
116
|
For a dispatch rewrite, the cache key includes both the destination and original pathname. A direct request to `/en/docs/foo` therefore uses a different entry from `/docs/foo` rewritten to that destination.
|
|
@@ -135,4 +140,4 @@ export const POST = defineHandler(async (c) => {
|
|
|
135
140
|
});
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
With [`routing.typedRoutes`](../../reference/config.md#routing-typedroutes)
|
|
143
|
+
With [`routing.typedRoutes`](../../reference/config.md#routing-typedroutes), TypeScript checks each path against your routes. For a path you validate at runtime, use `as RouteUrl` from `void/routes` to skip the type check.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Serve one route at another URL without changing the address in the browser.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -56,7 +57,7 @@ Keep access checks on any destination that needs them.
|
|
|
56
57
|
|
|
57
58
|
A destination without `?` preserves the incoming query string. `c.rewrite('/search')` keeps `?q=...`, while `c.rewrite('/search?q=all')` replaces it.
|
|
58
59
|
|
|
59
|
-
Your editor suggests known routes through
|
|
60
|
+
Your editor suggests known routes through [`RewriteDestination`](../../reference/api/rewrites.md#rewritedestination). Enable [`routing.typedRoutes`](../../reference/config.md#routing-typedroutes) to reject strings that don't match a route. For a path you build at runtime, import `RouteUrl` from `void/routes` and use a cast, such as ``c.rewrite(`/en${c.req.path}` as RouteUrl)``.
|
|
60
61
|
|
|
61
62
|
### Runtime rewrites cannot reach static assets
|
|
62
63
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: "Cache static assets on Cloudflare's edge. Hashed build files stay reusable across deploys."
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -90,6 +91,10 @@ Choose `single-page-application`, `404-page`, or `none`. These settings preserve
|
|
|
90
91
|
|
|
91
92
|
SvelteKit, Nuxt, Analog, and Astro handle their own error pages and ignore `routing.notFound`. For direct Cloudflare deployment with TanStack Start, React Router, or vinext, configure the asset binding, directory, and routing policy through the framework's Cloudflare config.
|
|
92
93
|
|
|
94
|
+
On direct Cloudflare deployments, SvelteKit, Nuxt, Analog, and Astro serve built files and prerendered pages without running the Worker. Other requests reach the framework.
|
|
95
|
+
|
|
96
|
+
To run server code before serving an asset, set [`run_worker_first`](https://developers.cloudflare.com/workers/static-assets/binding/#run_worker_first) under `cloudflare.assets` in `void.config.ts`. Setting it to `true` runs the Worker on every request and counts toward Worker request usage.
|
|
97
|
+
|
|
93
98
|
## API routes and SSR pages
|
|
94
99
|
|
|
95
100
|
API responses and SSR pages are not cached as static assets. Use [Revalidation](./revalidation) to cache public rendered pages.
|
|
@@ -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.
|