void 0.10.12 → 0.20.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/AGENTS_TEMPLATE.md +6 -0
- package/{skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md → LICENSE} +1 -1
- package/README.md +34 -8
- package/dist/{auth-qgMlYp7Z.d.mts → auth-DkcFflXV.d.mts} +10 -11
- package/dist/auth-W9WII-mN.mjs +630 -0
- package/dist/{auth-cmd-BqsdZJp5.mjs → auth-cmd-CYVhSNFy.mjs} +4 -3
- package/dist/{auth-migrations-BTZ-ATvQ.mjs → auth-migrations-9vif1uj8.mjs} +53 -12
- package/dist/{better-auth-shared-BQooDxbw.mjs → better-auth-shared-CYw1T3k4.mjs} +7 -10
- package/dist/{better-auth-shared-DealXecJ.d.mts → better-auth-shared-DSCeohOK.d.mts} +10 -5
- package/dist/{build-cmd-Bujrv5q-.mjs → build-cmd-CkVD1uOh.mjs} +6 -4
- package/dist/{cache-C11V8Fxq.mjs → cache-QcUfR-ff.mjs} +9 -5
- package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-DsvWKFTe.mjs} +3 -2
- package/dist/cf-access-AJ1ehiFR.mjs +42 -0
- package/dist/cf-access-DsSsZUPr.mjs +67 -0
- package/dist/cli/cli.d.mts +1 -1
- package/dist/cli/cli.mjs +1592 -153
- package/dist/cli/env-schema-probe.d.mts +48 -61
- package/dist/cli/env-schema-probe.mjs +10 -58
- package/dist/{client-Gb71-XkG.mjs → client-CyCHWSO_.mjs} +61 -463
- package/dist/cloudflare-auth-DRkGe7-s.mjs +170 -0
- package/dist/cloudflare-cmd-D3ME2GAe.mjs +62 -0
- package/dist/cloudflare-connect-BivMefMA.mjs +56 -0
- package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
- package/dist/{config-BkTvs43g.mjs → config-BQFq7QvD.mjs} +85 -41
- package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
- package/dist/connect-D9Yr-T5f.mjs +79 -0
- package/dist/{create-project-DsYvl3TB.mjs → create-project-DMV-csEm.mjs} +26 -16
- package/dist/database-provider.d.mts +21 -0
- package/dist/database-provider.mjs +6 -0
- package/dist/{db-DOiJMRt2.mjs → db-BxoUWL0F.mjs} +600 -115
- package/dist/{delete-mh6p-zkQ.mjs → delete-iJOqxBz1.mjs} +9 -6
- package/dist/{deploy-u7Rv9q_q.mjs → deploy-CcDoeBIf.mjs} +3451 -1986
- package/dist/dev-inbox-DkgRWLkW.mjs +307 -0
- package/dist/{discover-CJHyvYfR.mjs → discover-xvfrgJeo.mjs} +3 -3
- package/dist/{magic-string.es-ZQjdJFFn.mjs → dist-BR1quN_w.mjs} +570 -216
- package/dist/{dist-DaKKDf8D.mjs → dist-BrsS7cai.mjs} +17 -2
- package/dist/{dist-BuiRJkTd.mjs → dist-m40_XgNh.mjs} +48 -33
- package/dist/{domain-DiaNQbrl.mjs → domain-gu_iaHmn.mjs} +41 -4
- package/dist/dotenv-VQxupEUv.mjs +181 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +2 -0
- package/dist/email-Ce6SQq-i.mjs +182 -0
- package/dist/email-r6DHJyAB.mjs +262 -0
- package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
- package/dist/env-D4Emu-M_.mjs +95 -0
- package/dist/env-DmU2To0C.mjs +73 -0
- package/dist/env-helpers-CyKtOBpj.d.mts +22 -0
- package/dist/env-public-D_6u46fX.d.mts +135 -0
- package/dist/{env-types-QBj-ndax.mjs → env-types-BNPhro-M.mjs} +2 -2
- package/dist/{env-validation-Dea3v3ej.mjs → env-validation-ENpMy6Ez.mjs} +68 -122
- package/dist/{gen-o_w-8yI8.mjs → gen-BKw6qHIg.mjs} +70 -15
- package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-DJS5Ab-H.mjs} +39 -31
- package/dist/{handler-Cjh8uM3Y.d.mts → handler-D1hLsObx.d.mts} +124 -122
- package/dist/{head-nmvOgFjd.d.mts → head-Do8P4puT.d.mts} +9 -8
- package/dist/{headers-nsHIFixA.mjs → headers-D8QfRX9Y.mjs} +12 -10
- package/dist/inbound-BJ70in1n.d.mts +354 -0
- package/dist/inbound-CNKxb3FY.mjs +694 -0
- package/dist/index.d.mts +61 -34
- package/dist/index.mjs +1048 -321
- package/dist/{init-3rgHKBVi.mjs → init-Dx5cgKqK.mjs} +329 -271
- package/dist/link-D_rm5sRH.mjs +52 -0
- package/dist/{list-CPwFDZ_c.mjs → list-M8XShti7.mjs} +37 -5
- package/dist/{runner-kapo9aPs.mjs → local-d1-BE8KBbMy.mjs} +116 -6
- package/dist/{login-BT3H8PN3.mjs → login-C8-UuLnp.mjs} +17 -15
- package/dist/{logs-Bt313ax7.mjs → logs-DwFU7dMW.mjs} +16 -2
- package/dist/mime-BJD7d_qL.mjs +1216 -0
- package/dist/neon-DHwd2zvC.mjs +54 -0
- package/dist/{node-Da0UcsGA.mjs → node-BkaXcpAc.mjs} +29 -8
- package/dist/operator-cmd-DYWRbWUA.mjs +348 -0
- package/dist/{agents-CtgBYqld.mjs → output-tFQLLj26.mjs} +676 -211
- package/dist/{package-json-Cx1osYo6.mjs → package-json-CPoWX79C.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -41
- package/dist/pages/client.mjs +40 -33
- package/dist/pages/head-client.d.mts +10 -12
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +37 -14
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +25 -27
- package/dist/pages/islands-plugin.mjs +6 -4
- package/dist/pages/prefetch.d.mts +6 -7
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -1
- package/dist/pages/serialize.d.mts +7 -8
- package/dist/platform-cmd-BEOVv1PN.mjs +123 -0
- package/dist/platform-domain-BszUfiS8.mjs +228 -0
- package/dist/platform-lifecycle-CjSr6xf0.mjs +4450 -0
- package/dist/platform-management-W30iCaTL.mjs +698 -0
- package/dist/platform-recovery-pHHv4ZSg.mjs +99 -0
- package/dist/{plugin-inference-DMeavIJ6.mjs → plugin-inference-BDRfZngg.mjs} +35 -19
- package/dist/prepare-BfJvFUtJ.mjs +14 -0
- package/dist/{prepare-BoKHgMNx.mjs → prepare-CBetXvsN.mjs} +15 -24
- package/dist/{preset-BjyR3lzz.mjs → preset-lAy0B0BQ.mjs} +25 -212
- package/dist/{project-cmd-D_w-4w5B.mjs → project-cmd-DCpk1cDt.mjs} +25 -12
- package/dist/{project-paths-BQd7OmIo.mjs → project-paths-SK8nMHPp.mjs} +3 -1
- package/dist/{project-tsconfig-B-QtXjLQ.mjs → project-tsconfig-Ql2XsSQp.mjs} +2 -2
- package/dist/{protocol-Bnb0LFp3.d.mts → protocol-C-pqYJjE.d.mts} +3 -4
- package/dist/{provision-rShh6MKY.mjs → provision-Blnstcm2.mjs} +78 -45
- package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
- package/dist/{requests-B8sZxaFM.mjs → requests-Dn8Vheh1.mjs} +5 -3
- package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
- package/dist/rollback-CtlPXEBi.mjs +166 -0
- package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
- package/dist/{route-types-COI2DsZv.mjs → route-types-Da-DpyUp.mjs} +85 -26
- package/dist/routes-stub.d.mts +22 -23
- package/dist/runner-mysql-CgRFl3s6.mjs +61 -0
- package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-DCkWPsWS.mjs} +18 -6
- package/dist/runtime/ai.d.mts +21 -14
- package/dist/runtime/ai.mjs +5 -4
- package/dist/runtime/auth-client-react.d.mts +3 -5
- package/dist/runtime/auth-client-solid.d.mts +3 -5
- package/dist/runtime/auth-client-svelte.d.mts +3 -5
- package/dist/runtime/auth-client-vue.d.mts +3 -5
- package/dist/runtime/auth-client.d.mts +3 -5
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +10 -0
- package/dist/runtime/better-auth-mysql.mjs +49 -0
- package/dist/runtime/better-auth-pg.d.mts +8 -9
- package/dist/runtime/better-auth-pg.mjs +2 -2
- package/dist/runtime/better-auth.d.mts +8 -9
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db.d.mts +10 -11
- package/dist/runtime/durable.d.mts +47 -0
- package/dist/runtime/durable.mjs +146 -0
- package/dist/runtime/email/testing.d.mts +112 -0
- package/dist/runtime/email/testing.mjs +283 -0
- package/dist/runtime/email.d.mts +30 -0
- package/dist/runtime/email.mjs +573 -0
- package/dist/runtime/env-helpers.d.mts +2 -2
- package/dist/runtime/env-helpers.mjs +5 -42
- package/dist/runtime/env-public-client.d.mts +10 -11
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +104 -49
- package/dist/runtime/env.d.mts +19 -18
- package/dist/runtime/env.mjs +15 -2
- package/dist/runtime/fetch-stream.d.mts +20 -21
- package/dist/runtime/fetch.d.mts +15 -16
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr.d.mts +21 -22
- package/dist/runtime/isr.mjs +26 -8
- package/dist/runtime/kv.d.mts +9 -10
- package/dist/runtime/live-client.d.mts +5 -7
- package/dist/runtime/live-client.mjs +9 -7
- package/dist/runtime/live-server.d.mts +4 -5
- package/dist/runtime/live.d.mts +22 -24
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.d.mts +16 -17
- package/dist/runtime/migration-handler-mysql.d.mts +4 -0
- package/dist/runtime/migration-handler-mysql.mjs +81 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -4
- package/dist/runtime/migration-handler.d.mts +5 -6
- package/dist/runtime/migration-handler.mjs +4 -3
- package/dist/runtime/queues.d.mts +3 -4
- package/dist/runtime/queues.mjs +2 -1
- package/dist/runtime/remote/binding-handler.d.mts +10 -12
- package/dist/runtime/remote/binding-handler.mjs +24 -3
- package/dist/runtime/remote/index.d.mts +5 -6
- package/dist/runtime/remote/index.mjs +21 -18
- package/dist/runtime/response.d.mts +10 -11
- package/dist/runtime/sandbox.d.mts +56 -55
- package/dist/runtime/sandbox.mjs +57 -49
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/seed.d.mts +14 -9
- package/dist/runtime/sse-client.d.mts +6 -7
- package/dist/runtime/sse.d.mts +11 -12
- package/dist/runtime/storage.d.mts +3 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +12 -12
- package/dist/runtime/ws-server.mjs +32 -4
- package/dist/runtime/ws.d.mts +19 -21
- package/dist/{scan-DYXkrasO.mjs → scan-BMH4rzlv.mjs} +53 -31
- package/dist/{scan-DEwlM_Xy.mjs → scan-CpK-57ug.mjs} +9 -5
- package/dist/{secret-Dt32J6RI.mjs → secret-BqTxGqki.mjs} +62 -5
- package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
- package/dist/{standard-schema-DJ0HW7QP.d.mts → standard-schema-Fo_vCAZh.d.mts} +6 -6
- package/dist/{subcommand-prompt-BzV8iQZo.mjs → subcommand-prompt-WfySCQ7S.mjs} +67 -48
- package/dist/sveltekit.d.mts +12 -11
- package/dist/sveltekit.mjs +1 -1
- package/dist/types-BAp5AEBU.d.mts +79 -0
- package/dist/types-CKWnYgfy.d.mts +1 -0
- package/dist/{validate-Cw_RLeTj.mjs → validate-Bihr8WBi.mjs} +3 -3
- package/dist/wrangler--imS8n0d.mjs +1796 -0
- package/dist/{yarn-pnp-DJn3SAHF.mjs → yarn-pnp-DxSInkzL.mjs} +1 -1
- package/package.json +79 -65
- package/schema.json +35 -3
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +1 -1
- package/skills/void/SKILL.md +59 -2
- package/skills/void/docs/guide/ai.md +32 -14
- package/skills/void/docs/guide/app-types.md +6 -6
- package/skills/void/docs/guide/auth.md +14 -16
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/database/mysql.md +60 -0
- package/skills/void/docs/guide/database/postgresql.md +14 -9
- package/skills/void/docs/guide/database.md +39 -26
- package/skills/void/docs/guide/deployment.md +163 -22
- package/skills/void/docs/guide/durable-state.md +140 -0
- package/skills/void/docs/guide/edge/headers.md +5 -5
- package/skills/void/docs/guide/edge/prerendering.md +2 -0
- package/skills/void/docs/guide/edge/revalidation.md +21 -6
- package/skills/void/docs/guide/edge/rewrites.md +18 -14
- package/skills/void/docs/guide/edge/static-assets.md +23 -8
- package/skills/void/docs/guide/email.md +609 -0
- package/skills/void/docs/guide/env-migration.md +109 -0
- package/skills/void/docs/guide/env-vars.md +70 -248
- package/skills/void/docs/guide/index.md +15 -17
- package/skills/void/docs/guide/jobs.md +8 -5
- package/skills/void/docs/guide/live.md +7 -15
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +8 -4
- package/skills/void/docs/guide/pages-routing/islands.md +3 -3
- package/skills/void/docs/guide/pages-routing/loaders.md +6 -4
- package/skills/void/docs/guide/pages-routing/overview.md +7 -7
- package/skills/void/docs/guide/platform-administration.md +212 -0
- package/skills/void/docs/guide/platform-development.md +235 -0
- package/skills/void/docs/guide/queues.md +10 -10
- package/skills/void/docs/guide/quickstart.md +46 -67
- package/skills/void/docs/guide/remote-dev.md +8 -6
- package/skills/void/docs/guide/sandboxes.md +33 -16
- package/skills/void/docs/guide/self-hosted-platform.md +553 -0
- package/skills/void/docs/guide/server-routing.md +25 -5
- package/skills/void/docs/guide/sse.md +4 -4
- package/skills/void/docs/guide/ssg.md +5 -3
- package/skills/void/docs/guide/storage.md +2 -2
- package/skills/void/docs/guide/websockets.md +18 -7
- package/skills/void/docs/index.md +3 -3
- package/skills/void/docs/integrations/agents.md +6 -64
- package/skills/void/docs/integrations/cloudflare.md +165 -146
- package/skills/void/docs/integrations/frameworks/analog.md +4 -4
- package/skills/void/docs/integrations/frameworks/astro.md +5 -5
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -5
- package/skills/void/docs/integrations/frameworks/overview.md +3 -3
- package/skills/void/docs/integrations/frameworks/react-router.md +3 -3
- package/skills/void/docs/integrations/frameworks/sveltekit.md +3 -3
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +2 -2
- package/skills/void/docs/integrations/nodejs-bun-deno.md +11 -4
- package/skills/void/docs/reference/api.md +42 -6
- package/skills/void/docs/reference/cli.md +637 -159
- package/skills/void/docs/reference/config.md +80 -25
- package/skills/void/docs/reference/resource-inference.md +13 -9
- package/skills/void/docs/reference/structure.md +10 -11
- package/AGENT_PROMPT.md +0 -19
- package/dist/cf-access-Bqw81xAf.mjs +0 -22
- package/dist/env-CZy5MorI.mjs +0 -299
- package/dist/env-helpers-z4stu8uc.d.mts +0 -52
- package/dist/env-mask-Dd47NbR6.mjs +0 -90
- package/dist/env-public-BfiLcMBk.d.mts +0 -140
- package/dist/link-CdGHSIy-.mjs +0 -45
- package/dist/mcp-DoM3_nhd.mjs +0 -377
- package/dist/project-paths-GpziKeQQ.d.mts +0 -25
- package/dist/providers-BNKRacMr.d.mts +0 -7
- package/dist/proxy-D-3_D-Gl.mjs +0 -5
- package/dist/rollback-CkvTFXx5.mjs +0 -90
- package/dist/runtime/isr-cache.d.mts +0 -207
- package/dist/runtime/isr-cache.mjs +0 -523
- package/dist/types-lLjNE9Qp.d.mts +0 -51
- package/getting-started-prompt.txt +0 -28
- package/skills/void/command/void.md +0 -7
- package/skills/void/docs/integrations/auth-providers.md +0 -0
- package/skills/void/docs/integrations/payment-processors.md +0 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +0 -408
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +0 -5
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +0 -103
- package/skills/void/docs/node_modules/oxc-minify/README.md +0 -78
- package/skills/void/docs/node_modules/reka-ui/README.md +0 -80
- package/skills/void/docs/node_modules/vitepress/README.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +0 -49
- package/skills/void/docs/node_modules/vitepress/template/index.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +0 -85
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +0 -101
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +0 -19
- package/skills/void/docs/node_modules/void/CLAUDE.md +0 -219
- package/skills/void/docs/node_modules/void/README.md +0 -90
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +0 -685
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +0 -396
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +0 -219
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +0 -37
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +0 -189
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +0 -143
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +0 -1272
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +0 -19
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +0 -22
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +0 -153
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +0 -565
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +0 -127
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +0 -600
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +0 -386
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +0 -95
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-footnote/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +0 -58
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +0 -32
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +0 -99
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +0 -79
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +0 -44
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +0 -65
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +0 -403
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +0 -48
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +0 -85
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +0 -452
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +0 -325
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +0 -398
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +0 -96
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +0 -183
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +0 -94
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +0 -63
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +0 -191
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +0 -175
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +0 -76
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +0 -7
- package/skills/void/docs/node_modules/void/test/e2e/README.md +0 -85
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { D as log, F as isCancel, O as note, c as import_picocolors, w as confirm } from "./output-tFQLLj26.mjs";
|
|
2
|
+
import { C as renderAddressMap, S as preflightEmail, a as isWranglerNonInteractiveOrCI, b as createNodeEmailDns, i as discoverRootWranglerConfig, o as loadProvisionModule, r as deriveWorkerName, s as resolveDeployTransport, t as createDeployWranglerRunner, u as runWranglerAuthToken, w as renderEmailChecklist, x as findEmailConfigConflicts, y as applyEmailSetup } from "./deploy-CcDoeBIf.mjs";
|
|
3
|
+
import { n as readProjectPaths } from "./project-paths-SK8nMHPp.mjs";
|
|
4
|
+
import { c as getToken, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
|
|
5
|
+
import { k as writeProvisionedWranglerConfig } from "./wrangler--imS8n0d.mjs";
|
|
6
|
+
import { f as readConfig } from "./config-BQFq7QvD.mjs";
|
|
7
|
+
import { a as scanEmailHandlersSync } from "./email-Ce6SQq-i.mjs";
|
|
8
|
+
import { n as PlatformClient } from "./client-CyCHWSO_.mjs";
|
|
9
|
+
import { parseRootWranglerConfig, readWranglerTopLevelString } from "@void/deploy-cloudflare";
|
|
10
|
+
//#region src/cli/email.ts
|
|
11
|
+
async function runEmailCommand(root, args) {
|
|
12
|
+
if (args.platform === "cloudflare") return runEmailCloudflareCommand(root, args);
|
|
13
|
+
if (args.subcommand === "setup") {
|
|
14
|
+
log.error("email: `void email setup` sets email up on your OWN Cloudflare account — run it with `--platform cloudflare`. The Void platform needs no setup: deploy, and `void email usage` shows your address.");
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
if (args.subcommand === "status") {
|
|
18
|
+
log.error("email: `void email status` is available with `--platform cloudflare` today. On the Void platform use `void email usage` and `void email destinations`.");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
const token = getToken(root);
|
|
22
|
+
if (!token) {
|
|
23
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const client = new PlatformClient(token, { root });
|
|
27
|
+
const requestedSlug = args.projectSlug ?? process.env.VOID_PROJECT?.trim();
|
|
28
|
+
let projectId;
|
|
29
|
+
if (requestedSlug) {
|
|
30
|
+
const project = (await client.listProjects()).find((p) => p.slug === requestedSlug);
|
|
31
|
+
if (!project) {
|
|
32
|
+
log.error(`project: No project found with slug '${requestedSlug}'.`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
projectId = project.id;
|
|
36
|
+
} else {
|
|
37
|
+
const config = readProjectConfig(root);
|
|
38
|
+
if (!config) {
|
|
39
|
+
log.error("No linked project. Run `void project link` or pass --project <name>.");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
projectId = config.projectId;
|
|
43
|
+
}
|
|
44
|
+
switch (args.subcommand) {
|
|
45
|
+
case "usage": return emailUsage(client, projectId);
|
|
46
|
+
case "logs": return emailLogs(client, projectId, args.limit);
|
|
47
|
+
case "destinations": return emailDestinations(client, projectId);
|
|
48
|
+
case "allow": return emailAllow(client, projectId, args.address);
|
|
49
|
+
case "disallow": return emailDisallow(client, projectId, args.address);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function emailUsage(client, projectId) {
|
|
53
|
+
const usage = await client.getEmailUsage(projectId);
|
|
54
|
+
const status = usage.suspended ? import_picocolors.default.red("SUSPENDED") : import_picocolors.default.green("active");
|
|
55
|
+
const lines = [
|
|
56
|
+
`Month: ${usage.month}`,
|
|
57
|
+
`Status: ${status}`,
|
|
58
|
+
`Outbound: ${usage.sent} / ${usage.limit} (${usage.remaining} remaining)`,
|
|
59
|
+
`Inbound: ${usage.received}`
|
|
60
|
+
];
|
|
61
|
+
note(lines.join("\n"), "Email Usage");
|
|
62
|
+
}
|
|
63
|
+
async function emailDestinations(client, projectId) {
|
|
64
|
+
const rows = await client.listEmailDestinations(projectId);
|
|
65
|
+
if (rows.length === 0) {
|
|
66
|
+
log.info("No verified destinations. Run `void email allow <address>` to add one — Cloudflare will email the recipient with a verification link.");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const lines = rows.map((d) => {
|
|
70
|
+
const status = d.status === "verified" ? import_picocolors.default.green("verified") : d.status === "pending" ? import_picocolors.default.yellow("pending") : import_picocolors.default.red("failed");
|
|
71
|
+
return ` ${d.address.padEnd(40)} ${status}`;
|
|
72
|
+
});
|
|
73
|
+
note(lines.join("\n"), "Email Destinations");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `void email allow <address>` — exported for the unit test; the command
|
|
77
|
+
* entry (`runEmailCommand`) resolves the client and project first.
|
|
78
|
+
*/
|
|
79
|
+
async function emailAllow(client, projectId, address) {
|
|
80
|
+
const dest = await client.addEmailDestination(projectId, address);
|
|
81
|
+
const sent = dest.verificationSent !== false && (dest.created || dest.platformVerificationPending);
|
|
82
|
+
if (dest.status === "verified") log.success(`${dest.address} is already verified.`);
|
|
83
|
+
else if (sent) {
|
|
84
|
+
log.success(`Verification email sent to ${dest.address}.`);
|
|
85
|
+
log.info("They click the link in their inbox — no Void or Cloudflare account needed. `void email destinations` to poll status.");
|
|
86
|
+
} else if (dest.created) log.warn(`${dest.address} is on this project's list now, but Cloudflare already had the address pending (added by another project, or by hand), so no new verification email was sent — the link it mailed when the address was first added is the one to click. ${freshLinkHint(dest.address)}`);
|
|
87
|
+
else log.info(`${dest.address} is still pending — Cloudflare emailed them a verification link when the address was first added, and a repeat add sends nothing new. ${freshLinkHint(dest.address)}`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Cloudflare has no API to resend its verification mail; the only fresh link
|
|
91
|
+
* is a fresh registration, and the platform deletes the Cloudflare-side
|
|
92
|
+
* address only once no project still lists it.
|
|
93
|
+
*/
|
|
94
|
+
function freshLinkHint(address) {
|
|
95
|
+
return `For a fresh link, remove the address from every project that lists it (\`void email disallow ${address}\`), then \`void email allow ${address}\` — Cloudflare mails a new link only when it registers the address anew.`;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* `void email disallow <address>` — exported for the unit test; the command
|
|
99
|
+
* entry (`runEmailCommand`) resolves the client and project first.
|
|
100
|
+
*
|
|
101
|
+
* No deploy is involved: the api tightens the proxy's `email-allowlist`
|
|
102
|
+
* KV mirror inside the DELETE (and answers 503 if that write fails), and
|
|
103
|
+
* the proxy re-reads the mirror with a 60s `cacheTtl` on both the send
|
|
104
|
+
* path and inbound forward/reply — so the address is refused once that
|
|
105
|
+
* per-colo cache turns over.
|
|
106
|
+
*/
|
|
107
|
+
async function emailDisallow(client, projectId, address) {
|
|
108
|
+
const dest = (await client.listEmailDestinations(projectId)).find((d) => d.address.toLowerCase() === address.toLowerCase());
|
|
109
|
+
if (!dest) {
|
|
110
|
+
log.error(`destination: '${address}' is not in the project's allowlist.`);
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
await client.removeEmailDestination(projectId, dest.id);
|
|
114
|
+
log.success(`Removed ${dest.address}. Sends to it are refused within about a minute.`);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* `void email logs` — exported for the unit test; the command entry
|
|
118
|
+
* (`runEmailCommand`) resolves the client and project first.
|
|
119
|
+
*/
|
|
120
|
+
async function emailLogs(client, projectId, limit) {
|
|
121
|
+
const result = await client.getEmailLogs(projectId, limit);
|
|
122
|
+
if (result.pending) {
|
|
123
|
+
log.info(result.note ?? "Persistent log storage is not yet wired up.");
|
|
124
|
+
log.info("Email activity logs are not available yet. Console output from your email handler appears in `void project logs`.");
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (result.logs.length === 0) {
|
|
128
|
+
log.info("No email activity recorded.");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const lines = result.logs.map((entry) => {
|
|
132
|
+
const ts = new Date(entry.timestamp).toISOString();
|
|
133
|
+
const dir = entry.direction === "sent" ? "→" : "←";
|
|
134
|
+
const subject = entry.subject ? ` "${entry.subject}"` : "";
|
|
135
|
+
return `${ts} ${dir} ${entry.from} → ${entry.to} ${entry.status}${subject}`;
|
|
136
|
+
});
|
|
137
|
+
note(lines.join("\n"), "Email Logs");
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* `void email setup --platform cloudflare` and `void email status --platform cloudflare`.
|
|
141
|
+
*
|
|
142
|
+
* `setup` is the deploy's step 3b-ii on its own: preflight → checklist → the one Enter →
|
|
143
|
+
* apply → write the root wrangler.jsonc. It exists for CI: a non-interactive deploy that
|
|
144
|
+
* finds email not ready prints the checklist and says to run this once, commit
|
|
145
|
+
* wrangler.jsonc, and redeploy. Rules and the catch-all stay wrangler's job — the next
|
|
146
|
+
* `void deploy --platform cloudflare` applies the plan from the written `addresses`. It
|
|
147
|
+
* is also the ONLY place a sending onboarding the committed binding remembers as refused
|
|
148
|
+
* (Workers Free) is retried — on its own prompt, after a Workers Paid upgrade; the deploy
|
|
149
|
+
* reads that row as settled and never retries it.
|
|
150
|
+
*
|
|
151
|
+
* `status` is the preflight alone, printed, exit 1 when not ready.
|
|
152
|
+
*/
|
|
153
|
+
async function runEmailCloudflareCommand(root, args, deps = {}) {
|
|
154
|
+
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
155
|
+
const print = deps.print ?? ((block) => log.message(block));
|
|
156
|
+
const fail = (message) => {
|
|
157
|
+
log.error(message);
|
|
158
|
+
return exit(1);
|
|
159
|
+
};
|
|
160
|
+
const from = readConfig(root).email?.from;
|
|
161
|
+
if (!from) return fail("email: no sender configured. Add \"email\": { \"from\": \"you@mail.acme.com\" } to void.json — its host is the domain email is set up on.");
|
|
162
|
+
const paths = readProjectPaths(root);
|
|
163
|
+
const handlers = scanEmailHandlersSync(paths.sourceRoot);
|
|
164
|
+
const configPath = discoverRootWranglerConfig(root);
|
|
165
|
+
const rootConfig = parseRootWranglerConfig(configPath);
|
|
166
|
+
await loadProvisionModule();
|
|
167
|
+
let apiBaseUrl;
|
|
168
|
+
try {
|
|
169
|
+
apiBaseUrl = resolveDeployTransport(root, rootConfig);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
return fail(`email: ${err instanceof Error ? err.message : String(err)}`);
|
|
172
|
+
}
|
|
173
|
+
const accountId = readWranglerTopLevelString(rootConfig, "account_id") ?? (process.env.CLOUDFLARE_ACCOUNT_ID?.trim() || void 0);
|
|
174
|
+
if (!accountId) return fail([
|
|
175
|
+
"email: no Cloudflare account is pinned.",
|
|
176
|
+
"Set `account_id` in your root wrangler.jsonc, or export CLOUDFLARE_ACCOUNT_ID —",
|
|
177
|
+
"the same pin `void deploy --platform cloudflare` needs."
|
|
178
|
+
].join("\n"));
|
|
179
|
+
const workerName = readWranglerTopLevelString(rootConfig, "name") ?? deriveWorkerName(root);
|
|
180
|
+
const runWrangler = deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl);
|
|
181
|
+
const getSessionBearer = deps.getSessionBearer ?? (() => runWranglerAuthToken(runWrangler, configPath));
|
|
182
|
+
const sendEmail = rootConfig.send_email;
|
|
183
|
+
const inputs = {
|
|
184
|
+
handlers,
|
|
185
|
+
from,
|
|
186
|
+
workerName,
|
|
187
|
+
accountId,
|
|
188
|
+
existingSendEmail: Array.isArray(sendEmail) ? sendEmail : null,
|
|
189
|
+
existingAddresses: rootConfig.addresses,
|
|
190
|
+
existingVars: rootConfig.vars && typeof rootConfig.vars === "object" && !Array.isArray(rootConfig.vars) ? rootConfig.vars : null,
|
|
191
|
+
configConflicts: findEmailConfigConflicts(rootConfig),
|
|
192
|
+
wranglerArgs: [
|
|
193
|
+
"-c",
|
|
194
|
+
configPath,
|
|
195
|
+
"--env="
|
|
196
|
+
],
|
|
197
|
+
apiBaseUrl,
|
|
198
|
+
runWrangler,
|
|
199
|
+
getSessionBearer,
|
|
200
|
+
fetchImpl: deps.fetchImpl ?? fetch,
|
|
201
|
+
dns: deps.dns ?? await createNodeEmailDns()
|
|
202
|
+
};
|
|
203
|
+
let pre;
|
|
204
|
+
try {
|
|
205
|
+
pre = await preflightEmail(inputs);
|
|
206
|
+
} catch (err) {
|
|
207
|
+
return fail(`email: ${err instanceof Error ? err.message : String(err)}`);
|
|
208
|
+
}
|
|
209
|
+
print(renderEmailChecklist(pre));
|
|
210
|
+
if (args.subcommand === "status") {
|
|
211
|
+
print(renderAddressMap({
|
|
212
|
+
from,
|
|
213
|
+
routes: pre.derived.routes,
|
|
214
|
+
addresses: pre.rules.mine,
|
|
215
|
+
sendingReady: pre.sending.state === "ready",
|
|
216
|
+
pendingLabel: "(no rule yet)"
|
|
217
|
+
}));
|
|
218
|
+
if (pre.ready) {
|
|
219
|
+
log.success(`Email is set up on ${pre.domain}.`);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
log.warn(`Email is not set up on ${pre.domain} yet — run \`void email setup --platform cloudflare\`.`);
|
|
223
|
+
return exit(1);
|
|
224
|
+
}
|
|
225
|
+
if (pre.blockers.some((b) => b.scope === "all")) return fail("email: nothing was changed — fix the ✘ rows above and rerun.");
|
|
226
|
+
if (!pre.ready || pre.sendingRetryable) {
|
|
227
|
+
if (!(deps.isInteractive ?? !isWranglerNonInteractiveOrCI())) return fail("email: `void email setup` changes your Cloudflare account, so it needs an interactive terminal. Run it locally once, commit wrangler.jsonc, then redeploy.");
|
|
228
|
+
if (!await (deps.confirm ?? (async (message) => {
|
|
229
|
+
const answer = await confirm({
|
|
230
|
+
message,
|
|
231
|
+
initialValue: true
|
|
232
|
+
});
|
|
233
|
+
return !isCancel(answer) && answer === true;
|
|
234
|
+
}))(pre.ready ? `Onboard ${pre.domain} for Email Sending? Inbound already works; onboarding needs Workers Paid.` : `Set up email on ${pre.domain}?`)) {
|
|
235
|
+
log.info("Nothing changed.");
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const out = await applyEmailSetup(pre, inputs);
|
|
240
|
+
if (out.lines.length > 0) print(out.lines.join("\n"));
|
|
241
|
+
try {
|
|
242
|
+
writeProvisionedWranglerConfig(root, out.patch, { configPath });
|
|
243
|
+
} catch (err) {
|
|
244
|
+
return fail(`email: could not update ${configPath} — ${err instanceof Error ? err.message : String(err)}`);
|
|
245
|
+
}
|
|
246
|
+
print(renderAddressMap({
|
|
247
|
+
from,
|
|
248
|
+
routes: pre.derived.routes,
|
|
249
|
+
addresses: out.patch.addresses ?? [],
|
|
250
|
+
sendingReady: out.sendingReady,
|
|
251
|
+
pendingLabel: "(no rule yet)"
|
|
252
|
+
}));
|
|
253
|
+
if (!out.inboundReady) {
|
|
254
|
+
const missing = !out.routingReady ? `Email Routing on ${pre.domain} is not ready` : !out.subaddressingReady ? `subaddressing on ${pre.apex} is still off (support+anything@ would not reach support@)` : "`addresses` was withheld";
|
|
255
|
+
log.warn(`Email is not set up on ${pre.domain} yet — ${missing}; no routing rule is created until it is. Finish the step above, then rerun \`void email setup --platform cloudflare\`.`);
|
|
256
|
+
return exit(1);
|
|
257
|
+
}
|
|
258
|
+
if ((out.patch.addresses ?? []).length > 0) log.info("Routing rules are created by the next `void deploy --platform cloudflare`, which applies the Email Routing plan from `addresses`.");
|
|
259
|
+
log.success(`Email set up on ${pre.domain}.`);
|
|
260
|
+
}
|
|
261
|
+
//#endregion
|
|
262
|
+
export { runEmailCommand };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
1
|
+
import { c as relative, o as join } from "./dist-BrsS7cai.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-SK8nMHPp.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { parseSync } from "vite";
|
|
5
5
|
//#region src/shared/ast.ts
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { o as join } from "./dist-BrsS7cai.mjs";
|
|
2
|
+
import { n as parseDotenvFile } from "./dotenv-VQxupEUv.mjs";
|
|
3
|
+
import { readdirSync } from "node:fs";
|
|
4
|
+
//#region src/shared/env.ts
|
|
5
|
+
/** Void's single local dotenv file. It is never a production configuration source. */
|
|
6
|
+
const LOCAL_ENV_FILE = ".env";
|
|
7
|
+
/** The fixed browser-exposure convention supported by `void/env`. */
|
|
8
|
+
const CLIENT_ENV_PREFIX = "VITE_";
|
|
9
|
+
function isClientEnvKey(key) {
|
|
10
|
+
return key.startsWith(CLIENT_ENV_PREFIX);
|
|
11
|
+
}
|
|
12
|
+
/** Read the one local-development dotenv file. */
|
|
13
|
+
function loadLocalEnv(root, options = {}) {
|
|
14
|
+
return parseDotenvFile(join(root, LOCAL_ENV_FILE), { onWarn: options.onWarn });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Marks the isolated probes and Vite build run by
|
|
18
|
+
* `void deploy --platform cloudflare`.
|
|
19
|
+
*
|
|
20
|
+
* Kept here so the deploy orchestrator and Vite plugin share one spelling.
|
|
21
|
+
* The marker is passed through child-process env only; it is never a Worker
|
|
22
|
+
* binding and is not set for `void dev` or ordinary `vite build` commands.
|
|
23
|
+
*/
|
|
24
|
+
const CLOUDFLARE_DEPLOY_BUILD_ENV = "VOID_CLOUDFLARE_DEPLOY_BUILD";
|
|
25
|
+
/**
|
|
26
|
+
* Find legacy Vite dotenv variants. Void intentionally supports only `.env`;
|
|
27
|
+
* production configuration is project-scoped remote state instead of a file.
|
|
28
|
+
*/
|
|
29
|
+
function findLegacyEnvFiles(root) {
|
|
30
|
+
try {
|
|
31
|
+
return readdirSync(root).filter((name) => name.startsWith(".env.") || name === ".env.example" || name === ".dev.vars" || name.startsWith(".dev.vars.")).sort((a, b) => a.localeCompare(b));
|
|
32
|
+
} catch {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve whether the plugin should run in "remote" mode (proxy real
|
|
38
|
+
* D1/KV/R2 via the platform) based on the project config plus an optional
|
|
39
|
+
* `VOID_REMOTE` env override.
|
|
40
|
+
*
|
|
41
|
+
* Tri-state override semantics:
|
|
42
|
+
* - `VOID_REMOTE=1` → force remote mode on
|
|
43
|
+
* - `VOID_REMOTE=0` → force remote mode off (e.g. local/CI builds of a
|
|
44
|
+
* project whose `void.json` has `remote: true`)
|
|
45
|
+
* - unset / any other value → fall back to `config.remote`
|
|
46
|
+
*
|
|
47
|
+
* Both the dev-server plugin (index.ts) and the prerender build plugin
|
|
48
|
+
* (plugin-prerender.ts) must derive `remoteMode` through this helper so
|
|
49
|
+
* dev and build stay in lockstep.
|
|
50
|
+
*/
|
|
51
|
+
function resolveRemoteMode(configRemote) {
|
|
52
|
+
const override = process.env.VOID_REMOTE;
|
|
53
|
+
if (override === "1") return true;
|
|
54
|
+
if (override === "0") return false;
|
|
55
|
+
return configRemote === true;
|
|
56
|
+
}
|
|
57
|
+
const INTERNAL_ENV_KEY_SET = /* @__PURE__ */ new Set([
|
|
58
|
+
"__VOID_TOKEN",
|
|
59
|
+
"__VOID_PROJECT_ID",
|
|
60
|
+
"__VOID_REMOTE",
|
|
61
|
+
"__VOID_STAGING",
|
|
62
|
+
"__VOID_PROXY_URL",
|
|
63
|
+
"__VOID_PROXY_TOKEN"
|
|
64
|
+
]);
|
|
65
|
+
/**
|
|
66
|
+
* Remove any internal Void env keys from a user-supplied env record. Returns
|
|
67
|
+
* the sanitized record plus the list of keys that were stripped so callers
|
|
68
|
+
* (which live in non-leaf modules) can emit a warning via `voidWarn`.
|
|
69
|
+
*
|
|
70
|
+
* This module is a leaf — it must not import from `../log` or any non-leaf
|
|
71
|
+
* module, otherwise the prerender subprocess's worker bundle acquires
|
|
72
|
+
* unwanted transitive dependencies. That's why warnings are the caller's
|
|
73
|
+
* responsibility.
|
|
74
|
+
*/
|
|
75
|
+
function stripInternalEnvKeys(input) {
|
|
76
|
+
if (!input) return {
|
|
77
|
+
sanitized: {},
|
|
78
|
+
stripped: []
|
|
79
|
+
};
|
|
80
|
+
const sanitized = {};
|
|
81
|
+
const stripped = [];
|
|
82
|
+
for (const [key, value] of Object.entries(input)) {
|
|
83
|
+
if (INTERNAL_ENV_KEY_SET.has(key)) {
|
|
84
|
+
stripped.push(key);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
sanitized[key] = value;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
sanitized,
|
|
91
|
+
stripped
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { loadLocalEnv as a, isClientEnvKey as i, CLOUDFLARE_DEPLOY_BUILD_ENV as n, resolveRemoteMode as o, findLegacyEnvFiles as r, stripInternalEnvKeys as s, CLIENT_ENV_PREFIX as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { o as join } from "./dist-BrsS7cai.mjs";
|
|
2
|
+
import { D as log, E as intro, O as note, k as outro, r as cliTitle } from "./output-tFQLLj26.mjs";
|
|
3
|
+
import { b as readDeploymentPlatform, c as getToken, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
|
|
4
|
+
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-BNPhro-M.mjs";
|
|
5
|
+
import { c as fetchRemoteSecretNames, l as formatEnvReport, p as validateProdEnv } from "./env-validation-ENpMy6Ez.mjs";
|
|
6
|
+
import { n as PlatformClient } from "./client-CyCHWSO_.mjs";
|
|
7
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
8
|
+
//#region src/cli/env.ts
|
|
9
|
+
async function runEnvCommand(root, args) {
|
|
10
|
+
console.log();
|
|
11
|
+
intro(cliTitle(`env ${args.subcommand}`));
|
|
12
|
+
if (args.subcommand === "check") {
|
|
13
|
+
await runCheck(root, args.useRemoteSecrets);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (args.subcommand === "types") {
|
|
17
|
+
runTypes(root);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function runCheck(root, useRemoteSecrets) {
|
|
22
|
+
let remoteSecrets;
|
|
23
|
+
if (useRemoteSecrets) {
|
|
24
|
+
const platform = readDeploymentPlatform(root);
|
|
25
|
+
if (platform === "none") throw new Error("env: Deployment is disabled. Run `void init` to choose a platform.");
|
|
26
|
+
if (platform === "cloudflare") {
|
|
27
|
+
const { listCloudflareSecrets, resolveCloudflareOperationContext } = await import("./cloudflare-operations-CPTpRW6d.mjs").then((n) => n.t);
|
|
28
|
+
remoteSecrets = await listCloudflareSecrets(resolveCloudflareOperationContext(root));
|
|
29
|
+
} else {
|
|
30
|
+
const token = getToken(root);
|
|
31
|
+
if (!token) {
|
|
32
|
+
log.error("--remote requires authentication. Run `void auth login` first.");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const config = readProjectConfig(root);
|
|
36
|
+
if (!config) {
|
|
37
|
+
log.error("--remote requires a linked project. Run `void project link` first.");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const client = new PlatformClient(token, { root });
|
|
41
|
+
remoteSecrets = await fetchRemoteSecretNames(client, config.projectId);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const { hasSchema, report } = await validateProdEnv(root, {
|
|
45
|
+
productionOnly: useRemoteSecrets,
|
|
46
|
+
remoteSecrets
|
|
47
|
+
});
|
|
48
|
+
if (!hasSchema) {
|
|
49
|
+
outro("No env.ts found — nothing to validate.");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (report.valid) {
|
|
53
|
+
outro(useRemoteSecrets ? "All required remote env names are present; values validate at runtime." : "Local .env values are valid.");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
note(formatEnvReport(report), "Env validation failed");
|
|
57
|
+
if (report.missing.length > 0) log.info(useRemoteSecrets ? "Upload missing server values with `void secret put <NAME>`; set VITE_* values in the build shell or schema defaults." : "Add the missing values to .env or set them in your shell.");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
function runTypes(root) {
|
|
61
|
+
const envFile = findEnvFile(root);
|
|
62
|
+
if (!envFile) {
|
|
63
|
+
outro("No env.ts found at project root — nothing to generate.");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const outDir = join(root, ".void");
|
|
67
|
+
mkdirSync(outDir, { recursive: true });
|
|
68
|
+
const { dts } = generateEnvTypes(envFile, outDir);
|
|
69
|
+
writeFileSync(join(outDir, "env.d.ts"), dts);
|
|
70
|
+
outro(`Wrote ${join(".void", "env.d.ts")}.`);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { runEnvCommand };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as StandardSchemaV1 } from "./standard-schema-Fo_vCAZh.mjs";
|
|
2
|
+
//#region src/runtime/env-helpers.d.ts
|
|
3
|
+
type EnvSchema<T> = StandardSchemaV1<unknown, T> & {
|
|
4
|
+
optional(): EnvSchema<T | undefined>;
|
|
5
|
+
default(value: NonNullable<T>): EnvSchema<NonNullable<T>>;
|
|
6
|
+
};
|
|
7
|
+
/** Required string env value. */
|
|
8
|
+
declare function string(): EnvSchema<string>;
|
|
9
|
+
/** Numeric env value. Parses with `Number(raw)`; rejects NaN. */
|
|
10
|
+
declare function number(): EnvSchema<number>;
|
|
11
|
+
/** Boolean env value. Accepts "true"/"false"/"1"/"0" (case-insensitive). */
|
|
12
|
+
declare function boolean(): EnvSchema<boolean>;
|
|
13
|
+
/** URL string — validated via `new URL(raw)`. */
|
|
14
|
+
declare function url(): EnvSchema<string>;
|
|
15
|
+
/** Email string — basic shape validation. */
|
|
16
|
+
declare function email(): EnvSchema<string>;
|
|
17
|
+
/** One of a fixed set of literal string values. */
|
|
18
|
+
declare function oneOf<const Values extends Array<string>>(values: Values): EnvSchema<Values[number]>;
|
|
19
|
+
/** JSON-parsed env value. Specify `T` to type the parsed result. */
|
|
20
|
+
declare function json<T = unknown>(): EnvSchema<T>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { number as a, url as c, json as i, boolean as n, oneOf as o, email as r, string as s, EnvSchema as t };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { t as StandardSchemaV1 } from "./standard-schema-Fo_vCAZh.mjs";
|
|
2
|
+
//#region src/runtime/env-public.d.ts
|
|
3
|
+
type AnyValidator = StandardSchemaV1<unknown, unknown>;
|
|
4
|
+
type AnySchema = Record<string, AnyValidator>;
|
|
5
|
+
/**
|
|
6
|
+
* Type-only stub for the validated env shape. Augmented by the generated
|
|
7
|
+
* `.void/env.d.ts` so `env.X` is typed per the user's schema. Includes an
|
|
8
|
+
* index signature so untyped property access returns `unknown` (rather than
|
|
9
|
+
* a hard error) for bindings and keys not declared in the schema.
|
|
10
|
+
*/
|
|
11
|
+
interface ValidatedEnv {
|
|
12
|
+
readonly [key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
type InferEnv<S extends AnySchema> = { readonly [K in keyof S]: StandardSchemaV1.InferOutput<S[K]>; };
|
|
15
|
+
/**
|
|
16
|
+
* Register an env schema and return the typed `env` proxy.
|
|
17
|
+
*
|
|
18
|
+
* Calling `defineEnv` is the only required step — Void auto-discovers
|
|
19
|
+
* `env.ts` at project root, imports it, and uses the schema for runtime
|
|
20
|
+
* validation, type generation, and deploy-time secret checks.
|
|
21
|
+
*
|
|
22
|
+
* The return value is identical to the `env` export from `void/env`.
|
|
23
|
+
* Re-export it from your `env.ts` if you prefer the explicit
|
|
24
|
+
* `import { env } from "~/env"` pattern.
|
|
25
|
+
*/
|
|
26
|
+
declare function defineEnv<S extends AnySchema>(schema: S): InferEnv<S>;
|
|
27
|
+
/**
|
|
28
|
+
* Internal: validate the entire schema against the worker's actual env on
|
|
29
|
+
* the first request per isolate. Catches bad remote-secret values and
|
|
30
|
+
* post-deploy drift that the deploy CLI can't see (it only knows secret
|
|
31
|
+
* names, not their values).
|
|
32
|
+
*
|
|
33
|
+
* Spliced into the generated worker entry by `compileWorkerEntry`. Cached
|
|
34
|
+
* after the first call so subsequent requests pay no cost.
|
|
35
|
+
*
|
|
36
|
+
* Async lifecycle: this function awaits any async Standard Schema
|
|
37
|
+
* validators (zod `refine`, arktype async narrows, etc.) and seeds the
|
|
38
|
+
* per-key cache with the resolved values. Subsequent reads via `env.X`
|
|
39
|
+
* hit the sync cache — async work only happens here, at boot. If a user
|
|
40
|
+
* accesses `env.X` for a key with an async validator *before* this
|
|
41
|
+
* function has run (e.g. during module-top-level code), the proxy will
|
|
42
|
+
* throw with guidance pointing back to this boot-time pre-validation.
|
|
43
|
+
*/
|
|
44
|
+
declare function _validateEnvOnce(envValues: unknown): Promise<void>;
|
|
45
|
+
/** Internal: framework-only access to the registered schema (for plugin/CLI). */
|
|
46
|
+
declare function _getRegisteredSchema(): AnySchema | null;
|
|
47
|
+
/**
|
|
48
|
+
* Internal: returns `true` once `defineEnv()` has been called at least once,
|
|
49
|
+
* regardless of whether the caller passed an empty schema. Gives tooling a
|
|
50
|
+
* reliable signal — `_getRegisteredSchema()` alone can't distinguish
|
|
51
|
+
* `defineEnv({})` (an intentional empty schema) from "never called".
|
|
52
|
+
*/
|
|
53
|
+
declare function _hasRegisteredSchema(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Internal: extract `.default(value)` values from the registered schema as
|
|
56
|
+
* stringified env values. Used for explicit build-time client fallbacks.
|
|
57
|
+
*
|
|
58
|
+
* Detection is schema-agnostic: probe each validator with `undefined` and,
|
|
59
|
+
* if it succeeds with a non-undefined value, that value is the default.
|
|
60
|
+
* Works for our built-in `.default(...)` helpers and for any Standard
|
|
61
|
+
* Schema validator with intrinsic default behaviour. Async validators are
|
|
62
|
+
* skipped (we can't get a sync default).
|
|
63
|
+
*
|
|
64
|
+
* Keys with no default — required keys and plain `.optional()` keys — are omitted.
|
|
65
|
+
*/
|
|
66
|
+
declare function _getSchemaDefaults(): Record<string, string>;
|
|
67
|
+
declare class EnvValidationError extends Error {
|
|
68
|
+
readonly key: string;
|
|
69
|
+
readonly issues: Array<StandardSchemaV1.Issue>;
|
|
70
|
+
constructor(key: string, issues: Array<StandardSchemaV1.Issue>);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Typed env proxy. Reads from the runtime env, validating declared keys
|
|
74
|
+
* on first access and passing through bindings / unknown keys unchanged.
|
|
75
|
+
*
|
|
76
|
+
* Sync-only: the `get` trap must be synchronous, so validators that return
|
|
77
|
+
* a `Promise` cannot be awaited here. For async Standard Schema validators,
|
|
78
|
+
* `_validateEnvOnce()` pre-resolves them at worker boot and seeds the
|
|
79
|
+
* per-env cache; property reads then serve the cached value synchronously.
|
|
80
|
+
* If an async validator is encountered here without a prior pre-validation,
|
|
81
|
+
* the trap throws with guidance on how to resolve it.
|
|
82
|
+
*/
|
|
83
|
+
declare const env: ValidatedEnv;
|
|
84
|
+
/** Aggregate report from validating an entire env object against the schema. */
|
|
85
|
+
type EnvValidationReport = {
|
|
86
|
+
valid: boolean;
|
|
87
|
+
missing: Array<string>;
|
|
88
|
+
invalid: Array<{
|
|
89
|
+
key: string;
|
|
90
|
+
messages: Array<string>;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* Resolved values for keys that validated successfully. Used to seed the
|
|
94
|
+
* per-env cache after async pre-validation so sync `env.X` reads hit the
|
|
95
|
+
* cache.
|
|
96
|
+
*/
|
|
97
|
+
values: Map<string, unknown>;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Validate an env record (local dotenv, build inputs, or runtime bindings) against
|
|
101
|
+
* the registered schema. Used by the dev plugin (warnings), the deploy CLI
|
|
102
|
+
* (hard error), and `_validateEnvOnce` at worker boot.
|
|
103
|
+
*
|
|
104
|
+
* Async: awaits any validators that return a `Promise` (zod async refines,
|
|
105
|
+
* arktype narrows, etc.). Callers already run in async contexts.
|
|
106
|
+
*/
|
|
107
|
+
declare function validateAllEnv(envValues: Record<string, unknown>): Promise<EnvValidationReport>;
|
|
108
|
+
declare global {
|
|
109
|
+
namespace Cloudflare {
|
|
110
|
+
interface Env {
|
|
111
|
+
DB: D1Database;
|
|
112
|
+
KV: KVNamespace;
|
|
113
|
+
STORAGE: R2Bucket;
|
|
114
|
+
AI: Ai;
|
|
115
|
+
SANDBOX: DurableObjectNamespace<import("@cloudflare/sandbox").Sandbox>;
|
|
116
|
+
/** @internal Service binding to proxy worker (AI, revalidation, future features) */
|
|
117
|
+
__VOID_PROXY?: Fetcher;
|
|
118
|
+
/** @internal Custom proxy URL override */
|
|
119
|
+
__VOID_PROXY_URL?: string;
|
|
120
|
+
/** @internal Auth token for HTTP proxy (local dev) */
|
|
121
|
+
__VOID_TOKEN?: string;
|
|
122
|
+
/** @internal Project ID for HTTP proxy (local dev) */
|
|
123
|
+
__VOID_PROJECT_ID?: string;
|
|
124
|
+
/** @internal Staging environment flag */
|
|
125
|
+
__VOID_STAGING?: string;
|
|
126
|
+
/** @internal Project ID (service binding path) */
|
|
127
|
+
__PROJECT_ID?: string;
|
|
128
|
+
/** @internal Proxy token (service binding path) */
|
|
129
|
+
__VOID_PROXY_TOKEN?: string;
|
|
130
|
+
[key: `QUEUE_${string}`]: Queue<unknown> | undefined;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { _getSchemaDefaults as a, defineEnv as c, _getRegisteredSchema as i, env as l, EnvValidationReport as n, _hasRegisteredSchema as o, ValidatedEnv as r, _validateEnvOnce as s, EnvValidationError as t, validateAllEnv as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
1
|
+
import { c as relative } from "./dist-BrsS7cai.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-SK8nMHPp.mjs";
|
|
3
3
|
import { i as voidWarn } from "./log-ChfPKsVd.mjs";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/codegen/env-types.ts
|