void 0.25.0 → 0.26.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 +1 -3
- package/README.md +19 -9
- package/dist/{account-cmd-DcR1ywt8.mjs → account-cmd-CfUXh_nU.mjs} +8 -7
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DKy02UY0.mjs} +21 -32
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-DQyUh_5S.mjs} +1 -1
- package/dist/{auth-7wuZ5ob8.mjs → auth-B5_tZLxT.mjs} +9 -9
- package/dist/{auth-CdgZ9uag.mjs → auth-BgX2qYSY.mjs} +1 -1
- package/dist/{auth-link-Z6E5DYvM.mjs → auth-link-D5RmKnzh.mjs} +5 -5
- package/dist/{auth-migrations-9vif1uj8.mjs → auth-migrations-BwHgeEsD.mjs} +8 -18
- package/dist/{auth-router-BdM4avI8.mjs → auth-router-Bap-pvbn.mjs} +6 -19
- package/dist/{better-auth-shared-BVkjZ3vM.d.mts → better-auth-shared-CPvWD3nG.d.mts} +0 -4
- package/dist/{better-auth-shared-hy6RPh9W.mjs → better-auth-shared-DPpj8zxc.mjs} +94 -16
- package/dist/{build-cmd-CEE7D-hM.mjs → build-cmd-B58c8iS8.mjs} +8 -7
- package/dist/{cache-TcZnBLtH.mjs → cache-Bo52trKF.mjs} +8 -8
- package/dist/{cancel-deploy-CYoZmcmR.mjs → cancel-deploy-BZNz3Q26.mjs} +6 -5
- package/dist/{cf-access-AHKBzmuu.mjs → cf-access-ngGqZpHZ.mjs} +11 -12
- package/dist/{cf-build-output-U8o1Gl6X.mjs → cf-build-output-DjvB_872.mjs} +62 -85
- package/dist/cf-build-output-H9a97vME.mjs +2 -0
- package/dist/cli/cli.mjs +48 -83
- package/dist/cli/cloudflare-operation-process.mjs +71 -77
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +5 -6
- package/dist/client-By4JjMw_.mjs +2 -0
- package/dist/{client-RsPo8wsP.mjs → client-C2Prx_Bi.mjs} +30 -8
- package/dist/{cloudflare-auth-Qdc7tw8F.mjs → cloudflare-auth-CuxfF6OA.mjs} +9 -17
- package/dist/{cloudflare-cmd-bhwCxAN6.mjs → cloudflare-cmd-lHqNlJGW.mjs} +6 -5
- package/dist/{cloudflare-config-Bktvwtpf.mjs → cloudflare-config-BmhBv3HV.mjs} +1 -1
- package/dist/{cloudflare-connect-CuhRgk3k.mjs → cloudflare-connect-2G3rL2rP.mjs} +4 -4
- package/dist/{cloudflare-operations-BhbK6yTq.mjs → cloudflare-operations-BlYLlowZ.mjs} +1 -1
- package/dist/{cloudflare-operations-CjaV4lZi.mjs → cloudflare-operations-CwI1bChl.mjs} +41 -70
- package/dist/{cloudflare-process-B-wekeR6.mjs → cloudflare-process-2-TfIEzB.mjs} +20 -22
- package/dist/{config-CyQ-wVd7.mjs → config-5r-YpMC-.mjs} +1 -1
- package/dist/{config-C_XRIPx2.mjs → config-B_ggY-IO.mjs} +3 -3
- package/dist/config-BtSFvXZx.mjs +2 -0
- package/dist/config-CLYAosnQ.mjs +78 -0
- package/dist/{config-BMHb8RCj.d.mts → config-CSa15FvD.d.mts} +1 -1
- package/dist/{config-Br_JZD6u.mjs → config-DiowPT80.mjs} +24 -30
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-write-B1f88wJA.mjs → config-write-AHGesphx.mjs} +8 -7
- package/dist/{connect-DCvUmPXY.mjs → connect-X0MUA1gk.mjs} +12 -11
- package/dist/{create-project-eAPgYq35.mjs → create-project-DxiyW6iX.mjs} +7 -7
- package/dist/{create-project-C734I-Mu.mjs → create-project-iwkbqiBU.mjs} +1 -1
- package/dist/{db-C07GEdKF.mjs → db-XnVMHzoV.mjs} +101 -133
- package/dist/{delete-pKMVsrpJ.mjs → delete-esYlMiSJ.mjs} +8 -8
- package/dist/{deploy-DfsAe-T0.mjs → deploy-BsEvnlJl.mjs} +2377 -2512
- package/dist/deploy-C1d-YTfp.mjs +2 -0
- package/dist/{dev-inbox-D64ZKUod.mjs → dev-inbox-CK-UuPob.mjs} +7 -16
- package/dist/{discover-BcPPiF1o.mjs → discover-CkCYv9T_.mjs} +1 -2
- package/dist/discover-EDUf6JJw.mjs +2 -0
- package/dist/{prompts-ZAuJlyCj.mjs → dist-Bx1z6Eva.mjs} +1 -1
- package/dist/{dist-AoCzRTJE.mjs → dist-Cegxq8gs.mjs} +8 -8
- package/dist/{prompts-6OSVA7DJ.mjs → dist-D3m88sjf.mjs} +10 -53
- package/dist/{domain-D3uA9ize.mjs → domain-CbbBWhWE.mjs} +29 -30
- package/dist/{dotenv-VQxupEUv.mjs → dotenv-BfU6eqFt.mjs} +20 -32
- package/dist/{drizzle-Beb2Am5S.mjs → drizzle-CF84FOVM.mjs} +16 -13
- package/dist/{email-z3o2cwjH.mjs → email-CpuT42g7.mjs} +24 -19
- package/dist/{email--tEtMoj_.mjs → email-d_Aux1vM.mjs} +1 -1
- package/dist/{entry-CF5wvH4w.mjs → entry-CMAkqBmU.mjs} +6 -6
- package/dist/{env-_v349JBd.mjs → env-BxocywBB.mjs} +25 -6
- package/dist/{env-D5liuQYR.mjs → env-DMA3cXZt.mjs} +1 -1
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{env-raw-Cx8ElDdj.mjs → env-raw-jZpP5n47.mjs} +1 -2
- package/dist/{env-types-D5kds_OZ.mjs → env-types-CwXgeMgL.mjs} +1 -1
- package/dist/{env-validation-cZBvGWaP.mjs → env-validation-CrVNjsPm.mjs} +1 -1
- package/dist/{env-validation-vBSQ8gw5.mjs → env-validation-Dxdx_5wo.mjs} +17 -21
- package/dist/{env-3Q8-_2IH.mjs → env-w9jOyGZn.mjs} +10 -9
- package/dist/{fetch-_SeGZao9.d.mts → fetch-BPCYVi3H.d.mts} +20 -1
- package/dist/{fetch-BIZJh7vR.mjs → fetch-sAcwjzLO.mjs} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-PGgz4uGz.mjs} +26 -24
- package/dist/{fetch-stream-Bjf0hoZb.d.mts → fetch-stream-obvZ7fvO.d.mts} +1 -16
- package/dist/{gen-NjwoG9FK.mjs → gen-DtkQhvQg.mjs} +40 -57
- package/dist/gen-dA9hW7AV.mjs +2 -0
- package/dist/{github-cmd-DquUq-b1.mjs → github-cmd-D_FsOFxq.mjs} +65 -164
- package/dist/{handler-DghKr6dU.mjs → handler-BHAn2fZJ.mjs} +1 -0
- package/dist/{handler-CZ4nAylQ.d.mts → handler-CNAwjRcW.d.mts} +5 -12
- package/dist/{head-Do8P4puT.d.mts → head-C8K_iGe6.d.mts} +1 -1
- package/dist/{head-D_QRR5Yd.mjs → head-D2VF4ApL.mjs} +29 -51
- package/dist/{headers-2rKda9Y6.mjs → headers-DlfR78Nu.mjs} +3 -3
- package/dist/{help-DRZXC4fj.mjs → help-CVFBTmBx.mjs} +23 -38
- package/dist/help-DzKUrQvk.mjs +2 -0
- package/dist/{inbound-fRkqcXaC.mjs → inbound-PfQDLXc5.mjs} +23 -24
- package/dist/index.d.mts +19 -2
- package/dist/index.mjs +632 -532
- package/dist/{info-BmA3_IFZ.mjs → info-PYWwkWyt.mjs} +4 -4
- package/dist/{init-DT7yuuyl.mjs → init-Bw-fRKGp.mjs} +161 -197
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-CXOlqh2F.mjs → link-DlPG8iX3.mjs} +10 -10
- package/dist/{list-eEWVJEPn.mjs → list-2GN7_ueV.mjs} +11 -9
- package/dist/{live-CB1y5IuC.mjs → live-CgQuTpqD.mjs} +15 -16
- package/dist/{live-Chw1eIMv.d.mts → live-Du8jXwOW.d.mts} +4 -2
- package/dist/{local-d1-Df4XpwhW.mjs → local-d1-ga5O_idV.mjs} +2 -2
- package/dist/{login-pWQHYVu2.mjs → login-D-Q4xw3Q.mjs} +7 -7
- package/dist/login-Dc-wuTDq.mjs +2 -0
- package/dist/{logs-DnxVX7TR.mjs → logs-rd8J-OFh.mjs} +28 -11
- package/dist/migrate-BHp07yJE.mjs +2 -0
- package/dist/{migrate-CV1on-yJ.mjs → migrate-NLsjBbuM.mjs} +34 -20
- package/dist/{mime-D5Nmdzf7.mjs → mime-DxCznlJq.mjs} +45 -95
- package/dist/{node-BkyRWRx8.mjs → node-DJicPvPj.mjs} +5 -5
- package/dist/{operator-args-CAVcmwUt.mjs → operator-args-BNsW5gfp.mjs} +10 -1
- package/dist/{operator-auth-CkmTE3rt.mjs → operator-auth-AzVLbrr3.mjs} +4 -8
- package/dist/{operator-client-LmwjxT6q.mjs → operator-client-BQtzyG-g.mjs} +3 -3
- package/dist/{operator-cmd-d-IEKgNk.mjs → operator-cmd-B6f6Cg9Z.mjs} +45 -14
- package/dist/operator-cmd-Cwn50lOV.mjs +2 -0
- package/dist/{output-BBsUwdyT.mjs → output-C50ag2r3.mjs} +44 -2
- package/dist/pages/client.d.mts +19 -51
- package/dist/pages/client.mjs +204 -225
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +6 -12
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +21 -25
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-BhLO2p4w.mjs} +4 -3
- package/dist/plan-CH2G51je.mjs +2 -0
- package/dist/{platform-args-Bzf8JPc2.mjs → platform-args-BoZkWQnJ.mjs} +4 -2
- package/dist/platform-args-DYgITk0D.mjs +2 -0
- package/dist/{platform-auth-config-0V0lA3pF.mjs → platform-auth-config-n603OANg.mjs} +45 -40
- package/dist/{platform-auth-protection-DFeJ-JkK.mjs → platform-auth-protection-zxDr0hWW.mjs} +9 -8
- package/dist/{platform-auth-recovery-ICy4muq6.mjs → platform-auth-recovery-tw9lgtgE.mjs} +8 -7
- package/dist/{platform-cmd-D7vSWMvV.mjs → platform-cmd-B8-bCb7t.mjs} +48 -23
- package/dist/{platform-cmd-BPySFOew.mjs → platform-cmd-C00YM14r.mjs} +1 -1
- package/dist/{platform-discovery-DDDUvnqp.mjs → platform-discovery-BC0HCKYt.mjs} +18 -4
- package/dist/{platform-domain-CUdY064e.mjs → platform-domain-p0kobLV8.mjs} +6 -5
- package/dist/{platform-lifecycle-Dm09JNkn.mjs → platform-lifecycle-D_QEY32D.mjs} +906 -389
- package/dist/{platform-lifecycle-BaUdTRPU.mjs → platform-lifecycle-vFqtNPPa.mjs} +1 -1
- package/dist/{platform-management-BSEc_ZeG.mjs → platform-management-BdYblvvE.mjs} +175 -32
- package/dist/{platform-management-Bp6aoH2C.mjs → platform-management-oi-SvI3f.mjs} +1 -1
- package/dist/{platform-plans-config-B0pOVQyW.mjs → platform-plans-config-CjiFv5J4.mjs} +5 -4
- package/dist/{platform-recovery-WOZ95Uze.mjs → platform-recovery-PvNS9Nl2.mjs} +3 -3
- package/dist/{platform-registry-KfNEF84O.mjs → platform-registry-P387v42A.mjs} +17 -10
- package/dist/platform-setup-DVe42Ws7.mjs +299 -0
- package/dist/{plugin-inference-CXWnn79A.mjs → plugin-inference-BlQbOL0P.mjs} +43 -42
- package/dist/prepare-DRUV-g3X.mjs +2 -0
- package/dist/{prepare-DnaKBi--.mjs → prepare-Do96654b.mjs} +8 -8
- package/dist/{prepare-39EvOhI6.mjs → prepare-Dq9hTIbo.mjs} +4 -3
- package/dist/{prerender-render-D9qbLs2f.mjs → prerender-render-Ct20jftc.mjs} +17 -3
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-IOjBU8R6.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-BkbfDs0V.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-Bs5A392E.mjs → project-cmd-ti8_yTcA.mjs} +19 -19
- package/dist/{project-team-ohAWWaew.mjs → project-team-CDPE1Tsg.mjs} +15 -18
- package/dist/{project-token-CP01Jna6.mjs → project-token-CkZ1cN0Z.mjs} +14 -17
- package/dist/{project-tsconfig-B8GeM0RM.mjs → project-tsconfig-CVJhNMxs.mjs} +2 -1
- package/dist/{project-zero-trust-BzkVgx35.mjs → project-zero-trust-DdjLR61k.mjs} +12 -9
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BPZaNqBo.d.mts} +4 -2
- package/dist/{protocol-U7bfjHmA.mjs → protocol-CfaUwNs8.mjs} +46 -49
- package/dist/{providers-CJlNS3kT.mjs → providers-BXuhmuub.mjs} +1 -12
- package/dist/{provision-Btj1jppf.mjs → provision-BfaLiWbj.mjs} +51 -42
- package/dist/{provision-BEv0k-qz.mjs → provision-Wu9ZBk9L.mjs} +2 -3
- package/dist/{requests-B3PBuGlX.mjs → requests-DFAqyYy8.mjs} +5 -5
- package/dist/resolve-project-BIeYs9Cw.mjs +2 -0
- package/dist/{resolve-project-BG5ORGID.mjs → resolve-project-CP8rZs_p.mjs} +6 -1
- package/dist/{rollback-DDub9GsO.mjs → rollback-BKYXBduI.mjs} +30 -37
- package/dist/{route-types-Clm4WD0B.mjs → route-types-CbtsIeFn.mjs} +1 -1
- package/dist/route-url-BgPja1GS.d.mts +5 -0
- package/dist/route-url-BjGv_KKY.mjs +28 -0
- package/dist/runner-9wjsSZx-.mjs +2 -0
- package/dist/{runner-Ol0TNjk6.mjs → runner-DMBKSrRk.mjs} +2 -2
- package/dist/{runner-mysql-DmWchSWJ.mjs → runner-mysql-CEzKtmFb.mjs} +8 -8
- package/dist/{runner-mysql-CEG5JozK.mjs → runner-mysql-CkFqZ6CE.mjs} +1 -1
- package/dist/{runner-pg-Bh4AgZdj.mjs → runner-pg-BGYRFdRp.mjs} +1 -1
- package/dist/runtime/ai.d.mts +11 -12
- package/dist/runtime/ai.mjs +47 -113
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +4 -9
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +5 -10
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +3 -3
- package/dist/runtime/client-react.d.mts +2 -3
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.d.mts +2 -3
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.d.mts +2 -3
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.d.mts +2 -3
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.d.mts +2 -3
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.mjs +3 -10
- package/dist/runtime/email/testing.mjs +5 -5
- package/dist/runtime/email.d.mts +2 -1
- package/dist/runtime/email.mjs +11 -27
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +15 -20
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +2 -3
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +2 -2
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +10 -11
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-client.mjs +12 -22
- package/dist/runtime/live-server.mjs +27 -35
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +2 -2
- package/dist/runtime/migration-handler.mjs +35 -86
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/binding-handler.d.mts +2 -2
- package/dist/runtime/remote/binding-handler.mjs +8 -9
- package/dist/runtime/remote/index.mjs +27 -77
- package/dist/runtime/route-url.d.mts +2 -4
- package/dist/runtime/route-url.mjs +1 -1
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/routing.mjs +15 -26
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +14 -24
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +30 -61
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C3uDzz6J.mjs} +21 -18
- package/dist/{secret-3c72lY1U.mjs → secret-BAt2KMmO.mjs} +15 -15
- package/dist/{skills-BPQUGClu.mjs → skills-BgVMvQdy.mjs} +2 -2
- package/dist/{sse-CQNaDFFV.mjs → sse-CMvCgjNk.mjs} +1 -1
- package/dist/{subcommand-prompt-Dhom39bd.mjs → subcommand-prompt-BSlnD1fI.mjs} +2 -2
- package/dist/sveltekit.d.mts +0 -2
- package/dist/terminal-log-text-D9ACPOuG.mjs +32 -0
- package/dist/validate-BJr9LfXy.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-C9qJArv7.mjs} +9 -28
- package/dist/{defer-YsYDUoii.mjs → validation-error-Dg9Recn1.mjs} +11 -11
- package/dist/{wrangler-DhUerFkW.mjs → wrangler-D9KTuqnv.mjs} +89 -194
- package/dist/{ws-CL1w7GXU.d.mts → ws-CChrrAU-.d.mts} +1 -1
- package/dist/{yarn-pnp-BV4AzNul.mjs → yarn-pnp-CUX_iTPA.mjs} +19 -27
- package/{skills/void/docs → docs}/guide/ai.md +69 -64
- package/{skills/void/docs → docs}/guide/app-types.md +1 -1
- package/{skills/void/docs → docs}/guide/auth.md +37 -1
- package/{skills/void/docs → docs}/guide/database/postgresql.md +2 -2
- package/{skills/void/docs → docs}/guide/database.md +23 -8
- package/{skills/void/docs → docs}/guide/edge/revalidation.md +1 -1
- package/{skills/void/docs → docs}/guide/edge/rewrites.md +2 -4
- package/{skills/void/docs → docs}/guide/email/receiving.md +2 -2
- package/{skills/void/docs → docs}/guide/email/sending.md +0 -2
- package/{skills/void/docs → docs}/guide/env-vars.md +4 -0
- package/{skills/void/docs → docs}/guide/jobs.md +2 -2
- package/{skills/void/docs → docs}/guide/live.md +12 -5
- package/{skills/void/docs → docs}/guide/pages-routing/actions-and-forms.md +21 -9
- package/{skills/void/docs → docs}/guide/pages-routing/loaders.md +7 -3
- package/{skills/void/docs → docs}/guide/pages-routing/markdown.md +15 -23
- package/{skills/void/docs → docs}/guide/pages-routing/overview.md +6 -4
- package/{skills/void/docs → docs}/guide/platform/administration/access.md +2 -10
- package/{skills/void/docs → docs}/guide/platform/administration/operations.md +3 -12
- package/{skills/void/docs → docs}/guide/platform/administration/projects.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/development/local.md +4 -2
- package/{skills/void/docs → docs}/guide/platform/development/runtime.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/development/schema-ci.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/installation/credentials.md +2 -2
- package/{skills/void/docs → docs}/guide/platform/installation/domains.md +3 -1
- package/{skills/void/docs → docs}/guide/platform/installation/first-deployment.md +8 -2
- package/{skills/void/docs → docs}/guide/platform/installation/maintenance.md +7 -1
- package/{skills/void/docs → docs}/guide/platform/installation/setup.md +1 -1
- package/docs/guide/platform/installation/uninstall.md +102 -0
- package/{skills/void/docs → docs}/guide/project-collaboration.md +6 -2
- package/{skills/void/docs → docs}/guide/queues.md +0 -2
- package/{skills/void/docs → docs}/guide/remote-dev.md +5 -5
- package/{skills/void/docs → docs}/guide/sandboxes.md +41 -22
- package/{skills/void/docs → docs}/guide/sse.md +0 -2
- package/{skills/void/docs → docs}/guide/storage.md +7 -2
- package/{skills/void/docs → docs}/guide/websockets.md +4 -0
- package/docs/integrations/agents.md +37 -0
- package/{skills/void/docs → docs}/integrations/frameworks/astro.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/nuxt.md +6 -2
- package/{skills/void/docs → docs}/integrations/hono.md +15 -7
- package/{skills/void/docs → docs}/integrations/nodejs-bun-deno.md +1 -0
- package/{skills/void/docs → docs}/reference/api/auth.md +1 -1
- package/{skills/void/docs → docs}/reference/api/handlers.md +4 -2
- package/{skills/void/docs → docs}/reference/api/pages.md +4 -0
- package/{skills/void/docs → docs}/reference/api/resources.md +11 -14
- package/{skills/void/docs → docs}/reference/api.md +35 -34
- package/{skills/void/docs → docs}/reference/cli/auth.md +3 -6
- package/{skills/void/docs → docs}/reference/cli/database.md +3 -4
- package/{skills/void/docs → docs}/reference/cli/generate.md +1 -1
- package/{skills/void/docs → docs}/reference/cli/github.md +3 -12
- package/{skills/void/docs → docs}/reference/cli/platform-config.md +3 -3
- package/{skills/void/docs → docs}/reference/cli/platform-email.md +2 -3
- package/{skills/void/docs → docs}/reference/cli/platform-installation.md +15 -13
- package/{skills/void/docs → docs}/reference/cli/platform-operations.md +3 -0
- package/{skills/void/docs → docs}/reference/cli/platform-users.md +2 -2
- package/{skills/void/docs → docs}/reference/cli/platform.md +4 -2
- package/{skills/void/docs → docs}/reference/cli/project.md +5 -4
- package/{skills/void/docs → docs}/reference/cli/secrets.md +3 -3
- package/{skills/void/docs → docs}/reference/cli/setup.md +9 -11
- package/{skills/void/docs → docs}/reference/cli.md +2 -2
- package/{skills/void/docs → docs}/reference/config.md +13 -13
- package/{skills/void/docs → docs}/reference/resource-inference.md +2 -16
- package/package.json +34 -30
- package/schema.json +1 -1
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +4 -1
- package/skills/void/SKILL.md +11 -5
- package/dist/cf-build-output-ChY6-XWP.mjs +0 -2
- package/dist/client-B4Me-9HE.mjs +0 -2
- package/dist/config-0acf1oys.mjs +0 -2
- package/dist/config-D8MOgiQV.mjs +0 -32
- package/dist/deploy-BDu1vhSH.mjs +0 -2
- package/dist/discover-AMCBXivQ.mjs +0 -2
- package/dist/fetch-error-Sp1R4mZv.d.mts +0 -20
- package/dist/gen-ById9r2j.mjs +0 -2
- package/dist/help-DPGBwomV.mjs +0 -2
- package/dist/login-C98-sw79.mjs +0 -2
- package/dist/migrate-CEu2X5DB.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-Cq6EjQro.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/resolve-project-DtbidV4y.mjs +0 -2
- package/dist/route-url-CG7U-cRN.mjs +0 -15
- package/dist/runner-CXA9Fh8h.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
- package/skills/void/docs/guide/platform/installation/uninstall.md +0 -69
- package/skills/void/docs/integrations/agents.md +0 -26
- package/dist/{runner-pg-D4OPlil-.mjs → runner-pg-DV8p_zjA.mjs} +4 -4
- package/{skills/void/docs → docs}/guide/database/d1.md +2 -2
- package/{skills/void/docs → docs}/guide/database/mysql.md +0 -0
- package/{skills/void/docs → docs}/guide/deployment.md +0 -0
- package/{skills/void/docs → docs}/guide/durable-state.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/headers.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/prerendering.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/redirects.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/static-assets.md +0 -0
- package/{skills/void/docs → docs}/guide/email/domains.md +0 -0
- package/{skills/void/docs → docs}/guide/email.md +0 -0
- package/{skills/void/docs → docs}/guide/index.md +0 -0
- package/{skills/void/docs → docs}/guide/kv.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/head.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/islands.md +2 -2
- package/{skills/void/docs → docs}/guide/pages-routing/layouts.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/view-transitions.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/email.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/plans.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/zero-trust.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/ci.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/prerequisites.md +0 -0
- package/{skills/void/docs → docs}/guide/platform-administration.md +0 -0
- package/{skills/void/docs → docs}/guide/platform-development.md +0 -0
- package/{skills/void/docs → docs}/guide/quickstart.md +0 -0
- package/{skills/void/docs → docs}/guide/self-hosted-platform.md +0 -0
- package/{skills/void/docs → docs}/guide/server-routing.md +3 -3
- package/{skills/void/docs → docs}/guide/ssg.md +0 -0
- package/{skills/void/docs → docs}/guide/ssr.md +0 -0
- package/{skills/void/docs → docs}/guide/type-safety.md +0 -0
- package/{skills/void/docs → docs}/guide/typed-fetch.md +0 -0
- package/{skills/void/docs → docs}/index.md +0 -0
- package/{skills/void/docs → docs}/integrations/cloudflare.md +0 -0
- package/{skills/void/docs → docs}/integrations/frameworks/analog.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/overview.md +0 -0
- package/{skills/void/docs → docs}/integrations/frameworks/react-router.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/sveltekit.md +1 -1
- package/{skills/void/docs → docs}/integrations/frameworks/tanstack-start.md +2 -2
- package/{skills/void/docs → docs}/reference/api/client.md +0 -0
- package/{skills/void/docs → docs}/reference/api/database.md +2 -2
- /package/{skills/void/docs → docs}/reference/api/durable.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/env.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/plugin.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/rewrites.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/types.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/deploy.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/domains.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/email.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/platform-zero-trust.md +0 -0
- /package/{skills/void/docs → docs}/reference/structure.md +0 -0
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, l as relative, n as dirname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
2
|
+
import { r as detectFramework } from "./plugin-inference-BlQbOL0P.mjs";
|
|
3
3
|
import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-GgcMozYz.mjs";
|
|
4
|
-
import { m as readConfig, u as getDatabaseDialect } from "./config-
|
|
5
|
-
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-
|
|
6
|
-
import { r as materializeCloudflareConfig } from "./cloudflare-config-
|
|
7
|
-
import {
|
|
8
|
-
import { c as getToken } from "./auth-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
4
|
+
import { m as readConfig, u as getDatabaseDialect } from "./config-DiowPT80.mjs";
|
|
5
|
+
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-DQstYTxO.mjs";
|
|
6
|
+
import { r as materializeCloudflareConfig } from "./cloudflare-config-BmhBv3HV.mjs";
|
|
7
|
+
import { i as LATEST_KNOWN_COMPAT_DATE, j as writeProvisionedWranglerConfig } from "./wrangler-D9KTuqnv.mjs";
|
|
8
|
+
import { c as getToken } from "./auth-B5_tZLxT.mjs";
|
|
9
|
+
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
10
|
+
import { d as printSuccess, u as note } from "./output-C50ag2r3.mjs";
|
|
11
|
+
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-CVJhNMxs.mjs";
|
|
12
|
+
import { t as MagicString } from "./dist-Cegxq8gs.mjs";
|
|
13
|
+
import { t as parseDotenvFile } from "./dotenv-BfU6eqFt.mjs";
|
|
13
14
|
import { n as getPackageDir, t as detectAgents } from "./agents-B_pX_HmQ.mjs";
|
|
14
|
-
import { r as PlatformClient } from "./client-
|
|
15
|
-
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-
|
|
16
|
-
import {
|
|
17
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
18
|
-
import {
|
|
19
|
-
import { n as writeVoidProjectConfig, t as canRewriteVoidProjectConfig } from "./config-write-
|
|
20
|
-
import { t as promptForLoginToken } from "./login-
|
|
21
|
-
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-
|
|
22
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
23
|
-
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-
|
|
15
|
+
import { r as PlatformClient } from "./client-C2Prx_Bi.mjs";
|
|
16
|
+
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-NLsjBbuM.mjs";
|
|
17
|
+
import { s as formatProjectCommand } from "./cloudflare-process-2-TfIEzB.mjs";
|
|
18
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-DxiyW6iX.mjs";
|
|
19
|
+
import { n as writeDrizzleConfig } from "./config-CLYAosnQ.mjs";
|
|
20
|
+
import { n as writeVoidProjectConfig, t as canRewriteVoidProjectConfig } from "./config-write-AHGesphx.mjs";
|
|
21
|
+
import { t as promptForLoginToken } from "./login-D-Q4xw3Q.mjs";
|
|
22
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-B8-bCb7t.mjs";
|
|
23
|
+
import { t as connectCloudflare } from "./cloudflare-connect-2G3rL2rP.mjs";
|
|
24
|
+
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-CUX_iTPA.mjs";
|
|
24
25
|
import { createRequire } from "node:module";
|
|
25
26
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
26
27
|
import { fileURLToPath } from "node:url";
|
|
@@ -29,13 +30,6 @@ import { parse } from "jsonc-parser";
|
|
|
29
30
|
import { parseArgs } from "node:util";
|
|
30
31
|
import { spawnSync } from "node:child_process";
|
|
31
32
|
//#region src/cli/deploy-setup.ts
|
|
32
|
-
async function ensureToken(root) {
|
|
33
|
-
const existing = getToken(root);
|
|
34
|
-
if (existing) return existing;
|
|
35
|
-
const token = await promptForLoginToken(root);
|
|
36
|
-
log.success("Token saved.");
|
|
37
|
-
return token;
|
|
38
|
-
}
|
|
39
33
|
async function maybeSetupDeployProject(root) {
|
|
40
34
|
const existing = readProjectConfig(root);
|
|
41
35
|
if (existing) {
|
|
@@ -49,7 +43,11 @@ async function maybeSetupDeployProject(root) {
|
|
|
49
43
|
process.exit(0);
|
|
50
44
|
}
|
|
51
45
|
if (!shouldSetup) return null;
|
|
52
|
-
|
|
46
|
+
let token = existingToken;
|
|
47
|
+
if (!token) {
|
|
48
|
+
token = await promptForLoginToken(root);
|
|
49
|
+
log.step("Token saved.");
|
|
50
|
+
}
|
|
53
51
|
const client = new PlatformClient(token, { root });
|
|
54
52
|
const projects = await client.listProjects();
|
|
55
53
|
if (projects.length === 0) return promptAndCreateProject(root, client);
|
|
@@ -60,7 +58,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
60
58
|
slug: result.project.slug
|
|
61
59
|
};
|
|
62
60
|
writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
63
|
-
log.
|
|
61
|
+
log.step(`Linked project: ${config.slug}`);
|
|
64
62
|
return config;
|
|
65
63
|
}
|
|
66
64
|
return promptAndCreateProject(root, client);
|
|
@@ -78,8 +76,6 @@ async function maybeSetupDeployProject(root) {
|
|
|
78
76
|
* This is a best-effort DX sweetener, not a correctness boundary — a
|
|
79
77
|
* wrong guess only costs the user a single-line edit.
|
|
80
78
|
*/
|
|
81
|
-
/** Void has one local dotenv source. */
|
|
82
|
-
const SCAFFOLD_SOURCE_FILES = [".env"];
|
|
83
79
|
const BOOLEAN_LITERAL = /^(true|false)$/i;
|
|
84
80
|
const HTTP_URL = /^https?:\/\/\S+$/;
|
|
85
81
|
const SMALL_INTEGER = /^(?:0|[1-9]\d{0,4})$/;
|
|
@@ -97,34 +93,13 @@ function inferHelperForValue(value) {
|
|
|
97
93
|
if (SMALL_INTEGER.test(trimmed)) return "number";
|
|
98
94
|
return "string";
|
|
99
95
|
}
|
|
100
|
-
/** Collect
|
|
96
|
+
/** Collect the inferred entries from the local `.env`, sorted by key. */
|
|
101
97
|
function collectInferredEntries(root) {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
...parsed,
|
|
108
|
-
...cumulative
|
|
109
|
-
};
|
|
110
|
-
const expanded = expandDotenv(expansionView);
|
|
111
|
-
for (const key of Object.keys(parsed)) {
|
|
112
|
-
const value = expanded[key] ?? "";
|
|
113
|
-
if (!(key in cumulative)) cumulative[key] = parsed[key];
|
|
114
|
-
const existing = seen.get(key);
|
|
115
|
-
if (!existing) seen.set(key, {
|
|
116
|
-
key,
|
|
117
|
-
helper: inferHelperForValue(value),
|
|
118
|
-
sampleValue: value || void 0
|
|
119
|
-
});
|
|
120
|
-
else if (!existing.sampleValue && value) seen.set(key, {
|
|
121
|
-
key,
|
|
122
|
-
helper: inferHelperForValue(value),
|
|
123
|
-
sampleValue: value
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return [...seen.values()].sort((a, b) => a.key.localeCompare(b.key));
|
|
98
|
+
const values = parseDotenvFile(join(root, ".env"));
|
|
99
|
+
return Object.keys(values).sort((a, b) => a.localeCompare(b)).map((key) => ({
|
|
100
|
+
key,
|
|
101
|
+
helper: inferHelperForValue(values[key])
|
|
102
|
+
}));
|
|
128
103
|
}
|
|
129
104
|
/**
|
|
130
105
|
* Render the scaffolded `env.ts` body. The imports are pulled in lazily
|
|
@@ -164,27 +139,17 @@ function renderEnvTs(entries) {
|
|
|
164
139
|
* no-ops when `env.ts` is present. Never overwrites an existing file.
|
|
165
140
|
*/
|
|
166
141
|
function maybeScaffoldEnvTs(root) {
|
|
167
|
-
for (const
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
]) if (existsSync(join(root,
|
|
173
|
-
written: null,
|
|
174
|
-
skipReason: "env-ts-exists",
|
|
175
|
-
entries: []
|
|
176
|
-
};
|
|
177
|
-
for (const candidate of [
|
|
178
|
-
"src/env.ts",
|
|
179
|
-
"src/env.mts",
|
|
180
|
-
"src/env.js",
|
|
181
|
-
"src/env.mjs"
|
|
182
|
-
]) if (existsSync(join(root, candidate))) return {
|
|
142
|
+
for (const dir of ["", "src/"]) for (const ext of [
|
|
143
|
+
"ts",
|
|
144
|
+
"mts",
|
|
145
|
+
"js",
|
|
146
|
+
"mjs"
|
|
147
|
+
]) if (existsSync(join(root, `${dir}env.${ext}`))) return {
|
|
183
148
|
written: null,
|
|
184
149
|
skipReason: "env-ts-exists",
|
|
185
150
|
entries: []
|
|
186
151
|
};
|
|
187
|
-
if (!
|
|
152
|
+
if (!existsSync(join(root, ".env"))) return {
|
|
188
153
|
written: null,
|
|
189
154
|
skipReason: "no-dotenv-files",
|
|
190
155
|
entries: []
|
|
@@ -776,7 +741,6 @@ function parseInitArgs(args) {
|
|
|
776
741
|
options: {
|
|
777
742
|
tsconfig: { type: "boolean" },
|
|
778
743
|
github: { type: "boolean" },
|
|
779
|
-
agents: { type: "boolean" },
|
|
780
744
|
git: { type: "boolean" }
|
|
781
745
|
},
|
|
782
746
|
allowNegative: true,
|
|
@@ -789,7 +753,6 @@ function parseInitArgs(args) {
|
|
|
789
753
|
return {
|
|
790
754
|
tsconfig: parsed.values.tsconfig === true,
|
|
791
755
|
github: parsed.values.github === true,
|
|
792
|
-
agents: parsed.values.agents === true,
|
|
793
756
|
git: parsed.values.git
|
|
794
757
|
};
|
|
795
758
|
}
|
|
@@ -919,12 +882,15 @@ function getOwnConfigBaseUrlDir(config, configDir) {
|
|
|
919
882
|
const compilerOptions = asRecord(config.compilerOptions);
|
|
920
883
|
return compilerOptions && typeof compilerOptions.baseUrl === "string" ? resolve(configDir, compilerOptions.baseUrl) : null;
|
|
921
884
|
}
|
|
885
|
+
function readExtends(config) {
|
|
886
|
+
return typeof config.extends === "string" ? [config.extends] : Array.isArray(config.extends) ? config.extends.filter((value) => typeof value === "string") : [];
|
|
887
|
+
}
|
|
922
888
|
function getEffectiveConfigBaseUrlDir(config, configPath, seen) {
|
|
923
889
|
if (seen.has(configPath)) return null;
|
|
924
890
|
seen.add(configPath);
|
|
925
891
|
const ownBaseUrl = getOwnConfigBaseUrlDir(config, dirname(configPath));
|
|
926
892
|
if (ownBaseUrl) return ownBaseUrl;
|
|
927
|
-
const extendsValues =
|
|
893
|
+
const extendsValues = readExtends(config);
|
|
928
894
|
let inheritedBaseUrl = null;
|
|
929
895
|
for (const extendsValue of extendsValues) {
|
|
930
896
|
const extendedPath = resolveExtendedTsconfig(configPath, extendsValue);
|
|
@@ -984,7 +950,7 @@ function collectTsconfigPatchFromConfig(config, configPath, root, outputBaseDir,
|
|
|
984
950
|
};
|
|
985
951
|
if (seen.has(configPath)) return patch;
|
|
986
952
|
seen.add(configPath);
|
|
987
|
-
const extendsValues =
|
|
953
|
+
const extendsValues = readExtends(config);
|
|
988
954
|
const hasOwnFiles = Array.isArray(config.files);
|
|
989
955
|
const compilerOptions = asRecord(config.compilerOptions);
|
|
990
956
|
const hasOwnPaths = asRecord(compilerOptions?.paths) !== null;
|
|
@@ -1139,7 +1105,7 @@ function parsePackageManagerField(pkg) {
|
|
|
1139
1105
|
* pnpm markers is still pnpm-managed if the enclosing workspace root has
|
|
1140
1106
|
* `pnpm-workspace.yaml`, a `pnpm-lock.yaml`, or `packageManager: pnpm@...`.
|
|
1141
1107
|
*
|
|
1142
|
-
*
|
|
1108
|
+
* Local non-pnpm signals MUST outrank the ancestor walk. A bun
|
|
1143
1109
|
* or yarn subproject nested under a pnpm workspace ancestor is still
|
|
1144
1110
|
* bun/yarn — its local `bun.lockb` / `yarn.lock` / `package-lock.json` or
|
|
1145
1111
|
* a local Corepack pin for bun/yarn/npm proves the ancestor's pnpm shape
|
|
@@ -1153,7 +1119,7 @@ function isPnpmProject(root, pkg) {
|
|
|
1153
1119
|
const localPm = parsePackageManagerField(pkg);
|
|
1154
1120
|
if (localPm === "pnpm") return true;
|
|
1155
1121
|
if (localPm === "bun" || localPm === "yarn" || localPm === "npm") return false;
|
|
1156
|
-
if (
|
|
1122
|
+
if (hasLocalLockfile(root)) return false;
|
|
1157
1123
|
return hasAncestorPnpmMarkers(root);
|
|
1158
1124
|
}
|
|
1159
1125
|
/**
|
|
@@ -1162,14 +1128,13 @@ function isPnpmProject(root, pkg) {
|
|
|
1162
1128
|
* workspace root is pnpm-managed even when the subpackage has no local
|
|
1163
1129
|
* pnpm signals.
|
|
1164
1130
|
*
|
|
1165
|
-
*
|
|
1131
|
+
* An ancestor `pnpm-workspace.yaml` / `pnpm-lock.yaml` /
|
|
1166
1132
|
* Corepack pnpm pin alone is NOT proof that `start` is governed by
|
|
1167
1133
|
* that repo's pnpm install. A scratch app nested under a pnpm
|
|
1168
1134
|
* monorepo is a separate project when its path doesn't match the
|
|
1169
|
-
* workspace globs
|
|
1170
|
-
* `ensureVoidDependency` / `scaffoldPagesApp`
|
|
1171
|
-
*
|
|
1172
|
-
* standalone fallback path.
|
|
1135
|
+
* workspace globs; treating it as a member would make
|
|
1136
|
+
* `ensureVoidDependency` / `scaffoldPagesApp` disagree with the local
|
|
1137
|
+
* install, which uses the standalone fallback path.
|
|
1173
1138
|
*
|
|
1174
1139
|
* Delegate workspace membership to `findWorkspaceRoot` +
|
|
1175
1140
|
* `isWorkspaceSubpackage` — the same check used by the
|
|
@@ -1204,14 +1169,13 @@ function hasAncestorPnpmMarkers(start) {
|
|
|
1204
1169
|
* subpackage's `package.json` (or verified it was already there), and
|
|
1205
1170
|
* under PnP the workspace-root install is what wires up resolution.
|
|
1206
1171
|
*
|
|
1207
|
-
*
|
|
1172
|
+
* A committed-but-unfetched `.pnp.cjs` is NOT proof that
|
|
1208
1173
|
* `yarn install` has run. Yarn Berry repos commonly commit `.pnp.cjs`
|
|
1209
1174
|
* but gitignore `.yarn/cache/*.zip` (zero-install is opt-in), so a
|
|
1210
1175
|
* fresh clone has the runtime file on disk while the archives it
|
|
1211
1176
|
* points at are missing. The stricter `findInstalledYarnPnpRuntime`
|
|
1212
|
-
* also requires
|
|
1213
|
-
*
|
|
1214
|
-
* install has actually populated the archives. Without that marker,
|
|
1177
|
+
* also requires a post-install marker next to the runtime
|
|
1178
|
+
* (`.yarn/install-state.gz` or a populated `.yarn/cache`). Without it,
|
|
1215
1179
|
* we fall through and return false so the caller triggers the install
|
|
1216
1180
|
* step before attempting to spawn drizzle-kit.
|
|
1217
1181
|
*/
|
|
@@ -1304,12 +1268,8 @@ function readWorkspacePatterns(workspaceRoot) {
|
|
|
1304
1268
|
* whitespace (or is the first column) AND it is not inside a quoted
|
|
1305
1269
|
* scalar. Flow-style inline quoting is handled by a plain state machine
|
|
1306
1270
|
* — no escape sequence support, because real-world workspace globs
|
|
1307
|
-
* never contain escaped quotes.
|
|
1308
|
-
*
|
|
1309
|
-
* This replaces the original `/\s+#.*$/` strip which was greedy and
|
|
1310
|
-
* would truncate legitimate quoted values like `- "path #hash/*"`,
|
|
1311
|
-
* leaving a broken glob that silently failed
|
|
1312
|
-
* `isWorkspaceSubpackage` membership.
|
|
1271
|
+
* never contain escaped quotes. A naive `/\s+#.*$/` strip would
|
|
1272
|
+
* truncate quoted values like `- "path #hash/*"`.
|
|
1313
1273
|
*/
|
|
1314
1274
|
function stripYamlLineComment(line) {
|
|
1315
1275
|
let inSingle = false;
|
|
@@ -1540,13 +1500,14 @@ function detectProjectState(root) {
|
|
|
1540
1500
|
if (field === "pnpm" || field === "yarn" || field === "bun") packageManager = field;
|
|
1541
1501
|
else packageManager = "npm";
|
|
1542
1502
|
}
|
|
1503
|
+
const paths = readProjectPaths(root);
|
|
1543
1504
|
return {
|
|
1544
1505
|
hasTypescript,
|
|
1545
1506
|
hasTsconfig: existsSync(join(root, "tsconfig.json")),
|
|
1546
1507
|
hasGithubWorkflows: existsSync(join(root, ".github", "workflows")),
|
|
1547
|
-
hasRoutes: existsSync(
|
|
1548
|
-
hasMigrations: existsSync(
|
|
1549
|
-
hasPages: existsSync(
|
|
1508
|
+
hasRoutes: existsSync(paths.routesDir),
|
|
1509
|
+
hasMigrations: existsSync(paths.migrationsDir) || existsSync(join(root, "migrations")),
|
|
1510
|
+
hasPages: existsSync(paths.pagesDir),
|
|
1550
1511
|
packageManager,
|
|
1551
1512
|
typescriptWanted: hasTypescript
|
|
1552
1513
|
};
|
|
@@ -1559,15 +1520,12 @@ function hasDrizzleSchema(root) {
|
|
|
1559
1520
|
return existsSync(paths.schemaFile) || existsSync(paths.schemaDir);
|
|
1560
1521
|
}
|
|
1561
1522
|
function detectPagesFramework(root) {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
} catch {
|
|
1569
|
-
return;
|
|
1570
|
-
}
|
|
1523
|
+
const pkg = readPackageJson(root);
|
|
1524
|
+
if (!pkg) return;
|
|
1525
|
+
return detectScaffoldFrameworkFromDependencies({
|
|
1526
|
+
...asRecord(pkg.dependencies) ?? {},
|
|
1527
|
+
...asRecord(pkg.devDependencies) ?? {}
|
|
1528
|
+
});
|
|
1571
1529
|
}
|
|
1572
1530
|
function readPackageJson(root) {
|
|
1573
1531
|
try {
|
|
@@ -1591,9 +1549,10 @@ function getDeclaredDependencySpec(root, packageName) {
|
|
|
1591
1549
|
}
|
|
1592
1550
|
}
|
|
1593
1551
|
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1552
|
+
return getDeclaredDependencySpec(root, packageName) || fallbackVersion;
|
|
1553
|
+
}
|
|
1554
|
+
function defaultPackageName(root) {
|
|
1555
|
+
return basename(root).toLowerCase().replace(/[^a-z0-9-]/g, "-") || "my-app";
|
|
1597
1556
|
}
|
|
1598
1557
|
function setupTsconfig(root, state, pagesFramework) {
|
|
1599
1558
|
const tsconfigPath = join(root, "tsconfig.json");
|
|
@@ -1618,7 +1577,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1618
1577
|
else if (Array.isArray(extendsValue)) tsconfig.extends = [...extendsValue, target];
|
|
1619
1578
|
else tsconfig.extends = target;
|
|
1620
1579
|
updated = true;
|
|
1621
|
-
log.
|
|
1580
|
+
log.step("Updated tsconfig.json — added extends .void/tsconfig.json");
|
|
1622
1581
|
}
|
|
1623
1582
|
const compilerOptions = asRecord(tsconfig.compilerOptions) ?? {};
|
|
1624
1583
|
tsconfig.compilerOptions = compilerOptions;
|
|
@@ -1626,13 +1585,13 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1626
1585
|
if (!types.includes("void/env")) {
|
|
1627
1586
|
types.push("void/env");
|
|
1628
1587
|
updated = true;
|
|
1629
|
-
log.
|
|
1588
|
+
log.step("Updated tsconfig.json — added void/env to types");
|
|
1630
1589
|
}
|
|
1631
1590
|
const cfIdx = types.indexOf("@cloudflare/workers-types");
|
|
1632
1591
|
if (cfIdx !== -1) {
|
|
1633
1592
|
types.splice(cfIdx, 1);
|
|
1634
1593
|
updated = true;
|
|
1635
|
-
log.
|
|
1594
|
+
log.step("Removed @cloudflare/workers-types from tsconfig types (included in void/env)");
|
|
1636
1595
|
}
|
|
1637
1596
|
compilerOptions.types = types;
|
|
1638
1597
|
const existingFiles = uniqueStrings(existingPatch.files);
|
|
@@ -1641,7 +1600,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1641
1600
|
if (JSON.stringify(tsconfig.files) !== JSON.stringify(files)) {
|
|
1642
1601
|
tsconfig.files = files;
|
|
1643
1602
|
updated = true;
|
|
1644
|
-
log.
|
|
1603
|
+
log.step("Updated tsconfig.json — merged generated Void type files");
|
|
1645
1604
|
}
|
|
1646
1605
|
}
|
|
1647
1606
|
if (Object.keys(existingPatch.paths).length > 0 || asRecord(compilerOptions.paths) !== null) {
|
|
@@ -1651,7 +1610,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1651
1610
|
if (JSON.stringify(existingPaths) !== JSON.stringify(paths)) {
|
|
1652
1611
|
compilerOptions.paths = paths;
|
|
1653
1612
|
updated = true;
|
|
1654
|
-
log.
|
|
1613
|
+
log.step("Updated tsconfig.json — merged generated Void path aliases");
|
|
1655
1614
|
}
|
|
1656
1615
|
}
|
|
1657
1616
|
if (updated) {
|
|
@@ -1661,7 +1620,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1661
1620
|
...rest
|
|
1662
1621
|
};
|
|
1663
1622
|
writeFileSync(tsconfigPath, JSON.stringify(ordered, null, 2) + "\n");
|
|
1664
|
-
} else log.
|
|
1623
|
+
} else log.step("tsconfig.json looks good");
|
|
1665
1624
|
try {
|
|
1666
1625
|
const pkgPath = join(root, "package.json");
|
|
1667
1626
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
@@ -1676,7 +1635,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1676
1635
|
}
|
|
1677
1636
|
if (pkgUpdated) {
|
|
1678
1637
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
1679
|
-
log.
|
|
1638
|
+
log.step("Removed @cloudflare/workers-types from package.json (included in void/env)");
|
|
1680
1639
|
log.info(`Re-run ${state.packageManager} install to update your lockfile`);
|
|
1681
1640
|
}
|
|
1682
1641
|
} catch {}
|
|
@@ -1704,21 +1663,18 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1704
1663
|
]
|
|
1705
1664
|
};
|
|
1706
1665
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
1707
|
-
log.
|
|
1666
|
+
log.step("Created tsconfig.json");
|
|
1708
1667
|
if (!state.hasTypescript) log.info("Don't forget to install typescript");
|
|
1709
1668
|
}
|
|
1710
1669
|
}
|
|
1711
1670
|
function readProjectWranglerCompatDate(root) {
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
if (typeof parsed?.compatibility_date === "string") return parsed.compatibility_date;
|
|
1720
|
-
} catch {}
|
|
1721
|
-
}
|
|
1671
|
+
const configPath = materializeCloudflareConfig(root);
|
|
1672
|
+
if (!existsSync(configPath)) return;
|
|
1673
|
+
try {
|
|
1674
|
+
const errors = [];
|
|
1675
|
+
const parsed = parse(readFileSync(configPath, "utf-8"), errors);
|
|
1676
|
+
if (errors.length === 0 && typeof parsed?.compatibility_date === "string") return parsed.compatibility_date;
|
|
1677
|
+
} catch {}
|
|
1722
1678
|
}
|
|
1723
1679
|
/**
|
|
1724
1680
|
* Ensure wrangler.jsonc exists with `compatibility_date` and `nodejs_als` flag
|
|
@@ -1731,11 +1687,8 @@ function setupWranglerConfig(root, framework) {
|
|
|
1731
1687
|
compatibilityDate: LATEST_KNOWN_COMPAT_DATE,
|
|
1732
1688
|
compatibilityFlags: ["nodejs_als"]
|
|
1733
1689
|
});
|
|
1734
|
-
if (result.modified) log.
|
|
1735
|
-
else log.
|
|
1736
|
-
}
|
|
1737
|
-
function writeVoidConfig(root, config) {
|
|
1738
|
-
writeVoidProjectConfig(root, config);
|
|
1690
|
+
if (result.modified) log.step(hadConfig ? "Updated Cloudflare config with compatibility_date and nodejs_als" : "Created Cloudflare config with compatibility_date and nodejs_als");
|
|
1691
|
+
else log.step(`${basename(result.configPath)} looks good`);
|
|
1739
1692
|
}
|
|
1740
1693
|
function ensureVoidWorkerCompatibilityDate(root) {
|
|
1741
1694
|
const config = readConfig(root);
|
|
@@ -1745,15 +1698,15 @@ function ensureVoidWorkerCompatibilityDate(root) {
|
|
|
1745
1698
|
const compatibilityDate = readProjectWranglerCompatDate(root) ?? "2026-02-24";
|
|
1746
1699
|
if (!canRewriteVoidProjectConfig(root)) {
|
|
1747
1700
|
writeProvisionedWranglerConfig(root, { compatibilityDate });
|
|
1748
|
-
log.
|
|
1701
|
+
log.step("Pinned worker compatibility_date in void.lock.json");
|
|
1749
1702
|
return;
|
|
1750
1703
|
}
|
|
1751
1704
|
config.worker = {
|
|
1752
1705
|
...worker,
|
|
1753
1706
|
compatibility_date: compatibilityDate
|
|
1754
1707
|
};
|
|
1755
|
-
|
|
1756
|
-
log.
|
|
1708
|
+
writeVoidProjectConfig(root, config);
|
|
1709
|
+
log.step("Pinned worker compatibility_date in void.config.ts");
|
|
1757
1710
|
}
|
|
1758
1711
|
function clearConfiguredDatabase(root, messages) {
|
|
1759
1712
|
const config = readConfig(root);
|
|
@@ -1762,8 +1715,8 @@ function clearConfiguredDatabase(root, messages) {
|
|
|
1762
1715
|
return;
|
|
1763
1716
|
}
|
|
1764
1717
|
delete config.database;
|
|
1765
|
-
|
|
1766
|
-
log.
|
|
1718
|
+
writeVoidProjectConfig(root, config);
|
|
1719
|
+
log.step(messages.updated);
|
|
1767
1720
|
}
|
|
1768
1721
|
function applyDatabaseDialect(root, dialect) {
|
|
1769
1722
|
const config = readConfig(root);
|
|
@@ -1773,8 +1726,8 @@ function applyDatabaseDialect(root, dialect) {
|
|
|
1773
1726
|
return;
|
|
1774
1727
|
}
|
|
1775
1728
|
config.database = "pg";
|
|
1776
|
-
|
|
1777
|
-
log.
|
|
1729
|
+
writeVoidProjectConfig(root, config);
|
|
1730
|
+
log.step("Configured PostgreSQL in void.config.ts");
|
|
1778
1731
|
return;
|
|
1779
1732
|
}
|
|
1780
1733
|
if (dialect === "mysql") {
|
|
@@ -1783,8 +1736,8 @@ function applyDatabaseDialect(root, dialect) {
|
|
|
1783
1736
|
return;
|
|
1784
1737
|
}
|
|
1785
1738
|
config.database = "mysql";
|
|
1786
|
-
|
|
1787
|
-
log.
|
|
1739
|
+
writeVoidProjectConfig(root, config);
|
|
1740
|
+
log.step("Configured MySQL in void.config.ts");
|
|
1788
1741
|
return;
|
|
1789
1742
|
}
|
|
1790
1743
|
clearConfiguredDatabase(root, {
|
|
@@ -1932,7 +1885,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1932
1885
|
let selectedApiUrl = null;
|
|
1933
1886
|
let promptedForPlatform = false;
|
|
1934
1887
|
try {
|
|
1935
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1888
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-BgX2qYSY.mjs");
|
|
1936
1889
|
selectedApiUrl = getApiUrl(root);
|
|
1937
1890
|
getSiteDomain(root);
|
|
1938
1891
|
} catch (error) {
|
|
@@ -1952,7 +1905,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1952
1905
|
}
|
|
1953
1906
|
const discovery = await discoverPlatform(selectedApiUrl);
|
|
1954
1907
|
saveDiscoveredPlatform(discovery);
|
|
1955
|
-
if (promptedForPlatform) log.
|
|
1908
|
+
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
1956
1909
|
return discovery;
|
|
1957
1910
|
}
|
|
1958
1911
|
async function setupCloudflareDeployment(root) {
|
|
@@ -2109,7 +2062,7 @@ function setupGithubActions(root, state, platform = "void", platformApiUrl) {
|
|
|
2109
2062
|
const slug = readProjectConfig(root)?.slug ?? null;
|
|
2110
2063
|
mkdirSync(workflowDir, { recursive: true });
|
|
2111
2064
|
writeFileSync(workflowPath, getWorkflowYaml(root, state.packageManager, slug, platform, platformApiUrl));
|
|
2112
|
-
log.
|
|
2065
|
+
log.step("Created .github/workflows/void-deploy.yml");
|
|
2113
2066
|
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 cloudflare.account_id in void.config.ts.", "GitHub Actions Cloudflare deploy");
|
|
2114
2067
|
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");
|
|
2115
2068
|
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");
|
|
@@ -2132,7 +2085,7 @@ function patchWorkflowProjectSlug(root, slug) {
|
|
|
2132
2085
|
const placeholderBlock = " # Set a VOID_PROJECT repository variable to your project slug\n # (Settings → Secrets and variables → Actions → Variables).\n VOID_PROJECT: ${{ vars.VOID_PROJECT }}";
|
|
2133
2086
|
if (!yaml.includes(placeholderBlock)) return false;
|
|
2134
2087
|
writeFileSync(workflowPath, yaml.replace(placeholderBlock, ` VOID_PROJECT: ${slug}`));
|
|
2135
|
-
log.
|
|
2088
|
+
log.step(`Set VOID_PROJECT: ${slug} in .github/workflows/void-deploy.yml`);
|
|
2136
2089
|
return true;
|
|
2137
2090
|
}
|
|
2138
2091
|
function writeFileIfMissing(root, filePath, content) {
|
|
@@ -2140,13 +2093,13 @@ function writeFileIfMissing(root, filePath, content) {
|
|
|
2140
2093
|
if (existsSync(fullPath)) return;
|
|
2141
2094
|
mkdirSync(dirname(fullPath), { recursive: true });
|
|
2142
2095
|
writeFileSync(fullPath, content);
|
|
2143
|
-
log.
|
|
2096
|
+
log.step(`Created ${filePath}`);
|
|
2144
2097
|
}
|
|
2145
2098
|
function ensureGitignore(root) {
|
|
2146
2099
|
const gitignorePath = join(root, ".gitignore");
|
|
2147
2100
|
if (!existsSync(gitignorePath)) {
|
|
2148
2101
|
writeFileSync(gitignorePath, SCAFFOLD_GITIGNORE_LINES.join("\n") + "\n");
|
|
2149
|
-
log.
|
|
2102
|
+
log.step("Created .gitignore");
|
|
2150
2103
|
return;
|
|
2151
2104
|
}
|
|
2152
2105
|
const content = readFileSync(gitignorePath, "utf-8");
|
|
@@ -2155,7 +2108,7 @@ function ensureGitignore(root) {
|
|
|
2155
2108
|
if (missing.length === 0) return;
|
|
2156
2109
|
const separator = content.endsWith("\n") ? "" : "\n";
|
|
2157
2110
|
writeFileSync(gitignorePath, content + separator + missing.join("\n") + "\n");
|
|
2158
|
-
log.
|
|
2111
|
+
log.step("Updated .gitignore with Void defaults");
|
|
2159
2112
|
}
|
|
2160
2113
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
2161
2114
|
const lines = yaml.split(/\r?\n/);
|
|
@@ -2192,7 +2145,7 @@ function insertPnpmAllowBuilds(yaml) {
|
|
|
2192
2145
|
function resolvePnpmConfigRoot(root, pkg) {
|
|
2193
2146
|
if (existsSync(join(root, "pnpm-workspace.yaml")) || existsSync(join(root, "pnpm-lock.yaml")) || parsePackageManagerField(pkg) === "pnpm") return root;
|
|
2194
2147
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
2195
|
-
if (workspaceRoot !== void 0 &&
|
|
2148
|
+
if (workspaceRoot !== void 0 && hasAncestorPnpmMarkers(root)) return workspaceRoot;
|
|
2196
2149
|
return root;
|
|
2197
2150
|
}
|
|
2198
2151
|
function ensurePnpmAllowBuilds(root, pkg) {
|
|
@@ -2202,7 +2155,7 @@ function ensurePnpmAllowBuilds(root, pkg) {
|
|
|
2202
2155
|
const after = insertPnpmAllowBuilds(removeTopLevelYamlBlock(removeTopLevelYamlBlock(before, "onlyBuiltDependencies"), "allowBuilds"));
|
|
2203
2156
|
if (after !== before) {
|
|
2204
2157
|
writeFileSync(workspacePath, after);
|
|
2205
|
-
log.
|
|
2158
|
+
log.step(configRoot === root ? "Updated pnpm-workspace.yaml with approved builds" : `Updated ${relative(root, workspacePath)} with approved builds`);
|
|
2206
2159
|
return true;
|
|
2207
2160
|
}
|
|
2208
2161
|
return false;
|
|
@@ -2216,7 +2169,7 @@ function installProjectDependencies(root, packageManager) {
|
|
|
2216
2169
|
});
|
|
2217
2170
|
if (result.error) throw result.error;
|
|
2218
2171
|
if (result.status !== 0) throw new Error(`${packageManager} install failed with exit code ${result.status ?? "unknown"}`);
|
|
2219
|
-
log.
|
|
2172
|
+
log.step(`Installed dependencies with ${packageManager}`);
|
|
2220
2173
|
}
|
|
2221
2174
|
function generateStarterMigration(root, starterMode) {
|
|
2222
2175
|
const dialect = starterMode;
|
|
@@ -2275,7 +2228,7 @@ function generateStarterMigration(root, starterMode) {
|
|
|
2275
2228
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
2276
2229
|
throw new Error(["Failed to generate the starter database migration.", ...detail ? [detail] : []].join("\n\n"));
|
|
2277
2230
|
}
|
|
2278
|
-
log.
|
|
2231
|
+
log.step("Generated initial Drizzle migration");
|
|
2279
2232
|
}
|
|
2280
2233
|
function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchain) {
|
|
2281
2234
|
const packageJsonPath = join(root, "package.json");
|
|
@@ -2292,7 +2245,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2292
2245
|
} catch {
|
|
2293
2246
|
throw new Error("Could not parse package.json in empty project");
|
|
2294
2247
|
}
|
|
2295
|
-
const fallbackName =
|
|
2248
|
+
const fallbackName = defaultPackageName(root);
|
|
2296
2249
|
if (!pkg.name || typeof pkg.name !== "string") pkg.name = fallbackName;
|
|
2297
2250
|
if (pkg.private === void 0) pkg.private = true;
|
|
2298
2251
|
if (!pkg.type) pkg.type = "module";
|
|
@@ -2326,7 +2279,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2326
2279
|
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2327
2280
|
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@12.4.1";
|
|
2328
2281
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2329
|
-
log.
|
|
2282
|
+
log.step("Updated package.json with starter scripts and dependencies");
|
|
2330
2283
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
2331
2284
|
ensureGitignore(root);
|
|
2332
2285
|
if (starterMode !== "static") applyDatabaseDialect(root, starterMode);
|
|
@@ -2358,7 +2311,7 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2358
2311
|
throw new Error("Could not parse package.json while configuring Void");
|
|
2359
2312
|
}
|
|
2360
2313
|
}
|
|
2361
|
-
const fallbackName =
|
|
2314
|
+
const fallbackName = defaultPackageName(root);
|
|
2362
2315
|
let changed = !existedBefore;
|
|
2363
2316
|
let dependencyAdded = false;
|
|
2364
2317
|
if (!pkg.name || typeof pkg.name !== "string") {
|
|
@@ -2400,7 +2353,7 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2400
2353
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2401
2354
|
if (changed) {
|
|
2402
2355
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2403
|
-
log.
|
|
2356
|
+
log.step(existedBefore ? plainViteSetup ? "Updated package.json with Void dependencies and Vite scripts" : "Updated package.json with Void dependency" : plainViteSetup ? "Created package.json with Void dependencies and Vite scripts" : "Created package.json with Void dependency");
|
|
2404
2357
|
}
|
|
2405
2358
|
return {
|
|
2406
2359
|
dependencyAdded,
|
|
@@ -2455,7 +2408,7 @@ function ensureExistingProjectViteConfig(root, framework) {
|
|
|
2455
2408
|
return;
|
|
2456
2409
|
}
|
|
2457
2410
|
writeFileSync(fullPath, updated);
|
|
2458
|
-
log.
|
|
2411
|
+
log.step(`Added voidPlugin() to ${configPath}`);
|
|
2459
2412
|
}
|
|
2460
2413
|
function setupExistingProject(root, framework) {
|
|
2461
2414
|
log.info("Existing project detected. Configuring Void...");
|
|
@@ -2490,7 +2443,7 @@ export const posts = sqliteTable("posts", {
|
|
|
2490
2443
|
createdAt: text("created_at").notNull().default(sql\`(datetime('now'))\`),
|
|
2491
2444
|
});
|
|
2492
2445
|
`);
|
|
2493
|
-
log.
|
|
2446
|
+
log.step("Created db/schema.ts");
|
|
2494
2447
|
mkdirSync(join(paths.routesDir, "api"), { recursive: true });
|
|
2495
2448
|
writeFileSync(join(paths.routesDir, "api", "posts.ts"), `import { defineHandler } from "void";
|
|
2496
2449
|
import { db } from "void/db";
|
|
@@ -2501,7 +2454,7 @@ export const GET = defineHandler(async () => {
|
|
|
2501
2454
|
return db.select().from(posts);
|
|
2502
2455
|
});
|
|
2503
2456
|
`);
|
|
2504
|
-
log.
|
|
2457
|
+
log.step("Created routes/api/posts.ts");
|
|
2505
2458
|
ensureProjectTsconfig(root, void 0, true, true, { paths });
|
|
2506
2459
|
mkdirSync(paths.ssrDir, { recursive: true });
|
|
2507
2460
|
writeFileSync(join(paths.ssrDir, "demo.ts"), `import { fetch } from "void/client";
|
|
@@ -2515,7 +2468,7 @@ console.log(posts);
|
|
|
2515
2468
|
// posts[0].body ← string (type-checked)
|
|
2516
2469
|
// posts[0].nope ← TypeScript error
|
|
2517
2470
|
`);
|
|
2518
|
-
log.
|
|
2471
|
+
log.step("Created src/demo.ts");
|
|
2519
2472
|
note(`SQL migration → DB types → Route handler → Route types → Typed fetch
|
|
2520
2473
|
|
|
2521
2474
|
Run \`${devCommand}\` and open src/demo.ts to see the types in action.\nTry changing the migration or handler — types update automatically.`, "Type Safety Demo");
|
|
@@ -2543,7 +2496,7 @@ function ensureVoidDependency(root) {
|
|
|
2543
2496
|
throw new Error("Could not parse package.json while scaffolding demo");
|
|
2544
2497
|
}
|
|
2545
2498
|
}
|
|
2546
|
-
const fallbackName =
|
|
2499
|
+
const fallbackName = defaultPackageName(root);
|
|
2547
2500
|
let changed = !existedBefore;
|
|
2548
2501
|
if (!pkg.name || typeof pkg.name !== "string") {
|
|
2549
2502
|
pkg.name = fallbackName;
|
|
@@ -2561,16 +2514,14 @@ function ensureVoidDependency(root) {
|
|
|
2561
2514
|
if (!pkg.dependencies || typeof pkg.dependencies !== "object" || Array.isArray(pkg.dependencies)) pkg.dependencies = {};
|
|
2562
2515
|
const devDependencies = asRecord(pkg.devDependencies) ?? {};
|
|
2563
2516
|
pkg.devDependencies = devDependencies;
|
|
2564
|
-
if (!
|
|
2565
|
-
return typeof asRecord(pkg[field])?.void === "string";
|
|
2566
|
-
})) {
|
|
2517
|
+
if (!hasDeclaredDependency(pkg, "void")) {
|
|
2567
2518
|
devDependencies.void = voidSpec;
|
|
2568
2519
|
changed = true;
|
|
2569
2520
|
}
|
|
2570
2521
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2571
2522
|
if (changed) {
|
|
2572
2523
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2573
|
-
log.
|
|
2524
|
+
log.step(existedBefore ? "Ensured void is in package.json devDependencies" : "Created package.json with void as a devDependency");
|
|
2574
2525
|
}
|
|
2575
2526
|
return changed || pnpmConfigChanged;
|
|
2576
2527
|
}
|
|
@@ -2578,42 +2529,57 @@ function getOwnVersion() {
|
|
|
2578
2529
|
return JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2579
2530
|
}
|
|
2580
2531
|
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-]+)*)?`;
|
|
2581
|
-
const MARKER_OPEN_RE = new RegExp(String.raw`^<!--injected-by-void-v(${MARKER_VERSION_SOURCE})-->\r?$`, "m");
|
|
2582
2532
|
const MARKER_CLOSE = "<!--/injected-by-void-->";
|
|
2583
2533
|
const MARKER_BLOCK_RE = new RegExp(String.raw`^<!--injected-by-void-v${MARKER_VERSION_SOURCE}-->\r?\n[\s\S]*?^<!--\/injected-by-void-->\r?$`, "m");
|
|
2584
|
-
function injectAgentBlock(root) {
|
|
2534
|
+
async function injectAgentBlock(root, newProject) {
|
|
2585
2535
|
const filePath = "AGENTS.md";
|
|
2586
2536
|
const fullPath = join(root, filePath);
|
|
2587
2537
|
const version = getOwnVersion();
|
|
2588
2538
|
const template = readFileSync(join(getPackageDir(), "AGENTS_TEMPLATE.md"), "utf-8");
|
|
2589
2539
|
const block = `${`<!--injected-by-void-v${version}-->`}\n${template}\n${MARKER_CLOSE}`;
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2540
|
+
const existing = existsSync(fullPath) ? readFileSync(fullPath, "utf-8") : null;
|
|
2541
|
+
const managedBlock = existing?.match(MARKER_BLOCK_RE);
|
|
2542
|
+
if (managedBlock?.[0] === block) {
|
|
2543
|
+
log.info(`${filePath} already has Void instructions (v${version})`);
|
|
2544
|
+
return;
|
|
2545
|
+
}
|
|
2546
|
+
if (!newProject) {
|
|
2547
|
+
if (process.env.CI || !process.stdin.isTTY) {
|
|
2548
|
+
log.info(`Skipping ${filePath} setup without an interactive terminal; read node_modules/void/docs/.`);
|
|
2549
|
+
return;
|
|
2550
|
+
}
|
|
2551
|
+
const accepted = await confirm({
|
|
2552
|
+
message: managedBlock ? "Update Void instructions in AGENTS.md?" : existing !== null ? "Append Void instructions to AGENTS.md?" : "Create AGENTS.md with Void instructions?",
|
|
2553
|
+
initialValue: true
|
|
2554
|
+
});
|
|
2555
|
+
if (isCancel(accepted)) {
|
|
2556
|
+
cancel("Setup cancelled.");
|
|
2557
|
+
process.exit(0);
|
|
2558
|
+
}
|
|
2559
|
+
if (!accepted) return;
|
|
2560
|
+
}
|
|
2561
|
+
if (existing !== null) {
|
|
2562
|
+
if (managedBlock) {
|
|
2598
2563
|
const updated = existing.replace(MARKER_BLOCK_RE, block);
|
|
2599
2564
|
writeFileSync(fullPath, updated);
|
|
2600
|
-
log.
|
|
2565
|
+
log.step(`Updated Void instructions in ${filePath}`);
|
|
2601
2566
|
} else {
|
|
2602
2567
|
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
2603
2568
|
writeFileSync(fullPath, existing + separator + block + "\n");
|
|
2604
|
-
log.
|
|
2569
|
+
log.step(`Added Void instructions to ${filePath}`);
|
|
2605
2570
|
}
|
|
2606
2571
|
} else {
|
|
2607
2572
|
writeFileSync(fullPath, block + "\n");
|
|
2608
|
-
log.
|
|
2573
|
+
log.step(`Created ${filePath} with Void instructions`);
|
|
2609
2574
|
}
|
|
2610
2575
|
}
|
|
2611
2576
|
async function runInitCommand(root, initArgs) {
|
|
2612
2577
|
console.log();
|
|
2613
|
-
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github
|
|
2578
|
+
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github));
|
|
2614
2579
|
if (!targeted) root = await resolveInitRoot(root);
|
|
2580
|
+
const newProject = isScaffoldableEmptyProject(root) && !existsSync(join(root, "AGENTS.md"));
|
|
2615
2581
|
const hadTypedConfig = existsSync(join(root, TYPED_CONFIG_FILE));
|
|
2616
|
-
if (migrateLegacyVoidConfig(root)) log.
|
|
2582
|
+
if (migrateLegacyVoidConfig(root)) log.step("Migrated project configuration to void.config.ts. Commit void.config.ts and void.lock.json.");
|
|
2617
2583
|
const workspaceSubpackage = isInsideWorkspaceSubpackage(root);
|
|
2618
2584
|
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.");
|
|
2619
2585
|
const gitInitialized = !workspaceSubpackage && (!targeted || initArgs?.git !== void 0) ? await setupGit(root, initArgs?.git) : false;
|
|
@@ -2674,14 +2640,12 @@ async function runInitCommand(root, initArgs) {
|
|
|
2674
2640
|
if (framework) setupWranglerConfig(root, framework);
|
|
2675
2641
|
if (!hadTypedConfig) migrateFrameworkAdapterPaths(root);
|
|
2676
2642
|
if (!targeted && !didScaffoldStarter) applyDatabaseSetup(root, await promptDatabaseSetup(root));
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
} else log.info("No coding agent detected; read the bundled docs linked in AGENTS.md");
|
|
2684
|
-
}
|
|
2643
|
+
await injectAgentBlock(root, newProject);
|
|
2644
|
+
const agents = detectAgents(root);
|
|
2645
|
+
if (agents.length > 0) {
|
|
2646
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-BgVMvQdy.mjs");
|
|
2647
|
+
linkSkillsForSpecificAgents(root, agents);
|
|
2648
|
+
} else log.info("Bundled Void docs: node_modules/void/docs/");
|
|
2685
2649
|
if (!targeted && !framework) {
|
|
2686
2650
|
if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2687
2651
|
else if (!state.typescriptWanted) {} else {
|
|
@@ -2708,11 +2672,11 @@ async function runInitCommand(root, initArgs) {
|
|
|
2708
2672
|
let voidPlatformDiscovery = null;
|
|
2709
2673
|
if (!targeted && deploymentPlatform === "cloudflare") await setupCloudflareDeployment(root);
|
|
2710
2674
|
if (!targeted && deploymentPlatform === "void") voidPlatformDiscovery = await ensureVoidPlatformConnection(root);
|
|
2711
|
-
const githubStepSkipForSubpackage =
|
|
2675
|
+
const githubStepSkipForSubpackage = workspaceSubpackage;
|
|
2712
2676
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2713
2677
|
if (shouldSetupGithub && !githubStepSkipForSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2714
2678
|
if (!voidPlatformDiscovery) {
|
|
2715
|
-
const { getApiUrl } = await import("./auth-
|
|
2679
|
+
const { getApiUrl } = await import("./auth-BgX2qYSY.mjs");
|
|
2716
2680
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2717
2681
|
}
|
|
2718
2682
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -2737,8 +2701,8 @@ async function runInitCommand(root, initArgs) {
|
|
|
2737
2701
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2738
2702
|
if (scaffoldResult.written) {
|
|
2739
2703
|
const rel = relative(root, scaffoldResult.written) || "env.ts";
|
|
2740
|
-
if (scaffoldResult.entries.length > 0) log.
|
|
2741
|
-
else log.
|
|
2704
|
+
if (scaffoldResult.entries.length > 0) log.step(`Scaffolded ${rel} from .env — review inferred types before running dev.`);
|
|
2705
|
+
else log.step(`Created empty ${rel} — add your env keys with \`defineEnv({...})\`.`);
|
|
2742
2706
|
}
|
|
2743
2707
|
}
|
|
2744
2708
|
if (scaffoldAddedDependencies) installProjectDependencies(root, state.packageManager);
|
|
@@ -2749,9 +2713,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2749
2713
|
}
|
|
2750
2714
|
if (gitInitialized) log.info(`Git (optional): ${initialCommitCommand(root)}`);
|
|
2751
2715
|
if (workspaceSubpackageSkip) {
|
|
2752
|
-
if (scaffoldedStarterMode)
|
|
2753
|
-
else
|
|
2754
|
-
} else
|
|
2716
|
+
if (scaffoldedStarterMode) printSuccess("Project initialized. Run your workspace install, then `void db generate` to finish setup.");
|
|
2717
|
+
else printSuccess("Project initialized. Run your workspace install to finish setup.");
|
|
2718
|
+
} else printSuccess(`Project initialized. Run \`${getDevCommand(root, framework)}\` to start developing.`);
|
|
2755
2719
|
}
|
|
2756
2720
|
//#endregion
|
|
2757
2721
|
export { parseInitArgs, runInitCommand };
|