void 0.26.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-CDry3B5V.mjs → account-cmd-CfUXh_nU.mjs} +8 -7
- package/dist/{application-analysis-DC2yPvzY.mjs → application-analysis-DKy02UY0.mjs} +21 -32
- package/dist/{application-routing-C9khgLiS.mjs → application-routing-DQyUh_5S.mjs} +1 -1
- package/dist/{auth-D52yG7hl.mjs → auth-B5_tZLxT.mjs} +7 -7
- package/dist/{auth-B60QDbjg.mjs → auth-BgX2qYSY.mjs} +1 -1
- package/dist/{auth-link-DjeOptYi.mjs → auth-link-D5RmKnzh.mjs} +5 -5
- package/dist/{auth-migrations-9vif1uj8.mjs → auth-migrations-BwHgeEsD.mjs} +8 -18
- package/dist/{auth-router-BRxIuqDi.mjs → auth-router-Bap-pvbn.mjs} +4 -17
- 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-Ce3C8huo.mjs → build-cmd-B58c8iS8.mjs} +7 -6
- package/dist/{cache-CS8Yxr5a.mjs → cache-Bo52trKF.mjs} +7 -7
- package/dist/{cancel-deploy-mZsD88Xa.mjs → cancel-deploy-BZNz3Q26.mjs} +5 -4
- package/dist/{cf-access-YTlqvAsk.mjs → cf-access-ngGqZpHZ.mjs} +10 -11
- 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.mjs +5 -6
- package/dist/client-By4JjMw_.mjs +2 -0
- package/dist/{client-mC-dFGDD.mjs → client-C2Prx_Bi.mjs} +28 -6
- 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-DoQrVHAt.mjs → cloudflare-operations-BlYLlowZ.mjs} +1 -1
- package/dist/{cloudflare-operations-DYa3coIk.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-H6EvP62X.mjs → connect-X0MUA1gk.mjs} +10 -9
- package/dist/{create-project-B2kk9Q0o.mjs → create-project-DxiyW6iX.mjs} +6 -6
- package/dist/{create-project-Dbb4uiN-.mjs → create-project-iwkbqiBU.mjs} +1 -1
- package/dist/{db-DpCKZto0.mjs → db-XnVMHzoV.mjs} +100 -132
- package/dist/{delete-CxlSvsvW.mjs → delete-esYlMiSJ.mjs} +6 -6
- package/dist/{deploy-CeEbnv4b.mjs → deploy-BsEvnlJl.mjs} +2346 -2495
- 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-B_9VgOm6.mjs → domain-CbbBWhWE.mjs} +28 -29
- package/dist/{dotenv-VQxupEUv.mjs → dotenv-BfU6eqFt.mjs} +20 -32
- package/dist/{drizzle-Beb2Am5S.mjs → drizzle-CF84FOVM.mjs} +16 -13
- package/dist/{email-BokHgjKj.mjs → email-CpuT42g7.mjs} +23 -18
- 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-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-BdTc-K2L.mjs → env-w9jOyGZn.mjs} +9 -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-Nm3hkZbT.mjs → fetch-stream-PGgz4uGz.mjs} +18 -23
- package/dist/{fetch-stream-Bjf0hoZb.d.mts → fetch-stream-obvZ7fvO.d.mts} +1 -16
- package/dist/{gen-BhDlTpwW.mjs → gen-DtkQhvQg.mjs} +40 -57
- package/dist/gen-dA9hW7AV.mjs +2 -0
- package/dist/{github-cmd-hhkTzlGS.mjs → github-cmd-D_FsOFxq.mjs} +64 -163
- package/dist/{handler-DghKr6dU.mjs → handler-BHAn2fZJ.mjs} +1 -0
- package/dist/{handler-BeK3weD4.d.mts → handler-CNAwjRcW.d.mts} +4 -11
- 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-Bv44e2tm.mjs → help-CVFBTmBx.mjs} +13 -32
- 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 +617 -530
- package/dist/{info-DhtTKh65.mjs → info-PYWwkWyt.mjs} +4 -4
- package/dist/{init-BMf4T03q.mjs → init-Bw-fRKGp.mjs} +160 -197
- package/dist/{link-BqYsSS_I.mjs → link-DlPG8iX3.mjs} +9 -9
- package/dist/{list-_kBToO-l.mjs → list-2GN7_ueV.mjs} +8 -7
- package/dist/{live-CB1y5IuC.mjs → live-CgQuTpqD.mjs} +15 -16
- package/dist/{live-iAuEH1hd.d.mts → live-Du8jXwOW.d.mts} +4 -2
- package/dist/{local-d1-fGxYrVD6.mjs → local-d1-ga5O_idV.mjs} +2 -2
- package/dist/{login-DFuo-RWO.mjs → login-D-Q4xw3Q.mjs} +7 -7
- package/dist/login-Dc-wuTDq.mjs +2 -0
- package/dist/{logs-DYgnh6dH.mjs → logs-rd8J-OFh.mjs} +27 -10
- 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-C6Q6e1Es.mjs → node-DJicPvPj.mjs} +5 -5
- package/dist/{operator-args-DdY54Bgb.mjs → operator-args-BNsW5gfp.mjs} +10 -1
- package/dist/{operator-auth-2dsGlTT5.mjs → operator-auth-AzVLbrr3.mjs} +1 -1
- package/dist/{operator-client-BFqpp6z0.mjs → operator-client-BQtzyG-g.mjs} +1 -1
- package/dist/{operator-cmd-CUGHXrQf.mjs → operator-cmd-B6f6Cg9Z.mjs} +24 -11
- package/dist/operator-cmd-Cwn50lOV.mjs +2 -0
- package/dist/{output-BvdaehtE.mjs → output-C50ag2r3.mjs} +20 -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-CJGEeTEI.mjs → plan-BhLO2p4w.mjs} +2 -1
- package/dist/plan-CH2G51je.mjs +2 -0
- package/dist/{platform-args-DSV2p4nY.mjs → platform-args-BoZkWQnJ.mjs} +1 -1
- package/dist/platform-args-DYgITk0D.mjs +2 -0
- package/dist/{platform-auth-config-Bosx7U1h.mjs → platform-auth-config-n603OANg.mjs} +40 -36
- package/dist/{platform-auth-protection-DcbL_LW_.mjs → platform-auth-protection-zxDr0hWW.mjs} +8 -7
- package/dist/{platform-auth-recovery-WfTZ8K6o.mjs → platform-auth-recovery-tw9lgtgE.mjs} +7 -6
- package/dist/{platform-cmd-DbKtQb_4.mjs → platform-cmd-B8-bCb7t.mjs} +10 -10
- package/dist/{platform-cmd-dyFUof0t.mjs → platform-cmd-C00YM14r.mjs} +1 -1
- package/dist/{platform-domain-Bsq43AJp.mjs → platform-domain-p0kobLV8.mjs} +5 -5
- package/dist/{platform-lifecycle-Cfi0o6xM.mjs → platform-lifecycle-D_QEY32D.mjs} +75 -386
- package/dist/{platform-lifecycle--5gWmDoI.mjs → platform-lifecycle-vFqtNPPa.mjs} +1 -1
- package/dist/{platform-management-BrF9STZp.mjs → platform-management-BdYblvvE.mjs} +6 -6
- package/dist/{platform-management-Bbwf6-Dq.mjs → platform-management-oi-SvI3f.mjs} +1 -1
- package/dist/{platform-plans-config-DU-8nC2Y.mjs → platform-plans-config-CjiFv5J4.mjs} +5 -4
- package/dist/{platform-recovery-DQAqAQYu.mjs → platform-recovery-PvNS9Nl2.mjs} +2 -2
- 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-WoUubFKL.mjs → prepare-Do96654b.mjs} +8 -8
- package/dist/{prepare-BMrRWLwP.mjs → prepare-Dq9hTIbo.mjs} +4 -4
- package/dist/{prerender-render-D9qbLs2f.mjs → prerender-render-Ct20jftc.mjs} +17 -3
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-BbH2LptN.mjs → project-cmd-ti8_yTcA.mjs} +18 -18
- package/dist/{project-team-Yiww3-go.mjs → project-team-CDPE1Tsg.mjs} +14 -17
- package/dist/{project-token-BrtT2NkY.mjs → project-token-CkZ1cN0Z.mjs} +13 -16
- package/dist/{project-tsconfig-B8GeM0RM.mjs → project-tsconfig-CVJhNMxs.mjs} +2 -1
- package/dist/{project-zero-trust-nYJ2V2nc.mjs → project-zero-trust-DdjLR61k.mjs} +11 -8
- package/dist/{protocol-BX8t2jiw.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-VeqAC77A.mjs → provision-BfaLiWbj.mjs} +38 -41
- package/dist/{provision-DMTPG8Rh.mjs → provision-Wu9ZBk9L.mjs} +2 -3
- package/dist/{requests-TIz_jtSu.mjs → requests-DFAqyYy8.mjs} +4 -4
- package/dist/resolve-project-BIeYs9Cw.mjs +2 -0
- package/dist/{resolve-project-BG5ORGID.mjs → resolve-project-CP8rZs_p.mjs} +6 -1
- package/dist/{rollback-dBqICPzj.mjs → rollback-BKYXBduI.mjs} +29 -36
- 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--2KF6Kua.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 +1 -1
- package/dist/runtime/ai.mjs +34 -95
- 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.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/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 +4 -81
- 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.mjs +2 -2
- 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/{scan-C8dA7iM4.mjs → scan-C3uDzz6J.mjs} +12 -13
- package/dist/{secret-AKnNXNP5.mjs → secret-BAt2KMmO.mjs} +14 -14
- package/dist/{skills-BPQUGClu.mjs → skills-BgVMvQdy.mjs} +2 -2
- package/dist/{sse-CQNaDFFV.mjs → sse-CMvCgjNk.mjs} +1 -1
- package/dist/{subcommand-prompt-B6WS9Aoz.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-ymhap6M_.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-C79j4aED.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 +5 -3
- 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/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 +10 -5
- package/{skills/void/docs → docs}/guide/pages-routing/actions-and-forms.md +20 -8
- 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/domains.md +3 -1
- package/{skills/void/docs → docs}/guide/platform/installation/first-deployment.md +3 -1
- package/{skills/void/docs → docs}/guide/platform/installation/maintenance.md +4 -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 +2 -2
- 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/cli/auth.md +0 -5
- 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 +1 -1
- package/{skills/void/docs → docs}/reference/cli/platform-email.md +2 -3
- package/{skills/void/docs → docs}/reference/cli/platform-installation.md +1 -1
- 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/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 +1 -1
- package/{skills/void/docs → docs}/reference/config.md +13 -13
- package/{skills/void/docs → docs}/reference/resource-inference.md +1 -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 +6 -3
- package/dist/cf-build-output-ChY6-XWP.mjs +0 -2
- package/dist/client-BxVixJBI.mjs +0 -2
- package/dist/config-0acf1oys.mjs +0 -2
- package/dist/config-D8MOgiQV.mjs +0 -32
- package/dist/deploy-qmiLE1G1.mjs +0 -2
- package/dist/discover-AMCBXivQ.mjs +0 -2
- package/dist/fetch-error-Sp1R4mZv.d.mts +0 -20
- package/dist/gen-qCBwH3fZ.mjs +0 -2
- package/dist/help-Dw5f9Xrg.mjs +0 -2
- package/dist/login-D7meQg_3.mjs +0 -2
- package/dist/migrate-CEu2X5DB.mjs +0 -2
- package/dist/operator-cmd-DRPvhpjM.mjs +0 -2
- package/dist/plan-COtUvdMA.mjs +0 -2
- package/dist/platform-args-Dcy_5b_Y.mjs +0 -2
- package/dist/prepare-BBknoZI1.mjs +0 -2
- package/dist/resolve-project-DtbidV4y.mjs +0 -2
- package/dist/route-url-CG7U-cRN.mjs +0 -15
- package/dist/runner-voIltZrY.mjs +0 -2
- package/dist/validate-pna7R3Pv.mjs +0 -2
- 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/app-types.md +0 -0
- 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/database.md +8 -8
- 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/credentials.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/prerequisites.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/setup.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/uninstall.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/resources.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/api.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/cli/platform.md +0 -0
- /package/{skills/void/docs → docs}/reference/structure.md +0 -0
|
@@ -1,27 +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-
|
|
4
|
+
import { m as readConfig, u as getDatabaseDialect } from "./config-DiowPT80.mjs";
|
|
5
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-
|
|
7
|
-
import {
|
|
8
|
-
import { c as getToken } from "./auth-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
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 {
|
|
18
|
-
import {
|
|
19
|
-
import { t as
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-BV4AzNul.mjs";
|
|
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";
|
|
25
25
|
import { createRequire } from "node:module";
|
|
26
26
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
27
27
|
import { fileURLToPath } from "node:url";
|
|
@@ -30,13 +30,6 @@ import { parse } from "jsonc-parser";
|
|
|
30
30
|
import { parseArgs } from "node:util";
|
|
31
31
|
import { spawnSync } from "node:child_process";
|
|
32
32
|
//#region src/cli/deploy-setup.ts
|
|
33
|
-
async function ensureToken(root) {
|
|
34
|
-
const existing = getToken(root);
|
|
35
|
-
if (existing) return existing;
|
|
36
|
-
const token = await promptForLoginToken(root);
|
|
37
|
-
log.success("Token saved.");
|
|
38
|
-
return token;
|
|
39
|
-
}
|
|
40
33
|
async function maybeSetupDeployProject(root) {
|
|
41
34
|
const existing = readProjectConfig(root);
|
|
42
35
|
if (existing) {
|
|
@@ -50,7 +43,11 @@ async function maybeSetupDeployProject(root) {
|
|
|
50
43
|
process.exit(0);
|
|
51
44
|
}
|
|
52
45
|
if (!shouldSetup) return null;
|
|
53
|
-
|
|
46
|
+
let token = existingToken;
|
|
47
|
+
if (!token) {
|
|
48
|
+
token = await promptForLoginToken(root);
|
|
49
|
+
log.step("Token saved.");
|
|
50
|
+
}
|
|
54
51
|
const client = new PlatformClient(token, { root });
|
|
55
52
|
const projects = await client.listProjects();
|
|
56
53
|
if (projects.length === 0) return promptAndCreateProject(root, client);
|
|
@@ -61,7 +58,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
61
58
|
slug: result.project.slug
|
|
62
59
|
};
|
|
63
60
|
writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
64
|
-
log.
|
|
61
|
+
log.step(`Linked project: ${config.slug}`);
|
|
65
62
|
return config;
|
|
66
63
|
}
|
|
67
64
|
return promptAndCreateProject(root, client);
|
|
@@ -79,8 +76,6 @@ async function maybeSetupDeployProject(root) {
|
|
|
79
76
|
* This is a best-effort DX sweetener, not a correctness boundary — a
|
|
80
77
|
* wrong guess only costs the user a single-line edit.
|
|
81
78
|
*/
|
|
82
|
-
/** Void has one local dotenv source. */
|
|
83
|
-
const SCAFFOLD_SOURCE_FILES = [".env"];
|
|
84
79
|
const BOOLEAN_LITERAL = /^(true|false)$/i;
|
|
85
80
|
const HTTP_URL = /^https?:\/\/\S+$/;
|
|
86
81
|
const SMALL_INTEGER = /^(?:0|[1-9]\d{0,4})$/;
|
|
@@ -98,34 +93,13 @@ function inferHelperForValue(value) {
|
|
|
98
93
|
if (SMALL_INTEGER.test(trimmed)) return "number";
|
|
99
94
|
return "string";
|
|
100
95
|
}
|
|
101
|
-
/** Collect
|
|
96
|
+
/** Collect the inferred entries from the local `.env`, sorted by key. */
|
|
102
97
|
function collectInferredEntries(root) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
...parsed,
|
|
109
|
-
...cumulative
|
|
110
|
-
};
|
|
111
|
-
const expanded = expandDotenv(expansionView);
|
|
112
|
-
for (const key of Object.keys(parsed)) {
|
|
113
|
-
const value = expanded[key] ?? "";
|
|
114
|
-
if (!(key in cumulative)) cumulative[key] = parsed[key];
|
|
115
|
-
const existing = seen.get(key);
|
|
116
|
-
if (!existing) seen.set(key, {
|
|
117
|
-
key,
|
|
118
|
-
helper: inferHelperForValue(value),
|
|
119
|
-
sampleValue: value || void 0
|
|
120
|
-
});
|
|
121
|
-
else if (!existing.sampleValue && value) seen.set(key, {
|
|
122
|
-
key,
|
|
123
|
-
helper: inferHelperForValue(value),
|
|
124
|
-
sampleValue: value
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
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
|
+
}));
|
|
129
103
|
}
|
|
130
104
|
/**
|
|
131
105
|
* Render the scaffolded `env.ts` body. The imports are pulled in lazily
|
|
@@ -165,27 +139,17 @@ function renderEnvTs(entries) {
|
|
|
165
139
|
* no-ops when `env.ts` is present. Never overwrites an existing file.
|
|
166
140
|
*/
|
|
167
141
|
function maybeScaffoldEnvTs(root) {
|
|
168
|
-
for (const
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
]) if (existsSync(join(root,
|
|
174
|
-
written: null,
|
|
175
|
-
skipReason: "env-ts-exists",
|
|
176
|
-
entries: []
|
|
177
|
-
};
|
|
178
|
-
for (const candidate of [
|
|
179
|
-
"src/env.ts",
|
|
180
|
-
"src/env.mts",
|
|
181
|
-
"src/env.js",
|
|
182
|
-
"src/env.mjs"
|
|
183
|
-
]) 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 {
|
|
184
148
|
written: null,
|
|
185
149
|
skipReason: "env-ts-exists",
|
|
186
150
|
entries: []
|
|
187
151
|
};
|
|
188
|
-
if (!
|
|
152
|
+
if (!existsSync(join(root, ".env"))) return {
|
|
189
153
|
written: null,
|
|
190
154
|
skipReason: "no-dotenv-files",
|
|
191
155
|
entries: []
|
|
@@ -777,7 +741,6 @@ function parseInitArgs(args) {
|
|
|
777
741
|
options: {
|
|
778
742
|
tsconfig: { type: "boolean" },
|
|
779
743
|
github: { type: "boolean" },
|
|
780
|
-
agents: { type: "boolean" },
|
|
781
744
|
git: { type: "boolean" }
|
|
782
745
|
},
|
|
783
746
|
allowNegative: true,
|
|
@@ -790,7 +753,6 @@ function parseInitArgs(args) {
|
|
|
790
753
|
return {
|
|
791
754
|
tsconfig: parsed.values.tsconfig === true,
|
|
792
755
|
github: parsed.values.github === true,
|
|
793
|
-
agents: parsed.values.agents === true,
|
|
794
756
|
git: parsed.values.git
|
|
795
757
|
};
|
|
796
758
|
}
|
|
@@ -920,12 +882,15 @@ function getOwnConfigBaseUrlDir(config, configDir) {
|
|
|
920
882
|
const compilerOptions = asRecord(config.compilerOptions);
|
|
921
883
|
return compilerOptions && typeof compilerOptions.baseUrl === "string" ? resolve(configDir, compilerOptions.baseUrl) : null;
|
|
922
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
|
+
}
|
|
923
888
|
function getEffectiveConfigBaseUrlDir(config, configPath, seen) {
|
|
924
889
|
if (seen.has(configPath)) return null;
|
|
925
890
|
seen.add(configPath);
|
|
926
891
|
const ownBaseUrl = getOwnConfigBaseUrlDir(config, dirname(configPath));
|
|
927
892
|
if (ownBaseUrl) return ownBaseUrl;
|
|
928
|
-
const extendsValues =
|
|
893
|
+
const extendsValues = readExtends(config);
|
|
929
894
|
let inheritedBaseUrl = null;
|
|
930
895
|
for (const extendsValue of extendsValues) {
|
|
931
896
|
const extendedPath = resolveExtendedTsconfig(configPath, extendsValue);
|
|
@@ -985,7 +950,7 @@ function collectTsconfigPatchFromConfig(config, configPath, root, outputBaseDir,
|
|
|
985
950
|
};
|
|
986
951
|
if (seen.has(configPath)) return patch;
|
|
987
952
|
seen.add(configPath);
|
|
988
|
-
const extendsValues =
|
|
953
|
+
const extendsValues = readExtends(config);
|
|
989
954
|
const hasOwnFiles = Array.isArray(config.files);
|
|
990
955
|
const compilerOptions = asRecord(config.compilerOptions);
|
|
991
956
|
const hasOwnPaths = asRecord(compilerOptions?.paths) !== null;
|
|
@@ -1140,7 +1105,7 @@ function parsePackageManagerField(pkg) {
|
|
|
1140
1105
|
* pnpm markers is still pnpm-managed if the enclosing workspace root has
|
|
1141
1106
|
* `pnpm-workspace.yaml`, a `pnpm-lock.yaml`, or `packageManager: pnpm@...`.
|
|
1142
1107
|
*
|
|
1143
|
-
*
|
|
1108
|
+
* Local non-pnpm signals MUST outrank the ancestor walk. A bun
|
|
1144
1109
|
* or yarn subproject nested under a pnpm workspace ancestor is still
|
|
1145
1110
|
* bun/yarn — its local `bun.lockb` / `yarn.lock` / `package-lock.json` or
|
|
1146
1111
|
* a local Corepack pin for bun/yarn/npm proves the ancestor's pnpm shape
|
|
@@ -1154,7 +1119,7 @@ function isPnpmProject(root, pkg) {
|
|
|
1154
1119
|
const localPm = parsePackageManagerField(pkg);
|
|
1155
1120
|
if (localPm === "pnpm") return true;
|
|
1156
1121
|
if (localPm === "bun" || localPm === "yarn" || localPm === "npm") return false;
|
|
1157
|
-
if (
|
|
1122
|
+
if (hasLocalLockfile(root)) return false;
|
|
1158
1123
|
return hasAncestorPnpmMarkers(root);
|
|
1159
1124
|
}
|
|
1160
1125
|
/**
|
|
@@ -1163,14 +1128,13 @@ function isPnpmProject(root, pkg) {
|
|
|
1163
1128
|
* workspace root is pnpm-managed even when the subpackage has no local
|
|
1164
1129
|
* pnpm signals.
|
|
1165
1130
|
*
|
|
1166
|
-
*
|
|
1131
|
+
* An ancestor `pnpm-workspace.yaml` / `pnpm-lock.yaml` /
|
|
1167
1132
|
* Corepack pnpm pin alone is NOT proof that `start` is governed by
|
|
1168
1133
|
* that repo's pnpm install. A scratch app nested under a pnpm
|
|
1169
1134
|
* monorepo is a separate project when its path doesn't match the
|
|
1170
|
-
* workspace globs
|
|
1171
|
-
* `ensureVoidDependency` / `scaffoldPagesApp`
|
|
1172
|
-
*
|
|
1173
|
-
* 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.
|
|
1174
1138
|
*
|
|
1175
1139
|
* Delegate workspace membership to `findWorkspaceRoot` +
|
|
1176
1140
|
* `isWorkspaceSubpackage` — the same check used by the
|
|
@@ -1205,14 +1169,13 @@ function hasAncestorPnpmMarkers(start) {
|
|
|
1205
1169
|
* subpackage's `package.json` (or verified it was already there), and
|
|
1206
1170
|
* under PnP the workspace-root install is what wires up resolution.
|
|
1207
1171
|
*
|
|
1208
|
-
*
|
|
1172
|
+
* A committed-but-unfetched `.pnp.cjs` is NOT proof that
|
|
1209
1173
|
* `yarn install` has run. Yarn Berry repos commonly commit `.pnp.cjs`
|
|
1210
1174
|
* but gitignore `.yarn/cache/*.zip` (zero-install is opt-in), so a
|
|
1211
1175
|
* fresh clone has the runtime file on disk while the archives it
|
|
1212
1176
|
* points at are missing. The stricter `findInstalledYarnPnpRuntime`
|
|
1213
|
-
* also requires
|
|
1214
|
-
*
|
|
1215
|
-
* 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,
|
|
1216
1179
|
* we fall through and return false so the caller triggers the install
|
|
1217
1180
|
* step before attempting to spawn drizzle-kit.
|
|
1218
1181
|
*/
|
|
@@ -1305,12 +1268,8 @@ function readWorkspacePatterns(workspaceRoot) {
|
|
|
1305
1268
|
* whitespace (or is the first column) AND it is not inside a quoted
|
|
1306
1269
|
* scalar. Flow-style inline quoting is handled by a plain state machine
|
|
1307
1270
|
* — no escape sequence support, because real-world workspace globs
|
|
1308
|
-
* never contain escaped quotes.
|
|
1309
|
-
*
|
|
1310
|
-
* This replaces the original `/\s+#.*$/` strip which was greedy and
|
|
1311
|
-
* would truncate legitimate quoted values like `- "path #hash/*"`,
|
|
1312
|
-
* leaving a broken glob that silently failed
|
|
1313
|
-
* `isWorkspaceSubpackage` membership.
|
|
1271
|
+
* never contain escaped quotes. A naive `/\s+#.*$/` strip would
|
|
1272
|
+
* truncate quoted values like `- "path #hash/*"`.
|
|
1314
1273
|
*/
|
|
1315
1274
|
function stripYamlLineComment(line) {
|
|
1316
1275
|
let inSingle = false;
|
|
@@ -1541,13 +1500,14 @@ function detectProjectState(root) {
|
|
|
1541
1500
|
if (field === "pnpm" || field === "yarn" || field === "bun") packageManager = field;
|
|
1542
1501
|
else packageManager = "npm";
|
|
1543
1502
|
}
|
|
1503
|
+
const paths = readProjectPaths(root);
|
|
1544
1504
|
return {
|
|
1545
1505
|
hasTypescript,
|
|
1546
1506
|
hasTsconfig: existsSync(join(root, "tsconfig.json")),
|
|
1547
1507
|
hasGithubWorkflows: existsSync(join(root, ".github", "workflows")),
|
|
1548
|
-
hasRoutes: existsSync(
|
|
1549
|
-
hasMigrations: existsSync(
|
|
1550
|
-
hasPages: existsSync(
|
|
1508
|
+
hasRoutes: existsSync(paths.routesDir),
|
|
1509
|
+
hasMigrations: existsSync(paths.migrationsDir) || existsSync(join(root, "migrations")),
|
|
1510
|
+
hasPages: existsSync(paths.pagesDir),
|
|
1551
1511
|
packageManager,
|
|
1552
1512
|
typescriptWanted: hasTypescript
|
|
1553
1513
|
};
|
|
@@ -1560,15 +1520,12 @@ function hasDrizzleSchema(root) {
|
|
|
1560
1520
|
return existsSync(paths.schemaFile) || existsSync(paths.schemaDir);
|
|
1561
1521
|
}
|
|
1562
1522
|
function detectPagesFramework(root) {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
} catch {
|
|
1570
|
-
return;
|
|
1571
|
-
}
|
|
1523
|
+
const pkg = readPackageJson(root);
|
|
1524
|
+
if (!pkg) return;
|
|
1525
|
+
return detectScaffoldFrameworkFromDependencies({
|
|
1526
|
+
...asRecord(pkg.dependencies) ?? {},
|
|
1527
|
+
...asRecord(pkg.devDependencies) ?? {}
|
|
1528
|
+
});
|
|
1572
1529
|
}
|
|
1573
1530
|
function readPackageJson(root) {
|
|
1574
1531
|
try {
|
|
@@ -1592,9 +1549,10 @@ function getDeclaredDependencySpec(root, packageName) {
|
|
|
1592
1549
|
}
|
|
1593
1550
|
}
|
|
1594
1551
|
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1552
|
+
return getDeclaredDependencySpec(root, packageName) || fallbackVersion;
|
|
1553
|
+
}
|
|
1554
|
+
function defaultPackageName(root) {
|
|
1555
|
+
return basename(root).toLowerCase().replace(/[^a-z0-9-]/g, "-") || "my-app";
|
|
1598
1556
|
}
|
|
1599
1557
|
function setupTsconfig(root, state, pagesFramework) {
|
|
1600
1558
|
const tsconfigPath = join(root, "tsconfig.json");
|
|
@@ -1619,7 +1577,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1619
1577
|
else if (Array.isArray(extendsValue)) tsconfig.extends = [...extendsValue, target];
|
|
1620
1578
|
else tsconfig.extends = target;
|
|
1621
1579
|
updated = true;
|
|
1622
|
-
log.
|
|
1580
|
+
log.step("Updated tsconfig.json — added extends .void/tsconfig.json");
|
|
1623
1581
|
}
|
|
1624
1582
|
const compilerOptions = asRecord(tsconfig.compilerOptions) ?? {};
|
|
1625
1583
|
tsconfig.compilerOptions = compilerOptions;
|
|
@@ -1627,13 +1585,13 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1627
1585
|
if (!types.includes("void/env")) {
|
|
1628
1586
|
types.push("void/env");
|
|
1629
1587
|
updated = true;
|
|
1630
|
-
log.
|
|
1588
|
+
log.step("Updated tsconfig.json — added void/env to types");
|
|
1631
1589
|
}
|
|
1632
1590
|
const cfIdx = types.indexOf("@cloudflare/workers-types");
|
|
1633
1591
|
if (cfIdx !== -1) {
|
|
1634
1592
|
types.splice(cfIdx, 1);
|
|
1635
1593
|
updated = true;
|
|
1636
|
-
log.
|
|
1594
|
+
log.step("Removed @cloudflare/workers-types from tsconfig types (included in void/env)");
|
|
1637
1595
|
}
|
|
1638
1596
|
compilerOptions.types = types;
|
|
1639
1597
|
const existingFiles = uniqueStrings(existingPatch.files);
|
|
@@ -1642,7 +1600,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1642
1600
|
if (JSON.stringify(tsconfig.files) !== JSON.stringify(files)) {
|
|
1643
1601
|
tsconfig.files = files;
|
|
1644
1602
|
updated = true;
|
|
1645
|
-
log.
|
|
1603
|
+
log.step("Updated tsconfig.json — merged generated Void type files");
|
|
1646
1604
|
}
|
|
1647
1605
|
}
|
|
1648
1606
|
if (Object.keys(existingPatch.paths).length > 0 || asRecord(compilerOptions.paths) !== null) {
|
|
@@ -1652,7 +1610,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1652
1610
|
if (JSON.stringify(existingPaths) !== JSON.stringify(paths)) {
|
|
1653
1611
|
compilerOptions.paths = paths;
|
|
1654
1612
|
updated = true;
|
|
1655
|
-
log.
|
|
1613
|
+
log.step("Updated tsconfig.json — merged generated Void path aliases");
|
|
1656
1614
|
}
|
|
1657
1615
|
}
|
|
1658
1616
|
if (updated) {
|
|
@@ -1662,7 +1620,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1662
1620
|
...rest
|
|
1663
1621
|
};
|
|
1664
1622
|
writeFileSync(tsconfigPath, JSON.stringify(ordered, null, 2) + "\n");
|
|
1665
|
-
} else log.
|
|
1623
|
+
} else log.step("tsconfig.json looks good");
|
|
1666
1624
|
try {
|
|
1667
1625
|
const pkgPath = join(root, "package.json");
|
|
1668
1626
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
@@ -1677,7 +1635,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1677
1635
|
}
|
|
1678
1636
|
if (pkgUpdated) {
|
|
1679
1637
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
1680
|
-
log.
|
|
1638
|
+
log.step("Removed @cloudflare/workers-types from package.json (included in void/env)");
|
|
1681
1639
|
log.info(`Re-run ${state.packageManager} install to update your lockfile`);
|
|
1682
1640
|
}
|
|
1683
1641
|
} catch {}
|
|
@@ -1705,21 +1663,18 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1705
1663
|
]
|
|
1706
1664
|
};
|
|
1707
1665
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
1708
|
-
log.
|
|
1666
|
+
log.step("Created tsconfig.json");
|
|
1709
1667
|
if (!state.hasTypescript) log.info("Don't forget to install typescript");
|
|
1710
1668
|
}
|
|
1711
1669
|
}
|
|
1712
1670
|
function readProjectWranglerCompatDate(root) {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
if (typeof parsed?.compatibility_date === "string") return parsed.compatibility_date;
|
|
1721
|
-
} catch {}
|
|
1722
|
-
}
|
|
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 {}
|
|
1723
1678
|
}
|
|
1724
1679
|
/**
|
|
1725
1680
|
* Ensure wrangler.jsonc exists with `compatibility_date` and `nodejs_als` flag
|
|
@@ -1732,11 +1687,8 @@ function setupWranglerConfig(root, framework) {
|
|
|
1732
1687
|
compatibilityDate: LATEST_KNOWN_COMPAT_DATE,
|
|
1733
1688
|
compatibilityFlags: ["nodejs_als"]
|
|
1734
1689
|
});
|
|
1735
|
-
if (result.modified) log.
|
|
1736
|
-
else log.
|
|
1737
|
-
}
|
|
1738
|
-
function writeVoidConfig(root, config) {
|
|
1739
|
-
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`);
|
|
1740
1692
|
}
|
|
1741
1693
|
function ensureVoidWorkerCompatibilityDate(root) {
|
|
1742
1694
|
const config = readConfig(root);
|
|
@@ -1746,15 +1698,15 @@ function ensureVoidWorkerCompatibilityDate(root) {
|
|
|
1746
1698
|
const compatibilityDate = readProjectWranglerCompatDate(root) ?? "2026-02-24";
|
|
1747
1699
|
if (!canRewriteVoidProjectConfig(root)) {
|
|
1748
1700
|
writeProvisionedWranglerConfig(root, { compatibilityDate });
|
|
1749
|
-
log.
|
|
1701
|
+
log.step("Pinned worker compatibility_date in void.lock.json");
|
|
1750
1702
|
return;
|
|
1751
1703
|
}
|
|
1752
1704
|
config.worker = {
|
|
1753
1705
|
...worker,
|
|
1754
1706
|
compatibility_date: compatibilityDate
|
|
1755
1707
|
};
|
|
1756
|
-
|
|
1757
|
-
log.
|
|
1708
|
+
writeVoidProjectConfig(root, config);
|
|
1709
|
+
log.step("Pinned worker compatibility_date in void.config.ts");
|
|
1758
1710
|
}
|
|
1759
1711
|
function clearConfiguredDatabase(root, messages) {
|
|
1760
1712
|
const config = readConfig(root);
|
|
@@ -1763,8 +1715,8 @@ function clearConfiguredDatabase(root, messages) {
|
|
|
1763
1715
|
return;
|
|
1764
1716
|
}
|
|
1765
1717
|
delete config.database;
|
|
1766
|
-
|
|
1767
|
-
log.
|
|
1718
|
+
writeVoidProjectConfig(root, config);
|
|
1719
|
+
log.step(messages.updated);
|
|
1768
1720
|
}
|
|
1769
1721
|
function applyDatabaseDialect(root, dialect) {
|
|
1770
1722
|
const config = readConfig(root);
|
|
@@ -1774,8 +1726,8 @@ function applyDatabaseDialect(root, dialect) {
|
|
|
1774
1726
|
return;
|
|
1775
1727
|
}
|
|
1776
1728
|
config.database = "pg";
|
|
1777
|
-
|
|
1778
|
-
log.
|
|
1729
|
+
writeVoidProjectConfig(root, config);
|
|
1730
|
+
log.step("Configured PostgreSQL in void.config.ts");
|
|
1779
1731
|
return;
|
|
1780
1732
|
}
|
|
1781
1733
|
if (dialect === "mysql") {
|
|
@@ -1784,8 +1736,8 @@ function applyDatabaseDialect(root, dialect) {
|
|
|
1784
1736
|
return;
|
|
1785
1737
|
}
|
|
1786
1738
|
config.database = "mysql";
|
|
1787
|
-
|
|
1788
|
-
log.
|
|
1739
|
+
writeVoidProjectConfig(root, config);
|
|
1740
|
+
log.step("Configured MySQL in void.config.ts");
|
|
1789
1741
|
return;
|
|
1790
1742
|
}
|
|
1791
1743
|
clearConfiguredDatabase(root, {
|
|
@@ -1933,7 +1885,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1933
1885
|
let selectedApiUrl = null;
|
|
1934
1886
|
let promptedForPlatform = false;
|
|
1935
1887
|
try {
|
|
1936
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1888
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-BgX2qYSY.mjs");
|
|
1937
1889
|
selectedApiUrl = getApiUrl(root);
|
|
1938
1890
|
getSiteDomain(root);
|
|
1939
1891
|
} catch (error) {
|
|
@@ -1953,7 +1905,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1953
1905
|
}
|
|
1954
1906
|
const discovery = await discoverPlatform(selectedApiUrl);
|
|
1955
1907
|
saveDiscoveredPlatform(discovery);
|
|
1956
|
-
if (promptedForPlatform) log.
|
|
1908
|
+
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
1957
1909
|
return discovery;
|
|
1958
1910
|
}
|
|
1959
1911
|
async function setupCloudflareDeployment(root) {
|
|
@@ -2110,7 +2062,7 @@ function setupGithubActions(root, state, platform = "void", platformApiUrl) {
|
|
|
2110
2062
|
const slug = readProjectConfig(root)?.slug ?? null;
|
|
2111
2063
|
mkdirSync(workflowDir, { recursive: true });
|
|
2112
2064
|
writeFileSync(workflowPath, getWorkflowYaml(root, state.packageManager, slug, platform, platformApiUrl));
|
|
2113
|
-
log.
|
|
2065
|
+
log.step("Created .github/workflows/void-deploy.yml");
|
|
2114
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");
|
|
2115
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");
|
|
2116
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");
|
|
@@ -2133,7 +2085,7 @@ function patchWorkflowProjectSlug(root, slug) {
|
|
|
2133
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 }}";
|
|
2134
2086
|
if (!yaml.includes(placeholderBlock)) return false;
|
|
2135
2087
|
writeFileSync(workflowPath, yaml.replace(placeholderBlock, ` VOID_PROJECT: ${slug}`));
|
|
2136
|
-
log.
|
|
2088
|
+
log.step(`Set VOID_PROJECT: ${slug} in .github/workflows/void-deploy.yml`);
|
|
2137
2089
|
return true;
|
|
2138
2090
|
}
|
|
2139
2091
|
function writeFileIfMissing(root, filePath, content) {
|
|
@@ -2141,13 +2093,13 @@ function writeFileIfMissing(root, filePath, content) {
|
|
|
2141
2093
|
if (existsSync(fullPath)) return;
|
|
2142
2094
|
mkdirSync(dirname(fullPath), { recursive: true });
|
|
2143
2095
|
writeFileSync(fullPath, content);
|
|
2144
|
-
log.
|
|
2096
|
+
log.step(`Created ${filePath}`);
|
|
2145
2097
|
}
|
|
2146
2098
|
function ensureGitignore(root) {
|
|
2147
2099
|
const gitignorePath = join(root, ".gitignore");
|
|
2148
2100
|
if (!existsSync(gitignorePath)) {
|
|
2149
2101
|
writeFileSync(gitignorePath, SCAFFOLD_GITIGNORE_LINES.join("\n") + "\n");
|
|
2150
|
-
log.
|
|
2102
|
+
log.step("Created .gitignore");
|
|
2151
2103
|
return;
|
|
2152
2104
|
}
|
|
2153
2105
|
const content = readFileSync(gitignorePath, "utf-8");
|
|
@@ -2156,7 +2108,7 @@ function ensureGitignore(root) {
|
|
|
2156
2108
|
if (missing.length === 0) return;
|
|
2157
2109
|
const separator = content.endsWith("\n") ? "" : "\n";
|
|
2158
2110
|
writeFileSync(gitignorePath, content + separator + missing.join("\n") + "\n");
|
|
2159
|
-
log.
|
|
2111
|
+
log.step("Updated .gitignore with Void defaults");
|
|
2160
2112
|
}
|
|
2161
2113
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
2162
2114
|
const lines = yaml.split(/\r?\n/);
|
|
@@ -2193,7 +2145,7 @@ function insertPnpmAllowBuilds(yaml) {
|
|
|
2193
2145
|
function resolvePnpmConfigRoot(root, pkg) {
|
|
2194
2146
|
if (existsSync(join(root, "pnpm-workspace.yaml")) || existsSync(join(root, "pnpm-lock.yaml")) || parsePackageManagerField(pkg) === "pnpm") return root;
|
|
2195
2147
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
2196
|
-
if (workspaceRoot !== void 0 &&
|
|
2148
|
+
if (workspaceRoot !== void 0 && hasAncestorPnpmMarkers(root)) return workspaceRoot;
|
|
2197
2149
|
return root;
|
|
2198
2150
|
}
|
|
2199
2151
|
function ensurePnpmAllowBuilds(root, pkg) {
|
|
@@ -2203,7 +2155,7 @@ function ensurePnpmAllowBuilds(root, pkg) {
|
|
|
2203
2155
|
const after = insertPnpmAllowBuilds(removeTopLevelYamlBlock(removeTopLevelYamlBlock(before, "onlyBuiltDependencies"), "allowBuilds"));
|
|
2204
2156
|
if (after !== before) {
|
|
2205
2157
|
writeFileSync(workspacePath, after);
|
|
2206
|
-
log.
|
|
2158
|
+
log.step(configRoot === root ? "Updated pnpm-workspace.yaml with approved builds" : `Updated ${relative(root, workspacePath)} with approved builds`);
|
|
2207
2159
|
return true;
|
|
2208
2160
|
}
|
|
2209
2161
|
return false;
|
|
@@ -2217,7 +2169,7 @@ function installProjectDependencies(root, packageManager) {
|
|
|
2217
2169
|
});
|
|
2218
2170
|
if (result.error) throw result.error;
|
|
2219
2171
|
if (result.status !== 0) throw new Error(`${packageManager} install failed with exit code ${result.status ?? "unknown"}`);
|
|
2220
|
-
log.
|
|
2172
|
+
log.step(`Installed dependencies with ${packageManager}`);
|
|
2221
2173
|
}
|
|
2222
2174
|
function generateStarterMigration(root, starterMode) {
|
|
2223
2175
|
const dialect = starterMode;
|
|
@@ -2276,7 +2228,7 @@ function generateStarterMigration(root, starterMode) {
|
|
|
2276
2228
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
2277
2229
|
throw new Error(["Failed to generate the starter database migration.", ...detail ? [detail] : []].join("\n\n"));
|
|
2278
2230
|
}
|
|
2279
|
-
log.
|
|
2231
|
+
log.step("Generated initial Drizzle migration");
|
|
2280
2232
|
}
|
|
2281
2233
|
function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchain) {
|
|
2282
2234
|
const packageJsonPath = join(root, "package.json");
|
|
@@ -2293,7 +2245,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2293
2245
|
} catch {
|
|
2294
2246
|
throw new Error("Could not parse package.json in empty project");
|
|
2295
2247
|
}
|
|
2296
|
-
const fallbackName =
|
|
2248
|
+
const fallbackName = defaultPackageName(root);
|
|
2297
2249
|
if (!pkg.name || typeof pkg.name !== "string") pkg.name = fallbackName;
|
|
2298
2250
|
if (pkg.private === void 0) pkg.private = true;
|
|
2299
2251
|
if (!pkg.type) pkg.type = "module";
|
|
@@ -2327,7 +2279,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2327
2279
|
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2328
2280
|
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@12.4.1";
|
|
2329
2281
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2330
|
-
log.
|
|
2282
|
+
log.step("Updated package.json with starter scripts and dependencies");
|
|
2331
2283
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
2332
2284
|
ensureGitignore(root);
|
|
2333
2285
|
if (starterMode !== "static") applyDatabaseDialect(root, starterMode);
|
|
@@ -2359,7 +2311,7 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2359
2311
|
throw new Error("Could not parse package.json while configuring Void");
|
|
2360
2312
|
}
|
|
2361
2313
|
}
|
|
2362
|
-
const fallbackName =
|
|
2314
|
+
const fallbackName = defaultPackageName(root);
|
|
2363
2315
|
let changed = !existedBefore;
|
|
2364
2316
|
let dependencyAdded = false;
|
|
2365
2317
|
if (!pkg.name || typeof pkg.name !== "string") {
|
|
@@ -2401,7 +2353,7 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2401
2353
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2402
2354
|
if (changed) {
|
|
2403
2355
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2404
|
-
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");
|
|
2405
2357
|
}
|
|
2406
2358
|
return {
|
|
2407
2359
|
dependencyAdded,
|
|
@@ -2456,7 +2408,7 @@ function ensureExistingProjectViteConfig(root, framework) {
|
|
|
2456
2408
|
return;
|
|
2457
2409
|
}
|
|
2458
2410
|
writeFileSync(fullPath, updated);
|
|
2459
|
-
log.
|
|
2411
|
+
log.step(`Added voidPlugin() to ${configPath}`);
|
|
2460
2412
|
}
|
|
2461
2413
|
function setupExistingProject(root, framework) {
|
|
2462
2414
|
log.info("Existing project detected. Configuring Void...");
|
|
@@ -2491,7 +2443,7 @@ export const posts = sqliteTable("posts", {
|
|
|
2491
2443
|
createdAt: text("created_at").notNull().default(sql\`(datetime('now'))\`),
|
|
2492
2444
|
});
|
|
2493
2445
|
`);
|
|
2494
|
-
log.
|
|
2446
|
+
log.step("Created db/schema.ts");
|
|
2495
2447
|
mkdirSync(join(paths.routesDir, "api"), { recursive: true });
|
|
2496
2448
|
writeFileSync(join(paths.routesDir, "api", "posts.ts"), `import { defineHandler } from "void";
|
|
2497
2449
|
import { db } from "void/db";
|
|
@@ -2502,7 +2454,7 @@ export const GET = defineHandler(async () => {
|
|
|
2502
2454
|
return db.select().from(posts);
|
|
2503
2455
|
});
|
|
2504
2456
|
`);
|
|
2505
|
-
log.
|
|
2457
|
+
log.step("Created routes/api/posts.ts");
|
|
2506
2458
|
ensureProjectTsconfig(root, void 0, true, true, { paths });
|
|
2507
2459
|
mkdirSync(paths.ssrDir, { recursive: true });
|
|
2508
2460
|
writeFileSync(join(paths.ssrDir, "demo.ts"), `import { fetch } from "void/client";
|
|
@@ -2516,7 +2468,7 @@ console.log(posts);
|
|
|
2516
2468
|
// posts[0].body ← string (type-checked)
|
|
2517
2469
|
// posts[0].nope ← TypeScript error
|
|
2518
2470
|
`);
|
|
2519
|
-
log.
|
|
2471
|
+
log.step("Created src/demo.ts");
|
|
2520
2472
|
note(`SQL migration → DB types → Route handler → Route types → Typed fetch
|
|
2521
2473
|
|
|
2522
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");
|
|
@@ -2544,7 +2496,7 @@ function ensureVoidDependency(root) {
|
|
|
2544
2496
|
throw new Error("Could not parse package.json while scaffolding demo");
|
|
2545
2497
|
}
|
|
2546
2498
|
}
|
|
2547
|
-
const fallbackName =
|
|
2499
|
+
const fallbackName = defaultPackageName(root);
|
|
2548
2500
|
let changed = !existedBefore;
|
|
2549
2501
|
if (!pkg.name || typeof pkg.name !== "string") {
|
|
2550
2502
|
pkg.name = fallbackName;
|
|
@@ -2562,16 +2514,14 @@ function ensureVoidDependency(root) {
|
|
|
2562
2514
|
if (!pkg.dependencies || typeof pkg.dependencies !== "object" || Array.isArray(pkg.dependencies)) pkg.dependencies = {};
|
|
2563
2515
|
const devDependencies = asRecord(pkg.devDependencies) ?? {};
|
|
2564
2516
|
pkg.devDependencies = devDependencies;
|
|
2565
|
-
if (!
|
|
2566
|
-
return typeof asRecord(pkg[field])?.void === "string";
|
|
2567
|
-
})) {
|
|
2517
|
+
if (!hasDeclaredDependency(pkg, "void")) {
|
|
2568
2518
|
devDependencies.void = voidSpec;
|
|
2569
2519
|
changed = true;
|
|
2570
2520
|
}
|
|
2571
2521
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2572
2522
|
if (changed) {
|
|
2573
2523
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2574
|
-
log.
|
|
2524
|
+
log.step(existedBefore ? "Ensured void is in package.json devDependencies" : "Created package.json with void as a devDependency");
|
|
2575
2525
|
}
|
|
2576
2526
|
return changed || pnpmConfigChanged;
|
|
2577
2527
|
}
|
|
@@ -2579,42 +2529,57 @@ function getOwnVersion() {
|
|
|
2579
2529
|
return JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2580
2530
|
}
|
|
2581
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-]+)*)?`;
|
|
2582
|
-
const MARKER_OPEN_RE = new RegExp(String.raw`^<!--injected-by-void-v(${MARKER_VERSION_SOURCE})-->\r?$`, "m");
|
|
2583
2532
|
const MARKER_CLOSE = "<!--/injected-by-void-->";
|
|
2584
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");
|
|
2585
|
-
function injectAgentBlock(root) {
|
|
2534
|
+
async function injectAgentBlock(root, newProject) {
|
|
2586
2535
|
const filePath = "AGENTS.md";
|
|
2587
2536
|
const fullPath = join(root, filePath);
|
|
2588
2537
|
const version = getOwnVersion();
|
|
2589
2538
|
const template = readFileSync(join(getPackageDir(), "AGENTS_TEMPLATE.md"), "utf-8");
|
|
2590
2539
|
const block = `${`<!--injected-by-void-v${version}-->`}\n${template}\n${MARKER_CLOSE}`;
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
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) {
|
|
2599
2563
|
const updated = existing.replace(MARKER_BLOCK_RE, block);
|
|
2600
2564
|
writeFileSync(fullPath, updated);
|
|
2601
|
-
log.
|
|
2565
|
+
log.step(`Updated Void instructions in ${filePath}`);
|
|
2602
2566
|
} else {
|
|
2603
2567
|
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
2604
2568
|
writeFileSync(fullPath, existing + separator + block + "\n");
|
|
2605
|
-
log.
|
|
2569
|
+
log.step(`Added Void instructions to ${filePath}`);
|
|
2606
2570
|
}
|
|
2607
2571
|
} else {
|
|
2608
2572
|
writeFileSync(fullPath, block + "\n");
|
|
2609
|
-
log.
|
|
2573
|
+
log.step(`Created ${filePath} with Void instructions`);
|
|
2610
2574
|
}
|
|
2611
2575
|
}
|
|
2612
2576
|
async function runInitCommand(root, initArgs) {
|
|
2613
2577
|
console.log();
|
|
2614
|
-
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github
|
|
2578
|
+
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github));
|
|
2615
2579
|
if (!targeted) root = await resolveInitRoot(root);
|
|
2580
|
+
const newProject = isScaffoldableEmptyProject(root) && !existsSync(join(root, "AGENTS.md"));
|
|
2616
2581
|
const hadTypedConfig = existsSync(join(root, TYPED_CONFIG_FILE));
|
|
2617
|
-
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.");
|
|
2618
2583
|
const workspaceSubpackage = isInsideWorkspaceSubpackage(root);
|
|
2619
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.");
|
|
2620
2585
|
const gitInitialized = !workspaceSubpackage && (!targeted || initArgs?.git !== void 0) ? await setupGit(root, initArgs?.git) : false;
|
|
@@ -2675,14 +2640,12 @@ async function runInitCommand(root, initArgs) {
|
|
|
2675
2640
|
if (framework) setupWranglerConfig(root, framework);
|
|
2676
2641
|
if (!hadTypedConfig) migrateFrameworkAdapterPaths(root);
|
|
2677
2642
|
if (!targeted && !didScaffoldStarter) applyDatabaseSetup(root, await promptDatabaseSetup(root));
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
} else log.info("No coding agent detected; read the bundled docs linked in AGENTS.md");
|
|
2685
|
-
}
|
|
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/");
|
|
2686
2649
|
if (!targeted && !framework) {
|
|
2687
2650
|
if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2688
2651
|
else if (!state.typescriptWanted) {} else {
|
|
@@ -2709,11 +2672,11 @@ async function runInitCommand(root, initArgs) {
|
|
|
2709
2672
|
let voidPlatformDiscovery = null;
|
|
2710
2673
|
if (!targeted && deploymentPlatform === "cloudflare") await setupCloudflareDeployment(root);
|
|
2711
2674
|
if (!targeted && deploymentPlatform === "void") voidPlatformDiscovery = await ensureVoidPlatformConnection(root);
|
|
2712
|
-
const githubStepSkipForSubpackage =
|
|
2675
|
+
const githubStepSkipForSubpackage = workspaceSubpackage;
|
|
2713
2676
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2714
2677
|
if (shouldSetupGithub && !githubStepSkipForSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2715
2678
|
if (!voidPlatformDiscovery) {
|
|
2716
|
-
const { getApiUrl } = await import("./auth-
|
|
2679
|
+
const { getApiUrl } = await import("./auth-BgX2qYSY.mjs");
|
|
2717
2680
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2718
2681
|
}
|
|
2719
2682
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -2738,8 +2701,8 @@ async function runInitCommand(root, initArgs) {
|
|
|
2738
2701
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2739
2702
|
if (scaffoldResult.written) {
|
|
2740
2703
|
const rel = relative(root, scaffoldResult.written) || "env.ts";
|
|
2741
|
-
if (scaffoldResult.entries.length > 0) log.
|
|
2742
|
-
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({...})\`.`);
|
|
2743
2706
|
}
|
|
2744
2707
|
}
|
|
2745
2708
|
if (scaffoldAddedDependencies) installProjectDependencies(root, state.packageManager);
|
|
@@ -2750,9 +2713,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2750
2713
|
}
|
|
2751
2714
|
if (gitInitialized) log.info(`Git (optional): ${initialCommitCommand(root)}`);
|
|
2752
2715
|
if (workspaceSubpackageSkip) {
|
|
2753
|
-
if (scaffoldedStarterMode)
|
|
2754
|
-
else
|
|
2755
|
-
} 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.`);
|
|
2756
2719
|
}
|
|
2757
2720
|
//#endregion
|
|
2758
2721
|
export { parseInitArgs, runInitCommand };
|