void 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{account-cmd-l-FM7Ioq.mjs → account-cmd-Ci00cncT.mjs} +5 -5
- package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
- package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-D72ZQfMZ.mjs} +118 -135
- package/dist/{application-routing-DQyUh_5S.mjs → application-routing-Dy589Vgn.mjs} +1 -2
- package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
- package/dist/{auth-Dn2vw-SG.mjs → auth-B6iOCjKI.mjs} +23 -56
- package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DWr6Afao.mjs} +10 -10
- package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
- package/dist/{auth-router-DvsCUVw4.mjs → auth-router-DP14wVkZ.mjs} +4 -4
- package/dist/auth-wn6F8dB8.mjs +2 -0
- package/dist/base64-DVrOndmI.mjs +16 -0
- package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
- package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
- package/dist/{build-cmd-D6we0VjO.mjs → build-cmd-Cr3FJxv0.mjs} +5 -5
- package/dist/{cache-CZRdzKx1.mjs → cache-D0Tt28cn.mjs} +5 -5
- package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CJKvk7AN.mjs} +4 -4
- package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
- package/dist/{cf-access-BcIBSKqG.mjs → cf-access-CWP4avfP.mjs} +3 -7
- package/dist/cf-build-output-2u583yJK.mjs +2 -0
- package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
- package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
- package/dist/cli/cli.mjs +198 -311
- package/dist/cli/cloudflare-operation-process.mjs +41 -15
- package/dist/cli/env-schema-probe.d.mts +5 -43
- package/dist/cli/env-schema-probe.mjs +14 -80
- package/dist/client-C1BjRn3g.mjs +2 -0
- package/dist/{client-DlDJuY0s.mjs → client-DM9Kcf4e.mjs} +161 -415
- package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
- package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-CTrn-lXJ.mjs} +6 -5
- package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
- package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-BosmCNlq.mjs} +3 -3
- package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-BKdSfNBN.mjs} +26 -34
- package/dist/{cloudflare-operations-BlYLlowZ.mjs → cloudflare-operations-Ds-lX3Ts.mjs} +1 -1
- package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
- package/dist/collect-NUlJMpLY.mjs +2 -0
- package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
- package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
- package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
- package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
- package/dist/config-CNnrSMYm.mjs +2 -0
- package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-BfPBHHm-.mjs → connect-nukQSoEO.mjs} +8 -8
- package/dist/{create-project-BdXEFKal.mjs → create-project-D4APeBwX.mjs} +7 -7
- package/dist/{create-project-qFDC45zg.mjs → create-project-DL7YXpjj.mjs} +1 -1
- package/dist/{db-Xs80hcaA.mjs → db-27RztQLy.mjs} +173 -263
- package/dist/{delete-d2vuou3j.mjs → delete-BbsZFZIw.mjs} +5 -5
- package/dist/deploy-B06EQq4t.mjs +6009 -0
- package/dist/deploy-Db2ALnQP.mjs +3 -0
- package/dist/deploy-managed-static-CGswbcay.mjs +2277 -0
- package/dist/deploy-transport-BiicfoQW.mjs +180 -0
- package/dist/deploy.d.mts +10 -0
- package/dist/deploy.mjs +82 -0
- package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
- package/dist/discover-CTUiSsfG.mjs +2 -0
- package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
- package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
- package/dist/{domain-BsDUBAvt.mjs → domain-Bfq9n03H.mjs} +7 -22
- package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
- package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
- package/dist/{email-_lGAHOhp.mjs → email-DIwaQU4P.mjs} +99 -191
- package/dist/email-cloudflare-CH053RxK.mjs +1096 -0
- package/dist/email-protocol-D9nTvhCp.mjs +82 -0
- package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
- package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
- package/dist/{env-DMA3cXZt.mjs → env-BhdWMrNy.mjs} +2 -13
- package/dist/{env-C74QepDE.mjs → env-C6ipBLp3.mjs} +8 -8
- package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
- package/dist/{env-raw-jZpP5n47.mjs → env-raw-Cklzcde3.mjs} +3 -20
- package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
- package/dist/{env-validation-CrVNjsPm.mjs → env-validation-CTn-HhG1.mjs} +1 -1
- package/dist/env-validation-cE0zcmzO.mjs +486 -0
- package/dist/{gen-DtkQhvQg.mjs → gen-CnN1Xidx.mjs} +131 -253
- package/dist/gen-F8pSZnhc.mjs +2 -0
- package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
- package/dist/generate-Rii9klHB.mjs +2 -0
- package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
- package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-BdkU4Nhe.mjs} +27 -71
- package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
- package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
- package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
- package/dist/{help-0bTe_lID.mjs → help-Bug7pyK_.mjs} +18 -10
- package/dist/help-s9q7LTcu.mjs +2 -0
- package/dist/{inbound-PfQDLXc5.mjs → inbound-DmkTQeWp.mjs} +71 -222
- package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
- package/dist/index.d.mts +2 -18
- package/dist/index.mjs +200 -496
- package/dist/{info-PYWwkWyt.mjs → info-CujPwtMe.mjs} +5 -5
- package/dist/{init-DaBGmaXC.mjs → init-ZWOJvc-Z.mjs} +179 -388
- package/dist/isr-config-DPjXM8J2.mjs +194 -0
- package/dist/{link-C6fjafep.mjs → link-UEc7bnF4.mjs} +8 -8
- package/dist/{list-BTFBlqKl.mjs → list-CuWeOnzk.mjs} +6 -17
- package/dist/{live-CgQuTpqD.mjs → live-BxLX-JqJ.mjs} +19 -17
- package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
- package/dist/load-user-env-DD5qveNU.mjs +49 -0
- package/dist/{local-d1-ga5O_idV.mjs → local-d1-BM3p74mm.mjs} +6 -6
- package/dist/{login-GKcNUmtI.mjs → login-CZ2Cqa-D.mjs} +11 -11
- package/dist/login-DhK7o1oJ.mjs +2 -0
- package/dist/{logs-BiMSULmc.mjs → logs-TihRcLTk.mjs} +5 -5
- package/dist/migrate-BgT-hmu8.mjs +2 -0
- package/dist/{migrate-NLsjBbuM.mjs → migrate-uFwojusJ.mjs} +69 -21
- package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
- package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
- package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
- package/dist/{node-DJicPvPj.mjs → node-DoKbo1SZ.mjs} +8 -24
- package/dist/{operator-args-DOBhIaIg.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
- package/dist/{operator-auth-BEZ_u0Cz.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
- package/dist/{operator-client-DbDv4vtE.mjs → operator-client-C-ROjk1I.mjs} +4 -4
- package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-C5lCctnc.mjs} +8 -8
- package/dist/operator-cmd-Cjk5DiRx.mjs +2 -0
- package/dist/{output-C50ag2r3.mjs → output-FNHKw5Ac.mjs} +36 -5
- package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +91 -5
- package/dist/pages/index.d.mts +1 -2
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.mjs +5 -83
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{platform-args-DUeXY9Om.mjs → platform-args-C6Mb_I3a.mjs} +34 -58
- package/dist/platform-args-Cm7x-fot.mjs +2 -0
- package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-CJmNkFT2.mjs} +10 -11
- package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-D5wvsI-Y.mjs} +36 -26
- package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-D_0I3n-1.mjs} +8 -9
- package/dist/{platform-cmd-BbmJiq5O.mjs → platform-cmd-Cuj4oUVo.mjs} +1 -1
- package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DxxZO6e5.mjs} +15 -15
- package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
- package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-zLXnW1G_.mjs} +5 -5
- package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DOW-wLfx.mjs} +1398 -2043
- package/dist/{platform-lifecycle-ByAlpkhV.mjs → platform-lifecycle-_gfnjUBr.mjs} +1 -1
- package/dist/{platform-management-CBOT4BSM.mjs → platform-management-CYrLvTGH.mjs} +1 -1
- package/dist/{platform-management-CuuVDhyt.mjs → platform-management-t7HKy4-U.mjs} +632 -124
- package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-CNH6zbPX.mjs} +15 -11
- package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-DeucI7A9.mjs} +6 -9
- package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
- package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-CTf6MMT9.mjs} +19 -26
- package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
- package/dist/{prepare-Dq9hTIbo.mjs → prepare-C4zfwks4.mjs} +3 -3
- package/dist/{prepare-Do96654b.mjs → prepare-CSH9dKTI.mjs} +11 -13
- package/dist/prepare-dr9uxQSV.mjs +2 -0
- package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
- package/dist/prerender-render.d.mts +2 -0
- package/dist/prerender-render.mjs +2 -2
- package/dist/project-DiiOBZPF.mjs +2 -0
- package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-Dq75AXzy.mjs} +19 -19
- package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
- package/dist/{project-BAm2aB6Q.mjs → project-rqDnVsJN.mjs} +8 -4
- package/dist/{project-team-Q_lCA7Io.mjs → project-team-B3_QcStG.mjs} +6 -6
- package/dist/{project-token-BArgK9o1.mjs → project-token-CvsRvv2I.mjs} +5 -5
- package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
- package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-D1ICiwN_.mjs} +5 -5
- package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
- package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
- package/dist/{provision-BfaLiWbj.mjs → provision-DDh7ITVS.mjs} +118 -865
- package/dist/{requests-C7Oeoh5u.mjs → requests-3CL3BuZh.mjs} +4 -4
- package/dist/resolve-project-B9Hr0D3n.mjs +2 -0
- package/dist/resolve-project-C_Cu7E8a.mjs +48 -0
- package/dist/{rollback-DVAtrLAl.mjs → rollback-Ce1d_0J9.mjs} +7 -17
- package/dist/{route-types-CbtsIeFn.mjs → route-types-IrBuwJ7u.mjs} +35 -70
- package/dist/routing-assets-VkrKIbxE.mjs +139 -0
- package/dist/{runner-9wjsSZx-.mjs → runner-B5huK2eC.mjs} +1 -1
- package/dist/{runner-DMBKSrRk.mjs → runner-DcVDrzuR.mjs} +7 -28
- package/dist/{runner-mysql-CEzKtmFb.mjs → runner-mysql-CCtyI0p6.mjs} +4 -3
- package/dist/runner-mysql-CaJq-hd6.mjs +2 -0
- package/dist/runner-pg-BJhFZZG4.mjs +2 -0
- package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-CPd-CB_F.mjs} +1 -1
- package/dist/runtime/ai.mjs +9 -22
- package/dist/runtime/better-auth-mysql.d.mts +2 -5
- package/dist/runtime/better-auth-mysql.mjs +6 -31
- package/dist/runtime/better-auth-pg.d.mts +2 -5
- package/dist/runtime/better-auth-pg.mjs +6 -32
- package/dist/runtime/better-auth.d.mts +2 -4
- package/dist/runtime/better-auth.mjs +9 -19
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.d.mts +16 -0
- package/dist/runtime/durable.mjs +26 -2
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +9 -23
- package/dist/runtime/email-protocol.d.mts +12 -0
- package/dist/runtime/email-protocol.mjs +2 -70
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +79 -221
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +12 -38
- package/dist/runtime/env.d.mts +1 -12
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +1 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-mysql.d.mts +2 -2
- package/dist/runtime/migration-handler-mysql.mjs +3 -2
- package/dist/runtime/migration-handler-pg.d.mts +2 -2
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -2
- package/dist/runtime/migration-handler.mjs +2 -470
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/binding-handler.mjs +62 -62
- package/dist/runtime/remote/index.mjs +16 -77
- package/dist/runtime/routing.d.mts +1 -4
- package/dist/runtime/routing.mjs +82 -218
- package/dist/runtime/sandbox-container.d.mts +2 -2
- package/dist/runtime/sandbox-container.mjs +2 -2
- package/dist/runtime/sandbox.d.mts +2 -2
- package/dist/runtime/sandbox.mjs +13 -6
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -3
- package/dist/runtime/ws-server.mjs +6 -28
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
- package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-DBKIqDEK.mjs} +12 -1
- package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
- package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
- package/dist/{secret-BvtB7IjY.mjs → secret-B5J8bBsI.mjs} +62 -80
- package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
- package/dist/{skills-BgVMvQdy.mjs → skills-BJsan98C.mjs} +2 -2
- package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-gQ-NDA-u.mjs} +38 -43
- package/dist/sveltekit.mjs +1 -1
- package/dist/validate-C9xtFOYR.mjs +2 -0
- package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
- package/dist/version-metadata-DIrqEHQo.mjs +73 -0
- package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
- package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
- package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
- package/docs/guide/auth.md +2 -0
- package/docs/guide/database/postgresql.md +2 -0
- package/docs/guide/database.md +2 -0
- package/docs/guide/durable-state.md +24 -0
- package/docs/guide/platform/administration/access.md +4 -0
- package/docs/guide/platform/administration/connected-apps.md +55 -0
- package/docs/guide/platform/installation/credentials.md +3 -1
- package/docs/guide/quickstart.md +2 -0
- package/docs/guide/sandboxes.md +2 -0
- package/docs/reference/api/deploy.md +23 -0
- package/docs/reference/api/pages.md +2 -0
- package/docs/reference/api.md +2 -1
- package/docs/reference/cli/database.md +9 -3
- package/docs/reference/cli/platform-installation.md +1 -1
- package/docs/reference/cli/setup.md +2 -0
- package/package.json +13 -16
- package/skills/void/SKILL.md +1 -0
- package/dist/auth-LMJcNESe.mjs +0 -2
- package/dist/cf-build-output-H9a97vME.mjs +0 -2
- package/dist/cf-user-agent-lKblH3zU.mjs +0 -17
- package/dist/client-tso2OfcG.mjs +0 -2
- package/dist/collect-DLyFDiKW.mjs +0 -2
- package/dist/config-5r-YpMC-.mjs +0 -2
- package/dist/config-B_ggY-IO.mjs +0 -89
- package/dist/config-BtSFvXZx.mjs +0 -2
- package/dist/config-write-AHGesphx.mjs +0 -61
- package/dist/deploy-Bqe1PYBw.mjs +0 -10458
- package/dist/deploy-VsWsVQkw.mjs +0 -2
- package/dist/dev-inbox-CK-UuPob.mjs +0 -297
- package/dist/discover-EDUf6JJw.mjs +0 -2
- package/dist/dist-_UUlL6bg.mjs +0 -2
- package/dist/env-validation-Dxdx_5wo.mjs +0 -951
- package/dist/gen-dA9hW7AV.mjs +0 -2
- package/dist/head-client-DzmJGN4C.mjs +0 -90
- package/dist/help-DfQYVfGY.mjs +0 -2
- package/dist/login-mx_ydhmp.mjs +0 -2
- package/dist/migrate-BHp07yJE.mjs +0 -2
- package/dist/operator-cmd-CwBB-1yb.mjs +0 -2
- package/dist/pages/head-client.d.mts +0 -13
- package/dist/pages/head-client.mjs +0 -2
- package/dist/platform-args-D4E1PjVw.mjs +0 -2
- package/dist/prepare-DRUV-g3X.mjs +0 -2
- package/dist/project-DedqCp59.mjs +0 -2
- package/dist/provision-Wu9ZBk9L.mjs +0 -2
- package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
- package/dist/resolve-project-CP8rZs_p.mjs +0 -28
- package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
- package/dist/runner-pg-BGYRFdRp.mjs +0 -2
- package/dist/runtime/env-helpers.d.mts +0 -2
- package/dist/runtime/env-helpers.mjs +0 -2
- package/dist/validate-BJr9LfXy.mjs +0 -2
- package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { f as import_picocolors, i as dim } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
6
|
//#region src/cli/requests.ts
|
|
7
7
|
async function runRequestsCommand(root, range, status) {
|
|
8
8
|
console.log();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
3
|
+
import { L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
//#region src/cli/resolve-project.ts
|
|
6
|
+
function getRequestedProjectSlug(options) {
|
|
7
|
+
const cliSlug = options?.projectSlug?.trim();
|
|
8
|
+
if (cliSlug) return cliSlug;
|
|
9
|
+
const envSlug = process.env.VOID_PROJECT?.trim();
|
|
10
|
+
if (envSlug) return envSlug;
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
function resolveProjectBySlug(projects, slug) {
|
|
14
|
+
const project = projects.find((candidate) => candidate.slug === slug);
|
|
15
|
+
return project ? {
|
|
16
|
+
projectId: project.id,
|
|
17
|
+
slug: project.slug
|
|
18
|
+
} : null;
|
|
19
|
+
}
|
|
20
|
+
async function requireProjectBySlug(client, slug) {
|
|
21
|
+
const project = resolveProjectBySlug(await client.listProjects(), slug);
|
|
22
|
+
if (!project) throw new Error(`project: No project found with slug '${slug}'.`);
|
|
23
|
+
return project;
|
|
24
|
+
}
|
|
25
|
+
/** Resolves --project, then VOID_PROJECT, then the linked project; exits with an error otherwise. */
|
|
26
|
+
async function resolveCommandProjectId(client, root, projectSlug) {
|
|
27
|
+
const requestedSlug = projectSlug ?? process.env.VOID_PROJECT?.trim();
|
|
28
|
+
if (requestedSlug) {
|
|
29
|
+
const project = resolveProjectBySlug(await client.listProjects(), requestedSlug);
|
|
30
|
+
if (!project) {
|
|
31
|
+
log.error(`project: No project found with slug '${requestedSlug}'.`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
return project.projectId;
|
|
35
|
+
}
|
|
36
|
+
const config = readProjectConfig(root);
|
|
37
|
+
if (!config) {
|
|
38
|
+
log.error("No linked project. Run `void project link` or pass --project <name>.");
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
return config.projectId;
|
|
42
|
+
}
|
|
43
|
+
function inferDefaultSlug(root) {
|
|
44
|
+
const pkgPath = join(root, "package.json");
|
|
45
|
+
return (JSON.parse(readFileSync(pkgPath, "utf-8")).name ?? "my-app").replace(/^@[^/]+\//, "").replace(/[^a-z0-9-]/g, "-");
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { resolveProjectBySlug as a, resolveCommandProjectId as i, inferDefaultSlug as n, requireProjectBySlug as r, getRequestedProjectSlug as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { A as confirm, H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { c as formatRelativeTime, i as dim, m as printSuccess, o as formatCount, r as createSpinner } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
6
|
//#region src/cli/rollback.ts
|
|
7
7
|
async function runRollbackCommand(root, deployId) {
|
|
8
8
|
console.log();
|
|
@@ -39,7 +39,7 @@ async function runRollbackCommand(root, deployId) {
|
|
|
39
39
|
message: "Select a deployment to roll back to:",
|
|
40
40
|
options: candidates.map((d) => ({
|
|
41
41
|
value: d.id,
|
|
42
|
-
label: `${d.id} ${dim(
|
|
42
|
+
label: `${d.id} ${dim(d.deployed_at ? formatRelativeTime(d.deployed_at) : "")}`,
|
|
43
43
|
hint: d.source ? `via ${d.source}` : void 0
|
|
44
44
|
}))
|
|
45
45
|
});
|
|
@@ -74,7 +74,7 @@ async function runRollbackCommand(root, deployId) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
async function runCloudflareRollback(root, deployId) {
|
|
77
|
-
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
77
|
+
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
|
|
78
78
|
const context = resolveCloudflareOperationContext(root);
|
|
79
79
|
const status = await readCloudflareWorkerStatus(context);
|
|
80
80
|
const deployedVersionIds = new Set(status.deployedVersionIds);
|
|
@@ -99,7 +99,7 @@ async function runCloudflareRollback(root, deployId) {
|
|
|
99
99
|
message: "Select a version to roll back to:",
|
|
100
100
|
options: candidates.map((version) => ({
|
|
101
101
|
value: version.id,
|
|
102
|
-
label: `${version.id} ${dim(
|
|
102
|
+
label: `${version.id} ${dim(version.createdAt ? formatRelativeTime(version.createdAt) : "")}`,
|
|
103
103
|
hint: version.metadata ? formatCount(version.metadata.migrations.length, "migration") : "migration state unknown"
|
|
104
104
|
}))
|
|
105
105
|
});
|
|
@@ -146,15 +146,5 @@ async function confirmUnrevertedMigrations(migrationDiff, noun) {
|
|
|
146
146
|
log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
|
|
147
147
|
await confirmRollbackOrExit();
|
|
148
148
|
}
|
|
149
|
-
function formatAge(deployedAt) {
|
|
150
|
-
if (!deployedAt) return "";
|
|
151
|
-
const diffMs = Date.now() - new Date(ensureUtc(deployedAt)).getTime();
|
|
152
|
-
if (diffMs < 6e4) return "just now";
|
|
153
|
-
const minutes = Math.floor(diffMs / 6e4);
|
|
154
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
155
|
-
const hours = Math.floor(minutes / 60);
|
|
156
|
-
if (hours < 24) return `${hours}h ago`;
|
|
157
|
-
return `${Math.floor(hours / 24)}d ago`;
|
|
158
|
-
}
|
|
159
149
|
//#endregion
|
|
160
150
|
export { runRollbackCommand };
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import { a as join,
|
|
2
|
-
import { r as writeFileIfChanged } from "./project-tsconfig-
|
|
3
|
-
import { mkdirSync } from "node:fs";
|
|
1
|
+
import { a as join, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { r as writeFileIfChanged } from "./project-tsconfig-bveqhlYA.mjs";
|
|
4
3
|
//#region src/codegen/db-types.ts
|
|
5
4
|
const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, asc, like, ilike, notLike, inArray, notInArray, isNull, isNotNull, between, notBetween, exists, notExists, count, sum, avg, min, max";
|
|
5
|
+
const DIALECT_DB_TYPES = {
|
|
6
|
+
sqlite: {
|
|
7
|
+
type: "DrizzleD1Database",
|
|
8
|
+
from: "void/_db",
|
|
9
|
+
arg: "d1: D1Database"
|
|
10
|
+
},
|
|
11
|
+
postgresql: {
|
|
12
|
+
type: "NodePgDatabase",
|
|
13
|
+
from: "void/_db-pg",
|
|
14
|
+
arg: "connectionString: string"
|
|
15
|
+
},
|
|
16
|
+
mysql: {
|
|
17
|
+
type: "MySql2Database",
|
|
18
|
+
from: "void/_db-mysql",
|
|
19
|
+
arg: "connectionString: string"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
6
22
|
/**
|
|
7
23
|
* Generate `.void/db.d.ts` with Drizzle types referencing the user's schema.
|
|
8
24
|
*
|
|
@@ -14,62 +30,17 @@ const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, as
|
|
|
14
30
|
* base module) to avoid circular resolution through the paths redirect.
|
|
15
31
|
*/
|
|
16
32
|
function generateDbDts(outDir, schema, dialect) {
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
"import type { MySql2Database } from \"void/_db-mysql\";",
|
|
21
|
-
"import type * as schema from \"@schema\";",
|
|
22
|
-
"type Schema = typeof schema;",
|
|
23
|
-
"export declare const db: MySql2Database<Schema>;",
|
|
24
|
-
"export declare function createDb(connectionString: string): MySql2Database<Schema>;",
|
|
25
|
-
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
26
|
-
"export type { MySql2Database } from \"void/_db-mysql\";",
|
|
27
|
-
""
|
|
28
|
-
] : [
|
|
29
|
-
"// Auto-generated by void — do not edit",
|
|
30
|
-
"import type { MySql2Database } from \"void/_db-mysql\";",
|
|
31
|
-
"export declare const db: MySql2Database<Record<string, never>>;",
|
|
32
|
-
"export declare function createDb(connectionString: string): MySql2Database<Record<string, never>>;",
|
|
33
|
-
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
34
|
-
"export type { MySql2Database } from \"void/_db-mysql\";",
|
|
35
|
-
""
|
|
36
|
-
] : dialect === "postgresql" ? schema ? [
|
|
37
|
-
"// Auto-generated by void — do not edit",
|
|
38
|
-
"import type { NodePgDatabase } from \"void/_db-pg\";",
|
|
39
|
-
"import type * as schema from \"@schema\";",
|
|
40
|
-
"type Schema = typeof schema;",
|
|
41
|
-
"export declare const db: NodePgDatabase<Schema>;",
|
|
42
|
-
"export declare function createDb(connectionString: string): NodePgDatabase<Schema>;",
|
|
43
|
-
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
44
|
-
"export type { NodePgDatabase } from \"void/_db-pg\";",
|
|
45
|
-
""
|
|
46
|
-
] : [
|
|
33
|
+
const { type, from, arg } = DIALECT_DB_TYPES[dialect];
|
|
34
|
+
const schemaType = schema ? "Schema" : "Record<string, never>";
|
|
35
|
+
const lines = [
|
|
47
36
|
"// Auto-generated by void — do not edit",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
37
|
+
...dialect === "sqlite" ? ["/// <reference types=\"@cloudflare/workers-types\" />"] : [],
|
|
38
|
+
`import type { ${type} } from "${from}";`,
|
|
39
|
+
...schema ? ["import type * as schema from \"@schema\";", "type Schema = typeof schema;"] : [],
|
|
40
|
+
`export declare const db: ${type}<${schemaType}>;`,
|
|
41
|
+
`export declare function createDb(${arg}): ${type}<${schemaType}>;`,
|
|
51
42
|
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
52
|
-
|
|
53
|
-
""
|
|
54
|
-
] : schema ? [
|
|
55
|
-
"// Auto-generated by void — do not edit",
|
|
56
|
-
"/// <reference types=\"@cloudflare/workers-types\" />",
|
|
57
|
-
"import type { DrizzleD1Database } from \"void/_db\";",
|
|
58
|
-
"import type * as schema from \"@schema\";",
|
|
59
|
-
"type Schema = typeof schema;",
|
|
60
|
-
"export declare const db: DrizzleD1Database<Schema>;",
|
|
61
|
-
"export declare function createDb(d1: D1Database): DrizzleD1Database<Schema>;",
|
|
62
|
-
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
63
|
-
"export type { DrizzleD1Database } from \"void/_db\";",
|
|
64
|
-
""
|
|
65
|
-
] : [
|
|
66
|
-
"// Auto-generated by void — do not edit",
|
|
67
|
-
"/// <reference types=\"@cloudflare/workers-types\" />",
|
|
68
|
-
"import type { DrizzleD1Database } from \"void/_db\";",
|
|
69
|
-
"export declare const db: DrizzleD1Database<Record<string, never>>;",
|
|
70
|
-
"export declare function createDb(d1: D1Database): DrizzleD1Database<Record<string, never>>;",
|
|
71
|
-
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
72
|
-
"export type { DrizzleD1Database } from \"void/_db\";",
|
|
43
|
+
`export type { ${type} } from "${from}";`,
|
|
73
44
|
""
|
|
74
45
|
];
|
|
75
46
|
return writeFileIfChanged(join(outDir, "db.d.ts"), lines.join("\n"));
|
|
@@ -271,22 +242,16 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
271
242
|
const hasActions = page.methods.includes("actions");
|
|
272
243
|
if (hasAction && hasActions) throw new Error(`pages: Page '${page.pattern}' exports both "action" and "actions". Use one or the other.`);
|
|
273
244
|
lines.push(` ${JSON.stringify(page.pattern)}: {`);
|
|
274
|
-
|
|
275
|
-
if (page.serverPath) {
|
|
276
|
-
const absPath = `${pagesDir}/${page.serverPath}`;
|
|
277
|
-
importPath = relative(outDir, absPath);
|
|
278
|
-
}
|
|
245
|
+
const importPath = relative(outDir, `${pagesDir}/${page.serverPath}`);
|
|
279
246
|
if (hasActions) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
} else if (importPath) {
|
|
247
|
+
const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
|
|
248
|
+
lines.push(` actions: { [K in keyof ${actionsImport}]: {`);
|
|
249
|
+
lines.push(` body: ExtractInput<${actionsImport}[K]["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
|
|
250
|
+
lines.push(" } };");
|
|
251
|
+
} else {
|
|
287
252
|
const importExpr = `(typeof import(${JSON.stringify(importPath)}))["action"]`;
|
|
288
253
|
lines.push(` body: ExtractInput<${importExpr}["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
|
|
289
|
-
}
|
|
254
|
+
}
|
|
290
255
|
if (page.params.length > 0) {
|
|
291
256
|
const paramsType = page.params.map((p) => `${p}: string`).join("; ");
|
|
292
257
|
lines.push(` params: { ${paramsType} };`);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
//#region src/runtime/routing-assets.ts
|
|
2
|
+
const ASSET_EXTENSIONS = [
|
|
3
|
+
"png",
|
|
4
|
+
"jpg",
|
|
5
|
+
"jpeg",
|
|
6
|
+
"gif",
|
|
7
|
+
"webp",
|
|
8
|
+
"avif",
|
|
9
|
+
"svg",
|
|
10
|
+
"ico",
|
|
11
|
+
"css",
|
|
12
|
+
"js",
|
|
13
|
+
"mjs",
|
|
14
|
+
"cjs",
|
|
15
|
+
"woff",
|
|
16
|
+
"woff2",
|
|
17
|
+
"ttf",
|
|
18
|
+
"otf",
|
|
19
|
+
"eot",
|
|
20
|
+
"mp4",
|
|
21
|
+
"webm",
|
|
22
|
+
"mp3",
|
|
23
|
+
"wav",
|
|
24
|
+
"pdf",
|
|
25
|
+
"txt",
|
|
26
|
+
"xml",
|
|
27
|
+
"json",
|
|
28
|
+
"wasm",
|
|
29
|
+
"map"
|
|
30
|
+
];
|
|
31
|
+
function createManifestLoader() {
|
|
32
|
+
let cached = null;
|
|
33
|
+
return async (request, env) => {
|
|
34
|
+
if (cached) return cached;
|
|
35
|
+
const injected = globalThis.__VITE_MANIFEST__;
|
|
36
|
+
if (typeof injected === "object" && injected) {
|
|
37
|
+
cached = injected;
|
|
38
|
+
return cached;
|
|
39
|
+
}
|
|
40
|
+
const assets = env?.ASSETS;
|
|
41
|
+
if (!assets || typeof assets.fetch !== "function") return null;
|
|
42
|
+
const response = await assets.fetch(new Request(new URL("/.vite/manifest.json", request.url).toString()));
|
|
43
|
+
if (!response.ok) return null;
|
|
44
|
+
cached = await response.json();
|
|
45
|
+
return cached;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const BINDING_HINT_SCRIPT = "<script type=\"module\" src=\"/@id/virtual:void/binding-hint\"><\/script>";
|
|
49
|
+
const REACT_REFRESH_SCRIPT = `<script type="module">
|
|
50
|
+
import RefreshRuntime from "/@react-refresh";
|
|
51
|
+
RefreshRuntime.injectIntoGlobalHook(window);
|
|
52
|
+
window.$RefreshReg$ = () => {};
|
|
53
|
+
window.$RefreshSig$ = () => (type) => type;
|
|
54
|
+
window.__vite_plugin_react_preamble_installed__ = true;
|
|
55
|
+
<\/script>`;
|
|
56
|
+
const escapeAttribute = (value) => String(value).replace(/"/g, """);
|
|
57
|
+
const script = (url) => `<script type="module" src="${escapeAttribute(url)}"><\/script>`;
|
|
58
|
+
function collectManifestFiles(manifest, entryId, depthFirst) {
|
|
59
|
+
const seen = /* @__PURE__ */ new Set();
|
|
60
|
+
const pending = [entryId];
|
|
61
|
+
for (let index = 0; depthFirst ? pending.length > 0 : index < pending.length;) {
|
|
62
|
+
const id = depthFirst ? pending.pop() : pending[index++];
|
|
63
|
+
if (seen.has(id)) continue;
|
|
64
|
+
seen.add(id);
|
|
65
|
+
const imports = manifest[id]?.imports;
|
|
66
|
+
if (Array.isArray(imports)) pending.push(...imports);
|
|
67
|
+
}
|
|
68
|
+
return [...seen];
|
|
69
|
+
}
|
|
70
|
+
function collectRouteCss(manifest, roots) {
|
|
71
|
+
const css = /* @__PURE__ */ new Set();
|
|
72
|
+
const visited = /* @__PURE__ */ new Set();
|
|
73
|
+
const visit = (id) => {
|
|
74
|
+
if (visited.has(id)) return;
|
|
75
|
+
visited.add(id);
|
|
76
|
+
const chunk = manifest[id];
|
|
77
|
+
if (!chunk) return;
|
|
78
|
+
if (Array.isArray(chunk.css)) for (const file of chunk.css) css.add(file);
|
|
79
|
+
if (Array.isArray(chunk.imports)) for (const imported of chunk.imports) visit(imported);
|
|
80
|
+
};
|
|
81
|
+
for (const root of roots) visit(root);
|
|
82
|
+
return css;
|
|
83
|
+
}
|
|
84
|
+
/** Frameworks supply only client entry IDs and active layout/page roots. */
|
|
85
|
+
function createClientAssetTags(options, loadManifest = createManifestLoader()) {
|
|
86
|
+
return async (request, env, componentId = "") => {
|
|
87
|
+
const empty = {
|
|
88
|
+
css: "",
|
|
89
|
+
preloads: "",
|
|
90
|
+
body: ""
|
|
91
|
+
};
|
|
92
|
+
const manifest = await loadManifest(request, env);
|
|
93
|
+
if (!manifest || typeof manifest !== "object") {
|
|
94
|
+
if (!options.dev) return empty;
|
|
95
|
+
const preloads = [script("/@vite/client"), BINDING_HINT_SCRIPT];
|
|
96
|
+
if (options.kind === "ssr" && options.reactRefresh) preloads.push(REACT_REFRESH_SCRIPT);
|
|
97
|
+
let body = script(options.entryUrl);
|
|
98
|
+
if (options.extraEntryUrl) body += "\n" + script(options.extraEntryUrl);
|
|
99
|
+
const tags = {
|
|
100
|
+
css: "",
|
|
101
|
+
preloads: preloads.join("\n"),
|
|
102
|
+
body
|
|
103
|
+
};
|
|
104
|
+
if (options.devCss && options.kind !== "ssr") {
|
|
105
|
+
const css = await options.devCss(request, env, {
|
|
106
|
+
kind: options.kind,
|
|
107
|
+
componentId,
|
|
108
|
+
rootPhases: options.devRootPhases?.[componentId] || [[options.entryUrl]]
|
|
109
|
+
});
|
|
110
|
+
tags.devCss = Array.isArray(css) ? css : [];
|
|
111
|
+
}
|
|
112
|
+
return tags;
|
|
113
|
+
}
|
|
114
|
+
const entry = manifest[options.entryId];
|
|
115
|
+
if (!entry || typeof entry !== "object" || typeof entry.file !== "string") return empty;
|
|
116
|
+
const ids = collectManifestFiles(manifest, options.entryId, options.kind === "ssr");
|
|
117
|
+
const extraEntry = options.extraEntryId ? manifest[options.extraEntryId] : void 0;
|
|
118
|
+
const hasExtra = extraEntry && typeof extraEntry.file === "string";
|
|
119
|
+
if (hasExtra) ids.push(...collectManifestFiles(manifest, options.extraEntryId, false));
|
|
120
|
+
const css = options.kind === "ssr" ? /* @__PURE__ */ new Set() : collectRouteCss(manifest, [options.entryId, ...options.pageCssKeys?.[componentId] ?? []]);
|
|
121
|
+
if (hasExtra) for (const file of collectRouteCss(manifest, [options.extraEntryId])) css.add(file);
|
|
122
|
+
const preloads = /* @__PURE__ */ new Set();
|
|
123
|
+
for (const id of ids) {
|
|
124
|
+
const chunk = manifest[id];
|
|
125
|
+
if (!chunk || typeof chunk !== "object") continue;
|
|
126
|
+
if (options.kind === "ssr" && Array.isArray(chunk.css)) for (const file of chunk.css) css.add(file);
|
|
127
|
+
if (id !== options.entryId && id !== options.extraEntryId && typeof chunk.file === "string") preloads.add(chunk.file);
|
|
128
|
+
}
|
|
129
|
+
let body = script("/" + entry.file);
|
|
130
|
+
if (hasExtra) body += "\n" + script("/" + extraEntry.file);
|
|
131
|
+
return {
|
|
132
|
+
css: [...css].map((file) => `<link rel="stylesheet" href="/${escapeAttribute(file)}">`).join("\n"),
|
|
133
|
+
preloads: [...preloads].map((file) => `<link rel="modulepreload" href="/${escapeAttribute(file)}">`).join("\n"),
|
|
134
|
+
body
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { createClientAssetTags as n, createManifestLoader as r, ASSET_EXTENSIONS as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as runMigrations, i as openSqliteDatabase, n as getAppliedMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-
|
|
1
|
+
import { a as runMigrations, i as openSqliteDatabase, n as getAppliedMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-DcVDrzuR.mjs";
|
|
2
2
|
export { getApplicationTables, getAppliedMigrations, getMiniflareDatabasePath, openSqliteDatabase, runMigrations };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as join, n as dirname } from "./dist-
|
|
2
|
-
import { t as collectMigrations } from "./collect-
|
|
3
|
-
import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-
|
|
1
|
+
import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
3
|
+
import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-BjYqR-So.mjs";
|
|
4
4
|
import { r as classifyMigration } from "./plan-BhLO2p4w.mjs";
|
|
5
5
|
import { existsSync, mkdirSync } from "node:fs";
|
|
6
6
|
import { createHash, createHmac } from "node:crypto";
|
|
@@ -64,14 +64,8 @@ function getMiniflareDatabasePath(persistRoot, databaseId) {
|
|
|
64
64
|
return join(persistRoot, "v3", "d1", uniqueKey, `${hash}.sqlite`);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* Wrapped in an IMMEDIATE transaction + re-checked inside, so two concurrent
|
|
71
|
-
* local runners (e.g. two `vite dev` processes against the same DB file)
|
|
72
|
-
* don't race each other. Without the lock, both could observe `_migrations`
|
|
73
|
-
* exists, both enter the body, and the loser crashes on `SELECT … FROM
|
|
74
|
-
* _migrations` after the winner already dropped it.
|
|
67
|
+
* Move the legacy `_migrations` rows into `_void_migrations`. The check runs inside an
|
|
68
|
+
* IMMEDIATE transaction so two local runners cannot both copy and drop the old table.
|
|
75
69
|
*/
|
|
76
70
|
function upgradeTrackingTable(db) {
|
|
77
71
|
db.transaction(() => {
|
|
@@ -120,23 +114,8 @@ function assertLocalMigrationState(migrations, appliedNames, applicationTables)
|
|
|
120
114
|
].join("\n"));
|
|
121
115
|
}
|
|
122
116
|
/**
|
|
123
|
-
* Apply
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* Each .sql file is executed as a single `db.exec()` call — better-sqlite3's
|
|
127
|
-
* `exec` natively handles multi-statement SQL and lets SQLite do the parsing,
|
|
128
|
-
* so semicolons inside string literals, comments, or trigger bodies don't
|
|
129
|
-
* fracture the migration. A naive `split(';')` pre-processor would misparse
|
|
130
|
-
* a statement like `CREATE TABLE t (msg TEXT DEFAULT 'a;b')` into garbage
|
|
131
|
-
* fragments.
|
|
132
|
-
*
|
|
133
|
-
* Concurrent-runner safety: two local `void` processes can race against the
|
|
134
|
-
* same SQLite file. Both can snapshot the applied-set before either writes,
|
|
135
|
-
* and if both decide a migration is pending, the loser would crash on a
|
|
136
|
-
* `table already exists` error. Each per-migration apply therefore runs
|
|
137
|
-
* inside an IMMEDIATE transaction that re-checks the tracking row under the
|
|
138
|
-
* SQLite write lock — the loser sees the winner's insert and skips, instead
|
|
139
|
-
* of re-running the DDL.
|
|
117
|
+
* Apply pending SQL migrations and record them in `_void_migrations`.
|
|
118
|
+
* Each file runs through one `exec` so SQLite parses multi-statement SQL itself.
|
|
140
119
|
*/
|
|
141
120
|
async function runMigrations(migrationsDir, dbPath) {
|
|
142
121
|
const allMigrations = collectMigrations(migrationsDir);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as collectMigrations } from "./collect-
|
|
1
|
+
import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
2
|
+
import { n as splitMigrationSql } from "./migration-handler-Cg0Y4EPu.mjs";
|
|
2
3
|
//#region src/migrations/runner-mysql.ts
|
|
3
4
|
async function readMySqlAppliedMigrations(client) {
|
|
4
5
|
try {
|
|
@@ -31,7 +32,7 @@ async function applyMySqlMigrations(client, migrations) {
|
|
|
31
32
|
const appliedSet = new Set(existing.map((row) => String(row.name)));
|
|
32
33
|
const pending = migrations.filter((migration) => !appliedSet.has(migration.name));
|
|
33
34
|
for (const migration of pending) {
|
|
34
|
-
await client.query(
|
|
35
|
+
for (const statement of splitMigrationSql(migration.sql)) await client.query(statement);
|
|
35
36
|
await client.query("INSERT INTO `_void_migrations` (`name`, `applied_at`) VALUES (?, ?)", [migration.name, (/* @__PURE__ */ new Date()).toISOString()]);
|
|
36
37
|
}
|
|
37
38
|
return pending.map((migration) => migration.name);
|
|
@@ -51,4 +52,4 @@ async function runMySqlMigrations(migrationsDir, url) {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
//#endregion
|
|
54
|
-
export { runMySqlMigrations as i, getMySqlAppliedMigrations as n, readMySqlAppliedMigrations as r, applyMySqlMigrations as t };
|
|
55
|
+
export { toMySqlClient as a, runMySqlMigrations as i, getMySqlAppliedMigrations as n, readMySqlAppliedMigrations as r, applyMySqlMigrations as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as toMySqlClient, i as runMySqlMigrations, n as getMySqlAppliedMigrations, r as readMySqlAppliedMigrations, t as applyMySqlMigrations } from "./runner-mysql-CCtyI0p6.mjs";
|
|
2
|
+
export { applyMySqlMigrations, getMySqlAppliedMigrations, readMySqlAppliedMigrations, runMySqlMigrations, toMySqlClient };
|
package/dist/runtime/ai.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as bytesToBase64 } from "../base64-DVrOndmI.mjs";
|
|
2
|
+
import { t as cfAccessHeaders } from "../cf-access-BM9G0lhO.mjs";
|
|
3
|
+
import { a as getRawRuntimeEnv } from "../env-raw-Cklzcde3.mjs";
|
|
3
4
|
import { r as limitFromResponse, t as UsageLimit } from "../limits-D0vD1M9A.mjs";
|
|
4
5
|
//#region src/runtime/ai-types.ts
|
|
5
6
|
/** Maps provider prefix to expected env var name for the API key */
|
|
@@ -95,12 +96,6 @@ function copyBinaryView(value) {
|
|
|
95
96
|
copy.set(bytes);
|
|
96
97
|
return copy.buffer;
|
|
97
98
|
}
|
|
98
|
-
function bytesToBase64(bytes) {
|
|
99
|
-
let binary = "";
|
|
100
|
-
const chunkSize = 32768;
|
|
101
|
-
for (let i = 0; i < bytes.length; i += chunkSize) binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
102
|
-
return btoa(binary);
|
|
103
|
-
}
|
|
104
99
|
function arrayBufferToBase64(buffer) {
|
|
105
100
|
return bytesToBase64(new Uint8Array(buffer));
|
|
106
101
|
}
|
|
@@ -214,16 +209,10 @@ async function responseFromResult(result) {
|
|
|
214
209
|
if (isBinaryView(result)) return new Response(copyBinaryView(result), { headers: { "content-type": "application/octet-stream" } });
|
|
215
210
|
return Response.json(result);
|
|
216
211
|
}
|
|
217
|
-
function
|
|
218
|
-
if (typeof options !== "object" || options === null) return
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
};
|
|
222
|
-
const { endpoint, ...runOptions } = options;
|
|
223
|
-
return {
|
|
224
|
-
endpoint: typeof endpoint === "string" ? endpoint : "images/generations",
|
|
225
|
-
runOptions: Object.keys(runOptions).length > 0 ? runOptions : void 0
|
|
226
|
-
};
|
|
212
|
+
function imageRunOptions(options) {
|
|
213
|
+
if (typeof options !== "object" || options === null) return;
|
|
214
|
+
const { endpoint: _endpoint, ...runOptions } = options;
|
|
215
|
+
return Object.keys(runOptions).length > 0 ? runOptions : void 0;
|
|
227
216
|
}
|
|
228
217
|
function resolveProviderKey(provider, runtimeEnv, options) {
|
|
229
218
|
const envVar = options?.apiKeyEnv ?? PROVIDER_KEY_MAP[provider];
|
|
@@ -324,11 +313,10 @@ function makeProxyBackend(send, runtimeEnv) {
|
|
|
324
313
|
return readProxyResult(res);
|
|
325
314
|
},
|
|
326
315
|
async image(model, inputs, options) {
|
|
327
|
-
const { runOptions } = splitImageOptions(options);
|
|
328
316
|
return proxyFetch("run", {
|
|
329
317
|
model,
|
|
330
318
|
inputs,
|
|
331
|
-
options:
|
|
319
|
+
options: imageRunOptions(options)
|
|
332
320
|
});
|
|
333
321
|
},
|
|
334
322
|
async providerFetch(provider, path, init, options) {
|
|
@@ -392,8 +380,7 @@ function makeDirectBackend(directAi, runtimeEnv, gatewayId) {
|
|
|
392
380
|
return {
|
|
393
381
|
run,
|
|
394
382
|
async image(model, inputs, options) {
|
|
395
|
-
|
|
396
|
-
return responseFromResult(await run(model, inputs, runOptions));
|
|
383
|
+
return responseFromResult(await run(model, inputs, imageRunOptions(options)));
|
|
397
384
|
},
|
|
398
385
|
async providerFetch(provider, path, init, options) {
|
|
399
386
|
if (!gatewayId) return Response.json({ error: "ai: ai.provider().fetch() needs an AI Gateway when self-hosting. Set \"ai\": { \"gateway\": \"<id>\" } in void.json." }, { status: 501 });
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-B74NJIus.mjs";
|
|
2
2
|
//#region src/runtime/better-auth-mysql.d.ts
|
|
3
|
-
export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
|
|
4
|
-
export declare const createVoidAuth: VoidAuthRuntimeApi["createVoidAuth"];
|
|
5
3
|
export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
|
|
6
4
|
export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
|
|
7
5
|
export declare const handleVoidAuthRequest: VoidAuthRuntimeApi["handleVoidAuthRequest"];
|
|
8
6
|
export declare const runVoidAuthMigrations: VoidAuthRuntimeApi["runVoidAuthMigrations"];
|
|
9
|
-
//#endregion
|
|
10
|
-
export type { VoidAuthDialect, VoidAuthEnv, VoidAuthRuntimeOptions };
|
|
7
|
+
//#endregion
|
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
import { t as applyMySqlAuthMigrations } from "../auth-migrations-
|
|
2
|
-
import { n as
|
|
1
|
+
import { i as mysqlMigrationRunner, t as applyMySqlAuthMigrations } from "../auth-migrations-Cgs0k6lS.mjs";
|
|
2
|
+
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-CMXlZG7W.mjs";
|
|
3
3
|
//#region src/runtime/better-auth-mysql.ts
|
|
4
|
-
async function
|
|
5
|
-
const { createPool } = await import("mysql2/promise");
|
|
6
|
-
const pool = createPool({
|
|
7
|
-
uri: resolveConnectionString(env, "MySQL"),
|
|
8
|
-
connectionLimit: 1
|
|
9
|
-
});
|
|
10
|
-
return {
|
|
11
|
-
database: pool,
|
|
12
|
-
async dispose() {
|
|
13
|
-
await pool.end();
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
async function runMySqlAuthMigrations(_request, env, runtime, migrationSchema) {
|
|
18
|
-
if (!migrationSchema) throw new Error("auth: Migration schema is unavailable.");
|
|
19
|
-
if (runtime.dialect !== "mysql" || migrationSchema.dialect !== "mysql") throw new Error("auth: Runtime mismatch. Expected mysql.");
|
|
4
|
+
async function applyMigrations(env, migrationSchema) {
|
|
20
5
|
const { createConnection } = await import("mysql2/promise");
|
|
21
6
|
const connection = await createConnection(resolveConnectionString(env, "MySQL"));
|
|
22
7
|
try {
|
|
23
|
-
await applyMySqlAuthMigrations(
|
|
24
|
-
async all(sql, params) {
|
|
25
|
-
const [rows] = await connection.query(sql, params);
|
|
26
|
-
return rows;
|
|
27
|
-
},
|
|
28
|
-
async run(sql, params) {
|
|
29
|
-
await connection.query(sql, params);
|
|
30
|
-
}
|
|
31
|
-
}, migrationSchema);
|
|
8
|
+
await applyMySqlAuthMigrations(mysqlMigrationRunner(connection), migrationSchema);
|
|
32
9
|
} finally {
|
|
33
10
|
await connection.end();
|
|
34
11
|
}
|
|
35
12
|
}
|
|
36
|
-
const runtime = createVoidAuthRuntime("mysql",
|
|
37
|
-
const resolveVoidAuthOptions = runtime.resolveVoidAuthOptions;
|
|
38
|
-
const createVoidAuth = runtime.createVoidAuth;
|
|
13
|
+
const runtime = createVoidAuthRuntime("mysql", applyMigrations);
|
|
39
14
|
const resolveVoidAuthState = runtime.resolveVoidAuthState;
|
|
40
15
|
const runVoidAuthMiddleware = runtime.runVoidAuthMiddleware;
|
|
41
16
|
const handleVoidAuthRequest = runtime.handleVoidAuthRequest;
|
|
42
17
|
const runVoidAuthMigrations = runtime.runVoidAuthMigrations;
|
|
43
18
|
//#endregion
|
|
44
|
-
export {
|
|
19
|
+
export { handleVoidAuthRequest, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-B74NJIus.mjs";
|
|
2
2
|
//#region src/runtime/better-auth-pg.d.ts
|
|
3
|
-
export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
|
|
4
|
-
export declare const createVoidAuth: VoidAuthRuntimeApi["createVoidAuth"];
|
|
5
3
|
export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
|
|
6
4
|
export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
|
|
7
5
|
export declare const handleVoidAuthRequest: VoidAuthRuntimeApi["handleVoidAuthRequest"];
|
|
8
6
|
export declare const runVoidAuthMigrations: VoidAuthRuntimeApi["runVoidAuthMigrations"];
|
|
9
|
-
//#endregion
|
|
10
|
-
export type { VoidAuthDialect, VoidAuthEnv, VoidAuthRuntimeOptions };
|
|
7
|
+
//#endregion
|