void 0.26.1 → 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-CfUXh_nU.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-B5_tZLxT.mjs → auth-B6iOCjKI.mjs} +23 -56
- package/dist/{auth-link-D5RmKnzh.mjs → auth-link-DWr6Afao.mjs} +10 -10
- package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
- package/dist/{auth-router-Bap-pvbn.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-B58c8iS8.mjs → build-cmd-Cr3FJxv0.mjs} +5 -5
- package/dist/{cache-Bo52trKF.mjs → cache-D0Tt28cn.mjs} +5 -5
- package/dist/{cancel-deploy-BZNz3Q26.mjs → cancel-deploy-CJKvk7AN.mjs} +4 -4
- package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
- package/dist/{cf-access-ngGqZpHZ.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 +46 -14
- 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-C2Prx_Bi.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-X0MUA1gk.mjs → connect-nukQSoEO.mjs} +8 -8
- package/dist/{create-project-DxiyW6iX.mjs → create-project-D4APeBwX.mjs} +7 -7
- package/dist/{create-project-iwkbqiBU.mjs → create-project-DL7YXpjj.mjs} +1 -1
- package/dist/{db-XnVMHzoV.mjs → db-27RztQLy.mjs} +173 -263
- package/dist/{delete-esYlMiSJ.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-CbbBWhWE.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-CpuT42g7.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-w9jOyGZn.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-D_FsOFxq.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-CVFBTmBx.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-Bw-fRKGp.mjs → init-ZWOJvc-Z.mjs} +179 -388
- package/dist/isr-config-DPjXM8J2.mjs +194 -0
- package/dist/{link-DlPG8iX3.mjs → link-UEc7bnF4.mjs} +8 -8
- package/dist/{list-2GN7_ueV.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-D-Q4xw3Q.mjs → login-CZ2Cqa-D.mjs} +11 -11
- package/dist/login-DhK7o1oJ.mjs +2 -0
- package/dist/{logs-rd8J-OFh.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-BNsW5gfp.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
- package/dist/{operator-auth-AzVLbrr3.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
- package/dist/{operator-client-BQtzyG-g.mjs → operator-client-C-ROjk1I.mjs} +4 -4
- package/dist/{operator-cmd-B6f6Cg9Z.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-BoZkWQnJ.mjs → platform-args-C6Mb_I3a.mjs} +34 -58
- package/dist/platform-args-Cm7x-fot.mjs +2 -0
- package/dist/{platform-auth-config-n603OANg.mjs → platform-auth-config-CJmNkFT2.mjs} +10 -11
- package/dist/{platform-auth-protection-zxDr0hWW.mjs → platform-auth-protection-D5wvsI-Y.mjs} +36 -26
- package/dist/{platform-auth-recovery-tw9lgtgE.mjs → platform-auth-recovery-D_0I3n-1.mjs} +8 -9
- package/dist/{platform-cmd-C00YM14r.mjs → platform-cmd-Cuj4oUVo.mjs} +1 -1
- package/dist/{platform-cmd-B8-bCb7t.mjs → platform-cmd-DxxZO6e5.mjs} +17 -16
- package/dist/{platform-discovery-BC0HCKYt.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
- package/dist/{platform-domain-p0kobLV8.mjs → platform-domain-zLXnW1G_.mjs} +5 -5
- package/dist/{platform-lifecycle-D_QEY32D.mjs → platform-lifecycle-DOW-wLfx.mjs} +1398 -2043
- package/dist/{platform-lifecycle-vFqtNPPa.mjs → platform-lifecycle-_gfnjUBr.mjs} +1 -1
- package/dist/{platform-management-oi-SvI3f.mjs → platform-management-CYrLvTGH.mjs} +1 -1
- package/dist/{platform-management-BdYblvvE.mjs → platform-management-t7HKy4-U.mjs} +632 -124
- package/dist/{platform-plans-config-CjiFv5J4.mjs → platform-plans-config-CNH6zbPX.mjs} +15 -11
- package/dist/{platform-recovery-PvNS9Nl2.mjs → platform-recovery-DeucI7A9.mjs} +6 -9
- package/dist/{platform-registry-P387v42A.mjs → platform-registry-B9mWX9LO.mjs} +18 -19
- package/dist/{platform-setup-DVe42Ws7.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-ti8_yTcA.mjs → project-cmd-Dq75AXzy.mjs} +19 -19
- package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
- package/dist/{project-DQstYTxO.mjs → project-rqDnVsJN.mjs} +8 -4
- package/dist/{project-team-CDPE1Tsg.mjs → project-team-B3_QcStG.mjs} +6 -6
- package/dist/{project-token-CkZ1cN0Z.mjs → project-token-CvsRvv2I.mjs} +5 -5
- package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
- package/dist/{project-zero-trust-DdjLR61k.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-DFAqyYy8.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-BKYXBduI.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-BAt2KMmO.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/deployment.md +2 -2
- package/docs/guide/durable-state.md +24 -0
- package/docs/guide/platform/administration/access.md +5 -1
- package/docs/guide/platform/administration/connected-apps.md +55 -0
- package/docs/guide/platform/installation/credentials.md +3 -1
- package/docs/guide/platform/installation/first-deployment.md +1 -1
- package/docs/guide/project-collaboration.md +1 -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/auth.md +1 -1
- package/docs/reference/cli/database.md +9 -3
- package/docs/reference/cli/deploy.md +1 -1
- package/docs/reference/cli/platform-installation.md +1 -1
- package/docs/reference/cli/setup.md +2 -0
- package/package.json +14 -17
- package/skills/void/SKILL.md +4 -2
- package/dist/auth-BgX2qYSY.mjs +0 -2
- package/dist/cf-build-output-H9a97vME.mjs +0 -2
- package/dist/client-By4JjMw_.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-BsEvnlJl.mjs +0 -10455
- package/dist/deploy-C1d-YTfp.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-DzKUrQvk.mjs +0 -2
- package/dist/login-Dc-wuTDq.mjs +0 -2
- package/dist/migrate-BHp07yJE.mjs +0 -2
- package/dist/operator-cmd-Cwn50lOV.mjs +0 -2
- package/dist/pages/head-client.d.mts +0 -13
- package/dist/pages/head-client.mjs +0 -2
- package/dist/platform-args-DYgITk0D.mjs +0 -2
- package/dist/prepare-DRUV-g3X.mjs +0 -2
- package/dist/project-BiaPQ7ur.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
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
|
+
//#region src/asset-routing.ts
|
|
4
|
+
function isApiRoutePattern(pattern) {
|
|
5
|
+
return pattern === "/api" || pattern.startsWith("/api/");
|
|
6
|
+
}
|
|
7
|
+
function hasDocumentRoutes(routes) {
|
|
8
|
+
return routes.some((route) => !isApiRoutePattern(route.pattern));
|
|
9
|
+
}
|
|
10
|
+
function hasApiRoutes(routes) {
|
|
11
|
+
return routes.some((route) => isApiRoutePattern(route.pattern));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns true when browser document navigations must reach the worker before
|
|
15
|
+
* a static asset fallback can serve HTML.
|
|
16
|
+
*/
|
|
17
|
+
function workerOwnsHtmlRouting(inputs) {
|
|
18
|
+
return inputs.isSsr || inputs.hasPages || inputs.hasDocumentRoutes || inputs.hasMiddleware || inputs.hasWebSockets === true || inputs.liveEnabled === true;
|
|
19
|
+
}
|
|
20
|
+
function resolveAssetConfig(inputs) {
|
|
21
|
+
return resolveAssetRoutingPolicy(inputs).assetConfig;
|
|
22
|
+
}
|
|
23
|
+
const VOID_INTERNAL_WORKER_FIRST = ["/__void", "/__void/*"];
|
|
24
|
+
function resolveAssetRoutingPolicy(inputs) {
|
|
25
|
+
const workerFirst = workerOwnsHtmlRouting(inputs);
|
|
26
|
+
const apiWorkerFirst = !workerFirst && (inputs.hasApiRoutes === true || inputs.authEnabled === true);
|
|
27
|
+
const assetConfig = workerFirst ? {
|
|
28
|
+
not_found_handling: "none",
|
|
29
|
+
run_worker_first: ["/**"]
|
|
30
|
+
} : apiWorkerFirst ? {
|
|
31
|
+
not_found_handling: "single-page-application",
|
|
32
|
+
run_worker_first: [
|
|
33
|
+
"/api",
|
|
34
|
+
"/api/*",
|
|
35
|
+
...VOID_INTERNAL_WORKER_FIRST
|
|
36
|
+
]
|
|
37
|
+
} : {
|
|
38
|
+
not_found_handling: "single-page-application",
|
|
39
|
+
run_worker_first: [...VOID_INTERNAL_WORKER_FIRST]
|
|
40
|
+
};
|
|
41
|
+
if (inputs.notFound !== void 0) assetConfig.not_found_handling = inputs.notFound;
|
|
42
|
+
return {
|
|
43
|
+
assetConfig,
|
|
44
|
+
apiWorkerFirst,
|
|
45
|
+
workerFirst,
|
|
46
|
+
workerSpaFallback: workerFirst && !inputs.isSsr && !inputs.hasPages && (inputs.notFound === void 0 || inputs.notFound === "single-page-application")
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/queues/dispatch.ts
|
|
51
|
+
/**
|
|
52
|
+
* Emit the queue-name resolver used by generated native workers and framework
|
|
53
|
+
* wrappers. Hosted relays send the exact logical name. Native Queue events may
|
|
54
|
+
* expose a project-prefixed physical name, so fallback matching selects the
|
|
55
|
+
* unique longest known `-name` suffix. Unknown or ambiguous inputs fail closed.
|
|
56
|
+
*/
|
|
57
|
+
function generateQueueResolverSource(queueNames) {
|
|
58
|
+
return `const __queueNames = ${JSON.stringify(queueNames)};
|
|
59
|
+
function __resolveQueueIndex(queueName) {
|
|
60
|
+
if (typeof queueName !== "string") return -1;
|
|
61
|
+
const exact = __queueNames.indexOf(queueName);
|
|
62
|
+
if (exact !== -1) return exact;
|
|
63
|
+
let match = -1;
|
|
64
|
+
let matchLength = -1;
|
|
65
|
+
for (let i = 0; i < __queueNames.length; i++) {
|
|
66
|
+
const name = __queueNames[i];
|
|
67
|
+
if (!queueName.endsWith("-" + name)) continue;
|
|
68
|
+
if (name.length > matchLength) {
|
|
69
|
+
match = i;
|
|
70
|
+
matchLength = name.length;
|
|
71
|
+
} else if (name.length === matchLength) {
|
|
72
|
+
match = -1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return match;
|
|
76
|
+
}`;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/cli/build-output-dir.ts
|
|
80
|
+
/**
|
|
81
|
+
* Resolve the top-level build output directory: the first segment of a
|
|
82
|
+
* framework preset's `workerDir`, or `dist` for a Void app.
|
|
83
|
+
*/
|
|
84
|
+
function resolveDistDir(root, fwPreset, buildCommand) {
|
|
85
|
+
if (fwPreset) {
|
|
86
|
+
const topDir = fwPreset.workerDir.split("/")[0];
|
|
87
|
+
const distDir = join(root, topDir);
|
|
88
|
+
if (!existsSync(distDir)) throw new Error(`deploy: Build output directory '${topDir}' not found. Run '${buildCommand ?? fwPreset.buildCommand}' first.`);
|
|
89
|
+
return distDir;
|
|
90
|
+
}
|
|
91
|
+
return join(root, "dist");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Resolve the worker output subdirectory within the build dir: the rest of a
|
|
95
|
+
* framework preset's `workerDir`, or the first known Void output that exists.
|
|
96
|
+
*/
|
|
97
|
+
function resolveWorkerDirName(distDir, fwPreset, buildCommand) {
|
|
98
|
+
if (fwPreset) {
|
|
99
|
+
const subDir = fwPreset.workerDir.split("/").slice(1).join("/");
|
|
100
|
+
if (!existsSync(join(distDir, subDir))) throw new Error(`deploy: Worker output '${fwPreset.workerDir}' not found. Run '${buildCommand ?? fwPreset.buildCommand}' first.`);
|
|
101
|
+
return subDir;
|
|
102
|
+
}
|
|
103
|
+
for (const name of [
|
|
104
|
+
"ssr",
|
|
105
|
+
"rsc",
|
|
106
|
+
"server"
|
|
107
|
+
]) if (existsSync(join(distDir, name))) return name;
|
|
108
|
+
throw new Error("deploy: Worker output not found. Expected dist/ssr/ or dist/rsc/.");
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/shared/collect-files.ts
|
|
112
|
+
/**
|
|
113
|
+
* Every non-directory path under `dir`, depth first. Unlike
|
|
114
|
+
* `readdirSync(dir, { recursive: true })`, it does not descend into
|
|
115
|
+
* symlinked directories.
|
|
116
|
+
*/
|
|
117
|
+
function collectFiles(dir) {
|
|
118
|
+
const files = [];
|
|
119
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
120
|
+
const fullPath = join(dir, entry.name);
|
|
121
|
+
if (entry.isDirectory()) files.push(...collectFiles(fullPath));
|
|
122
|
+
else files.push(fullPath);
|
|
123
|
+
}
|
|
124
|
+
return files;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/isr-config.ts
|
|
128
|
+
/**
|
|
129
|
+
* Whether a resolved `revalidate` value represents an active ISR configuration.
|
|
130
|
+
* `null`/`undefined`/`0`/`{}` are treated as "no ISR", a positive number or a
|
|
131
|
+
* non-empty path map is treated as "ISR on".
|
|
132
|
+
*/
|
|
133
|
+
function hasRevalidate(r) {
|
|
134
|
+
if (r == null) return false;
|
|
135
|
+
if (typeof r === "number") return r > 0;
|
|
136
|
+
if (typeof r === "object") return Object.keys(r).length > 0;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Merge `routing.revalidate` with per-page `export const revalidate` rules into
|
|
141
|
+
* the flat fallback map baked into managed and native builds. With page rules,
|
|
142
|
+
* page entries come first and a number config becomes the `*` fallback. At
|
|
143
|
+
* runtime, page requests use the `collectPages()` table instead.
|
|
144
|
+
*/
|
|
145
|
+
function collectRevalidate(config, pageScan) {
|
|
146
|
+
if (config.routing?.isr === false) return;
|
|
147
|
+
const vcRevalidate = config.routing?.revalidate;
|
|
148
|
+
let revalidate;
|
|
149
|
+
if (vcRevalidate != null) revalidate = vcRevalidate;
|
|
150
|
+
if (pageScan) {
|
|
151
|
+
const perPageRules = {};
|
|
152
|
+
for (const page of pageScan.pages) if (page.revalidate != null) {
|
|
153
|
+
const key = page.pattern.replace(/:[A-Za-z0-9_]+\{[^}]*\}/g, "*");
|
|
154
|
+
perPageRules[key] = page.revalidate;
|
|
155
|
+
}
|
|
156
|
+
if (Object.keys(perPageRules).length > 0) {
|
|
157
|
+
if (typeof revalidate === "number") {
|
|
158
|
+
if (!Object.hasOwn(perPageRules, "*")) perPageRules["*"] = revalidate;
|
|
159
|
+
revalidate = perPageRules;
|
|
160
|
+
} else if (typeof revalidate === "object") revalidate = Object.fromEntries([...Object.entries(perPageRules), ...Object.entries(revalidate).filter(([pattern]) => !Object.hasOwn(perPageRules, pattern))]);
|
|
161
|
+
else revalidate = perPageRules;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return revalidate;
|
|
165
|
+
}
|
|
166
|
+
/** A page export wins, then a number config; an object config (or none) gives `undefined`. */
|
|
167
|
+
function resolvePageBuildTtl(page, revalidateConfig) {
|
|
168
|
+
if (page.revalidate != null) return page.revalidate > 0 ? page.revalidate : 0;
|
|
169
|
+
if (typeof revalidateConfig === "number") return revalidateConfig > 0 ? revalidateConfig : 0;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Build the ordered page table shipped in the deploy manifest as `pages`, in
|
|
173
|
+
* `pageScan.pages` order with raw patterns (catch-alls are not collapsed).
|
|
174
|
+
*
|
|
175
|
+
* Each entry's `revalidate` has three states: N > 0 turns ISR on, 0 is an
|
|
176
|
+
* explicit opt-out, and absent lets dispatch resolve the per-path object config
|
|
177
|
+
* (`manifest.pathRevalidate`) against the request path. Object configs are not
|
|
178
|
+
* baked because one dynamic page can span several entries, including a 0.
|
|
179
|
+
*
|
|
180
|
+
* Built from pages only, so a catch-all page TTL can also cache a non-`/api`
|
|
181
|
+
* `routes/` handler at dispatch (bounded by `shouldBypassIsr` and `isApiPath`).
|
|
182
|
+
*/
|
|
183
|
+
function collectPages(pageScan, revalidateConfig, isrEnabled = true) {
|
|
184
|
+
if (!pageScan || pageScan.pages.length === 0) return;
|
|
185
|
+
return pageScan.pages.map((page) => {
|
|
186
|
+
const ttl = isrEnabled ? resolvePageBuildTtl(page, revalidateConfig) : void 0;
|
|
187
|
+
return ttl === void 0 ? { pattern: page.pattern } : {
|
|
188
|
+
pattern: page.pattern,
|
|
189
|
+
revalidate: ttl
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { resolveDistDir as a, hasApiRoutes as c, resolveAssetRoutingPolicy as d, collectFiles as i, hasDocumentRoutes as l, collectRevalidate as n, resolveWorkerDirName as o, hasRevalidate as r, generateQueueResolverSource as s, collectPages as t, resolveAssetConfig as u };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getToken, s as getSiteDomain } from "./auth-
|
|
1
|
+
import { r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken, s as getSiteDomain } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log, O as cancel } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
6
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
7
|
-
import {
|
|
4
|
+
import { f as import_picocolors, m as printSuccess } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-D4APeBwX.mjs";
|
|
7
|
+
import { a as resolveProjectBySlug } from "./resolve-project-C_Cu7E8a.mjs";
|
|
8
8
|
//#region src/cli/link.ts
|
|
9
9
|
function projectLabel(slug, root, url) {
|
|
10
10
|
if (url) return url;
|
|
@@ -32,7 +32,7 @@ async function runLink(root, slug) {
|
|
|
32
32
|
cancel(`project: No project found with slug '${slug}'.`);
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
|
35
|
-
const config = attachSelectedPlatform(
|
|
35
|
+
const config = attachSelectedPlatform(resolved, client.apiUrl);
|
|
36
36
|
writeProjectConfig(root, config);
|
|
37
37
|
printSuccess(`Linked to ${projectLabel(config.slug, root, projects.find((project) => project.id === config.projectId)?.url)}`);
|
|
38
38
|
return;
|
|
@@ -43,7 +43,7 @@ async function runLink(root, slug) {
|
|
|
43
43
|
printSuccess(`Created and linked to ${projectLabel(config.slug, root)}`);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
writeProjectConfig(root, attachSelectedPlatform(
|
|
46
|
+
writeProjectConfig(root, attachSelectedPlatform({
|
|
47
47
|
projectId: result.project.id,
|
|
48
48
|
slug: result.project.slug
|
|
49
49
|
}, client.apiUrl));
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { H as outro, L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
6
|
-
import {
|
|
4
|
+
import { _ as tablePrefix, c as formatRelativeTime, f as import_picocolors, h as sanitizeTerminalText, i as dim, o as formatCount } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
+
import { a as resolveProjectBySlug } from "./resolve-project-C_Cu7E8a.mjs";
|
|
7
7
|
//#region src/cli/list.ts
|
|
8
8
|
async function runListCommand(root, slug) {
|
|
9
9
|
console.log();
|
|
@@ -42,7 +42,7 @@ async function runListCommand(root, slug) {
|
|
|
42
42
|
}
|
|
43
43
|
async function showCloudflareDeployments(root, slug) {
|
|
44
44
|
if (slug) throw new Error("project: A project name selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
45
|
-
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
45
|
+
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
|
|
46
46
|
const status = await readCloudflareWorkerStatus(resolveCloudflareOperationContext(root));
|
|
47
47
|
if (status.versions.length === 0) {
|
|
48
48
|
outro(`No deployments for ${status.workerName}.`);
|
|
@@ -131,16 +131,5 @@ function formatDeploymentRow(d, activeDeploymentId) {
|
|
|
131
131
|
deployed
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function formatRelativeTime(iso) {
|
|
135
|
-
const diffMs = Date.now() - new Date(ensureUtc(iso)).getTime();
|
|
136
|
-
if (diffMs < 0) return "just now";
|
|
137
|
-
const seconds = Math.floor(diffMs / 1e3);
|
|
138
|
-
if (seconds < 60) return "just now";
|
|
139
|
-
const minutes = Math.floor(seconds / 60);
|
|
140
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
141
|
-
const hours = Math.floor(minutes / 60);
|
|
142
|
-
if (hours < 24) return `${hours}h ago`;
|
|
143
|
-
return `${Math.floor(hours / 24)}d ago`;
|
|
144
|
-
}
|
|
145
134
|
//#endregion
|
|
146
135
|
export { runListCommand };
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as bytesToBase64 } from "./base64-DVrOndmI.mjs";
|
|
2
|
+
import { a as getRawRuntimeEnv } from "./env-raw-Cklzcde3.mjs";
|
|
2
3
|
import { i as getUser } from "./auth-3sGB0zJ1.mjs";
|
|
4
|
+
//#region src/runtime/live-names.ts
|
|
5
|
+
async function topicDigest(streamId, topic) {
|
|
6
|
+
const bytes = new TextEncoder().encode(`${streamId}\u0000${topic}`);
|
|
7
|
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
8
|
+
return bytesToBase64(new Uint8Array(digest)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
9
|
+
}
|
|
10
|
+
function connectionInstanceName(streamId, connectionId) {
|
|
11
|
+
return `live:${streamId}:connection:${connectionId}`;
|
|
12
|
+
}
|
|
13
|
+
function topicInstanceName(streamId, topicKey) {
|
|
14
|
+
return `live:${streamId}:topic:${topicKey}`;
|
|
15
|
+
}
|
|
16
|
+
function internalUrl(path) {
|
|
17
|
+
return `https://void.live${path}`;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
3
20
|
//#region src/runtime/live.ts
|
|
4
21
|
let liveBindingName = "VOID_LIVE";
|
|
5
22
|
let liveDev = false;
|
|
@@ -350,21 +367,6 @@ function assertJsonSerializable(value) {
|
|
|
350
367
|
throw new Error(`live: payload must be JSON-serializable. ${error instanceof Error ? error.message : String(error)}`);
|
|
351
368
|
}
|
|
352
369
|
}
|
|
353
|
-
async function topicDigest(streamId, topic) {
|
|
354
|
-
const bytes = new TextEncoder().encode(`${streamId}\u0000${topic}`);
|
|
355
|
-
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
356
|
-
const binary = String.fromCharCode(...new Uint8Array(digest));
|
|
357
|
-
return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
358
|
-
}
|
|
359
|
-
function connectionInstanceName(streamId, connectionId) {
|
|
360
|
-
return `live:${streamId}:connection:${connectionId}`;
|
|
361
|
-
}
|
|
362
|
-
function topicInstanceName(streamId, topicKey) {
|
|
363
|
-
return `live:${streamId}:topic:${topicKey}`;
|
|
364
|
-
}
|
|
365
|
-
function internalUrl(path) {
|
|
366
|
-
return `https://void.live${path}`;
|
|
367
|
-
}
|
|
368
370
|
var LiveResponseError = class extends Error {
|
|
369
371
|
code;
|
|
370
372
|
status;
|
|
@@ -407,4 +409,4 @@ async function responseToControlError(response) {
|
|
|
407
409
|
};
|
|
408
410
|
}
|
|
409
411
|
//#endregion
|
|
410
|
-
export { defineLiveStream as i, __setLiveBindingName as n, __setLiveDev as r, __getLiveBindingName as t };
|
|
412
|
+
export { connectionInstanceName as a, topicInstanceName as c, defineLiveStream as i, __setLiveBindingName as n, internalUrl as o, __setLiveDev as r, topicDigest as s, __getLiveBindingName as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as AuthUser } from "./auth-DkcFflXV.mjs";
|
|
2
|
-
import { a as CloudEnv, r as CloudContext } from "./handler-
|
|
2
|
+
import { a as CloudEnv, r as CloudContext } from "./handler-_PqY82xe.mjs";
|
|
3
3
|
//#region src/runtime/live.d.ts
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type LiveControlRequest = {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
//#region src/host/load-user-env.ts
|
|
3
|
+
/**
|
|
4
|
+
* Loader for the user's `env.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Uses Node's native `import()` (type-stripping is on by default in the
|
|
7
|
+
* supported Node version), so only relative imports and bare package
|
|
8
|
+
* specifiers resolve. tsconfig path aliases (`@/foo`, `~/foo`) are NOT
|
|
9
|
+
* supported — if the user writes one, we detect the resulting resolution
|
|
10
|
+
* error and re-throw with guidance pointing at the offending specifier.
|
|
11
|
+
*
|
|
12
|
+
* Side-effect contract: loading the file evaluates the user's `defineEnv`
|
|
13
|
+
* call, which registers the schema in the singleton state in
|
|
14
|
+
* `runtime/env-public.ts`. Callers read the result from there.
|
|
15
|
+
*
|
|
16
|
+
* Node-only (lives under `host/`). Must not be imported from anything
|
|
17
|
+
* that ships in worker bundles.
|
|
18
|
+
*/
|
|
19
|
+
let loadCounter = 0;
|
|
20
|
+
/** Returns the failed specifier from a Node module-resolution error, or `null`. */
|
|
21
|
+
function extractFailedSpecifier(err) {
|
|
22
|
+
if (!(err instanceof Error)) return null;
|
|
23
|
+
const code = err.code;
|
|
24
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "ERR_PACKAGE_PATH_NOT_EXPORTED") return null;
|
|
25
|
+
const match = /Cannot find (?:package|module) '([^']+)'/.exec(err.message);
|
|
26
|
+
return match ? match[1] ?? null : null;
|
|
27
|
+
}
|
|
28
|
+
/** A specifier is alias-shaped if it isn't relative, absolute, a node: URL, or a valid bare package name. */
|
|
29
|
+
function looksLikeAlias(specifier) {
|
|
30
|
+
if (specifier.startsWith("./") || specifier.startsWith("../") || specifier.startsWith("/") || specifier.startsWith("node:") || specifier.startsWith("file:")) return false;
|
|
31
|
+
if (specifier.startsWith("@")) return !/^@[^/]+\/[^/]+/.test(specifier);
|
|
32
|
+
return specifier.startsWith("~") || specifier.startsWith("#");
|
|
33
|
+
}
|
|
34
|
+
async function loadUserEnvFile(envFile) {
|
|
35
|
+
const url = pathToFileURL(envFile).href + `?t=${Date.now()}-${++loadCounter}`;
|
|
36
|
+
try {
|
|
37
|
+
await import(
|
|
38
|
+
/* @vite-ignore */
|
|
39
|
+
url
|
|
40
|
+
);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
const specifier = extractFailedSpecifier(err);
|
|
43
|
+
const base = `env: Failed to load '${envFile}': '${err.message}'.`;
|
|
44
|
+
if (specifier && looksLikeAlias(specifier)) throw new Error(`${base}\n\nHint: '${specifier}' looks like a tsconfig path alias. env.ts is loaded directly by Node and does not resolve tsconfig "paths" — use a relative import (e.g. "./shared/...") instead.`);
|
|
45
|
+
throw new Error(base);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { loadUserEnvFile as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as join,
|
|
2
|
-
import { b as readRootWranglerConfig } from "./wrangler-
|
|
3
|
-
import { r as getMiniflareDatabasePath } from "./runner-
|
|
1
|
+
import { a as join, c as resolve, i as isAbsolute } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { b as readRootWranglerConfig } from "./wrangler-BYs07Rxy.mjs";
|
|
3
|
+
import { r as getMiniflareDatabasePath } from "./runner-DcVDrzuR.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/local-d1.ts
|
|
@@ -17,8 +17,8 @@ function readConfiguredDatabaseId(root, bindingName) {
|
|
|
17
17
|
let rootConfig;
|
|
18
18
|
try {
|
|
19
19
|
rootConfig = readRootWranglerConfig(root);
|
|
20
|
-
} catch {
|
|
21
|
-
throw new Error(`db: cannot read malformed Wrangler configuration in ${root}
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw new Error(`db: cannot read malformed Wrangler configuration in ${root}.`, { cause: error });
|
|
22
22
|
}
|
|
23
23
|
if (!rootConfig) return;
|
|
24
24
|
const { configPath, config } = rootConfig;
|
|
@@ -26,7 +26,7 @@ function readConfiguredDatabaseId(root, bindingName) {
|
|
|
26
26
|
if (rawDatabases === void 0) return;
|
|
27
27
|
if (!Array.isArray(rawDatabases)) throw new Error(`db: cannot read ${configPath}: "d1_databases" must be an array.`);
|
|
28
28
|
if (rawDatabases.some((entry) => entry === null || typeof entry !== "object" || Array.isArray(entry) || typeof entry.binding !== "string" || entry.binding === "")) throw new Error(`db: cannot read ${configPath}: every "d1_databases" entry needs a non-empty binding.`);
|
|
29
|
-
const matches = rawDatabases.filter((entry) => entry
|
|
29
|
+
const matches = rawDatabases.filter((entry) => entry.binding === bindingName);
|
|
30
30
|
if (matches.length > 1) throw new Error(`db: cannot select local D1 database: binding ${JSON.stringify(bindingName)} is declared ${matches.length} times in ${configPath}.`);
|
|
31
31
|
const match = matches[0];
|
|
32
32
|
if (!match) return;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as getApiUrl, c as getToken, f as removeToken,
|
|
1
|
+
import { a as getApiUrl, c as getToken, f as removeToken, l as getTokenSource, m as savePlatformToken, p as runPlatformLogin } from "./auth-B6iOCjKI.mjs";
|
|
2
2
|
import { H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-
|
|
3
|
+
import { f as import_picocolors, l as formatUrl, m as printSuccess, r as createSpinner } from "./output-FNHKw5Ac.mjs";
|
|
4
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
5
5
|
//#region src/cli/login.ts
|
|
6
6
|
async function selectPlatformLoginMethod(platform, requestedId) {
|
|
7
|
-
const providers = platform
|
|
8
|
-
const methods = platform
|
|
7
|
+
const providers = platform.authenticationProviders;
|
|
8
|
+
const methods = platform.authentication?.methods ?? providers.map((id) => ({
|
|
9
9
|
id,
|
|
10
10
|
label: id === "github" ? "GitHub" : id === "google" ? "Google" : id
|
|
11
11
|
}));
|
|
12
|
-
if (providers.length === 0) throw new Error(platform
|
|
12
|
+
if (providers.length === 0) throw new Error(platform.authentication?.setupPending ? "auth: The platform administrator must finish initial setup." : "auth: This platform has no login providers.");
|
|
13
13
|
if (requestedId) {
|
|
14
14
|
const selected = methods.find((method) => method.id === requestedId);
|
|
15
15
|
if (!selected) throw new Error(`auth: Login method ${requestedId} is not enabled on this platform.`);
|
|
@@ -29,16 +29,16 @@ async function selectPlatformLoginMethod(platform, requestedId) {
|
|
|
29
29
|
return methods.find((method) => method.id === provider);
|
|
30
30
|
}
|
|
31
31
|
async function promptForLoginToken(root = process.cwd(), platform) {
|
|
32
|
-
const
|
|
32
|
+
const apiUrl = platform?.apiUrl ?? getApiUrl(root);
|
|
33
|
+
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await (await import("./platform-cmd-Cuj4oUVo.mjs")).discoverPlatform(apiUrl));
|
|
33
34
|
const s = createSpinner();
|
|
34
35
|
s.start(`Opening browser for ${providerName} login...`);
|
|
35
36
|
try {
|
|
36
37
|
const onUrl = (url) => {
|
|
37
|
-
s.message(`Waiting for ${providerName} login. If your browser didn't open, visit:\n${import_picocolors.default.blue(url)}`);
|
|
38
|
+
s.message(`Waiting for ${providerName} login. If your browser didn't open, visit:\n${import_picocolors.default.blue(formatUrl(url))}`);
|
|
38
39
|
};
|
|
39
|
-
const token =
|
|
40
|
-
|
|
41
|
-
else saveToken(token, root);
|
|
40
|
+
const token = await runPlatformLogin(apiUrl, provider, onUrl);
|
|
41
|
+
savePlatformToken(token, apiUrl);
|
|
42
42
|
s.stop("Logged in!");
|
|
43
43
|
return token;
|
|
44
44
|
} catch (err) {
|
|
@@ -1,15 +1,15 @@
|
|
|
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 { $ as wrapTextWithPrefix, H as outro, L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { a as errorStackFrames, f as import_picocolors, i as dim, o as formatCount } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
6
|
import { t as sanitizeTerminalLogText } from "./terminal-log-text-D9ACPOuG.mjs";
|
|
7
7
|
//#region src/cli/logs.ts
|
|
8
8
|
async function runLogsCommand(root, filter, range, deployment, level) {
|
|
9
9
|
console.log();
|
|
10
10
|
const platform = readDeploymentPlatform(root);
|
|
11
11
|
if (platform === "cloudflare") {
|
|
12
|
-
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-
|
|
12
|
+
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
|
|
13
13
|
if (range !== "1h") log.warn("Cloudflare tail streams live logs; --range does not select historical entries.");
|
|
14
14
|
if (level && level !== "all" && level !== "error") log.warn("Cloudflare tail cannot filter individual console levels; showing all invocation logs.");
|
|
15
15
|
await tailCloudflareWorker(resolveCloudflareOperationContext(root), {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { a as join, n as dirname } from "./dist-
|
|
2
|
-
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
1
|
+
import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-DMvEeSau.mjs";
|
|
3
|
+
import { p as validateConfig } from "./config-Bx_1SpnO.mjs";
|
|
4
|
+
import { t as parseJsoncObject } from "./generated-wrangler-config-DeWj5F9Y.mjs";
|
|
5
|
+
import { n as VOID_LOCK_FILE, o as seedCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-DV60XFFK.mjs";
|
|
6
|
+
import "./wrangler-BYs07Rxy.mjs";
|
|
6
7
|
import { L as log } from "./dist-D3m88sjf.mjs";
|
|
7
|
-
import {
|
|
8
|
+
import { m as printSuccess } from "./output-FNHKw5Ac.mjs";
|
|
8
9
|
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
10
|
import { parseSync } from "vite";
|
|
10
11
|
import { randomUUID } from "node:crypto";
|
|
11
|
-
import { parse, parseTree } from "jsonc-parser";
|
|
12
12
|
import { isDeepStrictEqual } from "node:util";
|
|
13
|
+
import { parseTree } from "jsonc-parser";
|
|
13
14
|
//#region src/cli/framework-config-migrate.ts
|
|
14
15
|
const GENERATED_PATH = "./.void-wrangler.jsonc";
|
|
15
16
|
const CONFIG_FILES = [
|
|
@@ -197,16 +198,66 @@ function migrateFrameworkAdapterPaths(root) {
|
|
|
197
198
|
return applyFrameworkConfigMigration(root, planFrameworkConfigMigration(root));
|
|
198
199
|
}
|
|
199
200
|
//#endregion
|
|
201
|
+
//#region src/config-write.ts
|
|
202
|
+
const GENERATED_MARKERS = [
|
|
203
|
+
"// Generated by void migrate.",
|
|
204
|
+
"// Generated from void.json by void migrate.",
|
|
205
|
+
"// Generated by void init."
|
|
206
|
+
];
|
|
207
|
+
function renderVoidConfig(config, marker = GENERATED_MARKERS[0]) {
|
|
208
|
+
return `${marker}\nimport { defineConfig } from 'void/config';\n\nexport default defineConfig(${JSON.stringify(config, null, 2)});\n`;
|
|
209
|
+
}
|
|
210
|
+
function isStaticValue(node) {
|
|
211
|
+
if (!node) return false;
|
|
212
|
+
if (node.type === "Literal") return node.value === null || [
|
|
213
|
+
"string",
|
|
214
|
+
"number",
|
|
215
|
+
"boolean"
|
|
216
|
+
].includes(typeof node.value);
|
|
217
|
+
if (node.type === "UnaryExpression") return node.operator === "-" && node.argument?.type === "Literal" && typeof node.argument.value === "number";
|
|
218
|
+
if (node.type === "ArrayExpression") return node.elements?.every(isStaticValue) ?? false;
|
|
219
|
+
if (node.type !== "ObjectExpression") return false;
|
|
220
|
+
return node.properties?.every((property) => property.type === "Property" && property.kind === "init" && !property.computed && !property.method && (property.key?.type === "Identifier" || property.key?.type === "Literal") && isStaticValue(property.value)) ?? false;
|
|
221
|
+
}
|
|
222
|
+
function isGeneratedStaticConfig(source) {
|
|
223
|
+
if (!GENERATED_MARKERS.some((marker) => source.startsWith(marker))) return false;
|
|
224
|
+
let program;
|
|
225
|
+
try {
|
|
226
|
+
const parsed = parseSync(TYPED_CONFIG_FILE, source, {
|
|
227
|
+
lang: "js",
|
|
228
|
+
sourceType: "module",
|
|
229
|
+
preserveParens: false,
|
|
230
|
+
showSemanticErrors: true
|
|
231
|
+
});
|
|
232
|
+
if (parsed.errors.length > 0 || parsed.comments.length !== 1 || !GENERATED_MARKERS.includes(`// ${parsed.comments[0]?.value.trim()}`)) return false;
|
|
233
|
+
program = parsed.program;
|
|
234
|
+
} catch {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
const [importDeclaration, exportDeclaration] = program.body ?? [];
|
|
238
|
+
const call = exportDeclaration?.declaration;
|
|
239
|
+
return program.body?.length === 2 && importDeclaration?.type === "ImportDeclaration" && importDeclaration.source?.value === "void/config" && importDeclaration.specifiers?.length === 1 && importDeclaration.specifiers[0]?.imported?.name === "defineConfig" && importDeclaration.specifiers[0]?.local?.name === "defineConfig" && exportDeclaration?.type === "ExportDefaultDeclaration" && call?.type === "CallExpression" && call.callee?.name === "defineConfig" && call.arguments?.length === 1 && isStaticValue(call.arguments[0]);
|
|
240
|
+
}
|
|
241
|
+
function canRewriteVoidProjectConfig(root) {
|
|
242
|
+
const path = join(root, TYPED_CONFIG_FILE);
|
|
243
|
+
return !existsSync(path) || isGeneratedStaticConfig(readFileSync(path, "utf8"));
|
|
244
|
+
}
|
|
245
|
+
/** Update CLI-owned static config without silently rewriting authored TypeScript. */
|
|
246
|
+
function writeVoidProjectConfig(root, config) {
|
|
247
|
+
validateConfig(config, TYPED_CONFIG_FILE);
|
|
248
|
+
const path = join(root, TYPED_CONFIG_FILE);
|
|
249
|
+
if (existsSync(path)) {
|
|
250
|
+
if (!isGeneratedStaticConfig(readFileSync(path, "utf8"))) throw new Error(`config: ${TYPED_CONFIG_FILE} contains authored TypeScript or comments. Update it directly and rerun the command.`);
|
|
251
|
+
validateConfig(loadTypedVoidConfigFile(path), TYPED_CONFIG_FILE);
|
|
252
|
+
}
|
|
253
|
+
writeFileSync(path, renderVoidConfig(config, "// Generated by void init."));
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
200
256
|
//#region src/cli/migrate.ts
|
|
201
257
|
const LEGACY_FILE = "void.json";
|
|
202
|
-
const GENERATED_MARKER = "// Generated by void migrate.";
|
|
203
|
-
const OLD_GENERATED_MARKER = "// Generated from void.json by void migrate.";
|
|
204
|
-
const INIT_GENERATED_MARKER = "// Generated by void init.";
|
|
205
258
|
function parseWranglerJsonc(path, raw) {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const parsed = parse(source, errors, { allowTrailingComma: true });
|
|
209
|
-
if (errors.length > 0 || typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`migrate: Invalid JSON/JSONC in ${path}. Fix it before migrating.`);
|
|
259
|
+
const parsed = parseJsoncObject(raw);
|
|
260
|
+
if (!parsed) throw new Error(`migrate: Invalid JSON/JSONC in ${path}. Fix it before migrating.`);
|
|
210
261
|
function assertUnique(node) {
|
|
211
262
|
if (!node) return;
|
|
212
263
|
if (node.type === "object") {
|
|
@@ -219,7 +270,7 @@ function parseWranglerJsonc(path, raw) {
|
|
|
219
270
|
}
|
|
220
271
|
} else for (const child of node.children ?? []) assertUnique(child);
|
|
221
272
|
}
|
|
222
|
-
assertUnique(parseTree(
|
|
273
|
+
assertUnique(parseTree(raw.replace(/^\uFEFF/, "")));
|
|
223
274
|
return parsed;
|
|
224
275
|
}
|
|
225
276
|
function backup(root, name, content) {
|
|
@@ -228,9 +279,6 @@ function backup(root, name, content) {
|
|
|
228
279
|
const path = join(dir, name);
|
|
229
280
|
if (!existsSync(path)) writeFileSync(path, content, { flag: "wx" });
|
|
230
281
|
}
|
|
231
|
-
function generatedSource(config) {
|
|
232
|
-
return `${GENERATED_MARKER}\nimport { defineConfig } from 'void/config';\n\nexport default defineConfig(${JSON.stringify(config, null, 2)});\n`;
|
|
233
|
-
}
|
|
234
282
|
function isOrphanedCompatibilityConfig(root, legacy, typed) {
|
|
235
283
|
if (!isDeepStrictEqual(legacy, { worker: { compatibility_date: "2026-02-24" } })) return false;
|
|
236
284
|
const backupPath = join(root, ".void", "config-migration", LEGACY_FILE);
|
|
@@ -280,7 +328,7 @@ function migrateLegacyVoidConfig(root) {
|
|
|
280
328
|
let current;
|
|
281
329
|
if (hadTyped) {
|
|
282
330
|
const existing = readFileSync(typedPath, "utf8");
|
|
283
|
-
if (!
|
|
331
|
+
if (!GENERATED_MARKERS.some((marker) => existing.startsWith(marker))) throw new Error(`migrate: ${TYPED_CONFIG_FILE} already exists. Move the legacy settings into it before deleting the old files.`);
|
|
284
332
|
current = validateConfig(loadTypedVoidConfigFile(typedPath), TYPED_CONFIG_FILE);
|
|
285
333
|
const currentVoid = { ...current };
|
|
286
334
|
delete currentVoid.cloudflare;
|
|
@@ -291,7 +339,7 @@ function migrateLegacyVoidConfig(root) {
|
|
|
291
339
|
if (cloudflare) next.cloudflare = cloudflare;
|
|
292
340
|
const needsTypedWrite = !hadTyped || !isDeepStrictEqual(current, next);
|
|
293
341
|
const temporaryPath = join(root, `.void.config.${randomUUID()}.ts`);
|
|
294
|
-
if (needsTypedWrite) writeFileSync(temporaryPath,
|
|
342
|
+
if (needsTypedWrite) writeFileSync(temporaryPath, renderVoidConfig(next), { flag: "wx" });
|
|
295
343
|
try {
|
|
296
344
|
if (needsTypedWrite) {
|
|
297
345
|
const loaded = loadTypedVoidConfigFile(temporaryPath);
|
|
@@ -320,4 +368,4 @@ async function runMigrateCommand(root) {
|
|
|
320
368
|
} else log.info("No legacy project configuration found.");
|
|
321
369
|
}
|
|
322
370
|
//#endregion
|
|
323
|
-
export {
|
|
371
|
+
export { discoverFrameworkWranglerFiles as a, writeVoidProjectConfig as i, runMigrateCommand as n, migrateFrameworkAdapterPaths as o, canRewriteVoidProjectConfig as r, migrateLegacyVoidConfig as t };
|