void 0.27.0 → 1.0.3
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-BTcUzv9L.mjs} +6 -6
- package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
- package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-AB_YYWgH.mjs} +118 -135
- package/dist/{application-routing-DQyUh_5S.mjs → application-routing-L7V-TFhZ.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-Cbqi1iVX.mjs +1 -0
- package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DUJuvRx5.mjs} +11 -11
- package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
- package/dist/{auth-router-DvsCUVw4.mjs → auth-router-CIxiMG7i.mjs} +5 -5
- 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-BkIv25PA.mjs} +6 -6
- package/dist/{cache-CZRdzKx1.mjs → cache-Ctzfig-W.mjs} +6 -6
- package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CD9o-SsC.mjs} +5 -5
- 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-BU3hqdHu.mjs +1 -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 +199 -312
- package/dist/cli/cloudflare-operation-process.mjs +41 -15
- package/dist/cli/env-schema-probe.d.mts +7 -44
- package/dist/cli/env-schema-probe.mjs +14 -80
- package/dist/client-B60PwCC4.mjs +1 -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-BIAF_BIY.mjs} +7 -6
- package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
- package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-WjwnVOJA.mjs} +4 -4
- package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-B42EZeJy.mjs} +26 -34
- package/dist/cloudflare-operations-CrSUFRzJ.mjs +1 -0
- package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
- package/dist/collect-Cae8A7Zr.mjs +1 -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-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
- package/dist/config-QrJWu0IX.mjs +1 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-BfPBHHm-.mjs → connect-CKtk-EZe.mjs} +9 -9
- package/dist/create-project-B-ewF_Af.mjs +1 -0
- package/dist/{create-project-BdXEFKal.mjs → create-project-yInGo72M.mjs} +8 -8
- package/dist/database-provider.mjs +1 -2
- package/dist/{db-Xs80hcaA.mjs → db-7I_gfdVq.mjs} +177 -268
- package/dist/db-types-Bb4WBWIs.mjs +49 -0
- package/dist/{delete-d2vuou3j.mjs → delete-Cy-M1u-r.mjs} +6 -6
- package/dist/deploy-9lgfhrXS.mjs +2 -0
- package/dist/deploy-BYYlnsiy.mjs +6164 -0
- package/dist/deploy-managed-static-Ca4TFdmx.mjs +1595 -0
- package/dist/deploy-transport-DWlWBe6M.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-ClzFSwns.mjs +1 -0
- package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
- package/dist/dispatch-DrTTk8Xg.mjs +431 -0
- package/dist/{dist-D3m88sjf.mjs → dist-BVdsO7Py.mjs} +5 -6
- package/dist/dist-CfgIkieS.mjs +1 -0
- package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
- package/dist/{domain-BsDUBAvt.mjs → domain-CZGxPv9u.mjs} +8 -23
- package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
- package/dist/edge.mjs +1 -2
- package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
- package/dist/{email-_lGAHOhp.mjs → email-DzyNVuoU.mjs} +100 -192
- package/dist/email-cloudflare-DfG6UEMm.mjs +1096 -0
- package/dist/email-protocol-D9nTvhCp.mjs +82 -0
- package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
- package/dist/{env-DMA3cXZt.mjs → env-0jrMQJI_.mjs} +6 -14
- package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
- package/dist/{env-C74QepDE.mjs → env-Nx3yf50r.mjs} +9 -9
- package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
- package/dist/{env-raw-jZpP5n47.mjs → env-raw-D74P4ebM.mjs} +15 -21
- package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
- package/dist/env-validation-BT7z-qpQ.mjs +1 -0
- package/dist/env-validation-DYxjz_Wo.mjs +488 -0
- package/dist/{gen-DtkQhvQg.mjs → gen-CufHEf42.mjs} +132 -254
- package/dist/gen-sXyp5DFO.mjs +1 -0
- package/dist/generate-ClI89brV.mjs +1 -0
- package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
- package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
- package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-FU8EjFyU.mjs} +28 -72
- 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-BT2hovNI.mjs} +26 -14
- package/dist/help-i2YGGnTH.mjs +1 -0
- package/dist/{inbound-PfQDLXc5.mjs → inbound-BuTfm11U.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 +714 -762
- package/dist/{info-PYWwkWyt.mjs → info-l249eUdH.mjs} +5 -5
- package/dist/{init-DaBGmaXC.mjs → init-D0A6M64Q.mjs} +229 -392
- package/dist/isr-config-fZaJJ8t7.mjs +165 -0
- package/dist/{link-C6fjafep.mjs → link-WMoJFf4i.mjs} +9 -9
- package/dist/{list-BTFBlqKl.mjs → list-CQ2EQEHL.mjs} +7 -18
- package/dist/{live-CgQuTpqD.mjs → live-BcHoTDFe.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-BxvQYEFi.mjs} +6 -6
- package/dist/{login-GKcNUmtI.mjs → login-C2T1oVG-.mjs} +12 -12
- package/dist/login-XD844Xs-.mjs +1 -0
- package/dist/{logs-BiMSULmc.mjs → logs-DnC1d7xB.mjs} +6 -6
- package/dist/{migrate-NLsjBbuM.mjs → migrate-BDIprOYd.mjs} +70 -22
- package/dist/migrate-BRwU-blY.mjs +1 -0
- 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/mysql-migration-sql-BIS5vbNk.mjs +241 -0
- package/dist/nitro.d.mts +30 -0
- package/dist/nitro.mjs +88 -0
- package/dist/{node-DJicPvPj.mjs → node-cPadMgUO.mjs} +9 -25
- 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-D6gnZsnK.mjs +1 -0
- package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-DHieWtFp.mjs} +8 -8
- package/dist/{output-C50ag2r3.mjs → output-Ba6ZbrzY.mjs} +37 -6
- 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/head.mjs +1 -2
- 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/prefetch.mjs +1 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -2
- package/dist/plan-CKX_jWnD.mjs +1 -0
- package/dist/platform-args-B0HeTh0C.mjs +1 -0
- package/dist/{platform-args-DUeXY9Om.mjs → platform-args-CaCL_1Ch.mjs} +43 -60
- package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-Z16-I8nT.mjs} +11 -12
- package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-BXwZiJSF.mjs} +37 -27
- package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-CXjfqyOv.mjs} +9 -10
- package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DaAOiWTl.mjs} +16 -16
- package/dist/platform-cmd-PT4YwMLM.mjs +1 -0
- package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
- package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-CxpvUeo0.mjs} +6 -6
- package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DBiS0cJd.mjs} +1693 -2120
- package/dist/platform-lifecycle-u9pMOvxC.mjs +1 -0
- package/dist/{platform-management-CuuVDhyt.mjs → platform-management-DhEFdQAf.mjs} +696 -130
- package/dist/platform-management-DvBS83rC.mjs +1 -0
- package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-BWn1S2Rv.mjs} +16 -12
- package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-BUGOB4RC.mjs} +6 -9
- package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
- package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-YvN9VQXV.mjs} +21 -28
- package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
- package/dist/prepare-CYT6tAzD.mjs +1 -0
- package/dist/{prepare-Do96654b.mjs → prepare-DEB5SeVJ.mjs} +12 -13
- package/dist/{prepare-Dq9hTIbo.mjs → prepare-PQCgsny0.mjs} +4 -4
- 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 +1 -2
- package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-DVatD8Ev.mjs} +20 -20
- 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-slug-6cyz8E7k.mjs +1 -0
- package/dist/{project-team-Q_lCA7Io.mjs → project-team-DJrWEAG1.mjs} +7 -7
- package/dist/{project-token-BArgK9o1.mjs → project-token-CBgLBuL6.mjs} +6 -6
- package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
- package/dist/project-zdB3fs9G.mjs +1 -0
- package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-92gLtZ25.mjs} +6 -6
- 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-BnSSkiED.mjs} +119 -866
- package/dist/{requests-C7Oeoh5u.mjs → requests-7W1Pygt2.mjs} +5 -5
- package/dist/resolve-project-PnhzMtY6.mjs +1 -0
- package/dist/resolve-project-WpwkCB_c.mjs +48 -0
- package/dist/{rollback-DVAtrLAl.mjs → rollback-BcASVnwP.mjs} +8 -18
- package/dist/{route-types-CbtsIeFn.mjs → route-types-BZi26DVS.mjs} +9 -91
- package/dist/routing-assets-VkrKIbxE.mjs +139 -0
- package/dist/{runner-DMBKSrRk.mjs → runner-CabsQ-iM.mjs} +22 -34
- package/dist/runner-So9mYfcm.mjs +1 -0
- package/dist/runner-mysql-BhRaONkO.mjs +146 -0
- package/dist/runner-mysql-DWwE8jKi.mjs +1 -0
- package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-BRemq_GX.mjs} +3 -3
- package/dist/runner-pg-_Xncr3H5.mjs +1 -0
- package/dist/runtime/ai.mjs +23 -25
- package/dist/runtime/auth-client-react.mjs +1 -2
- package/dist/runtime/auth-client-solid.mjs +1 -2
- package/dist/runtime/auth-client-svelte.mjs +1 -2
- package/dist/runtime/auth-client-vue.mjs +1 -2
- package/dist/runtime/auth-client.mjs +1 -2
- package/dist/runtime/auth.mjs +1 -2
- package/dist/runtime/better-auth-mysql.d.mts +2 -5
- package/dist/runtime/better-auth-mysql.mjs +9 -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 +6 -2
- package/dist/runtime/durable.d.mts +18 -1
- 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 +1 -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 -2
- 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/limits.mjs +1 -2
- package/dist/runtime/live-client.d.mts +3 -2
- package/dist/runtime/live-server.d.mts +2 -1
- package/dist/runtime/live-server.mjs +1 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -2
- package/dist/runtime/log.d.mts +2 -1
- package/dist/runtime/migration-handler-mysql.d.mts +2 -2
- package/dist/runtime/migration-handler-mysql.mjs +39 -8
- 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 +1 -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/response.mjs +1 -2
- package/dist/runtime/route-url.mjs +1 -2
- package/dist/runtime/routing.d.mts +3 -5
- package/dist/runtime/routing.mjs +82 -218
- package/dist/runtime/sandbox-container.d.mts +2 -2
- package/dist/runtime/sandbox-container.mjs +1 -2
- package/dist/runtime/sandbox.d.mts +2 -2
- package/dist/runtime/sandbox.mjs +13 -6
- package/dist/runtime/seed.d.mts +2 -1
- package/dist/runtime/sse.mjs +1 -2
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -2
- package/dist/runtime/ws-server.d.mts +4 -4
- 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-a9LRUtii.mjs} +13 -2
- 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-bg73f1Ge.mjs} +63 -81
- package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
- package/dist/{skills-BgVMvQdy.mjs → skills-C_yRTg0g.mjs} +3 -3
- package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-Bm3ZlYgA.mjs} +39 -44
- package/dist/sveltekit.d.mts +2 -1
- package/dist/sveltekit.mjs +1 -1
- package/dist/validate-BQFdf0Pi.mjs +1 -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/wrapper-CwhpNWtH.mjs +663 -0
- package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
- package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
- package/docs/guide/ai.md +8 -2
- package/docs/guide/auth.md +2 -0
- package/docs/guide/database/mysql.md +14 -3
- package/docs/guide/database/postgresql.md +2 -0
- package/docs/guide/database.md +3 -5
- package/docs/guide/durable-state.md +32 -4
- 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 +21 -3
- package/docs/guide/platform/installation/domains.md +1 -1
- package/docs/guide/platform/installation/maintenance.md +38 -1
- package/docs/guide/platform/installation/prerequisites.md +6 -2
- package/docs/guide/platform/installation/setup.md +23 -1
- package/docs/guide/platform/installation/uninstall.md +6 -1
- package/docs/guide/quickstart.md +2 -0
- package/docs/guide/sandboxes.md +3 -1
- package/docs/guide/self-hosted-platform.md +1 -1
- package/docs/integrations/cloudflare.md +2 -2
- package/docs/integrations/frameworks/analog.md +3 -11
- package/docs/integrations/frameworks/nuxt.md +7 -10
- package/docs/integrations/nodejs-bun-deno.md +2 -0
- package/docs/reference/api/deploy.md +23 -0
- package/docs/reference/api/pages.md +2 -0
- package/docs/reference/api.md +3 -1
- package/docs/reference/cli/database.md +9 -3
- package/docs/reference/cli/platform-installation.md +19 -7
- package/docs/reference/cli/setup.md +2 -0
- package/docs/reference/config.md +2 -0
- package/package.json +39 -36
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +2 -1
- 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/cloudflare-operations-BlYLlowZ.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/create-project-qFDC45zg.mjs +0 -2
- 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-Bx1z6Eva.mjs +0 -2
- package/dist/dist-_UUlL6bg.mjs +0 -2
- package/dist/env-validation-CrVNjsPm.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/plan-CH2G51je.mjs +0 -2
- package/dist/platform-args-D4E1PjVw.mjs +0 -2
- package/dist/platform-cmd-BbmJiq5O.mjs +0 -2
- package/dist/platform-lifecycle-ByAlpkhV.mjs +0 -2
- package/dist/platform-management-CBOT4BSM.mjs +0 -2
- package/dist/prepare-DRUV-g3X.mjs +0 -2
- package/dist/project-DedqCp59.mjs +0 -2
- package/dist/project-slug-DofjTFd-.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-9wjsSZx-.mjs +0 -2
- package/dist/runner-mysql-CEzKtmFb.mjs +0 -54
- 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,34 +1,36 @@
|
|
|
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-BVdsO7Py.mjs";
|
|
12
|
+
import { l as formatUrl, m as printSuccess, p as note } from "./output-Ba6ZbrzY.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-yInGo72M.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-C2T1oVG-.mjs";
|
|
22
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-DaAOiWTl.mjs";
|
|
23
|
+
import { t as connectCloudflare } from "./cloudflare-connect-WjwnVOJA.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-BDIprOYd.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";
|
|
33
|
+
import { parseDocument } from "yaml";
|
|
32
34
|
//#region src/cli/deploy-setup.ts
|
|
33
35
|
async function maybeSetupDeployProject(root) {
|
|
34
36
|
const existing = readProjectConfig(root);
|
|
@@ -57,7 +59,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
57
59
|
projectId: result.project.id,
|
|
58
60
|
slug: result.project.slug
|
|
59
61
|
};
|
|
60
|
-
writeProjectConfig(root, attachSelectedPlatform(
|
|
62
|
+
writeProjectConfig(root, attachSelectedPlatform(config, client.apiUrl));
|
|
61
63
|
log.step(`Linked project: ${config.slug}`);
|
|
62
64
|
return config;
|
|
63
65
|
}
|
|
@@ -227,7 +229,10 @@ const SCAFFOLD_BASE_DEV_DEPENDENCIES = {
|
|
|
227
229
|
vite: "^8.0.10",
|
|
228
230
|
typescript: "^7.0.2"
|
|
229
231
|
};
|
|
230
|
-
const SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES = {
|
|
232
|
+
const SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES = {
|
|
233
|
+
vite: "npm:@voidzero-dev/vite-plus-core@^1.2.0",
|
|
234
|
+
"vite-plus": "^1.2.0"
|
|
235
|
+
};
|
|
231
236
|
const SCAFFOLD_TOOLCHAIN_OPTIONS = [{
|
|
232
237
|
value: "vite-plus",
|
|
233
238
|
label: "Vite+",
|
|
@@ -650,6 +655,41 @@ export default function HomePage(props: Props) {
|
|
|
650
655
|
}
|
|
651
656
|
}
|
|
652
657
|
//#endregion
|
|
658
|
+
//#region src/cli/init-vite-plus.ts
|
|
659
|
+
/** Keep every Vite consumer on the core used by the selected Vite+ toolchain. */
|
|
660
|
+
function configureVitePlusScaffold(root, packageManager, pkg) {
|
|
661
|
+
const core = SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES.vite;
|
|
662
|
+
if (packageManager === "pnpm") editYaml(root, "pnpm-workspace.yaml", (document) => {
|
|
663
|
+
if (document.hasIn(["overrides", "vite"])) document.deleteIn(["overrides", "vite"]);
|
|
664
|
+
document.setIn(["overrides", "vite@*"], core);
|
|
665
|
+
document.setIn([
|
|
666
|
+
"peerDependencyRules",
|
|
667
|
+
"allowedVersions",
|
|
668
|
+
"vite"
|
|
669
|
+
], "*");
|
|
670
|
+
});
|
|
671
|
+
else if (packageManager === "yarn") {
|
|
672
|
+
pkg.resolutions = {
|
|
673
|
+
...pkg.resolutions,
|
|
674
|
+
vite: core
|
|
675
|
+
};
|
|
676
|
+
editYaml(root, ".yarnrc.yml", (document) => {
|
|
677
|
+
document.set("nodeLinker", "node-modules");
|
|
678
|
+
});
|
|
679
|
+
} else pkg.overrides = {
|
|
680
|
+
...pkg.overrides,
|
|
681
|
+
vite: packageManager === "npm" ? "$vite" : core
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function editYaml(root, name, edit) {
|
|
685
|
+
const path = join(root, name);
|
|
686
|
+
const before = existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
687
|
+
const document = parseDocument(before);
|
|
688
|
+
if (document.errors.length) throw new Error(`Could not parse ${name}: ${document.errors[0].message}`);
|
|
689
|
+
edit(document);
|
|
690
|
+
writeFileSync(path, document.toString());
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
653
693
|
//#region src/cli/vite-config-patch.ts
|
|
654
694
|
function unwrap(node) {
|
|
655
695
|
while (node && [
|
|
@@ -763,6 +803,7 @@ const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
|
763
803
|
"CLAUDE.md",
|
|
764
804
|
".node-version",
|
|
765
805
|
".npmrc",
|
|
806
|
+
".yarnrc.yml",
|
|
766
807
|
".nvmrc",
|
|
767
808
|
".editorconfig",
|
|
768
809
|
".vscode",
|
|
@@ -796,12 +837,13 @@ const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
|
796
837
|
".windsurf",
|
|
797
838
|
".zencoder"
|
|
798
839
|
]);
|
|
799
|
-
const
|
|
800
|
-
"
|
|
801
|
-
"
|
|
802
|
-
"
|
|
840
|
+
const PNPM_BUILD_DEFAULTS = [
|
|
841
|
+
["better-sqlite3", false],
|
|
842
|
+
["esbuild", true],
|
|
843
|
+
["sharp", true],
|
|
844
|
+
["workerd", true]
|
|
803
845
|
];
|
|
804
|
-
const
|
|
846
|
+
const PNPM_BUILD_PLACEHOLDER = "set this to true or false";
|
|
805
847
|
const EMPTY_PROJECT_ALLOWED_PACKAGES = /* @__PURE__ */ new Set([
|
|
806
848
|
"void",
|
|
807
849
|
"hono",
|
|
@@ -863,8 +905,7 @@ const VITE_CONFIG_FILES = [
|
|
|
863
905
|
];
|
|
864
906
|
const VOID_CONFIG_FILE = "void.json";
|
|
865
907
|
function asRecord(value) {
|
|
866
|
-
|
|
867
|
-
return value;
|
|
908
|
+
return isRecord(value) ? value : null;
|
|
868
909
|
}
|
|
869
910
|
function parseJsoncFile(path) {
|
|
870
911
|
const errors = [];
|
|
@@ -1091,27 +1132,9 @@ function parsePackageManagerField(pkg) {
|
|
|
1091
1132
|
if (name === "npm" || name === "pnpm" || name === "yarn" || name === "bun") return name;
|
|
1092
1133
|
}
|
|
1093
1134
|
/**
|
|
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.
|
|
1135
|
+
* Whether pnpm manages `root`. pnpm keeps the lockfile and Corepack pin at the
|
|
1136
|
+
* workspace root, so a member without local markers inherits them, but a local
|
|
1137
|
+
* lockfile or pin for another manager always wins.
|
|
1115
1138
|
*/
|
|
1116
1139
|
function isPnpmProject(root, pkg) {
|
|
1117
1140
|
if (existsSync(join(root, "pnpm-lock.yaml"))) return true;
|
|
@@ -1123,23 +1146,8 @@ function isPnpmProject(root, pkg) {
|
|
|
1123
1146
|
return hasAncestorPnpmMarkers(root);
|
|
1124
1147
|
}
|
|
1125
1148
|
/**
|
|
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.
|
|
1149
|
+
* Whether `start` is a declared member of a pnpm-managed ancestor workspace.
|
|
1150
|
+
* A scratch app outside the workspace globs is a separate project.
|
|
1143
1151
|
*/
|
|
1144
1152
|
function hasAncestorPnpmMarkers(start) {
|
|
1145
1153
|
const workspaceRoot = findWorkspaceRoot(start);
|
|
@@ -1154,30 +1162,8 @@ function hasAncestorPnpmMarkers(start) {
|
|
|
1154
1162
|
return false;
|
|
1155
1163
|
}
|
|
1156
1164
|
/**
|
|
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.
|
|
1165
|
+
* Whether `void` resolves from `start`, through an ancestor `node_modules`
|
|
1166
|
+
* (hoisted workspace installs) or an installed Yarn PnP runtime.
|
|
1181
1167
|
*/
|
|
1182
1168
|
function isVoidResolvableFrom(start) {
|
|
1183
1169
|
let dir = start;
|
|
@@ -1197,7 +1183,6 @@ function isVoidResolvableFrom(start) {
|
|
|
1197
1183
|
const probe = spawnSync(process.execPath, probeArgs, {
|
|
1198
1184
|
cwd: start,
|
|
1199
1185
|
stdio: "ignore",
|
|
1200
|
-
shell: process.platform === "win32",
|
|
1201
1186
|
env: buildDrizzleKitSpawnEnv(start)
|
|
1202
1187
|
});
|
|
1203
1188
|
return !probe.error && probe.status === 0;
|
|
@@ -1205,13 +1190,8 @@ function isVoidResolvableFrom(start) {
|
|
|
1205
1190
|
return false;
|
|
1206
1191
|
}
|
|
1207
1192
|
/**
|
|
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.
|
|
1193
|
+
* Nearest ancestor of `start` (excluding `start`) with a `pnpm-workspace.yaml`
|
|
1194
|
+
* or a `package.json#workspaces` field.
|
|
1215
1195
|
*/
|
|
1216
1196
|
function findWorkspaceRoot(start) {
|
|
1217
1197
|
let dir = dirname(start);
|
|
@@ -1228,18 +1208,8 @@ function findWorkspaceRoot(start) {
|
|
|
1228
1208
|
}
|
|
1229
1209
|
}
|
|
1230
1210
|
/**
|
|
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.
|
|
1211
|
+
* Member globs from `pnpm-workspace.yaml#packages` or `package.json#workspaces`
|
|
1212
|
+
* (an array or `{ packages }`). Empty when none can be read.
|
|
1243
1213
|
*/
|
|
1244
1214
|
function readWorkspacePatterns(workspaceRoot) {
|
|
1245
1215
|
const pnpmWorkspacePath = join(workspaceRoot, "pnpm-workspace.yaml");
|
|
@@ -1261,16 +1231,7 @@ function readWorkspacePatterns(workspaceRoot) {
|
|
|
1261
1231
|
}
|
|
1262
1232
|
return [];
|
|
1263
1233
|
}
|
|
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
|
-
*/
|
|
1234
|
+
/** Strip a trailing YAML comment, keeping `#` inside quotes (`- "path #hash/*"`). */
|
|
1274
1235
|
function stripYamlLineComment(line) {
|
|
1275
1236
|
let inSingle = false;
|
|
1276
1237
|
let inDouble = false;
|
|
@@ -1297,23 +1258,8 @@ function stripYamlLineComment(line) {
|
|
|
1297
1258
|
return line;
|
|
1298
1259
|
}
|
|
1299
1260
|
/**
|
|
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.
|
|
1261
|
+
* Read the `packages:` list of a `pnpm-workspace.yaml` in block (`- 'apps/*'`)
|
|
1262
|
+
* or flow (`packages: ['apps/*']`) form.
|
|
1317
1263
|
*/
|
|
1318
1264
|
function extractPnpmWorkspacePackages(yaml) {
|
|
1319
1265
|
const lines = yaml.split(/\r?\n/);
|
|
@@ -1345,14 +1291,7 @@ function extractPnpmWorkspacePackages(yaml) {
|
|
|
1345
1291
|
}
|
|
1346
1292
|
return patterns;
|
|
1347
1293
|
}
|
|
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
|
-
*/
|
|
1294
|
+
/** Expand `{a,b}` brace groups, including several groups in one pattern. */
|
|
1356
1295
|
function expandBraces(pattern) {
|
|
1357
1296
|
const match = pattern.match(/^([^{}]*)\{([^{}]*)\}(.*)$/);
|
|
1358
1297
|
if (!match) return [pattern];
|
|
@@ -1363,19 +1302,6 @@ function expandBraces(pattern) {
|
|
|
1363
1302
|
for (const opt of options) for (const sub of expandBraces(before + opt + after)) results.push(sub);
|
|
1364
1303
|
return results;
|
|
1365
1304
|
}
|
|
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
1305
|
function matchesWorkspacePattern(relPath, pattern) {
|
|
1380
1306
|
return expandBraces(pattern).some((p) => matchesSingleWorkspacePattern(relPath, p));
|
|
1381
1307
|
}
|
|
@@ -1412,21 +1338,8 @@ function matchSegments(path, pi, pat, qi) {
|
|
|
1412
1338
|
return pi === path.length;
|
|
1413
1339
|
}
|
|
1414
1340
|
/**
|
|
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.
|
|
1341
|
+
* Whether `root` matches a workspace glob and no `!` glob. A nested app outside
|
|
1342
|
+
* the globs is a separate project.
|
|
1430
1343
|
*/
|
|
1431
1344
|
function isWorkspaceSubpackage(workspaceRoot, root) {
|
|
1432
1345
|
const relPath = relative(workspaceRoot, root);
|
|
@@ -1444,31 +1357,15 @@ function isWorkspaceSubpackage(workspaceRoot, root) {
|
|
|
1444
1357
|
}
|
|
1445
1358
|
return matched;
|
|
1446
1359
|
}
|
|
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
|
-
*/
|
|
1360
|
+
/** Workspace membership, even when the member manages its own install. */
|
|
1456
1361
|
function isInsideWorkspaceSubpackage(root) {
|
|
1457
1362
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
1458
1363
|
if (workspaceRoot === void 0) return false;
|
|
1459
1364
|
return isWorkspaceSubpackage(workspaceRoot, root);
|
|
1460
1365
|
}
|
|
1461
1366
|
/**
|
|
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.
|
|
1367
|
+
* The workspace root that should install for `root`: set when `root` is a
|
|
1368
|
+
* member without its own lockfile or non-pnpm Corepack pin, as in `isPnpmProject`.
|
|
1472
1369
|
*/
|
|
1473
1370
|
function resolveWorkspaceDeferral(root, pkg) {
|
|
1474
1371
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
@@ -1504,7 +1401,6 @@ function detectProjectState(root) {
|
|
|
1504
1401
|
return {
|
|
1505
1402
|
hasTypescript,
|
|
1506
1403
|
hasTsconfig: existsSync(join(root, "tsconfig.json")),
|
|
1507
|
-
hasGithubWorkflows: existsSync(join(root, ".github", "workflows")),
|
|
1508
1404
|
hasRoutes: existsSync(paths.routesDir),
|
|
1509
1405
|
hasMigrations: existsSync(paths.migrationsDir) || existsSync(join(root, "migrations")),
|
|
1510
1406
|
hasPages: existsSync(paths.pagesDir),
|
|
@@ -1527,29 +1423,20 @@ function detectPagesFramework(root) {
|
|
|
1527
1423
|
...asRecord(pkg.devDependencies) ?? {}
|
|
1528
1424
|
});
|
|
1529
1425
|
}
|
|
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
1426
|
const DEPENDENCY_FIELDS = [
|
|
1538
1427
|
"dependencies",
|
|
1539
1428
|
"devDependencies",
|
|
1540
1429
|
"peerDependencies",
|
|
1541
1430
|
"optionalDependencies"
|
|
1542
1431
|
];
|
|
1543
|
-
|
|
1432
|
+
/** The first declared spec for `packageName`, in `DEPENDENCY_FIELDS` order. */
|
|
1433
|
+
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1544
1434
|
const pkg = readPackageJson(root);
|
|
1545
|
-
if (!pkg) return;
|
|
1546
1435
|
for (const field of DEPENDENCY_FIELDS) {
|
|
1547
|
-
const
|
|
1548
|
-
if (typeof
|
|
1436
|
+
const spec = asRecord(pkg?.[field])?.[packageName];
|
|
1437
|
+
if (typeof spec === "string") return spec || fallbackVersion;
|
|
1549
1438
|
}
|
|
1550
|
-
|
|
1551
|
-
function resolveScaffoldDependencySpec(root, packageName, fallbackVersion) {
|
|
1552
|
-
return getDeclaredDependencySpec(root, packageName) || fallbackVersion;
|
|
1439
|
+
return fallbackVersion;
|
|
1553
1440
|
}
|
|
1554
1441
|
function defaultPackageName(root) {
|
|
1555
1442
|
return basename(root).toLowerCase().replace(/[^a-z0-9-]/g, "-") || "my-app";
|
|
@@ -1885,7 +1772,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1885
1772
|
let selectedApiUrl = null;
|
|
1886
1773
|
let promptedForPlatform = false;
|
|
1887
1774
|
try {
|
|
1888
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1775
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-Cbqi1iVX.mjs");
|
|
1889
1776
|
selectedApiUrl = getApiUrl(root);
|
|
1890
1777
|
getSiteDomain(root);
|
|
1891
1778
|
} catch (error) {
|
|
@@ -1905,7 +1792,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1905
1792
|
}
|
|
1906
1793
|
const discovery = await discoverPlatform(selectedApiUrl);
|
|
1907
1794
|
saveDiscoveredPlatform(discovery);
|
|
1908
|
-
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
1795
|
+
if (promptedForPlatform) log.step(`Connected to ${discovery.displayName} at ${formatUrl(discovery.apiUrl)}.`);
|
|
1909
1796
|
return discovery;
|
|
1910
1797
|
}
|
|
1911
1798
|
async function setupCloudflareDeployment(root) {
|
|
@@ -1965,17 +1852,9 @@ function getWorkflowSetupSteps(root, pm) {
|
|
|
1965
1852
|
}
|
|
1966
1853
|
}
|
|
1967
1854
|
/**
|
|
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.
|
|
1855
|
+
* The deploy workflow. Void deploys exchange a GitHub OIDC token (`id-token: write`)
|
|
1856
|
+
* at deploy time, so no long-lived token is stored. Without a `slug`, the workflow
|
|
1857
|
+
* reads a `vars.VOID_PROJECT` repository variable.
|
|
1979
1858
|
*/
|
|
1980
1859
|
function getWorkflowYaml(root, pm, slug, platform = "void", platformApiUrl) {
|
|
1981
1860
|
const { setup, install, runner } = getWorkflowSetupSteps(root, pm);
|
|
@@ -2068,15 +1947,8 @@ function setupGithubActions(root, state, platform = "void", platformApiUrl) {
|
|
|
2068
1947
|
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
1948
|
}
|
|
2070
1949
|
/**
|
|
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).
|
|
1950
|
+
* Replace the `vars.VOID_PROJECT` placeholder in `void-deploy.yml` with a slug
|
|
1951
|
+
* linked after the workflow was written. Returns false when there is none.
|
|
2080
1952
|
*/
|
|
2081
1953
|
function patchWorkflowProjectSlug(root, slug) {
|
|
2082
1954
|
const workflowPath = join(root, ".github", "workflows", "void-deploy.yml");
|
|
@@ -2110,9 +1982,11 @@ function ensureGitignore(root) {
|
|
|
2110
1982
|
writeFileSync(gitignorePath, content + separator + missing.join("\n") + "\n");
|
|
2111
1983
|
log.step("Updated .gitignore with Void defaults");
|
|
2112
1984
|
}
|
|
1985
|
+
/** Removes each block-style top-level `key:` block; `removed` holds its non-blank lines. */
|
|
2113
1986
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
2114
1987
|
const lines = yaml.split(/\r?\n/);
|
|
2115
1988
|
const next = [];
|
|
1989
|
+
const removed = [];
|
|
2116
1990
|
for (let i = 0; i < lines.length; i += 1) {
|
|
2117
1991
|
const line = lines[i];
|
|
2118
1992
|
if (!new RegExp(`^${key}:\\s*(?:#.*)?$`).test(line)) {
|
|
@@ -2120,19 +1994,46 @@ function removeTopLevelYamlBlock(yaml, key) {
|
|
|
2120
1994
|
continue;
|
|
2121
1995
|
}
|
|
2122
1996
|
i += 1;
|
|
2123
|
-
while (i < lines.length && (lines[i].trim() === "" ||
|
|
1997
|
+
while (i < lines.length && (lines[i].trim() === "" || /^(?:\s|-(?:\s|$))/.test(lines[i]))) {
|
|
1998
|
+
if (lines[i].trim() !== "") removed.push(lines[i]);
|
|
1999
|
+
i += 1;
|
|
2000
|
+
}
|
|
2124
2001
|
i -= 1;
|
|
2125
2002
|
}
|
|
2126
|
-
return
|
|
2003
|
+
return {
|
|
2004
|
+
yaml: next.join("\n"),
|
|
2005
|
+
removed
|
|
2006
|
+
};
|
|
2127
2007
|
}
|
|
2128
|
-
function
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2008
|
+
function pnpmAllowBuildsEntryName(line) {
|
|
2009
|
+
return /^\s+(?!#)(["']?)(.+?)\1\s*:(?:\s|$)/.exec(line)?.[2];
|
|
2010
|
+
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Keeps the existing `allowBuilds` entries as written, approves the legacy
|
|
2013
|
+
* `onlyBuiltDependencies` list, and adds each Void default that is missing.
|
|
2014
|
+
*/
|
|
2015
|
+
function pnpmAllowBuildsYaml(entries, legacyList) {
|
|
2016
|
+
const legacy = legacyList.flatMap((line) => {
|
|
2017
|
+
const name = /^\s*-\s+(["']?)(.+?)\1\s*(?:#.*)?$/.exec(line)?.[2];
|
|
2018
|
+
return name === void 0 ? [] : [name];
|
|
2019
|
+
});
|
|
2020
|
+
const decided = /* @__PURE__ */ new Set([...legacy, ...PNPM_BUILD_DEFAULTS.map(([name]) => name)]);
|
|
2021
|
+
const lines = entries.filter((line) => {
|
|
2022
|
+
const name = pnpmAllowBuildsEntryName(line);
|
|
2023
|
+
return !(name !== void 0 && decided.has(name) && line.includes(PNPM_BUILD_PLACEHOLDER));
|
|
2024
|
+
});
|
|
2025
|
+
const names = new Set(lines.map((line) => pnpmAllowBuildsEntryName(line)));
|
|
2026
|
+
const firstEntry = lines.find((line) => pnpmAllowBuildsEntryName(line) !== void 0);
|
|
2027
|
+
const indent = /^\s+/.exec(firstEntry ?? "")?.[0] ?? " ";
|
|
2028
|
+
const additions = [...legacy.map((name) => [name, true]), ...PNPM_BUILD_DEFAULTS];
|
|
2029
|
+
for (const [name, value] of additions) if (!names.has(name)) {
|
|
2030
|
+
names.add(name);
|
|
2031
|
+
lines.push(`${indent}${/^[\w.-]+$/.test(name) ? name : JSON.stringify(name)}: ${value}`);
|
|
2032
|
+
}
|
|
2033
|
+
return ["allowBuilds:", ...lines].join("\n");
|
|
2132
2034
|
}
|
|
2133
|
-
function insertPnpmAllowBuilds(yaml) {
|
|
2035
|
+
function insertPnpmAllowBuilds(yaml, allowBuilds) {
|
|
2134
2036
|
const trimmed = yaml.trim();
|
|
2135
|
-
const allowBuilds = pnpmAllowBuildsYaml();
|
|
2136
2037
|
if (trimmed === "") return `${allowBuilds}\n`;
|
|
2137
2038
|
const lines = trimmed.split(/\r?\n/);
|
|
2138
2039
|
const packagesIndex = lines.findIndex((line) => /^packages:\s*(?:#.*)?$/.test(line));
|
|
@@ -2151,37 +2052,67 @@ function resolvePnpmConfigRoot(root, pkg) {
|
|
|
2151
2052
|
function ensurePnpmAllowBuilds(root, pkg) {
|
|
2152
2053
|
const configRoot = resolvePnpmConfigRoot(root, pkg);
|
|
2153
2054
|
const workspacePath = join(configRoot, "pnpm-workspace.yaml");
|
|
2055
|
+
const displayPath = configRoot === root ? "pnpm-workspace.yaml" : relative(root, workspacePath);
|
|
2154
2056
|
const before = existsSync(workspacePath) ? readFileSync(workspacePath, "utf-8") : "";
|
|
2155
|
-
const
|
|
2057
|
+
const inline = /^allowBuilds:[ \t]*([^\s#].*)$/m.exec(before)?.[1];
|
|
2058
|
+
if (inline !== void 0) {
|
|
2059
|
+
const missing = PNPM_BUILD_DEFAULTS.filter(([name]) => !new RegExp(`[{,]\\s*["']?${name}["']?\\s*:`).test(inline));
|
|
2060
|
+
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.`);
|
|
2061
|
+
return;
|
|
2062
|
+
}
|
|
2063
|
+
const legacy = removeTopLevelYamlBlock(before, "onlyBuiltDependencies");
|
|
2064
|
+
const current = removeTopLevelYamlBlock(legacy.yaml, "allowBuilds");
|
|
2065
|
+
const after = insertPnpmAllowBuilds(current.yaml, pnpmAllowBuildsYaml(current.removed, legacy.removed));
|
|
2156
2066
|
if (after !== before) {
|
|
2157
2067
|
writeFileSync(workspacePath, after);
|
|
2158
|
-
log.step(
|
|
2159
|
-
return true;
|
|
2068
|
+
log.step(`Updated ${displayPath} with approved builds`);
|
|
2160
2069
|
}
|
|
2161
|
-
return false;
|
|
2162
2070
|
}
|
|
2163
2071
|
function installProjectDependencies(root, packageManager) {
|
|
2164
|
-
|
|
2165
|
-
const
|
|
2072
|
+
const pkg = readPackageJson(root);
|
|
2073
|
+
const useVitePlus = pkg !== null && hasPackageDependency(pkg, "vite-plus");
|
|
2074
|
+
const installer = useVitePlus ? "vp" : packageManager;
|
|
2075
|
+
log.step(`Installing dependencies with ${installer}`);
|
|
2076
|
+
let command = installer;
|
|
2077
|
+
let args = useVitePlus || packageManager === "pnpm" ? ["install", "--no-frozen-lockfile"] : ["install"];
|
|
2078
|
+
if (useVitePlus) {
|
|
2079
|
+
let localBin;
|
|
2080
|
+
try {
|
|
2081
|
+
const require = createRequire(join(root, "package.json"));
|
|
2082
|
+
localBin = join(dirname(require.resolve("vite-plus/package.json")), "bin/vp");
|
|
2083
|
+
} catch {}
|
|
2084
|
+
if (localBin) {
|
|
2085
|
+
command = process.execPath;
|
|
2086
|
+
args = [localBin, ...args];
|
|
2087
|
+
} else if (spawnSync("vp", ["--version"], {
|
|
2088
|
+
cwd: root,
|
|
2089
|
+
stdio: "ignore",
|
|
2090
|
+
shell: process.platform === "win32",
|
|
2091
|
+
timeout: 5e3
|
|
2092
|
+
}).status !== 0) {
|
|
2093
|
+
command = "npx";
|
|
2094
|
+
const packageArg = `--package=vite-plus@${SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES["vite-plus"]}`;
|
|
2095
|
+
args = [
|
|
2096
|
+
"--yes",
|
|
2097
|
+
process.platform === "win32" ? `"${packageArg}"` : packageArg,
|
|
2098
|
+
"vp",
|
|
2099
|
+
...args
|
|
2100
|
+
];
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
const result = spawnSync(command, args, {
|
|
2166
2104
|
cwd: root,
|
|
2167
2105
|
stdio: "inherit",
|
|
2168
|
-
shell: process.platform === "win32"
|
|
2106
|
+
shell: command !== process.execPath && process.platform === "win32"
|
|
2169
2107
|
});
|
|
2170
2108
|
if (result.error) throw result.error;
|
|
2171
|
-
if (result.status !== 0) throw new Error(`${
|
|
2172
|
-
log.step(`Installed dependencies with ${
|
|
2109
|
+
if (result.status !== 0) throw new Error(`${installer} install failed with exit code ${result.status ?? "unknown"}`);
|
|
2110
|
+
log.step(`Installed dependencies with ${installer}`);
|
|
2173
2111
|
}
|
|
2174
2112
|
function generateStarterMigration(root, starterMode) {
|
|
2175
2113
|
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();
|
|
2114
|
+
const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[dialect], dialect);
|
|
2115
|
+
const rollBack = snapshotDrizzleOutputs(readProjectPaths(root).migrationsDir);
|
|
2185
2116
|
log.step("Generating initial Drizzle migration");
|
|
2186
2117
|
const result = spawnSync(process.execPath, [
|
|
2187
2118
|
drizzleKitBin,
|
|
@@ -2192,37 +2123,9 @@ function generateStarterMigration(root, starterMode) {
|
|
|
2192
2123
|
cwd: root,
|
|
2193
2124
|
stdio: "pipe",
|
|
2194
2125
|
encoding: "utf-8",
|
|
2195
|
-
shell: process.platform === "win32",
|
|
2196
2126
|
env: buildDrizzleKitSpawnEnv(root)
|
|
2197
2127
|
});
|
|
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
|
-
}
|
|
2128
|
+
if (result.error || result.status !== 0) rollBack();
|
|
2226
2129
|
if (result.error) throw result.error;
|
|
2227
2130
|
if (result.status !== 0) {
|
|
2228
2131
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
@@ -2265,8 +2168,9 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2265
2168
|
const targetGroup = group === "dependencies" ? dependencies : devDependencies;
|
|
2266
2169
|
const sourceGroup = otherGroup === "dependencies" ? dependencies : devDependencies;
|
|
2267
2170
|
const existing = targetGroup[name] ?? sourceGroup[name];
|
|
2268
|
-
|
|
2269
|
-
|
|
2171
|
+
const selectToolchainVersion = toolchain === "vite-plus" && (name === "vite" || name === "vite-plus");
|
|
2172
|
+
if (!targetGroup[name] || selectToolchainVersion && existing !== fallbackVersion) {
|
|
2173
|
+
targetGroup[name] = selectToolchainVersion ? fallbackVersion : existing ?? fallbackVersion;
|
|
2270
2174
|
dependencyAdded = true;
|
|
2271
2175
|
}
|
|
2272
2176
|
if (sourceGroup[name]) {
|
|
@@ -2276,8 +2180,8 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2276
2180
|
};
|
|
2277
2181
|
for (const [name, version] of Object.entries(template.dependencies)) ensureDependency("dependencies", name, version);
|
|
2278
2182
|
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"
|
|
2183
|
+
if (packageManager === "pnpm" || isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2184
|
+
if (toolchain === "vite-plus") configureVitePlusScaffold(packageManager === "pnpm" ? resolvePnpmConfigRoot(root, pkg) : root, packageManager, pkg);
|
|
2281
2185
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2282
2186
|
log.step("Updated package.json with starter scripts and dependencies");
|
|
2283
2187
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
@@ -2292,11 +2196,7 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2292
2196
|
}
|
|
2293
2197
|
return dependencyAdded;
|
|
2294
2198
|
}
|
|
2295
|
-
|
|
2296
|
-
return DEPENDENCY_FIELDS.some((field) => {
|
|
2297
|
-
return typeof asRecord(pkg[field])?.[name] === "string";
|
|
2298
|
-
});
|
|
2299
|
-
}
|
|
2199
|
+
/** Returns whether a dependency was added. */
|
|
2300
2200
|
function ensureExistingProjectPackage(root, options = {}) {
|
|
2301
2201
|
const packageJsonPath = join(root, "package.json");
|
|
2302
2202
|
const voidSpec = resolveScaffoldDependencySpec(root, "void", getOwnVersion());
|
|
@@ -2340,25 +2240,22 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2340
2240
|
}
|
|
2341
2241
|
const devDependencies = asRecord(pkg.devDependencies) ?? {};
|
|
2342
2242
|
pkg.devDependencies = devDependencies;
|
|
2343
|
-
if (!
|
|
2243
|
+
if (!hasPackageDependency(pkg, "void", DEPENDENCY_FIELDS)) {
|
|
2344
2244
|
devDependencies.void = voidSpec;
|
|
2345
2245
|
changed = true;
|
|
2346
2246
|
dependencyAdded = true;
|
|
2347
2247
|
}
|
|
2348
|
-
if (plainViteSetup && !
|
|
2248
|
+
if (plainViteSetup && !hasPackageDependency(pkg, "vite", DEPENDENCY_FIELDS)) {
|
|
2349
2249
|
devDependencies.vite = SCAFFOLD_BASE_DEV_DEPENDENCIES.vite;
|
|
2350
2250
|
changed = true;
|
|
2351
2251
|
dependencyAdded = true;
|
|
2352
2252
|
}
|
|
2353
|
-
|
|
2253
|
+
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2354
2254
|
if (changed) {
|
|
2355
2255
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2356
2256
|
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
2257
|
}
|
|
2358
|
-
return
|
|
2359
|
-
dependencyAdded,
|
|
2360
|
-
packageJsonMutated: changed || pnpmConfigChanged
|
|
2361
|
-
};
|
|
2258
|
+
return dependencyAdded;
|
|
2362
2259
|
}
|
|
2363
2260
|
function getBasicVoidViteConfig() {
|
|
2364
2261
|
return `import { defineConfig } from "vite";
|
|
@@ -2381,7 +2278,11 @@ function noteManualFrameworkConfigSetup(framework) {
|
|
|
2381
2278
|
return;
|
|
2382
2279
|
}
|
|
2383
2280
|
if (framework.name === "nuxt") {
|
|
2384
|
-
note("Detected Nuxt. Void init does not patch nuxt.config.* automatically.\n\nAdd `voidPlugin()` to the Nuxt Vite plugins option:\n\nimport { voidPlugin } from \"void\";\n\nexport default defineNuxtConfig({\n vite: { plugins: [voidPlugin()] },\n});", "Manual Nuxt config step");
|
|
2281
|
+
note("Detected Nuxt. Void init does not patch nuxt.config.* automatically.\n\nAdd `voidPlugin()` to the Nuxt Vite plugins option, the `@schema` alias that `nuxi typecheck` reads, and the Cloudflare preset, `void/nitro` and the generated Cloudflare config to the Nitro options:\n\nimport { resolve } from \"node:path\";\nimport { voidPlugin } from \"void\";\n\nexport default defineNuxtConfig({\n alias: {\n \"@schema\": resolve(import.meta.dirname, \"db/schema.ts\"),\n },\n nitro: {\n preset: \"cloudflare-module\",\n modules: [\"void/nitro\"],\n cloudflare: { dev: { configPath: \"./.void-wrangler.jsonc\" } },\n },\n vite: { plugins: [voidPlugin()] },\n});", "Manual Nuxt config step");
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
if (framework.name === "analog") {
|
|
2285
|
+
note("Detected Analog. Void init does not patch vite.config.* automatically.\n\nInstall `nitro-cloudflare-dev` as a dev dependency. Add `voidPlugin()` to the Vite plugins, and the Cloudflare preset, `void/nitro` and the generated Cloudflare config to Analog's Nitro options:\n\nimport analog from \"@analogjs/platform\";\nimport { voidPlugin } from \"void\";\n\nexport default defineConfig({\n plugins: [\n analog({\n ssr: true,\n nitro: {\n preset: \"cloudflare-module\",\n modules: [\"nitro-cloudflare-dev\", \"void/nitro\"],\n cloudflareDev: { configPath: \"./.void-wrangler.jsonc\" },\n },\n }),\n voidPlugin(),\n ],\n});", "Manual Analog config step");
|
|
2385
2286
|
return;
|
|
2386
2287
|
}
|
|
2387
2288
|
noteManualViteConfigSetup();
|
|
@@ -2410,28 +2311,20 @@ function ensureExistingProjectViteConfig(root, framework) {
|
|
|
2410
2311
|
writeFileSync(fullPath, updated);
|
|
2411
2312
|
log.step(`Added voidPlugin() to ${configPath}`);
|
|
2412
2313
|
}
|
|
2314
|
+
/** Returns whether a dependency was added. */
|
|
2413
2315
|
function setupExistingProject(root, framework) {
|
|
2414
2316
|
log.info("Existing project detected. Configuring Void...");
|
|
2415
|
-
const
|
|
2317
|
+
const dependencyAdded = ensureExistingProjectPackage(root, { plainViteSetup: framework?.class !== "c" });
|
|
2416
2318
|
ensureExistingProjectViteConfig(root, framework);
|
|
2417
|
-
return
|
|
2319
|
+
return dependencyAdded;
|
|
2418
2320
|
}
|
|
2419
2321
|
/**
|
|
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.
|
|
2322
|
+
* Scaffolds the "SQL → types → handler → fetch" demo into an existing project.
|
|
2323
|
+
* `setupExistingProject` has already declared `void` in `package.json`.
|
|
2430
2324
|
*/
|
|
2431
2325
|
function scaffoldDemo(root) {
|
|
2432
2326
|
const devCommand = getDevCommand(root);
|
|
2433
2327
|
const paths = readProjectPaths(root);
|
|
2434
|
-
const packageJsonMutated = ensureVoidDependency(root);
|
|
2435
2328
|
mkdirSync(paths.dbDir, { recursive: true });
|
|
2436
2329
|
writeFileSync(paths.schemaFile, `import { sql } from "void/db";
|
|
2437
2330
|
import { integer, sqliteTable, text } from "void/schema-d1";
|
|
@@ -2472,61 +2365,6 @@ console.log(posts);
|
|
|
2472
2365
|
note(`SQL migration → DB types → Route handler → Route types → Typed fetch
|
|
2473
2366
|
|
|
2474
2367
|
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
2368
|
}
|
|
2531
2369
|
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
2370
|
const MARKER_CLOSE = "<!--/injected-by-void-->";
|
|
@@ -2600,7 +2438,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2600
2438
|
log.info(`Detected ${SCAFFOLD_FRAMEWORKS[detectedPagesFramework].label} adapter in package.json`);
|
|
2601
2439
|
} else scaffoldedPagesFramework = await promptScaffoldFramework();
|
|
2602
2440
|
const starterMode = await promptStarterMode();
|
|
2603
|
-
const
|
|
2441
|
+
const existingPackageJson = readPackageJson(root);
|
|
2442
|
+
const hasPackageManager = hasLocalLockfile(root) || existsSync(join(root, "pnpm-workspace.yaml")) || parsePackageManagerField(existingPackageJson) !== void 0 || resolveWorkspaceDeferral(root, existingPackageJson) !== void 0;
|
|
2443
|
+
const scaffoldPackageManager = scaffoldToolchain === "vite-plus" && !hasPackageManager ? "pnpm" : preScaffoldState.packageManager;
|
|
2604
2444
|
const scaffoldWroteDeps = scaffoldPagesApp(root, scaffoldPackageManager, scaffoldedPagesFramework, starterMode, scaffoldToolchain);
|
|
2605
2445
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2606
2446
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
@@ -2616,9 +2456,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2616
2456
|
const state = detectProjectState(root);
|
|
2617
2457
|
const pagesFramework = scaffoldedPagesFramework ?? detectPagesFramework(root);
|
|
2618
2458
|
if (!targeted && !didScaffoldStarter) {
|
|
2619
|
-
const
|
|
2459
|
+
const dependencyAdded = setupExistingProject(root, framework);
|
|
2620
2460
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
2621
|
-
if (
|
|
2461
|
+
if (dependencyAdded || !voidResolvable) {
|
|
2622
2462
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2623
2463
|
if (deferral) {
|
|
2624
2464
|
workspaceSubpackageSkip = true;
|
|
@@ -2643,27 +2483,25 @@ async function runInitCommand(root, initArgs) {
|
|
|
2643
2483
|
await injectAgentBlock(root, newProject);
|
|
2644
2484
|
const agents = detectAgents(root);
|
|
2645
2485
|
if (agents.length > 0) {
|
|
2646
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2486
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-C_yRTg0g.mjs");
|
|
2647
2487
|
linkSkillsForSpecificAgents(root, agents);
|
|
2648
2488
|
} else log.info("Bundled Void docs: node_modules/void/docs/");
|
|
2649
2489
|
if (!targeted && !framework) {
|
|
2650
2490
|
if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2651
|
-
else
|
|
2491
|
+
else {
|
|
2652
2492
|
const scaffold = await confirm({ message: "Scaffold demo code? (migration + API route + frontend fetch)" });
|
|
2653
2493
|
if (isCancel(scaffold)) {
|
|
2654
2494
|
cancel("Setup cancelled.");
|
|
2655
2495
|
process.exit(0);
|
|
2656
2496
|
}
|
|
2657
2497
|
if (scaffold) {
|
|
2658
|
-
|
|
2498
|
+
scaffoldDemo(root);
|
|
2659
2499
|
const voidResolvable = isVoidResolvableFrom(root);
|
|
2660
2500
|
const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
|
|
2661
|
-
if (deferral &&
|
|
2662
|
-
workspaceSubpackageSkip = true;
|
|
2501
|
+
if (deferral && !voidResolvable) {
|
|
2663
2502
|
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
} else if (!voidResolvable || packageJsonMutated) scaffoldAddedDependencies = true;
|
|
2503
|
+
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");
|
|
2504
|
+
}
|
|
2667
2505
|
scaffoldedStarterMode = "sqlite";
|
|
2668
2506
|
}
|
|
2669
2507
|
}
|
|
@@ -2672,11 +2510,10 @@ async function runInitCommand(root, initArgs) {
|
|
|
2672
2510
|
let voidPlatformDiscovery = null;
|
|
2673
2511
|
if (!targeted && deploymentPlatform === "cloudflare") await setupCloudflareDeployment(root);
|
|
2674
2512
|
if (!targeted && deploymentPlatform === "void") voidPlatformDiscovery = await ensureVoidPlatformConnection(root);
|
|
2675
|
-
const githubStepSkipForSubpackage = workspaceSubpackage;
|
|
2676
2513
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2677
|
-
if (shouldSetupGithub && !
|
|
2514
|
+
if (shouldSetupGithub && !workspaceSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2678
2515
|
if (!voidPlatformDiscovery) {
|
|
2679
|
-
const { getApiUrl } = await import("./auth-
|
|
2516
|
+
const { getApiUrl } = await import("./auth-Cbqi1iVX.mjs");
|
|
2680
2517
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2681
2518
|
}
|
|
2682
2519
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -2686,7 +2523,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2686
2523
|
shouldSetupGithub = false;
|
|
2687
2524
|
}
|
|
2688
2525
|
}
|
|
2689
|
-
if (shouldSetupGithub && !
|
|
2526
|
+
if (shouldSetupGithub && !workspaceSubpackage) {
|
|
2690
2527
|
if (targeted) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2691
2528
|
else {
|
|
2692
2529
|
const setupGha = await confirm({ message: "Create .github/workflows/void-deploy.yml to deploy on pushes to main?" });
|
|
@@ -2696,7 +2533,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2696
2533
|
}
|
|
2697
2534
|
if (setupGha) setupGithubActions(root, state, deploymentPlatform === "cloudflare" ? "cloudflare" : "void", voidPlatformDiscovery?.apiUrl);
|
|
2698
2535
|
}
|
|
2699
|
-
} else if (
|
|
2536
|
+
} else if (workspaceSubpackage && shouldSetupGithub) log.info("Skipping GitHub Actions setup: workflow files must live at the repo root, not in a workspace subpackage.");
|
|
2700
2537
|
if (!targeted) {
|
|
2701
2538
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2702
2539
|
if (scaffoldResult.written) {
|