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,18 +1,17 @@
|
|
|
1
|
-
import { a as join,
|
|
2
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
3
|
-
import {
|
|
4
|
-
import { n as readJournal, t as collectMigrations } from "./collect-
|
|
5
|
-
import { K as select, L as log, O as cancel, tt as isCancel } from "./dist-
|
|
6
|
-
import {
|
|
7
|
-
import { n as ensureProjectTsconfig } from "./project-tsconfig-
|
|
8
|
-
import { r as
|
|
9
|
-
import {
|
|
10
|
-
import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { a as join, n as dirname, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
|
|
3
|
+
import { d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
|
|
4
|
+
import { n as readJournal, t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
5
|
+
import { K as select, L as log, O as cancel, tt as isCancel } from "./dist-BVdsO7Py.mjs";
|
|
6
|
+
import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
|
|
7
|
+
import { n as ensureProjectTsconfig } from "./project-tsconfig-bveqhlYA.mjs";
|
|
8
|
+
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BEm9vRvS.mjs";
|
|
9
|
+
import { t as assertJournalCoherence } from "./validate-CheZGRE7.mjs";
|
|
10
|
+
import { n as drizzleKitBin, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DLbEFMT0.mjs";
|
|
11
|
+
import { n as snapshotDrizzleOutputs } from "./generate-Dat0UTry.mjs";
|
|
12
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { spawnSync } from "node:child_process";
|
|
14
14
|
//#region src/cli/gen.ts
|
|
15
|
-
const drizzleKitBin = join(fileURLToPath(import.meta.resolve("drizzle-kit")), "..", "bin.cjs");
|
|
16
15
|
async function runGenCommand(root, args) {
|
|
17
16
|
console.log();
|
|
18
17
|
if (args.subcommand === "model") await runModel(root, args.name, args.columns);
|
|
@@ -56,105 +55,59 @@ function getNextMiddlewareNumber(middlewareDir) {
|
|
|
56
55
|
}
|
|
57
56
|
return String(max + 1).padStart(2, "0");
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
case "real":
|
|
85
|
-
types.add("real");
|
|
86
|
-
break;
|
|
87
|
-
default: types.add("text");
|
|
58
|
+
const TEXT_COLUMN = { fn: "text" };
|
|
59
|
+
const COLUMN_BUILDERS = {
|
|
60
|
+
sqlite: {
|
|
61
|
+
string: TEXT_COLUMN,
|
|
62
|
+
text: TEXT_COLUMN,
|
|
63
|
+
integer: { fn: "integer" },
|
|
64
|
+
boolean: {
|
|
65
|
+
fn: "integer",
|
|
66
|
+
options: "{ mode: \"boolean\" }"
|
|
67
|
+
},
|
|
68
|
+
real: { fn: "real" }
|
|
69
|
+
},
|
|
70
|
+
postgresql: {
|
|
71
|
+
string: TEXT_COLUMN,
|
|
72
|
+
text: TEXT_COLUMN,
|
|
73
|
+
integer: { fn: "integer" },
|
|
74
|
+
boolean: { fn: "boolean" },
|
|
75
|
+
real: { fn: "doublePrecision" }
|
|
76
|
+
},
|
|
77
|
+
mysql: {
|
|
78
|
+
string: TEXT_COLUMN,
|
|
79
|
+
text: TEXT_COLUMN,
|
|
80
|
+
integer: { fn: "int" },
|
|
81
|
+
boolean: { fn: "boolean" },
|
|
82
|
+
real: { fn: "double" }
|
|
88
83
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const notNull = col.nullable ? "" : ".notNull()";
|
|
94
|
-
switch (type) {
|
|
95
|
-
case "string":
|
|
96
|
-
case "text": return ` ${name}: text("${name}")${notNull},`;
|
|
97
|
-
case "integer": return ` ${name}: integer("${name}")${notNull},`;
|
|
98
|
-
case "boolean": return ` ${name}: boolean("${name}")${notNull}.default(false),`;
|
|
99
|
-
case "real": return ` ${name}: doublePrecision("${name}")${notNull},`;
|
|
100
|
-
default: return ` ${name}: text("${name}"),`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function drizzleImportsForColumnsPg(columns) {
|
|
104
|
-
const types = /* @__PURE__ */ new Set([
|
|
84
|
+
};
|
|
85
|
+
const BASE_IMPORTS = {
|
|
86
|
+
sqlite: ["text", "integer"],
|
|
87
|
+
postgresql: [
|
|
105
88
|
"text",
|
|
106
89
|
"serial",
|
|
107
90
|
"timestamp"
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
case "string":
|
|
111
|
-
case "text":
|
|
112
|
-
types.add("text");
|
|
113
|
-
break;
|
|
114
|
-
case "integer":
|
|
115
|
-
types.add("integer");
|
|
116
|
-
break;
|
|
117
|
-
case "boolean":
|
|
118
|
-
types.add("boolean");
|
|
119
|
-
break;
|
|
120
|
-
case "real":
|
|
121
|
-
types.add("doublePrecision");
|
|
122
|
-
break;
|
|
123
|
-
default: types.add("text");
|
|
124
|
-
}
|
|
125
|
-
return [...types].sort();
|
|
126
|
-
}
|
|
127
|
-
function drizzleColumnDefMySql(col) {
|
|
128
|
-
const { name, type } = col;
|
|
129
|
-
const notNull = col.nullable ? "" : ".notNull()";
|
|
130
|
-
switch (type) {
|
|
131
|
-
case "string":
|
|
132
|
-
case "text": return ` ${name}: text("${name}")${notNull},`;
|
|
133
|
-
case "integer": return ` ${name}: int("${name}")${notNull},`;
|
|
134
|
-
case "boolean": return ` ${name}: boolean("${name}")${notNull}.default(false),`;
|
|
135
|
-
case "real": return ` ${name}: double("${name}")${notNull},`;
|
|
136
|
-
default: return ` ${name}: text("${name}"),`;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
function drizzleImportsForColumnsMySql(columns) {
|
|
140
|
-
const types = /* @__PURE__ */ new Set([
|
|
91
|
+
],
|
|
92
|
+
mysql: [
|
|
141
93
|
"int",
|
|
142
94
|
"text",
|
|
143
95
|
"timestamp"
|
|
144
|
-
]
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
function drizzleColumnDef(dialect, col) {
|
|
99
|
+
const { name } = col;
|
|
100
|
+
const builder = COLUMN_BUILDERS[dialect][col.type];
|
|
101
|
+
if (!builder) return ` ${name}: text("${name}"),`;
|
|
102
|
+
const args = builder.options ? `"${name}", ${builder.options}` : `"${name}"`;
|
|
103
|
+
const notNull = col.nullable ? "" : ".notNull()";
|
|
104
|
+
const defaultValue = col.type === "boolean" ? ".default(false)" : "";
|
|
105
|
+
return ` ${name}: ${builder.fn}(${args})${notNull}${defaultValue},`;
|
|
106
|
+
}
|
|
107
|
+
function drizzleImportsForColumns(dialect, columns) {
|
|
108
|
+
const imports = new Set(BASE_IMPORTS[dialect]);
|
|
109
|
+
for (const col of columns) imports.add(COLUMN_BUILDERS[dialect][col.type]?.fn ?? "text");
|
|
110
|
+
return [...imports].sort();
|
|
158
111
|
}
|
|
159
112
|
function detectValidator(root) {
|
|
160
113
|
const pkgPath = join(root, "package.json");
|
|
@@ -203,76 +156,39 @@ async function resolveValidator(root) {
|
|
|
203
156
|
if (choice !== "none") log.warn(`Remember to install ${choice}: npm install ${choice}`);
|
|
204
157
|
return choice;
|
|
205
158
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
base = "v.instance(Blob)";
|
|
228
|
-
break;
|
|
229
|
-
default: base = "v.string()";
|
|
230
|
-
}
|
|
231
|
-
return col.nullable ? `v.optional(${base})` : base;
|
|
232
|
-
}
|
|
233
|
-
function zodType(col) {
|
|
234
|
-
let base;
|
|
235
|
-
switch (col.type) {
|
|
236
|
-
case "string":
|
|
237
|
-
case "text":
|
|
238
|
-
case "datetime":
|
|
239
|
-
base = "z.string()";
|
|
240
|
-
break;
|
|
241
|
-
case "integer":
|
|
242
|
-
case "real":
|
|
243
|
-
base = "z.number()";
|
|
244
|
-
break;
|
|
245
|
-
case "boolean":
|
|
246
|
-
base = "z.boolean()";
|
|
247
|
-
break;
|
|
248
|
-
case "blob":
|
|
249
|
-
base = "z.instanceof(Blob)";
|
|
250
|
-
break;
|
|
251
|
-
default: base = "z.string()";
|
|
252
|
-
}
|
|
253
|
-
return col.nullable ? `${base}.optional()` : base;
|
|
254
|
-
}
|
|
255
|
-
function arktypeType(col) {
|
|
256
|
-
let base;
|
|
257
|
-
switch (col.type) {
|
|
258
|
-
case "string":
|
|
259
|
-
case "text":
|
|
260
|
-
case "datetime":
|
|
261
|
-
base = "string";
|
|
262
|
-
break;
|
|
263
|
-
case "integer":
|
|
264
|
-
case "real":
|
|
265
|
-
base = "number";
|
|
266
|
-
break;
|
|
267
|
-
case "boolean":
|
|
268
|
-
base = "boolean";
|
|
269
|
-
break;
|
|
270
|
-
case "blob":
|
|
271
|
-
base = "instanceof Blob";
|
|
272
|
-
break;
|
|
273
|
-
default: base = "string";
|
|
159
|
+
const VALIDATOR_TYPES = {
|
|
160
|
+
valibot: {
|
|
161
|
+
string: "v.string()",
|
|
162
|
+
number: "v.number()",
|
|
163
|
+
boolean: "v.boolean()",
|
|
164
|
+
blob: "v.instance(Blob)",
|
|
165
|
+
optional: (base) => `v.optional(${base})`
|
|
166
|
+
},
|
|
167
|
+
zod: {
|
|
168
|
+
string: "z.string()",
|
|
169
|
+
number: "z.number()",
|
|
170
|
+
boolean: "z.boolean()",
|
|
171
|
+
blob: "z.instanceof(Blob)",
|
|
172
|
+
optional: (base) => `${base}.optional()`
|
|
173
|
+
},
|
|
174
|
+
arktype: {
|
|
175
|
+
string: "string",
|
|
176
|
+
number: "number",
|
|
177
|
+
boolean: "boolean",
|
|
178
|
+
blob: "instanceof Blob",
|
|
179
|
+
optional: (base) => `${base} | undefined`
|
|
274
180
|
}
|
|
275
|
-
|
|
181
|
+
};
|
|
182
|
+
const VALUE_KINDS = {
|
|
183
|
+
integer: "number",
|
|
184
|
+
real: "number",
|
|
185
|
+
boolean: "boolean",
|
|
186
|
+
blob: "blob"
|
|
187
|
+
};
|
|
188
|
+
function validatorType(validator, col) {
|
|
189
|
+
const types = VALIDATOR_TYPES[validator];
|
|
190
|
+
const base = types[VALUE_KINDS[col.type] ?? "string"];
|
|
191
|
+
return col.nullable ? types.optional(base) : base;
|
|
276
192
|
}
|
|
277
193
|
function getImportLine(validator) {
|
|
278
194
|
switch (validator) {
|
|
@@ -283,8 +199,8 @@ function getImportLine(validator) {
|
|
|
283
199
|
}
|
|
284
200
|
}
|
|
285
201
|
function getBodySchema(validator, columns) {
|
|
286
|
-
if (validator === "arktype") return `type({\n${columns.map((c) => ` ${c.name}: "${
|
|
287
|
-
const fields = columns.map((c) => ` ${c.name}: ${
|
|
202
|
+
if (validator === "arktype") return `type({\n${columns.map((c) => ` ${c.name}: "${validatorType(validator, c)}",`).join("\n")}\n })`;
|
|
203
|
+
const fields = columns.map((c) => ` ${c.name}: ${validatorType(validator, c)},`).join("\n");
|
|
288
204
|
return `${validator === "valibot" ? "v" : "z"}.object({\n${fields}\n })`;
|
|
289
205
|
}
|
|
290
206
|
function getParamsSchema(validator) {
|
|
@@ -370,60 +286,43 @@ async function runModel(root, name, columns) {
|
|
|
370
286
|
const schemaDir = paths.schemaDir;
|
|
371
287
|
const barrelPath = paths.schemaFile;
|
|
372
288
|
const modelPath = join(schemaDir, `${name}.ts`);
|
|
289
|
+
const colDefs = columns.map((col) => drizzleColumnDef(dialect, col));
|
|
290
|
+
const columnImports = drizzleImportsForColumns(dialect, columns).join(", ");
|
|
373
291
|
let content;
|
|
374
|
-
if (dialect === "postgresql")
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
} else {
|
|
409
|
-
const colDefs = columns.map((col) => drizzleColumnDef(col));
|
|
410
|
-
const columnImports = drizzleImportsForColumns(columns);
|
|
411
|
-
const allCols = [
|
|
412
|
-
` id: integer("id").primaryKey({ autoIncrement: true }),`,
|
|
413
|
-
...colDefs,
|
|
414
|
-
" createdAt: text(\"created_at\").notNull().default(sql`(datetime('now'))`),",
|
|
415
|
-
" updatedAt: text(\"updated_at\").notNull().default(sql`(datetime('now'))`),"
|
|
416
|
-
];
|
|
417
|
-
content = [
|
|
418
|
-
`import { sqliteTable, ${columnImports.join(", ")} } from "void/schema-d1";`,
|
|
419
|
-
`import { sql } from "void/db";`,
|
|
420
|
-
"",
|
|
421
|
-
`export const ${name} = sqliteTable("${name}", {`,
|
|
422
|
-
...allCols,
|
|
423
|
-
"});",
|
|
424
|
-
""
|
|
425
|
-
].join("\n");
|
|
426
|
-
}
|
|
292
|
+
if (dialect === "postgresql") content = [
|
|
293
|
+
`import { pgTable, ${columnImports} } from "void/schema-pg";`,
|
|
294
|
+
"",
|
|
295
|
+
`export const ${name} = pgTable("${name}", {`,
|
|
296
|
+
` id: serial("id").primaryKey(),`,
|
|
297
|
+
...colDefs,
|
|
298
|
+
` createdAt: timestamp("created_at").notNull().defaultNow(),`,
|
|
299
|
+
` updatedAt: timestamp("updated_at").notNull().defaultNow(),`,
|
|
300
|
+
"});",
|
|
301
|
+
""
|
|
302
|
+
].join("\n");
|
|
303
|
+
else if (dialect === "mysql") content = [
|
|
304
|
+
`import { mysqlTable, ${columnImports} } from "void/schema-mysql";`,
|
|
305
|
+
"",
|
|
306
|
+
`export const ${name} = mysqlTable("${name}", {`,
|
|
307
|
+
` id: int("id").autoincrement().primaryKey(),`,
|
|
308
|
+
...colDefs,
|
|
309
|
+
` createdAt: timestamp("created_at").notNull().defaultNow(),`,
|
|
310
|
+
` updatedAt: timestamp("updated_at").notNull().defaultNow(),`,
|
|
311
|
+
"});",
|
|
312
|
+
""
|
|
313
|
+
].join("\n");
|
|
314
|
+
else content = [
|
|
315
|
+
`import { sqliteTable, ${columnImports} } from "void/schema-d1";`,
|
|
316
|
+
`import { sql } from "void/db";`,
|
|
317
|
+
"",
|
|
318
|
+
`export const ${name} = sqliteTable("${name}", {`,
|
|
319
|
+
` id: integer("id").primaryKey({ autoIncrement: true }),`,
|
|
320
|
+
...colDefs,
|
|
321
|
+
" createdAt: text(\"created_at\").notNull().default(sql`(datetime('now'))`),",
|
|
322
|
+
" updatedAt: text(\"updated_at\").notNull().default(sql`(datetime('now'))`),",
|
|
323
|
+
"});",
|
|
324
|
+
""
|
|
325
|
+
].join("\n");
|
|
427
326
|
mkdirSync(schemaDir, { recursive: true });
|
|
428
327
|
writeIfNotExists(modelPath, content);
|
|
429
328
|
const exportLine = `export * from "./schema/${name}";`;
|
|
@@ -464,9 +363,7 @@ function runMigration(root, name) {
|
|
|
464
363
|
log.error("Restore the snapshot from version control, or regenerate migrations with `void db generate` before running `void gen migration`.");
|
|
465
364
|
process.exit(1);
|
|
466
365
|
}
|
|
467
|
-
const
|
|
468
|
-
const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
|
|
469
|
-
const snapshotsBefore = new Set(readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json")));
|
|
366
|
+
const rollBack = snapshotDrizzleOutputs(migrationsDir);
|
|
470
367
|
const sqlFilesBefore = new Set(readdirSync(migrationsDir).filter((f) => f.endsWith(".sql")));
|
|
471
368
|
let journalDialect;
|
|
472
369
|
if (existingJournal.dialect === "sqlite") journalDialect = "sqlite";
|
|
@@ -485,8 +382,7 @@ function runMigration(root, name) {
|
|
|
485
382
|
}
|
|
486
383
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
487
384
|
const additionalSchemas = existsSync(authSchemaPath) ? [authSchemaPath] : void 0;
|
|
488
|
-
const configPath = writeDrizzleConfig(root, journalDialect
|
|
489
|
-
const childEnv = buildDrizzleKitSpawnEnv(root);
|
|
385
|
+
const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[journalDialect], journalDialect, { additionalSchemas });
|
|
490
386
|
const result = spawnSync(process.execPath, [
|
|
491
387
|
drizzleKitBin,
|
|
492
388
|
"generate",
|
|
@@ -499,21 +395,10 @@ function runMigration(root, name) {
|
|
|
499
395
|
cwd: root,
|
|
500
396
|
stdio: "pipe",
|
|
501
397
|
encoding: "utf-8",
|
|
502
|
-
|
|
503
|
-
env: childEnv
|
|
398
|
+
env: buildDrizzleKitSpawnEnv(root)
|
|
504
399
|
});
|
|
505
400
|
if (result.error || result.status !== 0) {
|
|
506
|
-
|
|
507
|
-
writeFileSync(journalPath, originalJournalBytes);
|
|
508
|
-
} catch {}
|
|
509
|
-
if (existsSync(metaDir)) {
|
|
510
|
-
for (const f of readdirSync(metaDir)) if (f.endsWith("_snapshot.json") && !snapshotsBefore.has(f)) try {
|
|
511
|
-
unlinkSync(join(metaDir, f));
|
|
512
|
-
} catch {}
|
|
513
|
-
}
|
|
514
|
-
for (const f of readdirSync(migrationsDir)) if (f.endsWith(".sql") && !sqlFilesBefore.has(f)) try {
|
|
515
|
-
unlinkSync(join(migrationsDir, f));
|
|
516
|
-
} catch {}
|
|
401
|
+
rollBack();
|
|
517
402
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
518
403
|
log.error([
|
|
519
404
|
`Failed to run \`drizzle-kit generate --custom --name ${name}\`.`,
|
|
@@ -528,13 +413,6 @@ function runMigration(root, name) {
|
|
|
528
413
|
printSuccess("Migration created and journal updated.");
|
|
529
414
|
return;
|
|
530
415
|
}
|
|
531
|
-
if (existingJournal !== void 0 && existingJournal.entries.length === 0) {
|
|
532
|
-
if (listDrizzleArtifacts(migrationsDir).length > 0) {
|
|
533
|
-
log.error("db/migrations/meta/_journal.json has empty entries but stale drizzle-kit snapshots are on disk.");
|
|
534
|
-
log.error("Restore the journal entries from version control (or run `void db generate`), or delete the stale drizzle artifacts and rerun.");
|
|
535
|
-
process.exit(1);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
416
|
const tag = `${getMigrationTimestamp(migrationsDir)}_${name}`;
|
|
539
417
|
if (writeIfNotExists(join(migrationsDir, `${tag}.sql`), `-- ${name}\n`)) printSuccess("Migration created.");
|
|
540
418
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as runGenCommand } from "./gen-CufHEf42.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as generateValidatedSqliteMigrations } from "./generate-Dat0UTry.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as join, n as dirname } from "./dist-
|
|
2
|
-
import { t as collectMigrations } from "./collect-
|
|
1
|
+
import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
3
3
|
import { n as openMigrationValidationDatabase } from "./sqlite-validation-BzKMWnO4.mjs";
|
|
4
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
//#region src/drizzle/generate.ts
|
|
6
6
|
function snapshotFiles(root) {
|
|
7
7
|
const files = /* @__PURE__ */ new Map();
|
|
@@ -16,6 +16,40 @@ function snapshotFiles(root) {
|
|
|
16
16
|
}
|
|
17
17
|
return files;
|
|
18
18
|
}
|
|
19
|
+
function listFiles(dir, suffix) {
|
|
20
|
+
return new Set(existsSync(dir) ? readdirSync(dir).filter((file) => file.endsWith(suffix)) : []);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Record the Drizzle outputs under `migrationsDir` and return a rollback for a
|
|
24
|
+
* failed `drizzle-kit generate`, so partial files cannot fail the journal check
|
|
25
|
+
* of later `void db` commands.
|
|
26
|
+
*/
|
|
27
|
+
function snapshotDrizzleOutputs(migrationsDir) {
|
|
28
|
+
const metaDir = join(migrationsDir, "meta");
|
|
29
|
+
const journalPath = join(metaDir, "_journal.json");
|
|
30
|
+
const metaDirExisted = existsSync(metaDir);
|
|
31
|
+
const journal = existsSync(journalPath) ? readFileSync(journalPath) : null;
|
|
32
|
+
const snapshots = listFiles(metaDir, "_snapshot.json");
|
|
33
|
+
const sqlFiles = listFiles(migrationsDir, ".sql");
|
|
34
|
+
const bestEffort = (step) => {
|
|
35
|
+
try {
|
|
36
|
+
step();
|
|
37
|
+
} catch {}
|
|
38
|
+
};
|
|
39
|
+
const removeNewFiles = (dir, suffix, before) => {
|
|
40
|
+
for (const file of listFiles(dir, suffix)) if (!before.has(file)) bestEffort(() => unlinkSync(join(dir, file)));
|
|
41
|
+
};
|
|
42
|
+
return () => {
|
|
43
|
+
if (metaDirExisted) {
|
|
44
|
+
if (journal !== null) bestEffort(() => writeFileSync(journalPath, journal));
|
|
45
|
+
bestEffort(() => removeNewFiles(metaDir, "_snapshot.json", snapshots));
|
|
46
|
+
} else bestEffort(() => rmSync(metaDir, {
|
|
47
|
+
recursive: true,
|
|
48
|
+
force: true
|
|
49
|
+
}));
|
|
50
|
+
bestEffort(() => removeNewFiles(migrationsDir, ".sql", sqlFiles));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
19
53
|
/** Keep SQL and Drizzle's snapshot/journal together when generation fails validation. */
|
|
20
54
|
async function generateValidatedSqliteMigrations(migrationsDir, generate) {
|
|
21
55
|
try {
|
|
@@ -44,4 +78,4 @@ async function generateValidatedSqliteMigrations(migrationsDir, generate) {
|
|
|
44
78
|
}
|
|
45
79
|
}
|
|
46
80
|
//#endregion
|
|
47
|
-
export { generateValidatedSqliteMigrations };
|
|
81
|
+
export { snapshotDrizzleOutputs as n, generateValidatedSqliteMigrations as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { parse } from "jsonc-parser";
|
|
3
|
+
//#region src/cli/generated-wrangler-config.ts
|
|
4
|
+
/** Parse JSON/JSONC text with an optional BOM; undefined unless it is one valid object. */
|
|
5
|
+
function parseJsoncObject(text) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
const parsed = parse(text.replace(/^\uFEFF/, ""), errors, { allowTrailingComma: true });
|
|
8
|
+
if (errors.length > 0 || parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return;
|
|
9
|
+
return parsed;
|
|
10
|
+
}
|
|
11
|
+
/** Parse a generated Wrangler JSON/JSONC config without accepting a partial parse. */
|
|
12
|
+
function readGeneratedWranglerConfigFile(path) {
|
|
13
|
+
const parsed = parseJsoncObject(readFileSync(path, "utf8"));
|
|
14
|
+
if (!parsed) throw new Error("Invalid Wrangler JSON/JSONC config.");
|
|
15
|
+
return parsed;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { readGeneratedWranglerConfigFile as n, parseJsoncObject as t };
|