void 1.7.0 → 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-BfkJ_1PC.mjs → account-cmd-CZKntRH2.mjs} +5 -5
- package/dist/action-key-ByZ6DDld.mjs +64 -0
- package/dist/{application-analysis-OV0CBJ80.mjs → application-analysis-CyTagJQM.mjs} +25 -5
- package/dist/{application-routing-QpyC5G8z.mjs → application-routing-BLrMVpqi.mjs} +1 -1
- package/dist/{auth-CZrthGxs.d.mts → auth-Bk9VGtQW.d.mts} +1 -1
- package/dist/{auth-link-CW1Zh6FM.mjs → auth-link-BOaQWMKw.mjs} +5 -5
- package/dist/{auth-router-CNBKnEZi.mjs → auth-router-D0-VcmDs.mjs} +3 -3
- package/dist/{better-auth-shared-C-0uZg8-.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
- package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
- package/dist/{build-cmd-C9qOKW9W.mjs → build-cmd-JTsXXf2F.mjs} +4 -4
- package/dist/{cache-DVBBbWQL.mjs → cache-D0m3Z_Xf.mjs} +4 -4
- package/dist/{cancel-deploy-COavnjud.mjs → cancel-deploy-Ce6Os4fa.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 +2 -2
- package/dist/{cli-main-DFteHrJI.mjs → cli-main-rkrJy2Ge.mjs} +32 -32
- package/dist/client-D1Vz1Zep.mjs +1 -0
- package/dist/{client-BEZmTP6p.mjs → client-SZPyj4X_.mjs} +1 -1
- package/dist/{cloudflare-auth-DGIivpTb.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
- package/dist/{cloudflare-cmd-DJaxC-bc.mjs → cloudflare-cmd-ChPLQcTP.mjs} +4 -4
- package/dist/{cloudflare-connect-BjpWmglw.mjs → cloudflare-connect-Co93VYTo.mjs} +2 -2
- package/dist/{cloudflare-operations-k7wYUv56.mjs → cloudflare-operations-CXaDKYj2.mjs} +4 -4
- package/dist/{cloudflare-operations-CZkjFrzH.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
- package/dist/{cloudflare-process-BcPvlMFd.mjs → cloudflare-process-DmTxZR-N.mjs} +1 -1
- package/dist/{connect-j1F1C_rW.mjs → connect-DlvXt1JR.mjs} +6 -6
- package/dist/{create-project-CE3jOmd5.mjs → create-project-CC_7hmYJ.mjs} +4 -4
- package/dist/{create-project-DZH3aYGQ.mjs → create-project-DzY05xqC.mjs} +1 -1
- package/dist/{db-DyLzzxvM.mjs → db-FhyYGcJJ.mjs} +13 -13
- package/dist/{db-types-DdHHUVPy.mjs → db-types-sVwEpyPR.mjs} +3 -1
- package/dist/{delete-Dey6YoMA.mjs → delete-CModjyOC.mjs} +4 -4
- package/dist/{deploy-Ccw2D2lw.mjs → deploy-Cz9TEzZy.mjs} +34 -24
- package/dist/deploy-DMieisRu.mjs +2 -0
- package/dist/{deploy-managed-static-BBVtpuGv.mjs → deploy-managed-static-DlxxXkAM.mjs} +10 -10
- package/dist/{deploy-transport-Dt0IvSVW.mjs → deploy-transport-DUvm6-CR.mjs} +2 -2
- package/dist/deploy.mjs +5 -5
- package/dist/{dispatch-pYaww76u.mjs → dispatch-CCiaAnSK.mjs} +4 -4
- 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-DvdZPA50.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-ASpNrfLd.mjs} +7 -7
- package/dist/{email-cloudflare-CTt2n_W2.mjs → email-cloudflare-kqoN9jst.mjs} +13 -8
- package/dist/{entry-Bw-G1VVx.mjs → entry-BweGTCgj.mjs} +1 -1
- package/dist/{env-DkZzh_Dd.mjs → env-Bpkg3G5i.mjs} +5 -5
- 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-validation-1snjKtDX.mjs → env-validation-BpCCQE_6.mjs} +3 -3
- package/dist/{env-validation-C8NL3lEH.mjs → env-validation-CN386Utu.mjs} +1 -1
- package/dist/gen-M5fNQKfH.mjs +1 -0
- package/dist/{gen-BZmFOGDQ.mjs → gen-upKJChvd.mjs} +3 -3
- package/dist/{github-cmd-7Oky9qgH.mjs → github-cmd-BvMOlb8Z.mjs} +4 -4
- package/dist/{handler-DjqciiDc.d.mts → handler-BO7Od-z9.d.mts} +3 -2
- package/dist/{headers-CimYIfQI.mjs → headers-COGEDoMN.mjs} +10 -1
- package/dist/help-CItQVDL4.mjs +1 -0
- package/dist/{help-CNuUb47C.mjs → help-TPCjTu6e.mjs} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +247 -178
- package/dist/{info-DwB8IWIx.mjs → info-EsDyihwf.mjs} +2 -2
- package/dist/{init-CUGSmcED.mjs → init-a4lVagrb.mjs} +13 -14
- package/dist/{link-BlRTGHan.mjs → link-CE55DDzS.mjs} +5 -5
- package/dist/{list-iCg7d5Pa.mjs → list-CxRthQks.mjs} +5 -5
- package/dist/{live-zKGbRT4h.d.mts → live-Kc55iuOQ.d.mts} +2 -2
- package/dist/{login-TA51e5Fw.mjs → login-AfcSGSmE.mjs} +4 -4
- package/dist/login-ZHsAm-I6.mjs +1 -0
- package/dist/{logs-BlyAxlvx.mjs → logs-BgRJuvb1.mjs} +4 -4
- package/dist/{migrate-BH6LCr00.mjs → migrate-BNAh6m_C.mjs} +2 -2
- package/dist/migrate-BflbbZQK.mjs +1 -0
- package/dist/nitro.mjs +2 -2
- package/dist/{node-B0otYjDv.mjs → node-CXFUw0Uz.mjs} +2 -2
- package/dist/{operator-args-DuKAQ3Ks.mjs → operator-args-DGTuCdSE.mjs} +8 -0
- package/dist/{operator-cmd-CoHlJjcT.mjs → operator-cmd-C-viB7Si.mjs} +4 -4
- package/dist/operator-cmd-D6qNuJ_z.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 +132 -15
- package/dist/pages/index.d.mts +3 -2
- package/dist/pages/index.mjs +2 -2
- 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/{platform-args-DfT8yQBF.mjs → platform-args-CiYeZmc5.mjs} +1 -1
- package/dist/platform-args-DJvF1-kl.mjs +1 -0
- package/dist/{platform-auth-config-MO0VdVs9.mjs → platform-auth-config-Dt2qEc2w.mjs} +6 -6
- package/dist/{platform-auth-protection-Dv208eyL.mjs → platform-auth-protection-B7TaF-PZ.mjs} +4 -4
- package/dist/{platform-auth-recovery-DvAQ674F.mjs → platform-auth-recovery-suXSteJ6.mjs} +4 -4
- package/dist/{platform-cmd-dlSxrcQ7.mjs → platform-cmd-9rvYBBtr.mjs} +7 -7
- package/dist/{platform-cmd-BpUA19r_.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
- package/dist/{platform-domain-DSO4eUEw.mjs → platform-domain-DhH_vDr6.mjs} +4 -4
- package/dist/{platform-lifecycle-CfcFygHb.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
- package/dist/{platform-lifecycle-BSvsyB_x.mjs → platform-lifecycle-CXmXe2xt.mjs} +13 -13
- package/dist/{platform-management-CrP1XhVd.mjs → platform-management-BBCHfwji.mjs} +3 -3
- package/dist/{platform-management-BMdyt667.mjs → platform-management-PdrgDQTe.mjs} +1 -1
- package/dist/{platform-plans-config-CgDiwflR.mjs → platform-plans-config-BGwkXYDM.mjs} +2 -2
- package/dist/{platform-recovery-CHWwXVZ6.mjs → platform-recovery-C8NxXGRR.mjs} +2 -2
- package/dist/{platform-setup-BTQVbnTC.mjs → platform-setup-Casiffqj.mjs} +2 -2
- package/dist/{plugin-inference-g66Q1Mx9.mjs → plugin-inference-CErfTgEx.mjs} +3 -3
- package/dist/{prepare-DXduEwQp.mjs → prepare-BDKWZgfL.mjs} +5 -5
- package/dist/{prepare-DJYHjpzq.mjs → prepare-BLrzXjIl.mjs} +3 -3
- package/dist/prepare-a1_5usAn.mjs +1 -0
- 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-DzGvxXKH.mjs} +17 -17
- package/dist/{project-team-BO2dyc7S.mjs → project-team-C5XtHbZk.mjs} +4 -4
- package/dist/{project-token-ByO2mEI2.mjs → project-token-B4D5yhHQ.mjs} +4 -4
- package/dist/{project-zero-trust-CoQfwRBR.mjs → project-zero-trust--0LvktDg.mjs} +4 -4
- package/dist/{protocol-yxdHxFLN.mjs → protocol-B1Tvc9-x.mjs} +191 -69
- package/dist/{protocol-xZMvWsrg.d.mts → protocol-Cg2I81NA.d.mts} +9 -2
- package/dist/{provision-D5q-ptD3.mjs → provision-C3yiHdld.mjs} +1 -1
- package/dist/{provision-CMH4-8ri.mjs → provision-CAcrauvr.mjs} +1 -1
- package/dist/{requests-CPOiDkjh.mjs → requests-CrRiTgQA.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-BsmQyj-Q.mjs} +4 -4
- package/dist/{route-types-Cl3x0Q8B.mjs → route-types-CgtlFCDz.mjs} +3 -2
- package/dist/routes-stub.d.mts +4 -3
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +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.d.mts +1 -1
- package/dist/runtime/routing.d.mts +8 -3
- package/dist/runtime/routing.mjs +161 -21
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-L8OSv1f7.mjs → scan-BJ3bj6aP.mjs} +228 -27
- package/dist/{secret-CuI6LTpD.mjs → secret-D0g5oBsP.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/{wrapper-BGsi_uHs.mjs → wrapper-CVMZarxf.mjs} +1 -1
- package/dist/{ws-DB8Feytg.d.mts → ws--U7QicYy.d.mts} +2 -2
- package/docs/guide/ai.md +1 -0
- package/docs/guide/app-types.md +1 -0
- package/docs/guide/auth.md +1 -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 +1 -0
- package/docs/guide/deployment.md +1 -0
- package/docs/guide/durable-state.md +1 -0
- package/docs/guide/edge/headers.md +1 -0
- package/docs/guide/edge/prerendering.md +1 -0
- package/docs/guide/edge/redirects.md +1 -0
- package/docs/guide/edge/revalidation.md +3 -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 +1 -0
- package/docs/guide/pages-routing/actions-and-forms.md +36 -18
- package/docs/guide/pages-routing/errors.md +101 -0
- package/docs/guide/pages-routing/head.md +1 -0
- package/docs/guide/pages-routing/islands.md +1 -0
- package/docs/guide/pages-routing/layouts.md +3 -0
- package/docs/guide/pages-routing/loaders.md +1 -0
- package/docs/guide/pages-routing/markdown.md +1 -1
- package/docs/guide/pages-routing/overview.md +3 -0
- 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 +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 +1 -0
- package/docs/guide/sse.md +1 -0
- package/docs/guide/ssg.md +1 -0
- package/docs/guide/ssr.md +1 -0
- package/docs/guide/storage.md +1 -0
- package/docs/guide/testing.md +62 -0
- package/docs/guide/type-safety.md +1 -0
- 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 +1 -0
- package/docs/integrations/frameworks/analog.md +1 -0
- package/docs/integrations/frameworks/astro.md +1 -0
- package/docs/integrations/frameworks/nuxt.md +1 -0
- 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 +1 -0
- package/docs/integrations/nodejs-bun-deno.md +1 -0
- package/docs/reference/api/auth.md +1 -0
- 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 +22 -4
- package/docs/reference/api/plugin.md +1 -0
- package/docs/reference/api/resources.md +1 -0
- package/docs/reference/api/rewrites.md +2 -1
- package/docs/reference/api/types.md +1 -0
- package/docs/reference/api.md +1 -0
- package/docs/reference/cli/auth.md +1 -0
- package/docs/reference/cli/database.md +1 -0
- package/docs/reference/cli/deploy.md +1 -0
- 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 +3 -0
- package/docs/reference/config.md +1 -0
- 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 +2 -0
- package/dist/action-key-XtKKbbsi.mjs +0 -25
- package/dist/client-BAxLpSKv.mjs +0 -1
- package/dist/deploy-DEZkUS77.mjs +0 -2
- package/dist/gen-C6iknRdI.mjs +0 -1
- package/dist/help-C_cqTByy.mjs +0 -1
- 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/docs/guide/database.md
CHANGED
package/docs/guide/deployment.md
CHANGED
|
@@ -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).
|
|
@@ -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.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Send transactional email with sendEmail. Void captures messages in a local inbox during development.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -232,7 +233,7 @@ Remove the deprecated `sendInDev` option to use the local inbox. Deploy the app
|
|
|
232
233
|
Use the test harness to assert on outgoing messages without mocking the binding:
|
|
233
234
|
|
|
234
235
|
```ts
|
|
235
|
-
import { describe, it, expect } from '
|
|
236
|
+
import { describe, it, expect } from 'vite-plus/test';
|
|
236
237
|
import { sendEmail } from 'void/email';
|
|
237
238
|
import { createEmailTestHarness } from 'void/email/testing';
|
|
238
239
|
|
|
@@ -254,6 +255,6 @@ describe('signup flow', () => {
|
|
|
254
255
|
});
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
The harness intercepts every `sendEmail` call until `dispose()` is called. `clear()` empties the captured list without releasing the sink.
|
|
258
|
+
The harness intercepts every `sendEmail` call until `dispose()` is called. `clear()` empties the captured list without releasing the sink. [Testing](../testing.md) explains how to run tests and how to test code that uses other bindings.
|
|
258
259
|
|
|
259
260
|
To handle incoming messages, see [Receiving Email](./receiving.md).
|
package/docs/guide/email.md
CHANGED
package/docs/guide/env-vars.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Declare environment variables in env.ts and read the typed values from void/env. Use .env locally and secrets in production.'
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Environment variables
|
|
2
6
|
|
|
3
7
|
Declare your environment variables in `env.ts`, then read them through `env` from `void/env`. Use `.env` for local values and `void secret put` for production server values.
|
package/docs/guide/index.md
CHANGED
package/docs/guide/jobs.md
CHANGED
package/docs/guide/kv.md
CHANGED
package/docs/guide/live.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Change server data from a form or button with a page action. Actions accept POST, PUT, PATCH, and DELETE.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -149,21 +150,22 @@ The types are inferred from your action's `withValidator()` schema in the compan
|
|
|
149
150
|
|
|
150
151
|
`useForm` returns a reactive object with:
|
|
151
152
|
|
|
152
|
-
| Property / Method | Purpose
|
|
153
|
-
| -------------------------------- |
|
|
154
|
-
| `data` / `setData` | Current form values, typed to match the action's body schema.
|
|
155
|
-
| `errors` | Field-level validation errors, keys typed to body field names.
|
|
156
|
-
| `error` | Action error, or `null`.
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
153
|
+
| Property / Method | Purpose |
|
|
154
|
+
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
155
|
+
| `data` / `setData` | Current form values, typed to match the action's body schema. |
|
|
156
|
+
| `errors` | Field-level validation errors, keys typed to body field names. |
|
|
157
|
+
| `error` | Action error, or `null`. |
|
|
158
|
+
| `throwOnError` (option) | Set to `false` to keep authentication and server failures in `form.error` instead of throwing them. |
|
|
159
|
+
| `post`, `put`, `patch`, `delete` | Submit the form with that method. In React these are native form action callbacks. |
|
|
160
|
+
| `pending` | `true` while the submission is in flight. |
|
|
161
|
+
| `hasChanges` | `true` if form data differs from the current defaults. After a successful submit, defaults update to the submitted values, so `hasChanges` becomes `false` unless the form was edited during the submit. |
|
|
162
|
+
| `wasSuccessful` | `true` after a successful submission. Stays `true` until the next submission. |
|
|
163
|
+
| `recentlySuccessful` | `true` for 2 seconds after a successful submission. Useful for flash messages. |
|
|
164
|
+
| `reset(...fields)` | Reset form data to the current defaults (last submitted values after success). Field names autocomplete. Pass `{ initial: true }` first to reset to the values passed to `useForm`. |
|
|
165
|
+
| `resetOnSuccess` (option) | When `true`, a successful submit resets defaults to the mount-time values, and form data too unless it was edited during the submit. Useful for create forms that should clear after save. |
|
|
166
|
+
| `setError(field, message)` | Set a client-side validation error on a field. |
|
|
167
|
+
| `clearErrors(...fields)` | Clear validation errors. Field names autocomplete. |
|
|
168
|
+
| `clearError()` | Clear `error`. |
|
|
167
169
|
|
|
168
170
|
Use `setError()` for client-side validation. Editing a field clears its error automatically.
|
|
169
171
|
|
|
@@ -202,6 +204,12 @@ If a callback awaits `router.visit()` or `router.refresh()`, pass `{ resolveOn:
|
|
|
202
204
|
|
|
203
205
|
Vue, Svelte, and Solid submissions return a promise instead; use `await form.post()` to run work after a submission.
|
|
204
206
|
|
|
207
|
+
### Query parameters after submission
|
|
208
|
+
|
|
209
|
+
An action or form that posts to the current page keeps the page's query parameters. From `/items?page=2&search=foo`, `action('/items?vote')` posts to `/items?vote&page=2&search=foo`, so the action and loader see `page` and `search`. The URL, scroll position, and history entry stay as they are. A parameter written in the action URL takes precedence over the page's: `action('/items?vote&page=1')` posts with `page=1`.
|
|
210
|
+
|
|
211
|
+
A redirect from the action does not receive the page's query parameters. To clear them after an action, return `c.redirect('/items')`.
|
|
212
|
+
|
|
205
213
|
### Scroll after submission
|
|
206
214
|
|
|
207
215
|
Actions and forms keep the current scroll position when updating the page in place. Redirects and submissions that open another page scroll to the top, or to the destination's hash target.
|
|
@@ -247,7 +255,7 @@ export const actions = {
|
|
|
247
255
|
};
|
|
248
256
|
```
|
|
249
257
|
|
|
250
|
-
Named actions use a `?actionName` suffix, such as `/users/42?update`. `useForm` and `action()` handle this automatically. After a POST action renders the page or uses a default `c.redirect()`, the page URL keeps ordinary query parameters: `/users/42?update&tab=profile` becomes `/users/42?tab=profile`. See [redirect query parameters](../../reference/api/rewrites.md#c-rewrite-destination) for redirects that preserve the request method.
|
|
258
|
+
Named actions use a `?actionName` suffix, such as `/users/42?update`. `useForm` and `action()` handle this automatically. After a POST action renders the page or uses a default `c.redirect()`, the page URL keeps the action URL's ordinary query parameters: `/users/42?update&tab=profile` becomes `/users/42?tab=profile`. See [redirect query parameters](../../reference/api/rewrites.md#c-rewrite-destination) for redirects that preserve the request method.
|
|
251
259
|
|
|
252
260
|
Use `action` or `actions` in a file, not both.
|
|
253
261
|
|
|
@@ -301,7 +309,17 @@ A successful call returns `{ ok: true, pageData }`. Expected errors, such as val
|
|
|
301
309
|
|
|
302
310
|
Expected errors such as `400`, `404`, `409`, `422`, and `429` stay with the form or action call. `useForm` stores them in `form.errors` or `form.error`; `action()` returns `{ ok: false, error }`.
|
|
303
311
|
|
|
304
|
-
|
|
312
|
+
By default, authentication errors (`401`, `403`) and server errors (`500`, `502`) are thrown. Handle them with your framework's error boundary or error handling.
|
|
313
|
+
|
|
314
|
+
To handle all HTTP failures inline, pass `throwOnError: false` to `useForm()`. Validation errors still populate `form.errors`; other HTTP failures populate `form.error`, keeping the form and its input visible. The `Form` component displays the error automatically. In React, `onError` also receives these failures.
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { useForm } from '@void/react'; // or "@void/vue", "@void/svelte", "@void/solid"
|
|
318
|
+
|
|
319
|
+
const form = useForm('/users', { name: '', email: '' }, { throwOnError: false });
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Unexpected failures, such as network errors, still throw. Cancelled submissions do not set a form error.
|
|
305
323
|
|
|
306
324
|
Use `isVoidActionError()` to tell a failed action apart from other errors. It's `true` for a `VoidActionError` at any status, and narrows the error so you can read `status` and `message`. `isCallSiteActionError()` is `true` only for the expected errors that `action()` returns.
|
|
307
325
|
|
|
@@ -363,8 +381,8 @@ export default function Upload() {
|
|
|
363
381
|
|
|
364
382
|
```vue [Vue]
|
|
365
383
|
<script setup lang="ts">
|
|
366
|
-
import { ref } from 'vue';
|
|
367
384
|
import { Form, useForm } from '@void/vue';
|
|
385
|
+
import { ref } from 'vue';
|
|
368
386
|
|
|
369
387
|
const form = useForm('/photos', { title: '', photo: null as File | null });
|
|
370
388
|
const fileInput = ref<HTMLInputElement>();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Show not-found and error states inside your layouts with _not-found and _error components.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Not Found & Errors
|
|
7
|
+
|
|
8
|
+
Add `_not-found` and `_error` components to `pages/` to show errors inside your app's layouts. Both receive an `error` prop with `status` and `message`.
|
|
9
|
+
|
|
10
|
+
::: code-group
|
|
11
|
+
|
|
12
|
+
```tsx [React]
|
|
13
|
+
// pages/_error.tsx (or pages/_not-found.tsx)
|
|
14
|
+
import type { ErrorPageProps } from '@void/react';
|
|
15
|
+
|
|
16
|
+
export default function ErrorPage({ error }: ErrorPageProps) {
|
|
17
|
+
return (
|
|
18
|
+
<main>
|
|
19
|
+
<h1>{error.status}</h1>
|
|
20
|
+
<p>{error.message}</p>
|
|
21
|
+
<a href="/">Go home</a>
|
|
22
|
+
</main>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```vue [Vue]
|
|
28
|
+
<!-- pages/_error.vue (or pages/_not-found.vue) -->
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import type { ErrorPageProps } from '@void/vue';
|
|
31
|
+
|
|
32
|
+
defineProps<ErrorPageProps>();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<main>
|
|
37
|
+
<h1>{{ error.status }}</h1>
|
|
38
|
+
<p>{{ error.message }}</p>
|
|
39
|
+
<a href="/">Go home</a>
|
|
40
|
+
</main>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```svelte [Svelte]
|
|
45
|
+
<!-- pages/_error.svelte (or pages/_not-found.svelte) -->
|
|
46
|
+
<script lang="ts">
|
|
47
|
+
import type { ErrorPageProps } from '@void/svelte';
|
|
48
|
+
|
|
49
|
+
let { error }: ErrorPageProps = $props();
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<main><h1>{error.status}</h1><p>{error.message}</p><a href="/">Go home</a></main>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```tsx [Solid]
|
|
56
|
+
// pages/_error.tsx (or pages/_not-found.tsx)
|
|
57
|
+
import type { ErrorPageProps } from '@void/solid';
|
|
58
|
+
|
|
59
|
+
export default function ErrorPage(props: ErrorPageProps) {
|
|
60
|
+
return (
|
|
61
|
+
<main>
|
|
62
|
+
<h1>{props.error.status}</h1>
|
|
63
|
+
<p>{props.error.message}</p>
|
|
64
|
+
<a href="/">Go home</a>
|
|
65
|
+
</main>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
:::
|
|
71
|
+
|
|
72
|
+
`_not-found` handles a page loader returning a 404 or throwing `HTTPException(404)`. A root `pages/_not-found` also handles URLs that don't match a page or API route. Returning a 404 is the same in all four adapters:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
// pages/products/[id].server.ts
|
|
76
|
+
import { defineHandler } from 'void/handler';
|
|
77
|
+
|
|
78
|
+
export const loader = defineHandler((c) => c.notFound());
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`_error` handles unexpected loader and rendering failures. Unexpected errors use generic production messages; server details stay in your logs. Development shows the error message. Action errors that reach a client boundary retain their HTTP status and public message. Explicit responses such as redirects, authentication failures, and API errors keep their existing behavior.
|
|
82
|
+
|
|
83
|
+
Calling `c.notFound()` in middleware invokes the app's not-found handler, which uses the root `pages/_not-found`. It doesn't select a nested boundary or run the page loader. To send your own 404 response from middleware, return a response such as `c.text('Not Found', 404)`; Void leaves it unchanged.
|
|
84
|
+
|
|
85
|
+
## Nested errors
|
|
86
|
+
|
|
87
|
+
Put a boundary in a subdirectory to customize that section. The closest boundary wins, keeping its layout and outer layouts. A layout's own rendering failure goes to a boundary outside that layout. If an error component fails, Void tries an outer boundary, then its built-in error page.
|
|
88
|
+
|
|
89
|
+
Boundary components don't have `.server` companions, actions, or their own `layout` export. They aren't routes: `/error` and `/not-found` remain available for ordinary pages. `.dev` and `.prod` variants work like other Pages components.
|
|
90
|
+
|
|
91
|
+
## Recovery
|
|
92
|
+
|
|
93
|
+
Client rendering errors use the framework's error boundaries. Event handlers, detached async tasks, and independent islands keep the framework's normal error handling. Deferred props retain each adapter's usual behavior: React can throw a rejected deferred promise during rendering; Vue, Svelte, and Solid expose its error state for your component to display.
|
|
94
|
+
|
|
95
|
+
Use `useRouter().refresh()` in an interactive error component to retry the current page's GET loader. It bypasses Void's client page cache and never repeats a form submission. A regular link or document reload also works. Error responses aren't stored in the client page cache.
|
|
96
|
+
|
|
97
|
+
## Rendering modes
|
|
98
|
+
|
|
99
|
+
`ssr = false` pages show their error component in the browser. Island pages render error documents on the server; they don't gain a client router. Boundary components should work with the same shared context as the page they replace.
|
|
100
|
+
|
|
101
|
+
With `output: 'static'`, a root `_not-found` produces `404.html` unless an explicit 404 document already exists. It renders with empty shared data and parameters, without request middleware or client hydration. Keep that component and its layouts usable without a signed-in user or other request data. Your static host controls the response status for unknown URLs.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Share navigation and other UI across pages. Layouts nest with your directories and keep their state during navigation.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -216,6 +217,8 @@ A named layout replaces the deepest default layout: in `[root, docs/layout]`, it
|
|
|
216
217
|
|
|
217
218
|
Void uses the closest matching `_layouts/` file in the page's directory or an ancestor. A missing named layout fails the build.
|
|
218
219
|
|
|
220
|
+
Declare `layout` in the page file itself with a string literal or `false`. Void reads it without running the page, so it ignores a computed or re-exported value and prints a warning.
|
|
221
|
+
|
|
219
222
|
## Shared Data
|
|
220
223
|
|
|
221
224
|
Middleware can inject data available on every page via `c.set("shared", {...})`. Augment `CloudContextVariables` to type the shared data, and `useShared()` will infer the type automatically:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Add Markdown files in pages/ as routes. They inherit layouts and ship JavaScript only for islands and client scripts.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -194,7 +195,6 @@ export default function DocsLayout({ children }) {
|
|
|
194
195
|
import { useFrontmatter } from '@void/md';
|
|
195
196
|
|
|
196
197
|
const fm = useFrontmatter();
|
|
197
|
-
// fm.title, fm.description, etc.
|
|
198
198
|
</script>
|
|
199
199
|
|
|
200
200
|
<template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Turn files in pages/ into routes. A server loader returns data, and the page component receives it as props.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -153,6 +154,8 @@ Render and prerender flags combine like this:
|
|
|
153
154
|
| Island page + `ssr = false` | Invalid. Island pages already use the island renderer. |
|
|
154
155
|
| `output: "static"` + `prerender` unset | Auto-prerender pages that have known paths, including client-only shells. |
|
|
155
156
|
|
|
157
|
+
Write `ssr` and `prerender` as `true` or `false` with `export const` in the `.server.ts` file itself. Void reads them without running the file, so it ignores a computed or re-exported value and prints a warning.
|
|
158
|
+
|
|
156
159
|
### Typed navigation
|
|
157
160
|
|
|
158
161
|
Use the `Link` component for SPA navigation between pages. Build dynamic URLs with [`routeUrl()`](../type-safety.md#typed-urls-and-navigation) to check the route pattern and its parameters:
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Register a separate application as an OAuth client so its users can sign in on Void and choose whether to connect it.'
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Connected apps
|
|
2
6
|
|
|
3
7
|
A connected app is a separate application registered as an OAuth client on your Void installation. Users sign in on Void and decide whether to connect it. The application operator may be different from the platform administrator.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Find users, inspect their projects and usage, and change the plan assigned to an account.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -25,6 +26,16 @@ Project details include resources, domains, and recent builds and deployments. T
|
|
|
25
26
|
|
|
26
27
|
In the admin dashboard, open a project to view its team. Search for a platform user and choose a role to add them immediately; an email address is not required. You can also change or remove existing members. Pending invitations created through other project workflows remain visible until accepted or revoked. If email is unavailable for a pending invitation, share its ID so the user can accept it with `void project team accept <invitation-id>`. The owner cannot be removed from the team; transfer ownership first. Removing a collaborator or admin, changing one to reader, or suspending or deleting their account [replaces the project's platform credentials](../../project-collaboration.md#change-or-remove-access), the same as the CLI.
|
|
27
28
|
|
|
29
|
+
### AI Logging
|
|
30
|
+
|
|
31
|
+
Keep prompt and response bodies out of a project's AI Gateway logs while retaining request metadata:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
void platform project ai-logging <project-id> metadata
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Only platform administrators can change this setting. It applies to AI requests through the platform, including calls with an app's own provider key. Other projects keep their own settings. Use `inherit` to restore the gateway default, `off` to disable log collection, or `full` to include bodies. Inspect the saved mode with `void platform project show <project-id> --json`. See [AI Gateway logging](../../../reference/cli/platform-users.md#ai-gateway-logging) for the modes and Cloudflare's billing and Logpush behavior.
|
|
38
|
+
|
|
28
39
|
### Transferring Project Ownership
|
|
29
40
|
|
|
30
41
|
Only an installation administrator can change a project's owner. The new owner must already have an account on this platform. In the dashboard, search for the new owner on the project page and preview the transfer before applying it. The CLI accepts a user ID:
|