void 1.6.2 → 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-D903EEWQ.mjs → account-cmd-BfkJ_1PC.mjs} +6 -6
- package/dist/{application-analysis-DlUG-XNT.mjs → application-analysis-OV0CBJ80.mjs} +8 -7
- package/dist/{application-routing-GCBSwXA9.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-g9J7MSmP.mjs → auth-link-CW1Zh6FM.mjs} +6 -6
- package/dist/{auth-router-DMZbG9Qn.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-CuS42-9A.mjs → cloudflare-auth-DGIivpTb.mjs} +1 -1
- package/dist/{cloudflare-cmd-DTF19-j-.mjs → cloudflare-cmd-DJaxC-bc.mjs} +5 -5
- package/dist/{cloudflare-config-Ce8j5S7V.mjs → cloudflare-config-DtOGAbeB.mjs} +2 -2
- package/dist/{cloudflare-connect-BN4dHp8i.mjs → cloudflare-connect-BjpWmglw.mjs} +3 -3
- package/dist/{cloudflare-operations-laxRA8HN.mjs → cloudflare-operations-CZkjFrzH.mjs} +1 -1
- package/dist/{cloudflare-operations-DrZGzQap.mjs → cloudflare-operations-k7wYUv56.mjs} +6 -6
- package/dist/{cloudflare-process-D9aC-jXr.mjs → cloudflare-process-BcPvlMFd.mjs} +2 -2
- package/dist/{config-hL-S-Y9D.mjs → config-5oSQhZNj.mjs} +3 -1
- package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
- package/dist/{config-CNDjO-15.mjs → config-DcqUBGCb.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-DMR0i3Z2.mjs → config-wo2EaH0X.mjs} +1 -1
- package/dist/{connect-DHepM7Xs.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-CqfT6lhV.mjs → db-DyLzzxvM.mjs} +38 -38
- package/dist/{db-types-DRmxBJ2K.mjs → db-types-DdHHUVPy.mjs} +1 -1
- package/dist/{delete-CY4L8fi2.mjs → delete-Dey6YoMA.mjs} +5 -5
- package/dist/{deploy-La_Ly8g_.mjs → deploy-Ccw2D2lw.mjs} +491 -109
- package/dist/deploy-DEZkUS77.mjs +2 -0
- package/dist/{deploy-managed-static-CESLfKHN.mjs → deploy-managed-static-BBVtpuGv.mjs} +16 -16
- package/dist/{deploy-transport-DcI6LXhY.mjs → deploy-transport-Dt0IvSVW.mjs} +2 -2
- package/dist/deploy.mjs +8 -8
- package/dist/{dispatch-DM4Xdd2l.mjs → dispatch-pYaww76u.mjs} +4 -4
- package/dist/{dist-D23AAMxT.mjs → dist-BQdgCVQF.mjs} +1 -1
- package/dist/{dist-eV_Ep60B.mjs → dist-DeTdhbZc.mjs} +1 -1
- package/dist/{domain-BD1KOQL3.mjs → domain-Dh3mG8Vs.mjs} +6 -6
- package/dist/{email-XAspopcj.mjs → email-DKyMjOYM.mjs} +10 -10
- package/dist/{email-cloudflare-RxIQoPc9.mjs → email-cloudflare-CTt2n_W2.mjs} +13 -9
- package/dist/{env-DrYUh55t.mjs → env-DkZzh_Dd.mjs} +7 -7
- package/dist/env-mask-D31Qztl9.mjs +46 -0
- package/dist/{env-validation-Del3C8AY.mjs → env-validation-1snjKtDX.mjs} +4 -4
- package/dist/{env-validation-Bosj7EVg.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-DSkScMIz.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-DnI_au0K.mjs → handler-C9SnmeW1.mjs} +5 -4
- package/dist/{handler-BR6Tvjkp.d.mts → handler-DjqciiDc.d.mts} +20 -7
- package/dist/{headers--cbz6iZ8.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 +154 -109
- package/dist/{info-BpxpsX0B.mjs → info-DwB8IWIx.mjs} +4 -4
- package/dist/{init-DpVXO5S-.mjs → init-CUGSmcED.mjs} +33 -31
- package/dist/{link-DAXOT-G_.mjs → link-BlRTGHan.mjs} +6 -6
- package/dist/{list-BFQ0gcML.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-CLVPP6v7.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
- package/dist/login-C4q1S-5b.mjs +1 -0
- package/dist/{login-RIw7ffPe.mjs → login-TA51e5Fw.mjs} +5 -5
- package/dist/{logs-B2OeLS4X.mjs → logs-BlyAxlvx.mjs} +6 -6
- package/dist/{migrate-DiI50Chz.mjs → migrate-BH6LCr00.mjs} +5 -5
- package/dist/migrate-CVBsSFhC.mjs +1 -0
- package/dist/nitro.d.mts +5 -0
- package/dist/nitro.mjs +27 -8
- package/dist/{node-Bc-dBAGL.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-CEI5Aaza.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 +16 -13
- package/dist/pages/client.mjs +34 -66
- package/dist/pages/index.d.mts +4 -3
- package/dist/pages/index.mjs +6 -6
- 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-ZrYm8KVs.mjs → platform-auth-config-MO0VdVs9.mjs} +10 -10
- package/dist/{platform-auth-protection-t6mdY4nn.mjs → platform-auth-protection-Dv208eyL.mjs} +8 -8
- package/dist/{platform-auth-recovery-XeBmPTXx.mjs → platform-auth-recovery-DvAQ674F.mjs} +7 -7
- package/dist/{platform-cmd-C7BevP9b.mjs → platform-cmd-BpUA19r_.mjs} +1 -1
- package/dist/{platform-cmd-EXehmSYA.mjs → platform-cmd-dlSxrcQ7.mjs} +9 -9
- package/dist/{platform-domain-DR263ObA.mjs → platform-domain-DSO4eUEw.mjs} +5 -5
- package/dist/{platform-lifecycle-BvU_TNji.mjs → platform-lifecycle-BSvsyB_x.mjs} +17 -17
- package/dist/{platform-lifecycle-CN4aXldN.mjs → platform-lifecycle-CfcFygHb.mjs} +1 -1
- package/dist/{platform-management-yS2sve3V.mjs → platform-management-BMdyt667.mjs} +1 -1
- package/dist/{platform-management-_UE1_GM8.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-CPVk9-Q4.mjs → platform-recovery-CHWwXVZ6.mjs} +3 -3
- package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-BTQVbnTC.mjs} +3 -3
- package/dist/{plugin-inference-bQ1Be840.mjs → plugin-inference-g66Q1Mx9.mjs} +4 -4
- package/dist/prepare-Bx4a8cb1.mjs +1 -0
- package/dist/{prepare-BkRhDnxw.mjs → prepare-DJYHjpzq.mjs} +3 -3
- package/dist/{prepare-D8L9AQbw.mjs → prepare-DXduEwQp.mjs} +11 -8
- 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-DH3CuFC6.mjs → project-cmd-Dfb1Sg8w.mjs} +18 -18
- 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-BMveFb4b.mjs → project-tsconfig-nhnTWO_Y.mjs} +3 -1
- 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-CYhZR_Mn.mjs → provision-CMH4-8ri.mjs} +1 -1
- package/dist/{provision-B0HqoRuI.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-AVwiMAkk.mjs → rollback-BfCs2la4.mjs} +7 -7
- package/dist/{route-types-e69EqY88.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 +93 -11
- 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-F0psanp7.mjs → scan-L8OSv1f7.mjs} +10 -7
- package/dist/{secret-szNdoeKa.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-BC3LK7Y-.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
- package/dist/wrangler-R3kMdJfw.mjs +1 -0
- package/dist/{wrangler-Gn4EoY4-.mjs → wrangler-k40T7XTQ.mjs} +2 -2
- package/dist/{wrapper-B9W9RE8z.mjs → wrapper-BGsi_uHs.mjs} +11 -8
- 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/prerendering.md +9 -4
- package/docs/guide/edge/revalidation.md +3 -0
- package/docs/guide/live.md +2 -0
- package/docs/guide/pages-routing/actions-and-forms.md +15 -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/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 +8 -8
- package/docs/reference/api/resources.md +3 -1
- package/docs/reference/api/rewrites.md +16 -4
- 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-DMhOyebt.mjs +0 -2
- package/dist/gen-BbT1Ku1P.mjs +0 -1
- package/dist/help-Ba8Dq5-r.mjs +0 -1
- package/dist/login-BX2gzHUt.mjs +0 -1
- package/dist/migrate-CUGMGaIM.mjs +0 -1
- package/dist/operator-cmd-oTT2MA9G.mjs +0 -1
- package/dist/output-E6gecbbV.mjs +0 -1
- package/dist/platform-args-C7XUw9mw.mjs +0 -1
- package/dist/prepare-CZRVGNld.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-CQ5c-MtJ.mjs +0 -1
- package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
- package/dist/{config-s6TkpSat.mjs → config-eeDzKBS9.mjs} +1 -1
- package/dist/{entry-DFBca6aS.mjs → entry-Bw-G1VVx.mjs} +1 -1
- package/dist/{env-types-Bd8DkQhl.mjs → env-types-Dz9qkiOn.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-DFBca6aS.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--cbz6iZ8.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-GCBSwXA9.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-Del3C8AY.mjs";
|
|
39
|
-
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-B9W9RE8z.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-CESLfKHN.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-B0HqoRuI.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-DcI6LXhY.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-CuS42-9A.mjs";
|
|
47
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-DrZGzQap.mjs";
|
|
48
|
-
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-CLJXXN93.mjs";
|
|
49
|
-
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-DiI50Chz.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
|
}
|
|
@@ -2712,6 +2903,25 @@ function failed(message) {
|
|
|
2712
2903
|
stderr: message
|
|
2713
2904
|
};
|
|
2714
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
|
+
}
|
|
2715
2925
|
function parseJson(value) {
|
|
2716
2926
|
try {
|
|
2717
2927
|
return JSON.parse(value);
|
|
@@ -2965,6 +3175,47 @@ function createCfVersionRunner(options) {
|
|
|
2965
3175
|
} : void 0
|
|
2966
3176
|
};
|
|
2967
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
|
+
};
|
|
2968
3219
|
const verifyResources = async (directory) => {
|
|
2969
3220
|
try {
|
|
2970
3221
|
return await options.verifyResources(directory);
|
|
@@ -2980,8 +3231,9 @@ function createCfVersionRunner(options) {
|
|
|
2980
3231
|
};
|
|
2981
3232
|
const uploadPinnedVersion = async (operation, atomic) => {
|
|
2982
3233
|
if (!options.pinnedUpload || !options.pinnedUpload.verifyUploader()) return failed("The version-aware Cloudflare uploader is unavailable.");
|
|
2983
|
-
const
|
|
2984
|
-
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;
|
|
2985
3237
|
try {
|
|
2986
3238
|
const version = await uploadPinnedCloudflareVersion({
|
|
2987
3239
|
output,
|
|
@@ -3122,6 +3374,8 @@ function createCfVersionRunner(options) {
|
|
|
3122
3374
|
if (operation.type === "versions.upload") {
|
|
3123
3375
|
const blocked = await checkUploadTarget(operation, "The Cloudflare version upload target changed.");
|
|
3124
3376
|
if (blocked) return blocked;
|
|
3377
|
+
const settings = await prepareSettingsCredential(operation.message);
|
|
3378
|
+
if (settings) return settings;
|
|
3125
3379
|
if (output.activeSecrets) return uploadPinnedVersion(operation, false);
|
|
3126
3380
|
return uploadedResult(await run([
|
|
3127
3381
|
"workers",
|
|
@@ -3162,6 +3416,8 @@ function createCfVersionRunner(options) {
|
|
|
3162
3416
|
if (operation.type === "worker.deploy") {
|
|
3163
3417
|
const blocked = await checkUploadTarget(operation, "The Cloudflare bootstrap target changed.");
|
|
3164
3418
|
if (blocked) return blocked;
|
|
3419
|
+
const settings = await prepareSettingsCredential(operation.message);
|
|
3420
|
+
if (settings) return settings;
|
|
3165
3421
|
if (output.activeSecrets) return uploadPinnedVersion(operation, true);
|
|
3166
3422
|
return uploadedResult(await run([
|
|
3167
3423
|
"deploy",
|
|
@@ -3219,8 +3475,10 @@ function createCfVersionRunner(options) {
|
|
|
3219
3475
|
const credentials = options.pinnedUpload;
|
|
3220
3476
|
if (!credentials || !credentials.verifyUploader()) return failed("The Cloudflare settings publisher is unavailable.");
|
|
3221
3477
|
try {
|
|
3222
|
-
const
|
|
3223
|
-
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;
|
|
3224
3482
|
await publishCloudflareWorkerSettings({
|
|
3225
3483
|
apiBaseUrl: credentials.apiBaseUrl,
|
|
3226
3484
|
accountId: credentials.accountId,
|
|
@@ -3329,7 +3587,7 @@ function logCloudflareAuthFailure(error) {
|
|
|
3329
3587
|
* deploy without an account signs in and chooses one. Logs and returns null on failure.
|
|
3330
3588
|
*/
|
|
3331
3589
|
async function connectCloudflareDeployAccount(options) {
|
|
3332
|
-
const { root, configPath, deps } = options;
|
|
3590
|
+
const { root, configPath, deps, reporter } = options;
|
|
3333
3591
|
let { rootConfig } = options;
|
|
3334
3592
|
let apiBaseUrl;
|
|
3335
3593
|
try {
|
|
@@ -3342,7 +3600,7 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3342
3600
|
const pins = createCloudflareUploaderPins(root, deps);
|
|
3343
3601
|
let accountId = readWranglerTopLevelString(rootConfig, "account_id") ?? (process.env.CLOUDFLARE_ACCOUNT_ID?.trim() || void 0);
|
|
3344
3602
|
if (!accountId) {
|
|
3345
|
-
const accountRunner = deps.runWrangler ?? createDeployWranglerRunner(root, void 0, apiBaseUrl);
|
|
3603
|
+
const accountRunner = observeCloudflareRunner(deps.runWrangler ?? createDeployWranglerRunner(root, void 0, apiBaseUrl), reporter);
|
|
3346
3604
|
try {
|
|
3347
3605
|
accountId = await chooseCloudflareDeployAccount({
|
|
3348
3606
|
persist: options.persistAccount,
|
|
@@ -3373,7 +3631,7 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3373
3631
|
accountId,
|
|
3374
3632
|
workersDevSubdomain,
|
|
3375
3633
|
readinessAccessOrigin,
|
|
3376
|
-
runWrangler: deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl),
|
|
3634
|
+
runWrangler: observeCloudflareRunner(deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl), reporter),
|
|
3377
3635
|
rootConfig
|
|
3378
3636
|
};
|
|
3379
3637
|
}
|
|
@@ -3404,12 +3662,12 @@ function assertCloudflareDeployTargetUnchanged(options) {
|
|
|
3404
3662
|
function createCfActivationRunner(options) {
|
|
3405
3663
|
const { cfOutput, accountId, apiBaseUrl, configPath, runWrangler } = options;
|
|
3406
3664
|
if (!cfOutput) return runWrangler;
|
|
3407
|
-
const runCf = createCfCommand({
|
|
3665
|
+
const runCf = observeCfCommand(createCfCommand({
|
|
3408
3666
|
accountId,
|
|
3409
3667
|
apiBaseUrl,
|
|
3410
3668
|
env: deployChildEnv,
|
|
3411
3669
|
verifyUploader: options.cfUploaderIsPinned
|
|
3412
|
-
});
|
|
3670
|
+
}), options.reporter);
|
|
3413
3671
|
return createCfVersionRunner({
|
|
3414
3672
|
output: cfOutput,
|
|
3415
3673
|
workerName: options.workerName,
|
|
@@ -3417,7 +3675,7 @@ function createCfActivationRunner(options) {
|
|
|
3417
3675
|
pinnedUpload: {
|
|
3418
3676
|
accountId,
|
|
3419
3677
|
apiBaseUrl,
|
|
3420
|
-
getToken: () =>
|
|
3678
|
+
getToken: () => readWranglerAuthToken(runWrangler, configPath),
|
|
3421
3679
|
verifyUploader: options.cfUploaderIsPinned
|
|
3422
3680
|
},
|
|
3423
3681
|
verifyResources: createCfResourceVerifier({
|
|
@@ -3498,7 +3756,7 @@ function recordCloudflareActivation(options) {
|
|
|
3498
3756
|
clearCloudflareCandidate(root);
|
|
3499
3757
|
if (options.existingWorker) completeCloudflareLink(root);
|
|
3500
3758
|
acknowledgeWranglerManagedQueueRemovals(configPath, options.queueConsumerCleanup);
|
|
3501
|
-
rememberCloudflareWorkersDevSubdomain(root, options.accountId, execution.previewUrl);
|
|
3759
|
+
if (execution.previewUrl) rememberCloudflareWorkersDevSubdomain(root, options.accountId, execution.previewUrl);
|
|
3502
3760
|
if (execution.trafficConfig) writeWranglerPublishedTrafficSnapshot(configPath, {
|
|
3503
3761
|
workers_dev: execution.trafficConfig.workers_dev,
|
|
3504
3762
|
preview_urls: execution.trafficConfig.preview_urls,
|
|
@@ -3510,10 +3768,33 @@ function recordCloudflareActivation(options) {
|
|
|
3510
3768
|
versionId: execution.versionId
|
|
3511
3769
|
});
|
|
3512
3770
|
}
|
|
3513
|
-
|
|
3514
|
-
|
|
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
|
+
});
|
|
3515
3796
|
await cliLog.close().catch(() => {});
|
|
3516
|
-
log$1.error(`${
|
|
3797
|
+
log$1.error(`${safeMessage}${cliLog.path ? `\n\nDetailed log: ${cliLog.path}` : ""}`);
|
|
3517
3798
|
}
|
|
3518
3799
|
async function activateCloudflareVersionWithProgress(activate, options) {
|
|
3519
3800
|
const progress = createSpinner();
|
|
@@ -3566,6 +3847,11 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3566
3847
|
case "upload-output-invalid": return "deploy: Wrangler uploaded a version but did not report its version id; production traffic is unchanged.";
|
|
3567
3848
|
case "preview-unavailable":
|
|
3568
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");
|
|
3569
3855
|
return [
|
|
3570
3856
|
"deploy: the uploaded Worker Version has no preview URL, so Void cannot verify readiness.",
|
|
3571
3857
|
"Set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain (for example \"my-team\")",
|
|
@@ -3574,7 +3860,7 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3574
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." : ""}`;
|
|
3575
3861
|
case "atomic-failed": return `deploy: Cloudflare could not publish the Worker atomically${status}; inspect production status before retrying.${cloudflareCode}${diagnostic}`;
|
|
3576
3862
|
case "atomic-output-invalid":
|
|
3577
|
-
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"));
|
|
3578
3864
|
return "deploy: Cloudflare published atomically but did not report its version id. Inspect `void project status` immediately.";
|
|
3579
3865
|
case "atomic-readiness-failed":
|
|
3580
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")}` : ""}`;
|
|
@@ -3595,7 +3881,7 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3595
3881
|
].join("\n");
|
|
3596
3882
|
case "bootstrap-failed": return `deploy: Cloudflare could not bootstrap the first Worker deployment${status}.${cloudflareCode}${diagnostic}`;
|
|
3597
3883
|
case "bootstrap-output-invalid":
|
|
3598
|
-
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"));
|
|
3599
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");
|
|
3600
3886
|
case "bootstrap-readiness-failed": return [
|
|
3601
3887
|
"deploy: the first Worker deployment did not pass /__void/ready.",
|
|
@@ -3619,7 +3905,56 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3619
3905
|
"Worker is already active behind Access."
|
|
3620
3906
|
].join("\n");
|
|
3621
3907
|
case "activation-failed": return `deploy: the ready Worker Version could not be activated${status}; production traffic is unchanged.`;
|
|
3622
|
-
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}.`;
|
|
3623
3958
|
}
|
|
3624
3959
|
}
|
|
3625
3960
|
/** Explain why a custom-route readiness probe carried no Access credentials. */
|
|
@@ -3641,6 +3976,18 @@ function formatCloudflareReadinessRestoration(result) {
|
|
|
3641
3976
|
}
|
|
3642
3977
|
}
|
|
3643
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
|
+
}
|
|
3644
3991
|
/** Explain a live version whose readiness URL Void could not determine. */
|
|
3645
3992
|
function formatCloudflarePublishWithoutUrl(published, recovery) {
|
|
3646
3993
|
return [
|
|
@@ -3716,6 +4063,7 @@ async function prepareCloudflareFrameworkArtifact(options) {
|
|
|
3716
4063
|
"_routes.json",
|
|
3717
4064
|
"__original.js",
|
|
3718
4065
|
"__original.mjs",
|
|
4066
|
+
"__void_handlers.js",
|
|
3719
4067
|
"__void_handlers.mjs",
|
|
3720
4068
|
"__void_isr*.mjs",
|
|
3721
4069
|
"__void_migration_handler*.mjs"
|
|
@@ -3819,7 +4167,7 @@ function planStaticEdgeRouting(options) {
|
|
|
3819
4167
|
assetHeaders: generatedHeaders
|
|
3820
4168
|
};
|
|
3821
4169
|
}
|
|
3822
|
-
async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate) {
|
|
4170
|
+
async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate, reporter) {
|
|
3823
4171
|
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
3824
4172
|
const configPath = discoverRootWranglerConfig(root);
|
|
3825
4173
|
const connection = await connectCloudflareDeployAccount({
|
|
@@ -3828,7 +4176,8 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3828
4176
|
rootConfig: parseRootWranglerConfig(configPath),
|
|
3829
4177
|
deps,
|
|
3830
4178
|
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
3831
|
-
readinessAccessOrigin: options.readinessAccessOrigin
|
|
4179
|
+
readinessAccessOrigin: options.readinessAccessOrigin,
|
|
4180
|
+
reporter
|
|
3832
4181
|
});
|
|
3833
4182
|
if (!connection || !await confirmCloudflareDeployAuthentication(connection, configPath)) return exit(1);
|
|
3834
4183
|
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
@@ -3945,7 +4294,8 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3945
4294
|
configPath: staticConfigPath,
|
|
3946
4295
|
runWrangler,
|
|
3947
4296
|
cfUploaderIsPinned,
|
|
3948
|
-
verifyCompatibilityRunner: assertUploaderStillPinned
|
|
4297
|
+
verifyCompatibilityRunner: assertUploaderStillPinned,
|
|
4298
|
+
reporter
|
|
3949
4299
|
});
|
|
3950
4300
|
const execution = await activateCloudflareVersionWithProgress(deps.activateVersion ?? activateCloudflareVersion, {
|
|
3951
4301
|
...cloudflareCandidateActivationOptions({
|
|
@@ -3979,7 +4329,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3979
4329
|
assetsDirectoryOverride: stagedAssetsDirectory
|
|
3980
4330
|
}).finally(() => cfOutput?.dispose());
|
|
3981
4331
|
if (!execution.ok) {
|
|
3982
|
-
await reportCloudflareActivationFailure(
|
|
4332
|
+
await reportCloudflareActivationFailure(reporter, formatCloudflareActivationError(execution), execution);
|
|
3983
4333
|
return exit(1);
|
|
3984
4334
|
}
|
|
3985
4335
|
recordCloudflareActivation({
|
|
@@ -4436,7 +4786,7 @@ async function buildCloudflareWorker(input) {
|
|
|
4436
4786
|
if (!assertUploaderStillPinned()) return exit(1);
|
|
4437
4787
|
const migrations = collectMigrations(migrationsDir);
|
|
4438
4788
|
if (existingWorker && migrations.length) throw new Error("The build added database migrations. Link the existing site before making schema changes.");
|
|
4439
|
-
if (dialect !== "sqlite" && migrations.length > 0 && !process.env.DATABASE_URL) {
|
|
4789
|
+
if (!input.skipMigrations && dialect !== "sqlite" && migrations.length > 0 && !process.env.DATABASE_URL) {
|
|
4440
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.`);
|
|
4441
4791
|
return exit(1);
|
|
4442
4792
|
}
|
|
@@ -4610,7 +4960,11 @@ async function migrateCloudflareWorker(input) {
|
|
|
4610
4960
|
}
|
|
4611
4961
|
}
|
|
4612
4962
|
let appliedMigrations = 0;
|
|
4613
|
-
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) {
|
|
4614
4968
|
const mysql = dialect === "mysql";
|
|
4615
4969
|
const label = mysql ? "MySQL" : "PostgreSQL";
|
|
4616
4970
|
const databaseUrl = process.env.DATABASE_URL;
|
|
@@ -4628,7 +4982,7 @@ async function migrateCloudflareWorker(input) {
|
|
|
4628
4982
|
return exit(1);
|
|
4629
4983
|
}
|
|
4630
4984
|
}
|
|
4631
|
-
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");
|
|
4632
4986
|
if (!d1) return exit(1);
|
|
4633
4987
|
const d1RestoreCommand = d1.restoreCommand;
|
|
4634
4988
|
if (!verifyCloudflareDeployArtifact(root, deps, {
|
|
@@ -4639,6 +4993,7 @@ async function migrateCloudflareWorker(input) {
|
|
|
4639
4993
|
return exit(1);
|
|
4640
4994
|
}
|
|
4641
4995
|
return {
|
|
4996
|
+
migrationHistory: input.skipMigrations ? null : migrations.map((migration) => migration.name),
|
|
4642
4997
|
workerWasMissingBeforeSecretProvisioning,
|
|
4643
4998
|
initialAuthSecret,
|
|
4644
4999
|
appliedMigrations,
|
|
@@ -5015,7 +5370,7 @@ async function prepareCloudflareDeploySource(root, options, voidConfig) {
|
|
|
5015
5370
|
const configPath = discoverRootWranglerConfig(root);
|
|
5016
5371
|
const facts = await computeDesiredCloudflareResources(root, voidConfig, configPath, application);
|
|
5017
5372
|
const { desired, dialect, migrations: preBuildMigrations, migrationsDir } = facts;
|
|
5018
|
-
if (dialect !== "sqlite" && preBuildMigrations.length > 0 && !process.env.DATABASE_URL) {
|
|
5373
|
+
if (!options.skipMigrations && dialect !== "sqlite" && preBuildMigrations.length > 0 && !process.env.DATABASE_URL) {
|
|
5019
5374
|
log$1.error([
|
|
5020
5375
|
`deploy: ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} migrations require DATABASE_URL for --platform cloudflare.`,
|
|
5021
5376
|
"Set the production connection string in the deploy environment. Void uses it only to",
|
|
@@ -5046,7 +5401,7 @@ async function prepareCloudflareDeploySource(root, options, voidConfig) {
|
|
|
5046
5401
|
}
|
|
5047
5402
|
/** Pin the account and uploader, set up email, provision resources and snapshot the pins. */
|
|
5048
5403
|
async function preflightCloudflareWorker(input) {
|
|
5049
|
-
const { root, voidConfig, options, deps, exit, cliLog, initialCloudflareLink, detectedFramework, source } = input;
|
|
5404
|
+
const { root, voidConfig, options, deps, exit, cliLog, reporter, initialCloudflareLink, detectedFramework, source } = input;
|
|
5050
5405
|
const { configPath, needsSandbox, needsEmail, emailHandlers, authEnabled, needsAI, expectedCrons, desired, migrations: preBuildMigrations, reasons, needsLive } = source;
|
|
5051
5406
|
let rootConfig = parseRootWranglerConfig(configPath);
|
|
5052
5407
|
if (needsSandbox) try {
|
|
@@ -5061,7 +5416,8 @@ async function preflightCloudflareWorker(input) {
|
|
|
5061
5416
|
rootConfig,
|
|
5062
5417
|
deps,
|
|
5063
5418
|
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
5064
|
-
readinessAccessOrigin: options.readinessAccessOrigin
|
|
5419
|
+
readinessAccessOrigin: options.readinessAccessOrigin,
|
|
5420
|
+
reporter
|
|
5065
5421
|
});
|
|
5066
5422
|
if (!connection) return exit(1);
|
|
5067
5423
|
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
@@ -5316,10 +5672,11 @@ async function preflightCloudflareWorker(input) {
|
|
|
5316
5672
|
// src/cli/deploy-cloudflare-publish.ts
|
|
5317
5673
|
/** Upload the verified Worker as a candidate version, probe it, and activate it. */
|
|
5318
5674
|
async function publishCloudflareWorker(input) {
|
|
5319
|
-
const { root, deps, exit, cliLog, atomic, detectedFramework
|
|
5675
|
+
const { root, deps, exit, cliLog, reporter, atomic, detectedFramework } = input;
|
|
5676
|
+
const { initialCloudflareCandidate } = input;
|
|
5320
5677
|
const { configPath, needsSandbox, desired, analysis } = input.source;
|
|
5321
5678
|
const { usesCf, existingWorker, pinnedHandoffLink, accountId, workerName, cfUploaderIsPinned, apiBaseUrl, complianceRegion, runWrangler, assertUploaderStillPinned, schemaFacts, approvedHandoffKv, workersDevSubdomain, readinessAccessOrigin } = input.preflight;
|
|
5322
|
-
const {
|
|
5679
|
+
const { d1MigrateToken, generatedConfigPath, prepareBuildOutput } = input.build;
|
|
5323
5680
|
const { workerWasMissingBeforeSecretProvisioning, initialAuthSecret, appliedMigrations } = input.migration;
|
|
5324
5681
|
const queueConsumerCleanup = readWranglerManagedQueueCleanupCandidates(configPath);
|
|
5325
5682
|
assertCloudflareDeployTargetUnchanged({
|
|
@@ -5344,7 +5701,8 @@ async function publishCloudflareWorker(input) {
|
|
|
5344
5701
|
configPath: generatedConfigPath,
|
|
5345
5702
|
runWrangler,
|
|
5346
5703
|
cfUploaderIsPinned,
|
|
5347
|
-
verifyCompatibilityRunner: assertUploaderStillPinned
|
|
5704
|
+
verifyCompatibilityRunner: assertUploaderStillPinned,
|
|
5705
|
+
reporter
|
|
5348
5706
|
});
|
|
5349
5707
|
const pinActiveSecrets = createActiveSecretPinner({
|
|
5350
5708
|
output: cfOutput,
|
|
@@ -5377,7 +5735,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5377
5735
|
verifyUploader: cfOutput ? cfUploaderIsPinned : assertUploaderStillPinned,
|
|
5378
5736
|
requireVersionMetadata: existingWorker === null || hasVersionMetadata,
|
|
5379
5737
|
requirePreviewForReadiness: existingWorker !== null && !hasVersionMetadata,
|
|
5380
|
-
message: encodeCloudflareVersionMessage(
|
|
5738
|
+
message: encodeCloudflareVersionMessage(input.migration.migrationHistory, {
|
|
5381
5739
|
...readCloudflareTriggerConfig(generatedConfigPath, configPath),
|
|
5382
5740
|
...existingWorker ? { preserve: true } : {}
|
|
5383
5741
|
}),
|
|
@@ -5388,7 +5746,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5388
5746
|
}).finally(() => cfOutput?.dispose());
|
|
5389
5747
|
if (!execution.ok) {
|
|
5390
5748
|
if (execution.reason === "atomic-readiness-failed" || execution.reason === "atomic-readiness-access-denied") clearCloudflareCandidate(root);
|
|
5391
|
-
await reportCloudflareActivationFailure(
|
|
5749
|
+
await reportCloudflareActivationFailure(reporter, needsSandbox && execution.containersUnavailable ? formatCloudflareSandboxUnavailable() : formatCloudflareActivationError(execution), execution);
|
|
5392
5750
|
return exit(1);
|
|
5393
5751
|
}
|
|
5394
5752
|
recordCloudflareActivation({
|
|
@@ -5404,7 +5762,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5404
5762
|
note(formatDeploySummary({
|
|
5405
5763
|
workerName,
|
|
5406
5764
|
migrations: appliedMigrations,
|
|
5407
|
-
d1MigrationsCurrent: d1MigrateToken !== void 0,
|
|
5765
|
+
d1MigrationsCurrent: input.migration.migrationHistory !== null && d1MigrateToken !== void 0,
|
|
5408
5766
|
cronJobs: existingWorker ? void 0 : analysis.jobs.length,
|
|
5409
5767
|
queues: existingWorker ? void 0 : desired.queues.length,
|
|
5410
5768
|
framework: detectedFramework?.name
|
|
@@ -5416,7 +5774,23 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5416
5774
|
options = withRecordedReadinessAccessOrigin(options);
|
|
5417
5775
|
const initialCloudflareLink = readCloudflareLink(root);
|
|
5418
5776
|
const initialCloudflareCandidate = readCloudflareCandidate(root);
|
|
5419
|
-
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);
|
|
5420
5794
|
const voidConfig = readConfig(root);
|
|
5421
5795
|
const atomic = options.atomic === true || voidConfig.deploy?.cloudflare?.mode === "atomic";
|
|
5422
5796
|
if (atomic && (options.reuseExistingWorker || initialCloudflareLink)) {
|
|
@@ -5448,7 +5822,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5448
5822
|
log$1.error("deploy: atomic deployment is only for Workers with Durable Objects.");
|
|
5449
5823
|
return exit(1);
|
|
5450
5824
|
}
|
|
5451
|
-
return runCloudflareStaticDeploy(root, options, voidConfig, staticPreset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate);
|
|
5825
|
+
return runCloudflareStaticDeploy(root, options, voidConfig, staticPreset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate, reporter);
|
|
5452
5826
|
}
|
|
5453
5827
|
if (detectedFramework && voidConfig.routing?.alwaysUseHttps === true) {
|
|
5454
5828
|
log$1.error([
|
|
@@ -5467,6 +5841,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5467
5841
|
deps,
|
|
5468
5842
|
exit,
|
|
5469
5843
|
cliLog,
|
|
5844
|
+
reporter,
|
|
5470
5845
|
initialCloudflareLink,
|
|
5471
5846
|
detectedFramework,
|
|
5472
5847
|
source
|
|
@@ -5478,6 +5853,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5478
5853
|
deps,
|
|
5479
5854
|
exit,
|
|
5480
5855
|
atomic,
|
|
5856
|
+
skipMigrations: options.skipMigrations,
|
|
5481
5857
|
frameworkPreset,
|
|
5482
5858
|
detectedFramework,
|
|
5483
5859
|
source,
|
|
@@ -5490,7 +5866,8 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5490
5866
|
cliLog,
|
|
5491
5867
|
source,
|
|
5492
5868
|
preflight,
|
|
5493
|
-
build
|
|
5869
|
+
build,
|
|
5870
|
+
skipMigrations: options.skipMigrations
|
|
5494
5871
|
});
|
|
5495
5872
|
let restoreReported = false;
|
|
5496
5873
|
const reportRestore = () => {
|
|
@@ -5509,6 +5886,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5509
5886
|
deps,
|
|
5510
5887
|
exit: exitAfterMigrations,
|
|
5511
5888
|
cliLog,
|
|
5889
|
+
reporter,
|
|
5512
5890
|
atomic,
|
|
5513
5891
|
detectedFramework,
|
|
5514
5892
|
initialCloudflareCandidate,
|
|
@@ -5528,7 +5906,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5528
5906
|
/**
|
|
5529
5907
|
* Class B/C framework deploy: build with framework CLI, package with preset output paths.
|
|
5530
5908
|
*/
|
|
5531
|
-
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) {
|
|
5532
5910
|
log$1.info(`${detected.name} framework deploy`);
|
|
5533
5911
|
cliLog?.info("deploy_mode", {
|
|
5534
5912
|
mode: "framework",
|
|
@@ -5644,6 +6022,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
5644
6022
|
fallbackRules,
|
|
5645
6023
|
dialect
|
|
5646
6024
|
});
|
|
6025
|
+
if (skipMigrations) manifest.migrationMode = "skip";
|
|
5647
6026
|
const workerFiles = collectWorkerFiles(actualWorkerDir);
|
|
5648
6027
|
cliLog?.info("package_end", {
|
|
5649
6028
|
mode: "framework",
|
|
@@ -5678,7 +6057,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
5678
6057
|
printDeploySuccess(result.published !== false);
|
|
5679
6058
|
}
|
|
5680
6059
|
// src/cli/deploy-managed-full.ts
|
|
5681
|
-
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) {
|
|
5682
6061
|
cliLog?.info("deploy_mode", {
|
|
5683
6062
|
mode: "full",
|
|
5684
6063
|
framework: detected?.name
|
|
@@ -5902,6 +6281,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5902
6281
|
webSockets,
|
|
5903
6282
|
durableObjects: analysis.durableObjects
|
|
5904
6283
|
}, voidConfig.routing?.revalidate, voidConfig.routing?.isr !== false);
|
|
6284
|
+
if (skipMigrations) manifest.migrationMode = "skip";
|
|
5905
6285
|
const workerDir = join(distDir, workerDirName);
|
|
5906
6286
|
if (isFrameworkMode) {
|
|
5907
6287
|
const wrapperFeatures = {
|
|
@@ -6146,33 +6526,32 @@ function openDeployLog(opts) {
|
|
|
6146
6526
|
const mirror = opts?.mirrorToStderr === true;
|
|
6147
6527
|
const startedAt = Date.now();
|
|
6148
6528
|
let path = null;
|
|
6149
|
-
let
|
|
6529
|
+
let fd = null;
|
|
6150
6530
|
let broken = false;
|
|
6151
6531
|
let closed = false;
|
|
6532
|
+
let ended = false;
|
|
6152
6533
|
try {
|
|
6153
6534
|
const dir = join(homedir(), ".void", "logs");
|
|
6154
6535
|
mkdirSync(dir, { recursive: true });
|
|
6155
6536
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
6156
6537
|
const suffix = randomBytes(3).toString("hex");
|
|
6157
6538
|
const filePath = join(dir, `deploy-${ts}-${process.pid}-${suffix}.jsonl`);
|
|
6158
|
-
|
|
6159
|
-
flags: "wx",
|
|
6160
|
-
autoClose: true
|
|
6161
|
-
});
|
|
6162
|
-
stream.on("error", () => {
|
|
6163
|
-
broken = true;
|
|
6164
|
-
});
|
|
6539
|
+
fd = openSync(filePath, "wx", 384);
|
|
6165
6540
|
path = filePath;
|
|
6166
6541
|
} catch {
|
|
6167
6542
|
broken = true;
|
|
6168
6543
|
path = null;
|
|
6169
|
-
|
|
6544
|
+
fd = null;
|
|
6170
6545
|
}
|
|
6171
6546
|
function write(level, msg, err, fields) {
|
|
6547
|
+
if (msg === "deploy_end") {
|
|
6548
|
+
if (ended) return;
|
|
6549
|
+
ended = true;
|
|
6550
|
+
}
|
|
6172
6551
|
if (mirror) try {
|
|
6173
6552
|
process.stderr.write(`${formatStderrLine(level, msg, err, fields)}\n`);
|
|
6174
6553
|
} catch {}
|
|
6175
|
-
if (broken ||
|
|
6554
|
+
if (broken || fd === null || closed) return;
|
|
6176
6555
|
const now = Date.now();
|
|
6177
6556
|
const record = {
|
|
6178
6557
|
ts: now,
|
|
@@ -6197,7 +6576,9 @@ function openDeployLog(opts) {
|
|
|
6197
6576
|
})}\n`;
|
|
6198
6577
|
}
|
|
6199
6578
|
try {
|
|
6200
|
-
|
|
6579
|
+
const bytes = Buffer.from(line);
|
|
6580
|
+
let offset = 0;
|
|
6581
|
+
while (offset < bytes.length) offset += writeSync(fd, bytes, offset);
|
|
6201
6582
|
} catch {
|
|
6202
6583
|
broken = true;
|
|
6203
6584
|
}
|
|
@@ -6221,14 +6602,13 @@ function openDeployLog(opts) {
|
|
|
6221
6602
|
close() {
|
|
6222
6603
|
if (closed) return Promise.resolve();
|
|
6223
6604
|
closed = true;
|
|
6224
|
-
if (
|
|
6225
|
-
return new Promise((resolveClose) => {
|
|
6605
|
+
if (fd !== null) {
|
|
6226
6606
|
try {
|
|
6227
|
-
|
|
6228
|
-
} catch {
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6607
|
+
closeSync(fd);
|
|
6608
|
+
} catch {}
|
|
6609
|
+
fd = null;
|
|
6610
|
+
}
|
|
6611
|
+
return Promise.resolve();
|
|
6232
6612
|
}
|
|
6233
6613
|
};
|
|
6234
6614
|
}
|
|
@@ -6389,6 +6769,7 @@ async function runDeploy(root, options) {
|
|
|
6389
6769
|
dir: options?.dir,
|
|
6390
6770
|
spa: options?.spa === true ? true : void 0,
|
|
6391
6771
|
skipBuild: options?.skipBuild === true ? true : void 0,
|
|
6772
|
+
skipMigrations: options?.skipMigrations === true ? true : void 0,
|
|
6392
6773
|
nodeVersion: process.version,
|
|
6393
6774
|
platform: process.platform,
|
|
6394
6775
|
arch: process.arch
|
|
@@ -6528,6 +6909,7 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6528
6909
|
root,
|
|
6529
6910
|
cliLog
|
|
6530
6911
|
});
|
|
6912
|
+
if (options.skipMigrations) await client.requireMigrationSkipSupport();
|
|
6531
6913
|
let config = null;
|
|
6532
6914
|
if (requestedProjectSlug) {
|
|
6533
6915
|
const linked = linkedProject?.slug === requestedProjectSlug ? await client.getProject(linkedProject.projectId) : null;
|
|
@@ -6595,8 +6977,8 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6595
6977
|
log$1.error(`No deploy preset found for framework "${detected.name}".`);
|
|
6596
6978
|
process.exit(1);
|
|
6597
6979
|
}
|
|
6598
|
-
await runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, options?.skipBuild, gitMetadata, cliLog);
|
|
6599
|
-
} 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);
|
|
6600
6982
|
return;
|
|
6601
6983
|
}
|
|
6602
6984
|
if (!preset && !voidConfig.inference?.appType) preset = detectPreset(root, {
|
|
@@ -6609,7 +6991,7 @@ async function runManagedDeploy(root, options, cliLog) {
|
|
|
6609
6991
|
buildCommand: resolveStaticBuildCommand(preset, voidConfig.inference?.build, Boolean(options?.dir))
|
|
6610
6992
|
};
|
|
6611
6993
|
await runStaticDeploy(root, config, client, preset, options?.skipBuild, gitMetadata, void 0, void 0, void 0, void 0, voidConfig.routing, cliLog);
|
|
6612
|
-
} 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);
|
|
6613
6995
|
return;
|
|
6614
6996
|
} catch (error) {
|
|
6615
6997
|
if (isExpiredTokenError(error)) {
|