void 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-cmd-CZhbDfp4.mjs → account-cmd-D_0qJ9fx.mjs} +6 -6
- package/dist/{agents-DRo8gzni.mjs → agents-64FnLwxP.mjs} +6 -5
- package/dist/{application-analysis-Do1WaGAY.mjs → application-analysis-Cx2S63z5.mjs} +48 -22
- package/dist/{application-routing-DrOFahHO.mjs → application-routing-BAXpnawu.mjs} +1 -1
- package/dist/{assets-DZBd7yqh.mjs → assets-Br6_BeFJ.mjs} +34 -27
- package/dist/{ast-Cv0JwXqb.mjs → ast-BkPQu7A0.mjs} +5 -1
- package/dist/{auth-BN0NU9dz.mjs → auth-Boz0lrb3.mjs} +1 -1
- package/dist/{auth-CCk9Seol.mjs → auth-DlLDymuc.mjs} +24 -12
- package/dist/{auth-link-DFQTA1jN.mjs → auth-link-C97r9p2N.mjs} +6 -6
- package/dist/{auth-router-BOiaDmcQ.mjs → auth-router-BmzEgzYx.mjs} +5 -5
- package/dist/{better-auth-shared-BqsMzU14.d.mts → better-auth-shared-BS3pDQbT.d.mts} +11 -6
- package/dist/{better-auth-shared-DRHo5FoG.mjs → better-auth-shared-BcqDt-37.mjs} +7 -2
- package/dist/{build-cmd-BCiXgjn9.mjs → build-cmd-BaFsyZrz.mjs} +13 -12
- package/dist/{cache-CUulshOu.mjs → cache-xO711ATQ.mjs} +6 -6
- package/dist/{cancel-deploy-BHGZo6KC.mjs → cancel-deploy-Di11ynsr.mjs} +5 -5
- package/dist/{cf-access-pejlJmuy.mjs → cf-access-DmkKPcAI.mjs} +0 -8
- package/dist/{cf-access-Dnyw8KFY.mjs → cf-access-FaIm95jA.mjs} +8 -4
- package/dist/{cf-build-output-bBx1gDll.mjs → cf-build-output-Ca201_n1.mjs} +27 -25
- package/dist/cf-build-output-Dy7N0hQN.mjs +1 -0
- package/dist/{cf-command-values-Ccl-zRhl.mjs → cf-command-values-5BPBRc9Z.mjs} +1 -1
- package/dist/cf-config-migrate-D271BTiw.mjs +1664 -0
- package/dist/{cf-worker-settings-CARs4Wy9.mjs → cf-worker-settings-BBdlhm9U.mjs} +1 -1
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +223 -16
- package/dist/cli/env-schema-probe.d.mts +3 -1
- package/dist/cli/env-schema-probe.mjs +7 -8
- package/dist/{cli-main-hM7rhIbB.mjs → cli-main-DlW6lB8s.mjs} +153 -91
- package/dist/{client-BEYbgqZw.mjs → client-DkYzDEC0.mjs} +1 -1
- package/dist/{client-aIv5UQf3.mjs → client-ImIe7Mjq.mjs} +192 -17
- package/dist/{cloudflare-auth-pNvmT6kL.mjs → cloudflare-auth-eWfhdZCk.mjs} +1 -1
- package/dist/{cloudflare-cmd-DLcgInCa.mjs → cloudflare-cmd-SsFlJe2B.mjs} +7 -8
- package/dist/{cloudflare-config-BfEfIEuY.mjs → cloudflare-config-D9UFH_A5.mjs} +2 -2
- package/dist/{cloudflare-connect-CMcKtA02.mjs → cloudflare-connect-BgpHcSg3.mjs} +3 -3
- package/dist/{cloudflare-operations-DLhn_Bom.mjs → cloudflare-operations-BF0PSErW.mjs} +40 -24
- package/dist/cloudflare-operations-dpRD-2Px.mjs +1 -0
- package/dist/cloudflare-process-60r4Z2Zf.mjs +671 -0
- package/dist/cloudflare-user-output-CCR99eQY.mjs +19 -0
- package/dist/collect-B6nlSnsb.mjs +1 -0
- package/dist/{collect-C6Blu9yw.mjs → collect-rNLybAnF.mjs} +3 -3
- package/dist/{config-Do7gJI3T.mjs → config-BFX5ZB1J.mjs} +5 -4
- package/dist/{config-CbKmMpHK.mjs → config-BSoW3QCB.mjs} +5 -5
- package/dist/{config-DuiDZbq7.d.mts → config-DA6ZbLXO.d.mts} +3 -1
- package/dist/{config-CtkCfPpv.mjs → config-DtjrUtPo.mjs} +1 -1
- package/dist/{config-qgt863GH.mjs → config-Dv5jri1-.mjs} +10 -6
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-DM3yCNPG.mjs → connect-DDRQGfFE.mjs} +9 -9
- package/dist/{create-project-BkVGXGNt.mjs → create-project-CY7sP8sI.mjs} +7 -6
- package/dist/{create-project-C-hNdYvD.mjs → create-project-Dro3K-az.mjs} +1 -1
- package/dist/{db-DQAi7Ckr.mjs → db-DmlaWVBu.mjs} +166 -121
- package/dist/db-seed-loader-Bcz_SutQ.mjs +253 -0
- package/dist/{db-types-BpPYAx0B.mjs → db-types-B4Cf9dzR.mjs} +8 -2
- package/dist/{delete-BtVnPGO2.mjs → delete-Uuq9ch6o.mjs} +6 -6
- package/dist/{deploy-Cs93Af-d.mjs → deploy-B9E7_rHC.mjs} +235 -558
- package/dist/deploy-BB3rsZbP.mjs +2 -0
- package/dist/{deploy-managed-static-CZIx3cc1.mjs → deploy-managed-static-IKZyuc1W.mjs} +123 -198
- package/dist/deploy-security-notice-C3LalelR.mjs +192 -0
- package/dist/{deploy-transport-DT-ALuDj.mjs → deploy-transport-BKP_oV9q.mjs} +4 -4
- package/dist/deploy.mjs +10 -9
- package/dist/{dev-inbox-BiamQEAa.mjs → dev-inbox-ClVjKEHy.mjs} +1 -1
- package/dist/direct-r2-upload-DFXLWfXV.mjs +204 -0
- package/dist/discover-D2KGP3cR.mjs +1 -0
- package/dist/{discover-Vd18lHsj.mjs → discover-IcspacCg.mjs} +1 -1
- package/dist/{dispatch-DPEuEblR.mjs → dispatch-DIhDA3NI.mjs} +38 -17
- package/dist/{dist-Cp4b1_T9.mjs → dist-C47zy_kJ.mjs} +1 -1
- package/dist/{dist-STQXl8ck.mjs → dist-Cr_xGE_K.mjs} +73 -38
- package/dist/{domain-cOhYYiHU.mjs → domain-B_xY1yZ5.mjs} +8 -10
- package/dist/{dotenv-CEI8hapP.mjs → dotenv-BG6RQavH.mjs} +2 -2
- package/dist/{drizzle-DBSpPpU1.mjs → drizzle-BJDMPrj7.mjs} +35 -30
- package/dist/{drizzle-D4V_06-B.mjs → drizzle-CQ5jWuDL.mjs} +1 -1
- package/dist/{email-CnnDqvXV.mjs → email-BIC15L7a.mjs} +47 -32
- package/dist/{email-cloudflare-CCIoQueP.mjs → email-cloudflare-C447nOqq.mjs} +195 -109
- package/dist/{email-pattern-BYr-EFq5.mjs → email-pattern-bRna9MOJ.mjs} +2 -2
- package/dist/{entry-DMgR7XOf.mjs → entry-Bwb9ev8K.mjs} +13 -10
- package/dist/{env-5bphL5mV.mjs → env-DJPZYHT5.mjs} +8 -8
- package/dist/{env-UqS-21xi.mjs → env-EjHqc7m9.mjs} +1 -1
- package/dist/{env-types-WEZw5D-r.mjs → env-types-D2hBodXP.mjs} +2 -19
- package/dist/{env-validation-DfJ9Fzfa.mjs → env-validation-D-v5_CWL.mjs} +13 -13
- package/dist/{env-validation-ly_Q9Kgd.mjs → env-validation-j9pjCDfA.mjs} +1 -1
- package/dist/{error-pages-QNeBXiRR.mjs → error-pages-GORL6F_e.mjs} +1 -1
- package/dist/{fetch-CbI6lNnk.d.mts → fetch-CczQyIed.d.mts} +1 -1
- package/dist/{fetch-DdK9eGin.mjs → fetch-CiEsvjpP.mjs} +1 -1
- package/dist/{fetch-stream-DQAavFdm.mjs → fetch-stream-BIG5lHW6.mjs} +3 -4
- package/dist/{fetch-stream-DoED9atq.d.mts → fetch-stream-DRX8-83b.d.mts} +2 -2
- package/dist/gen-CQDiPi8m.mjs +1 -0
- package/dist/{gen-CjcH6DJS.mjs → gen-DiTZlDx8.mjs} +21 -18
- package/dist/{generate-BOp1g1H_.mjs → generate-C3ZAqCy-.mjs} +1 -1
- package/dist/{generate-CWb8aOsm.mjs → generate-Dq2Bgw75.mjs} +6 -6
- package/dist/{git-metadata-Cukp5kV5.mjs → git-metadata-BEokJ6US.mjs} +1 -1
- package/dist/{github-cmd-CVDLb51-.mjs → github-cmd-DPmby8x-.mjs} +14 -9
- package/dist/{handler-w_FAiIRu.mjs → handler-DCrDLzw2.mjs} +3 -3
- package/dist/has-own-key-D9QEnAkF.mjs +5 -0
- package/dist/{head-0o0QoREY.mjs → head-BwQ5kgqt.mjs} +5 -4
- package/dist/{head-CVO92KEx.d.mts → head-fUp8n_QJ.d.mts} +9 -4
- package/dist/{headers-Cyr87J6Z.mjs → headers-DqBsjDxg.mjs} +7 -7
- package/dist/{help-B1cH8518.mjs → help-9wfMyXHb.mjs} +146 -69
- package/dist/help-Dy3w4rPq.mjs +1 -0
- package/dist/{inbound-BHt4dIlL.d.mts → inbound-CwgZSqFI.d.mts} +9 -3
- package/dist/{inbound--OF7zkwX.mjs → inbound-feMn1Rxx.mjs} +7 -7
- package/dist/{index-CmqHYj2R.d.mts → index-8cAgNdb6.d.mts} +1 -1
- package/dist/{index-BTmhCDbw.d.mts → index-BQ5qYiAw.d.mts} +2 -2
- package/dist/{index-BESZTC1z.d.mts → index-BYcWajVp.d.mts} +2 -1
- package/dist/{index-BXdP39qx.d.mts → index-Dn2mkPr2.d.mts} +24 -23
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +351 -444
- package/dist/{info-BE3snw2_.mjs → info-BWEWaOBo.mjs} +4 -4
- package/dist/{init-BrS5MAiJ.mjs → init-BuTPVLPO.mjs} +737 -546
- package/dist/{isr-config-Czzb4mIq.mjs → isr-config-DiTnL9Tb.mjs} +5 -5
- package/dist/{link-BbzyrCBD.mjs → link-BiesPyT4.mjs} +7 -7
- package/dist/{list-DmppHjVc.mjs → list-CkonftPQ.mjs} +11 -7
- package/dist/{live-DvtxTUhW.mjs → live-dvGThbwy.mjs} +14 -17
- package/dist/{load-user-env-BltIJLtl.mjs → load-user-env-B8qC0Q2Y.mjs} +1 -1
- package/dist/{local-d1-DLxsKmkw.mjs → local-d1-CYOYkVwO.mjs} +3 -3
- package/dist/{login-Cihxnu7m.mjs → login-BSOSah1j.mjs} +8 -6
- package/dist/login-DWCZeCX9.mjs +1 -0
- package/dist/{logs-BCgLeLNd.mjs → logs-HOBUnroa.mjs} +9 -9
- package/dist/{migrate-DOK67gE-.mjs → migrate-BNZL1hee.mjs} +9 -10
- package/dist/migrate-C9aoWLvY.mjs +1 -0
- package/dist/{migrations-ByS7r3HV.mjs → migrations-CUHhX65Y.mjs} +15 -12
- package/dist/{mime-BGoZ8ZLL.mjs → mime-Btw9R3CC.mjs} +26 -12
- package/dist/{mysql-sql-SlpS6OMg.mjs → mysql-sql-CB52k8tQ.mjs} +45 -22
- package/dist/nitro.d.mts +3 -0
- package/dist/nitro.mjs +14 -5
- package/dist/{node-qXD3FbIU.mjs → node-DVJWfV6s.mjs} +6 -6
- package/dist/node-buffer-D7kgjaDs.mjs +4 -0
- package/dist/{operator-ai-logging-CNuX5uKg.mjs → operator-ai-logging-ZDqqhnIq.mjs} +11 -10
- package/dist/operator-args-DCkWbgT-.mjs +1499 -0
- package/dist/{operator-auth-CD3pap65.mjs → operator-auth-BjoPLgja.mjs} +2 -2
- package/dist/{operator-client-XvXTkea6.mjs → operator-client-DzebIntv.mjs} +3 -3
- package/dist/{operator-cmd-D0vSUVle.mjs → operator-cmd-AZoeI9Pl.mjs} +28 -12
- package/dist/operator-cmd-DEnHFmJF.mjs +1 -0
- package/dist/operator-security-Bo26FP01.mjs +263 -0
- package/dist/{output-DNVILSz2.mjs → output-BZLnu0z8.mjs} +39 -4
- package/dist/output-D7K9TWIA.mjs +1 -0
- package/dist/{package-json-DvS6IFRv.mjs → package-json-4xUI3xLz.mjs} +1 -1
- package/dist/pages/client.d.mts +53 -30
- package/dist/pages/client.mjs +93 -31
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +7 -7
- package/dist/pages/islands-plugin.d.mts +26 -8
- package/dist/pages/islands-plugin.mjs +61 -22
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{pgpass-CEtnBOZO.mjs → pgpass-BLPoYN9_.mjs} +3 -2
- package/dist/platform-args-DNbNZ_RR.mjs +1 -0
- package/dist/{platform-args-DQSMW4EP.mjs → platform-args-lwCyQ6Xy.mjs} +37 -9
- package/dist/{platform-auth-config-V2ifSLQ-.mjs → platform-auth-config-DLRMPw1G.mjs} +26 -23
- package/dist/{platform-auth-protection-BybVCUzi.mjs → platform-auth-protection-HSmLmD3d.mjs} +10 -10
- package/dist/{platform-auth-recovery-kH1-h8Ch.mjs → platform-auth-recovery-BXPhTlKa.mjs} +11 -9
- package/dist/{platform-cmd-B1jtqXnu.mjs → platform-cmd-CqRjxFEU.mjs} +1 -1
- package/dist/{platform-cmd-BHWdh1Hx.mjs → platform-cmd-DJ-fOYhL.mjs} +11 -11
- package/dist/{platform-discovery-B0eZjZ3B.mjs → platform-discovery-CLxtixHJ.mjs} +1 -1
- package/dist/{platform-domain-DB_KpVhg.mjs → platform-domain-CRsRJOws.mjs} +14 -10
- package/dist/{platform-lifecycle-BoOTmH6H.mjs → platform-lifecycle-bx_kpqo7.mjs} +1 -1
- package/dist/{platform-lifecycle-C6fUuj4y.mjs → platform-lifecycle-fau3VKv6.mjs} +773 -206
- package/dist/platform-management-BRGhD-oF.mjs +1 -0
- package/dist/{platform-management-B8-pOxoJ.mjs → platform-management-CnKBdDx5.mjs} +227 -58
- package/dist/{platform-plans-config-iczSDkQK.mjs → platform-plans-config-2C3_5EDs.mjs} +112 -35
- package/dist/{platform-recovery-ZAXin6WK.mjs → platform-recovery-poxgOOAY.mjs} +5 -5
- package/dist/{platform-registry-DZ_2Xuqd.mjs → platform-registry-DHH6fivm.mjs} +6 -5
- package/dist/{platform-setup-CpcHLI-0.mjs → platform-setup-DYylapHD.mjs} +26 -12
- package/dist/{plugin-inference-BGamcCqB.mjs → plugin-inference-7O11_E4H.mjs} +26 -26
- package/dist/{prepare-BrAkXTTB.mjs → prepare-BbvlKreR.mjs} +12 -12
- package/dist/prepare-BmG2E6TI.mjs +1 -0
- package/dist/{prepare-Cjt6EM0d.mjs → prepare-DWjn1Lzd.mjs} +3 -3
- package/dist/{project-cmd-wtCuc8Ln.mjs → project-cmd-DyUEFi2b.mjs} +30 -24
- package/dist/{project-CLwxcEdq.mjs → project-dh9431bN.mjs} +2 -2
- package/dist/{project-paths-CUhCPMpK.mjs → project-paths-2ENfCCih.mjs} +4 -3
- package/dist/project-security--tYGFPGo.mjs +1340 -0
- package/dist/project-security-DZEQgnsS.mjs +1 -0
- package/dist/{project-team-CZFvPIJ-.mjs → project-team-BszTHgzC.mjs} +8 -8
- package/dist/{project-token-C3TxkWeC.mjs → project-token-DBDy4NdV.mjs} +6 -6
- package/dist/{project-tsconfig-MyRJgufB.mjs → project-tsconfig-BOA4ym99.mjs} +25 -5
- package/dist/{project-DVsTAWFh.mjs → project-uXKua1it.mjs} +1 -1
- package/dist/project-zero-trust-D9sUouij.mjs +210 -0
- package/dist/{protocol-W5EQcIzN.mjs → protocol-CE3wP-H1.mjs} +5 -5
- package/dist/{protocol-BlAiF-hc.d.mts → protocol-ERy-n3jf.d.mts} +7 -4
- package/dist/{provision-CknEbPuw.mjs → provision-Bh44omGA.mjs} +39 -29
- package/dist/provision-DFv7SJDn.mjs +1 -0
- package/dist/{public-B80SwOFp.d.mts → public-DB9C2Cy_.d.mts} +5 -2
- package/dist/{raw-7pQirZpQ.mjs → raw-5rak34QN.mjs} +2 -1
- package/dist/{redirect-Dqb4fEc5.mjs → redirect-DD825Stf.mjs} +1 -1
- package/dist/{requests-FaA9M3RX.mjs → requests-CBokjiOi.mjs} +6 -6
- package/dist/{resolve-project-Da3OgCU1.mjs → resolve-project-8WZ3iVmr.mjs} +3 -3
- package/dist/resolve-project-YsTH-U9I.mjs +1 -0
- package/dist/{rollback-DM6pZ23Y.mjs → rollback-CEeHNFUn.mjs} +16 -7
- package/dist/route-types-CSed9-Dp.mjs +435 -0
- package/dist/{route-url-BBdkU7rb.mjs → route-url-B41eQ8QI.mjs} +1 -1
- package/dist/{route-url-Di1kB8D_.d.mts → route-url-Bd6IX-JZ.d.mts} +2 -1
- package/dist/routes-stub.d.mts +1 -1
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-CTk21HrO.mjs → runner-Bf94YVJK.mjs} +1 -1
- package/dist/{runner-CMZb7jNU.mjs → runner-CeguHWJx.mjs} +3 -2
- package/dist/{runner-mysql-CJ-HyqxV.mjs → runner-mysql-3XDKrn-g.mjs} +13 -9
- package/dist/{runner-mysql-C_PrAUTm.mjs → runner-mysql-r688x6Y9.mjs} +1 -1
- package/dist/{runner-pg-mYc75KfH.mjs → runner-pg-Buzw17hl.mjs} +1 -1
- package/dist/{runner-pg-2pjltt0t.mjs → runner-pg-DMJquR3d.mjs} +1 -1
- package/dist/runtime/ai/index.d.mts +1 -0
- package/dist/runtime/ai/index.mjs +26 -11
- package/dist/runtime/auth/better-auth-d1.d.mts +1 -1
- package/dist/runtime/auth/better-auth-d1.mjs +2 -2
- package/dist/runtime/auth/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/auth/better-auth-mysql.mjs +2 -2
- package/dist/runtime/auth/better-auth-postgres.d.mts +1 -1
- package/dist/runtime/auth/better-auth-postgres.mjs +3 -3
- package/dist/runtime/client/fetch-server.d.mts +1 -1
- package/dist/runtime/client/fetch-server.mjs +2 -2
- package/dist/runtime/client/fetch-stream.d.mts +2 -2
- package/dist/runtime/client/fetch-stream.mjs +1 -1
- package/dist/runtime/client/fetch.d.mts +1 -1
- package/dist/runtime/client/fetch.mjs +1 -1
- package/dist/runtime/client/index.d.mts +2 -2
- package/dist/runtime/client/index.mjs +2 -2
- package/dist/runtime/client/react.d.mts +2 -2
- package/dist/runtime/client/react.mjs +2 -2
- package/dist/runtime/client/solid.d.mts +2 -2
- package/dist/runtime/client/solid.mjs +2 -2
- package/dist/runtime/client/svelte.d.mts +2 -2
- package/dist/runtime/client/svelte.mjs +2 -2
- package/dist/runtime/client/vue.d.mts +2 -2
- package/dist/runtime/client/vue.mjs +2 -2
- package/dist/runtime/db/index.d.mts +8 -2
- package/dist/runtime/db/index.mjs +21 -8
- package/dist/runtime/db/migrations/mysql-handler.mjs +1 -1
- package/dist/runtime/db/migrations/postgres-handler.mjs +1 -1
- package/dist/runtime/db/session.d.mts +2 -0
- package/dist/runtime/db/session.mjs +1 -0
- package/dist/runtime/durable/index.mjs +7 -5
- package/dist/runtime/email/index.d.mts +1 -1
- package/dist/runtime/email/index.mjs +14 -11
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +4 -4
- package/dist/runtime/env/public-client.d.mts +4 -1
- package/dist/runtime/env/public.d.mts +1 -1
- package/dist/runtime/env/public.mjs +2 -2
- package/dist/runtime/env/runtime.mjs +1 -1
- package/dist/runtime/handler/index.d.mts +1 -1
- package/dist/runtime/handler/index.mjs +1 -1
- package/dist/runtime/handler/validator.d.mts +1 -1
- package/dist/runtime/handler/validator.mjs +1 -1
- package/dist/runtime/isr/index.mjs +1 -1
- package/dist/runtime/kv/index.mjs +1 -1
- package/dist/runtime/live/client.d.mts +2 -2
- package/dist/runtime/live/client.mjs +7 -7
- package/dist/runtime/live/index.d.mts +1 -1
- package/dist/runtime/live/index.mjs +1 -1
- package/dist/runtime/live/server.mjs +3 -3
- package/dist/runtime/queues/index.mjs +2 -2
- package/dist/runtime/remote/index.d.mts +5 -1
- package/dist/runtime/remote/index.mjs +10 -9
- package/dist/runtime/routing/index.d.mts +11 -12
- package/dist/runtime/routing/index.mjs +69 -65
- package/dist/runtime/routing/route-url.d.mts +1 -1
- package/dist/runtime/routing/route-url.mjs +1 -1
- package/dist/runtime/sandbox/index.d.mts +1 -1
- package/dist/runtime/sandbox/index.mjs +2 -2
- package/dist/runtime/sse/client.d.mts +1 -1
- package/dist/runtime/sse/index.mjs +1 -1
- package/dist/runtime/storage/index.mjs +1 -1
- package/dist/runtime/ws/index.d.mts +1 -1
- package/dist/runtime/ws/index.mjs +3 -2
- package/dist/runtime/ws/room.d.mts +1 -1
- package/dist/runtime/ws/room.mjs +2 -2
- package/dist/runtime/ws/server.d.mts +2 -2
- package/dist/runtime/ws/server.mjs +1 -1
- package/dist/{runtime-zDDinDI5.mjs → runtime-C_VPIJBF.mjs} +1 -1
- package/dist/{scan-tDExXbA1.mjs → scan-Ct_SEzH4.mjs} +36 -29
- package/dist/{secret-DDNLIQOT.mjs → secret-Deqo3n_N.mjs} +11 -10
- package/dist/security-api-types-CU7zQtr_.mjs +9 -0
- package/dist/security-sarif-ClyYwtAW.mjs +123 -0
- package/dist/{serialize-Pf-CIQK_.mjs → serialize-BmB4BfKu.mjs} +1 -1
- package/dist/{server-CfUbeOjx.mjs → server-T-4mn8zy.mjs} +5 -4
- package/dist/session-BT8XDkvL.mjs +45 -0
- package/dist/session-ouZYD7zb.d.mts +18 -0
- package/dist/{skills-CoBB9_Ao.mjs → skills-C-csz78e.mjs} +10 -17
- package/dist/{sse-BXnTfcf3.mjs → sse-D3ab0YQT.mjs} +16 -13
- package/dist/{static-exports-DFkzL-NX.mjs → static-exports-s7P86Ngp.mjs} +3 -3
- package/dist/{subcommand-prompt-0yIARXf2.mjs → subcommand-prompt-B4LOLosl.mjs} +31 -21
- package/dist/sveltekit.mjs +1 -1
- package/dist/{terminal-log-text-DNsWJREL.mjs → terminal-log-text-CfS2JKM6.mjs} +1 -1
- package/dist/{url-DaehRGKR.mjs → url-DBQluotE.mjs} +4 -1
- package/dist/validate-CZYUIfR-.mjs +1 -0
- package/dist/{validate-Ddzl-IwT.mjs → validate-CtBWCzez.mjs} +7 -4
- package/dist/{validator-Duafcnh7.mjs → validator-Dfh9kCDm.mjs} +5 -5
- package/dist/{version-metadata-DEmItNdS.mjs → version-metadata-DqgLa6gc.mjs} +1 -1
- package/dist/{wrangler-D1zq1rXr.mjs → wrangler-DVe5KV5G.mjs} +49 -46
- package/dist/wrangler-Dq269bjx.mjs +1 -0
- package/dist/{wrapper-C2gMY432.mjs → wrapper-CcMYpOS8.mjs} +45 -171
- package/docs/guide/ai.md +13 -0
- package/docs/guide/app-types.md +1 -1
- package/docs/guide/auth.md +2 -16
- package/docs/guide/database/d1.md +283 -3
- package/docs/guide/database.md +2 -0
- package/docs/guide/email/domains.md +8 -6
- package/docs/guide/email/sending.md +18 -1
- package/docs/guide/pages-routing/actions-and-forms.md +4 -4
- package/docs/guide/pages-routing/head.md +20 -2
- package/docs/guide/platform/administration/plans.md +13 -0
- package/docs/guide/platform/administration/security-audits.md +213 -0
- package/docs/guide/platform/administration/zero-trust.md +6 -0
- package/docs/guide/platform/development/local.md +3 -5
- package/docs/guide/platform/installation/ci.md +1 -1
- package/docs/guide/platform/installation/credentials.md +23 -20
- package/docs/guide/platform/installation/maintenance.md +8 -2
- package/docs/guide/platform/installation/prerequisites.md +1 -1
- package/docs/guide/platform/installation/uninstall.md +2 -0
- package/docs/guide/platform-administration.md +1 -0
- package/docs/guide/self-hosted-platform.md +14 -13
- package/docs/guide/type-safety.md +1 -1
- package/docs/integrations/cloudflare.md +5 -3
- package/docs/reference/api/database.md +42 -2
- package/docs/reference/api/handlers.md +3 -3
- package/docs/reference/api/types.md +11 -1
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/database.md +6 -3
- package/docs/reference/cli/deploy.md +17 -13
- package/docs/reference/cli/domains.md +1 -1
- package/docs/reference/cli/email.md +3 -3
- package/docs/reference/cli/platform-config.md +5 -3
- package/docs/reference/cli/platform-installation.md +29 -28
- package/docs/reference/cli/platform-security.md +98 -0
- package/docs/reference/cli/platform-zero-trust.md +2 -0
- package/docs/reference/cli/platform.md +1 -0
- package/docs/reference/cli/project.md +57 -0
- package/docs/reference/cli.md +3 -1
- package/docs/reference/config.md +7 -6
- package/package.json +31 -27
- package/schema.json +7 -1
- package/skills/void/SKILL.md +8 -0
- package/dist/cf-build-output-D3_x71H6.mjs +0 -1
- package/dist/cf-config-migrate-CHtnM3_C.mjs +0 -348
- package/dist/cloudflare-operations-C5RTQNnh.mjs +0 -1
- package/dist/cloudflare-process-wcnaQ5JG.mjs +0 -392
- package/dist/cloudflare-user-output-zEwuGrEJ.mjs +0 -19
- package/dist/collect-8i0wU63d.mjs +0 -1
- package/dist/deploy-rUunHBNJ.mjs +0 -2
- package/dist/discover-Diq0l6TZ.mjs +0 -1
- package/dist/gen-BQ7itmK7.mjs +0 -1
- package/dist/help-Ld6XFol7.mjs +0 -1
- package/dist/login-C-n1rA0s.mjs +0 -1
- package/dist/migrate-CKn30rmw.mjs +0 -1
- package/dist/operator-args-BCCohcz3.mjs +0 -722
- package/dist/operator-cmd-BnLoIO2A.mjs +0 -1
- package/dist/output-BsdnNpxa.mjs +0 -1
- package/dist/platform-args-Rgp86xa7.mjs +0 -1
- package/dist/platform-management-7Bf_OgS5.mjs +0 -1
- package/dist/prepare-CI7_C9Xf.mjs +0 -1
- package/dist/project-zero-trust-DrRyAHW1.mjs +0 -64
- package/dist/provision-DdWqRmmr.mjs +0 -1
- package/dist/resolve-project-C5wC-Hoi.mjs +0 -1
- package/dist/route-types-CrODgORq.mjs +0 -655
- package/dist/validate-DY1U9rET.mjs +0 -1
- package/dist/wrangler-DM3GOqck.mjs +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-
|
|
1
|
+
import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
|
|
2
2
|
import { a as join, c as resolve, n as dirname, r as extname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
|
-
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-
|
|
4
|
-
import { t as resolveLocalD1Target } from "./local-d1-
|
|
5
|
-
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-
|
|
6
|
-
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-
|
|
7
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
8
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
9
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
10
|
-
import { c as loadLocalEnv } from "./env-
|
|
11
|
-
import { c as getToken, o as getProxyUrl } from "./auth-
|
|
12
|
-
import { n as ensurePlatformProxyAccess, r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-
|
|
13
|
-
import { n as PlatformApiError, r as PlatformClient } from "./client-
|
|
14
|
-
import { n as formatTimestamp } from "./gen-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
3
|
+
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-Dv5jri1-.mjs";
|
|
4
|
+
import { t as resolveLocalD1Target } from "./local-d1-CYOYkVwO.mjs";
|
|
5
|
+
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-rNLybAnF.mjs";
|
|
6
|
+
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CtBWCzez.mjs";
|
|
7
|
+
import { r as detectFramework } from "./plugin-inference-7O11_E4H.mjs";
|
|
8
|
+
import { n as readProjectPaths } from "./project-paths-2ENfCCih.mjs";
|
|
9
|
+
import { t as cfAccessHeaders } from "./cf-access-DmkKPcAI.mjs";
|
|
10
|
+
import { c as loadLocalEnv } from "./env-EjHqc7m9.mjs";
|
|
11
|
+
import { c as getToken, o as getProxyUrl } from "./auth-DlLDymuc.mjs";
|
|
12
|
+
import { n as ensurePlatformProxyAccess, r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-FaIm95jA.mjs";
|
|
13
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-ImIe7Mjq.mjs";
|
|
14
|
+
import { n as formatTimestamp } from "./gen-DiTZlDx8.mjs";
|
|
15
|
+
import { t as Buffer } from "./node-buffer-D7kgjaDs.mjs";
|
|
16
|
+
import { c as formatCount, f as formatUrl, h as import_picocolors, o as dim, p as getErrorMessage, y as printSuccess } from "./output-BZLnu0z8.mjs";
|
|
17
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-dh9431bN.mjs";
|
|
17
18
|
import { n as drizzleKitBin } from "./yarn-pnp-DgWbE7z5.mjs";
|
|
18
19
|
import { createRequire } from "node:module";
|
|
19
20
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
20
21
|
import { pathToFileURL } from "node:url";
|
|
21
|
-
import { createJiti } from "jiti";
|
|
22
22
|
import { execFileSync } from "node:child_process";
|
|
23
23
|
// src/cli/db-export-sequences.ts
|
|
24
24
|
function quoteSqlIdentifier(value) {
|
|
@@ -155,7 +155,7 @@ function runDrizzleKit(root, args) {
|
|
|
155
155
|
* already printed its own error.
|
|
156
156
|
*/
|
|
157
157
|
async function runDrizzleKitWithDatabaseUrl(root, url, dialect, command) {
|
|
158
|
-
const { withPrivateDrizzleConfig } = await import("./config-
|
|
158
|
+
const { withPrivateDrizzleConfig } = await import("./config-DtjrUtPo.mjs");
|
|
159
159
|
if (!withPrivateDrizzleConfig(root, url, dialect, (configPath) => {
|
|
160
160
|
try {
|
|
161
161
|
runDrizzleKit(root, [
|
|
@@ -186,7 +186,7 @@ async function withPgClient(root, fn) {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
async function withMySqlClient(root, fn, options = {}) {
|
|
189
|
-
const { toMySqlClient } = await import("./runner-mysql-
|
|
189
|
+
const { toMySqlClient } = await import("./runner-mysql-r688x6Y9.mjs");
|
|
190
190
|
const { createConnection } = await import("mysql2/promise");
|
|
191
191
|
const connection = await createConnection({
|
|
192
192
|
uri: getLocalDatabaseUrl(root, "mysql"),
|
|
@@ -217,7 +217,7 @@ async function runDbCommand(root, args) {
|
|
|
217
217
|
else if (args.action === "status") await runStatus(root, dialect);
|
|
218
218
|
else if (args.action === "reset") await runReset(root, dialect, args.yes);
|
|
219
219
|
else if (args.action === "seed") await runSeed(root, args.file, dialect, args.yes);
|
|
220
|
-
else if (args.action === "execute") await runExecute(root, args.command, args.file, dialect, args.remote);
|
|
220
|
+
else if (args.action === "execute") await runExecute(root, args.command, args.file, dialect, args.remote, args.yes);
|
|
221
221
|
else if (args.action === "migrate") await runMigrate(root, dialect, args.remote);
|
|
222
222
|
else if (args.action === "studio") await runStudio(root, dialect, args.remote);
|
|
223
223
|
else if (args.action === "set-url") await runSetUrl(root, dialect);
|
|
@@ -228,8 +228,8 @@ async function runDbCommand(root, args) {
|
|
|
228
228
|
}
|
|
229
229
|
function writeLocalDatabaseUrl(root, connectionString) {
|
|
230
230
|
const envPath = join(root, ".env");
|
|
231
|
-
const original = existsSync(envPath) ? readFileSync(envPath, "
|
|
232
|
-
const lines = original ? original.
|
|
231
|
+
const original = existsSync(envPath) ? readFileSync(envPath, "utf8") : "";
|
|
232
|
+
const lines = original ? original.replaceAll("\r\n", "\n").split("\n") : [];
|
|
233
233
|
const assignment = `DATABASE_URL=${JSON.stringify(connectionString)}`;
|
|
234
234
|
const index = lines.findIndex((line) => /^\s*(?:export\s+)?DATABASE_URL\s*=/.test(line));
|
|
235
235
|
if (index === -1) {
|
|
@@ -311,7 +311,7 @@ async function runPush(root, dialect) {
|
|
|
311
311
|
printSuccess("Database schema pushed.");
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
314
|
+
const { writeDrizzleConfig } = await import("./config-DtjrUtPo.mjs");
|
|
315
315
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
316
316
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
317
317
|
const configPath = writeDrizzleConfig(root, dbPath);
|
|
@@ -327,15 +327,15 @@ async function runPush(root, dialect) {
|
|
|
327
327
|
printSuccess("Database schema pushed.");
|
|
328
328
|
}
|
|
329
329
|
async function runGenerate(root, dialect) {
|
|
330
|
-
const { prepareProject } = await import("./prepare-
|
|
331
|
-
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-
|
|
330
|
+
const { prepareProject } = await import("./prepare-BmG2E6TI.mjs");
|
|
331
|
+
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-DtjrUtPo.mjs");
|
|
332
332
|
await prepareProject(root);
|
|
333
333
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
334
334
|
const additionalSchemas = existsSync(authSchemaPath) ? [authSchemaPath] : void 0;
|
|
335
335
|
const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[dialect], dialect, { additionalSchemas });
|
|
336
336
|
try {
|
|
337
337
|
if (dialect === "sqlite") {
|
|
338
|
-
const { generateValidatedSqliteMigrations } = await import("./generate-
|
|
338
|
+
const { generateValidatedSqliteMigrations } = await import("./generate-C3ZAqCy-.mjs");
|
|
339
339
|
await generateValidatedSqliteMigrations(readProjectPaths(root).migrationsDir, () => {
|
|
340
340
|
runDrizzleKit(root, [
|
|
341
341
|
"generate",
|
|
@@ -371,19 +371,19 @@ async function runStatus(root, dialect) {
|
|
|
371
371
|
let localApplied;
|
|
372
372
|
let localError;
|
|
373
373
|
if (dialect === "postgresql") try {
|
|
374
|
-
const { readPgAppliedMigrations } = await import("./runner-pg-
|
|
374
|
+
const { readPgAppliedMigrations } = await import("./runner-pg-DMJquR3d.mjs");
|
|
375
375
|
localApplied = await withPgClient(root, readPgAppliedMigrations);
|
|
376
376
|
} catch (error) {
|
|
377
377
|
localError = error;
|
|
378
378
|
}
|
|
379
379
|
else if (dialect === "mysql") try {
|
|
380
|
-
const { readMySqlAppliedMigrations } = await import("./runner-mysql-
|
|
380
|
+
const { readMySqlAppliedMigrations } = await import("./runner-mysql-r688x6Y9.mjs");
|
|
381
381
|
localApplied = await withMySqlClient(root, readMySqlAppliedMigrations);
|
|
382
382
|
} catch (error) {
|
|
383
383
|
localError = error;
|
|
384
384
|
}
|
|
385
385
|
else {
|
|
386
|
-
const { getAppliedMigrations } = await import("./runner-
|
|
386
|
+
const { getAppliedMigrations } = await import("./runner-Bf94YVJK.mjs");
|
|
387
387
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
388
388
|
localApplied = (await getAppliedMigrations(dbPath)).map((m) => m.name);
|
|
389
389
|
}
|
|
@@ -393,12 +393,12 @@ async function runStatus(root, dialect) {
|
|
|
393
393
|
if (dialect !== "sqlite") {
|
|
394
394
|
const databaseUrl = process.env.DATABASE_URL;
|
|
395
395
|
if (!databaseUrl) throw new Error("DATABASE_URL is not available.");
|
|
396
|
-
remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-
|
|
396
|
+
remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-DMJquR3d.mjs")).getPgAppliedMigrations(databaseUrl) : await (await import("./runner-mysql-r688x6Y9.mjs")).getMySqlAppliedMigrations(databaseUrl)).map((name) => ({
|
|
397
397
|
name,
|
|
398
398
|
applied_at: ""
|
|
399
399
|
}));
|
|
400
400
|
} else {
|
|
401
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
401
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-dpRD-2Px.mjs");
|
|
402
402
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, configuredD1Binding(root)))).map((name) => ({
|
|
403
403
|
name,
|
|
404
404
|
applied_at: ""
|
|
@@ -548,7 +548,7 @@ async function resetDatabase(root, dialect, yes) {
|
|
|
548
548
|
}
|
|
549
549
|
await confirmReset(root, dialect, yes);
|
|
550
550
|
if (dialect === "postgresql") {
|
|
551
|
-
const { applyPgMigrations } = await import("./runner-pg-
|
|
551
|
+
const { applyPgMigrations } = await import("./runner-pg-DMJquR3d.mjs");
|
|
552
552
|
await withPgClient(root, async (client) => {
|
|
553
553
|
const objects = await client.query(PG_RESET_OBJECTS);
|
|
554
554
|
const names = (kind) => objects.rows.filter((row) => row.kind === kind).map((row) => row.name);
|
|
@@ -566,7 +566,7 @@ async function resetDatabase(root, dialect, yes) {
|
|
|
566
566
|
return migrations.length;
|
|
567
567
|
}
|
|
568
568
|
if (dialect === "mysql") {
|
|
569
|
-
const { applyPendingMySqlMigrations, withMySqlMigrationLock } = await import("./runner-mysql-
|
|
569
|
+
const { applyPendingMySqlMigrations, withMySqlMigrationLock } = await import("./runner-mysql-r688x6Y9.mjs");
|
|
570
570
|
await withMySqlClient(root, (client) => withMySqlMigrationLock(client, async () => {
|
|
571
571
|
const tables = await client.query("SELECT table_name AS table_name, table_type AS table_type FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type IN ('BASE TABLE', 'VIEW')");
|
|
572
572
|
await client.query("SET FOREIGN_KEY_CHECKS = 0");
|
|
@@ -584,7 +584,7 @@ async function resetDatabase(root, dialect, yes) {
|
|
|
584
584
|
}));
|
|
585
585
|
return migrations.length;
|
|
586
586
|
}
|
|
587
|
-
const { runMigrations } = await import("./runner-
|
|
587
|
+
const { runMigrations } = await import("./runner-Bf94YVJK.mjs");
|
|
588
588
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
589
589
|
rmSync(dbPath, { force: true });
|
|
590
590
|
rmSync(dbPath + "-wal", { force: true });
|
|
@@ -598,47 +598,65 @@ async function runReset(root, dialect, yes) {
|
|
|
598
598
|
}
|
|
599
599
|
async function runSeed(root, file, dialect, yes) {
|
|
600
600
|
const seed = resolveSeedTarget(root, file);
|
|
601
|
-
const
|
|
601
|
+
const seedSql = seed.kind === "sql" ? readFileSync(seed.path, "utf8") : void 0;
|
|
602
602
|
await confirmReset(root, dialect, yes);
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
const { openSqliteDatabase } = await import("./runner-CTk21HrO.mjs");
|
|
622
|
-
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
623
|
-
const db = await openSqliteDatabase(dbPath);
|
|
624
|
-
try {
|
|
625
|
-
db.exec(sql);
|
|
626
|
-
} finally {
|
|
627
|
-
db.close();
|
|
628
|
-
}
|
|
629
|
-
} else await runSeedModule(root, seedFn, dialect);
|
|
603
|
+
if (seedSql !== void 0) {
|
|
604
|
+
await resetBeforeSeed(root, dialect);
|
|
605
|
+
await runSqlSeed(root, dialect, seedSql);
|
|
606
|
+
if (dialect === "sqlite") log.info(dim("Restart your dev server if it's running."));
|
|
607
|
+
printSuccess(`Seeded from ${seed.displayPath}.`);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
const { createSeedModuleLoader } = await import("./db-seed-loader-Bcz_SutQ.mjs");
|
|
611
|
+
const loader = createSeedModuleLoader(root, seed.path);
|
|
612
|
+
try {
|
|
613
|
+
const run = await loadSeedFunction(seed.path, loader.importModule);
|
|
614
|
+
await resetBeforeSeed(root, dialect);
|
|
615
|
+
await runSeedModule(root, run, dialect, loader.importModule);
|
|
616
|
+
} finally {
|
|
617
|
+
loader.close();
|
|
618
|
+
}
|
|
630
619
|
log.info(dim("Restart your dev server if it's running."));
|
|
631
620
|
printSuccess(`Seeded from ${seed.displayPath}.`);
|
|
632
621
|
}
|
|
622
|
+
/** Drop and re-run migrations before a seed. The drop is already confirmed, so do not ask again. */
|
|
623
|
+
async function resetBeforeSeed(root, dialect) {
|
|
624
|
+
const migrationCount = await resetDatabase(root, dialect, true);
|
|
625
|
+
log.step(`Reset database. Applied ${formatCount(migrationCount, "migration")}.`);
|
|
626
|
+
}
|
|
627
|
+
async function runSqlSeed(root, dialect, sql) {
|
|
628
|
+
if (dialect === "postgresql") {
|
|
629
|
+
await withPgClient(root, async (client) => {
|
|
630
|
+
await client.query(sql);
|
|
631
|
+
});
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
if (dialect === "mysql") {
|
|
635
|
+
await withMySqlClient(root, async (client) => {
|
|
636
|
+
await client.query(sql);
|
|
637
|
+
});
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
const { openSqliteDatabase } = await import("./runner-Bf94YVJK.mjs");
|
|
641
|
+
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
642
|
+
const db = await openSqliteDatabase(dbPath);
|
|
643
|
+
try {
|
|
644
|
+
db.exec(sql);
|
|
645
|
+
} finally {
|
|
646
|
+
db.close();
|
|
647
|
+
}
|
|
648
|
+
}
|
|
633
649
|
/**
|
|
634
650
|
* Fail-closed check for read-only SQL (SELECT or plain EXPLAIN), which skips the remote
|
|
635
|
-
* confirmation prompt.
|
|
636
|
-
*
|
|
637
|
-
*
|
|
651
|
+
* confirmation prompt. A semicolon anywhere but the end means a script, and it is read from the
|
|
652
|
+
* raw text: a semicolon inside a literal must stay visible, or `SELECT '--' ; DROP TABLE users`
|
|
653
|
+
* reads as one comment-only SELECT and skips the prompt. Comments are stripped for the read-only
|
|
654
|
+
* test so they cannot hide `ANALYZE`. `WITH` (a CTE can write) is rejected, and so is
|
|
655
|
+
* `EXPLAIN ANALYZE` in either form, because PostgreSQL executes the analyzed statement.
|
|
638
656
|
*/
|
|
639
657
|
function isSafeStatement(sql) {
|
|
640
|
-
|
|
641
|
-
|
|
658
|
+
if (sql.replace(/;\s*$/, "").includes(";")) return false;
|
|
659
|
+
const stripped = sql.replaceAll(/\/\*[\s\S]*?\*\//g, " ").replaceAll(/--[^\n]*/g, " ").replace(/;\s*$/, "");
|
|
642
660
|
if (/^\s*SELECT\b/i.test(stripped)) return true;
|
|
643
661
|
if (/^\s*EXPLAIN\b/i.test(stripped)) {
|
|
644
662
|
if (/^\s*EXPLAIN\s+ANALYZE\b/i.test(stripped)) return false;
|
|
@@ -649,6 +667,21 @@ function isSafeStatement(sql) {
|
|
|
649
667
|
return false;
|
|
650
668
|
}
|
|
651
669
|
/**
|
|
670
|
+
* Prepare one statement. better-sqlite3 refuses SQL that holds no statement or more than one
|
|
671
|
+
* with a `RangeError`, before it runs anything (`src/objects/statement.cpp`). Those are the
|
|
672
|
+
* only errors this call can raise that way, so the caller runs the same text through
|
|
673
|
+
* `exec()`, which handles a script and reports no rows. Execution errors never come back
|
|
674
|
+
* here, so nothing is replayed.
|
|
675
|
+
*/
|
|
676
|
+
function prepareSingleStatement(db, sql) {
|
|
677
|
+
try {
|
|
678
|
+
return db.prepare(sql);
|
|
679
|
+
} catch (error) {
|
|
680
|
+
if (error instanceof RangeError) return;
|
|
681
|
+
throw error;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
652
685
|
* Fetch a project's remote PostgreSQL connection string from the platform.
|
|
653
686
|
* Exits with a friendly message when the URL has never been stored (404);
|
|
654
687
|
* other errors propagate so the caller's top-level handler can report them.
|
|
@@ -691,28 +724,44 @@ async function executeExternalRemoteSql(dialect, dbUrl, sql) {
|
|
|
691
724
|
}
|
|
692
725
|
/**
|
|
693
726
|
* Prompt the user to confirm a destructive remote query when running in a TTY.
|
|
694
|
-
*
|
|
727
|
+
* `always` asks even for read-only SQL, and `yes` (`--yes`) never asks. Returns true if
|
|
728
|
+
* execution should proceed, false if it was cancelled.
|
|
695
729
|
*/
|
|
696
|
-
async function confirmDestructiveRemote(sql) {
|
|
697
|
-
if (isSafeStatement(sql)) return true;
|
|
730
|
+
async function confirmDestructiveRemote(sql, { always = false, yes = false } = {}) {
|
|
731
|
+
if (yes || !always && isSafeStatement(sql)) return true;
|
|
698
732
|
if (!process.stdin.isTTY) return true;
|
|
699
733
|
const ok = await confirm({ message: "This will run against your deployed database. Continue?" });
|
|
700
734
|
if (isCancel(ok) || !ok) return false;
|
|
701
735
|
return true;
|
|
702
736
|
}
|
|
703
|
-
|
|
737
|
+
const D1_MAX_SQL_STATEMENT_BYTES = 1e5;
|
|
738
|
+
async function runExecute(root, command, file, dialect, remote, yes) {
|
|
739
|
+
const readSql = () => {
|
|
740
|
+
if (file) return readFileSync(resolve(root, file), "utf8");
|
|
741
|
+
if (command === void 0) throw new Error("db execute requires a SQL command or file.");
|
|
742
|
+
return command;
|
|
743
|
+
};
|
|
704
744
|
if (remote) {
|
|
705
745
|
const directCloudflare = readDeploymentPlatform(root) === "cloudflare";
|
|
706
|
-
const sql =
|
|
746
|
+
const sql = readSql();
|
|
707
747
|
if (directCloudflare) {
|
|
708
|
-
|
|
748
|
+
const bulkImport = dialect === "sqlite" && file !== void 0 && Buffer.byteLength(sql) > D1_MAX_SQL_STATEMENT_BYTES;
|
|
749
|
+
if (bulkImport) log.warn(`${file} is larger than 100 KB, so Void runs it as a D1 import. The database cannot serve queries until the import finishes, and query rows are not printed.`);
|
|
750
|
+
if (!await confirmDestructiveRemote(sql, {
|
|
751
|
+
always: bulkImport,
|
|
752
|
+
yes
|
|
753
|
+
})) {
|
|
709
754
|
log.info("Cancelled.");
|
|
710
755
|
process.exit(0);
|
|
711
756
|
}
|
|
712
757
|
if (dialect === "sqlite") {
|
|
713
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
758
|
+
const { executeCloudflareD1Sql, importCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-dpRD-2Px.mjs");
|
|
759
|
+
const context = resolveCloudflareD1Context(root, configuredD1Binding(root));
|
|
760
|
+
if (bulkImport) await importCloudflareD1Sql(context, sql);
|
|
761
|
+
else {
|
|
762
|
+
const rows = await executeCloudflareD1Sql(context, sql);
|
|
763
|
+
if (rows.length > 0) printTable(rows);
|
|
764
|
+
}
|
|
716
765
|
} else {
|
|
717
766
|
const dbUrl = process.env.DATABASE_URL;
|
|
718
767
|
if (!dbUrl) {
|
|
@@ -734,7 +783,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
734
783
|
log.error("No project linked. Run `void deploy` first or link a project.");
|
|
735
784
|
process.exit(1);
|
|
736
785
|
}
|
|
737
|
-
if (!await confirmDestructiveRemote(sql)) {
|
|
786
|
+
if (!await confirmDestructiveRemote(sql, { yes })) {
|
|
738
787
|
log.info("Cancelled.");
|
|
739
788
|
process.exit(0);
|
|
740
789
|
}
|
|
@@ -794,7 +843,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
794
843
|
return;
|
|
795
844
|
}
|
|
796
845
|
if (dialect === "postgresql") {
|
|
797
|
-
const sql =
|
|
846
|
+
const sql = readSql();
|
|
798
847
|
await withPgClient(root, async (client) => {
|
|
799
848
|
const result = await client.query(sql);
|
|
800
849
|
if (result.rows && result.rows.length > 0) printTable(result.rows);
|
|
@@ -803,7 +852,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
803
852
|
return;
|
|
804
853
|
}
|
|
805
854
|
if (dialect === "mysql") {
|
|
806
|
-
const sql =
|
|
855
|
+
const sql = readSql();
|
|
807
856
|
await withMySqlClient(root, async (client) => {
|
|
808
857
|
const rows = await client.query(sql);
|
|
809
858
|
if (rows.length > 0) printTable(rows);
|
|
@@ -811,20 +860,19 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
811
860
|
printSuccess("SQL executed successfully.");
|
|
812
861
|
return;
|
|
813
862
|
}
|
|
814
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
863
|
+
const { openSqliteDatabase } = await import("./runner-Bf94YVJK.mjs");
|
|
815
864
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
816
865
|
if (!existsSync(dbPath)) {
|
|
817
866
|
log.error("No local database found. Start the dev server first.");
|
|
818
867
|
process.exit(1);
|
|
819
868
|
}
|
|
820
|
-
const sql =
|
|
869
|
+
const sql = readSql();
|
|
821
870
|
const db = await openSqliteDatabase(dbPath);
|
|
822
871
|
try {
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
const rows =
|
|
826
|
-
if (rows.length
|
|
827
|
-
else printTable(rows);
|
|
872
|
+
const statement = prepareSingleStatement(db, sql);
|
|
873
|
+
if (statement?.reader) {
|
|
874
|
+
const rows = statement.all();
|
|
875
|
+
if (rows.length > 0) printTable(rows);
|
|
828
876
|
} else db.exec(sql);
|
|
829
877
|
} finally {
|
|
830
878
|
db.close();
|
|
@@ -875,11 +923,11 @@ async function runMigrate(root, dialect, remote) {
|
|
|
875
923
|
let appliedNames;
|
|
876
924
|
let applyMigrations;
|
|
877
925
|
if (dialect === "postgresql") {
|
|
878
|
-
const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-
|
|
926
|
+
const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-DMJquR3d.mjs");
|
|
879
927
|
appliedNames = await getPgAppliedMigrations(databaseUrl);
|
|
880
928
|
applyMigrations = () => runPgMigrations(migrationsDir, databaseUrl);
|
|
881
929
|
} else {
|
|
882
|
-
const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-
|
|
930
|
+
const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-r688x6Y9.mjs");
|
|
883
931
|
appliedNames = await getMySqlAppliedMigrations(databaseUrl);
|
|
884
932
|
applyMigrations = () => runMySqlMigrations(migrationsDir, databaseUrl);
|
|
885
933
|
}
|
|
@@ -904,7 +952,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
904
952
|
log.info(`No migration files found in ${paths.sourceRelative("db/migrations")}/`);
|
|
905
953
|
return;
|
|
906
954
|
}
|
|
907
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
955
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-dpRD-2Px.mjs");
|
|
908
956
|
const binding = configuredD1Binding(root);
|
|
909
957
|
const context = resolveCloudflareD1Context(root, binding);
|
|
910
958
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -924,7 +972,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
924
972
|
log.error(`db: D1 binding ${binding} has no "migrations_dir", so Cloudflare would apply ./migrations instead of ${dir}/. Add "migrations_dir": "./${dir}" to that D1 binding in your Cloudflare config, then run the command again.`);
|
|
925
973
|
process.exit(1);
|
|
926
974
|
}
|
|
927
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
975
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-BB3rsZbP.mjs");
|
|
928
976
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations, paths.sourceRelative("db/migrations"));
|
|
929
977
|
if (!applySet.ok) {
|
|
930
978
|
log.error(applySet.reason);
|
|
@@ -986,7 +1034,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
986
1034
|
return;
|
|
987
1035
|
}
|
|
988
1036
|
if (dialect === "postgresql") {
|
|
989
|
-
const { applyPgMigrations, readPgAppliedMigrations } = await import("./runner-pg-
|
|
1037
|
+
const { applyPgMigrations, readPgAppliedMigrations } = await import("./runner-pg-DMJquR3d.mjs");
|
|
990
1038
|
const applied = await withPgClient(root, async (client) => {
|
|
991
1039
|
const appliedNames = await readPgAppliedMigrations(client).catch(() => []);
|
|
992
1040
|
try {
|
|
@@ -1005,7 +1053,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
1005
1053
|
return;
|
|
1006
1054
|
}
|
|
1007
1055
|
if (dialect === "mysql") {
|
|
1008
|
-
const { applyMySqlMigrations, readMySqlAppliedMigrations } = await import("./runner-mysql-
|
|
1056
|
+
const { applyMySqlMigrations, readMySqlAppliedMigrations } = await import("./runner-mysql-r688x6Y9.mjs");
|
|
1009
1057
|
const applied = await withMySqlClient(root, async (client) => {
|
|
1010
1058
|
const appliedNames = await readMySqlAppliedMigrations(client).catch(() => []);
|
|
1011
1059
|
try {
|
|
@@ -1023,7 +1071,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
1023
1071
|
}
|
|
1024
1072
|
return;
|
|
1025
1073
|
}
|
|
1026
|
-
const { getAppliedMigrations, runMigrations } = await import("./runner-
|
|
1074
|
+
const { getAppliedMigrations, runMigrations } = await import("./runner-Bf94YVJK.mjs");
|
|
1027
1075
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1028
1076
|
try {
|
|
1029
1077
|
const existingRows = await getAppliedMigrations(dbPath);
|
|
@@ -1051,7 +1099,7 @@ async function runRestore(root, dialect, { target, platform: explicitPlatform, y
|
|
|
1051
1099
|
log.error("db: `void db restore` restores the D1 database of a direct Cloudflare deploy. After a one-off `void deploy --platform cloudflare`, run it with `--platform cloudflare`.");
|
|
1052
1100
|
process.exit(1);
|
|
1053
1101
|
}
|
|
1054
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context, restoreCloudflareD1Database } = await import("./cloudflare-operations-
|
|
1102
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context, restoreCloudflareD1Database } = await import("./cloudflare-operations-dpRD-2Px.mjs");
|
|
1055
1103
|
const binding = configuredD1Binding(root);
|
|
1056
1104
|
const context = resolveCloudflareD1Context(root, binding);
|
|
1057
1105
|
const database = `D1 database ${context.migrateToken} (${binding})`;
|
|
@@ -1125,7 +1173,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
1125
1173
|
await runDrizzleKitWithDatabaseUrl(root, url, dialect, "studio");
|
|
1126
1174
|
return;
|
|
1127
1175
|
}
|
|
1128
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
1176
|
+
const { writeDrizzleConfig } = await import("./config-DtjrUtPo.mjs");
|
|
1129
1177
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1130
1178
|
if (!existsSync(dbPath)) {
|
|
1131
1179
|
log.error("No local database found. Start the dev server first.");
|
|
@@ -1145,8 +1193,8 @@ async function runStudio(root, dialect, remote) {
|
|
|
1145
1193
|
}
|
|
1146
1194
|
/** A direct Cloudflare deploy records its D1 or Hyperdrive id in the checked-in Cloudflare config. */
|
|
1147
1195
|
async function hasDeployedCloudflareDatabase(root) {
|
|
1148
|
-
const { readRootWranglerConfig } = await import("./wrangler-
|
|
1149
|
-
const { isRealD1Id, isRealHyperdriveId } = await import("./provision-
|
|
1196
|
+
const { readRootWranglerConfig } = await import("./wrangler-Dq269bjx.mjs");
|
|
1197
|
+
const { isRealD1Id, isRealHyperdriveId } = await import("./provision-DFv7SJDn.mjs");
|
|
1150
1198
|
const config = readRootWranglerConfig(root)?.config;
|
|
1151
1199
|
const entries = (key) => {
|
|
1152
1200
|
const value = config?.[key];
|
|
@@ -1154,6 +1202,7 @@ async function hasDeployedCloudflareDatabase(root) {
|
|
|
1154
1202
|
};
|
|
1155
1203
|
return entries("d1_databases").some((entry) => isRealD1Id(entry.database_id)) || entries("hyperdrive").some((entry) => isRealHyperdriveId(entry.id));
|
|
1156
1204
|
}
|
|
1205
|
+
const snapshotPrefix = (tag) => tag.split("_")[0];
|
|
1157
1206
|
async function runRenameMigrations(root, dialect) {
|
|
1158
1207
|
const paths = readProjectPaths(root);
|
|
1159
1208
|
const migrationsDir = paths.migrationsDir;
|
|
@@ -1219,7 +1268,6 @@ Delete ${dir}/migrations.js and re-run \`void db generate\` to migrate away\nfro
|
|
|
1219
1268
|
const journalPath = join(metaDir, "_journal.json");
|
|
1220
1269
|
const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
|
|
1221
1270
|
const journal = readJournal(migrationsDir, paths.sourceRelative);
|
|
1222
|
-
const snapshotPrefix = (tag) => tag.split("_")[0];
|
|
1223
1271
|
const snapshotPathFor = (tag) => join(metaDir, `${snapshotPrefix(tag)}_snapshot.json`);
|
|
1224
1272
|
if (journal && journal.entries.length > 0) {
|
|
1225
1273
|
const missingSnapshots = [];
|
|
@@ -1357,7 +1405,7 @@ Regenerate it with \`void db generate\`, or restore it from version control.`);
|
|
|
1357
1405
|
await rollback("db: Failed to update MySQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.", err);
|
|
1358
1406
|
}
|
|
1359
1407
|
else {
|
|
1360
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1408
|
+
const { openSqliteDatabase } = await import("./runner-Bf94YVJK.mjs");
|
|
1361
1409
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1362
1410
|
if (existsSync(dbPath)) try {
|
|
1363
1411
|
const db = await openSqliteDatabase(dbPath);
|
|
@@ -1396,7 +1444,7 @@ function formatMySqlExportValue(value) {
|
|
|
1396
1444
|
if (typeof value === "number" || typeof value === "bigint") return String(value);
|
|
1397
1445
|
if (typeof value === "boolean") return value ? "1" : "0";
|
|
1398
1446
|
if (value instanceof Uint8Array) return `X'${Array.from(value, (byte) => byte.toString(16).padStart(2, "0")).join("")}'`;
|
|
1399
|
-
return `'${String(value).replaceAll("\\",
|
|
1447
|
+
return `'${String(value).replaceAll("\\", String.raw`\\`).replaceAll("'", "''")}'`;
|
|
1400
1448
|
}
|
|
1401
1449
|
function formatSqliteExportValue(value) {
|
|
1402
1450
|
if (value === null) return "NULL";
|
|
@@ -1456,7 +1504,7 @@ async function runExport(root, args, dialect) {
|
|
|
1456
1504
|
const value = row[column];
|
|
1457
1505
|
if (value === null) return "NULL";
|
|
1458
1506
|
if (typeof value === "number") return String(value);
|
|
1459
|
-
return `'${String(value).
|
|
1507
|
+
return `'${String(value).replaceAll("'", "''")}'`;
|
|
1460
1508
|
});
|
|
1461
1509
|
parts.push(`INSERT INTO ${tableName} (${cols.map(quoteSqlIdentifier).join(", ")})${overriding} VALUES (${vals.join(", ")});`);
|
|
1462
1510
|
}
|
|
@@ -1513,7 +1561,7 @@ async function runExport(root, args, dialect) {
|
|
|
1513
1561
|
} else process.stdout.write(output);
|
|
1514
1562
|
return;
|
|
1515
1563
|
}
|
|
1516
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1564
|
+
const { openSqliteDatabase } = await import("./runner-Bf94YVJK.mjs");
|
|
1517
1565
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1518
1566
|
if (!existsSync(dbPath)) {
|
|
1519
1567
|
log.error("No local database found. Start the dev server first.", errOut);
|
|
@@ -1550,8 +1598,7 @@ async function runExport(root, args, dialect) {
|
|
|
1550
1598
|
const sequences = db.prepare("SELECT name, seq FROM sqlite_sequence").all();
|
|
1551
1599
|
for (const sequence of sequences) if (tables.includes(sequence.name)) {
|
|
1552
1600
|
const name = quoteSqlString(sequence.name);
|
|
1553
|
-
parts.push(`DELETE FROM sqlite_sequence WHERE name = ${name};`);
|
|
1554
|
-
parts.push(`INSERT INTO sqlite_sequence (name, seq) VALUES (${name}, ${sequence.seq});`);
|
|
1601
|
+
parts.push(`DELETE FROM sqlite_sequence WHERE name = ${name};`, `INSERT INTO sqlite_sequence (name, seq) VALUES (${name}, ${sequence.seq});`);
|
|
1555
1602
|
}
|
|
1556
1603
|
}
|
|
1557
1604
|
if (!args.noSchema) {
|
|
@@ -1608,7 +1655,10 @@ async function runSetUrl(root, dialect) {
|
|
|
1608
1655
|
function resolveSeedTarget(root, file) {
|
|
1609
1656
|
if (file) return toSeedTarget(root, resolve(root, file), file);
|
|
1610
1657
|
const paths = readProjectPaths(root);
|
|
1611
|
-
const defaults = DEFAULT_SEED_FILES.
|
|
1658
|
+
const defaults = DEFAULT_SEED_FILES.flatMap((candidate) => {
|
|
1659
|
+
const mappedCandidate = paths.sourceRelative(candidate);
|
|
1660
|
+
return existsSync(join(root, mappedCandidate)) ? [mappedCandidate] : [];
|
|
1661
|
+
});
|
|
1612
1662
|
if (defaults.length === 0) {
|
|
1613
1663
|
log.error(`db: No seed file found. Create one of: ${DEFAULT_SEED_FILES.map((candidate) => paths.sourceRelative(candidate)).join(", ")} or pass --file <path>.`);
|
|
1614
1664
|
process.exit(1);
|
|
@@ -1640,8 +1690,8 @@ function toSeedTarget(root, seedPath, displayPath) {
|
|
|
1640
1690
|
log.error(`db: Unsupported seed file '${normalizedDisplay}'. Use .sql, .ts, .mts, .js, or .mjs.`);
|
|
1641
1691
|
process.exit(1);
|
|
1642
1692
|
}
|
|
1643
|
-
async function runSeedModule(root, seed, dialect) {
|
|
1644
|
-
const schema = await loadSeedSchema(root);
|
|
1693
|
+
async function runSeedModule(root, seed, dialect, importModule) {
|
|
1694
|
+
const schema = await loadSeedSchema(root, importModule);
|
|
1645
1695
|
const casing = getDatabaseCasing(readConfig(root));
|
|
1646
1696
|
if (dialect === "postgresql") {
|
|
1647
1697
|
const { drizzle } = await import("drizzle-orm/node-postgres");
|
|
@@ -1676,7 +1726,7 @@ async function runSeedModule(root, seed, dialect) {
|
|
|
1676
1726
|
return;
|
|
1677
1727
|
}
|
|
1678
1728
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
1679
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1729
|
+
const { openSqliteDatabase } = await import("./runner-Bf94YVJK.mjs");
|
|
1680
1730
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1681
1731
|
const sqlite = await openSqliteDatabase(dbPath);
|
|
1682
1732
|
try {
|
|
@@ -1690,23 +1740,25 @@ async function runSeedModule(root, seed, dialect) {
|
|
|
1690
1740
|
sqlite.close();
|
|
1691
1741
|
}
|
|
1692
1742
|
}
|
|
1693
|
-
async function loadSeedFunction(seedPath) {
|
|
1694
|
-
const mod = await
|
|
1743
|
+
async function loadSeedFunction(seedPath, importModule) {
|
|
1744
|
+
const mod = await importModule(seedPath);
|
|
1695
1745
|
const seed = typeof mod.default === "function" ? mod.default : typeof mod.seed === "function" ? mod.seed : void 0;
|
|
1696
1746
|
if (!seed) throw new Error(`db: Seed module '${seedPath}' must export a default function or a named "seed" function.`);
|
|
1697
1747
|
return seed;
|
|
1698
1748
|
}
|
|
1699
|
-
async function loadSeedSchema(root) {
|
|
1700
|
-
const { discoverSchema } = await import("./discover-
|
|
1749
|
+
async function loadSeedSchema(root, importModule) {
|
|
1750
|
+
const { discoverSchema } = await import("./discover-D2KGP3cR.mjs");
|
|
1701
1751
|
const location = discoverSchema(root, readProjectPaths(root));
|
|
1702
1752
|
if (!location) return {};
|
|
1703
1753
|
if (location.type === "file") {
|
|
1704
|
-
const mod = await
|
|
1754
|
+
const mod = await importModule(location.path);
|
|
1705
1755
|
return Object.fromEntries(Object.entries(mod).filter(([name]) => name !== "default" && name !== "__esModule"));
|
|
1706
1756
|
}
|
|
1707
1757
|
const files = collectSchemaModuleFiles(location.path);
|
|
1708
|
-
const parts = await Promise.all(files.map((file) =>
|
|
1709
|
-
|
|
1758
|
+
const parts = await Promise.all(files.map((file) => importModule(file)));
|
|
1759
|
+
const schema = {};
|
|
1760
|
+
Object.assign(schema, ...parts.map((mod) => Object.fromEntries(Object.entries(mod).filter(([name]) => name !== "default"))));
|
|
1761
|
+
return schema;
|
|
1710
1762
|
}
|
|
1711
1763
|
function collectSchemaModuleFiles(dir) {
|
|
1712
1764
|
const files = [];
|
|
@@ -1720,13 +1772,6 @@ function collectSchemaModuleFiles(dir) {
|
|
|
1720
1772
|
}
|
|
1721
1773
|
return files.sort();
|
|
1722
1774
|
}
|
|
1723
|
-
async function importLocalModule(modulePath) {
|
|
1724
|
-
return createJiti(import.meta.url, {
|
|
1725
|
-
fsCache: false,
|
|
1726
|
-
moduleCache: false,
|
|
1727
|
-
interopDefault: false
|
|
1728
|
-
}).import(modulePath);
|
|
1729
|
-
}
|
|
1730
1775
|
/** The schema and casing that `void/db` gives drizzle, or undefined when neither is set. */
|
|
1731
1776
|
function getDrizzleSchemaOptions(schema, casing) {
|
|
1732
1777
|
const options = {
|