void 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-cmd-DRhmCWcm.mjs → account-cmd-BfkJ_1PC.mjs} +6 -6
- package/dist/{application-analysis-HRFsZOv3.mjs → application-analysis-OV0CBJ80.mjs} +8 -19
- package/dist/{application-routing-P4TggvWp.mjs → application-routing-QpyC5G8z.mjs} +2 -1
- package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
- package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
- package/dist/{auth-CH4PLAX1.d.mts → auth-CZrthGxs.d.mts} +8 -1
- package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
- package/dist/{auth-link-CVXP1G6G.mjs → auth-link-CW1Zh6FM.mjs} +6 -6
- package/dist/{auth-router-D1pGdbvB.mjs → auth-router-CNBKnEZi.mjs} +3 -3
- package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-C-0uZg8-.d.mts} +1 -1
- package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
- package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-C9qOKW9W.mjs} +5 -5
- package/dist/{cache-2khBO1MR.mjs → cache-DVBBbWQL.mjs} +5 -5
- package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-COavnjud.mjs} +4 -4
- package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
- package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
- package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
- package/dist/cli/cli.mjs +68 -1868
- package/dist/cli/cloudflare-operation-process.mjs +10 -8
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/cli-main-DFteHrJI.mjs +1889 -0
- package/dist/client-BAxLpSKv.mjs +1 -0
- package/dist/{client-CoxPEhJq.mjs → client-BEZmTP6p.mjs} +10 -4
- package/dist/{cloudflare-auth-CEu-1Ps_.mjs → cloudflare-auth-DGIivpTb.mjs} +1 -1
- package/dist/{cloudflare-cmd-fZ6AMSWk.mjs → cloudflare-cmd-DJaxC-bc.mjs} +5 -5
- package/dist/{cloudflare-config-eQunqX6A.mjs → cloudflare-config-DtOGAbeB.mjs} +3 -3
- package/dist/{cloudflare-connect-9OZe4XVQ.mjs → cloudflare-connect-BjpWmglw.mjs} +3 -3
- package/dist/{cloudflare-operations-oLvAd9Nd.mjs → cloudflare-operations-CZkjFrzH.mjs} +1 -1
- package/dist/{cloudflare-operations-CrskD4_O.mjs → cloudflare-operations-k7wYUv56.mjs} +6 -6
- package/dist/{cloudflare-process-DjJ638A-.mjs → cloudflare-process-BcPvlMFd.mjs} +3 -3
- package/dist/{config-BITKQ3O6.mjs → config-5oSQhZNj.mjs} +7 -5
- package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
- package/dist/{config-BBlVXZCU.mjs → config-DcqUBGCb.mjs} +3 -3
- package/dist/{config-WlvEcL82.mjs → config-eeDzKBS9.mjs} +2 -2
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-BgysUhnm.mjs → config-wo2EaH0X.mjs} +1 -1
- package/dist/{connect-CKvmkl2R.mjs → connect-j1F1C_rW.mjs} +7 -7
- package/dist/{create-project-Bq0M8MtO.mjs → create-project-CE3jOmd5.mjs} +5 -5
- package/dist/{create-project-BiMmR5wA.mjs → create-project-DZH3aYGQ.mjs} +1 -1
- package/dist/{db-DjtGAcOz.mjs → db-DyLzzxvM.mjs} +39 -39
- package/dist/{db-types-C_8amnB0.mjs → db-types-DdHHUVPy.mjs} +1 -1
- package/dist/{delete-CY4L8fi2.mjs → delete-Dey6YoMA.mjs} +5 -5
- package/dist/{deploy-D_gEojD2.mjs → deploy-Ccw2D2lw.mjs} +507 -122
- package/dist/deploy-DEZkUS77.mjs +2 -0
- package/dist/{deploy-managed-static-BHVbB_-A.mjs → deploy-managed-static-BBVtpuGv.mjs} +18 -18
- package/dist/{deploy-transport-DEyOUfac.mjs → deploy-transport-Dt0IvSVW.mjs} +2 -2
- package/dist/deploy.mjs +8 -8
- package/dist/discover-1DJD4YXD.mjs +1 -0
- package/dist/{discover-Dhkzxgdt.mjs → discover-CVFCWU7W.mjs} +1 -1
- package/dist/{dispatch-BNLB5_Gm.mjs → dispatch-pYaww76u.mjs} +6 -6
- package/dist/{dist-D23AAMxT.mjs → dist-BQdgCVQF.mjs} +1 -1
- package/dist/{dist-eV_Ep60B.mjs → dist-DeTdhbZc.mjs} +1 -1
- package/dist/{domain-BlH90Ods.mjs → domain-Dh3mG8Vs.mjs} +6 -6
- package/dist/{email-Bkq8ZL1p.mjs → email-DKyMjOYM.mjs} +11 -11
- package/dist/{email-cloudflare-MvJIxrwx.mjs → email-cloudflare-CTt2n_W2.mjs} +13 -9
- package/dist/{entry-CBZsCy3O.mjs → entry-Bw-G1VVx.mjs} +2 -2
- package/dist/{env-AvuCSeCH.mjs → env-DkZzh_Dd.mjs} +7 -7
- package/dist/env-mask-D31Qztl9.mjs +46 -0
- package/dist/{env-types-DqzVBKnS.mjs → env-types-Dz9qkiOn.mjs} +1 -1
- package/dist/{env-validation-GV1oD4EV.mjs → env-validation-1snjKtDX.mjs} +4 -4
- package/dist/{env-validation-C8Cmvas0.mjs → env-validation-C8NL3lEH.mjs} +1 -1
- package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
- package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
- package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
- package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
- package/dist/{gen-B9bCV5qu.mjs → gen-BZmFOGDQ.mjs} +7 -7
- package/dist/gen-C6iknRdI.mjs +1 -0
- package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-7Oky9qgH.mjs} +6 -6
- package/dist/{handler-CKeTtYID.mjs → handler-C9SnmeW1.mjs} +6 -5
- package/dist/{handler-BR6Tvjkp.d.mts → handler-DjqciiDc.d.mts} +20 -7
- package/dist/{headers-CuTEdP9C.mjs → headers-CimYIfQI.mjs} +1 -1
- package/dist/{help-1OCFDsRr.mjs → help-CNuUb47C.mjs} +7 -3
- package/dist/help-C_cqTByy.mjs +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +155 -110
- package/dist/{info-CJxua_db.mjs → info-DwB8IWIx.mjs} +4 -4
- package/dist/{init-B-4CluYx.mjs → init-CUGSmcED.mjs} +34 -32
- package/dist/{link-DAXOT-G_.mjs → link-BlRTGHan.mjs} +6 -6
- package/dist/{list-BYSOo9fm.mjs → list-iCg7d5Pa.mjs} +7 -7
- package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
- package/dist/{live-0xrcVpyq.d.mts → live-zKGbRT4h.d.mts} +2 -2
- package/dist/{local-d1-BLgsNUj9.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
- package/dist/login-C4q1S-5b.mjs +1 -0
- package/dist/{login-CJopTWX4.mjs → login-TA51e5Fw.mjs} +5 -5
- package/dist/{logs-DE0weBsR.mjs → logs-BlyAxlvx.mjs} +6 -6
- package/dist/{migrate-ChHHZBTi.mjs → migrate-BH6LCr00.mjs} +6 -6
- package/dist/migrate-CVBsSFhC.mjs +1 -0
- package/dist/nitro.d.mts +5 -0
- package/dist/nitro.mjs +27 -8
- package/dist/{node-CZ6lGNLn.mjs → node-B0otYjDv.mjs} +4 -4
- package/dist/{operator-args-D79WQP70.mjs → operator-args-DuKAQ3Ks.mjs} +1 -1
- package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
- package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
- package/dist/{operator-cmd-BUqsdk2K.mjs → operator-cmd-CoHlJjcT.mjs} +7 -7
- package/dist/operator-cmd-DnaCnCSP.mjs +1 -0
- package/dist/output-CNsMDEd2.mjs +1 -0
- package/dist/{output-BCdLioKP.mjs → output-CXJTIAtF.mjs} +1 -1
- package/dist/pages/client.d.mts +18 -13
- package/dist/pages/client.mjs +40 -69
- package/dist/pages/index.d.mts +4 -3
- package/dist/pages/index.mjs +11 -7
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.d.mts +2 -2
- package/dist/pages/serialize.mjs +1 -1
- package/dist/platform-args-B7-wQ0_B.mjs +1 -0
- package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-DfT8yQBF.mjs} +1 -1
- package/dist/{platform-auth-config-K4m_LE8b.mjs → platform-auth-config-MO0VdVs9.mjs} +10 -10
- package/dist/{platform-auth-protection-KF5Vo-1I.mjs → platform-auth-protection-Dv208eyL.mjs} +8 -8
- package/dist/{platform-auth-recovery-BOdFrl7R.mjs → platform-auth-recovery-DvAQ674F.mjs} +7 -7
- package/dist/{platform-cmd-DpCHawGF.mjs → platform-cmd-BpUA19r_.mjs} +1 -1
- package/dist/{platform-cmd-Ds3EAV5t.mjs → platform-cmd-dlSxrcQ7.mjs} +9 -9
- package/dist/{platform-domain-rWJshybd.mjs → platform-domain-DSO4eUEw.mjs} +5 -5
- package/dist/{platform-lifecycle-D9RdGub1.mjs → platform-lifecycle-BSvsyB_x.mjs} +17 -17
- package/dist/{platform-lifecycle-BH34I0rh.mjs → platform-lifecycle-CfcFygHb.mjs} +1 -1
- package/dist/{platform-management-BfLW0Zlo.mjs → platform-management-BMdyt667.mjs} +1 -1
- package/dist/{platform-management-BRefdHGD.mjs → platform-management-CrP1XhVd.mjs} +4 -4
- package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-CgDiwflR.mjs} +5 -5
- package/dist/{platform-recovery-DZuZGJtt.mjs → platform-recovery-CHWwXVZ6.mjs} +3 -3
- package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-BTQVbnTC.mjs} +3 -3
- package/dist/{plugin-inference-CdLbxZL_.mjs → plugin-inference-g66Q1Mx9.mjs} +5 -8
- package/dist/prepare-Bx4a8cb1.mjs +1 -0
- package/dist/{prepare-BuNbuFlA.mjs → prepare-DJYHjpzq.mjs} +3 -3
- package/dist/{prepare-BerOZiD4.mjs → prepare-DXduEwQp.mjs} +12 -9
- package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BN9Lmebs.mjs} +29 -13
- package/dist/prerender-render.d.mts +10 -2
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-B_bUyZ3J.mjs → project-cmd-Dfb1Sg8w.mjs} +18 -18
- package/dist/{project-paths-CdGv9Tmi.mjs → project-paths-G0yut6Zz.mjs} +12 -8
- package/dist/{project-team-MjT5K4rQ.mjs → project-team-BO2dyc7S.mjs} +5 -5
- package/dist/{project-token-BKHGwY3k.mjs → project-token-ByO2mEI2.mjs} +5 -5
- package/dist/{project-tsconfig-Cf2NFjlM.mjs → project-tsconfig-nhnTWO_Y.mjs} +4 -2
- package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust-CoQfwRBR.mjs} +5 -5
- package/dist/{protocol-CkwjASep.d.mts → protocol-xZMvWsrg.d.mts} +5 -3
- package/dist/{protocol-COyySMki.mjs → protocol-yxdHxFLN.mjs} +47 -11
- package/dist/{provision-DQF6Kw-6.mjs → provision-CMH4-8ri.mjs} +1 -1
- package/dist/{provision-BbCzpbXs.mjs → provision-D5q-ptD3.mjs} +2 -2
- package/dist/{requests-daJmVpjk.mjs → requests-CPOiDkjh.mjs} +4 -4
- package/dist/resolve-project-BALVa9q0.mjs +1 -0
- package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-ClvLMTI9.mjs} +1 -1
- package/dist/{rollback-BgL0wY1J.mjs → rollback-BfCs2la4.mjs} +7 -7
- package/dist/{route-types-CZc1YXjF.mjs → route-types-Cl3x0Q8B.mjs} +265 -12
- package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
- package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
- package/dist/routes-stub.d.mts +10 -1
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
- package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/auth.mjs +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/env-public.mjs +2 -46
- package/dist/runtime/fetch-server.d.mts +1 -1
- package/dist/runtime/fetch-server.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.d.mts +3 -1
- package/dist/runtime/live-client.d.mts +11 -2
- package/dist/runtime/live-client.mjs +8 -0
- package/dist/runtime/live-server.mjs +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.mjs +1 -1
- package/dist/runtime/remote/index.mjs +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/route-url.mjs +1 -1
- package/dist/runtime/routing.d.mts +15 -4
- package/dist/runtime/routing.mjs +94 -12
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/sse-client.d.mts +9 -1
- package/dist/runtime/sse-client.mjs +7 -0
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +1 -1
- package/dist/{scan-X2rDDRNa.mjs → scan-L8OSv1f7.mjs} +68 -19
- package/dist/{secret-CPq-B_vp.mjs → secret-CuI6LTpD.mjs} +7 -7
- package/dist/serialize-DN-envGQ.d.mts +18 -0
- package/dist/serialize-Pf-CIQK_.mjs +39 -0
- package/dist/{skills-D393E4lB.mjs → skills-BBO9wMjB.mjs} +1 -1
- package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-BZMnCA8T.mjs} +2 -2
- package/dist/url-CuoEn0o3.mjs +43 -0
- package/dist/validator-8-NZs2Xr.mjs +168 -0
- package/dist/{version-metadata-C8hLzQkv.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
- package/dist/wrangler-R3kMdJfw.mjs +1 -0
- package/dist/{wrangler-DESSbN8L.mjs → wrangler-k40T7XTQ.mjs} +3 -3
- package/dist/{wrapper-C9SUxoj7.mjs → wrapper-BGsi_uHs.mjs} +12 -9
- package/dist/{ws-Dmjg5NH2.d.mts → ws-DB8Feytg.d.mts} +2 -2
- package/docs/guide/ai.md +2 -0
- package/docs/guide/auth.md +62 -0
- package/docs/guide/database.md +33 -0
- package/docs/guide/deployment.md +8 -0
- package/docs/guide/edge/headers.md +3 -1
- package/docs/guide/edge/prerendering.md +9 -4
- package/docs/guide/edge/redirects.md +1 -0
- package/docs/guide/edge/revalidation.md +3 -0
- package/docs/guide/edge/static-assets.md +1 -1
- package/docs/guide/live.md +2 -0
- package/docs/guide/pages-routing/actions-and-forms.md +29 -10
- package/docs/guide/pages-routing/head.md +3 -1
- package/docs/guide/pages-routing/islands.md +1 -1
- package/docs/guide/pages-routing/loaders.md +2 -0
- package/docs/guide/pages-routing/markdown.md +2 -2
- package/docs/guide/pages-routing/overview.md +139 -10
- package/docs/guide/quickstart.md +1 -0
- package/docs/guide/server-routing.md +14 -0
- package/docs/guide/sse.md +2 -0
- package/docs/guide/ssg.md +23 -2
- package/docs/guide/storage.md +6 -2
- package/docs/guide/type-safety.md +307 -26
- package/docs/guide/typed-fetch.md +7 -3
- package/docs/guide/websockets.md +5 -5
- package/docs/integrations/cloudflare.md +10 -10
- package/docs/integrations/frameworks/nuxt.md +2 -0
- package/docs/integrations/frameworks/overview.md +2 -0
- package/docs/integrations/nodejs-bun-deno.md +65 -0
- package/docs/reference/api/auth.md +19 -0
- package/docs/reference/api/client.md +6 -4
- package/docs/reference/api/handlers.md +3 -1
- package/docs/reference/api/pages.md +16 -8
- package/docs/reference/api/resources.md +3 -1
- package/docs/reference/api/rewrites.md +19 -5
- package/docs/reference/api/types.md +9 -2
- package/docs/reference/cli/database.md +2 -0
- package/docs/reference/cli/deploy.md +17 -11
- package/docs/reference/cli.md +3 -0
- package/docs/reference/config.md +24 -2
- package/package.json +25 -23
- package/schema.json +4 -0
- package/skills/void/SKILL.md +5 -0
- package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
- package/dist/client-CEtr5UOR.mjs +0 -1
- package/dist/deploy-B029oHlE.mjs +0 -2
- package/dist/discover-D4mQthao.mjs +0 -1
- package/dist/gen-cCxrFp9L.mjs +0 -1
- package/dist/help-Ba8Dq5-r.mjs +0 -1
- package/dist/login-BpbYeu-n.mjs +0 -1
- package/dist/migrate-HdA6Kh2p.mjs +0 -1
- package/dist/operator-cmd-wBYyp8iQ.mjs +0 -1
- package/dist/output-E6gecbbV.mjs +0 -1
- package/dist/platform-args-C7XUw9mw.mjs +0 -1
- package/dist/prepare-Cz18kLkF.mjs +0 -1
- package/dist/resolve-project-CgfjtOwz.mjs +0 -1
- package/dist/serialize-DUuYuaY3.mjs +0 -29
- package/dist/serialize-I4EmS-Wf.d.mts +0 -16
- package/dist/validator-CTfmzZYb.mjs +0 -69
- package/dist/wrangler-DUB3MGHV.mjs +0 -1
- package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
- package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
- package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
- package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
|
+
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-BQdgCVQF.mjs";
|
|
2
3
|
import { a as join, c as resolve, n as dirname, o as normalize, r as extname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import { o as validateSsrEntry } from "./entry-CBZsCy3O.mjs";
|
|
10
|
-
import { r as hasEmailHandlers } from "./email-BHY72ixO.mjs";
|
|
11
|
-
import { c as VOID_INTERNAL_WORKER_FIRST, d as hasDocumentRoutes, f as resolveAssetConfig, i as readGeneratedAssetHeadersFile, l as edgeRulesNeedWorker, u as hasApiRoutes } from "./headers-CuTEdP9C.mjs";
|
|
4
|
+
import { a as persistCloudflareConfig, c as stashCloudflareDeployPointer, i as materializeCloudflareConfig } from "./cloudflare-config-DtOGAbeB.mjs";
|
|
5
|
+
import { m as resolveBindingNames, p as readConfig, r as convertHeadersConfig, u as isNodeTarget } from "./config-5oSQhZNj.mjs";
|
|
6
|
+
import { r as detectFramework } from "./plugin-inference-g66Q1Mx9.mjs";
|
|
7
|
+
import { a as buildEnv, i as WRANGLER_AUTH_CREDENTIAL_ENV_VARS, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-eUd6Ar_U.mjs";
|
|
8
|
+
import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-CCk9Seol.mjs";
|
|
9
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-BEZmTP6p.mjs";
|
|
12
10
|
import { t as writeFileAtomic } from "./atomic-write-DA6eD1Kp.mjs";
|
|
13
|
-
import {
|
|
11
|
+
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-BH6LCr00.mjs";
|
|
14
12
|
import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
13
|
+
import { a as FRAMEWORK_PRESETS, c as hasBackendFiles, i as isCleanCloudflareExit, l as resolveCloudflareOperationArgv, o as detectPreset, s as formatProjectCommand, t as createCloudflareProcessRunner, u as resolveProjectCommand } from "./cloudflare-process-BcPvlMFd.mjs";
|
|
14
|
+
import { n as redactMessage } from "./env-mask-D31Qztl9.mjs";
|
|
15
|
+
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, o as requiresSandboxPlatformImage, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync } from "./application-analysis-OV0CBJ80.mjs";
|
|
16
|
+
import { A as syncWranglerWebSockets, C as readWranglerManagedQueueCleanupCandidates, D as sameMigrationsDir, E as resolveLiveBindingConfig, L as writeVoidProjectConfig, M as writeProvisionedWranglerConfig, N as writeWranglerPublishedTrafficSnapshot, a as LIVE_MIGRATION_TAG, c as bindingEntriesForField, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, o as acknowledgeWranglerManagedQueueRemovals, r as FRIENDLY_BINDING_NAMES, v as readExistingLiveBindingConfig, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-k40T7XTQ.mjs";
|
|
17
|
+
import { A as promptDeployProjectConfig, C as ensureManagedHyperdrive, D as hasNonPageBackend, E as getGitCommit, F as resolveStaticBuildCommand, I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, O as hasPrerenderSources, P as resolveFullDeployBuildCommand, R as validateDeployMigrations, S as createProjectFromSlug, T as getExitCode, _ as getDeploySchemaDriftMessage, a as collectAndHashAssets, b as assertProjectDeployAccess, c as readWranglerHtmlHandling, d as printDeploySuccess, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, h as warnUnpublishedRouting, i as buildStaticManifest, j as resolveDeployLiveBindingConfig, k as log$1, l as formatDeploySummary, m as warnIgnoredNotFoundForFramework, n as runStaticDeploy, o as collectWorkerFiles, p as streamDirectR2Deploy, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeployContext, v as hasDeploySchemaDrift, w as generateDeployWrapperIfNeeded, x as assertWorkerMainUploaded, y as assertEnvSchemaValid } from "./deploy-managed-static-BBVtpuGv.mjs";
|
|
18
|
+
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-QpyC5G8z.mjs";
|
|
19
|
+
import { a as resolveDistDir, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate } from "./isr-config-Czzb4mIq.mjs";
|
|
20
|
+
import { i as otherQueueConsumers, n as chooseCloudflareQueueName, o as scopedCloudflareQueueName, r as cloudflareQueueName } from "./dispatch-pYaww76u.mjs";
|
|
21
|
+
import { r as hasEmailHandlers } from "./email-BHY72ixO.mjs";
|
|
22
|
+
import { a as checkCloudflareProvisionDrift, b as resolveWorkersDevComplianceRegion, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-D5q-ptD3.mjs";
|
|
23
|
+
import { c as scrubWranglerAuthCredentials, n as buildSchemaProbeEnv, o as resolveDeployTransport, r as deployChildEnv, s as scrubManagedDeployBuildMarkers, t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-Dt0IvSVW.mjs";
|
|
24
|
+
import { f as listSelfHostSecretNames, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError } from "./env-validation-1snjKtDX.mjs";
|
|
15
25
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-CoDaaFsA.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { t as ensurePlatformAccessToken } from "./cf-access-BmBT2h8_.mjs";
|
|
20
|
-
import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-Dy8svcqQ.mjs";
|
|
21
|
-
import { n as record, t as migrateBuiltWranglerConfig } from "./cf-config-migrate-Dy8MrKgF.mjs";
|
|
26
|
+
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-CXJTIAtF.mjs";
|
|
27
|
+
import { t as collectMigrations } from "./collect-C6Blu9yw.mjs";
|
|
28
|
+
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-CLJXXN93.mjs";
|
|
22
29
|
import { l as resolveRemoteMode, n as CLOUDFLARE_QUEUE_NAMES_BUILD_ENV, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-CuzZZyjB.mjs";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { a as
|
|
27
|
-
import {
|
|
28
|
-
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-P4TggvWp.mjs";
|
|
29
|
-
import { n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-B1C8U83u.mjs";
|
|
30
|
-
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-Ddzl-IwT.mjs";
|
|
31
|
-
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
32
|
-
import { r as getPackageDir } from "./agents-DRo8gzni.mjs";
|
|
33
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
34
|
-
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-BCdLioKP.mjs";
|
|
35
|
-
import { t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
30
|
+
import { n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-CWNOH-KA.mjs";
|
|
31
|
+
import { c as VOID_INTERNAL_WORKER_FIRST, d as hasDocumentRoutes, f as resolveAssetConfig, i as readGeneratedAssetHeadersFile, l as edgeRulesNeedWorker, u as hasApiRoutes } from "./headers-CimYIfQI.mjs";
|
|
32
|
+
import { o as validateSsrEntry } from "./entry-Bw-G1VVx.mjs";
|
|
33
|
+
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-DGIivpTb.mjs";
|
|
34
|
+
import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from "./cf-access-pejlJmuy.mjs";
|
|
36
35
|
import { i as safePositional, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "./cf-command-values-Ccl-zRhl.mjs";
|
|
37
|
-
import {
|
|
38
|
-
import { f as listSelfHostSecretNames, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError } from "./env-validation-GV1oD4EV.mjs";
|
|
39
|
-
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-C9SUxoj7.mjs";
|
|
40
|
-
import { A as promptDeployProjectConfig, C as ensureManagedHyperdrive, D as hasNonPageBackend, E as getGitCommit, F as resolveStaticBuildCommand, I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, O as hasPrerenderSources, P as resolveFullDeployBuildCommand, R as validateDeployMigrations, S as createProjectFromSlug, T as getExitCode, _ as getDeploySchemaDriftMessage, a as collectAndHashAssets, b as assertProjectDeployAccess, c as readWranglerHtmlHandling, d as printDeploySuccess, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, h as warnUnpublishedRouting, i as buildStaticManifest, j as resolveDeployLiveBindingConfig, k as log$1, l as formatDeploySummary, m as warnIgnoredNotFoundForFramework, n as runStaticDeploy, o as collectWorkerFiles, p as streamDirectR2Deploy, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeployContext, v as hasDeploySchemaDrift, w as generateDeployWrapperIfNeeded, x as assertWorkerMainUploaded, y as assertEnvSchemaValid } from "./deploy-managed-static-BHVbB_-A.mjs";
|
|
41
|
-
import { a as checkCloudflareProvisionDrift, b as resolveWorkersDevComplianceRegion, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-BbCzpbXs.mjs";
|
|
42
|
-
import { c as scrubWranglerAuthCredentials, n as buildSchemaProbeEnv, o as resolveDeployTransport, r as deployChildEnv, s as scrubManagedDeployBuildMarkers, t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-DEyOUfac.mjs";
|
|
36
|
+
import { n as record, t as migrateBuiltWranglerConfig } from "./cf-config-migrate-Bb-EdAQq.mjs";
|
|
43
37
|
import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareWorkerSettings } from "./cf-worker-settings-CARs4Wy9.mjs";
|
|
38
|
+
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-k7wYUv56.mjs";
|
|
39
|
+
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-Ddzl-IwT.mjs";
|
|
40
|
+
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-G0yut6Zz.mjs";
|
|
44
41
|
import { t as sanitizeTerminalLogText } from "./terminal-log-text-DNsWJREL.mjs";
|
|
45
|
-
import {
|
|
46
|
-
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-CEu-1Ps_.mjs";
|
|
47
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-CrskD4_O.mjs";
|
|
48
|
-
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-CLJXXN93.mjs";
|
|
49
|
-
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-ChHHZBTi.mjs";
|
|
50
|
-
import { a as runMySqlMigrations } from "./runner-mysql-Bdmsp_x4.mjs";
|
|
42
|
+
import { a as runMySqlMigrations } from "./runner-mysql-BXfcQQj3.mjs";
|
|
51
43
|
import { i as runPgMigrations } from "./runner-pg-mYc75KfH.mjs";
|
|
44
|
+
import { a as emailConfigInputs, c as renderAddressMap, d as collectPrerenderPathsNode, f as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, n as SEND_EMAIL_BINDING, o as preflightEmail, p as prerenderPagesNode, r as applyEmailSetup, t as EMAIL_FROM_VAR, u as collectPrerenderPaths } from "./email-cloudflare-CTt2n_W2.mjs";
|
|
45
|
+
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-BGsi_uHs.mjs";
|
|
46
|
+
import { t as assertNoPrerenderFailures } from "./prerender-render-BN9Lmebs.mjs";
|
|
52
47
|
import { t as collectGitDeployMetadata } from "./git-metadata-Cukp5kV5.mjs";
|
|
48
|
+
import { t as ensurePlatformAccessToken } from "./cf-access-Dnyw8KFY.mjs";
|
|
49
|
+
import { r as getPackageDir } from "./agents-DRo8gzni.mjs";
|
|
50
|
+
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
51
|
+
import { t as promptForLoginToken } from "./login-TA51e5Fw.mjs";
|
|
52
|
+
import { s as listPlatformConnections } from "./platform-registry-DZ_2Xuqd.mjs";
|
|
53
|
+
import { t as getRequestedProjectSlug } from "./resolve-project-ClvLMTI9.mjs";
|
|
53
54
|
import { createRequire } from "node:module";
|
|
54
|
-
import {
|
|
55
|
+
import { closeSync, cpSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
55
56
|
import { fileURLToPath } from "node:url";
|
|
56
57
|
import { isRecord } from "@void/deploy-core";
|
|
57
58
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -61,10 +62,10 @@ import { applyEdits, modify, parse } from "jsonc-parser";
|
|
|
61
62
|
import { execFile, execSync, spawn } from "node:child_process";
|
|
62
63
|
import { getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
|
|
63
64
|
import { convertToWranglerConfig } from "@cloudflare/config";
|
|
65
|
+
import mime from "mime";
|
|
64
66
|
import ignore from "ignore";
|
|
65
|
-
import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, cloudflareCommandDiagnostic, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeReadinessAccessOrigin, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
|
|
67
|
+
import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, cloudflareCommandDiagnostic, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeReadinessAccessOrigin, normalizeWorkersDevSubdomain, parseCloudflareVersionMessage, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
|
|
66
68
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
67
|
-
import mime from "mime";
|
|
68
69
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
69
70
|
import { Minimatch } from "minimatch";
|
|
70
71
|
// src/cli/cloudflare-candidate.ts
|
|
@@ -324,6 +325,164 @@ function readCloudflareLocalState(root) {
|
|
|
324
325
|
return {};
|
|
325
326
|
}
|
|
326
327
|
}
|
|
328
|
+
// src/cli/cloudflare-child-report.ts
|
|
329
|
+
const NOT_SECRET = /* @__PURE__ */ new Set([
|
|
330
|
+
"CLOUDFLARE_EMAIL",
|
|
331
|
+
"CF_EMAIL",
|
|
332
|
+
"CLOUDFLARE_ACCESS_CLIENT_ID"
|
|
333
|
+
]);
|
|
334
|
+
const CREDENTIAL_ENV_VARS = [...WRANGLER_AUTH_CREDENTIAL_ENV_VARS.filter((name) => !NOT_SECRET.has(name)), "CF_ACCESS_CLIENT_SECRET"];
|
|
335
|
+
const MIN_SECRET_LENGTH = 8;
|
|
336
|
+
function createCredentialRedactor(env = process.env) {
|
|
337
|
+
const values = /* @__PURE__ */ new Set();
|
|
338
|
+
let ordered = [];
|
|
339
|
+
const add = (value) => {
|
|
340
|
+
if (typeof value !== "string") return;
|
|
341
|
+
for (const candidate of [value, value.trim()]) if (candidate.length >= MIN_SECRET_LENGTH && !values.has(candidate)) {
|
|
342
|
+
values.add(candidate);
|
|
343
|
+
ordered = [...values].sort((a, b) => b.length - a.length);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
for (const name of CREDENTIAL_ENV_VARS) add(env[name]);
|
|
347
|
+
return {
|
|
348
|
+
add,
|
|
349
|
+
redact(text) {
|
|
350
|
+
let out = text;
|
|
351
|
+
for (const value of ordered) out = redactMessage(value, out);
|
|
352
|
+
return out;
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function createCloudflareChildReporter(cliLog, env = process.env) {
|
|
357
|
+
return {
|
|
358
|
+
cliLog,
|
|
359
|
+
redactor: createCredentialRedactor(env)
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Scrub exact credential values from a child result. This must run before any formatter
|
|
364
|
+
* truncates the text, or a token that crosses the cut would leak its prefix. A clean
|
|
365
|
+
* stdout and `data` are left alone: callers parse them, and they carry results, not errors.
|
|
366
|
+
*/
|
|
367
|
+
function scrubCloudflareResult(result, redactor) {
|
|
368
|
+
return {
|
|
369
|
+
...result,
|
|
370
|
+
stderr: redactor.redact(result.stderr),
|
|
371
|
+
...isCleanCloudflareExit(result) ? {} : { stdout: redactor.redact(result.stdout) },
|
|
372
|
+
...result.error ? { error: redactor.redact(result.error) } : {},
|
|
373
|
+
...result.errors ? { errors: result.errors.map((error) => ({
|
|
374
|
+
...error,
|
|
375
|
+
message: redactor.redact(error.message)
|
|
376
|
+
})) } : {}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
/** Scrub a runner rejection in place, so fields callers check on the Error survive. */
|
|
380
|
+
function scrubCloudflareError(error, redactor) {
|
|
381
|
+
if (!(error instanceof Error)) return new Error(redactor.redact(String(error)));
|
|
382
|
+
error.message = redactor.redact(error.message);
|
|
383
|
+
if (typeof error.stack === "string") error.stack = redactor.redact(error.stack);
|
|
384
|
+
return error;
|
|
385
|
+
}
|
|
386
|
+
/** Why a child failed: its spawn error, the signal that stopped it, or its exit code. */
|
|
387
|
+
function describeCloudflareChildFailure(result, subject = "the Void CLI helper process") {
|
|
388
|
+
if (result.error) return `${subject} could not run: ${result.error}`;
|
|
389
|
+
if (result.signal) return `${subject} was stopped by ${result.signal}`;
|
|
390
|
+
return `${subject} exited with code ${String(result.status)}`;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The cause sentence, then the child's bounded diagnostic. stdout is never shown: for
|
|
394
|
+
* auth.token it is the credential envelope. The spawn error is already in the cause.
|
|
395
|
+
*/
|
|
396
|
+
function formatCloudflareChildFailure(result, subject) {
|
|
397
|
+
const diagnostic = cloudflareCommandDiagnostic({
|
|
398
|
+
status: result.status,
|
|
399
|
+
stdout: "",
|
|
400
|
+
stderr: result.stderr
|
|
401
|
+
});
|
|
402
|
+
const cause = `${describeCloudflareChildFailure(result, subject)}.`;
|
|
403
|
+
return diagnostic ? `${cause}\n${diagnostic}` : cause;
|
|
404
|
+
}
|
|
405
|
+
/** `cf` plus up to three leading subcommand words, so values and flags stay out of the log. */
|
|
406
|
+
function cfOperationName(args) {
|
|
407
|
+
const words = [];
|
|
408
|
+
for (const arg of args) {
|
|
409
|
+
if (words.length === 3 || arg.startsWith("-")) break;
|
|
410
|
+
words.push(arg);
|
|
411
|
+
}
|
|
412
|
+
return ["cf", ...words].join(" ");
|
|
413
|
+
}
|
|
414
|
+
function logCloudflareOp(reporter, op, startedAt, outcome) {
|
|
415
|
+
const ms = Date.now() - startedAt;
|
|
416
|
+
if ("thrown" in outcome) {
|
|
417
|
+
reporter.cliLog.debug("cloudflare_op", {
|
|
418
|
+
op,
|
|
419
|
+
ok: false,
|
|
420
|
+
ms,
|
|
421
|
+
diagnostic: cloudflareCommandDiagnostic({
|
|
422
|
+
status: 1,
|
|
423
|
+
stdout: "",
|
|
424
|
+
stderr: outcome.thrown.message
|
|
425
|
+
})
|
|
426
|
+
});
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
const { result } = outcome;
|
|
430
|
+
const ok = isCleanCloudflareExit(result);
|
|
431
|
+
reporter.cliLog.debug("cloudflare_op", {
|
|
432
|
+
op,
|
|
433
|
+
ok,
|
|
434
|
+
status: result.status,
|
|
435
|
+
...result.signal ? { signal: result.signal } : {},
|
|
436
|
+
ms,
|
|
437
|
+
...ok ? {} : { diagnostic: cloudflareCommandDiagnostic({
|
|
438
|
+
...result,
|
|
439
|
+
stdout: op === "auth.token" ? "" : result.stdout
|
|
440
|
+
}) }
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Observe the deploy's operation-child runner: scrub every result, learn the session
|
|
445
|
+
* bearer from a clean auth.token, and write one debug `cloudflare_op` record per child.
|
|
446
|
+
* Inputs (`opts.input` carries secret values) and result data are never logged.
|
|
447
|
+
*/
|
|
448
|
+
function observeCloudflareRunner(run, reporter) {
|
|
449
|
+
return async (operation, opts) => {
|
|
450
|
+
const startedAt = Date.now();
|
|
451
|
+
let result;
|
|
452
|
+
try {
|
|
453
|
+
result = await run(operation, opts);
|
|
454
|
+
} catch (error) {
|
|
455
|
+
const thrown = scrubCloudflareError(error, reporter.redactor);
|
|
456
|
+
logCloudflareOp(reporter, operation.type, startedAt, { thrown });
|
|
457
|
+
throw thrown;
|
|
458
|
+
}
|
|
459
|
+
if (operation.type === "auth.token" && isCleanCloudflareExit(result)) {
|
|
460
|
+
const data = result.data;
|
|
461
|
+
reporter.redactor.add(data?.token);
|
|
462
|
+
}
|
|
463
|
+
const scrubbed = scrubCloudflareResult(result, reporter.redactor);
|
|
464
|
+
logCloudflareOp(reporter, operation.type, startedAt, { result: scrubbed });
|
|
465
|
+
return scrubbed;
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
/** Observe the pinned cf CLI the same way. */
|
|
469
|
+
function observeCfCommand(run, reporter) {
|
|
470
|
+
return async (args, opts) => {
|
|
471
|
+
const op = cfOperationName(args);
|
|
472
|
+
const startedAt = Date.now();
|
|
473
|
+
let result;
|
|
474
|
+
try {
|
|
475
|
+
result = await run(args, opts);
|
|
476
|
+
} catch (error) {
|
|
477
|
+
const thrown = scrubCloudflareError(error, reporter.redactor);
|
|
478
|
+
logCloudflareOp(reporter, op, startedAt, { thrown });
|
|
479
|
+
throw thrown;
|
|
480
|
+
}
|
|
481
|
+
const scrubbed = scrubCloudflareResult(result, reporter.redactor);
|
|
482
|
+
logCloudflareOp(reporter, op, startedAt, { result: scrubbed });
|
|
483
|
+
return scrubbed;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
327
486
|
// src/cli/deploy-binding-snapshot.ts
|
|
328
487
|
/** The id-bearing binding fields whose identity must survive the build unchanged. */
|
|
329
488
|
const DEPLOY_BINDING_IDENTITY_FIELDS = {
|
|
@@ -1799,25 +1958,51 @@ async function chooseCloudflareDeployAccount(options) {
|
|
|
1799
1958
|
function isWranglerNonInteractiveOrCI() {
|
|
1800
1959
|
return import_ci_info.isCI || !(process.stdin.isTTY && process.stdout.isTTY);
|
|
1801
1960
|
}
|
|
1961
|
+
const GLOBAL_API_KEY_SESSION = "the session uses a Global API Key (CLOUDFLARE_API_KEY), which this step cannot use. Set CLOUDFLARE_API_TOKEN, or unset CLOUDFLARE_API_KEY and run `void cloudflare login`, then retry.";
|
|
1802
1962
|
/**
|
|
1803
1963
|
* Read the current Cloudflare session bearer through the pinned deploy runner, for API calls
|
|
1804
|
-
* Void makes itself. The token goes only to the caller
|
|
1964
|
+
* Void makes itself. The token goes only to the caller. A failure is built fresh from the
|
|
1965
|
+
* child's status, signal and stderr: it never carries the child's errorCode, failure, errors
|
|
1966
|
+
* or data, so an auth failure can never be read as a Cloudflare upload error.
|
|
1805
1967
|
*/
|
|
1806
|
-
async function
|
|
1968
|
+
async function readWranglerAuthToken(runWrangler, configPath) {
|
|
1969
|
+
const fail = (status, signal, stderr) => ({
|
|
1970
|
+
ok: false,
|
|
1971
|
+
failure: {
|
|
1972
|
+
status: status === 0 ? 1 : status,
|
|
1973
|
+
...signal ? { signal } : {},
|
|
1974
|
+
stdout: "",
|
|
1975
|
+
stderr
|
|
1976
|
+
}
|
|
1977
|
+
});
|
|
1807
1978
|
let result;
|
|
1808
1979
|
try {
|
|
1809
1980
|
result = await Promise.resolve(runWrangler({
|
|
1810
1981
|
type: "auth.token",
|
|
1811
1982
|
configPath
|
|
1812
1983
|
}, { capture: true }));
|
|
1813
|
-
} catch {
|
|
1814
|
-
return null
|
|
1984
|
+
} catch (error) {
|
|
1985
|
+
return fail(1, null, `${describeCloudflareChildFailure({
|
|
1986
|
+
status: 1,
|
|
1987
|
+
error: getErrorMessage(error)
|
|
1988
|
+
})}.`);
|
|
1815
1989
|
}
|
|
1816
|
-
if (!isCleanCloudflareExit(result)) return null;
|
|
1817
1990
|
const parsed = result.data;
|
|
1991
|
+
if (!isCleanCloudflareExit(result)) {
|
|
1992
|
+
if (parsed?.type === "api_key" && !result.error && !result.signal) return fail(result.status, null, GLOBAL_API_KEY_SESSION);
|
|
1993
|
+
return fail(result.status, result.signal, formatCloudflareChildFailure(result));
|
|
1994
|
+
}
|
|
1818
1995
|
const type = parsed?.type;
|
|
1819
1996
|
const token = parsed?.token;
|
|
1820
|
-
return (type === "oauth" || type === "api_token") && typeof token === "string" && token.length > 0 ?
|
|
1997
|
+
return (type === "oauth" || type === "api_token") && typeof token === "string" && token.length > 0 ? {
|
|
1998
|
+
ok: true,
|
|
1999
|
+
token
|
|
2000
|
+
} : fail(1, null, "the Void CLI helper process returned no session credential.");
|
|
2001
|
+
}
|
|
2002
|
+
/** {@link readWranglerAuthToken} for callers that only need the token; every failure is `null`. */
|
|
2003
|
+
async function runWranglerAuthToken(runWrangler, configPath) {
|
|
2004
|
+
const read = await readWranglerAuthToken(runWrangler, configPath);
|
|
2005
|
+
return read.ok ? read.token : null;
|
|
1821
2006
|
}
|
|
1822
2007
|
/**
|
|
1823
2008
|
* Ensure an auth-enabled worker has one persistent Better Auth secret.
|
|
@@ -2121,6 +2306,12 @@ function bindingsFromOutput(env, workerName, activeSecrets, explicitSecrets) {
|
|
|
2121
2306
|
type: "version_metadata"
|
|
2122
2307
|
});
|
|
2123
2308
|
break;
|
|
2309
|
+
case "worker-loader":
|
|
2310
|
+
bindings.push({
|
|
2311
|
+
name,
|
|
2312
|
+
type: "worker_loader"
|
|
2313
|
+
});
|
|
2314
|
+
break;
|
|
2124
2315
|
default: throw new Error(`Cloudflare binding ${name} cannot be uploaded with pinned secrets.`);
|
|
2125
2316
|
}
|
|
2126
2317
|
}
|
|
@@ -2490,13 +2681,14 @@ async function ensureContainerApplications(options) {
|
|
|
2490
2681
|
assertContainerApplicationSettings(confirmed, plan);
|
|
2491
2682
|
}
|
|
2492
2683
|
}
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2684
|
+
function readAssetHeaders(output) {
|
|
2685
|
+
if (!output.assetsDirectory) return;
|
|
2686
|
+
try {
|
|
2687
|
+
return readFileSync(join(getWorkerAssetsDir(output.directory), "_headers"), "utf8");
|
|
2688
|
+
} catch (cause) {
|
|
2689
|
+
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") return;
|
|
2690
|
+
throw cause;
|
|
2691
|
+
}
|
|
2500
2692
|
}
|
|
2501
2693
|
async function uploadAssets(options) {
|
|
2502
2694
|
if (!options.output.assetsDirectory) return;
|
|
@@ -2504,9 +2696,6 @@ async function uploadAssets(options) {
|
|
|
2504
2696
|
const manifest = {};
|
|
2505
2697
|
const byHash = /* @__PURE__ */ new Map();
|
|
2506
2698
|
const ignored = ignore().add([
|
|
2507
|
-
"/.assetsignore",
|
|
2508
|
-
"/_headers",
|
|
2509
|
-
"/_redirects",
|
|
2510
2699
|
".DS_Store",
|
|
2511
2700
|
".env",
|
|
2512
2701
|
".env.*",
|
|
@@ -2519,6 +2708,11 @@ async function uploadAssets(options) {
|
|
|
2519
2708
|
} catch (cause) {
|
|
2520
2709
|
if (!(cause instanceof Error && "code" in cause && cause.code === "ENOENT")) throw cause;
|
|
2521
2710
|
}
|
|
2711
|
+
ignored.add([
|
|
2712
|
+
"/.assetsignore",
|
|
2713
|
+
"/_headers",
|
|
2714
|
+
"/_redirects"
|
|
2715
|
+
]);
|
|
2522
2716
|
for (const entry of readdirSync(directory, {
|
|
2523
2717
|
recursive: true,
|
|
2524
2718
|
withFileTypes: true
|
|
@@ -2625,11 +2819,11 @@ async function uploadPinnedCloudflareVersion(options) {
|
|
|
2625
2819
|
content_base64: readFileSync(join(getWorkerBundleDir(options.output.directory), name)).toString("base64")
|
|
2626
2820
|
});
|
|
2627
2821
|
}
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
2822
|
+
const assetHeaders = readAssetHeaders(options.output);
|
|
2823
|
+
if (assetHeaders !== void 0) modules.push({
|
|
2630
2824
|
name: "_headers",
|
|
2631
2825
|
content_type: "text/plain",
|
|
2632
|
-
content_base64: Buffer$2.from(
|
|
2826
|
+
content_base64: Buffer$2.from(assetHeaders).toString("base64")
|
|
2633
2827
|
});
|
|
2634
2828
|
await preflightWorkflowExports({
|
|
2635
2829
|
exports,
|
|
@@ -2709,6 +2903,25 @@ function failed(message) {
|
|
|
2709
2903
|
stderr: message
|
|
2710
2904
|
};
|
|
2711
2905
|
}
|
|
2906
|
+
/** Keep the credential child's real status, signal and diagnostic under one header. */
|
|
2907
|
+
function credentialFailed(header, failure) {
|
|
2908
|
+
return {
|
|
2909
|
+
status: failure.status,
|
|
2910
|
+
...failure.signal ? { signal: failure.signal } : {},
|
|
2911
|
+
stdout: "",
|
|
2912
|
+
stderr: `${header}: ${failure.stderr}`
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
* Whether activating a version with this message publishes Worker settings (observability or
|
|
2917
|
+
* logpush) after traffic moves. The schema-2 snapshot is what trigger sync replays; a preserved
|
|
2918
|
+
* snapshot publishes nothing.
|
|
2919
|
+
*/
|
|
2920
|
+
function publishesWorkerSettings(message) {
|
|
2921
|
+
const metadata = parseCloudflareVersionMessage(message);
|
|
2922
|
+
if (metadata?.schema !== 2 || metadata.triggerConfig.preserve === true) return false;
|
|
2923
|
+
return metadata.triggerConfig.observability !== void 0 || metadata.triggerConfig.logpush !== void 0;
|
|
2924
|
+
}
|
|
2712
2925
|
function parseJson(value) {
|
|
2713
2926
|
try {
|
|
2714
2927
|
return JSON.parse(value);
|
|
@@ -2962,6 +3175,47 @@ function createCfVersionRunner(options) {
|
|
|
2962
3175
|
} : void 0
|
|
2963
3176
|
};
|
|
2964
3177
|
};
|
|
3178
|
+
let sessionToken;
|
|
3179
|
+
const readSessionToken = async (credentials) => {
|
|
3180
|
+
if (sessionToken !== void 0) return {
|
|
3181
|
+
ok: true,
|
|
3182
|
+
token: sessionToken
|
|
3183
|
+
};
|
|
3184
|
+
const credential = await credentials.getToken();
|
|
3185
|
+
if (credential.ok) sessionToken = credential.token;
|
|
3186
|
+
return credential;
|
|
3187
|
+
};
|
|
3188
|
+
const readFreshSessionToken = async (credentials) => {
|
|
3189
|
+
let credential;
|
|
3190
|
+
try {
|
|
3191
|
+
credential = await credentials.getToken();
|
|
3192
|
+
} catch (cause) {
|
|
3193
|
+
if (sessionToken === void 0) throw cause;
|
|
3194
|
+
return {
|
|
3195
|
+
ok: true,
|
|
3196
|
+
token: sessionToken
|
|
3197
|
+
};
|
|
3198
|
+
}
|
|
3199
|
+
if (credential.ok) {
|
|
3200
|
+
sessionToken = credential.token;
|
|
3201
|
+
return credential;
|
|
3202
|
+
}
|
|
3203
|
+
return sessionToken === void 0 ? credential : {
|
|
3204
|
+
ok: true,
|
|
3205
|
+
token: sessionToken
|
|
3206
|
+
};
|
|
3207
|
+
};
|
|
3208
|
+
/**
|
|
3209
|
+
* Read the settings publisher's credential before upload, so a deploy that cannot publish its
|
|
3210
|
+
* observability or logpush settings stops while production traffic is unchanged.
|
|
3211
|
+
*/
|
|
3212
|
+
const prepareSettingsCredential = async (message) => {
|
|
3213
|
+
if (!publishesWorkerSettings(message)) return null;
|
|
3214
|
+
const credentials = options.pinnedUpload;
|
|
3215
|
+
if (!credentials || !credentials.verifyUploader()) return failed("The Cloudflare settings publisher is unavailable; no version was uploaded.");
|
|
3216
|
+
const credential = await readSessionToken(credentials);
|
|
3217
|
+
return credential.ok ? null : credentialFailed("Could not get the Cloudflare session credential for publishing Worker settings (observability, logpush), so no version was uploaded", credential.failure);
|
|
3218
|
+
};
|
|
2965
3219
|
const verifyResources = async (directory) => {
|
|
2966
3220
|
try {
|
|
2967
3221
|
return await options.verifyResources(directory);
|
|
@@ -2977,8 +3231,9 @@ function createCfVersionRunner(options) {
|
|
|
2977
3231
|
};
|
|
2978
3232
|
const uploadPinnedVersion = async (operation, atomic) => {
|
|
2979
3233
|
if (!options.pinnedUpload || !options.pinnedUpload.verifyUploader()) return failed("The version-aware Cloudflare uploader is unavailable.");
|
|
2980
|
-
const
|
|
2981
|
-
if (!
|
|
3234
|
+
const credential = await readSessionToken(options.pinnedUpload);
|
|
3235
|
+
if (!credential.ok) return credentialFailed("Could not get the Cloudflare session credential for the upload", credential.failure);
|
|
3236
|
+
const { token } = credential;
|
|
2982
3237
|
try {
|
|
2983
3238
|
const version = await uploadPinnedCloudflareVersion({
|
|
2984
3239
|
output,
|
|
@@ -3119,6 +3374,8 @@ function createCfVersionRunner(options) {
|
|
|
3119
3374
|
if (operation.type === "versions.upload") {
|
|
3120
3375
|
const blocked = await checkUploadTarget(operation, "The Cloudflare version upload target changed.");
|
|
3121
3376
|
if (blocked) return blocked;
|
|
3377
|
+
const settings = await prepareSettingsCredential(operation.message);
|
|
3378
|
+
if (settings) return settings;
|
|
3122
3379
|
if (output.activeSecrets) return uploadPinnedVersion(operation, false);
|
|
3123
3380
|
return uploadedResult(await run([
|
|
3124
3381
|
"workers",
|
|
@@ -3159,6 +3416,8 @@ function createCfVersionRunner(options) {
|
|
|
3159
3416
|
if (operation.type === "worker.deploy") {
|
|
3160
3417
|
const blocked = await checkUploadTarget(operation, "The Cloudflare bootstrap target changed.");
|
|
3161
3418
|
if (blocked) return blocked;
|
|
3419
|
+
const settings = await prepareSettingsCredential(operation.message);
|
|
3420
|
+
if (settings) return settings;
|
|
3162
3421
|
if (output.activeSecrets) return uploadPinnedVersion(operation, true);
|
|
3163
3422
|
return uploadedResult(await run([
|
|
3164
3423
|
"deploy",
|
|
@@ -3216,8 +3475,10 @@ function createCfVersionRunner(options) {
|
|
|
3216
3475
|
const credentials = options.pinnedUpload;
|
|
3217
3476
|
if (!credentials || !credentials.verifyUploader()) return failed("The Cloudflare settings publisher is unavailable.");
|
|
3218
3477
|
try {
|
|
3219
|
-
const
|
|
3220
|
-
if (!
|
|
3478
|
+
const credential = await readFreshSessionToken(credentials);
|
|
3479
|
+
if (!credential.ok) return credentialFailed("Could not get the Cloudflare session credential for publishing Worker settings", credential.failure);
|
|
3480
|
+
if (!credentials.verifyUploader()) return failed("Cloudflare session is unavailable for publishing Worker settings.");
|
|
3481
|
+
const { token } = credential;
|
|
3221
3482
|
await publishCloudflareWorkerSettings({
|
|
3222
3483
|
apiBaseUrl: credentials.apiBaseUrl,
|
|
3223
3484
|
accountId: credentials.accountId,
|
|
@@ -3326,7 +3587,7 @@ function logCloudflareAuthFailure(error) {
|
|
|
3326
3587
|
* deploy without an account signs in and chooses one. Logs and returns null on failure.
|
|
3327
3588
|
*/
|
|
3328
3589
|
async function connectCloudflareDeployAccount(options) {
|
|
3329
|
-
const { root, configPath, deps } = options;
|
|
3590
|
+
const { root, configPath, deps, reporter } = options;
|
|
3330
3591
|
let { rootConfig } = options;
|
|
3331
3592
|
let apiBaseUrl;
|
|
3332
3593
|
try {
|
|
@@ -3339,7 +3600,7 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3339
3600
|
const pins = createCloudflareUploaderPins(root, deps);
|
|
3340
3601
|
let accountId = readWranglerTopLevelString(rootConfig, "account_id") ?? (process.env.CLOUDFLARE_ACCOUNT_ID?.trim() || void 0);
|
|
3341
3602
|
if (!accountId) {
|
|
3342
|
-
const accountRunner = deps.runWrangler ?? createDeployWranglerRunner(root, void 0, apiBaseUrl);
|
|
3603
|
+
const accountRunner = observeCloudflareRunner(deps.runWrangler ?? createDeployWranglerRunner(root, void 0, apiBaseUrl), reporter);
|
|
3343
3604
|
try {
|
|
3344
3605
|
accountId = await chooseCloudflareDeployAccount({
|
|
3345
3606
|
persist: options.persistAccount,
|
|
@@ -3370,7 +3631,7 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3370
3631
|
accountId,
|
|
3371
3632
|
workersDevSubdomain,
|
|
3372
3633
|
readinessAccessOrigin,
|
|
3373
|
-
runWrangler: deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl),
|
|
3634
|
+
runWrangler: observeCloudflareRunner(deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl), reporter),
|
|
3374
3635
|
rootConfig
|
|
3375
3636
|
};
|
|
3376
3637
|
}
|
|
@@ -3401,12 +3662,12 @@ function assertCloudflareDeployTargetUnchanged(options) {
|
|
|
3401
3662
|
function createCfActivationRunner(options) {
|
|
3402
3663
|
const { cfOutput, accountId, apiBaseUrl, configPath, runWrangler } = options;
|
|
3403
3664
|
if (!cfOutput) return runWrangler;
|
|
3404
|
-
const runCf = createCfCommand({
|
|
3665
|
+
const runCf = observeCfCommand(createCfCommand({
|
|
3405
3666
|
accountId,
|
|
3406
3667
|
apiBaseUrl,
|
|
3407
3668
|
env: deployChildEnv,
|
|
3408
3669
|
verifyUploader: options.cfUploaderIsPinned
|
|
3409
|
-
});
|
|
3670
|
+
}), options.reporter);
|
|
3410
3671
|
return createCfVersionRunner({
|
|
3411
3672
|
output: cfOutput,
|
|
3412
3673
|
workerName: options.workerName,
|
|
@@ -3414,7 +3675,7 @@ function createCfActivationRunner(options) {
|
|
|
3414
3675
|
pinnedUpload: {
|
|
3415
3676
|
accountId,
|
|
3416
3677
|
apiBaseUrl,
|
|
3417
|
-
getToken: () =>
|
|
3678
|
+
getToken: () => readWranglerAuthToken(runWrangler, configPath),
|
|
3418
3679
|
verifyUploader: options.cfUploaderIsPinned
|
|
3419
3680
|
},
|
|
3420
3681
|
verifyResources: createCfResourceVerifier({
|
|
@@ -3495,7 +3756,7 @@ function recordCloudflareActivation(options) {
|
|
|
3495
3756
|
clearCloudflareCandidate(root);
|
|
3496
3757
|
if (options.existingWorker) completeCloudflareLink(root);
|
|
3497
3758
|
acknowledgeWranglerManagedQueueRemovals(configPath, options.queueConsumerCleanup);
|
|
3498
|
-
rememberCloudflareWorkersDevSubdomain(root, options.accountId, execution.previewUrl);
|
|
3759
|
+
if (execution.previewUrl) rememberCloudflareWorkersDevSubdomain(root, options.accountId, execution.previewUrl);
|
|
3499
3760
|
if (execution.trafficConfig) writeWranglerPublishedTrafficSnapshot(configPath, {
|
|
3500
3761
|
workers_dev: execution.trafficConfig.workers_dev,
|
|
3501
3762
|
preview_urls: execution.trafficConfig.preview_urls,
|
|
@@ -3507,10 +3768,33 @@ function recordCloudflareActivation(options) {
|
|
|
3507
3768
|
versionId: execution.versionId
|
|
3508
3769
|
});
|
|
3509
3770
|
}
|
|
3510
|
-
|
|
3511
|
-
|
|
3771
|
+
/**
|
|
3772
|
+
* Record the failed activation, then the end of the deploy, and release the log before the
|
|
3773
|
+
* caller exits. The fields are picked from a fixed list, never spread from the result, and avoid
|
|
3774
|
+
* key names that the log summary masks.
|
|
3775
|
+
*/
|
|
3776
|
+
async function reportCloudflareActivationFailure(reporter, message, execution) {
|
|
3777
|
+
const { cliLog } = reporter;
|
|
3778
|
+
const safeMessage = reporter.redactor.redact(message);
|
|
3779
|
+
cliLog.error("cloudflare_deploy_failed", new Error(safeMessage), {
|
|
3780
|
+
reason: execution.reason,
|
|
3781
|
+
status: execution.status,
|
|
3782
|
+
cloudflareErrorCode: execution.cloudflareErrorCode,
|
|
3783
|
+
versionId: execution.versionId,
|
|
3784
|
+
previousVersionId: execution.previousVersionId,
|
|
3785
|
+
activeVersionId: execution.activeVersionId,
|
|
3786
|
+
rollback: execution.rollback,
|
|
3787
|
+
triggersRestored: execution.triggersRestored,
|
|
3788
|
+
restoreSkipped: execution.restoreSkipped,
|
|
3789
|
+
triggerRepair: execution.triggerRepair,
|
|
3790
|
+
containersUnavailable: execution.containersUnavailable
|
|
3791
|
+
});
|
|
3792
|
+
cliLog.error("deploy_end", void 0, {
|
|
3793
|
+
ok: false,
|
|
3794
|
+
exitCode: 1
|
|
3795
|
+
});
|
|
3512
3796
|
await cliLog.close().catch(() => {});
|
|
3513
|
-
log$1.error(`${
|
|
3797
|
+
log$1.error(`${safeMessage}${cliLog.path ? `\n\nDetailed log: ${cliLog.path}` : ""}`);
|
|
3514
3798
|
}
|
|
3515
3799
|
async function activateCloudflareVersionWithProgress(activate, options) {
|
|
3516
3800
|
const progress = createSpinner();
|
|
@@ -3563,6 +3847,11 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3563
3847
|
case "upload-output-invalid": return "deploy: Wrangler uploaded a version but did not report its version id; production traffic is unchanged.";
|
|
3564
3848
|
case "preview-unavailable":
|
|
3565
3849
|
if (result.diagnostic) return `deploy: candidate readiness cannot be verified.\n\n${result.diagnostic}`;
|
|
3850
|
+
if (result.workersDev === false) return [
|
|
3851
|
+
"deploy: the uploaded Worker Version has no URL Void can use to verify readiness.",
|
|
3852
|
+
"workers.dev is off for this Worker, so an account subdomain does not create one.",
|
|
3853
|
+
"Production traffic is unchanged."
|
|
3854
|
+
].join("\n");
|
|
3566
3855
|
return [
|
|
3567
3856
|
"deploy: the uploaded Worker Version has no preview URL, so Void cannot verify readiness.",
|
|
3568
3857
|
"Set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain (for example \"my-team\")",
|
|
@@ -3571,7 +3860,7 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3571
3860
|
case "readiness-staging-failed": return `deploy: Cloudflare could not stage the uploaded Worker Version at zero-percent traffic${status}; production traffic is unchanged.${cloudflareCode}${diagnostic}${result.cloudflareErrorCode === 10210 && (result.diagnostic ?? "").toLowerCase().includes("durable object migration") ? "\n\nReview the Durable Object migration, then run `void deploy --platform cloudflare --atomic`. For future deploys, set deploy.cloudflare.mode to \"atomic\" in void.config.ts." : result.cloudflareErrorCode === 100405 ? "\n\nThe new version declares different exports from the live version (for example a Durable Object or Workflow class), so Cloudflare cannot split traffic between them. Run `void deploy --platform cloudflare --atomic` once to publish it at 100% directly; it receives traffic before readiness is checked." : ""}`;
|
|
3572
3861
|
case "atomic-failed": return `deploy: Cloudflare could not publish the Worker atomically${status}; inspect production status before retrying.${cloudflareCode}${diagnostic}`;
|
|
3573
3862
|
case "atomic-output-invalid":
|
|
3574
|
-
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published Worker version ${result.versionId} atomically`,
|
|
3863
|
+
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published Worker version ${result.versionId} atomically`, workersDevReadinessRecovery(result.workersDev, "atomic"));
|
|
3575
3864
|
return "deploy: Cloudflare published atomically but did not report its version id. Inspect `void project status` immediately.";
|
|
3576
3865
|
case "atomic-readiness-failed":
|
|
3577
3866
|
case "atomic-readiness-access-denied": return `deploy: the atomic Worker deployment is live, but /__void/ready could not be verified. Inspect \`void project status\` and Worker logs immediately.${diagnostic}${result.customRouteReadinessOrigin ? `\n\n${customRouteAccessHint(result.customRouteReadinessOrigin).join("\n")}` : ""}`;
|
|
@@ -3592,7 +3881,7 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3592
3881
|
].join("\n");
|
|
3593
3882
|
case "bootstrap-failed": return `deploy: Cloudflare could not bootstrap the first Worker deployment${status}.${cloudflareCode}${diagnostic}`;
|
|
3594
3883
|
case "bootstrap-output-invalid":
|
|
3595
|
-
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published the first Worker deployment as version ${result.versionId}`,
|
|
3884
|
+
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published the first Worker deployment as version ${result.versionId}`, workersDevReadinessRecovery(result.workersDev, "bootstrap"));
|
|
3596
3885
|
return ["deploy: Cloudflare bootstrapped the first Worker deployment, but Wrangler", "did not report its version id. Inspect `void project status` before retrying."].join("\n");
|
|
3597
3886
|
case "bootstrap-readiness-failed": return [
|
|
3598
3887
|
"deploy: the first Worker deployment did not pass /__void/ready.",
|
|
@@ -3616,7 +3905,56 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3616
3905
|
"Worker is already active behind Access."
|
|
3617
3906
|
].join("\n");
|
|
3618
3907
|
case "activation-failed": return `deploy: the ready Worker Version could not be activated${status}; production traffic is unchanged.`;
|
|
3619
|
-
case "triggers-failed": return `deploy: the Worker activated, but Cloudflare trigger synchronization failed${status}
|
|
3908
|
+
case "triggers-failed": return [`deploy: the Worker activated, but Cloudflare trigger synchronization failed${status}.${cloudflareCode}`, ...formatCloudflareTriggerRecovery(result)].join("\n");
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
const TRIGGER_KINDS = "routes, schedules, queues, and workflows";
|
|
3912
|
+
const RETRY_DEPLOY = "Fix the cause and run `void deploy --platform cloudflare` again.";
|
|
3913
|
+
const INSPECT_STATUS = "Run `void project status` and check them in Cloudflare before retrying.";
|
|
3914
|
+
/**
|
|
3915
|
+
* Say which version serves production after a trigger synchronization failure. Built only from
|
|
3916
|
+
* the final owner and trigger state: `rollback` cannot tell "kept this deploy" from "switched
|
|
3917
|
+
* back", so reading it once printed a restore that never happened.
|
|
3918
|
+
*/
|
|
3919
|
+
function formatCloudflareTriggerRecovery(result) {
|
|
3920
|
+
const live = result.activeVersionId ?? null;
|
|
3921
|
+
const previous = result.previousVersionId ?? null;
|
|
3922
|
+
const diagnostic = result.diagnostic ? ["", result.diagnostic] : [];
|
|
3923
|
+
if (live === null) return [
|
|
3924
|
+
"Live now: unknown. Void could not read which version serves production.",
|
|
3925
|
+
...result.triggersRestored === "unknown" && previous ? [`Void tried to switch back to the previous version ${previous} and restore its ${TRIGGER_KINDS}, but could not confirm the result.`] : [],
|
|
3926
|
+
`Its ${TRIGGER_KINDS} may be partly updated. ${INSPECT_STATUS}`,
|
|
3927
|
+
...diagnostic
|
|
3928
|
+
];
|
|
3929
|
+
if (live === result.versionId) {
|
|
3930
|
+
const rollbackHint = previous && (result.restoreSkipped === "no-trigger-snapshot" || result.restoreSkipped === "atomic") ? [`To serve the previous version instead, run \`void project rollback ${previous} --platform cloudflare\`.`] : [];
|
|
3931
|
+
return [
|
|
3932
|
+
`Live now: ${live} (this deploy). Its ${TRIGGER_KINDS} may be partly updated.`,
|
|
3933
|
+
keptDeployReason(result.restoreSkipped, previous),
|
|
3934
|
+
RETRY_DEPLOY,
|
|
3935
|
+
...rollbackHint,
|
|
3936
|
+
...diagnostic
|
|
3937
|
+
];
|
|
3938
|
+
}
|
|
3939
|
+
if (live === previous) return [
|
|
3940
|
+
result.triggersRestored === "yes" ? `Live now: ${live} (the previous version). Void switched traffic back to it and restored its ${TRIGGER_KINDS}.` : `Live now: ${live} (the previous version). Void did not restore its ${TRIGGER_KINDS}, so they may be partly updated.`,
|
|
3941
|
+
result.triggersRestored === "yes" ? RETRY_DEPLOY : INSPECT_STATUS,
|
|
3942
|
+
...diagnostic
|
|
3943
|
+
];
|
|
3944
|
+
return [
|
|
3945
|
+
`Live now: ${live}. Another Cloudflare operation changed production while Void was switching back.`,
|
|
3946
|
+
`Its ${TRIGGER_KINDS} may not match it. ${INSPECT_STATUS}`,
|
|
3947
|
+
...diagnostic
|
|
3948
|
+
];
|
|
3949
|
+
}
|
|
3950
|
+
/** Explain why this deploy's version still serves production. */
|
|
3951
|
+
function keptDeployReason(restoreSkipped, previous) {
|
|
3952
|
+
if (!previous) return "This was the first deployment, so there is no previous version to switch back to.";
|
|
3953
|
+
switch (restoreSkipped) {
|
|
3954
|
+
case "placeholder": return `Void did not switch back to the previous version ${previous} because it is an empty placeholder or secret-only draft.`;
|
|
3955
|
+
case "no-trigger-snapshot": return `Void did not switch back to the previous version ${previous} because it has no Void trigger snapshot to restore.`;
|
|
3956
|
+
case "atomic": return `This deploy published at 100% directly, so Void did not switch back to the previous version ${previous}.`;
|
|
3957
|
+
default: return `Void could not switch back to the previous version ${previous}.`;
|
|
3620
3958
|
}
|
|
3621
3959
|
}
|
|
3622
3960
|
/** Explain why a custom-route readiness probe carried no Access credentials. */
|
|
@@ -3638,6 +3976,18 @@ function formatCloudflareReadinessRestoration(result) {
|
|
|
3638
3976
|
}
|
|
3639
3977
|
}
|
|
3640
3978
|
const WORKERS_SUBDOMAIN_EXAMPLE = "(for example \"my-team\", or \"my-team.fed\" for FedRAMP High)";
|
|
3979
|
+
/**
|
|
3980
|
+
* Tell the operator how to recover a publish whose URL Void could not determine.
|
|
3981
|
+
* An account subdomain only becomes a readiness URL when workers.dev is on.
|
|
3982
|
+
*/
|
|
3983
|
+
function workersDevReadinessRecovery(workersDev, kind) {
|
|
3984
|
+
if (workersDev === false) return "workers.dev is off for this Worker, so an account subdomain does not create a readiness URL.";
|
|
3985
|
+
switch (kind) {
|
|
3986
|
+
case "bootstrap": return `If the app uses workers.dev, enable workers.dev for this Worker in the Cloudflare dashboard. Then set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain ${WORKERS_SUBDOMAIN_EXAMPLE}.`;
|
|
3987
|
+
case "atomic": return `If the app uses workers.dev, set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain ${WORKERS_SUBDOMAIN_EXAMPLE}.`;
|
|
3988
|
+
default: return kind;
|
|
3989
|
+
}
|
|
3990
|
+
}
|
|
3641
3991
|
/** Explain a live version whose readiness URL Void could not determine. */
|
|
3642
3992
|
function formatCloudflarePublishWithoutUrl(published, recovery) {
|
|
3643
3993
|
return [
|
|
@@ -3713,6 +4063,7 @@ async function prepareCloudflareFrameworkArtifact(options) {
|
|
|
3713
4063
|
"_routes.json",
|
|
3714
4064
|
"__original.js",
|
|
3715
4065
|
"__original.mjs",
|
|
4066
|
+
"__void_handlers.js",
|
|
3716
4067
|
"__void_handlers.mjs",
|
|
3717
4068
|
"__void_isr*.mjs",
|
|
3718
4069
|
"__void_migration_handler*.mjs"
|
|
@@ -3816,7 +4167,7 @@ function planStaticEdgeRouting(options) {
|
|
|
3816
4167
|
assetHeaders: generatedHeaders
|
|
3817
4168
|
};
|
|
3818
4169
|
}
|
|
3819
|
-
async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate) {
|
|
4170
|
+
async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate, reporter) {
|
|
3820
4171
|
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
3821
4172
|
const configPath = discoverRootWranglerConfig(root);
|
|
3822
4173
|
const connection = await connectCloudflareDeployAccount({
|
|
@@ -3825,7 +4176,8 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3825
4176
|
rootConfig: parseRootWranglerConfig(configPath),
|
|
3826
4177
|
deps,
|
|
3827
4178
|
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
3828
|
-
readinessAccessOrigin: options.readinessAccessOrigin
|
|
4179
|
+
readinessAccessOrigin: options.readinessAccessOrigin,
|
|
4180
|
+
reporter
|
|
3829
4181
|
});
|
|
3830
4182
|
if (!connection || !await confirmCloudflareDeployAuthentication(connection, configPath)) return exit(1);
|
|
3831
4183
|
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
@@ -3942,7 +4294,8 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3942
4294
|
configPath: staticConfigPath,
|
|
3943
4295
|
runWrangler,
|
|
3944
4296
|
cfUploaderIsPinned,
|
|
3945
|
-
verifyCompatibilityRunner: assertUploaderStillPinned
|
|
4297
|
+
verifyCompatibilityRunner: assertUploaderStillPinned,
|
|
4298
|
+
reporter
|
|
3946
4299
|
});
|
|
3947
4300
|
const execution = await activateCloudflareVersionWithProgress(deps.activateVersion ?? activateCloudflareVersion, {
|
|
3948
4301
|
...cloudflareCandidateActivationOptions({
|
|
@@ -3976,7 +4329,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3976
4329
|
assetsDirectoryOverride: stagedAssetsDirectory
|
|
3977
4330
|
}).finally(() => cfOutput?.dispose());
|
|
3978
4331
|
if (!execution.ok) {
|
|
3979
|
-
await reportCloudflareActivationFailure(
|
|
4332
|
+
await reportCloudflareActivationFailure(reporter, formatCloudflareActivationError(execution), execution);
|
|
3980
4333
|
return exit(1);
|
|
3981
4334
|
}
|
|
3982
4335
|
recordCloudflareActivation({
|
|
@@ -4433,7 +4786,7 @@ async function buildCloudflareWorker(input) {
|
|
|
4433
4786
|
if (!assertUploaderStillPinned()) return exit(1);
|
|
4434
4787
|
const migrations = collectMigrations(migrationsDir);
|
|
4435
4788
|
if (existingWorker && migrations.length) throw new Error("The build added database migrations. Link the existing site before making schema changes.");
|
|
4436
|
-
if (dialect !== "sqlite" && migrations.length > 0 && !process.env.DATABASE_URL) {
|
|
4789
|
+
if (!input.skipMigrations && dialect !== "sqlite" && migrations.length > 0 && !process.env.DATABASE_URL) {
|
|
4437
4790
|
log$1.error(`deploy: the build added ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} migrations, but DATABASE_URL is not set. Refusing to upload a Worker against an unmigrated database.`);
|
|
4438
4791
|
return exit(1);
|
|
4439
4792
|
}
|
|
@@ -4607,7 +4960,11 @@ async function migrateCloudflareWorker(input) {
|
|
|
4607
4960
|
}
|
|
4608
4961
|
}
|
|
4609
4962
|
let appliedMigrations = 0;
|
|
4610
|
-
if (
|
|
4963
|
+
if (input.skipMigrations) {
|
|
4964
|
+
log$1.info("Skipping database migrations.");
|
|
4965
|
+
cliLog.info("cloudflare_migrations_skipped");
|
|
4966
|
+
}
|
|
4967
|
+
if (!input.skipMigrations && dialect !== "sqlite" && migrations.length > 0) {
|
|
4611
4968
|
const mysql = dialect === "mysql";
|
|
4612
4969
|
const label = mysql ? "MySQL" : "PostgreSQL";
|
|
4613
4970
|
const databaseUrl = process.env.DATABASE_URL;
|
|
@@ -4625,7 +4982,7 @@ async function migrateCloudflareWorker(input) {
|
|
|
4625
4982
|
return exit(1);
|
|
4626
4983
|
}
|
|
4627
4984
|
}
|
|
4628
|
-
const d1 = await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, readDeploymentPlatform(root) !== "cloudflare");
|
|
4985
|
+
const d1 = input.skipMigrations ? { restoreCommand: void 0 } : await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, readDeploymentPlatform(root) !== "cloudflare");
|
|
4629
4986
|
if (!d1) return exit(1);
|
|
4630
4987
|
const d1RestoreCommand = d1.restoreCommand;
|
|
4631
4988
|
if (!verifyCloudflareDeployArtifact(root, deps, {
|
|
@@ -4636,6 +4993,7 @@ async function migrateCloudflareWorker(input) {
|
|
|
4636
4993
|
return exit(1);
|
|
4637
4994
|
}
|
|
4638
4995
|
return {
|
|
4996
|
+
migrationHistory: input.skipMigrations ? null : migrations.map((migration) => migration.name),
|
|
4639
4997
|
workerWasMissingBeforeSecretProvisioning,
|
|
4640
4998
|
initialAuthSecret,
|
|
4641
4999
|
appliedMigrations,
|
|
@@ -5012,7 +5370,7 @@ async function prepareCloudflareDeploySource(root, options, voidConfig) {
|
|
|
5012
5370
|
const configPath = discoverRootWranglerConfig(root);
|
|
5013
5371
|
const facts = await computeDesiredCloudflareResources(root, voidConfig, configPath, application);
|
|
5014
5372
|
const { desired, dialect, migrations: preBuildMigrations, migrationsDir } = facts;
|
|
5015
|
-
if (dialect !== "sqlite" && preBuildMigrations.length > 0 && !process.env.DATABASE_URL) {
|
|
5373
|
+
if (!options.skipMigrations && dialect !== "sqlite" && preBuildMigrations.length > 0 && !process.env.DATABASE_URL) {
|
|
5016
5374
|
log$1.error([
|
|
5017
5375
|
`deploy: ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} migrations require DATABASE_URL for --platform cloudflare.`,
|
|
5018
5376
|
"Set the production connection string in the deploy environment. Void uses it only to",
|
|
@@ -5043,7 +5401,7 @@ async function prepareCloudflareDeploySource(root, options, voidConfig) {
|
|
|
5043
5401
|
}
|
|
5044
5402
|
/** Pin the account and uploader, set up email, provision resources and snapshot the pins. */
|
|
5045
5403
|
async function preflightCloudflareWorker(input) {
|
|
5046
|
-
const { root, voidConfig, options, deps, exit, cliLog, initialCloudflareLink, detectedFramework, source } = input;
|
|
5404
|
+
const { root, voidConfig, options, deps, exit, cliLog, reporter, initialCloudflareLink, detectedFramework, source } = input;
|
|
5047
5405
|
const { configPath, needsSandbox, needsEmail, emailHandlers, authEnabled, needsAI, expectedCrons, desired, migrations: preBuildMigrations, reasons, needsLive } = source;
|
|
5048
5406
|
let rootConfig = parseRootWranglerConfig(configPath);
|
|
5049
5407
|
if (needsSandbox) try {
|
|
@@ -5058,7 +5416,8 @@ async function preflightCloudflareWorker(input) {
|
|
|
5058
5416
|
rootConfig,
|
|
5059
5417
|
deps,
|
|
5060
5418
|
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
5061
|
-
readinessAccessOrigin: options.readinessAccessOrigin
|
|
5419
|
+
readinessAccessOrigin: options.readinessAccessOrigin,
|
|
5420
|
+
reporter
|
|
5062
5421
|
});
|
|
5063
5422
|
if (!connection) return exit(1);
|
|
5064
5423
|
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
@@ -5313,10 +5672,11 @@ async function preflightCloudflareWorker(input) {
|
|
|
5313
5672
|
// src/cli/deploy-cloudflare-publish.ts
|
|
5314
5673
|
/** Upload the verified Worker as a candidate version, probe it, and activate it. */
|
|
5315
5674
|
async function publishCloudflareWorker(input) {
|
|
5316
|
-
const { root, deps, exit, cliLog, atomic, detectedFramework
|
|
5675
|
+
const { root, deps, exit, cliLog, reporter, atomic, detectedFramework } = input;
|
|
5676
|
+
const { initialCloudflareCandidate } = input;
|
|
5317
5677
|
const { configPath, needsSandbox, desired, analysis } = input.source;
|
|
5318
5678
|
const { usesCf, existingWorker, pinnedHandoffLink, accountId, workerName, cfUploaderIsPinned, apiBaseUrl, complianceRegion, runWrangler, assertUploaderStillPinned, schemaFacts, approvedHandoffKv, workersDevSubdomain, readinessAccessOrigin } = input.preflight;
|
|
5319
|
-
const {
|
|
5679
|
+
const { d1MigrateToken, generatedConfigPath, prepareBuildOutput } = input.build;
|
|
5320
5680
|
const { workerWasMissingBeforeSecretProvisioning, initialAuthSecret, appliedMigrations } = input.migration;
|
|
5321
5681
|
const queueConsumerCleanup = readWranglerManagedQueueCleanupCandidates(configPath);
|
|
5322
5682
|
assertCloudflareDeployTargetUnchanged({
|
|
@@ -5341,7 +5701,8 @@ async function publishCloudflareWorker(input) {
|
|
|
5341
5701
|
configPath: generatedConfigPath,
|
|
5342
5702
|
runWrangler,
|
|
5343
5703
|
cfUploaderIsPinned,
|
|
5344
|
-
verifyCompatibilityRunner: assertUploaderStillPinned
|
|
5704
|
+
verifyCompatibilityRunner: assertUploaderStillPinned,
|
|
5705
|
+
reporter
|
|
5345
5706
|
});
|
|
5346
5707
|
const pinActiveSecrets = createActiveSecretPinner({
|
|
5347
5708
|
output: cfOutput,
|
|
@@ -5374,7 +5735,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5374
5735
|
verifyUploader: cfOutput ? cfUploaderIsPinned : assertUploaderStillPinned,
|
|
5375
5736
|
requireVersionMetadata: existingWorker === null || hasVersionMetadata,
|
|
5376
5737
|
requirePreviewForReadiness: existingWorker !== null && !hasVersionMetadata,
|
|
5377
|
-
message: encodeCloudflareVersionMessage(
|
|
5738
|
+
message: encodeCloudflareVersionMessage(input.migration.migrationHistory, {
|
|
5378
5739
|
...readCloudflareTriggerConfig(generatedConfigPath, configPath),
|
|
5379
5740
|
...existingWorker ? { preserve: true } : {}
|
|
5380
5741
|
}),
|
|
@@ -5385,7 +5746,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5385
5746
|
}).finally(() => cfOutput?.dispose());
|
|
5386
5747
|
if (!execution.ok) {
|
|
5387
5748
|
if (execution.reason === "atomic-readiness-failed" || execution.reason === "atomic-readiness-access-denied") clearCloudflareCandidate(root);
|
|
5388
|
-
await reportCloudflareActivationFailure(
|
|
5749
|
+
await reportCloudflareActivationFailure(reporter, needsSandbox && execution.containersUnavailable ? formatCloudflareSandboxUnavailable() : formatCloudflareActivationError(execution), execution);
|
|
5389
5750
|
return exit(1);
|
|
5390
5751
|
}
|
|
5391
5752
|
recordCloudflareActivation({
|
|
@@ -5401,7 +5762,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5401
5762
|
note(formatDeploySummary({
|
|
5402
5763
|
workerName,
|
|
5403
5764
|
migrations: appliedMigrations,
|
|
5404
|
-
d1MigrationsCurrent: d1MigrateToken !== void 0,
|
|
5765
|
+
d1MigrationsCurrent: input.migration.migrationHistory !== null && d1MigrateToken !== void 0,
|
|
5405
5766
|
cronJobs: existingWorker ? void 0 : analysis.jobs.length,
|
|
5406
5767
|
queues: existingWorker ? void 0 : desired.queues.length,
|
|
5407
5768
|
framework: detectedFramework?.name
|
|
@@ -5413,7 +5774,23 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5413
5774
|
options = withRecordedReadinessAccessOrigin(options);
|
|
5414
5775
|
const initialCloudflareLink = readCloudflareLink(root);
|
|
5415
5776
|
const initialCloudflareCandidate = readCloudflareCandidate(root);
|
|
5416
|
-
const
|
|
5777
|
+
const exitProcess = deps.exit ?? ((code) => process.exit(code));
|
|
5778
|
+
const exit = (code) => {
|
|
5779
|
+
if (code === 0) cliLog.info("deploy_end", {
|
|
5780
|
+
ok: true,
|
|
5781
|
+
exitCode: code
|
|
5782
|
+
});
|
|
5783
|
+
else cliLog.error("deploy_end", void 0, {
|
|
5784
|
+
ok: false,
|
|
5785
|
+
exitCode: code
|
|
5786
|
+
});
|
|
5787
|
+
return exitProcess(code);
|
|
5788
|
+
};
|
|
5789
|
+
deps = {
|
|
5790
|
+
...deps,
|
|
5791
|
+
exit
|
|
5792
|
+
};
|
|
5793
|
+
const reporter = createCloudflareChildReporter(cliLog);
|
|
5417
5794
|
const voidConfig = readConfig(root);
|
|
5418
5795
|
const atomic = options.atomic === true || voidConfig.deploy?.cloudflare?.mode === "atomic";
|
|
5419
5796
|
if (atomic && (options.reuseExistingWorker || initialCloudflareLink)) {
|
|
@@ -5445,7 +5822,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5445
5822
|
log$1.error("deploy: atomic deployment is only for Workers with Durable Objects.");
|
|
5446
5823
|
return exit(1);
|
|
5447
5824
|
}
|
|
5448
|
-
return runCloudflareStaticDeploy(root, options, voidConfig, staticPreset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate);
|
|
5825
|
+
return runCloudflareStaticDeploy(root, options, voidConfig, staticPreset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate, reporter);
|
|
5449
5826
|
}
|
|
5450
5827
|
if (detectedFramework && voidConfig.routing?.alwaysUseHttps === true) {
|
|
5451
5828
|
log$1.error([
|
|
@@ -5464,6 +5841,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5464
5841
|
deps,
|
|
5465
5842
|
exit,
|
|
5466
5843
|
cliLog,
|
|
5844
|
+
reporter,
|
|
5467
5845
|
initialCloudflareLink,
|
|
5468
5846
|
detectedFramework,
|
|
5469
5847
|
source
|
|
@@ -5475,6 +5853,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5475
5853
|
deps,
|
|
5476
5854
|
exit,
|
|
5477
5855
|
atomic,
|
|
5856
|
+
skipMigrations: options.skipMigrations,
|
|
5478
5857
|
frameworkPreset,
|
|
5479
5858
|
detectedFramework,
|
|
5480
5859
|
source,
|
|
@@ -5487,7 +5866,8 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5487
5866
|
cliLog,
|
|
5488
5867
|
source,
|
|
5489
5868
|
preflight,
|
|
5490
|
-
build
|
|
5869
|
+
build,
|
|
5870
|
+
skipMigrations: options.skipMigrations
|
|
5491
5871
|
});
|
|
5492
5872
|
let restoreReported = false;
|
|
5493
5873
|
const reportRestore = () => {
|
|
@@ -5506,6 +5886,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5506
5886
|
deps,
|
|
5507
5887
|
exit: exitAfterMigrations,
|
|
5508
5888
|
cliLog,
|
|
5889
|
+
reporter,
|
|
5509
5890
|
atomic,
|
|
5510
5891
|
detectedFramework,
|
|
5511
5892
|
initialCloudflareCandidate,
|
|
@@ -5525,7 +5906,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5525
5906
|
/**
|
|
5526
5907
|
* Class B/C framework deploy: build with framework CLI, package with preset output paths.
|
|
5527
5908
|
*/
|
|
5528
|
-
async function runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, skipBuild, gitMetadata, cliLog) {
|
|
5909
|
+
async function runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, skipBuild, gitMetadata, cliLog, skipMigrations) {
|
|
5529
5910
|
log$1.info(`${detected.name} framework deploy`);
|
|
5530
5911
|
cliLog?.info("deploy_mode", {
|
|
5531
5912
|
mode: "framework",
|
|
@@ -5641,6 +6022,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
5641
6022
|
fallbackRules,
|
|
5642
6023
|
dialect
|
|
5643
6024
|
});
|
|
6025
|
+
if (skipMigrations) manifest.migrationMode = "skip";
|
|
5644
6026
|
const workerFiles = collectWorkerFiles(actualWorkerDir);
|
|
5645
6027
|
cliLog?.info("package_end", {
|
|
5646
6028
|
mode: "framework",
|
|
@@ -5675,7 +6057,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
5675
6057
|
printDeploySuccess(result.published !== false);
|
|
5676
6058
|
}
|
|
5677
6059
|
// src/cli/deploy-managed-full.ts
|
|
5678
|
-
async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBuild, gitMetadata, detected, cliLog) {
|
|
6060
|
+
async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBuild, gitMetadata, detected, cliLog, skipMigrations) {
|
|
5679
6061
|
cliLog?.info("deploy_mode", {
|
|
5680
6062
|
mode: "full",
|
|
5681
6063
|
framework: detected?.name
|
|
@@ -5899,6 +6281,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5899
6281
|
webSockets,
|
|
5900
6282
|
durableObjects: analysis.durableObjects
|
|
5901
6283
|
}, voidConfig.routing?.revalidate, voidConfig.routing?.isr !== false);
|
|
6284
|
+
if (skipMigrations) manifest.migrationMode = "skip";
|
|
5902
6285
|
const workerDir = join(distDir, workerDirName);
|
|
5903
6286
|
if (isFrameworkMode) {
|
|
5904
6287
|
const wrapperFeatures = {
|
|
@@ -6143,33 +6526,32 @@ function openDeployLog(opts) {
|
|
|
6143
6526
|
const mirror = opts?.mirrorToStderr === true;
|
|
6144
6527
|
const startedAt = Date.now();
|
|
6145
6528
|
let path = null;
|
|
6146
|
-
let
|
|
6529
|
+
let fd = null;
|
|
6147
6530
|
let broken = false;
|
|
6148
6531
|
let closed = false;
|
|
6532
|
+
let ended = false;
|
|
6149
6533
|
try {
|
|
6150
6534
|
const dir = join(homedir(), ".void", "logs");
|
|
6151
6535
|
mkdirSync(dir, { recursive: true });
|
|
6152
6536
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
6153
6537
|
const suffix = randomBytes(3).toString("hex");
|
|
6154
6538
|
const filePath = join(dir, `deploy-${ts}-${process.pid}-${suffix}.jsonl`);
|
|
6155
|
-
|
|
6156
|
-
flags: "wx",
|
|
6157
|
-
autoClose: true
|
|
6158
|
-
});
|
|
6159
|
-
stream.on("error", () => {
|
|
6160
|
-
broken = true;
|
|
6161
|
-
});
|
|
6539
|
+
fd = openSync(filePath, "wx", 384);
|
|
6162
6540
|
path = filePath;
|
|
6163
6541
|
} catch {
|
|
6164
6542
|
broken = true;
|
|
6165
6543
|
path = null;
|
|
6166
|
-
|
|
6544
|
+
fd = null;
|
|
6167
6545
|
}
|
|
6168
6546
|
function write(level, msg, err, fields) {
|
|
6547
|
+
if (msg === "deploy_end") {
|
|
6548
|
+
if (ended) return;
|
|
6549
|
+
ended = true;
|
|
6550
|
+
}
|
|
6169
6551
|
if (mirror) try {
|
|
6170
6552
|
process.stderr.write(`${formatStderrLine(level, msg, err, fields)}\n`);
|
|
6171
6553
|
} catch {}
|
|
6172
|
-
if (broken ||
|
|
6554
|
+
if (broken || fd === null || closed) return;
|
|
6173
6555
|
const now = Date.now();
|
|
6174
6556
|
const record = {
|
|
6175
6557
|
ts: now,
|
|
@@ -6194,7 +6576,9 @@ function openDeployLog(opts) {
|
|
|
6194
6576
|
})}\n`;
|
|
6195
6577
|
}
|
|
6196
6578
|
try {
|
|
6197
|
-
|
|
6579
|
+
const bytes = Buffer.from(line);
|
|
6580
|
+
let offset = 0;
|
|
6581
|
+
while (offset < bytes.length) offset += writeSync(fd, bytes, offset);
|
|
6198
6582
|
} catch {
|
|
6199
6583
|
broken = true;
|
|
6200
6584
|
}
|
|
@@ -6218,14 +6602,13 @@ function openDeployLog(opts) {
|
|
|
6218
6602
|
close() {
|
|
6219
6603
|
if (closed) return Promise.resolve();
|
|
6220
6604
|
closed = true;
|
|
6221
|
-
if (
|
|
6222
|
-
return new Promise((resolveClose) => {
|
|
6605
|
+
if (fd !== null) {
|
|
6223
6606
|
try {
|
|
6224
|
-
|
|
6225
|
-
} catch {
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6607
|
+
closeSync(fd);
|
|
6608
|
+
} catch {}
|
|
6609
|
+
fd = null;
|
|
6610
|
+
}
|
|
6611
|
+
return Promise.resolve();
|
|
6229
6612
|
}
|
|
6230
6613
|
};
|
|
6231
6614
|
}
|
|
@@ -6386,6 +6769,7 @@ async function runDeploy(root, options) {
|
|
|
6386
6769
|
dir: options?.dir,
|
|
6387
6770
|
spa: options?.spa === true ? true : void 0,
|
|
6388
6771
|
skipBuild: options?.skipBuild === true ? true : void 0,
|
|
6772
|
+
skipMigrations: options?.skipMigrations === true ? true : void 0,
|
|
6389
6773
|
nodeVersion: process.version,
|
|
6390
6774
|
platform: process.platform,
|
|
6391
6775
|
arch: process.arch
|
|
@@ -6525,6 +6909,7 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6525
6909
|
root,
|
|
6526
6910
|
cliLog
|
|
6527
6911
|
});
|
|
6912
|
+
if (options.skipMigrations) await client.requireMigrationSkipSupport();
|
|
6528
6913
|
let config = null;
|
|
6529
6914
|
if (requestedProjectSlug) {
|
|
6530
6915
|
const linked = linkedProject?.slug === requestedProjectSlug ? await client.getProject(linkedProject.projectId) : null;
|
|
@@ -6592,8 +6977,8 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6592
6977
|
log$1.error(`No deploy preset found for framework "${detected.name}".`);
|
|
6593
6978
|
process.exit(1);
|
|
6594
6979
|
}
|
|
6595
|
-
await runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, options?.skipBuild, gitMetadata, cliLog);
|
|
6596
|
-
} else await runFullDeploy(root, config, client, voidConfig, fwPreset, options?.skipBuild, gitMetadata, detected, cliLog);
|
|
6980
|
+
await runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, options?.skipBuild, gitMetadata, cliLog, options.skipMigrations);
|
|
6981
|
+
} else await runFullDeploy(root, config, client, voidConfig, fwPreset, options?.skipBuild, gitMetadata, detected, cliLog, options.skipMigrations);
|
|
6597
6982
|
return;
|
|
6598
6983
|
}
|
|
6599
6984
|
if (!preset && !voidConfig.inference?.appType) preset = detectPreset(root, {
|
|
@@ -6606,7 +6991,7 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6606
6991
|
buildCommand: resolveStaticBuildCommand(preset, voidConfig.inference?.build, Boolean(options?.dir))
|
|
6607
6992
|
};
|
|
6608
6993
|
await runStaticDeploy(root, config, client, preset, options?.skipBuild, gitMetadata, void 0, void 0, void 0, void 0, voidConfig.routing, cliLog);
|
|
6609
|
-
} else await runFullDeploy(root, config, client, voidConfig, void 0, options?.skipBuild, gitMetadata, void 0, cliLog);
|
|
6994
|
+
} else await runFullDeploy(root, config, client, voidConfig, void 0, options?.skipBuild, gitMetadata, void 0, cliLog, options.skipMigrations);
|
|
6610
6995
|
return;
|
|
6611
6996
|
} catch (error) {
|
|
6612
6997
|
if (isExpiredTokenError(error)) {
|