void 0.1.6 → 0.7.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/AGENT_PROMPT.md +15 -0
- package/README.md +62 -123
- package/dist/auth-BdsJ0Aff.d.mts +43 -0
- package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
- package/dist/auth-migrations-BAtAck2g.mjs +117 -0
- package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
- package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
- package/dist/cache-W82I8ihI.mjs +47 -0
- package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
- package/dist/cf-access-Dee5cXxL.mjs +22 -0
- package/dist/chunk-DJd-R1mw.mjs +34 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +1807 -0
- package/dist/client-snXOjrp1.mjs +565 -0
- package/dist/collect-CjeZgz5D.mjs +55 -0
- package/dist/config-BIa9HwVX.mjs +573 -0
- package/dist/config-BzM9Dy7T.mjs +37 -0
- package/dist/config-CvHtTM0q.mjs +30 -0
- package/dist/create-project-BIA15W7z.mjs +90 -0
- package/dist/db-DsRoMcfN.mjs +895 -0
- package/dist/defer-DcxEsVH1.mjs +49 -0
- package/dist/delete-DAP6yDc7.mjs +64 -0
- package/dist/deploy-BPKblFx6.mjs +2424 -0
- package/dist/discover-B7FkXBLB.mjs +40 -0
- package/dist/dist-DUyXJLkq.mjs +2667 -0
- package/dist/dist-Dayj3gCK.mjs +1287 -0
- package/dist/domain-BGofcQ6I.mjs +79 -0
- package/dist/dotenv-DwO4ti0Z.mjs +173 -0
- package/dist/drizzle-NnudE_UN.mjs +232 -0
- package/dist/env-CyG3tvU0.mjs +301 -0
- package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
- package/dist/env-raw-BDL4TvdN.mjs +32 -0
- package/dist/env-types-DknSA4SO.mjs +64 -0
- package/dist/env-validation-DJKjR_8q.mjs +163 -0
- package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
- package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
- package/dist/gen-U0Ktr4Zd.mjs +761 -0
- package/dist/handler-B0ds0OHJ.d.mts +269 -0
- package/dist/head-P-egrtFE.d.mts +45 -0
- package/dist/headers-DCXc7mDs.mjs +279 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.mjs +4695 -0
- package/dist/init-C7wS5iGP.mjs +2625 -0
- package/dist/link-p2R6NbgN.mjs +49 -0
- package/dist/list-Bfel-QLc.mjs +113 -0
- package/dist/log-DXdqnmhF.mjs +26 -0
- package/dist/login-CkcXUiIu.mjs +72 -0
- package/dist/logs-DmkrRvx6.mjs +98 -0
- package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
- package/dist/mcp-CaQzfeUi.mjs +373 -0
- package/dist/node-DDfXj10V.mjs +54 -0
- package/dist/output-BwlcIYSR.mjs +139 -0
- package/dist/pages/client.d.mts +198 -0
- package/dist/pages/client.mjs +980 -0
- package/dist/pages/head-client.d.mts +15 -0
- package/dist/pages/head-client.mjs +90 -0
- package/dist/pages/head.d.mts +2 -0
- package/dist/pages/head.mjs +112 -0
- package/dist/pages/index.d.mts +38 -0
- package/dist/pages/index.mjs +76 -0
- package/dist/pages/islands-plugin.d.mts +50 -0
- package/dist/pages/islands-plugin.mjs +195 -0
- package/dist/pages/prefetch.d.mts +31 -0
- package/dist/pages/prefetch.mjs +90 -0
- package/dist/pages/protocol.d.mts +3 -0
- package/dist/pages/protocol.mjs +193 -0
- package/dist/pages/serialize.d.mts +10 -0
- package/dist/pages/serialize.mjs +14 -0
- package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
- package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
- package/dist/prepare-BAtWufvm.mjs +99 -0
- package/dist/preset-D4I73kT4.mjs +221 -0
- package/dist/project-TqORyHn8.mjs +72 -0
- package/dist/project-cmd-B7lQp3F3.mjs +67 -0
- package/dist/project-slug-CKam8lF9.mjs +11 -0
- package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
- package/dist/protocol-BWzXs2A2.d.mts +34 -0
- package/dist/providers-B3aMxWzP.mjs +67 -0
- package/dist/resolve-project-Br5BR03U.mjs +29 -0
- package/dist/rollback-gyC59l7U.mjs +92 -0
- package/dist/route-types-DReF1gUY.mjs +255 -0
- package/dist/routes-stub.d.mts +55 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/runner-6Ep3fNQu.mjs +123 -0
- package/dist/runner-pg-D0wWHYnr.mjs +57 -0
- package/dist/runtime/ai.d.mts +127 -0
- package/dist/runtime/ai.mjs +348 -0
- package/dist/runtime/auth-client-react.d.mts +8 -0
- package/dist/runtime/auth-client-react.mjs +6 -0
- package/dist/runtime/auth-client-solid.d.mts +8 -0
- package/dist/runtime/auth-client-solid.mjs +6 -0
- package/dist/runtime/auth-client-svelte.d.mts +8 -0
- package/dist/runtime/auth-client-svelte.mjs +6 -0
- package/dist/runtime/auth-client-vue.d.mts +8 -0
- package/dist/runtime/auth-client-vue.mjs +6 -0
- package/dist/runtime/auth-client.d.mts +8 -0
- package/dist/runtime/auth-client.mjs +6 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +22 -0
- package/dist/runtime/better-auth-pg.d.mts +11 -0
- package/dist/runtime/better-auth-pg.mjs +51 -0
- package/dist/runtime/better-auth.d.mts +11 -0
- package/dist/runtime/better-auth.mjs +33 -0
- package/dist/runtime/client.d.mts +6 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +30 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/env-helpers.d.mts +2 -0
- package/dist/runtime/env-helpers.mjs +173 -0
- package/dist/runtime/env-public-client.d.mts +22 -0
- package/dist/runtime/env-public-client.mjs +54 -0
- package/dist/runtime/env-public.d.mts +143 -0
- package/dist/runtime/env-public.mjs +366 -0
- package/dist/runtime/env.d.mts +13 -0
- package/dist/runtime/env.mjs +51 -0
- package/dist/runtime/fetch-stream.d.mts +51 -0
- package/dist/runtime/fetch-stream.mjs +81 -0
- package/dist/runtime/fetch.d.mts +59 -0
- package/dist/runtime/fetch.mjs +18 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +85 -0
- package/dist/runtime/isr.d.mts +26 -0
- package/dist/runtime/isr.mjs +43 -0
- package/dist/runtime/kv.d.mts +48 -0
- package/dist/runtime/kv.mjs +106 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +31 -0
- package/dist/runtime/migration-handler-pg.d.mts +6 -0
- package/dist/runtime/migration-handler-pg.mjs +85 -0
- package/dist/runtime/migration-handler.d.mts +19 -0
- package/dist/runtime/migration-handler.mjs +92 -0
- package/dist/runtime/queues.d.mts +7 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +15 -0
- package/dist/runtime/remote/binding-handler.mjs +208 -0
- package/dist/runtime/remote/index.d.mts +8 -0
- package/dist/runtime/remote/index.mjs +461 -0
- package/dist/runtime/response.d.mts +14 -0
- package/dist/runtime/response.mjs +30 -0
- package/dist/runtime/sandbox.d.mts +17 -0
- package/dist/runtime/sandbox.mjs +19 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +30 -0
- package/dist/runtime/seed.mjs +6 -0
- package/dist/runtime/storage.d.mts +7 -0
- package/dist/runtime/storage.mjs +14 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +72 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +296 -0
- package/dist/runtime/ws.d.mts +123 -0
- package/dist/runtime/ws.mjs +103 -0
- package/dist/scan-Ba4hFwlH.mjs +324 -0
- package/dist/scan-C6HMEIdW.mjs +318 -0
- package/dist/secret-CeRSukgM.mjs +109 -0
- package/dist/skills-ipldjlKE.mjs +62 -0
- package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
- package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
- package/dist/sveltekit.d.mts +20 -0
- package/dist/sveltekit.mjs +61 -0
- package/dist/types-mHOEwpW4.d.mts +57 -0
- package/dist/validate-CaMavMxu.mjs +146 -0
- package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
- package/getting-started-prompt.txt +26 -0
- package/package.json +322 -30
- package/schema.json +364 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/SKILL.md +75 -0
- package/skills/void/command/void.md +7 -0
- package/skills/void/docs/guide/ai.md +235 -0
- package/skills/void/docs/guide/app-types.md +103 -0
- package/skills/void/docs/guide/auth.md +257 -0
- package/skills/void/docs/guide/database/d1.md +106 -0
- package/skills/void/docs/guide/database/postgresql.md +106 -0
- package/skills/void/docs/guide/database.md +418 -0
- package/skills/void/docs/guide/deployment.md +98 -0
- package/skills/void/docs/guide/edge/headers.md +79 -0
- package/skills/void/docs/guide/edge/prerendering.md +83 -0
- package/skills/void/docs/guide/edge/redirects.md +116 -0
- package/skills/void/docs/guide/edge/revalidation.md +131 -0
- package/skills/void/docs/guide/edge/rewrites.md +354 -0
- package/skills/void/docs/guide/edge/static-assets.md +72 -0
- package/skills/void/docs/guide/env-vars.md +298 -0
- package/skills/void/docs/guide/index.md +80 -0
- package/skills/void/docs/guide/jobs.md +91 -0
- package/skills/void/docs/guide/kv.md +107 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
- package/skills/void/docs/guide/pages-routing/head.md +130 -0
- package/skills/void/docs/guide/pages-routing/islands.md +405 -0
- package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
- package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
- package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
- package/skills/void/docs/guide/pages-routing/overview.md +236 -0
- package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
- package/skills/void/docs/guide/queues.md +140 -0
- package/skills/void/docs/guide/quickstart.md +233 -0
- package/skills/void/docs/guide/remote-dev.md +67 -0
- package/skills/void/docs/guide/sandboxes.md +82 -0
- package/skills/void/docs/guide/server-routing.md +246 -0
- package/skills/void/docs/guide/ssg.md +74 -0
- package/skills/void/docs/guide/ssr.md +105 -0
- package/skills/void/docs/guide/storage.md +67 -0
- package/skills/void/docs/guide/type-safety.md +179 -0
- package/skills/void/docs/guide/typed-fetch.md +113 -0
- package/skills/void/docs/guide/websockets.md +190 -0
- package/skills/void/docs/index.md +48 -0
- package/skills/void/docs/integrations/agents.md +84 -0
- package/skills/void/docs/integrations/cloudflare.md +284 -0
- package/skills/void/docs/integrations/frameworks/analog.md +182 -0
- package/skills/void/docs/integrations/frameworks/astro.md +197 -0
- package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
- package/skills/void/docs/integrations/frameworks/overview.md +136 -0
- package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
- package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
- package/skills/void/docs/integrations/hono.md +97 -0
- package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
- package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
- package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
- package/skills/void/docs/node_modules/vitepress/README.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
- package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
- package/skills/void/docs/node_modules/void/README.md +89 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
- package/skills/void/docs/reference/api.md +917 -0
- package/skills/void/docs/reference/cli.md +561 -0
- package/skills/void/docs/reference/config.md +408 -0
- package/skills/void/docs/reference/resource-inference.md +149 -0
- package/skills/void/docs/reference/structure.md +176 -0
- package/.npmignore +0 -29
- package/.travis.yml +0 -9
- package/favicon.ico +0 -0
- package/index.js +0 -14
- package/lib/Job.js +0 -150
- package/lib/Void.js +0 -99
- package/lib/scan.js +0 -19
- package/test/credentials.js +0 -20
- package/test/job.js +0 -64
- package/test/static/dir1/test6.html +0 -0
- package/test/static/dir2/test7.html +0 -0
- package/test/static/dir2/test8.html +0 -0
- package/test/static/dir2/test9.html +0 -0
- package/test/static/test1.html +0 -0
- package/test/static/test2.html +0 -0
- package/test/static/test3.html +0 -0
- package/test/void.js +0 -31
- /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
- /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Analog
|
|
6
|
+
|
|
7
|
+
[Analog](https://analogjs.org/) is a Vite-based Angular meta-framework powered by Nitro. Add `voidPlugin()` to the Vite config for binding inference, typed DB, and migrations during development.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
### 1. Create a new project
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx create-analog@latest my-app
|
|
15
|
+
cd my-app
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 2. Install dependencies
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -D void wrangler nitro-cloudflare-dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `wrangler` dependency is needed for local Cloudflare bindings. `nitro-cloudflare-dev` creates a Cloudflare platform proxy during dev so that `void/db`, `void/kv`, and other runtime helpers can access bindings.
|
|
25
|
+
|
|
26
|
+
### 3. Configure `vite.config.ts`
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { resolve } from 'node:path';
|
|
30
|
+
import { defineConfig } from 'vite';
|
|
31
|
+
import analog from '@analogjs/platform';
|
|
32
|
+
import { voidPlugin } from 'void';
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
resolve: {
|
|
36
|
+
mainFields: ['module'],
|
|
37
|
+
},
|
|
38
|
+
plugins: [
|
|
39
|
+
analog({
|
|
40
|
+
ssr: true,
|
|
41
|
+
nitro: {
|
|
42
|
+
preset: 'cloudflare-module',
|
|
43
|
+
modules: ['nitro-cloudflare-dev'],
|
|
44
|
+
alias: {
|
|
45
|
+
// Nitro has its own bundler that doesn't use Vite aliases.
|
|
46
|
+
// Duplicate @schema here so Nitro can resolve it.
|
|
47
|
+
'@schema': resolve(__dirname, 'db/schema.ts'),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
voidPlugin(),
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4. Create `wrangler.jsonc`
|
|
57
|
+
|
|
58
|
+
`voidPlugin()` auto-syncs inferred bindings into this file on dev startup:
|
|
59
|
+
|
|
60
|
+
```jsonc
|
|
61
|
+
{
|
|
62
|
+
"name": "my-app",
|
|
63
|
+
"compatibility_date": "2026-02-24",
|
|
64
|
+
"compatibility_flags": ["nodejs_compat", "nodejs_als"],
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`nodejs_compat` is required for Nitro's Cloudflare runtime. `nodejs_als` is required for `void/*` runtime helpers (e.g. `void/db`, `void/kv`).
|
|
69
|
+
|
|
70
|
+
### 5. Deploy
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
void auth login
|
|
74
|
+
void deploy
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Using Void Platform Features
|
|
78
|
+
|
|
79
|
+
Most [Void platform features](../../guide/app-types.md#void-apps) work with Analog. Use them in page server loaders, actions, and API routes:
|
|
80
|
+
|
|
81
|
+
Void-managed auth is not supported in framework mode yet. Use Better Auth's official integration directly for now.
|
|
82
|
+
|
|
83
|
+
### Database
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
// src/app/pages/users.server.ts
|
|
87
|
+
import type { PageServerLoad } from '@analogjs/router';
|
|
88
|
+
import { db } from 'void/db';
|
|
89
|
+
import { users } from '@schema';
|
|
90
|
+
|
|
91
|
+
export const load = async ({ event }: PageServerLoad) => {
|
|
92
|
+
return { users: await db.select().from(users) };
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
::: warning ⚠️ Analog limitation
|
|
97
|
+
Analog uses Nitro, which bundles server routes outside of Vite's plugin pipeline. The schema cannot be injected into the `db` instance, so `db.query.*` relational queries are not available in Analog. Use the standard query builder API (`db.select().from(table)`) instead.
|
|
98
|
+
:::
|
|
99
|
+
|
|
100
|
+
### KV Storage
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import type { PageServerLoad } from '@analogjs/router';
|
|
104
|
+
import { kv } from 'void/kv';
|
|
105
|
+
|
|
106
|
+
export const load = async ({ event }: PageServerLoad) => {
|
|
107
|
+
return { settings: await kv.get('app:settings') };
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Blob Storage
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import type { PageServerLoad } from '@analogjs/router';
|
|
115
|
+
import { storage } from 'void/storage';
|
|
116
|
+
|
|
117
|
+
export const load = async ({ event }: PageServerLoad) => {
|
|
118
|
+
return { avatar: await storage.get('avatars/user-1.png') };
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### AI
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
// src/server/routes/api/summarize.ts
|
|
126
|
+
import { eventHandler } from 'h3';
|
|
127
|
+
import { ai } from 'void/ai';
|
|
128
|
+
|
|
129
|
+
export default eventHandler(async () => {
|
|
130
|
+
return ai.run('@cf/meta/llama-3.1-8b-instruct', {
|
|
131
|
+
prompt: 'Summarize the latest news',
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Cron Jobs
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
// crons/daily-cleanup.ts
|
|
140
|
+
import { defineScheduled } from 'void';
|
|
141
|
+
|
|
142
|
+
export const cron = '0 0 * * *';
|
|
143
|
+
|
|
144
|
+
export default defineScheduled(async () => {
|
|
145
|
+
// runs daily at midnight
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Queue Consumers
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
// queues/emails.ts
|
|
153
|
+
import { defineQueue } from 'void';
|
|
154
|
+
|
|
155
|
+
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
156
|
+
for (const msg of batch.messages) {
|
|
157
|
+
// process each message
|
|
158
|
+
msg.ack();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Environment Variables
|
|
164
|
+
|
|
165
|
+
Void gives you a typed env layer: declare keys in `env.ts`, read them via `import { env } from "void/env"`, and get schema validation at build + deploy time plus a client-leak guard that fails the build if a server-only key reaches the browser. See the [env vars guide](../../guide/env-vars.md) for the full feature set.
|
|
166
|
+
|
|
167
|
+
`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.).
|
|
168
|
+
|
|
169
|
+
## Accessing Bindings Directly
|
|
170
|
+
|
|
171
|
+
You can also access raw Cloudflare bindings via the H3 event context or the `cloudflare:workers` module:
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
// src/server/routes/api/users.ts
|
|
175
|
+
import { eventHandler } from 'h3';
|
|
176
|
+
import { env } from 'cloudflare:workers';
|
|
177
|
+
|
|
178
|
+
export default eventHandler(async () => {
|
|
179
|
+
const { results } = await env.DB.prepare('SELECT * FROM users').all();
|
|
180
|
+
return results;
|
|
181
|
+
});
|
|
182
|
+
```
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Astro
|
|
6
|
+
|
|
7
|
+
[Astro](https://astro.build/) has its own CLI and Cloudflare adapter (`@astrojs/cloudflare`). Add `voidPlugin()` to Astro's Vite config for binding inference, typed DB, and migrations during development.
|
|
8
|
+
|
|
9
|
+
::: warning Astro 6 required
|
|
10
|
+
|
|
11
|
+
- [Astro 6+](https://astro.build/blog/astro-6/) is required to use `import { x } from "void/x"` helpers in Astro apps.
|
|
12
|
+
- You also need to enable `"nodejs_als"` under `compatibility_flags` in your wrangler config.
|
|
13
|
+
:::
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
### 1. Create a new project
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm create astro@latest my-app
|
|
21
|
+
cd my-app
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Install dependencies
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -D @astrojs/cloudflare void
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 3. Configure `astro.config.mjs`
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { defineConfig } from 'astro/config';
|
|
34
|
+
import cloudflare from '@astrojs/cloudflare';
|
|
35
|
+
import { voidPlugin } from 'void';
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
adapter: cloudflare(),
|
|
39
|
+
vite: { plugins: [voidPlugin()] },
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
By default, Astro Cloudflare runtime and `voidPlugin()` migrations share Wrangler's local state at `.wrangler/state/v3`, so no extra persistence configuration is required.
|
|
44
|
+
|
|
45
|
+
### 4. Create `wrangler.jsonc`
|
|
46
|
+
|
|
47
|
+
`voidPlugin()` auto-syncs inferred bindings into this file on dev startup:
|
|
48
|
+
|
|
49
|
+
```jsonc
|
|
50
|
+
{
|
|
51
|
+
"name": "my-app",
|
|
52
|
+
"compatibility_date": "2026-02-24",
|
|
53
|
+
"compatibility_flags": ["nodejs_als"],
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`nodejs_als` is required for `void/*` runtime helpers (for example `void/db`, `void/kv`) in Astro.
|
|
58
|
+
|
|
59
|
+
### 5. Deploy
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
void auth login
|
|
63
|
+
void deploy
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Using Void Platform Features
|
|
67
|
+
|
|
68
|
+
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`.
|
|
69
|
+
|
|
70
|
+
Void-managed auth is not supported in framework mode yet. Use Better Auth's official Astro integration directly for now.
|
|
71
|
+
|
|
72
|
+
Pages that access runtime bindings must opt out of prerendering:
|
|
73
|
+
|
|
74
|
+
```astro
|
|
75
|
+
---
|
|
76
|
+
export const prerender = false;
|
|
77
|
+
// now Astro.locals.runtime is available
|
|
78
|
+
---
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Database
|
|
82
|
+
|
|
83
|
+
Use `void/db` in API routes and server-side code:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import type { APIRoute } from 'astro';
|
|
87
|
+
import { db } from 'void/db';
|
|
88
|
+
import { users } from '@schema';
|
|
89
|
+
|
|
90
|
+
export const GET: APIRoute = async () => {
|
|
91
|
+
const rows = await db.select().from(users);
|
|
92
|
+
return Response.json(rows);
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### KV Storage
|
|
97
|
+
|
|
98
|
+
Use `void/kv` in both dev and production:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import type { APIRoute } from 'astro';
|
|
102
|
+
import { kv } from 'void/kv';
|
|
103
|
+
|
|
104
|
+
export const GET: APIRoute = async () => {
|
|
105
|
+
const settings = await kv.get('app:settings');
|
|
106
|
+
return Response.json(settings);
|
|
107
|
+
};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Blob Storage
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
import type { APIRoute } from 'astro';
|
|
114
|
+
import { storage } from 'void/storage';
|
|
115
|
+
|
|
116
|
+
export const GET: APIRoute = async () => {
|
|
117
|
+
const avatar = await storage.get('avatars/user-1.png');
|
|
118
|
+
return new Response(avatar);
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### AI
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import type { APIRoute } from 'astro';
|
|
126
|
+
import { ai } from 'void/ai';
|
|
127
|
+
|
|
128
|
+
export const POST: APIRoute = async () => {
|
|
129
|
+
const result = await ai.run('@cf/meta/llama-3.1-8b-instruct', {
|
|
130
|
+
prompt: 'Summarize the latest news',
|
|
131
|
+
});
|
|
132
|
+
return Response.json(result);
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Cron Jobs
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
// crons/daily-cleanup.ts
|
|
140
|
+
import { defineScheduled } from 'void';
|
|
141
|
+
|
|
142
|
+
export const cron = '0 0 * * *';
|
|
143
|
+
|
|
144
|
+
export default defineScheduled(async () => {
|
|
145
|
+
// runs daily at midnight
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Queue Consumers
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
// queues/emails.ts
|
|
153
|
+
import { defineQueue } from 'void';
|
|
154
|
+
|
|
155
|
+
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
156
|
+
for (const msg of batch.messages) {
|
|
157
|
+
// process each message
|
|
158
|
+
msg.ack();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Environment Variables
|
|
164
|
+
|
|
165
|
+
Void gives you a typed env layer: declare keys in `env.ts`, read them via `import { env } from "void/env"`, and get schema validation at build + deploy time plus a client-leak guard that fails the build if a server-only key reaches the browser. See the [env vars guide](../../guide/env-vars.md) for the full feature set.
|
|
166
|
+
|
|
167
|
+
Astro-specific note: the client prefix is `PUBLIC_*` (Astro's default `envPrefix`), not `VITE_*` — name client-exposed keys accordingly and the leak guard + constant folding honour the prefix automatically.
|
|
168
|
+
|
|
169
|
+
`void/env` replaces [`astro:env`](https://docs.astro.build/en/guides/environment-variables/) and `Astro.locals.runtime.env` for env-var access. Keep `Astro.locals.runtime.env` around when you need raw binding access (D1, KV, R2, etc.).
|
|
170
|
+
|
|
171
|
+
## Accessing Bindings Directly
|
|
172
|
+
|
|
173
|
+
Access bindings via `Astro.locals.runtime.env` (works in both dev and production):
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import type { APIRoute } from 'astro';
|
|
177
|
+
|
|
178
|
+
export const GET: APIRoute = async ({ locals }) => {
|
|
179
|
+
const { DB } = locals.runtime.env;
|
|
180
|
+
const { results } = await DB.prepare('SELECT * FROM users').all();
|
|
181
|
+
return Response.json(results);
|
|
182
|
+
};
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
In `.astro` pages (remember to set `prerender = false`):
|
|
186
|
+
|
|
187
|
+
```astro
|
|
188
|
+
---
|
|
189
|
+
export const prerender = false;
|
|
190
|
+
const { DB } = Astro.locals.runtime.env;
|
|
191
|
+
const { results } = await DB.prepare("SELECT * FROM users").all();
|
|
192
|
+
---
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
::: tip Direct Binding Access
|
|
196
|
+
`Astro.locals.runtime.env` is still useful when you need direct access to raw Cloudflare bindings.
|
|
197
|
+
:::
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Nuxt
|
|
6
|
+
|
|
7
|
+
[Nuxt](https://nuxt.com/) has its own CLI and build system based on Nitro. Add `voidPlugin()` to Nuxt's Vite config for binding inference, typed DB, and migrations during development.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
### 1. Create a new project
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm create nuxt@latest my-app
|
|
15
|
+
cd my-app
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 2. Install dependencies
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -D void wrangler
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `wrangler` dependency is needed by Nuxt to create Cloudflare platform proxy during dev.
|
|
25
|
+
|
|
26
|
+
### 3. Configure `nuxt.config.ts`
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { resolve } from 'node:path';
|
|
30
|
+
import { voidPlugin } from 'void';
|
|
31
|
+
|
|
32
|
+
export default defineNuxtConfig({
|
|
33
|
+
nitro: {
|
|
34
|
+
preset: 'cloudflare-module',
|
|
35
|
+
alias: {
|
|
36
|
+
// Nitro has its own bundler that doesn't use Vite aliases.
|
|
37
|
+
// Duplicate @schema here so Nitro can resolve it.
|
|
38
|
+
'@schema': resolve(__dirname, 'db/schema.ts'),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
vite: { plugins: [voidPlugin()] },
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
By default, Nuxt Cloudflare dev runtime and `voidPlugin()` migrations share Wrangler's local state at `.wrangler/state/v3`, so no extra persistence configuration is required.
|
|
46
|
+
|
|
47
|
+
### 4. Create `wrangler.jsonc`
|
|
48
|
+
|
|
49
|
+
`voidPlugin()` auto-syncs inferred bindings into this file on dev startup:
|
|
50
|
+
|
|
51
|
+
```jsonc
|
|
52
|
+
{
|
|
53
|
+
"name": "my-app",
|
|
54
|
+
"compatibility_date": "2026-02-24",
|
|
55
|
+
"compatibility_flags": ["nodejs_compat", "nodejs_als"],
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 5. Deploy
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
void auth login
|
|
63
|
+
void deploy
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Using Void Platform Features
|
|
67
|
+
|
|
68
|
+
Most [Void platform features](../../guide/app-types.md#void-apps) work with Nuxt. Use them in server routes, API handlers, and middleware:
|
|
69
|
+
|
|
70
|
+
Void-managed auth is not supported in framework mode yet. Use Better Auth's official Nuxt integration directly for now.
|
|
71
|
+
|
|
72
|
+
### Database
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
// server/api/users.get.ts
|
|
76
|
+
import { db } from 'void/db';
|
|
77
|
+
import { users } from '@schema';
|
|
78
|
+
|
|
79
|
+
export default defineEventHandler(async () => {
|
|
80
|
+
return db.select().from(users);
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
::: warning ⚠️ Nuxt limitation
|
|
85
|
+
Nuxt uses Nitro, which bundles server routes outside of Vite's plugin pipeline. The schema cannot be injected into the `db` instance, so `db.query.*` relational queries are not available in Nuxt. Use the standard query builder API (`db.select().from(table)`) instead.
|
|
86
|
+
:::
|
|
87
|
+
|
|
88
|
+
### KV Storage
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { kv } from 'void/kv';
|
|
92
|
+
|
|
93
|
+
export default defineEventHandler(async () => {
|
|
94
|
+
return kv.get('app:settings');
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Blob Storage
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { storage } from 'void/storage';
|
|
102
|
+
|
|
103
|
+
export default defineEventHandler(async () => {
|
|
104
|
+
return storage.get('avatars/user-1.png');
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### AI
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import { ai } from 'void/ai';
|
|
112
|
+
|
|
113
|
+
export default defineEventHandler(async () => {
|
|
114
|
+
return ai.run('@cf/meta/llama-3.1-8b-instruct', {
|
|
115
|
+
prompt: 'Summarize the latest news',
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Cron Jobs
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// crons/daily-cleanup.ts
|
|
124
|
+
import { defineScheduled } from 'void';
|
|
125
|
+
|
|
126
|
+
export const cron = '0 0 * * *';
|
|
127
|
+
|
|
128
|
+
export default defineScheduled(async () => {
|
|
129
|
+
// runs daily at midnight
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Queue Consumers
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
// queues/emails.ts
|
|
137
|
+
import { defineQueue } from 'void';
|
|
138
|
+
|
|
139
|
+
export default defineQueue<{ to: string; subject: string }>(async (batch) => {
|
|
140
|
+
for (const msg of batch.messages) {
|
|
141
|
+
// process each message
|
|
142
|
+
msg.ack();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Environment Variables
|
|
148
|
+
|
|
149
|
+
Void gives you a typed env layer: declare keys in `env.ts`, read them via `import { env } from "void/env"`, and get schema validation at build + deploy time plus a client-leak guard that fails the build if a server-only key reaches the browser. See the [env vars guide](../../guide/env-vars.md) for the full feature set.
|
|
150
|
+
|
|
151
|
+
`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.
|
|
152
|
+
|
|
153
|
+
## Accessing Bindings Directly
|
|
154
|
+
|
|
155
|
+
You can also access raw Cloudflare bindings via Nitro's event context:
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
// server/api/users.get.ts
|
|
159
|
+
export default defineEventHandler(async (event) => {
|
|
160
|
+
const { DB } = event.context.cloudflare.env;
|
|
161
|
+
const { results } = await DB.prepare('SELECT * FROM users').all();
|
|
162
|
+
return results;
|
|
163
|
+
});
|
|
164
|
+
```
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Meta-Frameworks
|
|
6
|
+
|
|
7
|
+
Use this section when your app already has a framework that owns routing and rendering. Void does not try to replace that layer. Instead, it plugs into the Vite build and deployment pipeline so you still get the platform features that matter on the backend.
|
|
8
|
+
|
|
9
|
+
Void supports deploying meta-framework apps with `void deploy`. Add `voidPlugin()` to your framework's Vite config to get binding inference, typed DB generation, migration management, cron jobs, queues, and caching.
|
|
10
|
+
|
|
11
|
+
Some frameworks, such as TanStack Start and React Router, compose directly with `@cloudflare/vite-plugin`, which Void already covers. Others, such as SvelteKit, Nuxt, Analog, and Astro, bring their own Cloudflare integrations. In both cases, the framework stays in charge of routing and rendering. Void handles the platform-facing pieces around it.
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## Supported Frameworks
|
|
16
|
+
|
|
17
|
+
| Framework | Package | Integration |
|
|
18
|
+
| --------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------- |
|
|
19
|
+
| [TanStack Start](https://tanstack.com/start/latest) | `@tanstack/react-start` | Vite plugin composition. `voidPlugin()` runs alongside the framework plugin. |
|
|
20
|
+
| [React Router v7](https://reactrouter.com/) | `@react-router/dev` | Vite plugin composition. Setup matches TanStack Start. |
|
|
21
|
+
| [SvelteKit](https://svelte.dev/docs/kit) | `@sveltejs/kit` | Vite-based, uses its own Cloudflare adapter |
|
|
22
|
+
| [Nuxt](https://nuxt.com/) | `nuxt` | Own CLI and build toolchain |
|
|
23
|
+
| [Analog](https://analogjs.org/) | `@analogjs/platform` | Vite-based, uses Nitro with Cloudflare preset |
|
|
24
|
+
| [Astro **v6+**](https://astro.build/) | `astro` | Own CLI and Cloudflare adapter (v6 required) |
|
|
25
|
+
|
|
26
|
+
Detection is automatic. The CLI reads your `package.json` dependencies.
|
|
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
|
+
## Feature Support
|
|
38
|
+
|
|
39
|
+
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
|
+
|
|
41
|
+
- **Binding inference:** D1, KV, R2, AI, and queues are detected from source code.
|
|
42
|
+
- **Typed database:** query helpers are generated from `db/migrations/*.sql`.
|
|
43
|
+
- **Migrations:** local D1 is updated on dev startup, and migrations are validated and deployed with `void deploy`.
|
|
44
|
+
- **Runtime helpers:** `void/db`, `void/kv`, `void/storage`, and `void/ai` give you typed access to Cloudflare bindings in dev and production.
|
|
45
|
+
- **Auth:** Void-managed auth is not supported in framework mode yet. For now, use Better Auth's official integration for your framework.
|
|
46
|
+
- **Cron jobs:** scheduled handlers via the `crons/` directory.
|
|
47
|
+
- **Queue consumers:** typed producers and consumers via the `queues/` directory.
|
|
48
|
+
- **Revalidation and prerendering:** configure them with [`routing.revalidate`](../../guide/edge/revalidation.md) and [`routing.prerender`](../../guide/edge/prerendering.md) in `void.json`. Void apps can also set these per page in component files.
|
|
49
|
+
|
|
50
|
+
Frameworks can also access bindings directly via the framework's own mechanisms (e.g. `platform.env` in SvelteKit, `event.context.cloudflare.env` in Nuxt, `env` from `cloudflare:workers` in Analog, `Astro.locals.runtime.env` in Astro).
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
### `void.json`
|
|
55
|
+
|
|
56
|
+
Most configuration is inferred automatically. Use `void.json` to override defaults or fine-tune behavior:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"$schema": "https://unpkg.com/void/schema.json",
|
|
61
|
+
"inference": {
|
|
62
|
+
"build": "nuxt build",
|
|
63
|
+
"scanDirs": ["src", "server", "lib"],
|
|
64
|
+
"bindings": { "db": "MY_DB" }
|
|
65
|
+
},
|
|
66
|
+
"routing": {
|
|
67
|
+
"prerender": ["/", "/about", "/pricing"],
|
|
68
|
+
"revalidate": 60
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Field | Purpose |
|
|
74
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `inference.build` | Override the default build command |
|
|
76
|
+
| `inference.scanDirs` | Directories to scan for binding inference (defaults vary by framework) |
|
|
77
|
+
| `routing.prerender` | Paths to prerender as static HTML at deploy time |
|
|
78
|
+
| `routing.revalidate` | Default revalidation TTL in seconds for cached responses |
|
|
79
|
+
| `inference.bindings` | Override inferred bindings. You only need this if auto-detection is not doing what you want. Accepts `true` or a custom binding name such as `"db": "MY_DB"`. |
|
|
80
|
+
|
|
81
|
+
See [Configuration](../../reference/config.md) for the full reference.
|
|
82
|
+
|
|
83
|
+
### `wrangler.jsonc`
|
|
84
|
+
|
|
85
|
+
Frameworks that use Cloudflare's dev runtime for local dev (SvelteKit, Nuxt with `nitro-cloudflare-dev`, Astro) need a `wrangler.jsonc` for binding configuration. `voidPlugin()` auto-syncs inferred bindings into this file on dev startup:
|
|
86
|
+
|
|
87
|
+
```jsonc
|
|
88
|
+
{
|
|
89
|
+
"name": "my-app",
|
|
90
|
+
"compatibility_date": "2026-02-24",
|
|
91
|
+
"compatibility_flags": ["nodejs_compat"],
|
|
92
|
+
// Bindings below are auto-managed by voidPlugin()
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Existing bindings are preserved. Only missing ones are added with local placeholder IDs.
|
|
97
|
+
|
|
98
|
+
For `void deploy`, compatibility settings are read from `wrangler.jsonc` automatically (no need to duplicate them in `void.json`).
|
|
99
|
+
|
|
100
|
+
## Deploy Pipeline
|
|
101
|
+
|
|
102
|
+
SvelteKit, Nuxt, Analog, and Astro apps follow this pipeline:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
void deploy
|
|
106
|
+
│
|
|
107
|
+
├─ 1. Detect framework
|
|
108
|
+
│ Reads package.json → determines framework + output conventions
|
|
109
|
+
│
|
|
110
|
+
├─ 2. Build
|
|
111
|
+
│ Runs framework's build command (or void.json `build` override)
|
|
112
|
+
│ SvelteKit: vite build → .svelte-kit/cloudflare/
|
|
113
|
+
│ Nuxt: nuxt build → .output/
|
|
114
|
+
│ Analog: vite build → dist/analog/
|
|
115
|
+
│ Astro: astro build → dist/
|
|
116
|
+
│
|
|
117
|
+
├─ 3. Analyze
|
|
118
|
+
│ ├─ Locate worker entry + static assets from known output paths
|
|
119
|
+
│ ├─ Infer bindings from source or read from void.json
|
|
120
|
+
│ ├─ Collect migrations from db/migrations/*.sql
|
|
121
|
+
│ ├─ Detect cron and queue handlers
|
|
122
|
+
│ └─ Read wrangler.jsonc compat settings
|
|
123
|
+
│
|
|
124
|
+
├─ 4. Wrap (if needed)
|
|
125
|
+
│ If crons or queues are configured:
|
|
126
|
+
│ ├─ Generate wrapper entry module
|
|
127
|
+
│ ├─ Bundle with Vite (wraps framework's worker)
|
|
128
|
+
│ └─ Wrapper adds scheduled/queue handlers
|
|
129
|
+
│
|
|
130
|
+
├─ 5. Package + upload
|
|
131
|
+
│ Same as full-stack: hash-based asset diffing,
|
|
132
|
+
│ multipart upload, platform provisioning
|
|
133
|
+
│
|
|
134
|
+
└─ 6. Live
|
|
135
|
+
https://my-app.void.app
|
|
136
|
+
```
|