void 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{account-cmd-l-FM7Ioq.mjs → account-cmd-Ci00cncT.mjs} +5 -5
- package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
- package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-D72ZQfMZ.mjs} +118 -135
- package/dist/{application-routing-DQyUh_5S.mjs → application-routing-Dy589Vgn.mjs} +1 -2
- package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
- package/dist/{auth-Dn2vw-SG.mjs → auth-B6iOCjKI.mjs} +23 -56
- package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DWr6Afao.mjs} +10 -10
- package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
- package/dist/{auth-router-DvsCUVw4.mjs → auth-router-DP14wVkZ.mjs} +4 -4
- package/dist/auth-wn6F8dB8.mjs +2 -0
- package/dist/base64-DVrOndmI.mjs +16 -0
- package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
- package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
- package/dist/{build-cmd-D6we0VjO.mjs → build-cmd-Cr3FJxv0.mjs} +5 -5
- package/dist/{cache-CZRdzKx1.mjs → cache-D0Tt28cn.mjs} +5 -5
- package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CJKvk7AN.mjs} +4 -4
- package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
- package/dist/{cf-access-BcIBSKqG.mjs → cf-access-CWP4avfP.mjs} +3 -7
- package/dist/cf-build-output-2u583yJK.mjs +2 -0
- package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
- package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
- package/dist/cli/cli.mjs +198 -311
- package/dist/cli/cloudflare-operation-process.mjs +41 -15
- package/dist/cli/env-schema-probe.d.mts +5 -43
- package/dist/cli/env-schema-probe.mjs +14 -80
- package/dist/client-C1BjRn3g.mjs +2 -0
- package/dist/{client-DlDJuY0s.mjs → client-DM9Kcf4e.mjs} +161 -415
- package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
- package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-CTrn-lXJ.mjs} +6 -5
- package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
- package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-BosmCNlq.mjs} +3 -3
- package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-BKdSfNBN.mjs} +26 -34
- package/dist/{cloudflare-operations-BlYLlowZ.mjs → cloudflare-operations-Ds-lX3Ts.mjs} +1 -1
- package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
- package/dist/collect-NUlJMpLY.mjs +2 -0
- package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
- package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
- package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
- package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
- package/dist/config-CNnrSMYm.mjs +2 -0
- package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-BfPBHHm-.mjs → connect-nukQSoEO.mjs} +8 -8
- package/dist/{create-project-BdXEFKal.mjs → create-project-D4APeBwX.mjs} +7 -7
- package/dist/{create-project-qFDC45zg.mjs → create-project-DL7YXpjj.mjs} +1 -1
- package/dist/{db-Xs80hcaA.mjs → db-27RztQLy.mjs} +173 -263
- package/dist/{delete-d2vuou3j.mjs → delete-BbsZFZIw.mjs} +5 -5
- package/dist/deploy-B06EQq4t.mjs +6009 -0
- package/dist/deploy-Db2ALnQP.mjs +3 -0
- package/dist/deploy-managed-static-CGswbcay.mjs +2277 -0
- package/dist/deploy-transport-BiicfoQW.mjs +180 -0
- package/dist/deploy.d.mts +10 -0
- package/dist/deploy.mjs +82 -0
- package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
- package/dist/discover-CTUiSsfG.mjs +2 -0
- package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
- package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
- package/dist/{domain-BsDUBAvt.mjs → domain-Bfq9n03H.mjs} +7 -22
- package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
- package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
- package/dist/{email-_lGAHOhp.mjs → email-DIwaQU4P.mjs} +99 -191
- package/dist/email-cloudflare-CH053RxK.mjs +1096 -0
- package/dist/email-protocol-D9nTvhCp.mjs +82 -0
- package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
- package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
- package/dist/{env-DMA3cXZt.mjs → env-BhdWMrNy.mjs} +2 -13
- package/dist/{env-C74QepDE.mjs → env-C6ipBLp3.mjs} +8 -8
- package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
- package/dist/{env-raw-jZpP5n47.mjs → env-raw-Cklzcde3.mjs} +3 -20
- package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
- package/dist/{env-validation-CrVNjsPm.mjs → env-validation-CTn-HhG1.mjs} +1 -1
- package/dist/env-validation-cE0zcmzO.mjs +486 -0
- package/dist/{gen-DtkQhvQg.mjs → gen-CnN1Xidx.mjs} +131 -253
- package/dist/gen-F8pSZnhc.mjs +2 -0
- package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
- package/dist/generate-Rii9klHB.mjs +2 -0
- package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
- package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-BdkU4Nhe.mjs} +27 -71
- package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
- package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
- package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
- package/dist/{help-0bTe_lID.mjs → help-Bug7pyK_.mjs} +18 -10
- package/dist/help-s9q7LTcu.mjs +2 -0
- package/dist/{inbound-PfQDLXc5.mjs → inbound-DmkTQeWp.mjs} +71 -222
- package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
- package/dist/index.d.mts +2 -18
- package/dist/index.mjs +200 -496
- package/dist/{info-PYWwkWyt.mjs → info-CujPwtMe.mjs} +5 -5
- package/dist/{init-DaBGmaXC.mjs → init-ZWOJvc-Z.mjs} +179 -388
- package/dist/isr-config-DPjXM8J2.mjs +194 -0
- package/dist/{link-C6fjafep.mjs → link-UEc7bnF4.mjs} +8 -8
- package/dist/{list-BTFBlqKl.mjs → list-CuWeOnzk.mjs} +6 -17
- package/dist/{live-CgQuTpqD.mjs → live-BxLX-JqJ.mjs} +19 -17
- package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
- package/dist/load-user-env-DD5qveNU.mjs +49 -0
- package/dist/{local-d1-ga5O_idV.mjs → local-d1-BM3p74mm.mjs} +6 -6
- package/dist/{login-GKcNUmtI.mjs → login-CZ2Cqa-D.mjs} +11 -11
- package/dist/login-DhK7o1oJ.mjs +2 -0
- package/dist/{logs-BiMSULmc.mjs → logs-TihRcLTk.mjs} +5 -5
- package/dist/migrate-BgT-hmu8.mjs +2 -0
- package/dist/{migrate-NLsjBbuM.mjs → migrate-uFwojusJ.mjs} +69 -21
- package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
- package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
- package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
- package/dist/{node-DJicPvPj.mjs → node-DoKbo1SZ.mjs} +8 -24
- package/dist/{operator-args-DOBhIaIg.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
- package/dist/{operator-auth-BEZ_u0Cz.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
- package/dist/{operator-client-DbDv4vtE.mjs → operator-client-C-ROjk1I.mjs} +4 -4
- package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-C5lCctnc.mjs} +8 -8
- package/dist/operator-cmd-Cjk5DiRx.mjs +2 -0
- package/dist/{output-C50ag2r3.mjs → output-FNHKw5Ac.mjs} +36 -5
- package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +91 -5
- package/dist/pages/index.d.mts +1 -2
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.mjs +5 -83
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{platform-args-DUeXY9Om.mjs → platform-args-C6Mb_I3a.mjs} +34 -58
- package/dist/platform-args-Cm7x-fot.mjs +2 -0
- package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-CJmNkFT2.mjs} +10 -11
- package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-D5wvsI-Y.mjs} +36 -26
- package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-D_0I3n-1.mjs} +8 -9
- package/dist/{platform-cmd-BbmJiq5O.mjs → platform-cmd-Cuj4oUVo.mjs} +1 -1
- package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DxxZO6e5.mjs} +15 -15
- package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
- package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-zLXnW1G_.mjs} +5 -5
- package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DOW-wLfx.mjs} +1398 -2043
- package/dist/{platform-lifecycle-ByAlpkhV.mjs → platform-lifecycle-_gfnjUBr.mjs} +1 -1
- package/dist/{platform-management-CBOT4BSM.mjs → platform-management-CYrLvTGH.mjs} +1 -1
- package/dist/{platform-management-CuuVDhyt.mjs → platform-management-t7HKy4-U.mjs} +632 -124
- package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-CNH6zbPX.mjs} +15 -11
- package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-DeucI7A9.mjs} +6 -9
- package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
- package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-CTf6MMT9.mjs} +19 -26
- package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
- package/dist/{prepare-Dq9hTIbo.mjs → prepare-C4zfwks4.mjs} +3 -3
- package/dist/{prepare-Do96654b.mjs → prepare-CSH9dKTI.mjs} +11 -13
- package/dist/prepare-dr9uxQSV.mjs +2 -0
- package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
- package/dist/prerender-render.d.mts +2 -0
- package/dist/prerender-render.mjs +2 -2
- package/dist/project-DiiOBZPF.mjs +2 -0
- package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-Dq75AXzy.mjs} +19 -19
- package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
- package/dist/{project-BAm2aB6Q.mjs → project-rqDnVsJN.mjs} +8 -4
- package/dist/{project-team-Q_lCA7Io.mjs → project-team-B3_QcStG.mjs} +6 -6
- package/dist/{project-token-BArgK9o1.mjs → project-token-CvsRvv2I.mjs} +5 -5
- package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
- package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-D1ICiwN_.mjs} +5 -5
- package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
- package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
- package/dist/{provision-BfaLiWbj.mjs → provision-DDh7ITVS.mjs} +118 -865
- package/dist/{requests-C7Oeoh5u.mjs → requests-3CL3BuZh.mjs} +4 -4
- package/dist/resolve-project-B9Hr0D3n.mjs +2 -0
- package/dist/resolve-project-C_Cu7E8a.mjs +48 -0
- package/dist/{rollback-DVAtrLAl.mjs → rollback-Ce1d_0J9.mjs} +7 -17
- package/dist/{route-types-CbtsIeFn.mjs → route-types-IrBuwJ7u.mjs} +35 -70
- package/dist/routing-assets-VkrKIbxE.mjs +139 -0
- package/dist/{runner-9wjsSZx-.mjs → runner-B5huK2eC.mjs} +1 -1
- package/dist/{runner-DMBKSrRk.mjs → runner-DcVDrzuR.mjs} +7 -28
- package/dist/{runner-mysql-CEzKtmFb.mjs → runner-mysql-CCtyI0p6.mjs} +4 -3
- package/dist/runner-mysql-CaJq-hd6.mjs +2 -0
- package/dist/runner-pg-BJhFZZG4.mjs +2 -0
- package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-CPd-CB_F.mjs} +1 -1
- package/dist/runtime/ai.mjs +9 -22
- package/dist/runtime/better-auth-mysql.d.mts +2 -5
- package/dist/runtime/better-auth-mysql.mjs +6 -31
- package/dist/runtime/better-auth-pg.d.mts +2 -5
- package/dist/runtime/better-auth-pg.mjs +6 -32
- package/dist/runtime/better-auth.d.mts +2 -4
- package/dist/runtime/better-auth.mjs +9 -19
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.d.mts +16 -0
- package/dist/runtime/durable.mjs +26 -2
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +9 -23
- package/dist/runtime/email-protocol.d.mts +12 -0
- package/dist/runtime/email-protocol.mjs +2 -70
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +79 -221
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +12 -38
- package/dist/runtime/env.d.mts +1 -12
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +1 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-mysql.d.mts +2 -2
- package/dist/runtime/migration-handler-mysql.mjs +3 -2
- package/dist/runtime/migration-handler-pg.d.mts +2 -2
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -2
- package/dist/runtime/migration-handler.mjs +2 -470
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/binding-handler.mjs +62 -62
- package/dist/runtime/remote/index.mjs +16 -77
- package/dist/runtime/routing.d.mts +1 -4
- package/dist/runtime/routing.mjs +82 -218
- package/dist/runtime/sandbox-container.d.mts +2 -2
- package/dist/runtime/sandbox-container.mjs +2 -2
- package/dist/runtime/sandbox.d.mts +2 -2
- package/dist/runtime/sandbox.mjs +13 -6
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -3
- package/dist/runtime/ws-server.mjs +6 -28
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
- package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-DBKIqDEK.mjs} +12 -1
- package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
- package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
- package/dist/{secret-BvtB7IjY.mjs → secret-B5J8bBsI.mjs} +62 -80
- package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
- package/dist/{skills-BgVMvQdy.mjs → skills-BJsan98C.mjs} +2 -2
- package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-gQ-NDA-u.mjs} +38 -43
- package/dist/sveltekit.mjs +1 -1
- package/dist/validate-C9xtFOYR.mjs +2 -0
- package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
- package/dist/version-metadata-DIrqEHQo.mjs +73 -0
- package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
- package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
- package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
- package/docs/guide/auth.md +2 -0
- package/docs/guide/database/postgresql.md +2 -0
- package/docs/guide/database.md +2 -0
- package/docs/guide/durable-state.md +24 -0
- package/docs/guide/platform/administration/access.md +4 -0
- package/docs/guide/platform/administration/connected-apps.md +55 -0
- package/docs/guide/platform/installation/credentials.md +3 -1
- package/docs/guide/quickstart.md +2 -0
- package/docs/guide/sandboxes.md +2 -0
- package/docs/reference/api/deploy.md +23 -0
- package/docs/reference/api/pages.md +2 -0
- package/docs/reference/api.md +2 -1
- package/docs/reference/cli/database.md +9 -3
- package/docs/reference/cli/platform-installation.md +1 -1
- package/docs/reference/cli/setup.md +2 -0
- package/package.json +13 -16
- package/skills/void/SKILL.md +1 -0
- package/dist/auth-LMJcNESe.mjs +0 -2
- package/dist/cf-build-output-H9a97vME.mjs +0 -2
- package/dist/cf-user-agent-lKblH3zU.mjs +0 -17
- package/dist/client-tso2OfcG.mjs +0 -2
- package/dist/collect-DLyFDiKW.mjs +0 -2
- package/dist/config-5r-YpMC-.mjs +0 -2
- package/dist/config-B_ggY-IO.mjs +0 -89
- package/dist/config-BtSFvXZx.mjs +0 -2
- package/dist/config-write-AHGesphx.mjs +0 -61
- package/dist/deploy-Bqe1PYBw.mjs +0 -10458
- package/dist/deploy-VsWsVQkw.mjs +0 -2
- package/dist/dev-inbox-CK-UuPob.mjs +0 -297
- package/dist/discover-EDUf6JJw.mjs +0 -2
- package/dist/dist-_UUlL6bg.mjs +0 -2
- package/dist/env-validation-Dxdx_5wo.mjs +0 -951
- package/dist/gen-dA9hW7AV.mjs +0 -2
- package/dist/head-client-DzmJGN4C.mjs +0 -90
- package/dist/help-DfQYVfGY.mjs +0 -2
- package/dist/login-mx_ydhmp.mjs +0 -2
- package/dist/migrate-BHp07yJE.mjs +0 -2
- package/dist/operator-cmd-CwBB-1yb.mjs +0 -2
- package/dist/pages/head-client.d.mts +0 -13
- package/dist/pages/head-client.mjs +0 -2
- package/dist/platform-args-D4E1PjVw.mjs +0 -2
- package/dist/prepare-DRUV-g3X.mjs +0 -2
- package/dist/project-DedqCp59.mjs +0 -2
- package/dist/provision-Wu9ZBk9L.mjs +0 -2
- package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
- package/dist/resolve-project-CP8rZs_p.mjs +0 -28
- package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
- package/dist/runner-pg-BGYRFdRp.mjs +0 -2
- package/dist/runtime/env-helpers.d.mts +0 -2
- package/dist/runtime/env-helpers.mjs +0 -2
- package/dist/validate-BJr9LfXy.mjs +0 -2
- package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { a as join,
|
|
2
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
3
|
-
import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-
|
|
4
|
-
import {
|
|
5
|
-
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-BAm2aB6Q.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-Dn2vw-SG.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";
|
|
1
|
+
import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { r as detectFramework } from "./plugin-inference-DsARdQKE.mjs";
|
|
3
|
+
import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-DMvEeSau.mjs";
|
|
4
|
+
import { d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
|
|
12
5
|
import { t as MagicString } from "./dist-Cegxq8gs.mjs";
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { i as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { n as
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import {
|
|
6
|
+
import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
7
|
+
import { r as materializeCloudflareConfig } from "./cloudflare-config-DV60XFFK.mjs";
|
|
8
|
+
import { i as LATEST_KNOWN_COMPAT_DATE, j as writeProvisionedWranglerConfig } from "./wrangler-BYs07Rxy.mjs";
|
|
9
|
+
import { i as readPackageJson, n as hasPackageDependency } from "./package-json-BjYqR-So.mjs";
|
|
10
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
11
|
+
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
12
|
+
import { l as formatUrl, m as printSuccess, p as note } from "./output-FNHKw5Ac.mjs";
|
|
13
|
+
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-bveqhlYA.mjs";
|
|
14
|
+
import { t as parseDotenvFile } from "./dotenv-CNazY3-w.mjs";
|
|
15
|
+
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BEm9vRvS.mjs";
|
|
16
|
+
import { n as getOwnVersion, r as getPackageDir, t as detectAgents } from "./agents-CuNtT0D_.mjs";
|
|
17
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
18
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-D4APeBwX.mjs";
|
|
19
|
+
import { s as formatProjectCommand } from "./cloudflare-process-CeDWJRhj.mjs";
|
|
20
|
+
import { i as hasLocalLockfile, n as drizzleKitBin, r as findInstalledYarnPnpRuntime, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DLbEFMT0.mjs";
|
|
21
|
+
import { t as promptForLoginToken } from "./login-CZ2Cqa-D.mjs";
|
|
22
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-DxxZO6e5.mjs";
|
|
23
|
+
import { t as connectCloudflare } from "./cloudflare-connect-BosmCNlq.mjs";
|
|
24
|
+
import { n as snapshotDrizzleOutputs } from "./generate-Dat0UTry.mjs";
|
|
25
|
+
import { i as writeVoidProjectConfig, o as migrateFrameworkAdapterPaths, r as canRewriteVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-uFwojusJ.mjs";
|
|
25
26
|
import { createRequire } from "node:module";
|
|
26
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync,
|
|
27
|
-
import { fileURLToPath } from "node:url";
|
|
27
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
28
28
|
import { parseSync } from "vite";
|
|
29
|
-
import {
|
|
29
|
+
import { isRecord } from "@void/deploy-core";
|
|
30
30
|
import { parseArgs } from "node:util";
|
|
31
|
+
import { parse } from "jsonc-parser";
|
|
31
32
|
import { spawnSync } from "node:child_process";
|
|
32
33
|
//#region src/cli/deploy-setup.ts
|
|
33
34
|
async function maybeSetupDeployProject(root) {
|
|
@@ -57,7 +58,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
57
58
|
projectId: result.project.id,
|
|
58
59
|
slug: result.project.slug
|
|
59
60
|
};
|
|
60
|
-
writeProjectConfig(root, attachSelectedPlatform(
|
|
61
|
+
writeProjectConfig(root, attachSelectedPlatform(config, client.apiUrl));
|
|
61
62
|
log.step(`Linked project: ${config.slug}`);
|
|
62
63
|
return config;
|
|
63
64
|
}
|
|
@@ -796,12 +797,13 @@ const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
|
796
797
|
".windsurf",
|
|
797
798
|
".zencoder"
|
|
798
799
|
]);
|
|
799
|
-
const
|
|
800
|
-
"
|
|
801
|
-
"
|
|
802
|
-
"
|
|
800
|
+
const PNPM_BUILD_DEFAULTS = [
|
|
801
|
+
["better-sqlite3", false],
|
|
802
|
+
["esbuild", true],
|
|
803
|
+
["sharp", true],
|
|
804
|
+
["workerd", true]
|
|
803
805
|
];
|
|
804
|
-
const
|
|
806
|
+
const PNPM_BUILD_PLACEHOLDER = "set this to true or false";
|
|
805
807
|
const EMPTY_PROJECT_ALLOWED_PACKAGES = /* @__PURE__ */ new Set([
|
|
806
808
|
"void",
|
|
807
809
|
"hono",
|
|
@@ -863,8 +865,7 @@ const VITE_CONFIG_FILES = [
|
|
|
863
865
|
];
|
|
864
866
|
const VOID_CONFIG_FILE = "void.json";
|
|
865
867
|
function asRecord(value) {
|
|
866
|
-
|
|
867
|
-
return value;
|
|
868
|
+
return isRecord(value) ? value : null;
|
|
868
869
|
}
|
|
869
870
|
function parseJsoncFile(path) {
|
|
870
871
|
const errors = [];
|
|
@@ -1091,27 +1092,9 @@ function parsePackageManagerField(pkg) {
|
|
|
1091
1092
|
if (name === "npm" || name === "pnpm" || name === "yarn" || name === "bun") return name;
|
|
1092
1093
|
}
|
|
1093
1094
|
/**
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
* `pnpm-lock.yaml`, a local `pnpm-workspace.yaml`, or a Corepack
|
|
1098
|
-
* `packageManager: pnpm` pin in `package.json` — AND the same signals on
|
|
1099
|
-
* any ancestor workspace root.
|
|
1100
|
-
*
|
|
1101
|
-
* Ancestor walking matters for pnpm workspace subpackages: pnpm writes the
|
|
1102
|
-
* lockfile at the workspace root, not per-package, and many subpackages
|
|
1103
|
-
* omit their own `packageManager` field in favor of the workspace root's.
|
|
1104
|
-
* A subpackage with a `workspace:*` dep in its `package.json` but no local
|
|
1105
|
-
* pnpm markers is still pnpm-managed if the enclosing workspace root has
|
|
1106
|
-
* `pnpm-workspace.yaml`, a `pnpm-lock.yaml`, or `packageManager: pnpm@...`.
|
|
1107
|
-
*
|
|
1108
|
-
* Local non-pnpm signals MUST outrank the ancestor walk. A bun
|
|
1109
|
-
* or yarn subproject nested under a pnpm workspace ancestor is still
|
|
1110
|
-
* bun/yarn — its local `bun.lockb` / `yarn.lock` / `package-lock.json` or
|
|
1111
|
-
* a local Corepack pin for bun/yarn/npm proves the ancestor's pnpm shape
|
|
1112
|
-
* does not govern this subpackage. `detectProjectState` would pick
|
|
1113
|
-
* bun/yarn for such a project and try to install with that manager, so
|
|
1114
|
-
* the pnpm check must not inherit ancestor workspace state too eagerly.
|
|
1095
|
+
* Whether pnpm manages `root`. pnpm keeps the lockfile and Corepack pin at the
|
|
1096
|
+
* workspace root, so a member without local markers inherits them, but a local
|
|
1097
|
+
* lockfile or pin for another manager always wins.
|
|
1115
1098
|
*/
|
|
1116
1099
|
function isPnpmProject(root, pkg) {
|
|
1117
1100
|
if (existsSync(join(root, "pnpm-lock.yaml"))) return true;
|
|
@@ -1123,23 +1106,8 @@ function isPnpmProject(root, pkg) {
|
|
|
1123
1106
|
return hasAncestorPnpmMarkers(root);
|
|
1124
1107
|
}
|
|
1125
1108
|
/**
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1128
|
-
* workspace root is pnpm-managed even when the subpackage has no local
|
|
1129
|
-
* pnpm signals.
|
|
1130
|
-
*
|
|
1131
|
-
* An ancestor `pnpm-workspace.yaml` / `pnpm-lock.yaml` /
|
|
1132
|
-
* Corepack pnpm pin alone is NOT proof that `start` is governed by
|
|
1133
|
-
* that repo's pnpm install. A scratch app nested under a pnpm
|
|
1134
|
-
* monorepo is a separate project when its path doesn't match the
|
|
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.
|
|
1138
|
-
*
|
|
1139
|
-
* Delegate workspace membership to `findWorkspaceRoot` +
|
|
1140
|
-
* `isWorkspaceSubpackage` — the same check used by the
|
|
1141
|
-
* workspace-subpackage skip path in `runInitCommand` — so the two
|
|
1142
|
-
* paths can't disagree.
|
|
1109
|
+
* Whether `start` is a declared member of a pnpm-managed ancestor workspace.
|
|
1110
|
+
* A scratch app outside the workspace globs is a separate project.
|
|
1143
1111
|
*/
|
|
1144
1112
|
function hasAncestorPnpmMarkers(start) {
|
|
1145
1113
|
const workspaceRoot = findWorkspaceRoot(start);
|
|
@@ -1154,30 +1122,8 @@ function hasAncestorPnpmMarkers(start) {
|
|
|
1154
1122
|
return false;
|
|
1155
1123
|
}
|
|
1156
1124
|
/**
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1159
|
-
* algorithm for the `void` package name — returns true as soon as any
|
|
1160
|
-
* ancestor has `void` installed, false only when the entire chain is
|
|
1161
|
-
* empty. Used by the demo install gate so workspace subpackages whose
|
|
1162
|
-
* `void` is hoisted at the workspace root are detected as already
|
|
1163
|
-
* installed and we don't trigger a spurious subpackage install.
|
|
1164
|
-
*
|
|
1165
|
-
* PnP rationale: in a Yarn Berry PnP workspace, dependencies resolve
|
|
1166
|
-
* via `.pnp.cjs` at the workspace root and there is no `node_modules`
|
|
1167
|
-
* tree — not in the subpackage, not in ancestors. By the time we call
|
|
1168
|
-
* this, `scaffoldDemo`/`ensureVoidDependency` has added `void` to the
|
|
1169
|
-
* subpackage's `package.json` (or verified it was already there), and
|
|
1170
|
-
* under PnP the workspace-root install is what wires up resolution.
|
|
1171
|
-
*
|
|
1172
|
-
* A committed-but-unfetched `.pnp.cjs` is NOT proof that
|
|
1173
|
-
* `yarn install` has run. Yarn Berry repos commonly commit `.pnp.cjs`
|
|
1174
|
-
* but gitignore `.yarn/cache/*.zip` (zero-install is opt-in), so a
|
|
1175
|
-
* fresh clone has the runtime file on disk while the archives it
|
|
1176
|
-
* points at are missing. The stricter `findInstalledYarnPnpRuntime`
|
|
1177
|
-
* also requires a post-install marker next to the runtime
|
|
1178
|
-
* (`.yarn/install-state.gz` or a populated `.yarn/cache`). Without it,
|
|
1179
|
-
* we fall through and return false so the caller triggers the install
|
|
1180
|
-
* step before attempting to spawn drizzle-kit.
|
|
1125
|
+
* Whether `void` resolves from `start`, through an ancestor `node_modules`
|
|
1126
|
+
* (hoisted workspace installs) or an installed Yarn PnP runtime.
|
|
1181
1127
|
*/
|
|
1182
1128
|
function isVoidResolvableFrom(start) {
|
|
1183
1129
|
let dir = start;
|
|
@@ -1197,7 +1143,6 @@ function isVoidResolvableFrom(start) {
|
|
|
1197
1143
|
const probe = spawnSync(process.execPath, probeArgs, {
|
|
1198
1144
|
cwd: start,
|
|
1199
1145
|
stdio: "ignore",
|
|
1200
|
-
shell: process.platform === "win32",
|
|
1201
1146
|
env: buildDrizzleKitSpawnEnv(start)
|
|
1202
1147
|
});
|
|
1203
1148
|
return !probe.error && probe.status === 0;
|
|
@@ -1205,13 +1150,8 @@ function isVoidResolvableFrom(start) {
|
|
|
1205
1150
|
return false;
|
|
1206
1151
|
}
|
|
1207
1152
|
/**
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1210
|
-
* whose top-level `workspaces` field exists (array or object). Returns
|
|
1211
|
-
* the discovered workspace root path if `start` is a subpackage inside
|
|
1212
|
-
* such a workspace, or `undefined` when it is not. Stops at the
|
|
1213
|
-
* filesystem root. Skips `start` itself — a root with its own
|
|
1214
|
-
* `workspaces` field is its own root, not a subpackage.
|
|
1153
|
+
* Nearest ancestor of `start` (excluding `start`) with a `pnpm-workspace.yaml`
|
|
1154
|
+
* or a `package.json#workspaces` field.
|
|
1215
1155
|
*/
|
|
1216
1156
|
function findWorkspaceRoot(start) {
|
|
1217
1157
|
let dir = dirname(start);
|
|
@@ -1228,18 +1168,8 @@ function findWorkspaceRoot(start) {
|
|
|
1228
1168
|
}
|
|
1229
1169
|
}
|
|
1230
1170
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
* - `pnpm-workspace.yaml` — extracts patterns under the top-level
|
|
1234
|
-
* `packages:` key via a regex matcher (no `js-yaml` dep). Only the
|
|
1235
|
-
* `packages:` key is used; pnpm-specific keys like `catalog:` are
|
|
1236
|
-
* ignored.
|
|
1237
|
-
* - `package.json#workspaces` — either an array of patterns or a
|
|
1238
|
-
* `{ packages: [...] }` object form (npm/yarn/bun convention).
|
|
1239
|
-
*
|
|
1240
|
-
* Returns an empty array if no patterns are declared or parsing fails —
|
|
1241
|
-
* callers should treat that as "can't verify membership" and fall back
|
|
1242
|
-
* to the fresh-clone install path.
|
|
1171
|
+
* Member globs from `pnpm-workspace.yaml#packages` or `package.json#workspaces`
|
|
1172
|
+
* (an array or `{ packages }`). Empty when none can be read.
|
|
1243
1173
|
*/
|
|
1244
1174
|
function readWorkspacePatterns(workspaceRoot) {
|
|
1245
1175
|
const pnpmWorkspacePath = join(workspaceRoot, "pnpm-workspace.yaml");
|
|
@@ -1261,16 +1191,7 @@ function readWorkspacePatterns(workspaceRoot) {
|
|
|
1261
1191
|
}
|
|
1262
1192
|
return [];
|
|
1263
1193
|
}
|
|
1264
|
-
/**
|
|
1265
|
-
* Strip a trailing YAML line comment from a raw line while preserving
|
|
1266
|
-
* `#` characters that live inside single- or double-quoted scalars.
|
|
1267
|
-
* YAML treats `#` as a comment marker only when it is preceded by
|
|
1268
|
-
* whitespace (or is the first column) AND it is not inside a quoted
|
|
1269
|
-
* scalar. Flow-style inline quoting is handled by a plain state machine
|
|
1270
|
-
* — no escape sequence support, because real-world workspace globs
|
|
1271
|
-
* never contain escaped quotes. A naive `/\s+#.*$/` strip would
|
|
1272
|
-
* truncate quoted values like `- "path #hash/*"`.
|
|
1273
|
-
*/
|
|
1194
|
+
/** Strip a trailing YAML comment, keeping `#` inside quotes (`- "path #hash/*"`). */
|
|
1274
1195
|
function stripYamlLineComment(line) {
|
|
1275
1196
|
let inSingle = false;
|
|
1276
1197
|
let inDouble = false;
|
|
@@ -1297,23 +1218,8 @@ function stripYamlLineComment(line) {
|
|
|
1297
1218
|
return line;
|
|
1298
1219
|
}
|
|
1299
1220
|
/**
|
|
1300
|
-
*
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1303
|
-
* packages:
|
|
1304
|
-
* - 'packages/*'
|
|
1305
|
-
* - "apps/*"
|
|
1306
|
-
* - docs
|
|
1307
|
-
*
|
|
1308
|
-
* and the flow-style (inline) form:
|
|
1309
|
-
*
|
|
1310
|
-
* packages: ['packages/*', "apps/*"]
|
|
1311
|
-
* packages: [packages/*]
|
|
1312
|
-
*
|
|
1313
|
-
* Anything else (other top-level keys, comments, nested blocks) is
|
|
1314
|
-
* ignored. This intentionally does NOT pull in `js-yaml` — the
|
|
1315
|
-
* surface area we need is tiny and the real YAML we see in practice
|
|
1316
|
-
* uses one of these two shapes.
|
|
1221
|
+
* Read the `packages:` list of a `pnpm-workspace.yaml` in block (`- 'apps/*'`)
|
|
1222
|
+
* or flow (`packages: ['apps/*']`) form.
|
|
1317
1223
|
*/
|
|
1318
1224
|
function extractPnpmWorkspacePackages(yaml) {
|
|
1319
1225
|
const lines = yaml.split(/\r?\n/);
|
|
@@ -1345,14 +1251,7 @@ function extractPnpmWorkspacePackages(yaml) {
|
|
|
1345
1251
|
}
|
|
1346
1252
|
return patterns;
|
|
1347
1253
|
}
|
|
1348
|
-
/**
|
|
1349
|
-
* Expand brace groups in a workspace glob pattern. Supports the forms
|
|
1350
|
-
* that appear in real workspace manifests, like `{apps,packages}/*`
|
|
1351
|
-
* and nested forms like `{apps,packages}/{core,web}`. Returns an array
|
|
1352
|
-
* of expanded patterns with no braces. No-op for patterns that don't
|
|
1353
|
-
* contain `{...}`. Does not support escaped braces or nested braces
|
|
1354
|
-
* inside a group (neither appears in real workspace manifests).
|
|
1355
|
-
*/
|
|
1254
|
+
/** Expand `{a,b}` brace groups, including several groups in one pattern. */
|
|
1356
1255
|
function expandBraces(pattern) {
|
|
1357
1256
|
const match = pattern.match(/^([^{}]*)\{([^{}]*)\}(.*)$/);
|
|
1358
1257
|
if (!match) return [pattern];
|
|
@@ -1363,19 +1262,6 @@ function expandBraces(pattern) {
|
|
|
1363
1262
|
for (const opt of options) for (const sub of expandBraces(before + opt + after)) results.push(sub);
|
|
1364
1263
|
return results;
|
|
1365
1264
|
}
|
|
1366
|
-
/**
|
|
1367
|
-
* Match a path against a workspace glob pattern. Supports the forms
|
|
1368
|
-
* that appear in real workspace manifests:
|
|
1369
|
-
* - Literal path: `packages/void` → exact match.
|
|
1370
|
-
* - Leading `./`: `./packages/*` → stripped before matching.
|
|
1371
|
-
* - Single-segment glob: `packages/*` → one segment under prefix.
|
|
1372
|
-
* - Partial-segment glob: `packages/*-app` → regex within a segment.
|
|
1373
|
-
* - Recursive glob: `packages/**` → any depth under prefix.
|
|
1374
|
-
* - Brace expansion: `{apps,packages}/*` → expanded before matching.
|
|
1375
|
-
* Does not support character classes or extended globs — those don't
|
|
1376
|
-
* appear in any workspace manifest we've seen, and adding a full
|
|
1377
|
-
* minimatch pulls in a dep we don't need.
|
|
1378
|
-
*/
|
|
1379
1265
|
function matchesWorkspacePattern(relPath, pattern) {
|
|
1380
1266
|
return expandBraces(pattern).some((p) => matchesSingleWorkspacePattern(relPath, p));
|
|
1381
1267
|
}
|
|
@@ -1412,21 +1298,8 @@ function matchSegments(path, pi, pat, qi) {
|
|
|
1412
1298
|
return pi === path.length;
|
|
1413
1299
|
}
|
|
1414
1300
|
/**
|
|
1415
|
-
*
|
|
1416
|
-
*
|
|
1417
|
-
* `findWorkspaceRoot` is not enough — a standalone app nested under a
|
|
1418
|
-
* monorepo (e.g. `repo/scratch/my-app` inside a repo whose
|
|
1419
|
-
* `pnpm-workspace.yaml` only lists `packages/*`) is NOT a workspace
|
|
1420
|
-
* subpackage, and treating it as one leaves the demo scaffold in a
|
|
1421
|
-
* broken state: install is skipped, `generateStarterMigration` is
|
|
1422
|
-
* skipped, and the user ends up with unresolved `void` imports.
|
|
1423
|
-
*
|
|
1424
|
-
* Supports positive and negation (`!pattern`) patterns. A path is
|
|
1425
|
-
* considered a member if it matches at least one positive pattern and
|
|
1426
|
-
* no negation pattern.
|
|
1427
|
-
*
|
|
1428
|
-
* Returns `false` if no patterns are declared at all — callers treat
|
|
1429
|
-
* that as "not a subpackage" so the fresh-clone install path still runs.
|
|
1301
|
+
* Whether `root` matches a workspace glob and no `!` glob. A nested app outside
|
|
1302
|
+
* the globs is a separate project.
|
|
1430
1303
|
*/
|
|
1431
1304
|
function isWorkspaceSubpackage(workspaceRoot, root) {
|
|
1432
1305
|
const relPath = relative(workspaceRoot, root);
|
|
@@ -1444,31 +1317,15 @@ function isWorkspaceSubpackage(workspaceRoot, root) {
|
|
|
1444
1317
|
}
|
|
1445
1318
|
return matched;
|
|
1446
1319
|
}
|
|
1447
|
-
/**
|
|
1448
|
-
* Returns true iff `root` is structurally a declared member of an
|
|
1449
|
-
* ancestor workspace — regardless of whether the subpackage manages its
|
|
1450
|
-
* own install via a local lockfile or Corepack pin. This is the signal
|
|
1451
|
-
* Step 8 (GitHub Actions) uses: `.github/workflows/*` files are only
|
|
1452
|
-
* read from the repository root, so dropping them under a subpackage
|
|
1453
|
-
* root is always wrong, whether or not the subpackage self-manages
|
|
1454
|
-
* install.
|
|
1455
|
-
*/
|
|
1320
|
+
/** Workspace membership, even when the member manages its own install. */
|
|
1456
1321
|
function isInsideWorkspaceSubpackage(root) {
|
|
1457
1322
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
1458
1323
|
if (workspaceRoot === void 0) return false;
|
|
1459
1324
|
return isWorkspaceSubpackage(workspaceRoot, root);
|
|
1460
1325
|
}
|
|
1461
1326
|
/**
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
* declared member of an ancestor workspace AND has no local lockfile or
|
|
1465
|
-
* non-pnpm Corepack pin claiming it manages its own install. Returns
|
|
1466
|
-
* undefined when `root` is either not a subpackage at all, or is a
|
|
1467
|
-
* leaf-managed project nested inside a workspace.
|
|
1468
|
-
*
|
|
1469
|
-
* This is the single source of truth used by both the starter and the
|
|
1470
|
-
* demo branches in `runInitCommand` so they can never disagree about
|
|
1471
|
-
* whether to skip install/migration.
|
|
1327
|
+
* The workspace root that should install for `root`: set when `root` is a
|
|
1328
|
+
* member without its own lockfile or non-pnpm Corepack pin, as in `isPnpmProject`.
|
|
1472
1329
|
*/
|
|
1473
1330
|
function resolveWorkspaceDeferral(root, pkg) {
|
|
1474
1331
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
@@ -1504,7 +1361,6 @@ function detectProjectState(root) {
|
|
|
1504
1361
|
return {
|
|
1505
1362
|
hasTypescript,
|
|
1506
1363
|
hasTsconfig: existsSync(join(root, "tsconfig.json")),
|
|
1507
|
-
hasGithubWorkflows: existsSync(join(root, ".github", "workflows")),
|
|
1508
1364
|
hasRoutes: existsSync(paths.routesDir),
|
|
1509
1365
|
hasMigrations: existsSync(paths.migrationsDir) || existsSync(join(root, "migrations")),
|
|
1510
1366
|
hasPages: existsSync(paths.pagesDir),
|
|
@@ -1527,29 +1383,20 @@ function detectPagesFramework(root) {
|
|
|
1527
1383
|
...asRecord(pkg.devDependencies) ?? {}
|
|
1528
1384
|
});
|
|
1529
1385
|
}
|
|
1530
|
-
function readPackageJson(root) {
|
|
1531
|
-
try {
|
|
1532
|
-
return asRecord(JSON.parse(readFileSync(join(root, "package.json"), "utf-8"))) ?? void 0;
|
|
1533
|
-
} catch {
|
|
1534
|
-
return;
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
1386
|
const DEPENDENCY_FIELDS = [
|
|
1538
1387
|
"dependencies",
|
|
1539
1388
|
"devDependencies",
|
|
1540
1389
|
"peerDependencies",
|
|
1541
1390
|
"optionalDependencies"
|
|
1542
1391
|
];
|
|
1543
|
-
|
|
1392
|
+
/** The first declared spec for `packageName`, in `DEPENDENCY_FIELDS` order. */
|
|
1393
|
+
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1544
1394
|
const pkg = readPackageJson(root);
|
|
1545
|
-
if (!pkg) return;
|
|
1546
1395
|
for (const field of DEPENDENCY_FIELDS) {
|
|
1547
|
-
const
|
|
1548
|
-
if (typeof
|
|
1396
|
+
const spec = asRecord(pkg?.[field])?.[packageName];
|
|
1397
|
+
if (typeof spec === "string") return spec || fallbackVersion;
|
|
1549
1398
|
}
|
|
1550
|
-
|
|
1551
|
-
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1552
|
-
return getDeclaredDependencySpec(root, packageName) || fallbackVersion;
|
|
1399
|
+
return fallbackVersion;
|
|
1553
1400
|
}
|
|
1554
1401
|
function defaultPackageName(root) {
|
|
1555
1402
|
return basename(root).toLowerCase().replace(/[^a-z0-9-]/g, "-") || "my-app";
|
|
@@ -1885,7 +1732,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1885
1732
|
let selectedApiUrl = null;
|
|
1886
1733
|
let promptedForPlatform = false;
|
|
1887
1734
|
try {
|
|
1888
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1735
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-wn6F8dB8.mjs");
|
|
1889
1736
|
selectedApiUrl = getApiUrl(root);
|
|
1890
1737
|
getSiteDomain(root);
|
|
1891
1738
|
} catch (error) {
|
|
@@ -1905,7 +1752,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1905
1752
|
}
|
|
1906
1753
|
const discovery = await discoverPlatform(selectedApiUrl);
|
|
1907
1754
|
saveDiscoveredPlatform(discovery);
|
|
1908
|
-
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
1755
|
+
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${formatUrl(discovery.apiUrl)}.`);
|
|
1909
1756
|
return discovery;
|
|
1910
1757
|
}
|
|
1911
1758
|
async function setupCloudflareDeployment(root) {
|
|
@@ -1965,17 +1812,9 @@ function getWorkflowSetupSteps(root, pm) {
|
|
|
1965
1812
|
}
|
|
1966
1813
|
}
|
|
1967
1814
|
/**
|
|
1968
|
-
*
|
|
1969
|
-
* long-lived
|
|
1970
|
-
*
|
|
1971
|
-
* `POST $VOID_API_URL/auth/github-oidc` for a short-lived, project-scoped deploy
|
|
1972
|
-
* token, and uses it — so the workflow is a single `void deploy` step (no
|
|
1973
|
-
* curl/jq). `permissions: id-token: write` is still required: it is what lets
|
|
1974
|
-
* the job (and thus the CLI) mint the OIDC token.
|
|
1975
|
-
*
|
|
1976
|
-
* `slug` is the linked project slug when known (from `.void/project.json`);
|
|
1977
|
-
* otherwise a `${{ vars.VOID_PROJECT }}` placeholder is emitted with a comment
|
|
1978
|
-
* telling the user to set the repository variable.
|
|
1815
|
+
* The deploy workflow. Void deploys exchange a GitHub OIDC token (`id-token: write`)
|
|
1816
|
+
* at deploy time, so no long-lived token is stored. Without a `slug`, the workflow
|
|
1817
|
+
* reads a `vars.VOID_PROJECT` repository variable.
|
|
1979
1818
|
*/
|
|
1980
1819
|
function getWorkflowYaml(root, pm, slug, platform = "void", platformApiUrl) {
|
|
1981
1820
|
const { setup, install, runner } = getWorkflowSetupSteps(root, pm);
|
|
@@ -2068,15 +1907,8 @@ function setupGithubActions(root, state, platform = "void", platformApiUrl) {
|
|
|
2068
1907
|
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");
|
|
2069
1908
|
}
|
|
2070
1909
|
/**
|
|
2071
|
-
*
|
|
2072
|
-
*
|
|
2073
|
-
* Step 8 (GitHub Actions) runs BEFORE Step 9 (project link), so when a user
|
|
2074
|
-
* links a project during the same interactive init the workflow was written
|
|
2075
|
-
* with the `${{ vars.VOID_PROJECT }}` placeholder. Once the link resolves a
|
|
2076
|
-
* slug, rewrite the placeholder `env.VOID_PROJECT` block in place so the user
|
|
2077
|
-
* does not also have to set a repository variable. No-op (returns `false`)
|
|
2078
|
-
* when the workflow is missing or the placeholder is not present (e.g. the
|
|
2079
|
-
* slug was already known at scaffold time, or the user declined linking).
|
|
1910
|
+
* Replace the `vars.VOID_PROJECT` placeholder in `void-deploy.yml` with a slug
|
|
1911
|
+
* linked after the workflow was written. Returns false when there is none.
|
|
2080
1912
|
*/
|
|
2081
1913
|
function patchWorkflowProjectSlug(root, slug) {
|
|
2082
1914
|
const workflowPath = join(root, ".github", "workflows", "void-deploy.yml");
|
|
@@ -2110,9 +1942,11 @@ function ensureGitignore(root) {
|
|
|
2110
1942
|
writeFileSync(gitignorePath, content + separator + missing.join("\n") + "\n");
|
|
2111
1943
|
log.step("Updated .gitignore with Void defaults");
|
|
2112
1944
|
}
|
|
1945
|
+
/** Removes each block-style top-level `key:` block; `removed` holds its non-blank lines. */
|
|
2113
1946
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
2114
1947
|
const lines = yaml.split(/\r?\n/);
|
|
2115
1948
|
const next = [];
|
|
1949
|
+
const removed = [];
|
|
2116
1950
|
for (let i = 0; i < lines.length; i += 1) {
|
|
2117
1951
|
const line = lines[i];
|
|
2118
1952
|
if (!new RegExp(`^${key}:\\s*(?:#.*)?$`).test(line)) {
|
|
@@ -2120,19 +1954,46 @@ function removeTopLevelYamlBlock(yaml, key) {
|
|
|
2120
1954
|
continue;
|
|
2121
1955
|
}
|
|
2122
1956
|
i += 1;
|
|
2123
|
-
while (i < lines.length && (lines[i].trim() === "" ||
|
|
1957
|
+
while (i < lines.length && (lines[i].trim() === "" || /^(?:\s|-(?:\s|$))/.test(lines[i]))) {
|
|
1958
|
+
if (lines[i].trim() !== "") removed.push(lines[i]);
|
|
1959
|
+
i += 1;
|
|
1960
|
+
}
|
|
2124
1961
|
i -= 1;
|
|
2125
1962
|
}
|
|
2126
|
-
return
|
|
1963
|
+
return {
|
|
1964
|
+
yaml: next.join("\n"),
|
|
1965
|
+
removed
|
|
1966
|
+
};
|
|
2127
1967
|
}
|
|
2128
|
-
function
|
|
2129
|
-
|
|
2130
|
-
for (const dependency of PNPM_ALLOWED_BUILDS) lines.push(` ${dependency}: true`);
|
|
2131
|
-
return lines.join("\n");
|
|
1968
|
+
function pnpmAllowBuildsEntryName(line) {
|
|
1969
|
+
return /^\s+(?!#)(["']?)(.+?)\1\s*:(?:\s|$)/.exec(line)?.[2];
|
|
2132
1970
|
}
|
|
2133
|
-
|
|
1971
|
+
/**
|
|
1972
|
+
* Keeps the existing `allowBuilds` entries as written, approves the legacy
|
|
1973
|
+
* `onlyBuiltDependencies` list, and adds each Void default that is missing.
|
|
1974
|
+
*/
|
|
1975
|
+
function pnpmAllowBuildsYaml(entries, legacyList) {
|
|
1976
|
+
const legacy = legacyList.flatMap((line) => {
|
|
1977
|
+
const name = /^\s*-\s+(["']?)(.+?)\1\s*(?:#.*)?$/.exec(line)?.[2];
|
|
1978
|
+
return name === void 0 ? [] : [name];
|
|
1979
|
+
});
|
|
1980
|
+
const decided = /* @__PURE__ */ new Set([...legacy, ...PNPM_BUILD_DEFAULTS.map(([name]) => name)]);
|
|
1981
|
+
const lines = entries.filter((line) => {
|
|
1982
|
+
const name = pnpmAllowBuildsEntryName(line);
|
|
1983
|
+
return !(name !== void 0 && decided.has(name) && line.includes(PNPM_BUILD_PLACEHOLDER));
|
|
1984
|
+
});
|
|
1985
|
+
const names = new Set(lines.map((line) => pnpmAllowBuildsEntryName(line)));
|
|
1986
|
+
const firstEntry = lines.find((line) => pnpmAllowBuildsEntryName(line) !== void 0);
|
|
1987
|
+
const indent = /^\s+/.exec(firstEntry ?? "")?.[0] ?? " ";
|
|
1988
|
+
const additions = [...legacy.map((name) => [name, true]), ...PNPM_BUILD_DEFAULTS];
|
|
1989
|
+
for (const [name, value] of additions) if (!names.has(name)) {
|
|
1990
|
+
names.add(name);
|
|
1991
|
+
lines.push(`${indent}${/^[\w.-]+$/.test(name) ? name : JSON.stringify(name)}: ${value}`);
|
|
1992
|
+
}
|
|
1993
|
+
return ["allowBuilds:", ...lines].join("\n");
|
|
1994
|
+
}
|
|
1995
|
+
function insertPnpmAllowBuilds(yaml, allowBuilds) {
|
|
2134
1996
|
const trimmed = yaml.trim();
|
|
2135
|
-
const allowBuilds = pnpmAllowBuildsYaml();
|
|
2136
1997
|
if (trimmed === "") return `${allowBuilds}\n`;
|
|
2137
1998
|
const lines = trimmed.split(/\r?\n/);
|
|
2138
1999
|
const packagesIndex = lines.findIndex((line) => /^packages:\s*(?:#.*)?$/.test(line));
|
|
@@ -2151,37 +2012,67 @@ function resolvePnpmConfigRoot(root, pkg) {
|
|
|
2151
2012
|
function ensurePnpmAllowBuilds(root, pkg) {
|
|
2152
2013
|
const configRoot = resolvePnpmConfigRoot(root, pkg);
|
|
2153
2014
|
const workspacePath = join(configRoot, "pnpm-workspace.yaml");
|
|
2015
|
+
const displayPath = configRoot === root ? "pnpm-workspace.yaml" : relative(root, workspacePath);
|
|
2154
2016
|
const before = existsSync(workspacePath) ? readFileSync(workspacePath, "utf-8") : "";
|
|
2155
|
-
const
|
|
2017
|
+
const inline = /^allowBuilds:[ \t]*([^\s#].*)$/m.exec(before)?.[1];
|
|
2018
|
+
if (inline !== void 0) {
|
|
2019
|
+
const missing = PNPM_BUILD_DEFAULTS.filter(([name]) => !new RegExp(`[{,]\\s*["']?${name}["']?\\s*:`).test(inline));
|
|
2020
|
+
if (missing.length > 0) log.warn(`Add ${missing.map(([name, value]) => `${name}: ${value}`).join(", ")} to allowBuilds in ${displayPath}. Void only edits allowBuilds when each entry is on its own line.`);
|
|
2021
|
+
return;
|
|
2022
|
+
}
|
|
2023
|
+
const legacy = removeTopLevelYamlBlock(before, "onlyBuiltDependencies");
|
|
2024
|
+
const current = removeTopLevelYamlBlock(legacy.yaml, "allowBuilds");
|
|
2025
|
+
const after = insertPnpmAllowBuilds(current.yaml, pnpmAllowBuildsYaml(current.removed, legacy.removed));
|
|
2156
2026
|
if (after !== before) {
|
|
2157
2027
|
writeFileSync(workspacePath, after);
|
|
2158
|
-
log.step(
|
|
2159
|
-
return true;
|
|
2028
|
+
log.step(`Updated ${displayPath} with approved builds`);
|
|
2160
2029
|
}
|
|
2161
|
-
return false;
|
|
2162
2030
|
}
|
|
2163
2031
|
function installProjectDependencies(root, packageManager) {
|
|
2164
|
-
|
|
2165
|
-
const
|
|
2032
|
+
const pkg = readPackageJson(root);
|
|
2033
|
+
const useVitePlus = pkg !== null && hasPackageDependency(pkg, "vite-plus");
|
|
2034
|
+
const installer = useVitePlus ? "vp" : packageManager;
|
|
2035
|
+
log.step(`Installing dependencies with ${installer}`);
|
|
2036
|
+
let command = installer;
|
|
2037
|
+
let args = useVitePlus || packageManager === "pnpm" ? ["install", "--no-frozen-lockfile"] : ["install"];
|
|
2038
|
+
if (useVitePlus) {
|
|
2039
|
+
let localBin;
|
|
2040
|
+
try {
|
|
2041
|
+
const require = createRequire(join(root, "package.json"));
|
|
2042
|
+
localBin = join(dirname(require.resolve("vite-plus/package.json")), "bin/vp");
|
|
2043
|
+
} catch {}
|
|
2044
|
+
if (localBin) {
|
|
2045
|
+
command = process.execPath;
|
|
2046
|
+
args = [localBin, ...args];
|
|
2047
|
+
} else if (spawnSync("vp", ["--version"], {
|
|
2048
|
+
cwd: root,
|
|
2049
|
+
stdio: "ignore",
|
|
2050
|
+
shell: process.platform === "win32",
|
|
2051
|
+
timeout: 5e3
|
|
2052
|
+
}).status !== 0) {
|
|
2053
|
+
command = "npx";
|
|
2054
|
+
const packageArg = `--package=vite-plus@${SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES["vite-plus"]}`;
|
|
2055
|
+
args = [
|
|
2056
|
+
"--yes",
|
|
2057
|
+
process.platform === "win32" ? `"${packageArg}"` : packageArg,
|
|
2058
|
+
"vp",
|
|
2059
|
+
...args
|
|
2060
|
+
];
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
const result = spawnSync(command, args, {
|
|
2166
2064
|
cwd: root,
|
|
2167
2065
|
stdio: "inherit",
|
|
2168
|
-
shell: process.platform === "win32"
|
|
2066
|
+
shell: command !== process.execPath && process.platform === "win32"
|
|
2169
2067
|
});
|
|
2170
2068
|
if (result.error) throw result.error;
|
|
2171
|
-
if (result.status !== 0) throw new Error(`${
|
|
2172
|
-
log.step(`Installed dependencies with ${
|
|
2069
|
+
if (result.status !== 0) throw new Error(`${installer} install failed with exit code ${result.status ?? "unknown"}`);
|
|
2070
|
+
log.step(`Installed dependencies with ${installer}`);
|
|
2173
2071
|
}
|
|
2174
2072
|
function generateStarterMigration(root, starterMode) {
|
|
2175
2073
|
const dialect = starterMode;
|
|
2176
|
-
const configPath = writeDrizzleConfig(root, dialect
|
|
2177
|
-
const
|
|
2178
|
-
const metaDir = join(migrationsDir, "meta");
|
|
2179
|
-
const journalPath = join(metaDir, "_journal.json");
|
|
2180
|
-
const migrationsDirExistedBefore = existsSync(migrationsDir);
|
|
2181
|
-
const metaDirExistedBefore = existsSync(metaDir);
|
|
2182
|
-
const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
|
|
2183
|
-
const snapshotsBefore = metaDirExistedBefore ? new Set(readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json"))) : /* @__PURE__ */ new Set();
|
|
2184
|
-
const sqlFilesBefore = migrationsDirExistedBefore ? new Set(readdirSync(migrationsDir).filter((f) => f.endsWith(".sql"))) : /* @__PURE__ */ new Set();
|
|
2074
|
+
const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[dialect], dialect);
|
|
2075
|
+
const rollBack = snapshotDrizzleOutputs(readProjectPaths(root).migrationsDir);
|
|
2185
2076
|
log.step("Generating initial Drizzle migration");
|
|
2186
2077
|
const result = spawnSync(process.execPath, [
|
|
2187
2078
|
drizzleKitBin,
|
|
@@ -2192,37 +2083,9 @@ function generateStarterMigration(root, starterMode) {
|
|
|
2192
2083
|
cwd: root,
|
|
2193
2084
|
stdio: "pipe",
|
|
2194
2085
|
encoding: "utf-8",
|
|
2195
|
-
shell: process.platform === "win32",
|
|
2196
2086
|
env: buildDrizzleKitSpawnEnv(root)
|
|
2197
2087
|
});
|
|
2198
|
-
if (
|
|
2199
|
-
if (originalJournalBytes !== null) try {
|
|
2200
|
-
writeFileSync(journalPath, originalJournalBytes);
|
|
2201
|
-
} catch {}
|
|
2202
|
-
else if (!metaDirExistedBefore && existsSync(metaDir)) try {
|
|
2203
|
-
for (const f of readdirSync(metaDir)) try {
|
|
2204
|
-
unlinkSync(join(metaDir, f));
|
|
2205
|
-
} catch {}
|
|
2206
|
-
try {
|
|
2207
|
-
rmdirSync(metaDir);
|
|
2208
|
-
} catch {}
|
|
2209
|
-
} catch {}
|
|
2210
|
-
if (metaDirExistedBefore && existsSync(metaDir)) {
|
|
2211
|
-
for (const f of readdirSync(metaDir)) if (f.endsWith("_snapshot.json") && !snapshotsBefore.has(f)) try {
|
|
2212
|
-
unlinkSync(join(metaDir, f));
|
|
2213
|
-
} catch {}
|
|
2214
|
-
}
|
|
2215
|
-
if (!migrationsDirExistedBefore && existsSync(migrationsDir)) try {
|
|
2216
|
-
for (const f of readdirSync(migrationsDir)) if (f.endsWith(".sql")) try {
|
|
2217
|
-
unlinkSync(join(migrationsDir, f));
|
|
2218
|
-
} catch {}
|
|
2219
|
-
} catch {}
|
|
2220
|
-
else if (migrationsDirExistedBefore && existsSync(migrationsDir)) {
|
|
2221
|
-
for (const f of readdirSync(migrationsDir)) if (f.endsWith(".sql") && !sqlFilesBefore.has(f)) try {
|
|
2222
|
-
unlinkSync(join(migrationsDir, f));
|
|
2223
|
-
} catch {}
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2088
|
+
if (result.error || result.status !== 0) rollBack();
|
|
2226
2089
|
if (result.error) throw result.error;
|
|
2227
2090
|
if (result.status !== 0) {
|
|
2228
2091
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
@@ -2276,8 +2139,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2276
2139
|
};
|
|
2277
2140
|
for (const [name, version] of Object.entries(template.dependencies)) ensureDependency("dependencies", name, version);
|
|
2278
2141
|
for (const [name, version] of Object.entries(template.devDependencies)) ensureDependency("devDependencies", name, version);
|
|
2279
|
-
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2280
|
-
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@12.4.1";
|
|
2142
|
+
if (packageManager === "pnpm" || isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2281
2143
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2282
2144
|
log.step("Updated package.json with starter scripts and dependencies");
|
|
2283
2145
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
@@ -2292,11 +2154,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2292
2154
|
}
|
|
2293
2155
|
return dependencyAdded;
|
|
2294
2156
|
}
|
|
2295
|
-
|
|
2296
|
-
return DEPENDENCY_FIELDS.some((field) => {
|
|
2297
|
-
return typeof asRecord(pkg[field])?.[name] === "string";
|
|
2298
|
-
});
|
|
2299
|
-
}
|
|
2157
|
+
/** Returns whether a dependency was added. */
|
|
2300
2158
|
function ensureExistingProjectPackage(root, options = {}) {
|
|
2301
2159
|
const packageJsonPath = join(root, "package.json");
|
|
2302
2160
|
const voidSpec = resolveScaffoldDependencySpec(root, "void", getOwnVersion());
|
|
@@ -2340,25 +2198,22 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2340
2198
|
}
|
|
2341
2199
|
const devDependencies = asRecord(pkg.devDependencies) ?? {};
|
|
2342
2200
|
pkg.devDependencies = devDependencies;
|
|
2343
|
-
if (!
|
|
2201
|
+
if (!hasPackageDependency(pkg, "void", DEPENDENCY_FIELDS)) {
|
|
2344
2202
|
devDependencies.void = voidSpec;
|
|
2345
2203
|
changed = true;
|
|
2346
2204
|
dependencyAdded = true;
|
|
2347
2205
|
}
|
|
2348
|
-
if (plainViteSetup && !
|
|
2206
|
+
if (plainViteSetup && !hasPackageDependency(pkg, "vite", DEPENDENCY_FIELDS)) {
|
|
2349
2207
|
devDependencies.vite = SCAFFOLD_BASE_DEV_DEPENDENCIES.vite;
|
|
2350
2208
|
changed = true;
|
|
2351
2209
|
dependencyAdded = true;
|
|
2352
2210
|
}
|
|
2353
|
-
|
|
2211
|
+
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2354
2212
|
if (changed) {
|
|
2355
2213
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2356
2214
|
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");
|
|
2357
2215
|
}
|
|
2358
|
-
return
|
|
2359
|
-
dependencyAdded,
|
|
2360
|
-
packageJsonMutated: changed || pnpmConfigChanged
|
|
2361
|
-
};
|
|
2216
|
+
return dependencyAdded;
|
|
2362
2217
|
}
|
|
2363
2218
|
function getBasicVoidViteConfig() {
|
|
2364
2219
|
return `import { defineConfig } from "vite";
|
|
@@ -2410,28 +2265,20 @@ function ensureExistingProjectViteConfig(root, framework) {
|
|
|
2410
2265
|
writeFileSync(fullPath, updated);
|
|
2411
2266
|
log.step(`Added voidPlugin() to ${configPath}`);
|
|
2412
2267
|
}
|
|
2268
|
+
/** Returns whether a dependency was added. */
|
|
2413
2269
|
function setupExistingProject(root, framework) {
|
|
2414
2270
|
log.info("Existing project detected. Configuring Void...");
|
|
2415
|
-
const
|
|
2271
|
+
const dependencyAdded = ensureExistingProjectPackage(root, { plainViteSetup: framework?.class !== "c" });
|
|
2416
2272
|
ensureExistingProjectViteConfig(root, framework);
|
|
2417
|
-
return
|
|
2273
|
+
return dependencyAdded;
|
|
2418
2274
|
}
|
|
2419
2275
|
/**
|
|
2420
|
-
* Scaffolds the
|
|
2421
|
-
*
|
|
2422
|
-
* `void/schema-d1`, so `void` MUST be present in `package.json` before
|
|
2423
|
-
* the caller runs `installProjectDependencies` +
|
|
2424
|
-
* `generateStarterMigration`; otherwise `drizzle-kit generate` cannot
|
|
2425
|
-
* resolve the schema imports. This function ensures `void` is declared,
|
|
2426
|
-
* preserving whatever spec is already there or adding the current CLI
|
|
2427
|
-
* version used by greenfield scaffolds.
|
|
2428
|
-
* `scaffoldPagesApp` has the same contract via its template; we just
|
|
2429
|
-
* replicate the "ensure void dep" slice here for the demo path.
|
|
2276
|
+
* Scaffolds the "SQL → types → handler → fetch" demo into an existing project.
|
|
2277
|
+
* `setupExistingProject` has already declared `void` in `package.json`.
|
|
2430
2278
|
*/
|
|
2431
2279
|
function scaffoldDemo(root) {
|
|
2432
2280
|
const devCommand = getDevCommand(root);
|
|
2433
2281
|
const paths = readProjectPaths(root);
|
|
2434
|
-
const packageJsonMutated = ensureVoidDependency(root);
|
|
2435
2282
|
mkdirSync(paths.dbDir, { recursive: true });
|
|
2436
2283
|
writeFileSync(paths.schemaFile, `import { sql } from "void/db";
|
|
2437
2284
|
import { integer, sqliteTable, text } from "void/schema-d1";
|
|
@@ -2472,61 +2319,6 @@ console.log(posts);
|
|
|
2472
2319
|
note(`SQL migration → DB types → Route handler → Route types → Typed fetch
|
|
2473
2320
|
|
|
2474
2321
|
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");
|
|
2475
|
-
return { packageJsonMutated };
|
|
2476
|
-
}
|
|
2477
|
-
/**
|
|
2478
|
-
* Ensures `void` is declared in `package.json`, creating the file if it
|
|
2479
|
-
* does not exist. This is a narrow, scaffoldDemo-specific helper:
|
|
2480
|
-
* `scaffoldPagesApp` handles greenfield projects via
|
|
2481
|
-
* `createPagesStarterTemplate` (which knows about adapters,
|
|
2482
|
-
* devDependencies, scripts, etc.); `scaffoldDemo` only needs enough in
|
|
2483
|
-
* `package.json` for `drizzle-kit generate` to resolve `void/schema-d1`
|
|
2484
|
-
* via `node_modules/void` after install.
|
|
2485
|
-
*/
|
|
2486
|
-
function ensureVoidDependency(root) {
|
|
2487
|
-
const packageJsonPath = join(root, "package.json");
|
|
2488
|
-
const voidSpec = resolveScaffoldDependencySpec(root, "void", getOwnVersion());
|
|
2489
|
-
let pkg = {};
|
|
2490
|
-
let existedBefore = false;
|
|
2491
|
-
if (existsSync(packageJsonPath)) {
|
|
2492
|
-
existedBefore = true;
|
|
2493
|
-
try {
|
|
2494
|
-
pkg = asRecord(JSON.parse(readFileSync(packageJsonPath, "utf-8"))) ?? {};
|
|
2495
|
-
} catch {
|
|
2496
|
-
throw new Error("Could not parse package.json while scaffolding demo");
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
const fallbackName = defaultPackageName(root);
|
|
2500
|
-
let changed = !existedBefore;
|
|
2501
|
-
if (!pkg.name || typeof pkg.name !== "string") {
|
|
2502
|
-
pkg.name = fallbackName;
|
|
2503
|
-
changed = true;
|
|
2504
|
-
}
|
|
2505
|
-
if (!existedBefore && pkg.private === void 0) {
|
|
2506
|
-
pkg.private = true;
|
|
2507
|
-
changed = true;
|
|
2508
|
-
}
|
|
2509
|
-
if (!existedBefore && !pkg.type) {
|
|
2510
|
-
pkg.type = "module";
|
|
2511
|
-
changed = true;
|
|
2512
|
-
}
|
|
2513
|
-
if (!pkg.devDependencies || typeof pkg.devDependencies !== "object" || Array.isArray(pkg.devDependencies)) pkg.devDependencies = {};
|
|
2514
|
-
if (!pkg.dependencies || typeof pkg.dependencies !== "object" || Array.isArray(pkg.dependencies)) pkg.dependencies = {};
|
|
2515
|
-
const devDependencies = asRecord(pkg.devDependencies) ?? {};
|
|
2516
|
-
pkg.devDependencies = devDependencies;
|
|
2517
|
-
if (!hasDeclaredDependency(pkg, "void")) {
|
|
2518
|
-
devDependencies.void = voidSpec;
|
|
2519
|
-
changed = true;
|
|
2520
|
-
}
|
|
2521
|
-
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2522
|
-
if (changed) {
|
|
2523
|
-
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2524
|
-
log.step(existedBefore ? "Ensured void is in package.json devDependencies" : "Created package.json with void as a devDependency");
|
|
2525
|
-
}
|
|
2526
|
-
return changed || pnpmConfigChanged;
|
|
2527
|
-
}
|
|
2528
|
-
function getOwnVersion() {
|
|
2529
|
-
return JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2530
2322
|
}
|
|
2531
2323
|
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-]+)*)?`;
|
|
2532
2324
|
const MARKER_CLOSE = "<!--/injected-by-void-->";
|
|
@@ -2600,7 +2392,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2600
2392
|
log.info(`Detected ${SCAFFOLD_FRAMEWORKS[detectedPagesFramework].label} adapter in package.json`);
|
|
2601
2393
|
} else scaffoldedPagesFramework = await promptScaffoldFramework();
|
|
2602
2394
|
const starterMode = await promptStarterMode();
|
|
2603
|
-
const
|
|
2395
|
+
const existingPackageJson = readPackageJson(root);
|
|
2396
|
+
const hasPackageManager = hasLocalLockfile(root) || existsSync(join(root, "pnpm-workspace.yaml")) || parsePackageManagerField(existingPackageJson) !== void 0 || resolveWorkspaceDeferral(root, existingPackageJson) !== void 0;
|
|
2397
|
+
const scaffoldPackageManager = scaffoldToolchain === "vite-plus" && !hasPackageManager ? "pnpm" : preScaffoldState.packageManager;
|
|
2604
2398
|
const scaffoldWroteDeps = scaffoldPagesApp(root, scaffoldPackageManager, scaffoldedPagesFramework, starterMode, scaffoldToolchain);
|
|
2605
2399
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2606
2400
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
@@ -2616,9 +2410,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2616
2410
|
const state = detectProjectState(root);
|
|
2617
2411
|
const pagesFramework = scaffoldedPagesFramework ?? detectPagesFramework(root);
|
|
2618
2412
|
if (!targeted && !didScaffoldStarter) {
|
|
2619
|
-
const
|
|
2413
|
+
const dependencyAdded = setupExistingProject(root, framework);
|
|
2620
2414
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
2621
|
-
if (
|
|
2415
|
+
if (dependencyAdded || !voidResolvable) {
|
|
2622
2416
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2623
2417
|
if (deferral) {
|
|
2624
2418
|
workspaceSubpackageSkip = true;
|
|
@@ -2643,27 +2437,25 @@ async function runInitCommand(root, initArgs) {
|
|
|
2643
2437
|
await injectAgentBlock(root, newProject);
|
|
2644
2438
|
const agents = detectAgents(root);
|
|
2645
2439
|
if (agents.length > 0) {
|
|
2646
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2440
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-BJsan98C.mjs");
|
|
2647
2441
|
linkSkillsForSpecificAgents(root, agents);
|
|
2648
2442
|
} else log.info("Bundled Void docs: node_modules/void/docs/");
|
|
2649
2443
|
if (!targeted && !framework) {
|
|
2650
2444
|
if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2651
|
-
else
|
|
2445
|
+
else {
|
|
2652
2446
|
const scaffold = await confirm({ message: "Scaffold demo code? (migration + API route + frontend fetch)" });
|
|
2653
2447
|
if (isCancel(scaffold)) {
|
|
2654
2448
|
cancel("Setup cancelled.");
|
|
2655
2449
|
process.exit(0);
|
|
2656
2450
|
}
|
|
2657
2451
|
if (scaffold) {
|
|
2658
|
-
|
|
2452
|
+
scaffoldDemo(root);
|
|
2659
2453
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
2660
2454
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2661
|
-
if (deferral &&
|
|
2662
|
-
workspaceSubpackageSkip = true;
|
|
2455
|
+
if (deferral && !voidResolvable) {
|
|
2663
2456
|
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
} else if (!voidResolvable || packageJsonMutated) scaffoldAddedDependencies = true;
|
|
2457
|
+
note(`Scaffolded the starter demo in ./${relRoot}.\n\nRun your workspace install from ${deferral.workspaceRoot} to pick up the new \`void\` dep,\nthen run \`void db generate\` from ./${relRoot} to create the initial migration.`, "Workspace subpackage");
|
|
2458
|
+
}
|
|
2667
2459
|
scaffoldedStarterMode = "sqlite";
|
|
2668
2460
|
}
|
|
2669
2461
|
}
|
|
@@ -2672,11 +2464,10 @@ async function runInitCommand(root, initArgs) {
|
|
|
2672
2464
|
let voidPlatformDiscovery = null;
|
|
2673
2465
|
if (!targeted && deploymentPlatform === "cloudflare") await setupCloudflareDeployment(root);
|
|
2674
2466
|
if (!targeted && deploymentPlatform === "void") voidPlatformDiscovery = await ensureVoidPlatformConnection(root);
|
|
2675
|
-
const githubStepSkipForSubpackage = workspaceSubpackage;
|
|
2676
2467
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2677
|
-
if (shouldSetupGithub && !
|
|
2468
|
+
if (shouldSetupGithub && !workspaceSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2678
2469
|
if (!voidPlatformDiscovery) {
|
|
2679
|
-
const { getApiUrl } = await import("./auth-
|
|
2470
|
+
const { getApiUrl } = await import("./auth-wn6F8dB8.mjs");
|
|
2680
2471
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2681
2472
|
}
|
|
2682
2473
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -2686,7 +2477,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2686
2477
|
shouldSetupGithub = false;
|
|
2687
2478
|
}
|
|
2688
2479
|
}
|
|
2689
|
-
if (shouldSetupGithub && !
|
|
2480
|
+
if (shouldSetupGithub && !workspaceSubpackage) {
|
|
2690
2481
|
if (targeted) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2691
2482
|
else {
|
|
2692
2483
|
const setupGha = await confirm({ message: "Create .github/workflows/void-deploy.yml to deploy on pushes to main?" });
|
|
@@ -2696,7 +2487,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2696
2487
|
}
|
|
2697
2488
|
if (setupGha) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2698
2489
|
}
|
|
2699
|
-
} else if (
|
|
2490
|
+
} else if (workspaceSubpackage && shouldSetupGithub) log.info("Skipping GitHub Actions setup: workflow files must live at the repo root, not in a workspace subpackage.");
|
|
2700
2491
|
if (!targeted) {
|
|
2701
2492
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2702
2493
|
if (scaffoldResult.written) {
|