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,408 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Config
|
|
6
|
+
|
|
7
|
+
## Config File Format
|
|
8
|
+
|
|
9
|
+
Use this page as the exact reference for `void.json`. If you are still learning how the pieces fit together, start in the guide first and come back here when you need field-by-field details.
|
|
10
|
+
|
|
11
|
+
Project-level configuration lives in a `void.json` file at the project root. Most fields are optional. Cloudflare-targeted apps must pin a Workers `compatibility_date` in `worker.compatibility_date` or in a supported wrangler fallback file (`wrangler.jsonc` or `wrangler.json`). If no date is configured, Void writes the latest known-good date to `void.json` so future runs stay explicit and stable.
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"$schema": "./node_modules/void/schema.json",
|
|
16
|
+
"target": "cloudflare",
|
|
17
|
+
"auth": {
|
|
18
|
+
"providers": ["email", "github", "google"]
|
|
19
|
+
},
|
|
20
|
+
"routing": {
|
|
21
|
+
"revalidate": { "/": 60, "*": 30 },
|
|
22
|
+
"headers": {
|
|
23
|
+
"/assets/*": ["Cache-Control: public, max-age=31536000, immutable"],
|
|
24
|
+
"/*": ["X-Frame-Options: DENY", "X-Content-Type-Options: nosniff"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"inference": {
|
|
28
|
+
"bindings": { "db": true, "kv": false },
|
|
29
|
+
"appType": "spa",
|
|
30
|
+
"outputDir": "dist"
|
|
31
|
+
},
|
|
32
|
+
"worker": {
|
|
33
|
+
"compatibility_date": "2025-12-01",
|
|
34
|
+
"compatibility_flags": ["nodejs_compat"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add the `$schema` field for autocomplete and validation in your editor.
|
|
40
|
+
|
|
41
|
+
## Fields
|
|
42
|
+
|
|
43
|
+
### `auth`
|
|
44
|
+
|
|
45
|
+
High-level Better Auth configuration.
|
|
46
|
+
|
|
47
|
+
Use `auth.providers` to select which built-in auth providers Void should enable by default. Include `"email"` for email/password auth. Social providers read credentials from `AUTH_<PROVIDER>_CLIENT_ID` and `AUTH_<PROVIDER>_CLIENT_SECRET`.
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"auth": {
|
|
52
|
+
"providers": ["email", "github", "google", "discord"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If `auth` is omitted but auth is active via imports, Void enables email/password only. For provider-specific options, scopes, plugins, or custom OAuth flows, use a root `auth.ts` with `defineAuth(...)`.
|
|
58
|
+
|
|
59
|
+
Supported values for `auth.providers`:
|
|
60
|
+
|
|
61
|
+
- `email`
|
|
62
|
+
- `apple`
|
|
63
|
+
- `atlassian`
|
|
64
|
+
- `cognito`
|
|
65
|
+
- `discord`
|
|
66
|
+
- `dropbox`
|
|
67
|
+
- `facebook`
|
|
68
|
+
- `figma`
|
|
69
|
+
- `github`
|
|
70
|
+
- `gitlab`
|
|
71
|
+
- `google`
|
|
72
|
+
- `huggingface`
|
|
73
|
+
- `kakao`
|
|
74
|
+
- `kick`
|
|
75
|
+
- `line`
|
|
76
|
+
- `linear`
|
|
77
|
+
- `linkedin`
|
|
78
|
+
- `microsoft`
|
|
79
|
+
- `naver`
|
|
80
|
+
- `notion`
|
|
81
|
+
- `paybin`
|
|
82
|
+
- `paypal`
|
|
83
|
+
- `polar`
|
|
84
|
+
- `railway`
|
|
85
|
+
- `reddit`
|
|
86
|
+
- `roblox`
|
|
87
|
+
- `salesforce`
|
|
88
|
+
- `slack`
|
|
89
|
+
- `spotify`
|
|
90
|
+
- `tiktok`
|
|
91
|
+
- `twitch`
|
|
92
|
+
- `twitter`
|
|
93
|
+
- `vercel`
|
|
94
|
+
- `vk`
|
|
95
|
+
- `zoom`
|
|
96
|
+
|
|
97
|
+
### `database`
|
|
98
|
+
|
|
99
|
+
Database backend. Omit for D1/SQLite (default). Set to `"pg"` for PostgreSQL via Hyperdrive.
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"database": "pg"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
| Value | Description |
|
|
108
|
+
| ----------- | ------------------------------------------------------- |
|
|
109
|
+
| _(omitted)_ | D1 (SQLite), fully managed by Void with no extra config |
|
|
110
|
+
| `"pg"` | PostgreSQL via Hyperdrive; bring your own database |
|
|
111
|
+
|
|
112
|
+
When using `"pg"`:
|
|
113
|
+
|
|
114
|
+
- Add `DATABASE_URL` to `.env.local` for local development
|
|
115
|
+
- Import schema helpers from `void/schema-pg` instead of `void/schema-d1`
|
|
116
|
+
- `void/db` connects via Hyperdrive in production, direct connection locally
|
|
117
|
+
- `void gen model` generates `pgTable` with `serial`, `timestamp`, etc.
|
|
118
|
+
|
|
119
|
+
### `head`
|
|
120
|
+
|
|
121
|
+
Site-wide HTML `<head>` defaults for pages mode. Sets a title template, default meta tags, links, scripts, and HTML/body attributes. Per-page `head()` exports and middleware defaults merge on top of these with clear precedence: **page > middleware > config**.
|
|
122
|
+
|
|
123
|
+
| Field | Type | Description |
|
|
124
|
+
| --------------- | ------------------------ | ---------------------------------------------------------------- |
|
|
125
|
+
| `title` | `string` | Default page title (overridden by page `head()`) |
|
|
126
|
+
| `titleTemplate` | `string` | Wraps the resolved title. `%s` is replaced with the page title. |
|
|
127
|
+
| `meta` | `Array<object>` | Default `<meta>` tags (deduped by `name`/`property`, page wins) |
|
|
128
|
+
| `link` | `Array<object>` | Default `<link>` tags (concatenated: config, middleware, page) |
|
|
129
|
+
| `script` | `Array<object>` | Default `<script>` tags (concatenated: config, middleware, page) |
|
|
130
|
+
| `htmlAttrs` | `Record<string, string>` | Attributes on `<html>` (shallow merge, page wins) |
|
|
131
|
+
| `bodyAttrs` | `Record<string, string>` | Attributes on `<body>` (shallow merge, page wins) |
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"head": {
|
|
136
|
+
"titleTemplate": "%s | My Site",
|
|
137
|
+
"htmlAttrs": { "lang": "en" },
|
|
138
|
+
"meta": [
|
|
139
|
+
{ "charset": "utf-8" },
|
|
140
|
+
{ "name": "viewport", "content": "width=device-width, initial-scale=1" }
|
|
141
|
+
],
|
|
142
|
+
"link": [{ "rel": "icon", "href": "/favicon.svg" }]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
See [Head Management](../guide/pages-routing/head) for the full merge behavior, `HeadDescriptor` shape, and per-page usage.
|
|
148
|
+
|
|
149
|
+
### `output`
|
|
150
|
+
|
|
151
|
+
Output mode. Controls the default rendering strategy for pages.
|
|
152
|
+
|
|
153
|
+
| Value | Default prerender | Per-page override | Prerender timing |
|
|
154
|
+
| -------------------- | ----------------- | -------------------------------- | -------------------------- |
|
|
155
|
+
| `"server"` (default) | `false` | `export const prerender = true` | Deploy-time (platform ISR) |
|
|
156
|
+
| `"static"` | `true` | `export const prerender = false` | Build-time (`vite build`) |
|
|
157
|
+
|
|
158
|
+
When set to `"static"`, all pages are prerendered at build time as static HTML files written to `dist/client/`. Individual pages can opt out with `export const prerender = false`. Dynamic pages (with route params) without a `getPrerenderPaths()` export are implicitly not prerendered.
|
|
159
|
+
|
|
160
|
+
When omitted or set to `"server"`, pages are server-rendered on request. Individual pages can opt into deploy-time prerendering with `export const prerender = true`.
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{ "output": "static" }
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### `remote`
|
|
167
|
+
|
|
168
|
+
Use remote D1/KV/R2 bindings during local development instead of local miniflare. When enabled, the Void plugin replaces local bindings with proxy-backed versions that forward operations to your deployed project's real resources via the Void proxy.
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{ "remote": true }
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Requirements:**
|
|
175
|
+
|
|
176
|
+
- Must be logged in (`void auth login`)
|
|
177
|
+
- Must have a linked project (`void project link`)
|
|
178
|
+
- Only affects D1 (`DB`), KV (`KV`), and R2 (`STORAGE`) bindings
|
|
179
|
+
|
|
180
|
+
You can also enable remote mode via the `VOID_REMOTE=1` environment variable without modifying `void.json`:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
VOID_REMOTE=1 pnpm dev
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### `sandbox`
|
|
187
|
+
|
|
188
|
+
Enable and configure Cloudflare Sandboxes for Void apps. Importing from `void/sandbox` enables this automatically; set `sandbox` when you need custom container settings.
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"sandbox": {
|
|
193
|
+
"image": "./Dockerfile.sandbox",
|
|
194
|
+
"platformImage": "registry.example.com/acme/sandbox:latest",
|
|
195
|
+
"instanceType": "lite",
|
|
196
|
+
"maxInstances": 2
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
| Field | Type | Default |
|
|
202
|
+
| ------------------- | -------- | ---------------------------------------- |
|
|
203
|
+
| `binding` | `string` | `SANDBOX` |
|
|
204
|
+
| `className` | `string` | `Sandbox` |
|
|
205
|
+
| `containerName` | `string` | `void-sandbox` |
|
|
206
|
+
| `image` | `string` | Bundled `@cloudflare/sandbox` Dockerfile |
|
|
207
|
+
| `imageBuildContext` | `string` | Directory of `image` |
|
|
208
|
+
| `platformImage` | `string` | Matching sandbox SDK registry image |
|
|
209
|
+
| `instanceType` | `string` | `lite` on Void deploy |
|
|
210
|
+
| `maxInstances` | `number` | `20` on Void deploy |
|
|
211
|
+
|
|
212
|
+
Sandbox support currently applies to Void apps on the Cloudflare target. `void deploy` supports registry images. If `sandbox.image` is a custom local Dockerfile path, set `sandbox.platformImage` to the pushed image that the platform should run.
|
|
213
|
+
|
|
214
|
+
### `target`
|
|
215
|
+
|
|
216
|
+
Deploy target runtime. Defaults to `"cloudflare"`.
|
|
217
|
+
|
|
218
|
+
| Value | Description |
|
|
219
|
+
| -------------- | --------------------------------------------------------- |
|
|
220
|
+
| `"cloudflare"` | Cloudflare Workers (default), with full platform features |
|
|
221
|
+
| `"node"` | Node.js, using `@hono/node-server` |
|
|
222
|
+
| `"bun"` | Bun, using `Bun.serve()` |
|
|
223
|
+
| `"deno"` | Deno, using `Deno.serve()` |
|
|
224
|
+
|
|
225
|
+
Non-CF targets disable CF bindings (`void/db`, `void/kv`, `void/auth`, `void/storage`, `void/ai`, `void/sandbox`, `void/env`, `void/ws`). Importing any of these with a non-CF target produces a compile-time error. File-based routing, middleware, and `void/client` all work normally.
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{ "target": "node" }
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### `worker`
|
|
232
|
+
|
|
233
|
+
Curated Cloudflare Workers configuration. Cloudflare-targeted apps require an explicit `compatibility_date` here unless it is provided by a supported wrangler fallback file. If no date is configured, Void writes the latest known-good date here. Binding arrays such as `d1_databases`, `kv_namespaces`, and `r2_buckets` are not allowed here because Void manages bindings through inference and `inference.bindings`. If you need custom bindings with real IDs, use a `wrangler.json` and `wrangler deploy`.
|
|
234
|
+
|
|
235
|
+
| Field | Type | Description |
|
|
236
|
+
| --------------------- | ---------- | -------------------------------------- |
|
|
237
|
+
| `compatibility_date` | `string` | Cloudflare Workers compatibility date |
|
|
238
|
+
| `compatibility_flags` | `string[]` | Cloudflare Workers compatibility flags |
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"worker": {
|
|
243
|
+
"compatibility_date": "2025-12-01",
|
|
244
|
+
"compatibility_flags": ["nodejs_compat"]
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `routing`
|
|
250
|
+
|
|
251
|
+
Routing and edge configuration for headers, redirects, rewrites, and caching.
|
|
252
|
+
|
|
253
|
+
#### `routing.headers`
|
|
254
|
+
|
|
255
|
+
Custom response headers for static assets. Keys are URL patterns, values are arrays of `"Name: value"` strings. See [Custom Headers](../guide/edge/headers) for details.
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"routing": {
|
|
260
|
+
"headers": {
|
|
261
|
+
"/assets/*": ["Cache-Control: public, max-age=31536000, immutable"],
|
|
262
|
+
"/*": ["X-Frame-Options: DENY", "X-Content-Type-Options: nosniff"]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### `routing.redirects`
|
|
269
|
+
|
|
270
|
+
URL redirects. Keys are source URL patterns, values are destination strings (302 default) or objects with `to` and optional `status` (`301`, `302`, `303`, `307`, `308`). See [Redirects](../guide/edge/redirects) for details.
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"routing": {
|
|
275
|
+
"redirects": {
|
|
276
|
+
"/old": "/new",
|
|
277
|
+
"/blog/*": { "to": "/posts/:splat", "status": 301 }
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### `routing.rewrites`
|
|
284
|
+
|
|
285
|
+
URL rewrites. Keys are source URL patterns, values are destination paths. Serves content from the destination without changing the browser URL. See [Rewrites](../guide/edge/rewrites) for details.
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"routing": {
|
|
290
|
+
"rewrites": {
|
|
291
|
+
"/": "/en",
|
|
292
|
+
"/docs/*": "/en/docs/:splat"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Destinations use the `RewriteDestination` shape — typed route patterns plus `string`, so known routes autocomplete while dynamic paths remain accepted. See [Programmatic rewrites in middleware](../guide/edge/rewrites#programmatic-rewrites-in-middleware) for the trade-off and performance notes.
|
|
299
|
+
|
|
300
|
+
#### `routing.fallbacks`
|
|
301
|
+
|
|
302
|
+
Fallback rewrites. Same shape as `rewrites`, but rules only fire when no static asset or route matched the request (i.e. the request would otherwise 404). Useful for SPA shells or default-locale catch-alls that shouldn't pre-empt real routes. See [Rewrites → Fallbacks](../guide/edge/rewrites#fallbacks) for details.
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"routing": {
|
|
307
|
+
"fallbacks": {
|
|
308
|
+
"/*": "/index.html"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### `routing.revalidate`
|
|
315
|
+
|
|
316
|
+
ISR revalidation TTL in seconds, either globally or per path. See [Revalidation](../guide/edge/revalidation.md) for details.
|
|
317
|
+
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"routing": {
|
|
321
|
+
"revalidate": {
|
|
322
|
+
"/": 60,
|
|
323
|
+
"/docs/*": 31536000,
|
|
324
|
+
"*": 30
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### `routing.revalidateQueryAllowlist`
|
|
331
|
+
|
|
332
|
+
Query parameters that participate in ISR variant keys for dispatch rewrites. Keys are source URL patterns, values are query parameter names to keep. When omitted, rewritten ISR cache keys drop every incoming query parameter to avoid unbounded cache fanout.
|
|
333
|
+
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"routing": {
|
|
337
|
+
"revalidateQueryAllowlist": {
|
|
338
|
+
"/search": ["q"],
|
|
339
|
+
"/products/*": ["variant", "currency"],
|
|
340
|
+
"*": []
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### `routing.prerender`
|
|
347
|
+
|
|
348
|
+
Paths to prerender as static HTML at deploy time. Each path must start with `/`. See [Edge Prerendering](../guide/edge/prerendering.md) for details.
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"routing": {
|
|
353
|
+
"prerender": ["/", "/about", "/pricing"]
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### `inference`
|
|
359
|
+
|
|
360
|
+
Configuration for build-time inference, including how Void detects your app type, bindings, and build process.
|
|
361
|
+
|
|
362
|
+
#### `inference.bindings`
|
|
363
|
+
|
|
364
|
+
Explicitly control inferred Cloudflare bindings. If omitted, bindings are [automatically inferred](./resource-inference.md) by scanning your source files for binding usage. If provided, explicit values take precedence and inference is skipped entirely.
|
|
365
|
+
|
|
366
|
+
Each binding accepts `true` (use default name), `false` (disable), or a string (custom binding name):
|
|
367
|
+
|
|
368
|
+
```json
|
|
369
|
+
{ "inference": { "bindings": { "db": true, "kv": false, "storage": "MY_BUCKET" } } }
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
| Key | Default Binding | Type | Custom Name |
|
|
373
|
+
| --------- | --------------- | ------------- | ------------------------ |
|
|
374
|
+
| `db` | `DB` | `D1Database` | `"db": "MY_DB"` |
|
|
375
|
+
| `kv` | `KV` | `KVNamespace` | `"kv": "MY_KV"` |
|
|
376
|
+
| `storage` | `STORAGE` | `R2Bucket` | `"storage": "MY_BUCKET"` |
|
|
377
|
+
| `ai` | `AI` | `Ai` | Boolean only |
|
|
378
|
+
|
|
379
|
+
Custom names are used in the deploy manifest and in wrangler binding sync for local dev.
|
|
380
|
+
|
|
381
|
+
#### `inference.build`
|
|
382
|
+
|
|
383
|
+
Override the build command. Useful for frameworks with their own CLIs (Nuxt, Astro) or static apps with custom build scripts. If omitted, the CLI uses the detected default build command for the current app type.
|
|
384
|
+
|
|
385
|
+
```json
|
|
386
|
+
{ "inference": { "build": "nuxt build --preset cloudflare-module" } }
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### `inference.scanDirs`
|
|
390
|
+
|
|
391
|
+
Override which directories are scanned for [binding inference](./resource-inference.md). Paths are relative to the project root. Replaces the default directories for the current mode.
|
|
392
|
+
|
|
393
|
+
```json
|
|
394
|
+
{ "inference": { "scanDirs": ["src", "lib", "workers"] } }
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
#### `inference.appType`
|
|
398
|
+
|
|
399
|
+
App type. If omitted, auto-detected on first deploy. See [Supported App Types](../guide/app-types.md).
|
|
400
|
+
|
|
401
|
+
- `"void"`: worker plus assets, including API routes, SSR, and jobs
|
|
402
|
+
- `"framework"`: a meta-framework app such as TanStack Start, React Router, SvelteKit, Nuxt, or Astro
|
|
403
|
+
- `"static"`: fully rendered HTML files from VitePress, plain HTML, or external tools. Non-matching paths return `404.html` or a 404 response.
|
|
404
|
+
- `"spa"`: static output with SPA fallback. Non-file paths fall back to `index.html` with a `200` status so client-side routing works out of the box.
|
|
405
|
+
|
|
406
|
+
#### `inference.outputDir`
|
|
407
|
+
|
|
408
|
+
Output directory for static deploys, relative to the project root. Only relevant when `inference.appType` is `"spa"` or `"static"`. Defaults to `"dist"`.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Resource Inference
|
|
6
|
+
|
|
7
|
+
Void automatically detects which Cloudflare resources your project uses by scanning source files at startup. In most cases, there is no manual configuration. Use a resource in code, and Void provisions the matching binding for local development.
|
|
8
|
+
|
|
9
|
+
## How It Works
|
|
10
|
+
|
|
11
|
+
When `voidPlugin()` initializes, it synchronously scans your source files using a three-tier approach optimized for speed:
|
|
12
|
+
|
|
13
|
+
1. **Import detection:** uses `es-module-lexer` to check for `void/*` imports. This is the fastest pass and does not require AST parsing.
|
|
14
|
+
2. **Regex pre-check:** tests for patterns such as `env.DB` and `env.KV` so files without bindings can be skipped early.
|
|
15
|
+
3. **AST confirmation:** when the regex matches, parses the full AST to confirm `c.env.DB` or `env.DB` member expressions.
|
|
16
|
+
|
|
17
|
+
This runs once before plugins initialize, so the results are available to configure the Cloudflare Vite plugin.
|
|
18
|
+
|
|
19
|
+
## Detected Bindings
|
|
20
|
+
|
|
21
|
+
| Binding | Type | Detected by import | Detected by env access |
|
|
22
|
+
| --------- | --------------------------------- | ------------------------------------------------------------------------- | -------------------------------- |
|
|
23
|
+
| `DB` | `D1Database` | `import { db } from "void/db"` | `env.DB` or `c.env.DB` |
|
|
24
|
+
| `KV` | `KVNamespace` | `import { kv } from "void/kv"` | `env.KV` or `c.env.KV` |
|
|
25
|
+
| `STORAGE` | `R2Bucket` | `import { storage } from "void/storage"` | `env.STORAGE` or `c.env.STORAGE` |
|
|
26
|
+
| `AI` | `Ai` | `import { ai } from "void/ai"` | `env.AI` or `c.env.AI` |
|
|
27
|
+
| `SANDBOX` | `DurableObjectNamespace<Sandbox>` | `import { getSandbox } from "void/sandbox"` | `env.SANDBOX` or `c.env.SANDBOX` |
|
|
28
|
+
| Auth | none | `import { ... } from "void/auth"` or `import { auth } from "void/client"` | none |
|
|
29
|
+
| `QUEUE_*` | `Queue` | `import { ... } from "void/queue"` | `env.QUEUE_*` |
|
|
30
|
+
|
|
31
|
+
Auth detection also triggers when importing the `auth` specifier from `void/client` (but not when importing only `fetch`).
|
|
32
|
+
|
|
33
|
+
## Scanned Directories
|
|
34
|
+
|
|
35
|
+
### Standard mode
|
|
36
|
+
|
|
37
|
+
When using Void's built-in routing (no meta-framework), these directories are scanned:
|
|
38
|
+
|
|
39
|
+
| Directory | Contains |
|
|
40
|
+
| ------------- | ------------------------------------------- |
|
|
41
|
+
| `routes/` | API route handlers |
|
|
42
|
+
| `middleware/` | Hono middleware |
|
|
43
|
+
| `queues/` | Queue consumers |
|
|
44
|
+
| `pages/` | Page components and `.server.ts` companions |
|
|
45
|
+
| `crons/` | Scheduled job handlers |
|
|
46
|
+
|
|
47
|
+
### Framework mode
|
|
48
|
+
|
|
49
|
+
When a meta-framework is detected (TanStack Start, React Router, SvelteKit, Nuxt, or Astro), a broader set of directories is scanned instead:
|
|
50
|
+
|
|
51
|
+
| Directory | Contains |
|
|
52
|
+
| --------- | ----------------------- |
|
|
53
|
+
| `src/` | Application source |
|
|
54
|
+
| `app/` | Framework app directory |
|
|
55
|
+
| `routes/` | Framework routes |
|
|
56
|
+
| `server/` | Server-side code |
|
|
57
|
+
|
|
58
|
+
Framework detection checks `package.json` for `@tanstack/react-start`, `@react-router/dev`, `@sveltejs/kit`, `nuxt`, or `astro` in dependencies.
|
|
59
|
+
|
|
60
|
+
For SvelteKit, Nuxt, and Astro, add `voidPlugin()` to the framework's Vite config to enable inference during dev. See [Frameworks Integration](../integrations/frameworks/overview.md) for setup details.
|
|
61
|
+
|
|
62
|
+
### Always scanned
|
|
63
|
+
|
|
64
|
+
Regardless of mode, these are always checked:
|
|
65
|
+
|
|
66
|
+
- **SSR entry** such as `src/main.ssr.ts`, for SSR apps that access bindings during rendering
|
|
67
|
+
- **`src/`**, which is always scanned for auth imports unless it is already in the scan list for framework mode
|
|
68
|
+
|
|
69
|
+
## Custom Scan Directories
|
|
70
|
+
|
|
71
|
+
If your project organizes code in non-standard directories, you can override which directories are scanned:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"inference": {
|
|
76
|
+
"scanDirs": ["src", "lib", "workers"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Paths are relative to the project root. When `inference.scanDirs` is set, it replaces the default directories entirely. Defaults for the current mode are not merged in. The SSR entry and `src/` auth scan still apply either way.
|
|
82
|
+
|
|
83
|
+
## Explicit Binding Overrides
|
|
84
|
+
|
|
85
|
+
If inference doesn't match your setup, you can skip it entirely and declare bindings explicitly:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"inference": {
|
|
90
|
+
"bindings": {
|
|
91
|
+
"db": true,
|
|
92
|
+
"kv": true,
|
|
93
|
+
"storage": false,
|
|
94
|
+
"ai": false
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
When `inference.bindings` is set, explicit values take full precedence and inference is skipped entirely.
|
|
101
|
+
|
|
102
|
+
## File Types
|
|
103
|
+
|
|
104
|
+
Inference scans files matching `**/*.{ts,tsx,mts,js,jsx,mjs}` within each directory. Non-JS files (CSS, HTML, images) are ignored.
|
|
105
|
+
|
|
106
|
+
## Common Patterns
|
|
107
|
+
|
|
108
|
+
### Pages mode with D1
|
|
109
|
+
|
|
110
|
+
A page companion file in `pages/` triggers D1 inference:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
// pages/users.server.ts
|
|
114
|
+
import { db } from 'void/db';
|
|
115
|
+
|
|
116
|
+
export function loader() {
|
|
117
|
+
return db.select().from(users);
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Cron job with KV
|
|
122
|
+
|
|
123
|
+
A scheduled handler in `crons/` triggers KV inference:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
// crons/cleanup.ts
|
|
127
|
+
import { defineScheduled } from 'void';
|
|
128
|
+
import { kv } from 'void/kv';
|
|
129
|
+
|
|
130
|
+
export default defineScheduled(async () => {
|
|
131
|
+
await kv.delete('temp-cache');
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Route handler with R2
|
|
136
|
+
|
|
137
|
+
A route handler in `routes/` triggers R2 inference:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
// routes/api/upload.ts
|
|
141
|
+
import { defineHandler } from 'void';
|
|
142
|
+
import { storage } from 'void/storage';
|
|
143
|
+
|
|
144
|
+
export const POST = defineHandler(async (c) => {
|
|
145
|
+
const file = await c.req.blob();
|
|
146
|
+
await storage.put('uploads/file.bin', file);
|
|
147
|
+
return c.json({ ok: true });
|
|
148
|
+
});
|
|
149
|
+
```
|