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
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { a as join, i as isAbsolute, n as dirname, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
|
|
3
|
+
import { d as readConfig, f as resolveBindingNames, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
|
|
4
|
+
import { i as voidWarn } from "./log-vqY3pqwI.mjs";
|
|
5
|
+
import { n as ensureProjectTsconfig } from "./project-tsconfig-bveqhlYA.mjs";
|
|
6
|
+
import { n as generateDbDts, t as DRIZZLE_OPERATORS } from "./db-types-Bb4WBWIs.mjs";
|
|
7
|
+
import { t as discoverSchema } from "./discover-D2PGT63u.mjs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { normalizePath } from "vite";
|
|
12
|
+
//#region src/plugin-drizzle.ts
|
|
13
|
+
const drizzleD1Resolved = fileURLToPath(import.meta.resolve("drizzle-orm/d1"));
|
|
14
|
+
const drizzleOrmResolved = fileURLToPath(import.meta.resolve("drizzle-orm"));
|
|
15
|
+
const envModuleResolved = fileURLToPath(import.meta.resolve("#self/_env"));
|
|
16
|
+
const drizzleNodePgResolved = fileURLToPath(import.meta.resolve("drizzle-orm/node-postgres"));
|
|
17
|
+
const drizzleMysql2Resolved = fileURLToPath(import.meta.resolve("drizzle-orm/mysql2"));
|
|
18
|
+
const VIRTUAL_DB_ID = "\0virtual:void-db";
|
|
19
|
+
const VIRTUAL_SCHEMA_DB_ID = "\0virtual:void-db-schema";
|
|
20
|
+
const REQUEST_POOL_PROXY = `
|
|
21
|
+
function requestPool(resolve, own = {}) {
|
|
22
|
+
const has = new Map();
|
|
23
|
+
let prototype;
|
|
24
|
+
return new Proxy({}, {
|
|
25
|
+
get(_, prop) {
|
|
26
|
+
if (Object.hasOwn(own, prop)) return own[prop];
|
|
27
|
+
const pool = resolve();
|
|
28
|
+
const value = Reflect.get(pool, prop);
|
|
29
|
+
return typeof value === "function" ? value.bind(pool) : value;
|
|
30
|
+
},
|
|
31
|
+
has(_, prop) {
|
|
32
|
+
if (Object.hasOwn(own, prop)) return true;
|
|
33
|
+
if (!has.has(prop)) has.set(prop, Reflect.has(resolve(), prop));
|
|
34
|
+
return has.get(prop);
|
|
35
|
+
},
|
|
36
|
+
getPrototypeOf: () => (prototype ??= Object.getPrototypeOf(resolve())),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
/**
|
|
41
|
+
* The app's `void/db` module for its dialect, schema and D1 binding. Resolving and loading
|
|
42
|
+
* have no side effects, so the Vite plugin and `voidDbBundlerPlugin` share them.
|
|
43
|
+
*/
|
|
44
|
+
function createVoidDbModule(root, dialect, options, paths = readProjectPaths(root)) {
|
|
45
|
+
const schema = discoverSchema(root, paths);
|
|
46
|
+
const hasDbRuntime = schema != null || options.forceVirtualDb === true || dialect !== "sqlite";
|
|
47
|
+
const d1BindingName = options.d1BindingName ?? "DB";
|
|
48
|
+
return {
|
|
49
|
+
schema,
|
|
50
|
+
hasDbRuntime,
|
|
51
|
+
resolveId(id, importer) {
|
|
52
|
+
if (id === "void/db") {
|
|
53
|
+
if (!hasDbRuntime) return;
|
|
54
|
+
if (schema && importer) {
|
|
55
|
+
const normalizedImporter = normalizePath(importer);
|
|
56
|
+
const normalizedSchemaPath = normalizePath(schema.path);
|
|
57
|
+
if (schema.type === "file" && normalizedImporter === normalizedSchemaPath) return VIRTUAL_SCHEMA_DB_ID;
|
|
58
|
+
if (schema.type === "directory" && normalizedImporter.startsWith(normalizedSchemaPath)) return VIRTUAL_SCHEMA_DB_ID;
|
|
59
|
+
}
|
|
60
|
+
return VIRTUAL_DB_ID;
|
|
61
|
+
}
|
|
62
|
+
if (schema && (id === "@schema" || id.startsWith("@schema/"))) {
|
|
63
|
+
if (id === "@schema") return schema.path;
|
|
64
|
+
return join(schema.path, id.slice(8));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
load: {
|
|
68
|
+
filter: { id: /^\0virtual:void-db(?:-schema)?$/ },
|
|
69
|
+
handler(id) {
|
|
70
|
+
if (id === VIRTUAL_SCHEMA_DB_ID) return `
|
|
71
|
+
export { ${DRIZZLE_OPERATORS} } from ${JSON.stringify(drizzleOrmResolved)};
|
|
72
|
+
export const db = {};
|
|
73
|
+
export function createDb() {
|
|
74
|
+
throw new Error("db: createDb() is unavailable when importing void/db from a schema file.");
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
const schemaImport = schema ? `import * as schema from ${JSON.stringify(schema.path)};` : "";
|
|
78
|
+
const drizzleConfig = schema ? ", { schema }" : "";
|
|
79
|
+
if (dialect === "mysql") {
|
|
80
|
+
const mysqlDrizzleConfig = schema ? ", schema, mode: \"default\"" : "";
|
|
81
|
+
return `
|
|
82
|
+
import { drizzle } from ${JSON.stringify(drizzleMysql2Resolved)};
|
|
83
|
+
import { getRuntimeBinding, getRuntimeRequestResource } from ${JSON.stringify(envModuleResolved)};
|
|
84
|
+
${schemaImport}
|
|
85
|
+
export { ${DRIZZLE_OPERATORS} } from ${JSON.stringify(drizzleOrmResolved)};
|
|
86
|
+
|
|
87
|
+
const _requestResourceKey = {};
|
|
88
|
+
|
|
89
|
+
function getConnectionString() {
|
|
90
|
+
const url = getRuntimeBinding("DATABASE_URL");
|
|
91
|
+
if (url) return url;
|
|
92
|
+
const hd = getRuntimeBinding("HYPERDRIVE");
|
|
93
|
+
if (hd?.connectionString) return hd.connectionString;
|
|
94
|
+
throw new Error("db: MySQL is not configured. Add DATABASE_URL to .env for local dev, or configure Hyperdrive for production.");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// mysql2 closes idle connections only from a timer that it starts when it builds a pool with
|
|
98
|
+
// maxIdle below connectionLimit, and that timer runs until the pool ends: workerd rejects it in
|
|
99
|
+
// global scope, and nothing ends Void's pools. Time each connection from its release instead,
|
|
100
|
+
// which runs in the request that ran the query.
|
|
101
|
+
function closeIdleConnections(pool, idleTimeout) {
|
|
102
|
+
const timers = new WeakMap();
|
|
103
|
+
pool.on("release", (connection) => {
|
|
104
|
+
const timer = setTimeout(() => connection.destroy(), idleTimeout);
|
|
105
|
+
// A Node script that ends its pool exits without waiting for this timer.
|
|
106
|
+
timer.unref?.();
|
|
107
|
+
timers.set(connection, timer);
|
|
108
|
+
});
|
|
109
|
+
pool.on("acquire", (connection) => clearTimeout(timers.get(connection)));
|
|
110
|
+
return pool;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function createPools() {
|
|
114
|
+
const pool = closeIdleConnections(
|
|
115
|
+
drizzle({
|
|
116
|
+
connection: {
|
|
117
|
+
uri: getConnectionString(),
|
|
118
|
+
connectionLimit: 1,
|
|
119
|
+
// Workers forbid eval, which mysql2 uses to build its row parsers.
|
|
120
|
+
disableEval: true,
|
|
121
|
+
},
|
|
122
|
+
}).$client,
|
|
123
|
+
1000,
|
|
124
|
+
);
|
|
125
|
+
return { pool, promisePool: pool.promise() };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getPools() {
|
|
129
|
+
// Framework entries that Void does not own run outside its request scope:
|
|
130
|
+
// they get a client for each use, never one shared across requests.
|
|
131
|
+
return getRuntimeRequestResource(_requestResourceKey, createPools, createPools);
|
|
132
|
+
}
|
|
133
|
+
${REQUEST_POOL_PROXY}
|
|
134
|
+
const promiseClient = requestPool(() => getPools().promisePool);
|
|
135
|
+
// drizzle asks for the promise API while it builds the database, which can run in global
|
|
136
|
+
// scope. No request exists there to own a pool, so answer without one.
|
|
137
|
+
const client = requestPool(() => getPools().pool, { promise: () => promiseClient });
|
|
138
|
+
|
|
139
|
+
let instance;
|
|
140
|
+
|
|
141
|
+
export const db = new Proxy({}, {
|
|
142
|
+
get(_, prop) {
|
|
143
|
+
// drizzle reports a query's errors as "Failed query", so build the request's pool here:
|
|
144
|
+
// a missing connection string then throws its own message. Outside a request, build none.
|
|
145
|
+
getRuntimeRequestResource(_requestResourceKey, createPools, () => undefined);
|
|
146
|
+
instance ??= drizzle({ client${mysqlDrizzleConfig} });
|
|
147
|
+
const value = Reflect.get(instance, prop);
|
|
148
|
+
return typeof value === "function" ? value.bind(instance) : value;
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export function createDb(connectionString) {
|
|
153
|
+
const db = drizzle({ connection: { uri: connectionString, disableEval: true }${mysqlDrizzleConfig} });
|
|
154
|
+
// 60 seconds is mysql2's own idleTimeout default.
|
|
155
|
+
closeIdleConnections(db.$client, 60000);
|
|
156
|
+
return db;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
if (dialect === "postgresql") return `
|
|
161
|
+
import { drizzle } from ${JSON.stringify(drizzleNodePgResolved)};
|
|
162
|
+
import { getRuntimeBinding, getRuntimeRequestResource } from ${JSON.stringify(envModuleResolved)};
|
|
163
|
+
${schemaImport}
|
|
164
|
+
export { ${DRIZZLE_OPERATORS} } from ${JSON.stringify(drizzleOrmResolved)};
|
|
165
|
+
|
|
166
|
+
const _requestResourceKey = {};
|
|
167
|
+
|
|
168
|
+
function getConnectionString() {
|
|
169
|
+
const url = getRuntimeBinding("DATABASE_URL");
|
|
170
|
+
if (url) return url;
|
|
171
|
+
const hd = getRuntimeBinding("HYPERDRIVE");
|
|
172
|
+
if (hd?.connectionString) return hd.connectionString;
|
|
173
|
+
throw new Error("db: PostgreSQL is not configured. Add DATABASE_URL to .env for local dev, or configure Hyperdrive for production.");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function createPool() {
|
|
177
|
+
return drizzle({
|
|
178
|
+
connection: {
|
|
179
|
+
connectionString: getConnectionString(),
|
|
180
|
+
max: 1,
|
|
181
|
+
idleTimeoutMillis: 1000,
|
|
182
|
+
},
|
|
183
|
+
}).$client;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function getPool() {
|
|
187
|
+
// Framework entries that Void does not own run outside its request scope:
|
|
188
|
+
// they get a client for each use, never one shared across requests.
|
|
189
|
+
return getRuntimeRequestResource(_requestResourceKey, createPool, createPool);
|
|
190
|
+
}
|
|
191
|
+
${REQUEST_POOL_PROXY}
|
|
192
|
+
let instance;
|
|
193
|
+
|
|
194
|
+
export const db = new Proxy({}, {
|
|
195
|
+
get(_, prop) {
|
|
196
|
+
// drizzle reports a query's errors as "Failed query", so build the request's pool here:
|
|
197
|
+
// a missing connection string then throws its own message. Outside a request, build none.
|
|
198
|
+
getRuntimeRequestResource(_requestResourceKey, createPool, () => undefined);
|
|
199
|
+
instance ??= drizzle({ client: requestPool(getPool)${schema ? ", schema" : ""} });
|
|
200
|
+
const value = Reflect.get(instance, prop);
|
|
201
|
+
return typeof value === "function" ? value.bind(instance) : value;
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export function createDb(connectionString) {
|
|
206
|
+
return drizzle(connectionString${drizzleConfig});
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
return `
|
|
210
|
+
import { drizzle } from ${JSON.stringify(drizzleD1Resolved)};
|
|
211
|
+
import { getRuntimeRequestResource, requireRuntimeBinding } from ${JSON.stringify(envModuleResolved)};
|
|
212
|
+
${schemaImport}
|
|
213
|
+
export { ${DRIZZLE_OPERATORS} } from ${JSON.stringify(drizzleOrmResolved)};
|
|
214
|
+
|
|
215
|
+
const _requestResourceKey = {};
|
|
216
|
+
|
|
217
|
+
export const db = new Proxy({}, {
|
|
218
|
+
get(_, prop) {
|
|
219
|
+
const instance = getRuntimeRequestResource(
|
|
220
|
+
_requestResourceKey,
|
|
221
|
+
() => createDb(requireRuntimeBinding(${JSON.stringify(d1BindingName)})),
|
|
222
|
+
() => createPrimaryDb(requireRuntimeBinding(${JSON.stringify(d1BindingName)}))
|
|
223
|
+
);
|
|
224
|
+
return Reflect.get(instance, prop);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
export function createDb(d1) {
|
|
229
|
+
return drizzle(d1.withSession("first-unconstrained")${drizzleConfig});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function createPrimaryDb(d1) {
|
|
233
|
+
return drizzle(d1.withSession("first-primary")${drizzleConfig});
|
|
234
|
+
}
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Vite plugin for Drizzle integration.
|
|
242
|
+
*
|
|
243
|
+
* - Intercepts `void/db` imports in SSR/worker environments and serves
|
|
244
|
+
* a virtual module that creates a Drizzle DB instance, using the user's
|
|
245
|
+
* schema when present.
|
|
246
|
+
* - Generates `.void/db.d.ts` with proper Drizzle types.
|
|
247
|
+
* - Sets up `@schema` Vite alias for convenient imports when a schema exists.
|
|
248
|
+
* - Updates `.void/tsconfig.json` with TypeScript paths.
|
|
249
|
+
*/
|
|
250
|
+
function drizzlePlugin(root, hasRouteTypes, dialect = "sqlite", options = {}) {
|
|
251
|
+
const outDir = join(root, ".void");
|
|
252
|
+
const paths = readProjectPaths(root);
|
|
253
|
+
const dbModule = createVoidDbModule(root, dialect, options, paths);
|
|
254
|
+
const { schema, hasDbRuntime } = dbModule;
|
|
255
|
+
ensureProjectTsconfig(root, hasRouteTypes, hasDbRuntime, schema != null, {
|
|
256
|
+
redirectDbModule: options.redirectDbTypePaths,
|
|
257
|
+
paths
|
|
258
|
+
});
|
|
259
|
+
if (hasDbRuntime) generateDbDts(outDir, schema ?? null, dialect);
|
|
260
|
+
return {
|
|
261
|
+
name: "void:drizzle",
|
|
262
|
+
enforce: "pre",
|
|
263
|
+
config() {
|
|
264
|
+
if (!schema) return;
|
|
265
|
+
return { resolve: { alias: { "@schema": schema.path } } };
|
|
266
|
+
},
|
|
267
|
+
resolveId: {
|
|
268
|
+
filter: { id: /^(void\/db|@schema)/ },
|
|
269
|
+
handler(id, importer) {
|
|
270
|
+
if (id === "void/db" && this.environment?.name === "client") return;
|
|
271
|
+
const resolved = dbModule.resolveId(id, importer);
|
|
272
|
+
if (resolved === VIRTUAL_DB_ID && dialect !== "sqlite" && options.nitroBundlesServer && this.environment?.mode === "build") return {
|
|
273
|
+
id,
|
|
274
|
+
external: true
|
|
275
|
+
};
|
|
276
|
+
return resolved;
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
load: dbModule.load,
|
|
280
|
+
async configureServer() {
|
|
281
|
+
if (!schema) return;
|
|
282
|
+
const migrationsDir = paths.migrationsDir;
|
|
283
|
+
if (!(existsSync(migrationsDir) && readdirSync(migrationsDir).some((f) => f.endsWith(".sql")))) {
|
|
284
|
+
if (dialect === "sqlite") {
|
|
285
|
+
const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-So9mYfcm.mjs");
|
|
286
|
+
if ((await getApplicationTables(getMiniflareDatabasePath(options.localD1PersistRoot ?? join(root, ".void"), options.localD1DatabaseId ?? "local")).catch(() => [])).length > 0) return;
|
|
287
|
+
}
|
|
288
|
+
voidWarn(`Schema found but no migrations in ${paths.sourceRelative("db/migrations")}/.\n \`void db push\` syncs the schema to your local DB without creating migration files.
|
|
289
|
+
Run \`void db generate\` to create migration files for dev startup and deploy.`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* `void/db` and `@schema` for bundles that do not run Void's Vite plugins: Nitro's (Nuxt and
|
|
296
|
+
* Analog server routes, through `void/nitro`) and the cron and queue handler bundle that deploys
|
|
297
|
+
* build. Without it they load the package's static `void/db`, a D1 client without the app's
|
|
298
|
+
* schema. It reads the dialect, schema and D1 binding from the project, as the Vite plugin does.
|
|
299
|
+
* Its hooks are plain Rollup hooks; Vite also needs `enforce` to run them before its resolver.
|
|
300
|
+
*
|
|
301
|
+
* For a bundle that runs in workerd, `sqlDriver` builds a copy of the PostgreSQL or MySQL driver
|
|
302
|
+
* from its entry file, and the plugin serves that module for `pg` or `mysql2` (for
|
|
303
|
+
* `mysql2/promise`, the promise API from the same build). Each import gets the copy that the
|
|
304
|
+
* bundler resolves for it: the generated client's drizzle-orm gets the one it depends on, and an
|
|
305
|
+
* app's own import gets the app's version.
|
|
306
|
+
*/
|
|
307
|
+
function voidDbBundlerPlugin(root, options = {}) {
|
|
308
|
+
const config = options.config ?? readConfig(root);
|
|
309
|
+
const dialect = getDatabaseDialect(config);
|
|
310
|
+
const d1BindingName = resolveBindingNames(config.inference?.bindings)?.d1;
|
|
311
|
+
const dbModule = createVoidDbModule(root, dialect, {
|
|
312
|
+
d1BindingName,
|
|
313
|
+
forceVirtualDb: d1BindingName !== void 0
|
|
314
|
+
}, resolveProjectPaths(root, config));
|
|
315
|
+
const driverPackage = dialect === "postgresql" ? "pg" : dialect === "mysql" ? "mysql2" : void 0;
|
|
316
|
+
const drivers = /* @__PURE__ */ new Map();
|
|
317
|
+
const driverDirs = [];
|
|
318
|
+
return {
|
|
319
|
+
name: "void:db",
|
|
320
|
+
enforce: "pre",
|
|
321
|
+
async resolveId(id, importer, resolveOptions) {
|
|
322
|
+
const promiseApi = driverPackage === "mysql2" && MYSQL2_PROMISE.test(id);
|
|
323
|
+
if ((id === driverPackage || promiseApi) && options.sqlDriver && dialect !== "sqlite") {
|
|
324
|
+
const custom = resolveOptions?.custom;
|
|
325
|
+
const resolved = await this.resolve(id, importer, {
|
|
326
|
+
...resolveOptions,
|
|
327
|
+
skipSelf: true,
|
|
328
|
+
custom: {
|
|
329
|
+
...custom,
|
|
330
|
+
"node-resolve": {
|
|
331
|
+
...custom?.["node-resolve"],
|
|
332
|
+
isRequire: true
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
const entry = resolved && !resolved.external ? resolvePackageEntry(driverPackage, resolved.id) : void 0;
|
|
337
|
+
if (entry === void 0) return resolved;
|
|
338
|
+
let driver = drivers.get(entry);
|
|
339
|
+
if (!driver) {
|
|
340
|
+
assertWorkerDriver(driverPackage, entry, root, importer);
|
|
341
|
+
driver = options.sqlDriver(dialect, entry).then((path) => {
|
|
342
|
+
driverDirs.push(`${normalizePath(dirname(path))}/`);
|
|
343
|
+
return path;
|
|
344
|
+
});
|
|
345
|
+
drivers.set(entry, driver);
|
|
346
|
+
}
|
|
347
|
+
return promiseApi ? (await driver).replace(/mysql2\.mjs$/, "promise.mjs") : driver;
|
|
348
|
+
}
|
|
349
|
+
if (id.startsWith("node:") && importer && driverDirs.some((dir) => normalizePath(importer).startsWith(dir))) return {
|
|
350
|
+
id,
|
|
351
|
+
external: true
|
|
352
|
+
};
|
|
353
|
+
const resolved = dbModule.resolveId(id, importer);
|
|
354
|
+
if (resolved !== void 0 && id !== "void/db") return this.resolve(resolved, importer, { skipSelf: true });
|
|
355
|
+
return resolved ?? null;
|
|
356
|
+
},
|
|
357
|
+
load(id) {
|
|
358
|
+
if (id !== VIRTUAL_DB_ID && id !== VIRTUAL_SCHEMA_DB_ID) return null;
|
|
359
|
+
return dbModule.load.handler(id);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
/** mysql2's promise API, which `bundleWorkerSqlDriver` builds next to the driver. */
|
|
364
|
+
const MYSQL2_PROMISE = /^mysql2\/promise(?:\.js)?$/;
|
|
365
|
+
/**
|
|
366
|
+
* The first driver versions that run in Workers: pg 8.11 brings pg-cloudflare, its socket there,
|
|
367
|
+
* and mysql2 3.13 the `disableEval` option, without which it compiles its parsers with
|
|
368
|
+
* `new Function`, which workerd forbids.
|
|
369
|
+
*/
|
|
370
|
+
const WORKER_DRIVER_MINIMUM = {
|
|
371
|
+
pg: [8, 11],
|
|
372
|
+
mysql2: [3, 13]
|
|
373
|
+
};
|
|
374
|
+
/** Throw when the driver whose entry file is `entry` is older than Workers need. */
|
|
375
|
+
function assertWorkerDriver(name, entry, root, importer) {
|
|
376
|
+
let version;
|
|
377
|
+
try {
|
|
378
|
+
const packageJson = createRequire(entry).resolve(`${name}/package.json`);
|
|
379
|
+
({version} = JSON.parse(readFileSync(packageJson, "utf8")));
|
|
380
|
+
} catch {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const match = /^(\d+)\.(\d+)\./.exec(version ?? "");
|
|
384
|
+
const [major, minor] = WORKER_DRIVER_MINIMUM[name];
|
|
385
|
+
if (!match || Number(match[1]) > major || Number(match[1]) === major && Number(match[2]) >= minor) return;
|
|
386
|
+
const source = importer ? ` Imported by ${relative(root, importer)}.` : "";
|
|
387
|
+
throw new Error(`${name} ${version} cannot run in Cloudflare Workers, which need ${name} ${major}.${minor} or later. Upgrade ${name}.${source}`);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* The CommonJS entry of package `name`, from `file` inside one of its copies (which a bundler may
|
|
391
|
+
* have resolved to an ES module entry), or undefined if `file` is not on disk.
|
|
392
|
+
*/
|
|
393
|
+
function resolvePackageEntry(name, file) {
|
|
394
|
+
if (!isAbsolute(file)) return;
|
|
395
|
+
try {
|
|
396
|
+
return createRequire(file).resolve(name);
|
|
397
|
+
} catch {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
//#endregion
|
|
402
|
+
//#region src/queues/dispatch.ts
|
|
403
|
+
/**
|
|
404
|
+
* Emit the queue-name resolver used by generated native workers and framework
|
|
405
|
+
* wrappers. Hosted relays send the exact logical name. Native Queue events may
|
|
406
|
+
* expose a project-prefixed physical name, so fallback matching selects the
|
|
407
|
+
* unique longest known `-name` suffix. Unknown or ambiguous inputs fail closed.
|
|
408
|
+
*/
|
|
409
|
+
function generateQueueResolverSource(queueNames) {
|
|
410
|
+
return `const __queueNames = ${JSON.stringify(queueNames)};
|
|
411
|
+
function __resolveQueueIndex(queueName) {
|
|
412
|
+
if (typeof queueName !== "string") return -1;
|
|
413
|
+
const exact = __queueNames.indexOf(queueName);
|
|
414
|
+
if (exact !== -1) return exact;
|
|
415
|
+
let match = -1;
|
|
416
|
+
let matchLength = -1;
|
|
417
|
+
for (let i = 0; i < __queueNames.length; i++) {
|
|
418
|
+
const name = __queueNames[i];
|
|
419
|
+
if (!queueName.endsWith("-" + name)) continue;
|
|
420
|
+
if (name.length > matchLength) {
|
|
421
|
+
match = i;
|
|
422
|
+
matchLength = name.length;
|
|
423
|
+
} else if (name.length === matchLength) {
|
|
424
|
+
match = -1;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return match;
|
|
428
|
+
}`;
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
export { drizzlePlugin as n, voidDbBundlerPlugin as r, generateQueueResolverSource as t };
|
|
@@ -4,8 +4,7 @@ import "node:fs";
|
|
|
4
4
|
import { randomBytes } from "node:crypto";
|
|
5
5
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
6
6
|
import process$1, { stdin, stdout } from "node:process";
|
|
7
|
-
import * as l from "node:readline";
|
|
8
|
-
import l__default from "node:readline";
|
|
7
|
+
import l__default, * as l from "node:readline";
|
|
9
8
|
import { ReadStream } from "node:tty";
|
|
10
9
|
//#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
11
10
|
const getCodePointsLength$1 = (() => {
|
|
@@ -803,7 +802,7 @@ var n = class extends y {
|
|
|
803
802
|
}
|
|
804
803
|
};
|
|
805
804
|
//#endregion
|
|
806
|
-
//#region ../../node_modules/.pnpm/@voidzero-dev+vite-plus-prompts@1.
|
|
805
|
+
//#region ../../node_modules/.pnpm/@voidzero-dev+vite-plus-prompts@1.2.0/node_modules/@voidzero-dev/vite-plus-prompts/dist/index.mjs
|
|
807
806
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
808
807
|
const isAmbiguous = (x) => {
|
|
809
808
|
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
@@ -1510,13 +1509,13 @@ const box = (message = "", title = "", opts) => {
|
|
|
1510
1509
|
* piped output never see these markers as content (they only update the
|
|
1511
1510
|
* window title, which the runner's PTY captures).
|
|
1512
1511
|
*
|
|
1513
|
-
* Protocol (shared with vite-task's `
|
|
1514
|
-
* `OSC 2 ; pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
1512
|
+
* Protocol (shared with vite-task's `vt_pty_terminal_test_client` crate):
|
|
1513
|
+
* `OSC 2 ; vt-pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
1515
1514
|
* decodes the title with `decode_milestone_title`, ignoring ordinary title
|
|
1516
1515
|
* updates. A fresh random id per emission keeps repeated milestones with the
|
|
1517
1516
|
* same name observable as distinct title changes through Windows ConPTY.
|
|
1518
1517
|
*/
|
|
1519
|
-
const MILESTONE_TITLE_MARKER = "pty-terminal-test:";
|
|
1518
|
+
const MILESTONE_TITLE_MARKER = "vt-pty-terminal-test:";
|
|
1520
1519
|
const OSC2_OPEN = "\x1B]2;";
|
|
1521
1520
|
const ST = "\x1B\\";
|
|
1522
1521
|
const MILESTONES_ENABLED = process.env.VP_EMIT_MILESTONES === "1";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { tt as isCancel, L as log, K as select, X as text } from "./dist-BVdsO7Py.mjs";
|
|
@@ -44,7 +44,6 @@ const win32 = {
|
|
|
44
44
|
const posix = { ...nodePath.posix };
|
|
45
45
|
posix.posix = win32.posix = posix;
|
|
46
46
|
posix.win32 = win32.win32 = win32;
|
|
47
|
-
const
|
|
48
|
-
const { basename, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, relative, resolve, sep, toNamespacedPath } = path;
|
|
47
|
+
const { basename, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, relative, resolve, sep, toNamespacedPath } = isWindows ? win32 : posix;
|
|
49
48
|
//#endregion
|
|
50
|
-
export { join as a,
|
|
49
|
+
export { join as a, resolve as c, isAbsolute as i, toSlash as l, dirname as n, normalize as o, extname as r, relative as s, basename as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
3
|
-
import { L as log } from "./dist-
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
1
|
+
import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
|
+
import { L as log } from "./dist-BVdsO7Py.mjs";
|
|
4
|
+
import { f as import_picocolors, m as printSuccess, p as note } from "./output-Ba6ZbrzY.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
+
import { i as resolveCommandProjectId } from "./resolve-project-WpwkCB_c.mjs";
|
|
6
7
|
//#region src/cli/domain.ts
|
|
7
8
|
async function runDomainCommand(root, args) {
|
|
8
9
|
const platform = readDeploymentPlatform(root);
|
|
@@ -14,23 +15,7 @@ async function runDomainCommand(root, args) {
|
|
|
14
15
|
process.exit(1);
|
|
15
16
|
}
|
|
16
17
|
const client = new PlatformClient(token, { root });
|
|
17
|
-
const
|
|
18
|
-
let projectId;
|
|
19
|
-
if (requestedSlug) {
|
|
20
|
-
const project = (await client.listProjects()).find((p) => p.slug === requestedSlug);
|
|
21
|
-
if (!project) {
|
|
22
|
-
log.error(`project: No project found with slug '${requestedSlug}'.`);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
projectId = project.id;
|
|
26
|
-
} else {
|
|
27
|
-
const config = readProjectConfig(root);
|
|
28
|
-
if (!config) {
|
|
29
|
-
log.error("No linked project. Run `void project link` or pass --project <name>.");
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
projectId = config.projectId;
|
|
33
|
-
}
|
|
18
|
+
const projectId = await resolveCommandProjectId(client, root, args.projectSlug);
|
|
34
19
|
switch (args.subcommand) {
|
|
35
20
|
case "add": return domainAdd(client, projectId, args.hostname);
|
|
36
21
|
case "delete": return domainRemove(client, projectId, args.hostname);
|
|
@@ -40,7 +25,7 @@ async function runDomainCommand(root, args) {
|
|
|
40
25
|
}
|
|
41
26
|
async function runCloudflareDomainCommand(root, args) {
|
|
42
27
|
if (args.projectSlug) throw new Error("domain: --project selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
43
|
-
const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-
|
|
28
|
+
const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-CrSUFRzJ.mjs");
|
|
44
29
|
if (args.subcommand === "add") {
|
|
45
30
|
const result = await changeCloudflareDomain(root, args.hostname, "add");
|
|
46
31
|
note("Cloudflare Custom Domains manages the DNS record and TLS certificate in the zone on your account.", "Cloudflare Domain");
|
|
@@ -28,21 +28,13 @@ import { parseEnv } from "node:util";
|
|
|
28
28
|
/** Valid dotenv key — ASCII letter/underscore followed by letters/digits/underscore. */
|
|
29
29
|
const VALID_KEY = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
30
30
|
/**
|
|
31
|
-
* Parse the raw contents of a dotenv file into a record,
|
|
32
|
-
* expanding `${VAR}` / `$VAR` references against earlier entries.
|
|
31
|
+
* Parse the raw contents of a dotenv file into a record, skipping invalid
|
|
32
|
+
* keys and expanding `${VAR}` / `$VAR` references against earlier entries.
|
|
33
33
|
*/
|
|
34
34
|
function parseDotenv(content, options = {}) {
|
|
35
|
-
const { expand: shouldExpand = true, skipInvalidKeys = true, onWarn } = options;
|
|
36
35
|
const env = {};
|
|
37
|
-
for (const [key, value] of Object.entries(parseEnv(content)))
|
|
38
|
-
|
|
39
|
-
if (!VALID_KEY.test(key)) {
|
|
40
|
-
if (skipInvalidKeys) continue;
|
|
41
|
-
throw new Error(`dotenv: Invalid key '${key}'.`);
|
|
42
|
-
}
|
|
43
|
-
env[key] = value;
|
|
44
|
-
}
|
|
45
|
-
return shouldExpand ? expandDotenv(env, { onWarn }) : env;
|
|
36
|
+
for (const [key, value] of Object.entries(parseEnv(content))) if (value !== void 0 && VALID_KEY.test(key)) env[key] = value;
|
|
37
|
+
return expandDotenv(env, options);
|
|
46
38
|
}
|
|
47
39
|
/**
|
|
48
40
|
* Read and parse a dotenv file. Returns `{}` when the file is missing so
|
|
@@ -148,10 +140,6 @@ function expandValue(value, resolve) {
|
|
|
148
140
|
const WRANGLER_DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
149
141
|
/**
|
|
150
142
|
* The set of declared dotenv KEYS in `filePath`, parsed the way wrangler does.
|
|
151
|
-
* Lives in this leaf module (no `proper-lockfile` / lifecycle side effects) so both
|
|
152
|
-
* the provisioner's transport fence and the deploy orchestrator's config-override
|
|
153
|
-
* fence can read keys exactly as wrangler's per-command reload would, without either
|
|
154
|
-
* caller pulling in the provision lifecycle just to parse dotenv keys.
|
|
155
143
|
*/
|
|
156
144
|
function scanWranglerDotenvKeys(filePath) {
|
|
157
145
|
const keys = /* @__PURE__ */ new Set();
|
package/dist/edge.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createStaticEdgeHandler };
|
|
1
|
+
export { createStaticEdgeHandler } from "@void/edge";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as join } from "./dist-
|
|
2
|
-
import { n as globSync
|
|
1
|
+
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { n as globSync } from "./dist-Bn8Kodjp.mjs";
|
|
3
3
|
//#region src/router/email.ts
|
|
4
4
|
/**
|
|
5
5
|
* Scan `email/` for inbound email handlers.
|
|
@@ -155,28 +155,12 @@ function parseEmailFiles(files) {
|
|
|
155
155
|
defaultHandler
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
async function scanEmailHandlers(root, emailDir = "email") {
|
|
159
|
-
const pattern = `*.{${EMAIL_EXTENSIONS.join(",")}}`;
|
|
160
|
-
return parseEmailFiles(await glob(pattern, {
|
|
161
|
-
cwd: join(root, emailDir),
|
|
162
|
-
absolute: false
|
|
163
|
-
}).catch(() => []));
|
|
164
|
-
}
|
|
165
158
|
function scanEmailHandlersSync(root, emailDir = "email") {
|
|
166
159
|
const pattern = `*.{${EMAIL_EXTENSIONS.join(",")}}`;
|
|
167
|
-
|
|
168
|
-
try {
|
|
169
|
-
files = globSync(pattern, {
|
|
170
|
-
cwd: join(root, emailDir),
|
|
171
|
-
absolute: false
|
|
172
|
-
});
|
|
173
|
-
} catch {
|
|
174
|
-
files = [];
|
|
175
|
-
}
|
|
176
|
-
return parseEmailFiles(files);
|
|
160
|
+
return parseEmailFiles(globSync(pattern, { cwd: join(root, emailDir) }));
|
|
177
161
|
}
|
|
178
162
|
function hasEmailHandlers(scan) {
|
|
179
163
|
return scan.addresses.length > 0 || Boolean(scan.defaultHandler);
|
|
180
164
|
}
|
|
181
165
|
//#endregion
|
|
182
|
-
export { scanEmailHandlersSync as
|
|
166
|
+
export { scanEmailHandlersSync as i, compileEmailPattern as n, hasEmailHandlers as r, compareEmailRoutes as t };
|