void 0.10.13 → 0.20.1
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-CAH62yDU.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-CJvZvPQO.mjs} +6 -4
- package/dist/{cache-C11V8Fxq.mjs → cache-BlNeQjuP.mjs} +9 -5
- package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-CmlAZ9P6.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 +1735 -165
- 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-Clirrol3.mjs} +120 -463
- package/dist/cloudflare-auth-B1QtTO1b.mjs +217 -0
- package/dist/cloudflare-cmd-B6_OZx2V.mjs +62 -0
- package/dist/cloudflare-connect-j5D4hhrG.mjs +56 -0
- package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
- package/dist/{config-qHGgPuWT.mjs → config-BQFq7QvD.mjs} +75 -41
- package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
- package/dist/connect-C04Wdy_h.mjs +79 -0
- package/dist/{create-project-DsYvl3TB.mjs → create-project-ChGZ1DFd.mjs} +26 -16
- package/dist/database-provider.d.mts +21 -0
- package/dist/database-provider.mjs +6 -0
- package/dist/{db-C0i0sYMS.mjs → db-D2d_mUsB.mjs} +612 -117
- package/dist/{delete-mh6p-zkQ.mjs → delete-D8GigDk8.mjs} +9 -6
- package/dist/{deploy-jBJT1fUT.mjs → deploy-iXZ3F0N6.mjs} +3252 -1995
- 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-B1VmoSr0.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-uKyQYUVY.mjs +1016 -0
- package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
- package/dist/env-BcQzYgoG.mjs +73 -0
- package/dist/env-D4Emu-M_.mjs +95 -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-BzXf3Jh2.mjs → gen-DI2YwdBM.mjs} +70 -15
- package/dist/generate-RTK8_kK1.mjs +47 -0
- package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-xItS5Zwf.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-ChAADPQu.mjs → headers-D8QfRX9Y.mjs} +12 -10
- package/dist/inbound-2d0zi2yS.mjs +706 -0
- package/dist/inbound-afAcWeQ9.d.mts +363 -0
- package/dist/index.d.mts +61 -34
- package/dist/index.mjs +1012 -293
- package/dist/{init-7JCAcKNQ.mjs → init-BD-9THgn.mjs} +329 -271
- package/dist/link-RMdgjF1v.mjs +52 -0
- package/dist/{list-CPwFDZ_c.mjs → list-3F52R_yO.mjs} +37 -5
- package/dist/{runner-kapo9aPs.mjs → local-d1-D2I6Ox5F.mjs} +116 -6
- package/dist/{login-BT3H8PN3.mjs → login-pV69H-ZO.mjs} +17 -15
- package/dist/{logs-Bt313ax7.mjs → logs-DFHHD6wE.mjs} +16 -2
- package/dist/mime-BJD7d_qL.mjs +1216 -0
- package/dist/neon-DHwd2zvC.mjs +54 -0
- package/dist/{node-pRg81HqV.mjs → node-Dk3H2jmU.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-DxJ2FRwR.mjs +123 -0
- package/dist/platform-domain-ChvbJkdy.mjs +228 -0
- package/dist/platform-lifecycle-DN4MzJF_.mjs +4450 -0
- package/dist/platform-management-Db2PXw0B.mjs +698 -0
- package/dist/platform-recovery-C_YO-tIs.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-BvvgAz-3.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-Mo0V9yKS.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-CPx2ZxsH.mjs → provision-Blnstcm2.mjs} +78 -45
- package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
- package/dist/{requests-B8sZxaFM.mjs → requests-BcKOVpRg.mjs} +5 -3
- package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
- package/dist/rollback-Bx85-0xh.mjs +166 -0
- package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
- package/dist/{route-types-z1jtHEi_.mjs → route-types-Da-DpyUp.mjs} +77 -25
- package/dist/routes-stub.d.mts +22 -23
- package/dist/runner-mysql-7BPUNGmL.mjs +61 -0
- package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-BkEza-dX.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-ChWt4pX1.mjs → scan-BMH4rzlv.mjs} +42 -19
- package/dist/{scan-NU4xKGci.mjs → scan-CpK-57ug.mjs} +5 -4
- package/dist/{secret-Dt32J6RI.mjs → secret-ByhJ9AMl.mjs} +62 -5
- package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
- package/dist/sqlite-validation-BzKMWnO4.mjs +25 -0
- 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-tBBN_dXH.mjs} +4 -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 +22 -3
- 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 +99 -25
- 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 +12 -10
- package/skills/void/docs/guide/email.md +640 -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 +264 -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 +5 -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 +15 -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 +665 -160
- package/skills/void/docs/reference/config.md +67 -27
- package/skills/void/docs/reference/resource-inference.md +13 -9
- package/skills/void/docs/reference/structure.md +9 -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 -221
- 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
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as getDatabaseDialect, f as readConfig } from "./config-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { a as isAbsolute, c as relative, l as resolve, n as dirname, o as join, t as basename } from "./dist-BrsS7cai.mjs";
|
|
2
|
+
import { C as cancel, D as log, E as intro, F as isCancel, N as text, O as note, f as detectAgents, j as select, k as outro, p as getPackageDir, r as cliTitle, w as confirm } from "./output-tFQLLj26.mjs";
|
|
3
|
+
import { n as readProjectPaths } from "./project-paths-SK8nMHPp.mjs";
|
|
4
|
+
import { C as writeDeploymentPlatform, T as writeProjectConfig, b as readDeploymentPlatform, c as getToken, u as isStagingMode, v as attachSelectedPlatform, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
|
|
5
|
+
import { i as LATEST_KNOWN_COMPAT_DATE, k as writeProvisionedWranglerConfig } from "./wrangler--imS8n0d.mjs";
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig } from "./config-BQFq7QvD.mjs";
|
|
7
|
+
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-Ql2XsSQp.mjs";
|
|
8
|
+
import { r as detectFramework } from "./plugin-inference-BDRfZngg.mjs";
|
|
9
|
+
import { n as parseDotenvFile, t as expandDotenv } from "./dotenv-VQxupEUv.mjs";
|
|
10
|
+
import { t as MagicString } from "./dist-BR1quN_w.mjs";
|
|
11
|
+
import { n as writeDrizzleConfig } from "./config-NOG_U1aK.mjs";
|
|
12
|
+
import { n as PlatformClient } from "./client-Clirrol3.mjs";
|
|
13
|
+
import { r as formatProjectCommand } from "./preset-lAy0B0BQ.mjs";
|
|
14
|
+
import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-ChGZ1DFd.mjs";
|
|
15
|
+
import { t as promptForLoginToken } from "./login-pV69H-ZO.mjs";
|
|
16
|
+
import { t as connectCloudflare } from "./cloudflare-connect-j5D4hhrG.mjs";
|
|
17
|
+
import { discoverPlatform, saveDiscoveredPlatform } from "./platform-cmd-DxJ2FRwR.mjs";
|
|
18
|
+
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DxSInkzL.mjs";
|
|
14
19
|
import { createRequire } from "node:module";
|
|
15
20
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
16
21
|
import { fileURLToPath } from "node:url";
|
|
17
22
|
import { spawnSync } from "node:child_process";
|
|
18
|
-
import { parseArgs } from "node:util";
|
|
19
23
|
import { parse } from "jsonc-parser";
|
|
24
|
+
import { parseArgs } from "node:util";
|
|
20
25
|
//#region src/cli/deploy-setup.ts
|
|
21
26
|
async function ensureToken(root) {
|
|
22
27
|
const existing = getToken(root);
|
|
@@ -38,7 +43,8 @@ async function maybeSetupDeployProject(root) {
|
|
|
38
43
|
process.exit(0);
|
|
39
44
|
}
|
|
40
45
|
if (!shouldSetup) return null;
|
|
41
|
-
const
|
|
46
|
+
const token = existingToken ?? await ensureToken(root);
|
|
47
|
+
const client = new PlatformClient(token, { root });
|
|
42
48
|
const projects = await client.listProjects();
|
|
43
49
|
if (projects.length === 0) return promptAndCreateProject(root, client);
|
|
44
50
|
const result = await promptProjectSelection(projects, "Select a project to link:", root, { confirmExisting: true });
|
|
@@ -47,7 +53,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
47
53
|
projectId: result.project.id,
|
|
48
54
|
slug: result.project.slug
|
|
49
55
|
};
|
|
50
|
-
writeProjectConfig(root, config);
|
|
56
|
+
writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
51
57
|
log.success(`Linked project: ${config.slug}`);
|
|
52
58
|
return config;
|
|
53
59
|
}
|
|
@@ -66,14 +72,8 @@ async function maybeSetupDeployProject(root) {
|
|
|
66
72
|
* This is a best-effort DX sweetener, not a correctness boundary — a
|
|
67
73
|
* wrong guess only costs the user a single-line edit.
|
|
68
74
|
*/
|
|
69
|
-
/**
|
|
70
|
-
const SCAFFOLD_SOURCE_FILES = [
|
|
71
|
-
".env",
|
|
72
|
-
".env.local",
|
|
73
|
-
".env.development",
|
|
74
|
-
".env.development.local",
|
|
75
|
-
".env.example"
|
|
76
|
-
];
|
|
75
|
+
/** Void has one local dotenv source. */
|
|
76
|
+
const SCAFFOLD_SOURCE_FILES = [".env"];
|
|
77
77
|
const BOOLEAN_LITERAL = /^(true|false)$/i;
|
|
78
78
|
const HTTP_URL = /^https?:\/\/\S+$/;
|
|
79
79
|
const SMALL_INTEGER = /^(?:0|[1-9]\d{0,4})$/;
|
|
@@ -97,10 +97,11 @@ function collectInferredEntries(root) {
|
|
|
97
97
|
const cumulative = {};
|
|
98
98
|
for (const file of SCAFFOLD_SOURCE_FILES) {
|
|
99
99
|
const parsed = parseDotenvFile(join(root, file), { expand: false });
|
|
100
|
-
const
|
|
100
|
+
const expansionView = {
|
|
101
101
|
...parsed,
|
|
102
102
|
...cumulative
|
|
103
|
-
}
|
|
103
|
+
};
|
|
104
|
+
const expanded = expandDotenv(expansionView);
|
|
104
105
|
for (const key of Object.keys(parsed)) {
|
|
105
106
|
const value = expanded[key] ?? "";
|
|
106
107
|
if (!(key in cumulative)) cumulative[key] = parsed[key];
|
|
@@ -142,7 +143,7 @@ function renderEnvTs(entries) {
|
|
|
142
143
|
const lines = [];
|
|
143
144
|
lines.push(`import { defineEnv, ${importList.join(", ")} } from 'void/env';`);
|
|
144
145
|
lines.push("");
|
|
145
|
-
lines.push(`// Scaffolded from
|
|
146
|
+
lines.push(`// Scaffolded from .env. Inference is conservative — review each`);
|
|
146
147
|
lines.push(`// entry and tighten types as needed (e.g. oneOf([...]), url(), .optional(),`);
|
|
147
148
|
lines.push(`// .default(value), or a Standard Schema validator from valibot/zod/arktype).`);
|
|
148
149
|
lines.push(`export default defineEnv({`);
|
|
@@ -152,7 +153,7 @@ function renderEnvTs(entries) {
|
|
|
152
153
|
return lines.join("\n");
|
|
153
154
|
}
|
|
154
155
|
/**
|
|
155
|
-
* If the project has no `env.ts`, scaffold one based on `.env
|
|
156
|
+
* If the project has no `env.ts`, scaffold one based on the local `.env`
|
|
156
157
|
* user already has. Safe to call unconditionally during `void init` — it
|
|
157
158
|
* no-ops when `env.ts` is present. Never overwrites an existing file.
|
|
158
159
|
*/
|
|
@@ -191,19 +192,68 @@ function maybeScaffoldEnvTs(root) {
|
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
194
|
//#endregion
|
|
195
|
+
//#region src/cli/init-git.ts
|
|
196
|
+
async function setupGit(root, git) {
|
|
197
|
+
if (git === false) return false;
|
|
198
|
+
let directory = resolve(root);
|
|
199
|
+
while (true) {
|
|
200
|
+
if (existsSync(join(directory, ".git"))) return false;
|
|
201
|
+
const parent = dirname(directory);
|
|
202
|
+
if (parent === directory) break;
|
|
203
|
+
directory = parent;
|
|
204
|
+
}
|
|
205
|
+
if (git === void 0) {
|
|
206
|
+
if (process.env.CI || !process.stdin.isTTY) return false;
|
|
207
|
+
const selected = await confirm({
|
|
208
|
+
message: "Initialize a git repository?",
|
|
209
|
+
initialValue: true
|
|
210
|
+
});
|
|
211
|
+
if (isCancel(selected)) {
|
|
212
|
+
cancel("Setup cancelled.");
|
|
213
|
+
process.exit(0);
|
|
214
|
+
}
|
|
215
|
+
if (!selected) return false;
|
|
216
|
+
}
|
|
217
|
+
const result = spawnSync("git", ["init"], {
|
|
218
|
+
cwd: root,
|
|
219
|
+
encoding: "utf-8",
|
|
220
|
+
stdio: [
|
|
221
|
+
"ignore",
|
|
222
|
+
"pipe",
|
|
223
|
+
"pipe"
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
if (result.status !== 0) {
|
|
227
|
+
log.warn("Failed to initialize git repository");
|
|
228
|
+
const detail = result.stderr?.trim() || result.error?.message;
|
|
229
|
+
if (detail) log.info(detail);
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
function initialCommitCommand(root) {
|
|
235
|
+
const directory = resolve(root);
|
|
236
|
+
const argument = /^[A-Za-z0-9_@./:-]+$/.test(directory) ? directory : process.platform === "win32" ? `"${directory}"` : `'${directory.replaceAll("'", "'\\''")}'`;
|
|
237
|
+
const git = directory === resolve(process.cwd()) ? "git" : `git -C ${argument}`;
|
|
238
|
+
return `${git} add -A && ${git} commit -m "chore: initial commit"`;
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
194
241
|
//#region src/cli/template.ts
|
|
195
242
|
const SCAFFOLD_GITIGNORE_LINES = [
|
|
196
243
|
"node_modules",
|
|
197
244
|
"dist",
|
|
198
245
|
".void",
|
|
199
246
|
".wrangler",
|
|
247
|
+
".env",
|
|
248
|
+
".env.*",
|
|
249
|
+
"!.env.example",
|
|
200
250
|
"*.tsbuildinfo",
|
|
201
251
|
".DS_Store"
|
|
202
252
|
];
|
|
203
253
|
const SCAFFOLD_BASE_DEPENDENCIES = { hono: "^4.11.9" };
|
|
204
254
|
const SCAFFOLD_BASE_DEV_DEPENDENCIES = {
|
|
205
255
|
vite: "^8.0.10",
|
|
206
|
-
typescript: "^
|
|
256
|
+
typescript: "^7.0.2"
|
|
207
257
|
};
|
|
208
258
|
const SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES = { "vite-plus": "^0.1.21" };
|
|
209
259
|
const SCAFFOLD_TOOLCHAIN_OPTIONS = [{
|
|
@@ -215,11 +265,7 @@ const SCAFFOLD_TOOLCHAIN_OPTIONS = [{
|
|
|
215
265
|
label: "Vite",
|
|
216
266
|
hint: "Uses plain Vite commands without Vite+."
|
|
217
267
|
}];
|
|
218
|
-
const REACT_SCAFFOLD_COMPILER_DEV_DEPENDENCIES = {
|
|
219
|
-
"@rolldown/plugin-babel": "^0.2.3",
|
|
220
|
-
"@vitejs/plugin-react": "^6.0.1",
|
|
221
|
-
"babel-plugin-react-compiler": "^1.0.0"
|
|
222
|
-
};
|
|
268
|
+
const REACT_SCAFFOLD_COMPILER_DEV_DEPENDENCIES = { "oxc-transform-react": "^0.149.0" };
|
|
223
269
|
const SCAFFOLD_FRAMEWORK_OPTIONS = [
|
|
224
270
|
{
|
|
225
271
|
value: "react",
|
|
@@ -334,19 +380,14 @@ function createPagesStarterTemplate(options) {
|
|
|
334
380
|
};
|
|
335
381
|
}
|
|
336
382
|
function getViteConfig(framework, config) {
|
|
337
|
-
if (framework === "react") return `import
|
|
338
|
-
import { reactCompilerPreset } from "@vitejs/plugin-react";
|
|
339
|
-
import { defineConfig } from "vite";
|
|
383
|
+
if (framework === "react") return `import { defineConfig } from "vite";
|
|
340
384
|
import { voidPlugin } from "void";
|
|
341
385
|
import { ${config.adapterImport} } from "${config.adapterPlugin}";
|
|
342
386
|
|
|
343
387
|
export default defineConfig({
|
|
344
388
|
plugins: [
|
|
345
|
-
babel({
|
|
346
|
-
presets: [reactCompilerPreset()],
|
|
347
|
-
}),
|
|
348
389
|
voidPlugin(),
|
|
349
|
-
${config.adapterImport}(),
|
|
390
|
+
${config.adapterImport}({ react: { compiler: true } }),
|
|
350
391
|
],
|
|
351
392
|
});
|
|
352
393
|
`;
|
|
@@ -379,7 +420,7 @@ export const GET = defineHandler(() => {
|
|
|
379
420
|
return {
|
|
380
421
|
message: "Hello from Void",
|
|
381
422
|
framework: "${frameworkLabel}",
|
|
382
|
-
database: "${starterMode === "postgresql" ? "PostgreSQL" : "D1"}",
|
|
423
|
+
database: "${starterMode === "postgresql" ? "PostgreSQL" : starterMode === "mysql" ? "MySQL" : "D1"}",
|
|
383
424
|
};
|
|
384
425
|
});
|
|
385
426
|
`;
|
|
@@ -392,6 +433,14 @@ export const messages = pgTable("messages", {
|
|
|
392
433
|
text: text("text").notNull(),
|
|
393
434
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
394
435
|
});
|
|
436
|
+
`;
|
|
437
|
+
if (starterMode === "mysql") return `import { int, mysqlTable, text, timestamp } from "void/schema-mysql";
|
|
438
|
+
|
|
439
|
+
export const messages = mysqlTable("messages", {
|
|
440
|
+
id: int("id").autoincrement().primaryKey(),
|
|
441
|
+
text: text("text").notNull(),
|
|
442
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
443
|
+
});
|
|
395
444
|
`;
|
|
396
445
|
return `import { sql } from "void/db";
|
|
397
446
|
import { integer, sqliteTable, text } from "void/schema-d1";
|
|
@@ -608,8 +657,10 @@ function parseInitArgs(args) {
|
|
|
608
657
|
options: {
|
|
609
658
|
tsconfig: { type: "boolean" },
|
|
610
659
|
github: { type: "boolean" },
|
|
611
|
-
agents: { type: "boolean" }
|
|
660
|
+
agents: { type: "boolean" },
|
|
661
|
+
git: { type: "boolean" }
|
|
612
662
|
},
|
|
663
|
+
allowNegative: true,
|
|
613
664
|
strict: true
|
|
614
665
|
});
|
|
615
666
|
} catch (error) {
|
|
@@ -619,7 +670,8 @@ function parseInitArgs(args) {
|
|
|
619
670
|
return {
|
|
620
671
|
tsconfig: parsed.values.tsconfig === true,
|
|
621
672
|
github: parsed.values.github === true,
|
|
622
|
-
agents: parsed.values.agents === true
|
|
673
|
+
agents: parsed.values.agents === true,
|
|
674
|
+
git: parsed.values.git
|
|
623
675
|
};
|
|
624
676
|
}
|
|
625
677
|
const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
@@ -663,7 +715,6 @@ const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
|
663
715
|
".zencoder"
|
|
664
716
|
]);
|
|
665
717
|
const PNPM_ALLOWED_BUILDS = [
|
|
666
|
-
"better-sqlite3",
|
|
667
718
|
"esbuild",
|
|
668
719
|
"sharp",
|
|
669
720
|
"workerd"
|
|
@@ -675,10 +726,10 @@ const EMPTY_PROJECT_ALLOWED_PACKAGES = /* @__PURE__ */ new Set([
|
|
|
675
726
|
"vite",
|
|
676
727
|
"vite-plus",
|
|
677
728
|
"typescript",
|
|
678
|
-
"@typescript/native-preview",
|
|
679
729
|
"@rolldown/plugin-babel",
|
|
680
730
|
"@vitejs/plugin-react",
|
|
681
731
|
"babel-plugin-react-compiler",
|
|
732
|
+
"oxc-transform-react",
|
|
682
733
|
"@types/react",
|
|
683
734
|
"@types/react-dom",
|
|
684
735
|
"react",
|
|
@@ -938,7 +989,7 @@ async function resolveInitRoot(root) {
|
|
|
938
989
|
initialValue: "my-void-app",
|
|
939
990
|
validate: (value) => validateSubfolderName(root, value)
|
|
940
991
|
});
|
|
941
|
-
if (isCancel(folder)) {
|
|
992
|
+
if (isCancel(folder) || typeof folder === "symbol") {
|
|
942
993
|
cancel("Setup cancelled.");
|
|
943
994
|
process.exit(0);
|
|
944
995
|
}
|
|
@@ -1355,11 +1406,10 @@ function detectProjectState(root) {
|
|
|
1355
1406
|
try {
|
|
1356
1407
|
pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
1357
1408
|
const pkgRecord = pkg ?? {};
|
|
1358
|
-
|
|
1409
|
+
hasTypescript = "typescript" in {
|
|
1359
1410
|
...asRecord(pkgRecord.dependencies) ?? {},
|
|
1360
1411
|
...asRecord(pkgRecord.devDependencies) ?? {}
|
|
1361
1412
|
};
|
|
1362
|
-
hasTypescript = "typescript" in allDeps || "@typescript/native-preview" in allDeps;
|
|
1363
1413
|
} catch {}
|
|
1364
1414
|
let packageManager;
|
|
1365
1415
|
if (existsSync(join(root, "pnpm-lock.yaml"))) packageManager = "pnpm";
|
|
@@ -1539,11 +1589,6 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1539
1589
|
if (!state.hasTypescript) log.info("Don't forget to install typescript");
|
|
1540
1590
|
}
|
|
1541
1591
|
}
|
|
1542
|
-
/** Today's UTC date as YYYY-MM-DD for wrangler compatibility_date. */
|
|
1543
|
-
function getTodayCompatDate() {
|
|
1544
|
-
const d = /* @__PURE__ */ new Date();
|
|
1545
|
-
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, "0")}-${String(d.getUTCDate()).padStart(2, "0")}`;
|
|
1546
|
-
}
|
|
1547
1592
|
function readProjectWranglerCompatDate(root) {
|
|
1548
1593
|
for (const name of ["wrangler.jsonc", "wrangler.json"]) {
|
|
1549
1594
|
const configPath = join(root, name);
|
|
@@ -1563,42 +1608,13 @@ function readProjectWranglerCompatDate(root) {
|
|
|
1563
1608
|
*/
|
|
1564
1609
|
function setupWranglerConfig(root, framework) {
|
|
1565
1610
|
if (framework.class === "a") return;
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
try {
|
|
1574
|
-
const raw = readFileSync(p, "utf-8");
|
|
1575
|
-
const errors = [];
|
|
1576
|
-
parsed = parse(raw, errors);
|
|
1577
|
-
if (errors.length > 0) throw new SyntaxError("Failed to parse JSONC");
|
|
1578
|
-
} catch {}
|
|
1579
|
-
break;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
if (!configPath || !parsed) {
|
|
1583
|
-
configPath = join(root, "wrangler.jsonc");
|
|
1584
|
-
parsed = {};
|
|
1585
|
-
created = true;
|
|
1586
|
-
}
|
|
1587
|
-
let modified = false;
|
|
1588
|
-
if (!parsed.compatibility_date) {
|
|
1589
|
-
parsed.compatibility_date = getTodayCompatDate();
|
|
1590
|
-
modified = true;
|
|
1591
|
-
}
|
|
1592
|
-
const flags = Array.isArray(parsed.compatibility_flags) ? parsed.compatibility_flags : [];
|
|
1593
|
-
if (!flags.includes("nodejs_als")) {
|
|
1594
|
-
parsed.compatibility_flags = [...flags, "nodejs_als"];
|
|
1595
|
-
modified = true;
|
|
1596
|
-
}
|
|
1597
|
-
if (created || modified) {
|
|
1598
|
-
writeFileSync(configPath, JSON.stringify(parsed, null, 2) + "\n");
|
|
1599
|
-
if (created) log.success("Created wrangler.jsonc with compatibility_date and nodejs_als");
|
|
1600
|
-
else log.success("Updated wrangler.jsonc with compatibility_date and nodejs_als");
|
|
1601
|
-
} else log.success("wrangler.jsonc looks good");
|
|
1611
|
+
const hadConfig = ["wrangler.jsonc", "wrangler.json"].some((name) => existsSync(join(root, name)));
|
|
1612
|
+
const result = writeProvisionedWranglerConfig(root, {
|
|
1613
|
+
compatibilityDate: LATEST_KNOWN_COMPAT_DATE,
|
|
1614
|
+
compatibilityFlags: ["nodejs_als"]
|
|
1615
|
+
});
|
|
1616
|
+
if (result.modified) log.success(hadConfig ? "Updated Cloudflare config with compatibility_date and nodejs_als" : "Created wrangler.jsonc with compatibility_date and nodejs_als");
|
|
1617
|
+
else log.success(`${basename(result.configPath)} looks good`);
|
|
1602
1618
|
}
|
|
1603
1619
|
function withDefaultVoidSchema(config) {
|
|
1604
1620
|
if (typeof config.$schema === "string" && config.$schema.length > 0) return config;
|
|
@@ -1615,7 +1631,7 @@ function ensureVoidWorkerCompatibilityDate(root) {
|
|
|
1615
1631
|
if (typeof config.target === "string" && config.target !== "cloudflare") return;
|
|
1616
1632
|
const worker = asRecord(config.worker) ?? {};
|
|
1617
1633
|
if (typeof worker.compatibility_date === "string" && worker.compatibility_date.length > 0) return;
|
|
1618
|
-
const compatibilityDate = readProjectWranglerCompatDate(root) ??
|
|
1634
|
+
const compatibilityDate = readProjectWranglerCompatDate(root) ?? "2026-02-24";
|
|
1619
1635
|
config.worker = {
|
|
1620
1636
|
...worker,
|
|
1621
1637
|
compatibility_date: compatibilityDate
|
|
@@ -1626,7 +1642,7 @@ function ensureVoidWorkerCompatibilityDate(root) {
|
|
|
1626
1642
|
function clearConfiguredDatabase(root, messages) {
|
|
1627
1643
|
const config = readConfig(root);
|
|
1628
1644
|
const configPath = join(root, VOID_CONFIG_FILE);
|
|
1629
|
-
if (config.database !== "pg") {
|
|
1645
|
+
if (config.database !== "pg" && config.database !== "mysql") {
|
|
1630
1646
|
log.info(messages.unchanged);
|
|
1631
1647
|
return;
|
|
1632
1648
|
}
|
|
@@ -1651,13 +1667,24 @@ function applyDatabaseDialect(root, dialect) {
|
|
|
1651
1667
|
log.success("Configured PostgreSQL in void.json");
|
|
1652
1668
|
return;
|
|
1653
1669
|
}
|
|
1670
|
+
if (dialect === "mysql") {
|
|
1671
|
+
if (config.database === "mysql") {
|
|
1672
|
+
log.info("MySQL already configured in void.json");
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1675
|
+
config.database = "mysql";
|
|
1676
|
+
writeVoidConfig(root, config);
|
|
1677
|
+
log.success("Configured MySQL in void.json");
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1654
1680
|
clearConfiguredDatabase(root, {
|
|
1655
1681
|
unchanged: "Using default D1 (SQLite) configuration",
|
|
1656
1682
|
updated: "Updated void.json to use the default D1 (SQLite) configuration"
|
|
1657
1683
|
});
|
|
1658
1684
|
}
|
|
1659
1685
|
function detectDatabaseSetup(root) {
|
|
1660
|
-
|
|
1686
|
+
const dialect = getDatabaseDialect(readConfig(root));
|
|
1687
|
+
if (dialect !== "sqlite") return dialect;
|
|
1661
1688
|
if (hasDrizzleSchema(root) || existsSync(readProjectPaths(root).migrationsDir) || existsSync(join(root, "migrations"))) return "sqlite";
|
|
1662
1689
|
return "none";
|
|
1663
1690
|
}
|
|
@@ -1685,6 +1712,11 @@ async function promptStarterMode() {
|
|
|
1685
1712
|
label: "PostgreSQL",
|
|
1686
1713
|
hint: "Scaffolds the same starter with PostgreSQL, a generated migration, a seed file, and writes \"database\": \"pg\" to void.json."
|
|
1687
1714
|
},
|
|
1715
|
+
{
|
|
1716
|
+
value: "mysql",
|
|
1717
|
+
label: "MySQL",
|
|
1718
|
+
hint: "Scaffolds the same starter with MySQL, a generated migration, a seed file, and writes \"database\": \"mysql\" to void.json."
|
|
1719
|
+
},
|
|
1688
1720
|
{
|
|
1689
1721
|
value: "static",
|
|
1690
1722
|
label: "Static Pages",
|
|
@@ -1692,7 +1724,7 @@ async function promptStarterMode() {
|
|
|
1692
1724
|
}
|
|
1693
1725
|
]
|
|
1694
1726
|
});
|
|
1695
|
-
if (isCancel(choice)) {
|
|
1727
|
+
if (isCancel(choice) || typeof choice === "symbol") {
|
|
1696
1728
|
cancel("Setup cancelled.");
|
|
1697
1729
|
process.exit(0);
|
|
1698
1730
|
}
|
|
@@ -1737,10 +1769,15 @@ async function promptDatabaseSetup(root) {
|
|
|
1737
1769
|
label: currentSetup === "postgresql" ? "PostgreSQL [current]" : "PostgreSQL",
|
|
1738
1770
|
hint: "Bring your own Postgres via Hyperdrive; best for write-heavy apps, complex queries, or existing infra."
|
|
1739
1771
|
},
|
|
1772
|
+
{
|
|
1773
|
+
value: "mysql",
|
|
1774
|
+
label: currentSetup === "mysql" ? "MySQL [current]" : "MySQL",
|
|
1775
|
+
hint: "Bring your own MySQL via Hyperdrive; ideal for existing MySQL infrastructure and compatible providers."
|
|
1776
|
+
},
|
|
1740
1777
|
{
|
|
1741
1778
|
value: "none",
|
|
1742
1779
|
label: "No Database Yet",
|
|
1743
|
-
hint: "Skip database setup for now. You can add D1 or
|
|
1780
|
+
hint: "Skip database setup for now. You can add D1, PostgreSQL, or MySQL later as your app grows."
|
|
1744
1781
|
}
|
|
1745
1782
|
]
|
|
1746
1783
|
});
|
|
@@ -1750,6 +1787,72 @@ async function promptDatabaseSetup(root) {
|
|
|
1750
1787
|
}
|
|
1751
1788
|
return choice;
|
|
1752
1789
|
}
|
|
1790
|
+
async function promptDeploymentPlatform(root) {
|
|
1791
|
+
const current = readDeploymentPlatform(root);
|
|
1792
|
+
const choice = await select({
|
|
1793
|
+
message: "Where should this project deploy?",
|
|
1794
|
+
initialValue: current ?? "cloudflare",
|
|
1795
|
+
options: [
|
|
1796
|
+
{
|
|
1797
|
+
value: "cloudflare",
|
|
1798
|
+
label: current === "cloudflare" ? "Cloudflare [current]" : "Cloudflare",
|
|
1799
|
+
hint: "Deploy to your own Cloudflare account. (default)"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
value: "void",
|
|
1803
|
+
label: current === "void" ? "Void [current]" : "Void",
|
|
1804
|
+
hint: "Deploy to your company's Void Platform."
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
value: "none",
|
|
1808
|
+
label: current === "none" ? "Skip deployment setup [current]" : "Skip deployment setup",
|
|
1809
|
+
hint: "Use Void locally or deploy another way."
|
|
1810
|
+
}
|
|
1811
|
+
]
|
|
1812
|
+
});
|
|
1813
|
+
if (isCancel(choice) || typeof choice === "symbol") {
|
|
1814
|
+
cancel("Setup cancelled.");
|
|
1815
|
+
process.exit(0);
|
|
1816
|
+
}
|
|
1817
|
+
const platform = choice;
|
|
1818
|
+
writeDeploymentPlatform(root, platform);
|
|
1819
|
+
return platform;
|
|
1820
|
+
}
|
|
1821
|
+
async function ensureVoidPlatformConnection(root) {
|
|
1822
|
+
let selectedApiUrl = null;
|
|
1823
|
+
let promptedForPlatform = false;
|
|
1824
|
+
try {
|
|
1825
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-W9WII-mN.mjs").then((n) => n.t);
|
|
1826
|
+
selectedApiUrl = getApiUrl(root);
|
|
1827
|
+
getSiteDomain(root);
|
|
1828
|
+
} catch (error) {
|
|
1829
|
+
if (!(error instanceof Error) || !error.message.includes("No Void platform selected")) throw error;
|
|
1830
|
+
}
|
|
1831
|
+
if (!selectedApiUrl) {
|
|
1832
|
+
promptedForPlatform = true;
|
|
1833
|
+
const value = await text({
|
|
1834
|
+
message: "Void platform API URL:",
|
|
1835
|
+
placeholder: "https://platform.example.com"
|
|
1836
|
+
});
|
|
1837
|
+
if (isCancel(value) || typeof value === "symbol") {
|
|
1838
|
+
cancel("Setup cancelled.");
|
|
1839
|
+
process.exit(0);
|
|
1840
|
+
}
|
|
1841
|
+
selectedApiUrl = String(value);
|
|
1842
|
+
}
|
|
1843
|
+
const discovery = await discoverPlatform(selectedApiUrl);
|
|
1844
|
+
saveDiscoveredPlatform(discovery);
|
|
1845
|
+
if (promptedForPlatform) log.success(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
1846
|
+
return discovery;
|
|
1847
|
+
}
|
|
1848
|
+
async function setupCloudflareDeployment(root) {
|
|
1849
|
+
try {
|
|
1850
|
+
await connectCloudflare(root, true);
|
|
1851
|
+
} catch (error) {
|
|
1852
|
+
log.warn(error instanceof Error ? error.message : String(error));
|
|
1853
|
+
note("Run `void connect --platform cloudflare` when you want to finish Cloudflare setup.", "Cloudflare deployment");
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1753
1856
|
/** Get the dev command for a detected framework. */
|
|
1754
1857
|
function getDevCommand(root, framework) {
|
|
1755
1858
|
if (!framework) return formatProjectCommand(root, "vite dev");
|
|
@@ -1812,11 +1915,40 @@ function getWorkflowSetupSteps(root, pm) {
|
|
|
1812
1915
|
* otherwise a `${{ vars.VOID_PROJECT }}` placeholder is emitted with a comment
|
|
1813
1916
|
* telling the user to set the repository variable.
|
|
1814
1917
|
*/
|
|
1815
|
-
function getWorkflowYaml(root, pm, slug) {
|
|
1918
|
+
function getWorkflowYaml(root, pm, slug, platform = "void", platformApiUrl = WORKFLOW_DEFAULT_API_URL) {
|
|
1816
1919
|
const { setup, install, runner } = getWorkflowSetupSteps(root, pm);
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1920
|
+
if (platform === "cloudflare") return `name: Deploy to Cloudflare
|
|
1921
|
+
on:
|
|
1922
|
+
push:
|
|
1923
|
+
branches: [main]
|
|
1924
|
+
|
|
1925
|
+
concurrency:
|
|
1926
|
+
group: void-cloudflare-deploy-\${{ github.repository }}-\${{ github.ref }}
|
|
1927
|
+
cancel-in-progress: true
|
|
1928
|
+
|
|
1929
|
+
permissions:
|
|
1930
|
+
contents: read
|
|
1931
|
+
|
|
1932
|
+
jobs:
|
|
1933
|
+
deploy:
|
|
1934
|
+
runs-on: ubuntu-latest
|
|
1935
|
+
steps:
|
|
1936
|
+
- uses: actions/checkout@v6
|
|
1937
|
+
${setup}
|
|
1938
|
+
${install}
|
|
1939
|
+
- name: Deploy
|
|
1940
|
+
env:
|
|
1941
|
+
# Add this scoped token at Settings → Secrets and variables → Actions.
|
|
1942
|
+
CLOUDFLARE_API_TOKEN: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
1943
|
+
# Required only for PostgreSQL/MySQL provisioning and migrations.
|
|
1944
|
+
DATABASE_URL: \${{ secrets.DATABASE_URL }}
|
|
1945
|
+
# Required in fresh checkouts when a Worker Version has no preview URL.
|
|
1946
|
+
CLOUDFLARE_WORKERS_SUBDOMAIN: \${{ vars.CLOUDFLARE_WORKERS_SUBDOMAIN }}
|
|
1947
|
+
# Required only when Cloudflare Access protects Worker readiness.
|
|
1948
|
+
CF_ACCESS_CLIENT_ID: \${{ secrets.CF_ACCESS_CLIENT_ID }}
|
|
1949
|
+
CF_ACCESS_CLIENT_SECRET: \${{ secrets.CF_ACCESS_CLIENT_SECRET }}
|
|
1950
|
+
run: ${runner} deploy --platform cloudflare
|
|
1951
|
+
`;
|
|
1820
1952
|
return `name: Deploy to Void
|
|
1821
1953
|
on:
|
|
1822
1954
|
push:
|
|
@@ -1838,9 +1970,11 @@ permissions:
|
|
|
1838
1970
|
contents: read
|
|
1839
1971
|
|
|
1840
1972
|
env:
|
|
1841
|
-
# Override
|
|
1842
|
-
VOID_API_URL: \${{ vars.VOID_API_URL || '${
|
|
1843
|
-
${
|
|
1973
|
+
# Override only when intentionally targeting another platform deployment.
|
|
1974
|
+
VOID_API_URL: \${{ vars.VOID_API_URL || '${platformApiUrl}' }}
|
|
1975
|
+
${slug ? `VOID_PROJECT: ${slug}` : `# Set a VOID_PROJECT repository variable to your project slug
|
|
1976
|
+
# (Settings → Secrets and variables → Actions → Variables).
|
|
1977
|
+
VOID_PROJECT: \${{ vars.VOID_PROJECT }}`}
|
|
1844
1978
|
|
|
1845
1979
|
jobs:
|
|
1846
1980
|
deploy:
|
|
@@ -1850,10 +1984,10 @@ jobs:
|
|
|
1850
1984
|
${setup}
|
|
1851
1985
|
${install}
|
|
1852
1986
|
- name: Deploy
|
|
1853
|
-
run: ${runner} deploy --project "$VOID_PROJECT"
|
|
1987
|
+
run: ${runner} deploy --platform void --project "$VOID_PROJECT"
|
|
1854
1988
|
`;
|
|
1855
1989
|
}
|
|
1856
|
-
function setupGithubActions(root, state) {
|
|
1990
|
+
function setupGithubActions(root, state, platform = "void", platformApiUrl = WORKFLOW_DEFAULT_API_URL) {
|
|
1857
1991
|
const workflowDir = join(root, ".github", "workflows");
|
|
1858
1992
|
const workflowPath = join(workflowDir, "void-deploy.yml");
|
|
1859
1993
|
if (existsSync(workflowPath)) {
|
|
@@ -1862,9 +1996,10 @@ function setupGithubActions(root, state) {
|
|
|
1862
1996
|
}
|
|
1863
1997
|
const slug = readProjectConfig(root)?.slug ?? null;
|
|
1864
1998
|
mkdirSync(workflowDir, { recursive: true });
|
|
1865
|
-
writeFileSync(workflowPath, getWorkflowYaml(root, state.packageManager, slug));
|
|
1999
|
+
writeFileSync(workflowPath, getWorkflowYaml(root, state.packageManager, slug, platform, platformApiUrl));
|
|
1866
2000
|
log.success("Created .github/workflows/void-deploy.yml");
|
|
1867
|
-
if (
|
|
2001
|
+
if (platform === "cloudflare") note("Pushes to main will deploy through the same readiness-gated Cloudflare path.\nAdd a scoped CLOUDFLARE_API_TOKEN repository secret; PostgreSQL/MySQL apps also need DATABASE_URL.\nKeep account_id in wrangler.jsonc.", "GitHub Actions Cloudflare deploy");
|
|
2002
|
+
else if (slug) note(`Pushes to main will build and deploy "${slug}" via GitHub OIDC — no token to store.\nConnect the repo to your project in the Void dashboard to authorize it.`, "GitHub Actions OIDC deploy");
|
|
1868
2003
|
else note("Pushes to main will build and deploy via GitHub OIDC — no token to store.\nSet a VOID_PROJECT repository variable (Settings → Secrets and variables → Actions → Variables)\nto your project slug, and connect the repo to your project in the Void dashboard.", "GitHub Actions OIDC deploy");
|
|
1869
2004
|
}
|
|
1870
2005
|
/**
|
|
@@ -1906,7 +2041,8 @@ function ensureGitignore(root) {
|
|
|
1906
2041
|
const existing = new Set(content.split(/\r?\n/).map((line) => line.trim()).filter(Boolean));
|
|
1907
2042
|
const missing = SCAFFOLD_GITIGNORE_LINES.filter((line) => !existing.has(line));
|
|
1908
2043
|
if (missing.length === 0) return;
|
|
1909
|
-
|
|
2044
|
+
const separator = content.endsWith("\n") ? "" : "\n";
|
|
2045
|
+
writeFileSync(gitignorePath, content + separator + missing.join("\n") + "\n");
|
|
1910
2046
|
log.success("Updated .gitignore with Void defaults");
|
|
1911
2047
|
}
|
|
1912
2048
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
@@ -1925,7 +2061,7 @@ function removeTopLevelYamlBlock(yaml, key) {
|
|
|
1925
2061
|
return next.join("\n");
|
|
1926
2062
|
}
|
|
1927
2063
|
function pnpmAllowBuildsYaml() {
|
|
1928
|
-
const lines = ["allowBuilds:"];
|
|
2064
|
+
const lines = ["allowBuilds:", " better-sqlite3: false"];
|
|
1929
2065
|
for (const dependency of PNPM_ALLOWED_BUILDS) lines.push(` ${dependency}: true`);
|
|
1930
2066
|
return lines.join("\n");
|
|
1931
2067
|
}
|
|
@@ -1961,7 +2097,7 @@ function ensurePnpmAllowBuilds(root, pkg) {
|
|
|
1961
2097
|
}
|
|
1962
2098
|
function installProjectDependencies(root, packageManager) {
|
|
1963
2099
|
log.step(`Installing dependencies with ${packageManager}`);
|
|
1964
|
-
const result = spawnSync(packageManager, ["install"], {
|
|
2100
|
+
const result = spawnSync(packageManager, packageManager === "pnpm" ? ["install", "--no-frozen-lockfile"] : ["install"], {
|
|
1965
2101
|
cwd: root,
|
|
1966
2102
|
stdio: "inherit",
|
|
1967
2103
|
shell: process.platform === "win32"
|
|
@@ -1971,8 +2107,8 @@ function installProjectDependencies(root, packageManager) {
|
|
|
1971
2107
|
log.success(`Installed dependencies with ${packageManager}`);
|
|
1972
2108
|
}
|
|
1973
2109
|
function generateStarterMigration(root, starterMode) {
|
|
1974
|
-
const dialect = starterMode
|
|
1975
|
-
const configPath = writeDrizzleConfig(root, dialect === "postgresql" ? "postgresql://dummy" : ":memory:", dialect);
|
|
2110
|
+
const dialect = starterMode;
|
|
2111
|
+
const configPath = writeDrizzleConfig(root, dialect === "postgresql" ? "postgresql://dummy" : dialect === "mysql" ? "mysql://dummy" : ":memory:", dialect);
|
|
1976
2112
|
const migrationsDir = readProjectPaths(root).migrationsDir;
|
|
1977
2113
|
const metaDir = join(migrationsDir, "meta");
|
|
1978
2114
|
const journalPath = join(metaDir, "_journal.json");
|
|
@@ -2076,13 +2212,19 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2076
2212
|
for (const [name, version] of Object.entries(template.dependencies)) ensureDependency("dependencies", name, version);
|
|
2077
2213
|
for (const [name, version] of Object.entries(template.devDependencies)) ensureDependency("devDependencies", name, version);
|
|
2078
2214
|
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2079
|
-
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@
|
|
2215
|
+
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@12.4.1";
|
|
2080
2216
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2081
2217
|
log.success("Updated package.json with starter scripts and dependencies");
|
|
2082
2218
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
2083
2219
|
ensureGitignore(root);
|
|
2084
2220
|
if (starterMode !== "static") applyDatabaseDialect(root, starterMode);
|
|
2085
|
-
if (starterMode === "postgresql")
|
|
2221
|
+
if (starterMode === "postgresql") {
|
|
2222
|
+
const devCommand = getDevCommand(root);
|
|
2223
|
+
note(`Add DATABASE_URL to .env before running \`${devCommand}\`.\nVoid uses that direct connection for local PostgreSQL development.`, "PostgreSQL local dev");
|
|
2224
|
+
} else if (starterMode === "mysql") {
|
|
2225
|
+
const devCommand = getDevCommand(root);
|
|
2226
|
+
note(`Add DATABASE_URL to .env before running \`${devCommand}\`.\nVoid uses that direct connection for local MySQL development.`, "MySQL local dev");
|
|
2227
|
+
}
|
|
2086
2228
|
return dependencyAdded;
|
|
2087
2229
|
}
|
|
2088
2230
|
function hasDeclaredDependency(pkg, name) {
|
|
@@ -2587,78 +2729,19 @@ function ensureVoidDependency(root) {
|
|
|
2587
2729
|
}
|
|
2588
2730
|
return changed || pnpmConfigChanged;
|
|
2589
2731
|
}
|
|
2590
|
-
function detectInstructionFilePath(root, agents) {
|
|
2591
|
-
if (agents.some((a) => a.skillsDir === ".claude/skills")) return "CLAUDE.md";
|
|
2592
|
-
if (existsSync(join(root, "CLAUDE.md"))) return "CLAUDE.md";
|
|
2593
|
-
if (existsSync(join(root, "AGENTS.md"))) return "AGENTS.md";
|
|
2594
|
-
return "AGENTS.md";
|
|
2595
|
-
}
|
|
2596
|
-
async function pickAgentWhenUndetected() {
|
|
2597
|
-
const choice = await select({
|
|
2598
|
-
message: "Could not detect your coding agent. Which one are you using?",
|
|
2599
|
-
options: [
|
|
2600
|
-
{
|
|
2601
|
-
value: "claude-code",
|
|
2602
|
-
label: "Claude Code"
|
|
2603
|
-
},
|
|
2604
|
-
{
|
|
2605
|
-
value: "cursor",
|
|
2606
|
-
label: "Cursor"
|
|
2607
|
-
},
|
|
2608
|
-
{
|
|
2609
|
-
value: "codex",
|
|
2610
|
-
label: "Codex"
|
|
2611
|
-
},
|
|
2612
|
-
{
|
|
2613
|
-
value: "gemini-cli",
|
|
2614
|
-
label: "Gemini CLI"
|
|
2615
|
-
},
|
|
2616
|
-
{
|
|
2617
|
-
value: "generic",
|
|
2618
|
-
label: "Generic"
|
|
2619
|
-
}
|
|
2620
|
-
]
|
|
2621
|
-
});
|
|
2622
|
-
if (isCancel(choice)) {
|
|
2623
|
-
cancel("Setup cancelled.");
|
|
2624
|
-
process.exit(0);
|
|
2625
|
-
}
|
|
2626
|
-
if (choice === "generic") return {
|
|
2627
|
-
instructionFilePath: "AGENTS.md",
|
|
2628
|
-
agents: []
|
|
2629
|
-
};
|
|
2630
|
-
const selected = getAgentById(choice);
|
|
2631
|
-
if (!selected) return {
|
|
2632
|
-
instructionFilePath: "AGENTS.md",
|
|
2633
|
-
agents: []
|
|
2634
|
-
};
|
|
2635
|
-
return {
|
|
2636
|
-
instructionFilePath: choice === "claude-code" ? "CLAUDE.md" : "AGENTS.md",
|
|
2637
|
-
agents: [selected]
|
|
2638
|
-
};
|
|
2639
|
-
}
|
|
2640
|
-
async function resolveAgentSetup(root) {
|
|
2641
|
-
const detected = detectAgents(root);
|
|
2642
|
-
if (detected.length > 0) return {
|
|
2643
|
-
instructionFilePath: detectInstructionFilePath(root, detected),
|
|
2644
|
-
agents: detected
|
|
2645
|
-
};
|
|
2646
|
-
return pickAgentWhenUndetected();
|
|
2647
|
-
}
|
|
2648
|
-
function readAgentPrompt() {
|
|
2649
|
-
return readFileSync(join(getPackageDir(), "AGENT_PROMPT.md"), "utf-8");
|
|
2650
|
-
}
|
|
2651
2732
|
function getOwnVersion() {
|
|
2652
2733
|
return JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2653
2734
|
}
|
|
2654
|
-
const
|
|
2735
|
+
const MARKER_VERSION_SOURCE = String.raw`\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?` + String.raw`(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?`;
|
|
2736
|
+
const MARKER_OPEN_RE = new RegExp(String.raw`^<!--injected-by-void-v(${MARKER_VERSION_SOURCE})-->\r?$`, "m");
|
|
2655
2737
|
const MARKER_CLOSE = "<!--/injected-by-void-->";
|
|
2656
|
-
const MARKER_BLOCK_RE =
|
|
2657
|
-
function injectAgentBlock(root
|
|
2738
|
+
const MARKER_BLOCK_RE = new RegExp(String.raw`^<!--injected-by-void-v${MARKER_VERSION_SOURCE}-->\r?\n[\s\S]*?^<!--\/injected-by-void-->\r?$`, "m");
|
|
2739
|
+
function injectAgentBlock(root) {
|
|
2740
|
+
const filePath = "AGENTS.md";
|
|
2658
2741
|
const fullPath = join(root, filePath);
|
|
2659
2742
|
const version = getOwnVersion();
|
|
2660
|
-
const
|
|
2661
|
-
const block = `${`<!--injected-by-void-v${version}-->`}\n${
|
|
2743
|
+
const template = readFileSync(join(getPackageDir(), "AGENTS_TEMPLATE.md"), "utf-8");
|
|
2744
|
+
const block = `${`<!--injected-by-void-v${version}-->`}\n${template}\n${MARKER_CLOSE}`;
|
|
2662
2745
|
if (existsSync(fullPath)) {
|
|
2663
2746
|
const existing = readFileSync(fullPath, "utf-8");
|
|
2664
2747
|
const match = existing.match(MARKER_OPEN_RE);
|
|
@@ -2667,10 +2750,12 @@ function injectAgentBlock(root, filePath) {
|
|
|
2667
2750
|
log.info(`${filePath} already has Void instructions (v${version})`);
|
|
2668
2751
|
return;
|
|
2669
2752
|
}
|
|
2670
|
-
|
|
2753
|
+
const updated = existing.replace(MARKER_BLOCK_RE, block);
|
|
2754
|
+
writeFileSync(fullPath, updated);
|
|
2671
2755
|
log.success(`Updated Void instructions in ${filePath} (v${match[1]} → v${version})`);
|
|
2672
2756
|
} else {
|
|
2673
|
-
|
|
2757
|
+
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
2758
|
+
writeFileSync(fullPath, existing + separator + block + "\n");
|
|
2674
2759
|
log.success(`Added Void instructions to ${filePath}`);
|
|
2675
2760
|
}
|
|
2676
2761
|
} else {
|
|
@@ -2678,63 +2763,14 @@ function injectAgentBlock(root, filePath) {
|
|
|
2678
2763
|
log.success(`Created ${filePath} with Void instructions`);
|
|
2679
2764
|
}
|
|
2680
2765
|
}
|
|
2681
|
-
function writeMcpConfigForTarget(root, target) {
|
|
2682
|
-
const fullPath = join(root, target.filePath);
|
|
2683
|
-
let existing = {};
|
|
2684
|
-
if (existsSync(fullPath)) try {
|
|
2685
|
-
existing = asRecord(JSON.parse(readFileSync(fullPath, "utf-8"))) ?? {};
|
|
2686
|
-
} catch {}
|
|
2687
|
-
const rootConfig = asRecord(existing[target.rootKey]) ?? {};
|
|
2688
|
-
existing[target.rootKey] = rootConfig;
|
|
2689
|
-
if (rootConfig["void"]) {
|
|
2690
|
-
log.info(`${target.filePath} already has void MCP config`);
|
|
2691
|
-
return;
|
|
2692
|
-
}
|
|
2693
|
-
rootConfig["void"] = {
|
|
2694
|
-
command: "npx",
|
|
2695
|
-
args: ["void", "mcp"],
|
|
2696
|
-
...target.extraFields
|
|
2697
|
-
};
|
|
2698
|
-
mkdirSync(dirname(fullPath), { recursive: true });
|
|
2699
|
-
writeFileSync(fullPath, JSON.stringify(existing, null, 2) + "\n");
|
|
2700
|
-
log.success(`Added void MCP server to ${target.filePath}`);
|
|
2701
|
-
}
|
|
2702
|
-
function pickMcpTarget(root, targets) {
|
|
2703
|
-
if (targets.length === 1) return targets[0];
|
|
2704
|
-
const existingTargets = targets.filter((t) => existsSync(join(root, t.filePath)));
|
|
2705
|
-
if (existingTargets.length > 0) return existingTargets[0];
|
|
2706
|
-
return targets[0];
|
|
2707
|
-
}
|
|
2708
|
-
function setupMcpConfig(root, selectedAgents) {
|
|
2709
|
-
const mcpAgents = [];
|
|
2710
|
-
const hintAgents = [];
|
|
2711
|
-
for (const agent of selectedAgents) if (agent.mcpConfig) mcpAgents.push({
|
|
2712
|
-
agent,
|
|
2713
|
-
targets: agent.mcpConfig
|
|
2714
|
-
});
|
|
2715
|
-
else if (agent.mcpHint) hintAgents.push({
|
|
2716
|
-
agent,
|
|
2717
|
-
hint: agent.mcpHint
|
|
2718
|
-
});
|
|
2719
|
-
if (selectedAgents.length === 0) {
|
|
2720
|
-
note(JSON.stringify({ void: {
|
|
2721
|
-
command: "npx",
|
|
2722
|
-
args: ["void", "mcp"]
|
|
2723
|
-
} }, null, 2), "Add this MCP server config to your agent");
|
|
2724
|
-
return;
|
|
2725
|
-
}
|
|
2726
|
-
for (const { agent, hint } of hintAgents) log.info(`${agent.displayName}: ${hint}`);
|
|
2727
|
-
for (const { agent, targets } of mcpAgents) {
|
|
2728
|
-
const target = pickMcpTarget(root, targets);
|
|
2729
|
-
log.info(`${agent.displayName} MCP target: ${target.filePath}`);
|
|
2730
|
-
writeMcpConfigForTarget(root, target);
|
|
2731
|
-
}
|
|
2732
|
-
}
|
|
2733
2766
|
async function runInitCommand(root, initArgs) {
|
|
2734
2767
|
console.log();
|
|
2735
2768
|
intro(cliTitle("init"));
|
|
2736
2769
|
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github || initArgs.agents));
|
|
2737
2770
|
if (!targeted) root = await resolveInitRoot(root);
|
|
2771
|
+
const workspaceSubpackage = isInsideWorkspaceSubpackage(root);
|
|
2772
|
+
if (workspaceSubpackage && initArgs?.git !== void 0) throw new Error("init: The --git/--no-git options are not available when adding a package to an existing monorepo.");
|
|
2773
|
+
const gitInitialized = !workspaceSubpackage && (!targeted || initArgs?.git !== void 0) ? await setupGit(root, initArgs?.git) : false;
|
|
2738
2774
|
const framework = detectFramework(root);
|
|
2739
2775
|
const preScaffoldState = detectProjectState(root);
|
|
2740
2776
|
const detectedPagesFramework = detectPagesFramework(root);
|
|
@@ -2792,61 +2828,83 @@ async function runInitCommand(root, initArgs) {
|
|
|
2792
2828
|
if (!targeted) ensureVoidWorkerCompatibilityDate(root);
|
|
2793
2829
|
if (!targeted && !didScaffoldStarter) applyDatabaseSetup(root, await promptDatabaseSetup(root));
|
|
2794
2830
|
if (!targeted || initArgs?.agents) {
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
if (
|
|
2798
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2799
|
-
linkSkillsForSpecificAgents(root,
|
|
2800
|
-
} else log.info("
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2831
|
+
injectAgentBlock(root);
|
|
2832
|
+
const agents = detectAgents(root);
|
|
2833
|
+
if (agents.length > 0) {
|
|
2834
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-Q46GZMO-.mjs");
|
|
2835
|
+
linkSkillsForSpecificAgents(root, agents);
|
|
2836
|
+
} else log.info("No coding agent detected; read the bundled docs linked in AGENTS.md");
|
|
2837
|
+
}
|
|
2838
|
+
if (!targeted && !framework) {
|
|
2839
|
+
if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2840
|
+
else if (!state.typescriptWanted) {} else {
|
|
2841
|
+
const scaffold = await confirm({ message: "Scaffold demo code? (migration + API route + frontend fetch)" });
|
|
2842
|
+
if (isCancel(scaffold)) {
|
|
2843
|
+
cancel("Setup cancelled.");
|
|
2844
|
+
process.exit(0);
|
|
2845
|
+
}
|
|
2846
|
+
if (scaffold) {
|
|
2847
|
+
const { packageJsonMutated } = scaffoldDemo(root);
|
|
2848
|
+
const voidResolvable = isVoidResolvableFrom(root);
|
|
2849
|
+
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2850
|
+
if (deferral && (!voidResolvable || packageJsonMutated)) {
|
|
2851
|
+
workspaceSubpackageSkip = true;
|
|
2852
|
+
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2853
|
+
const headline = voidResolvable ? `\`void\` is already hoisted at an ancestor node_modules, but \`./${relRoot}/package.json\` was updated.\nRun your workspace install from ${deferral.workspaceRoot} to sync the lockfile,` : `Run your workspace install from ${deferral.workspaceRoot} to pick up the new \`void\` dep,`;
|
|
2854
|
+
note(`Scaffolded the starter demo in ./${relRoot}.\n\n${headline}\nthen run \`void db generate\` from ./${relRoot} to create the initial migration.`, "Workspace subpackage");
|
|
2855
|
+
} else if (!voidResolvable || packageJsonMutated) scaffoldAddedDependencies = true;
|
|
2856
|
+
scaffoldedStarterMode = "sqlite";
|
|
2857
|
+
}
|
|
2820
2858
|
}
|
|
2821
2859
|
}
|
|
2860
|
+
const deploymentPlatform = !targeted ? await promptDeploymentPlatform(root) : readDeploymentPlatform(root);
|
|
2861
|
+
let voidPlatformDiscovery = null;
|
|
2862
|
+
if (!targeted && deploymentPlatform === "cloudflare") await setupCloudflareDeployment(root);
|
|
2863
|
+
if (!targeted && deploymentPlatform === "void") voidPlatformDiscovery = await ensureVoidPlatformConnection(root);
|
|
2822
2864
|
const githubStepSkipForSubpackage = isInsideWorkspaceSubpackage(root);
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2865
|
+
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2866
|
+
if (shouldSetupGithub && !githubStepSkipForSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2867
|
+
if (!voidPlatformDiscovery) {
|
|
2868
|
+
const { getApiUrl } = await import("./auth-W9WII-mN.mjs").then((n) => n.t);
|
|
2869
|
+
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2870
|
+
}
|
|
2871
|
+
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
2872
|
+
const message = `${voidPlatformDiscovery.displayName} does not support GitHub Actions deployments.`;
|
|
2873
|
+
if (targeted) throw new Error(`init: ${message}`);
|
|
2874
|
+
log.info(`${message} Skipping workflow setup.`);
|
|
2875
|
+
shouldSetupGithub = false;
|
|
2829
2876
|
}
|
|
2830
|
-
if (setupGha) setupGithubActions(root, state);
|
|
2831
2877
|
}
|
|
2832
|
-
|
|
2878
|
+
if (shouldSetupGithub && !githubStepSkipForSubpackage) {
|
|
2879
|
+
if (targeted) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2880
|
+
else {
|
|
2881
|
+
const setupGha = await confirm({ message: "Create .github/workflows/void-deploy.yml to deploy on pushes to main?" });
|
|
2882
|
+
if (isCancel(setupGha)) {
|
|
2883
|
+
cancel("Setup cancelled.");
|
|
2884
|
+
process.exit(0);
|
|
2885
|
+
}
|
|
2886
|
+
if (setupGha) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2887
|
+
}
|
|
2888
|
+
} else if (githubStepSkipForSubpackage && shouldSetupGithub) log.info("Skipping GitHub Actions setup: workflow files must live at the repo root, not in a workspace subpackage.");
|
|
2833
2889
|
if (!targeted) {
|
|
2834
2890
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2835
2891
|
if (scaffoldResult.written) {
|
|
2836
2892
|
const rel = relative(root, scaffoldResult.written) || "env.ts";
|
|
2837
|
-
if (scaffoldResult.entries.length > 0) log.success(`Scaffolded ${rel} from
|
|
2893
|
+
if (scaffoldResult.entries.length > 0) log.success(`Scaffolded ${rel} from .env — review inferred types before running dev.`);
|
|
2838
2894
|
else log.success(`Created empty ${rel} — add your env keys with \`defineEnv({...})\`.`);
|
|
2839
2895
|
}
|
|
2840
2896
|
}
|
|
2841
2897
|
if (scaffoldAddedDependencies) installProjectDependencies(root, state.packageManager);
|
|
2842
2898
|
if (scaffoldedStarterMode && !workspaceSubpackageSkip) generateStarterMigration(root, scaffoldedStarterMode);
|
|
2843
|
-
if (!targeted) {
|
|
2899
|
+
if (!targeted && deploymentPlatform === "void") {
|
|
2844
2900
|
const linked = await maybeSetupDeployProject(root);
|
|
2845
2901
|
if (linked?.slug) patchWorkflowProjectSlug(root, linked.slug);
|
|
2846
2902
|
}
|
|
2847
|
-
if (
|
|
2848
|
-
|
|
2849
|
-
|
|
2903
|
+
if (gitInitialized) log.info(`Git (optional): ${initialCommitCommand(root)}`);
|
|
2904
|
+
if (workspaceSubpackageSkip) {
|
|
2905
|
+
if (scaffoldedStarterMode) outro("Run your workspace install, then `void db generate` to finish setup.");
|
|
2906
|
+
else outro("Run your workspace install to finish setup.");
|
|
2907
|
+
} else outro(`Run \`${getDevCommand(root, framework)}\` to start developing`);
|
|
2850
2908
|
}
|
|
2851
2909
|
//#endregion
|
|
2852
2910
|
export { parseInitArgs, runInitCommand };
|