void 0.21.9 → 0.23.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/README.md +5 -1
- package/dist/{account-cmd-DZZGK80W.mjs → account-cmd-C84Ee8cO.mjs} +5 -5
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-B_CeugBw.mjs → auth-link-CioEg6uY.mjs} +5 -5
- package/dist/{auth-router-BgEFRuvZ.mjs → auth-router-BsR981d4.mjs} +5 -5
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-Dpt0jd-x.mjs → build-cmd-LzvNJORH.mjs} +19 -7
- package/dist/{cache-7_UeZdTk.mjs → cache-C4MvnrMH.mjs} +4 -4
- package/dist/{cancel-deploy-D23R1RXT.mjs → cancel-deploy-abUxpP2n.mjs} +4 -4
- package/dist/{cf-build-output-CGT03qCD.mjs → cf-build-output-BPqOT964.mjs} +141 -63
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +114 -460
- package/dist/cli/cloudflare-operation-process.mjs +1103 -0
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-QTl6ko_D.mjs → client-RV8NVeB8.mjs} +165 -21
- package/dist/{cloudflare-auth-C4_GPZr0.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -43
- package/dist/{cloudflare-cmd-bSmZ1d5L.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +9 -10
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-jAwacxxP.mjs → cloudflare-connect-B8uPZ4nx.mjs} +4 -4
- package/dist/{cloudflare-operations-BipGMJ5O.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-sMZXpk_S.mjs → cloudflare-operations-fxHb-byx.mjs} +118 -203
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-CF69HgXc.d.mts → config-BMHb8RCj.d.mts} +2 -2
- package/dist/{config-CafTW6Cz.mjs → config-Br_JZD6u.mjs} +2 -7
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/{config-s7Xj7tPb.mjs → config-CyQ-wVd7.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-write-BSduPMY8.mjs → config-write-B1f88wJA.mjs} +1 -1
- package/dist/{connect-BsUSRzln.mjs → connect-Bd4kJd9U.mjs} +6 -6
- package/dist/{create-project-BniEV0OW.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-DBfFSZKY.mjs → create-project-bMf6ffLZ.mjs} +9 -5
- package/dist/{db-hRrvZaq_.mjs → db-8uG64XLl.mjs} +26 -26
- package/dist/{delete-D6dZ9B6B.mjs → delete-NvbiyeJf.mjs} +4 -4
- package/dist/{deploy-WaAQez1O.mjs → deploy-DzAIwqNU.mjs} +944 -607
- package/dist/{deploy-DDz7c8LK.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{dist-BR1quN_w.mjs → dist-AoCzRTJE.mjs} +226 -60
- package/dist/{dist-C5fND3R0.mjs → dist-BuDuKZJv.mjs} +1 -1
- package/dist/{dist-Dn6nn2IU.mjs → dist-CTBk70IR.mjs} +42 -42
- package/dist/{domain-Dmhvb2oU.mjs → domain-y5Tvydvo.mjs} +5 -5
- package/dist/{email-DFi-s2t4.mjs → email-B3umsW75.mjs} +15 -30
- package/dist/{env-Csi-tMbT.mjs → env-BS6qYHDb.mjs} +6 -6
- package/dist/{env-public-D_6u46fX.d.mts → env-public-BX_r8HR6.d.mts} +2 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-Dz3X1Qab.mjs → gen-B580--vC.mjs} +5 -5
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-BED3_9JD.mjs → github-cmd-v45BdfKX.mjs} +6 -8
- package/dist/{handler-BXJTXd02.d.mts → handler-CZ4nAylQ.d.mts} +2 -1
- package/dist/{headers-BOg_velo.mjs → headers-DWi2IXWx.mjs} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-DC7gdz7L.mjs → help-daGKjXGk.mjs} +268 -666
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +305 -1490
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-WO0JlPx8.mjs → init-Bvy7zrBo.mjs} +51 -20
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-CsHOinF7.mjs → link-CDqqCjFl.mjs} +5 -5
- package/dist/{list-CDb-4bZ1.mjs → list-CZj0dzKY.mjs} +5 -5
- package/dist/{live-CKiJilLr.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-CC8sKFGu.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-DvqXsfGs.mjs → login-UZKFM_u7.mjs} +5 -5
- package/dist/{logs-BdfiOezj.mjs → logs-CUZ6t9t3.mjs} +5 -5
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-B8KuoYsO.mjs → migrate-DHul7PRV.mjs} +5 -4
- package/dist/{node-BM43oz4G.mjs → node-BkyRWRx8.mjs} +2 -2
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-03819ATr.mjs → operator-cmd-DBA6dl0m.mjs} +69 -23
- package/dist/output-Dm_A4Tbv.mjs +81 -0
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +3 -3
- package/dist/pages/islands-plugin.d.mts +16 -6
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/{output-CCH48AMM.mjs → picocolors-BTps1_gs.mjs} +2 -76
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-z92h63q5.mjs → platform-auth-config-B56E9YP1.mjs} +4 -4
- package/dist/{platform-auth-protection-DeE3yr2R.mjs → platform-auth-protection-BDWO_aER.mjs} +3 -3
- package/dist/{platform-auth-recovery-o_340Ixx.mjs → platform-auth-recovery-1gg4CSRe.mjs} +4 -4
- package/dist/{platform-cmd-C4ZV3Vpy.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-DNl8WosH.mjs → platform-cmd-DMcQStSc.mjs} +26 -5
- package/dist/{platform-domain-CU1JtJkW.mjs → platform-domain-BNkcz0OB.mjs} +36 -9
- package/dist/{platform-lifecycle-Bc047IeT.mjs → platform-lifecycle-9OyBALhH.mjs} +850 -276
- package/dist/{platform-lifecycle-Bs2qx1E3.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-CVpGI9Y5.mjs → platform-management-CjwLVQwN.mjs} +59 -11
- package/dist/{platform-management-C8tt6D8h.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-dvUaptLr.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-DyZ-Yok5.mjs → prepare-B5Mkic5u.mjs} +3 -3
- package/dist/{prepare-C3kt3Rst.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-B44I8J_W.mjs → project-cmd-CNzrqvBv.mjs} +30 -16
- package/dist/{project-team-BkbYIsXN.mjs → project-team-DQOWPfQT.mjs} +4 -4
- package/dist/{project-token-C8xEEQnB.mjs → project-token-CTDYU0Cc.mjs} +4 -4
- package/dist/project-zero-trust-BNAkW-_0.mjs +63 -0
- package/dist/{protocol-ZH3jP4a7.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-DNtrtaVD.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-BhreDAOS.mjs → provision-CJFgTZY8.mjs} +111 -215
- package/dist/{requests-DFyhBMaf.mjs → requests-MhxYnau8.mjs} +4 -4
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-DHHxXZiS.mjs → rollback-CJ6iSDoU.mjs} +5 -5
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +3 -0
- package/dist/runtime/sandbox-container.mjs +2 -0
- package/dist/runtime/sandbox.d.mts +4 -32
- package/dist/runtime/sandbox.mjs +151 -75
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/sandbox-XZAqzFlG.d.mts +52 -0
- package/dist/sandbox-container-Bo0eiFKz.d.mts +73 -0
- package/dist/sandbox-container-C6ItmVuN.mjs +281 -0
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-DN9sSNiV.mjs → secret-Dli5fP0B.mjs} +6 -6
- package/dist/{skills-O6FUaizK.mjs → skills-D1II1Juz.mjs} +1 -1
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/{subcommand-prompt-BuGYkAkC.mjs → subcommand-prompt-CY1C4fvl.mjs} +2 -2
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-BymcxrRa.mjs → wrangler-7K-bW_DL.mjs} +14 -235
- package/dist/{ws-BwcqizuH.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +48 -33
- package/sandbox.Dockerfile +4 -0
- package/schema.json +10 -22
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -133
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +6 -19
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +23 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +189 -0
- package/skills/void/docs/guide/platform/development/local.md +2 -2
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +31 -3
- package/skills/void/docs/guide/platform/installation/first-deployment.md +6 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +21 -16
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform/installation/uninstall.md +17 -2
- package/skills/void/docs/guide/platform-administration.md +2 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +78 -41
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +33 -1621
- package/skills/void/docs/reference/config.md +26 -32
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/cli/cf-compat.mjs +0 -968
- package/dist/client-4cDVv7BO.mjs +0 -2
- package/dist/gen-Vnv2f65C.mjs +0 -2
- package/dist/help-DQMfeKMz.mjs +0 -2
- package/dist/login-DFQk7rbW.mjs +0 -2
- package/dist/migrate-TsHGBnDA.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-BZXkjdNe.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -79,7 +79,7 @@ void auth login
|
|
|
79
79
|
void deploy
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
## Using Void
|
|
82
|
+
## Using Void Features
|
|
83
83
|
|
|
84
84
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with Analog. Use them in page server loaders, actions, and API routes:
|
|
85
85
|
|
|
@@ -99,75 +99,16 @@ export const load = async ({ event }: PageServerLoad) => {
|
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
::: warning ⚠️ Analog limitation
|
|
102
|
-
|
|
102
|
+
Use `db.select().from(table)` for database queries in Analog. The `db.query.*` relational API is not available.
|
|
103
103
|
:::
|
|
104
104
|
|
|
105
|
-
###
|
|
105
|
+
### Other resources
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
import type { PageServerLoad } from '@analogjs/router';
|
|
109
|
-
import { kv } from 'void/kv';
|
|
110
|
-
|
|
111
|
-
export const load = async ({ event }: PageServerLoad) => {
|
|
112
|
-
return { settings: await kv.get('app:settings') };
|
|
113
|
-
};
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Blob Storage
|
|
117
|
-
|
|
118
|
-
```ts
|
|
119
|
-
import type { PageServerLoad } from '@analogjs/router';
|
|
120
|
-
import { storage } from 'void/storage';
|
|
121
|
-
|
|
122
|
-
export const load = async ({ event }: PageServerLoad) => {
|
|
123
|
-
return { avatar: await storage.get('avatars/user-1.png') };
|
|
124
|
-
};
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### AI
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
// src/server/routes/api/summarize.ts
|
|
131
|
-
import { eventHandler } from 'h3';
|
|
132
|
-
import { ai } from 'void/ai';
|
|
133
|
-
|
|
134
|
-
export default eventHandler(async () => {
|
|
135
|
-
return ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
136
|
-
prompt: 'Summarize the latest news',
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Cron Jobs
|
|
142
|
-
|
|
143
|
-
```ts
|
|
144
|
-
// crons/daily-cleanup.ts
|
|
145
|
-
import { defineScheduled } from 'void';
|
|
146
|
-
|
|
147
|
-
export const cron = '0 0 * * *';
|
|
148
|
-
|
|
149
|
-
export default defineScheduled(async () => {
|
|
150
|
-
// runs daily at midnight
|
|
151
|
-
});
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Queue Consumers
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
// queues/emails.ts
|
|
158
|
-
import { defineQueue } from 'void';
|
|
159
|
-
|
|
160
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
161
|
-
for (const msg of batch.messages) {
|
|
162
|
-
// process each message
|
|
163
|
-
msg.ack();
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
```
|
|
107
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
167
108
|
|
|
168
109
|
### Environment Variables
|
|
169
110
|
|
|
170
|
-
Declare
|
|
111
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
171
112
|
|
|
172
113
|
`void/env` replaces the H3 event context and `import { env } from "cloudflare:workers"` for env-var access. Keep those around when you need raw binding access (D1, KV, R2, etc.).
|
|
173
114
|
|
|
@@ -40,8 +40,6 @@ export default defineConfig({
|
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
By default, Astro's Cloudflare runtime and `voidPlugin()` migrations share local state at `.wrangler/state/v3`, so no extra persistence configuration is required.
|
|
44
|
-
|
|
45
43
|
### 4. Create `void.config.ts`
|
|
46
44
|
|
|
47
45
|
Void uses this config for the Cloudflare adapter during development and deployment:
|
|
@@ -67,7 +65,7 @@ void auth login
|
|
|
67
65
|
void deploy
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
## Using Void
|
|
68
|
+
## Using Void Features
|
|
71
69
|
|
|
72
70
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with Astro in both local dev and production when using Astro 6+ with `nodejs_als`.
|
|
73
71
|
|
|
@@ -97,76 +95,13 @@ export const GET: APIRoute = async () => {
|
|
|
97
95
|
};
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
###
|
|
101
|
-
|
|
102
|
-
Use `void/kv` in both dev and production:
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import type { APIRoute } from 'astro';
|
|
106
|
-
import { kv } from 'void/kv';
|
|
107
|
-
|
|
108
|
-
export const GET: APIRoute = async () => {
|
|
109
|
-
const settings = await kv.get('app:settings');
|
|
110
|
-
return Response.json(settings);
|
|
111
|
-
};
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Blob Storage
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
import type { APIRoute } from 'astro';
|
|
118
|
-
import { storage } from 'void/storage';
|
|
119
|
-
|
|
120
|
-
export const GET: APIRoute = async () => {
|
|
121
|
-
const avatar = await storage.get('avatars/user-1.png');
|
|
122
|
-
return new Response(avatar);
|
|
123
|
-
};
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### AI
|
|
98
|
+
### Other resources
|
|
127
99
|
|
|
128
|
-
|
|
129
|
-
import type { APIRoute } from 'astro';
|
|
130
|
-
import { ai } from 'void/ai';
|
|
131
|
-
|
|
132
|
-
export const POST: APIRoute = async () => {
|
|
133
|
-
const result = await ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
134
|
-
prompt: 'Summarize the latest news',
|
|
135
|
-
});
|
|
136
|
-
return Response.json(result);
|
|
137
|
-
};
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Cron Jobs
|
|
141
|
-
|
|
142
|
-
```ts
|
|
143
|
-
// crons/daily-cleanup.ts
|
|
144
|
-
import { defineScheduled } from 'void';
|
|
145
|
-
|
|
146
|
-
export const cron = '0 0 * * *';
|
|
147
|
-
|
|
148
|
-
export default defineScheduled(async () => {
|
|
149
|
-
// runs daily at midnight
|
|
150
|
-
});
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Queue Consumers
|
|
154
|
-
|
|
155
|
-
```ts
|
|
156
|
-
// queues/emails.ts
|
|
157
|
-
import { defineQueue } from 'void';
|
|
158
|
-
|
|
159
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
160
|
-
for (const msg of batch.messages) {
|
|
161
|
-
// process each message
|
|
162
|
-
msg.ack();
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
```
|
|
100
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
166
101
|
|
|
167
102
|
### Environment Variables
|
|
168
103
|
|
|
169
|
-
Declare
|
|
104
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
170
105
|
|
|
171
106
|
Void always uses `VITE_*` for client-exposed schema keys, including in Astro projects. Astro's separate `PUBLIC_*` convention still applies to direct `import.meta.env` access, but it does not change the `void/env` server/client boundary.
|
|
172
107
|
|
|
@@ -195,7 +130,3 @@ const { DB } = Astro.locals.runtime.env;
|
|
|
195
130
|
const { results } = await DB.prepare("SELECT * FROM users").all();
|
|
196
131
|
---
|
|
197
132
|
```
|
|
198
|
-
|
|
199
|
-
::: tip Direct Binding Access
|
|
200
|
-
`Astro.locals.runtime.env` is still useful when you need direct access to raw Cloudflare bindings.
|
|
201
|
-
:::
|
|
@@ -43,8 +43,6 @@ export default defineNuxtConfig({
|
|
|
43
43
|
});
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
By default, Nuxt's Cloudflare development runtime and `voidPlugin()` migrations share local state at `.wrangler/state/v3`, so no extra persistence configuration is required.
|
|
47
|
-
|
|
48
46
|
### 4. Create `void.config.ts`
|
|
49
47
|
|
|
50
48
|
Void generates the Cloudflare config used by Nuxt's development runtime:
|
|
@@ -68,7 +66,7 @@ void auth login
|
|
|
68
66
|
void deploy
|
|
69
67
|
```
|
|
70
68
|
|
|
71
|
-
## Using Void
|
|
69
|
+
## Using Void Features
|
|
72
70
|
|
|
73
71
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with Nuxt. Use them in server routes, API handlers, and middleware:
|
|
74
72
|
|
|
@@ -87,71 +85,16 @@ export default defineEventHandler(async () => {
|
|
|
87
85
|
```
|
|
88
86
|
|
|
89
87
|
::: warning ⚠️ Nuxt limitation
|
|
90
|
-
|
|
88
|
+
Use `db.select().from(table)` for database queries in Nuxt. The `db.query.*` relational API is not available.
|
|
91
89
|
:::
|
|
92
90
|
|
|
93
|
-
###
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
import { kv } from 'void/kv';
|
|
97
|
-
|
|
98
|
-
export default defineEventHandler(async () => {
|
|
99
|
-
return kv.get('app:settings');
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Blob Storage
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
import { storage } from 'void/storage';
|
|
107
|
-
|
|
108
|
-
export default defineEventHandler(async () => {
|
|
109
|
-
return storage.get('avatars/user-1.png');
|
|
110
|
-
});
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### AI
|
|
114
|
-
|
|
115
|
-
```ts
|
|
116
|
-
import { ai } from 'void/ai';
|
|
117
|
-
|
|
118
|
-
export default defineEventHandler(async () => {
|
|
119
|
-
return ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
120
|
-
prompt: 'Summarize the latest news',
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Cron Jobs
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
// crons/daily-cleanup.ts
|
|
129
|
-
import { defineScheduled } from 'void';
|
|
91
|
+
### Other resources
|
|
130
92
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
export default defineScheduled(async () => {
|
|
134
|
-
// runs daily at midnight
|
|
135
|
-
});
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Queue Consumers
|
|
139
|
-
|
|
140
|
-
```ts
|
|
141
|
-
// queues/emails.ts
|
|
142
|
-
import { defineQueue } from 'void';
|
|
143
|
-
|
|
144
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
145
|
-
for (const msg of batch.messages) {
|
|
146
|
-
// process each message
|
|
147
|
-
msg.ack();
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
```
|
|
93
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
151
94
|
|
|
152
95
|
### Environment Variables
|
|
153
96
|
|
|
154
|
-
Declare
|
|
97
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
155
98
|
|
|
156
99
|
`void/env` replaces `useRuntimeConfig()` and `event.context.cloudflare.env` for env-var access. Keep `event.context.cloudflare.env` around when you need raw binding access (D1, KV, R2, etc.), and `useRuntimeConfig()` when you need non-env runtime config.
|
|
157
100
|
|
|
@@ -14,32 +14,23 @@ TanStack Start and React Router use the Cloudflare Vite plugin provided by Void.
|
|
|
14
14
|
|
|
15
15
|
## Supported Frameworks
|
|
16
16
|
|
|
17
|
-
| Framework
|
|
18
|
-
|
|
|
19
|
-
| [TanStack Start](
|
|
20
|
-
| [React Router v7](
|
|
21
|
-
| [SvelteKit](
|
|
22
|
-
| [Nuxt](
|
|
23
|
-
| [Analog](
|
|
24
|
-
| [Astro **v6+**](
|
|
17
|
+
| Framework | Package | Integration |
|
|
18
|
+
| ------------------------------------- | ----------------------- | ---------------------------------------------------------------------------- |
|
|
19
|
+
| [TanStack Start](./tanstack-start.md) | `@tanstack/react-start` | Vite plugin composition. `voidPlugin()` runs alongside the framework plugin. |
|
|
20
|
+
| [React Router v7](./react-router.md) | `@react-router/dev` | Vite plugin composition. Setup matches TanStack Start. |
|
|
21
|
+
| [SvelteKit](./sveltekit.md) | `@sveltejs/kit` | Vite-based, uses its own Cloudflare adapter |
|
|
22
|
+
| [Nuxt](./nuxt.md) | `nuxt` | Own CLI and build toolchain |
|
|
23
|
+
| [Analog](./analog.md) | `@analogjs/platform` | Vite-based, uses Nitro with Cloudflare preset |
|
|
24
|
+
| [Astro **v6+**](./astro.md) | `astro` | Own CLI and Cloudflare adapter (v6 required) |
|
|
25
25
|
|
|
26
26
|
Detection is automatic. The CLI reads your `package.json` dependencies.
|
|
27
27
|
|
|
28
|
-
See the individual framework guides for setup instructions:
|
|
29
|
-
|
|
30
|
-
- [TanStack Start](./tanstack-start.md)
|
|
31
|
-
- [React Router](./react-router.md)
|
|
32
|
-
- [SvelteKit](./sveltekit.md)
|
|
33
|
-
- [Nuxt](./nuxt.md)
|
|
34
|
-
- [Analog](./analog.md)
|
|
35
|
-
- [Astro](./astro.md)
|
|
36
|
-
|
|
37
28
|
## Feature Support
|
|
38
29
|
|
|
39
30
|
With `voidPlugin()` added to the framework's Vite config, frameworks get most of the same backend/platform features as [Void apps](../../guide/app-types.md#void-apps):
|
|
40
31
|
|
|
41
32
|
- **Binding inference:** D1, KV, R2, AI, and queues are detected from source code.
|
|
42
|
-
- **Typed database:** query
|
|
33
|
+
- **Typed database:** query types come from your Drizzle schema.
|
|
43
34
|
- **Migrations:** local D1 is updated on dev startup, and migrations are validated and deployed with `void deploy`.
|
|
44
35
|
- **Runtime helpers:** `void/db`, `void/kv`, `void/storage`, and `void/ai` give you typed access to Cloudflare bindings in dev and production.
|
|
45
36
|
- **Auth:** Void-managed auth is not supported in framework mode yet. For now, use Better Auth's official integration for your framework.
|
|
@@ -104,40 +95,6 @@ Existing bindings are preserved. D1, KV, and R2 use local placeholder IDs until
|
|
|
104
95
|
|
|
105
96
|
Void combines these settings with inferred bindings and records provisioned resource IDs in `void.lock.json`. Commit both files.
|
|
106
97
|
|
|
107
|
-
##
|
|
108
|
-
|
|
109
|
-
SvelteKit, Nuxt, Analog, and Astro apps follow this pipeline:
|
|
98
|
+
## Deployment
|
|
110
99
|
|
|
111
|
-
|
|
112
|
-
void deploy
|
|
113
|
-
│
|
|
114
|
-
├─ 1. Detect framework
|
|
115
|
-
│ Reads package.json → determines framework + output conventions
|
|
116
|
-
│
|
|
117
|
-
├─ 2. Build
|
|
118
|
-
│ Runs framework's build command (or void.config.ts `build` override)
|
|
119
|
-
│ SvelteKit: vite build → .svelte-kit/cloudflare/
|
|
120
|
-
│ Nuxt: nuxt build → .output/
|
|
121
|
-
│ Analog: vite build → dist/analog/
|
|
122
|
-
│ Astro: astro build → dist/
|
|
123
|
-
│
|
|
124
|
-
├─ 3. Analyze
|
|
125
|
-
│ ├─ Locate worker entry + static assets from known output paths
|
|
126
|
-
│ ├─ Infer bindings from source or read from void.config.ts
|
|
127
|
-
│ ├─ Collect migrations from db/migrations/*.sql
|
|
128
|
-
│ ├─ Detect cron and queue handlers
|
|
129
|
-
│ └─ Read void.config.ts Cloudflare settings
|
|
130
|
-
│
|
|
131
|
-
├─ 4. Wrap (if needed)
|
|
132
|
-
│ If crons or queues are configured:
|
|
133
|
-
│ ├─ Generate wrapper entry module
|
|
134
|
-
│ ├─ Bundle with Vite (wraps framework's worker)
|
|
135
|
-
│ └─ Wrapper adds scheduled/queue handlers
|
|
136
|
-
│
|
|
137
|
-
├─ 5. Package + upload
|
|
138
|
-
│ Same as full-stack: hash-based asset diffing,
|
|
139
|
-
│ multipart upload, platform provisioning
|
|
140
|
-
│
|
|
141
|
-
└─ 6. Live
|
|
142
|
-
https://my-app.void.app
|
|
143
|
-
```
|
|
100
|
+
Run `void deploy` to build with your framework and deploy to the selected target. See [Deployment](../../guide/deployment.md) for setup and CI.
|
|
@@ -43,7 +43,7 @@ void auth login
|
|
|
43
43
|
void deploy
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
## Using Void
|
|
46
|
+
## Using Void Features
|
|
47
47
|
|
|
48
48
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with React Router. Use them in loaders and actions:
|
|
49
49
|
|
|
@@ -61,70 +61,15 @@ export async function loader({}: Route.LoaderArgs) {
|
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
###
|
|
64
|
+
### Other resources
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
import { kv } from 'void/kv';
|
|
68
|
-
|
|
69
|
-
export async function loader() {
|
|
70
|
-
return { settings: await kv.get('app:settings') };
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Blob Storage
|
|
75
|
-
|
|
76
|
-
```tsx
|
|
77
|
-
import { storage } from 'void/storage';
|
|
78
|
-
|
|
79
|
-
export async function loader() {
|
|
80
|
-
return { avatar: await storage.get('avatars/user-1.png') };
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### AI
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
import { ai } from 'void/ai';
|
|
88
|
-
|
|
89
|
-
export async function action() {
|
|
90
|
-
return ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
91
|
-
prompt: 'Summarize the latest news',
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Cron Jobs
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
// crons/daily-cleanup.ts
|
|
100
|
-
import { defineScheduled } from 'void';
|
|
101
|
-
|
|
102
|
-
export const cron = '0 0 * * *';
|
|
103
|
-
|
|
104
|
-
export default defineScheduled(async () => {
|
|
105
|
-
// runs daily at midnight
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Queue Consumers
|
|
110
|
-
|
|
111
|
-
```ts
|
|
112
|
-
// queues/emails.ts
|
|
113
|
-
import { defineQueue } from 'void';
|
|
114
|
-
|
|
115
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
116
|
-
for (const msg of batch.messages) {
|
|
117
|
-
// process each message
|
|
118
|
-
msg.ack();
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
```
|
|
66
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
122
67
|
|
|
123
68
|
### Environment Variables
|
|
124
69
|
|
|
125
|
-
Declare
|
|
70
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
126
71
|
|
|
127
|
-
|
|
72
|
+
Read server secrets in a `.server.ts` companion module and import it into your loader or action. Void rejects server-secret reads in route files that also contain browser components.
|
|
128
73
|
|
|
129
74
|
## Accessing Bindings Directly
|
|
130
75
|
|
|
@@ -64,13 +64,11 @@ export default defineConfig({
|
|
|
64
64
|
});
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
By default, SvelteKit's Cloudflare adapter, `voidPlugin()` migrations, and `void db` commands share local state at `.wrangler/state/v3`, so no extra `platformProxy.persist` configuration is required.
|
|
68
|
-
|
|
69
67
|
### 5. Configure `tsconfig.json`
|
|
70
68
|
|
|
71
|
-
SvelteKit
|
|
69
|
+
Extend SvelteKit’s generated config. The `withVoidTSConfig()` hook in the Vite config above adds Void’s types and aliases:
|
|
72
70
|
|
|
73
|
-
|
|
71
|
+
Keep `compilerOptions.paths` out of the root config so it does not override SvelteKit’s aliases.
|
|
74
72
|
|
|
75
73
|
```json
|
|
76
74
|
{
|
|
@@ -90,7 +88,7 @@ void auth login
|
|
|
90
88
|
void deploy
|
|
91
89
|
```
|
|
92
90
|
|
|
93
|
-
## Using Void
|
|
91
|
+
## Using Void Features
|
|
94
92
|
|
|
95
93
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with SvelteKit. Use them in server load functions, actions, and API routes:
|
|
96
94
|
|
|
@@ -108,70 +106,13 @@ export async function load() {
|
|
|
108
106
|
}
|
|
109
107
|
```
|
|
110
108
|
|
|
111
|
-
###
|
|
112
|
-
|
|
113
|
-
```ts
|
|
114
|
-
import { kv } from 'void/kv';
|
|
115
|
-
|
|
116
|
-
export async function load() {
|
|
117
|
-
return { settings: await kv.get('app:settings') };
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Blob Storage
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
import { storage } from 'void/storage';
|
|
125
|
-
|
|
126
|
-
export async function load() {
|
|
127
|
-
return { avatar: await storage.get('avatars/user-1.png') };
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### AI
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
import { ai } from 'void/ai';
|
|
109
|
+
### Other resources
|
|
135
110
|
|
|
136
|
-
|
|
137
|
-
summarize: async () => {
|
|
138
|
-
return ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
139
|
-
prompt: 'Summarize the latest news',
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Cron Jobs
|
|
146
|
-
|
|
147
|
-
```ts
|
|
148
|
-
// crons/daily-cleanup.ts
|
|
149
|
-
import { defineScheduled } from 'void';
|
|
150
|
-
|
|
151
|
-
export const cron = '0 0 * * *';
|
|
152
|
-
|
|
153
|
-
export default defineScheduled(async () => {
|
|
154
|
-
// runs daily at midnight
|
|
155
|
-
});
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Queue Consumers
|
|
159
|
-
|
|
160
|
-
```ts
|
|
161
|
-
// queues/emails.ts
|
|
162
|
-
import { defineQueue } from 'void';
|
|
163
|
-
|
|
164
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
165
|
-
for (const msg of batch.messages) {
|
|
166
|
-
// process each message
|
|
167
|
-
msg.ack();
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
```
|
|
111
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
171
112
|
|
|
172
113
|
### Environment Variables
|
|
173
114
|
|
|
174
|
-
Declare
|
|
115
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
175
116
|
|
|
176
117
|
## Accessing Bindings Directly
|
|
177
118
|
|
|
@@ -45,7 +45,7 @@ void auth login
|
|
|
45
45
|
void deploy
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Using Void
|
|
48
|
+
## Using Void Features
|
|
49
49
|
|
|
50
50
|
Most [Void platform features](../../guide/app-types.md#void-apps) work with TanStack Start. Use them in server functions:
|
|
51
51
|
|
|
@@ -63,71 +63,13 @@ const getUsers = createServerFn().handler(async () => {
|
|
|
63
63
|
});
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
###
|
|
66
|
+
### Other resources
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
import { createServerFn } from '@tanstack/react-start';
|
|
70
|
-
import { kv } from 'void/kv';
|
|
71
|
-
|
|
72
|
-
const getSettings = createServerFn().handler(async () => {
|
|
73
|
-
return kv.get('app:settings');
|
|
74
|
-
});
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Blob Storage
|
|
78
|
-
|
|
79
|
-
```tsx
|
|
80
|
-
import { createServerFn } from '@tanstack/react-start';
|
|
81
|
-
import { storage } from 'void/storage';
|
|
82
|
-
|
|
83
|
-
const getAvatar = createServerFn().handler(async () => {
|
|
84
|
-
return storage.get('avatars/user-1.png');
|
|
85
|
-
});
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### AI
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import { createServerFn } from '@tanstack/react-start';
|
|
92
|
-
import { ai } from 'void/ai';
|
|
93
|
-
|
|
94
|
-
const summarize = createServerFn().handler(async () => {
|
|
95
|
-
return ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
96
|
-
prompt: 'Summarize the latest news',
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Cron Jobs
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
// crons/daily-cleanup.ts
|
|
105
|
-
import { defineScheduled } from 'void';
|
|
106
|
-
|
|
107
|
-
export const cron = '0 0 * * *';
|
|
108
|
-
|
|
109
|
-
export default defineScheduled(async () => {
|
|
110
|
-
// runs daily at midnight
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Queue Consumers
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
// queues/emails.ts
|
|
118
|
-
import { defineQueue } from 'void';
|
|
119
|
-
|
|
120
|
-
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
121
|
-
for (const msg of batch.messages) {
|
|
122
|
-
// process each message
|
|
123
|
-
msg.ack();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
```
|
|
68
|
+
Use [KV](../../guide/kv.md), [object storage](../../guide/storage.md), and [AI](../../guide/ai.md) from server-side code with the same imports as a Void app. Add [cron jobs](../../guide/jobs.md) in `crons/` and [queue consumers](../../guide/queues.md) in `queues/`.
|
|
127
69
|
|
|
128
70
|
### Environment Variables
|
|
129
71
|
|
|
130
|
-
Declare
|
|
72
|
+
Declare variables in `env.ts` and read them with `import { env } from "void/env"`. See [Environment Variables](../../guide/env-vars.md) for local values, production secrets, and public `VITE_*` values.
|
|
131
73
|
|
|
132
74
|
## Accessing Bindings Directly
|
|
133
75
|
|