void 1.3.0 → 1.4.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-B4i71m7k.mjs → account-cmd-HP8bixYo.mjs} +3 -3
- package/dist/{application-analysis-DYdVoMAY.mjs → application-analysis-DDOQwiXk.mjs} +11 -7
- package/dist/{application-routing-C8EqRDfv.mjs → application-routing-4719u_kf.mjs} +1 -1
- package/dist/auth-g2TQbDLD.d.mts +70 -0
- package/dist/{auth-link-BKwHPbdv.mjs → auth-link-CedYpDCy.mjs} +3 -3
- package/dist/{auth-router-DqLx8E0F.mjs → auth-router-vafo7x8w.mjs} +11 -6
- package/dist/{better-auth-shared-DVk2DkTW.d.mts → better-auth-shared-BHB8kiTE.d.mts} +1 -1
- package/dist/{build-cmd-Dy4psnt1.mjs → build-cmd-9vUAQ1_V.mjs} +1 -1
- package/dist/{cache-DV37S6dl.mjs → cache-jvwLNb0h.mjs} +1 -1
- package/dist/{cancel-deploy-DMPyu1Vt.mjs → cancel-deploy-Dw0UmWKO.mjs} +1 -1
- package/dist/{cf-build-output-Bapzc_8Z.mjs → cf-build-output-XpNR9zoh.mjs} +20 -4
- package/dist/cf-build-output-bd8Uwv1P.mjs +1 -0
- package/dist/{cf-worker-settings-BECvvTVd.mjs → cf-worker-settings-Dg27RzyT.mjs} +11 -5
- package/dist/cli/cli.mjs +25 -25
- package/dist/cli/cloudflare-operation-process.mjs +9 -3
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/{client-BEMtySaV.mjs → client-B3LnB_bE.mjs} +1 -1
- package/dist/client-BZb9j66F.mjs +1 -0
- package/dist/{cloudflare-auth-Byo_0_N9.mjs → cloudflare-auth-DyD_kVFr.mjs} +1 -1
- package/dist/{cloudflare-cmd-BaqIigwI.mjs → cloudflare-cmd-D-b_u3T4.mjs} +2 -2
- package/dist/{cloudflare-config-DchHxPTo.mjs → cloudflare-config-CH1AylZT.mjs} +14 -3
- package/dist/{cloudflare-connect-pNLQmr_e.mjs → cloudflare-connect-zTJh8UnN.mjs} +2 -2
- package/dist/{cloudflare-operations-vP3b5CQf.mjs → cloudflare-operations-Bc-7fN44.mjs} +4 -4
- package/dist/{cloudflare-operations-PCM4wucv.mjs → cloudflare-operations-BtulCNOg.mjs} +1 -1
- package/dist/{config-BU6hMu1W.mjs → config-BV2ASlpn.mjs} +1 -1
- package/dist/{config-Du88-7Y8.d.mts → config-CAdZVTLN.d.mts} +2 -0
- package/dist/config-D-6q7EBH.mjs +87 -0
- package/dist/{config-DHgSEWT7.mjs → config-OFOAimzt.mjs} +5 -3
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-BIaXIkkv.mjs → config-tqMM6DwY.mjs} +1 -1
- package/dist/{connect-DwVsBvVh.mjs → connect-BOM6zvFX.mjs} +4 -4
- package/dist/{create-project-CjzbBlTv.mjs → create-project-Bxd02EHN.mjs} +1 -1
- package/dist/{create-project-CgrnvzyA.mjs → create-project-C2K0DN2O.mjs} +1 -1
- package/dist/{db-rvo64snS.mjs → db-Cdvr3zwG.mjs} +16 -16
- package/dist/{db-types-NGxPwnlt.mjs → db-types-0eCiqYb1.mjs} +1 -1
- package/dist/{delete-DWX6dP4M.mjs → delete-lETE6Tpt.mjs} +1 -1
- package/dist/deploy-CX94CmKa.mjs +2 -0
- package/dist/{deploy-hRPvw8ci.mjs → deploy-CdM-LAxX.mjs} +260 -95
- package/dist/{deploy-managed-static-CDYA2p3L.mjs → deploy-managed-static-DjeBFG2c.mjs} +24 -17
- package/dist/{deploy-transport-JCxw7QDi.mjs → deploy-transport-DIq_gFTP.mjs} +13 -12
- package/dist/deploy.d.mts +2 -0
- package/dist/deploy.mjs +7 -5
- package/dist/{dispatch-OVLeWW8K.mjs → dispatch-CLa2LThw.mjs} +5 -5
- package/dist/{domain-CH5iBD9Y.mjs → domain-DyhNtdYf.mjs} +2 -2
- package/dist/{email-CbTO1l78.mjs → email-DM2wDcBN.mjs} +6 -6
- package/dist/{email-cloudflare-B8-pq_-W.mjs → email-cloudflare-PMbAev9Q.mjs} +20 -7
- package/dist/{env-BBdw236G.mjs → env-78hbN-oI.mjs} +3 -3
- package/dist/{env-validation-XcukUlFM.mjs → env-validation-B3VobvXm.mjs} +1 -0
- package/dist/{env-validation-BfBVvBNe.mjs → env-validation-BUfFZ6bt.mjs} +1 -1
- package/dist/error-pages-CLIJ7aYq.mjs +37 -0
- package/dist/gen-BhWBT4iu.mjs +1 -0
- package/dist/{gen-CCx3t2Ju.mjs → gen-CFmsUsW1.mjs} +3 -3
- package/dist/{github-cmd-BzkRLkbg.mjs → github-cmd-De-_IWbM.mjs} +1 -1
- package/dist/{handler-CQv5YDS0.d.mts → handler-BHktmuTL.d.mts} +3 -1
- package/dist/{headers-D522zd0A.mjs → headers--vaK_chu.mjs} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +68 -33
- package/dist/{info-oBm8yK8J.mjs → info-Yg0-V5Rs.mjs} +3 -3
- package/dist/{init-CBp_uMve.mjs → init-CDiJQycf.mjs} +31 -16
- package/dist/{link-Dt_QXmM4.mjs → link-Dllip08S.mjs} +2 -2
- package/dist/{list-DF6asTdt.mjs → list-BYRP6am0.mjs} +2 -2
- package/dist/{live-CXJ9yC98.d.mts → live-BllfDuzA.d.mts} +2 -2
- package/dist/{local-d1-CUhH3qtj.mjs → local-d1-CAwAs9GH.mjs} +1 -1
- package/dist/login-BAPmYnb7.mjs +1 -0
- package/dist/{login-BjSyhXlT.mjs → login-PcFy5mlC.mjs} +2 -2
- package/dist/{logs-DmvBl6xA.mjs → logs-DmJTBhed.mjs} +2 -2
- package/dist/{migrate-BXRHpYwR.mjs → migrate-B8S2xTcb.mjs} +5 -66
- package/dist/migrate-BIYTPQE6.mjs +1 -0
- package/dist/nitro.mjs +4 -4
- package/dist/{node-DtD7ZiPf.mjs → node-CDOPrGSl.mjs} +3 -3
- package/dist/operator-cmd-CjazwOyb.mjs +1 -0
- package/dist/{operator-cmd-DjZKGGgN.mjs → operator-cmd-DmkmS2wL.mjs} +2 -2
- package/dist/pages/client.d.mts +17 -2
- package/dist/pages/client.mjs +26 -1
- package/dist/pages/index.d.mts +17 -1
- package/dist/pages/index.mjs +95 -4
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{platform-auth-config-BgnuMbml.mjs → platform-auth-config-CImnfohz.mjs} +3 -3
- package/dist/{platform-auth-protection-NjRejttU.mjs → platform-auth-protection-BogLhtHi.mjs} +2 -2
- package/dist/{platform-auth-recovery-Ug12d9W5.mjs → platform-auth-recovery-B-mEaWEi.mjs} +2 -2
- package/dist/{platform-cmd-BYKLMPCn.mjs → platform-cmd-CV8NxIIn.mjs} +1 -1
- package/dist/{platform-cmd-HByuZAO7.mjs → platform-cmd-DZK2ixMl.mjs} +3 -3
- package/dist/{platform-domain-DLSQ8GF8.mjs → platform-domain-CRvelPGE.mjs} +2 -2
- package/dist/{platform-lifecycle-3dwFJmnq.mjs → platform-lifecycle-CPYY7E9B.mjs} +8 -8
- package/dist/{platform-lifecycle-BRqcxerG.mjs → platform-lifecycle-DwXq7kZt.mjs} +1 -1
- package/dist/{platform-management-ZZ6bQM5j.mjs → platform-management-BOnGbMSM.mjs} +1 -1
- package/dist/{platform-management-ZK6XcbCo.mjs → platform-management-lXdgGgAM.mjs} +1 -1
- package/dist/{platform-recovery-8vNE5dNN.mjs → platform-recovery-noaALXnE.mjs} +2 -2
- package/dist/{prepare-5BR7Splm.mjs → prepare-BuOS18AM.mjs} +1 -1
- package/dist/{prepare-Dseww74N.mjs → prepare-D604Yiyr.mjs} +11 -7
- package/dist/prepare-DU-tOpS5.mjs +1 -0
- package/dist/{project-cmd-CjLNNxwe.mjs → project-cmd-DBYqAIbe.mjs} +13 -13
- package/dist/{project-team-DE5drjcl.mjs → project-team-BjCLgTRC.mjs} +1 -1
- package/dist/{project-token-XEYEXfiJ.mjs → project-token-BB6PwaA9.mjs} +1 -1
- package/dist/{project-tsconfig-Itv1f4WC.mjs → project-tsconfig-CVvk6Z_e.mjs} +24 -2
- package/dist/{project-zero-trust-6VPU8zmV.mjs → project-zero-trust-CWDh1P_t.mjs} +1 -1
- package/dist/{protocol-BekmFxCI.d.mts → protocol-D5XDySYu.d.mts} +1 -1
- package/dist/{provision-Chq0NRAV.mjs → provision-DfxLCg-d.mjs} +1 -1
- package/dist/{provision-B7UFrBH7.mjs → provision-DztLJ97X.mjs} +24 -8
- package/dist/{requests-CG-Pj8ze.mjs → requests-D_pbzDyz.mjs} +1 -1
- package/dist/{rollback-CIrm2txZ.mjs → rollback-CjfIYsJx.mjs} +2 -2
- package/dist/{route-types--PAOzHlH.mjs → route-types-DvEGmPif.mjs} +61 -3
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/routing.d.mts +5 -4
- package/dist/runtime/routing.mjs +10 -70
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +4 -2
- package/dist/{secret-BL6g7mF5.mjs → secret-3X0PxmuX.mjs} +9 -12
- package/dist/{version-metadata-DmaZNTYW.mjs → version-metadata-D2vfMQzv.mjs} +2 -1
- package/dist/{wrangler-CDiEBCdS.mjs → wrangler-I-scB_1t.mjs} +80 -12
- package/dist/wrangler-UnwdISay.mjs +1 -0
- package/dist/{wrapper-CEiDeCqD.mjs → wrapper-BBl1rC32.mjs} +3 -3
- package/dist/{ws-D1zWiB_P.d.mts → ws-B3ClMVDh.d.mts} +3 -2
- package/docs/guide/auth.md +1 -1
- package/docs/guide/edge/redirects.md +22 -0
- package/docs/guide/pages-routing/actions-and-forms.md +24 -0
- package/docs/guide/platform/installation/maintenance.md +3 -1
- package/docs/guide/server-routing.md +2 -0
- package/docs/guide/ssg.md +8 -0
- package/docs/integrations/cloudflare.md +16 -7
- package/docs/reference/api/auth.md +6 -2
- package/docs/reference/api/deploy.md +9 -5
- package/docs/reference/api/pages.md +2 -0
- package/docs/reference/cli/deploy.md +10 -9
- package/docs/reference/config.md +11 -1
- package/package.json +8 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +1 -1
- package/dist/auth-DkcFflXV.d.mts +0 -42
- package/dist/cf-build-output-DlBkWdNU.mjs +0 -1
- package/dist/client-DyxPQnF_.mjs +0 -1
- package/dist/config-BTu1o3Dc.mjs +0 -49
- package/dist/deploy-CtHE2A3R.mjs +0 -2
- package/dist/gen-TgXy93Rr.mjs +0 -1
- package/dist/login-Cdo8Aco1.mjs +0 -1
- package/dist/migrate-COPncCGx.mjs +0 -1
- package/dist/operator-cmd-DDiX7Y3f.mjs +0 -1
- package/dist/prepare-B3VrSF1Z.mjs +0 -1
- package/dist/wrangler-DOPr4jyI.mjs +0 -1
|
@@ -3,8 +3,8 @@ import { a as join, c as resolve, n as dirname, o as normalize, r as extname, s
|
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-BsDfhxIw.mjs";
|
|
4
4
|
import { r as detectFramework } from "./plugin-inference-CeiB6BG5.mjs";
|
|
5
5
|
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DGu_QZ_Q.mjs";
|
|
6
|
-
import { m as resolveBindingNames, p as readConfig, u as isNodeTarget } from "./config-
|
|
7
|
-
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-
|
|
6
|
+
import { m as resolveBindingNames, p as readConfig, u as isNodeTarget } from "./config-OFOAimzt.mjs";
|
|
7
|
+
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-DDOQwiXk.mjs";
|
|
8
8
|
import { t as collectMigrations } from "./collect-Dew86qce.mjs";
|
|
9
9
|
import { o as validateSsrEntry } from "./entry-BEM8ZuGP.mjs";
|
|
10
10
|
import { r as hasEmailHandlers } from "./email-B9ayYQEG.mjs";
|
|
@@ -13,38 +13,38 @@ import { t as writeFileAtomic } from "./atomic-write-Dq6R0BPN.mjs";
|
|
|
13
13
|
import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
|
|
14
14
|
import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
15
15
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-DeWj5F9Y.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import { A as syncWranglerWebSockets, C as readWranglerManagedQueueCleanupCandidates, D as sameMigrationsDir, E as resolveLiveBindingConfig, 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-
|
|
16
|
+
import { a as persistCloudflareConfig, c as stashCloudflareDeployPointer, i as materializeCloudflareConfig } from "./cloudflare-config-CH1AylZT.mjs";
|
|
17
|
+
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-I-scB_1t.mjs";
|
|
18
18
|
import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
19
19
|
import { t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
|
|
20
20
|
import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-B6iOCjKI.mjs";
|
|
21
|
-
import { i as otherQueueConsumers, n as chooseCloudflareQueueName, o as scopedCloudflareQueueName, r as cloudflareQueueName } from "./dispatch-
|
|
21
|
+
import { i as otherQueueConsumers, n as chooseCloudflareQueueName, o as scopedCloudflareQueueName, r as cloudflareQueueName } from "./dispatch-CLa2LThw.mjs";
|
|
22
22
|
import { l as resolveRemoteMode, n as CLOUDFLARE_QUEUE_NAMES_BUILD_ENV, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-BaMz0j7H.mjs";
|
|
23
23
|
import { t as assertNoPrerenderFailures } from "./prerender-render-CaShbHJ3.mjs";
|
|
24
|
-
import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-
|
|
25
|
-
import { a as emailConfigInputs, c as renderAddressMap, d as isGeneratedAssetHeaders, g as prerenderPagesNode, h as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, m as collectPrerenderPathsNode, n as SEND_EMAIL_BINDING, o as preflightEmail, p as collectPrerenderPaths, r as applyEmailSetup, t as EMAIL_FROM_VAR } from "./email-cloudflare-
|
|
26
|
-
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-
|
|
27
|
-
import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-
|
|
24
|
+
import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-D2vfMQzv.mjs";
|
|
25
|
+
import { a as emailConfigInputs, c as renderAddressMap, d as isGeneratedAssetHeaders, g as prerenderPagesNode, h as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, m as collectPrerenderPathsNode, n as SEND_EMAIL_BINDING, o as preflightEmail, p as collectPrerenderPaths, r as applyEmailSetup, t as EMAIL_FROM_VAR } from "./email-cloudflare-PMbAev9Q.mjs";
|
|
26
|
+
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-4719u_kf.mjs";
|
|
27
|
+
import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-XpNR9zoh.mjs";
|
|
28
28
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
|
|
29
29
|
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
30
30
|
import { r as getPackageDir } from "./agents-CuNtT0D_.mjs";
|
|
31
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-
|
|
31
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
32
32
|
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-BpgYODYx.mjs";
|
|
33
33
|
import { t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
34
34
|
import { i as safePositional, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "./cf-command-values-ByHk0xg4.mjs";
|
|
35
35
|
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-8jEYIeim.mjs";
|
|
36
|
-
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-
|
|
37
|
-
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-
|
|
38
|
-
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-
|
|
39
|
-
import { a as checkCloudflareProvisionDrift, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-
|
|
40
|
-
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-
|
|
41
|
-
import { n as getCfCliVersion, r as getVoidUserAgent, t as
|
|
36
|
+
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-B3VobvXm.mjs";
|
|
37
|
+
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-BBl1rC32.mjs";
|
|
38
|
+
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-DjeBFG2c.mjs";
|
|
39
|
+
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-DztLJ97X.mjs";
|
|
40
|
+
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-DIq_gFTP.mjs";
|
|
41
|
+
import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareWorkerSettings } from "./cf-worker-settings-Dg27RzyT.mjs";
|
|
42
42
|
import { t as sanitizeTerminalLogText } from "./terminal-log-text-D9ACPOuG.mjs";
|
|
43
|
-
import { t as promptForLoginToken } from "./login-
|
|
44
|
-
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-
|
|
45
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-
|
|
43
|
+
import { t as promptForLoginToken } from "./login-PcFy5mlC.mjs";
|
|
44
|
+
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-DyD_kVFr.mjs";
|
|
45
|
+
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-Bc-7fN44.mjs";
|
|
46
46
|
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-BzKMWnO4.mjs";
|
|
47
|
-
import {
|
|
47
|
+
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-B8S2xTcb.mjs";
|
|
48
48
|
import { a as runMySqlMigrations } from "./runner-mysql-BWmbk5IE.mjs";
|
|
49
49
|
import { i as runPgMigrations } from "./runner-pg-Cr3qrqi4.mjs";
|
|
50
50
|
import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
|
|
@@ -60,7 +60,7 @@ import { execFile, execSync, spawn } from "node:child_process";
|
|
|
60
60
|
import { getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
|
|
61
61
|
import { convertToWranglerConfig } from "@cloudflare/config";
|
|
62
62
|
import ignore from "ignore";
|
|
63
|
-
import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, cloudflareCommandDiagnostic, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
|
|
63
|
+
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";
|
|
64
64
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
65
65
|
import mime from "mime";
|
|
66
66
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
@@ -219,6 +219,112 @@ async function maybeLinkCloudflareDeploy(root, options = {}, deps = {}) {
|
|
|
219
219
|
return isCancel(accepted) || accepted !== true ? "cancelled" : "existing";
|
|
220
220
|
}
|
|
221
221
|
//#endregion
|
|
222
|
+
//#region src/cli/cloudflare-readiness.ts
|
|
223
|
+
const STATE_FILE = join(".void", "cloudflare.json");
|
|
224
|
+
/** Resolve the account subdomain without exposing Cloudflare credentials to project code. */
|
|
225
|
+
function resolveCloudflareWorkersDevSubdomain(root, accountId, env = process.env) {
|
|
226
|
+
const configured = env.CLOUDFLARE_WORKERS_SUBDOMAIN;
|
|
227
|
+
if (configured !== void 0 && configured.trim().length > 0) {
|
|
228
|
+
const normalized = normalizeWorkersDevSubdomain(configured);
|
|
229
|
+
if (!normalized) throw new Error("deploy: CLOUDFLARE_WORKERS_SUBDOMAIN must be the account subdomain, for example \"my-team\" or \"my-team.workers.dev\".");
|
|
230
|
+
return normalized;
|
|
231
|
+
}
|
|
232
|
+
const cached = subdomainsByAccount(readCloudflareLocalState(root))[accountId];
|
|
233
|
+
return typeof cached === "string" ? normalizeWorkersDevSubdomain(cached) : void 0;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Record `CF_ACCESS_READINESS_ORIGIN` before project code runs. `void.config.ts` is evaluated in
|
|
237
|
+
* this process, so a later read of `process.env` could see a value that the project assigned,
|
|
238
|
+
* for example through a dotenv import. `null` means unset. An already recorded value is kept.
|
|
239
|
+
*/
|
|
240
|
+
function withRecordedReadinessAccessOrigin(options, env = process.env) {
|
|
241
|
+
return options.readinessAccessOrigin !== void 0 ? options : {
|
|
242
|
+
...options,
|
|
243
|
+
readinessAccessOrigin: env.CF_ACCESS_READINESS_ORIGIN ?? null
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Validate the operator-selected origin that may receive readiness Access credentials when the
|
|
248
|
+
* probe uses a route or Custom Domain. Pass the value that `withRecordedReadinessAccessOrigin`
|
|
249
|
+
* recorded, not the current `process.env`.
|
|
250
|
+
*/
|
|
251
|
+
function resolveCloudflareReadinessAccessOrigin(env) {
|
|
252
|
+
const configured = env.CF_ACCESS_READINESS_ORIGIN?.trim();
|
|
253
|
+
if (!configured) return;
|
|
254
|
+
const origin = normalizeReadinessAccessOrigin(configured);
|
|
255
|
+
if (!origin) throw new Error("deploy: CF_ACCESS_READINESS_ORIGIN must be one exact https origin, without a wildcard, path, query, fragment, or credentials, for example \"https://app.example.com\".");
|
|
256
|
+
return origin;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Read the account subdomain from the Cloudflare API when a first publish reports no URL and
|
|
260
|
+
* no subdomain is configured or cached. The API returns only the account label, so this adds
|
|
261
|
+
* `.fed` for FedRAMP High, as Wrangler does. A failed lookup resolves `unavailable`.
|
|
262
|
+
*/
|
|
263
|
+
async function readCloudflareWorkersDevSubdomain(options) {
|
|
264
|
+
if (!options.verifyUploader()) return {
|
|
265
|
+
ok: false,
|
|
266
|
+
reason: "uploader-changed"
|
|
267
|
+
};
|
|
268
|
+
let label;
|
|
269
|
+
try {
|
|
270
|
+
const result = await options.runWrangler({
|
|
271
|
+
type: "workers.subdomain.get",
|
|
272
|
+
configPath: options.configPath
|
|
273
|
+
}, { capture: true });
|
|
274
|
+
if (!isCleanCloudflareExit(result) || !result.data || typeof result.data !== "object" || !("subdomain" in result.data) || typeof result.data.subdomain !== "string") return {
|
|
275
|
+
ok: false,
|
|
276
|
+
reason: "unavailable"
|
|
277
|
+
};
|
|
278
|
+
label = result.data.subdomain;
|
|
279
|
+
} catch {
|
|
280
|
+
return {
|
|
281
|
+
ok: false,
|
|
282
|
+
reason: "unavailable"
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
const subdomain = normalizeWorkersDevSubdomain(options.complianceRegion === "fedramp_high" ? `${label}.fed` : label);
|
|
286
|
+
return subdomain ? {
|
|
287
|
+
ok: true,
|
|
288
|
+
subdomain
|
|
289
|
+
} : {
|
|
290
|
+
ok: false,
|
|
291
|
+
reason: "unavailable"
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/** Cache a Wrangler-reported account subdomain for later no-preview version probes. */
|
|
295
|
+
function rememberCloudflareWorkersDevSubdomain(root, accountId, url) {
|
|
296
|
+
const workersDevSubdomain = extractWorkersDevSubdomain(url);
|
|
297
|
+
if (!workersDevSubdomain) return false;
|
|
298
|
+
const current = readCloudflareLocalState(root);
|
|
299
|
+
const currentByAccount = subdomainsByAccount(current);
|
|
300
|
+
if (currentByAccount[accountId] === workersDevSubdomain) return false;
|
|
301
|
+
const { workersDevSubdomain: _legacy, ...state } = current;
|
|
302
|
+
const filePath = join(root, STATE_FILE);
|
|
303
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
304
|
+
writeFileSync(filePath, JSON.stringify({
|
|
305
|
+
...state,
|
|
306
|
+
workersDevSubdomains: {
|
|
307
|
+
...currentByAccount,
|
|
308
|
+
[accountId]: workersDevSubdomain
|
|
309
|
+
}
|
|
310
|
+
}, null, 2) + "\n");
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
function subdomainsByAccount(state) {
|
|
314
|
+
const value = state.workersDevSubdomains;
|
|
315
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
316
|
+
}
|
|
317
|
+
function readCloudflareLocalState(root) {
|
|
318
|
+
const filePath = join(root, STATE_FILE);
|
|
319
|
+
if (!existsSync(filePath)) return {};
|
|
320
|
+
try {
|
|
321
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
322
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
|
|
323
|
+
} catch {
|
|
324
|
+
return {};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
222
328
|
//#region src/cli/deploy-binding-snapshot.ts
|
|
223
329
|
/** The id-bearing binding fields whose identity must survive the build unchanged. */
|
|
224
330
|
const DEPLOY_BINDING_IDENTITY_FIELDS = {
|
|
@@ -1805,6 +1911,31 @@ function textValue(value, label) {
|
|
|
1805
1911
|
if (typeof value !== "string") throw new Error(`The Cloudflare ${label} is missing from the verified Worker output.`);
|
|
1806
1912
|
return value;
|
|
1807
1913
|
}
|
|
1914
|
+
/** Match cf's package collection for uploads that preserve secrets through the JSON API. */
|
|
1915
|
+
async function readPackageDependencies(directory) {
|
|
1916
|
+
try {
|
|
1917
|
+
const pkg = record(JSON.parse(readFileSync(join(directory, "package.json"), "utf8")));
|
|
1918
|
+
const declared = {
|
|
1919
|
+
...record(pkg?.dependencies),
|
|
1920
|
+
...record(pkg?.devDependencies)
|
|
1921
|
+
};
|
|
1922
|
+
const { getInstalledPackageVersion } = await import("@cloudflare/workers-utils");
|
|
1923
|
+
const dependencies = [];
|
|
1924
|
+
for (const [name, packageJsonVersion] of Object.entries(declared)) {
|
|
1925
|
+
if (dependencies.length >= 200) break;
|
|
1926
|
+
if (typeof packageJsonVersion !== "string" || /^(workspace|catalog|file|link):/.test(packageJsonVersion)) continue;
|
|
1927
|
+
const installedVersion = getInstalledPackageVersion(name, directory);
|
|
1928
|
+
if (installedVersion) dependencies.push({
|
|
1929
|
+
name,
|
|
1930
|
+
packageJsonVersion,
|
|
1931
|
+
installedVersion
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
return dependencies.length ? dependencies : void 0;
|
|
1935
|
+
} catch {
|
|
1936
|
+
return;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1808
1939
|
const moduleContentTypes = {
|
|
1809
1940
|
esm: "application/javascript+module",
|
|
1810
1941
|
cjs: "application/javascript",
|
|
@@ -2544,6 +2675,7 @@ async function uploadPinnedCloudflareVersion(options) {
|
|
|
2544
2675
|
modules,
|
|
2545
2676
|
compatibility_date: config.compatibilityDate,
|
|
2546
2677
|
compatibility_flags: config.compatibilityFlags,
|
|
2678
|
+
package_dependencies: await readPackageDependencies(options.output.directory),
|
|
2547
2679
|
bindings,
|
|
2548
2680
|
...config.limits ? { limits: {
|
|
2549
2681
|
cpu_ms: config.limits.cpuMs,
|
|
@@ -3096,17 +3228,18 @@ function createCfVersionRunner(options) {
|
|
|
3096
3228
|
"deploy",
|
|
3097
3229
|
"--prebuilt"
|
|
3098
3230
|
], command.capture, directory);
|
|
3099
|
-
if (isCleanCloudflareExit(deployed) && raw.observability !== void 0) {
|
|
3231
|
+
if (isCleanCloudflareExit(deployed) && (raw.observability !== void 0 || raw.logpush !== void 0)) {
|
|
3100
3232
|
const credentials = options.pinnedUpload;
|
|
3101
3233
|
if (!credentials || !credentials.verifyUploader()) return failed("The Cloudflare settings publisher is unavailable.");
|
|
3102
3234
|
try {
|
|
3103
3235
|
const token = await credentials.getToken();
|
|
3104
3236
|
if (!token || !credentials.verifyUploader()) return failed("Cloudflare session is unavailable for publishing Worker settings.");
|
|
3105
|
-
await
|
|
3237
|
+
await publishCloudflareWorkerSettings({
|
|
3106
3238
|
apiBaseUrl: credentials.apiBaseUrl,
|
|
3107
3239
|
accountId: credentials.accountId,
|
|
3108
3240
|
workerName,
|
|
3109
3241
|
observability: raw.observability,
|
|
3242
|
+
logpush: raw.logpush,
|
|
3110
3243
|
headers: { Authorization: `Bearer ${token}` }
|
|
3111
3244
|
});
|
|
3112
3245
|
} catch (cause) {
|
|
@@ -3167,53 +3300,6 @@ function createCfVersionRunner(options) {
|
|
|
3167
3300
|
};
|
|
3168
3301
|
}
|
|
3169
3302
|
//#endregion
|
|
3170
|
-
//#region src/cli/cloudflare-readiness.ts
|
|
3171
|
-
const STATE_FILE = join(".void", "cloudflare.json");
|
|
3172
|
-
/** Resolve the account subdomain without exposing Cloudflare credentials to project code. */
|
|
3173
|
-
function resolveCloudflareWorkersDevSubdomain(root, accountId, env = process.env) {
|
|
3174
|
-
const configured = env.CLOUDFLARE_WORKERS_SUBDOMAIN;
|
|
3175
|
-
if (configured !== void 0 && configured.trim().length > 0) {
|
|
3176
|
-
const normalized = normalizeWorkersDevSubdomain(configured);
|
|
3177
|
-
if (!normalized) throw new Error("deploy: CLOUDFLARE_WORKERS_SUBDOMAIN must be the account subdomain, for example \"my-team\" or \"my-team.workers.dev\".");
|
|
3178
|
-
return normalized;
|
|
3179
|
-
}
|
|
3180
|
-
const cached = subdomainsByAccount(readCloudflareLocalState(root))[accountId];
|
|
3181
|
-
return typeof cached === "string" ? normalizeWorkersDevSubdomain(cached) : void 0;
|
|
3182
|
-
}
|
|
3183
|
-
/** Cache a Wrangler-reported account subdomain for later no-preview version probes. */
|
|
3184
|
-
function rememberCloudflareWorkersDevSubdomain(root, accountId, url) {
|
|
3185
|
-
const workersDevSubdomain = extractWorkersDevSubdomain(url);
|
|
3186
|
-
if (!workersDevSubdomain) return false;
|
|
3187
|
-
const current = readCloudflareLocalState(root);
|
|
3188
|
-
const currentByAccount = subdomainsByAccount(current);
|
|
3189
|
-
if (currentByAccount[accountId] === workersDevSubdomain) return false;
|
|
3190
|
-
const { workersDevSubdomain: _legacy, ...state } = current;
|
|
3191
|
-
const filePath = join(root, STATE_FILE);
|
|
3192
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
3193
|
-
writeFileSync(filePath, JSON.stringify({
|
|
3194
|
-
...state,
|
|
3195
|
-
workersDevSubdomains: {
|
|
3196
|
-
...currentByAccount,
|
|
3197
|
-
[accountId]: workersDevSubdomain
|
|
3198
|
-
}
|
|
3199
|
-
}, null, 2) + "\n");
|
|
3200
|
-
return true;
|
|
3201
|
-
}
|
|
3202
|
-
function subdomainsByAccount(state) {
|
|
3203
|
-
const value = state.workersDevSubdomains;
|
|
3204
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
3205
|
-
}
|
|
3206
|
-
function readCloudflareLocalState(root) {
|
|
3207
|
-
const filePath = join(root, STATE_FILE);
|
|
3208
|
-
if (!existsSync(filePath)) return {};
|
|
3209
|
-
try {
|
|
3210
|
-
const parsed = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
3211
|
-
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
|
|
3212
|
-
} catch {
|
|
3213
|
-
return {};
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
//#endregion
|
|
3217
3303
|
//#region src/cli/deploy-cloudflare-helpers.ts
|
|
3218
3304
|
/**
|
|
3219
3305
|
* Discover the root wrangler config path the same way the build / bindings
|
|
@@ -3266,6 +3352,7 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3266
3352
|
log$1.error(`deploy: ${getErrorMessage(error)}`);
|
|
3267
3353
|
return null;
|
|
3268
3354
|
}
|
|
3355
|
+
const complianceRegion = resolveWorkersDevComplianceRegion(process.env, readWranglerTopLevelString(rootConfig, "compliance_region"));
|
|
3269
3356
|
const pins = createCloudflareUploaderPins(root, deps);
|
|
3270
3357
|
let accountId = readWranglerTopLevelString(rootConfig, "account_id") ?? (process.env.CLOUDFLARE_ACCOUNT_ID?.trim() || void 0);
|
|
3271
3358
|
if (!accountId) {
|
|
@@ -3285,8 +3372,10 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3285
3372
|
}
|
|
3286
3373
|
}
|
|
3287
3374
|
let workersDevSubdomain;
|
|
3375
|
+
let readinessAccessOrigin;
|
|
3288
3376
|
try {
|
|
3289
3377
|
workersDevSubdomain = resolveCloudflareWorkersDevSubdomain(root, accountId);
|
|
3378
|
+
readinessAccessOrigin = resolveCloudflareReadinessAccessOrigin({ CF_ACCESS_READINESS_ORIGIN: options.readinessAccessOrigin ?? void 0 });
|
|
3290
3379
|
} catch (error) {
|
|
3291
3380
|
log$1.error(getErrorMessage(error));
|
|
3292
3381
|
return null;
|
|
@@ -3294,8 +3383,10 @@ async function connectCloudflareDeployAccount(options) {
|
|
|
3294
3383
|
return {
|
|
3295
3384
|
...pins,
|
|
3296
3385
|
apiBaseUrl,
|
|
3386
|
+
complianceRegion,
|
|
3297
3387
|
accountId,
|
|
3298
3388
|
workersDevSubdomain,
|
|
3389
|
+
readinessAccessOrigin,
|
|
3299
3390
|
runWrangler: deps.runWrangler ?? createDeployWranglerRunner(root, accountId, apiBaseUrl),
|
|
3300
3391
|
rootConfig
|
|
3301
3392
|
};
|
|
@@ -3381,7 +3472,21 @@ function cloudflareCandidateActivationOptions(options) {
|
|
|
3381
3472
|
},
|
|
3382
3473
|
readinessHeaders: cloudflareWorkerReadinessHeaders(),
|
|
3383
3474
|
workersDevSubdomain,
|
|
3475
|
+
resolveWorkersDevSubdomain: async () => {
|
|
3476
|
+
const { complianceRegion } = options;
|
|
3477
|
+
if (complianceRegion === void 0) return {
|
|
3478
|
+
ok: false,
|
|
3479
|
+
reason: "unavailable"
|
|
3480
|
+
};
|
|
3481
|
+
return readCloudflareWorkersDevSubdomain({
|
|
3482
|
+
configPath,
|
|
3483
|
+
complianceRegion,
|
|
3484
|
+
runWrangler,
|
|
3485
|
+
verifyUploader: options.assertUploaderStillPinned
|
|
3486
|
+
});
|
|
3487
|
+
},
|
|
3384
3488
|
readinessHeadersWorkersDevSubdomain: process.env.CLOUDFLARE_WORKERS_SUBDOMAIN?.trim() ? workersDevSubdomain : void 0,
|
|
3489
|
+
readinessHeadersOrigin: options.readinessAccessOrigin,
|
|
3385
3490
|
...createCloudflareEmptyTriggerPublishers({
|
|
3386
3491
|
accountId,
|
|
3387
3492
|
apiBaseUrl: options.apiBaseUrl,
|
|
@@ -3482,36 +3587,64 @@ function formatCloudflareActivationFailure(result) {
|
|
|
3482
3587
|
].join("\n");
|
|
3483
3588
|
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." : ""}`;
|
|
3484
3589
|
case "atomic-failed": return `deploy: Cloudflare could not publish the Worker atomically${status}; inspect production status before retrying.${cloudflareCode}${diagnostic}`;
|
|
3485
|
-
case "atomic-output-invalid":
|
|
3590
|
+
case "atomic-output-invalid":
|
|
3591
|
+
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published Worker version ${result.versionId} atomically`, `If the app uses workers.dev, set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain ${WORKERS_SUBDOMAIN_EXAMPLE}.`);
|
|
3592
|
+
return "deploy: Cloudflare published atomically but did not report its version id. Inspect `void project status` immediately.";
|
|
3486
3593
|
case "atomic-readiness-failed":
|
|
3487
|
-
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}`;
|
|
3594
|
+
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")}` : ""}`;
|
|
3488
3595
|
case "readiness-failed": return ["deploy: the uploaded Worker Version did not pass /__void/ready.", formatCloudflareReadinessRestoration(result)].join("\n");
|
|
3489
|
-
case "readiness-access-denied":
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3596
|
+
case "readiness-access-denied":
|
|
3597
|
+
if (result.customRouteReadinessOrigin) return [
|
|
3598
|
+
"deploy: Cloudflare Access blocked the uploaded Worker Version readiness probe.",
|
|
3599
|
+
...customRouteAccessHint(result.customRouteReadinessOrigin),
|
|
3600
|
+
ATOMIC_ACCESS_ALTERNATIVE,
|
|
3601
|
+
formatCloudflareReadinessRestoration(result)
|
|
3602
|
+
].join("\n");
|
|
3603
|
+
return [
|
|
3604
|
+
"deploy: Cloudflare Access blocked the uploaded Worker Version readiness probe.",
|
|
3605
|
+
"For CI, set CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET to an admitted service token.",
|
|
3606
|
+
"For a local deploy, set CF_ACCESS_TOKEN to a short-lived user JWT from cloudflared.",
|
|
3607
|
+
"If the response is error 1050, create an Access application for this hostname; a token alone cannot bypass account default-deny.",
|
|
3608
|
+
`Then retry. ${formatCloudflareReadinessRestoration(result)}`
|
|
3609
|
+
].join("\n");
|
|
3496
3610
|
case "bootstrap-failed": return `deploy: Cloudflare could not bootstrap the first Worker deployment${status}.${cloudflareCode}${diagnostic}`;
|
|
3497
|
-
case "bootstrap-output-invalid":
|
|
3611
|
+
case "bootstrap-output-invalid":
|
|
3612
|
+
if (result.versionId) return formatCloudflarePublishWithoutUrl(`Cloudflare published the first Worker deployment as version ${result.versionId}`, `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}.`);
|
|
3613
|
+
return ["deploy: Cloudflare bootstrapped the first Worker deployment, but Wrangler", "did not report its version id. Inspect `void project status` before retrying."].join("\n");
|
|
3498
3614
|
case "bootstrap-readiness-failed": return [
|
|
3499
3615
|
"deploy: the first Worker deployment did not pass /__void/ready.",
|
|
3500
3616
|
"Cloudflare requires this bootstrap to be non-versioned, so the new Worker is already active;",
|
|
3501
3617
|
"inspect its logs and `void project status` before retrying."
|
|
3502
3618
|
].join("\n") + diagnostic;
|
|
3503
|
-
case "bootstrap-readiness-access-denied":
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3619
|
+
case "bootstrap-readiness-access-denied":
|
|
3620
|
+
if (result.customRouteReadinessOrigin) return [
|
|
3621
|
+
"deploy: Cloudflare Access blocked the first Worker deployment readiness probe.",
|
|
3622
|
+
"Cloudflare requires the first deployment to be non-versioned, so the new Worker is already active behind Access.",
|
|
3623
|
+
...customRouteAccessHint(result.customRouteReadinessOrigin),
|
|
3624
|
+
"Later deploys check readiness before traffic moves, so they need the same setting.",
|
|
3625
|
+
ATOMIC_ACCESS_ALTERNATIVE
|
|
3626
|
+
].join("\n");
|
|
3627
|
+
return [
|
|
3628
|
+
"deploy: Cloudflare Access blocked the first Worker deployment readiness probe.",
|
|
3629
|
+
"For CI, set CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET to an admitted service token;",
|
|
3630
|
+
"for a local deploy, set CF_ACCESS_TOKEN to a short-lived user JWT from cloudflared.",
|
|
3631
|
+
"If the response is error 1050, create an Access application for this hostname; a token alone cannot bypass account default-deny.",
|
|
3632
|
+
"Then retry. Cloudflare requires the first deployment to be non-versioned, so the new",
|
|
3633
|
+
"Worker is already active behind Access."
|
|
3634
|
+
].join("\n");
|
|
3511
3635
|
case "activation-failed": return `deploy: the ready Worker Version could not be activated${status}; production traffic is unchanged.`;
|
|
3512
3636
|
case "triggers-failed": return `deploy: the Worker activated, but Cloudflare trigger synchronization failed${status}. ${result.rollback === "succeeded" ? "Traffic was restored to the previous version." : result.rollback === "unavailable" ? result.previousVersionId === null ? "This was the first deployment, so no previous version was available to restore." : "Traffic or trigger restoration could not be completed. Inspect its routes, schedules, queues, and workflows in Cloudflare before retrying." : "Automatic traffic restoration failed; inspect `void project status` immediately."}`;
|
|
3513
3637
|
}
|
|
3514
3638
|
}
|
|
3639
|
+
/** Explain why a custom-route readiness probe carried no Access credentials. */
|
|
3640
|
+
function customRouteAccessHint(origin) {
|
|
3641
|
+
return [
|
|
3642
|
+
`Void did not send Access credentials to ${origin}. A route or Custom Domain receives them only when CF_ACCESS_READINESS_ORIGIN names its origin.`,
|
|
3643
|
+
`If Access protects ${origin} and admits your credentials, set CF_ACCESS_READINESS_ORIGIN=${origin} with CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET, or CF_ACCESS_TOKEN. Then retry.`,
|
|
3644
|
+
"Set it only if you control this hostname and it serves this Worker, because Void sends your Access credentials to it."
|
|
3645
|
+
];
|
|
3646
|
+
}
|
|
3647
|
+
const ATOMIC_ACCESS_ALTERNATIVE = "For a Worker with Durable Object migration history, `void deploy --platform cloudflare --atomic` publishes without the zero-traffic check. The new version receives traffic first, and the command still exits with an error because Void cannot verify readiness through Access.";
|
|
3515
3648
|
function formatCloudflareReadinessRestoration(result) {
|
|
3516
3649
|
switch (result.rollback) {
|
|
3517
3650
|
case "succeeded": return "The failed version remains inactive, and traffic was restored to the previous version.";
|
|
@@ -3521,6 +3654,16 @@ function formatCloudflareReadinessRestoration(result) {
|
|
|
3521
3654
|
default: return "The failed version remains inactive for inspection; production traffic is unchanged.";
|
|
3522
3655
|
}
|
|
3523
3656
|
}
|
|
3657
|
+
const WORKERS_SUBDOMAIN_EXAMPLE = "(for example \"my-team\", or \"my-team.fed\" for FedRAMP High)";
|
|
3658
|
+
/** Explain a live version whose readiness URL Void could not determine. */
|
|
3659
|
+
function formatCloudflarePublishWithoutUrl(published, recovery) {
|
|
3660
|
+
return [
|
|
3661
|
+
`deploy: ${published}, but Void could not determine its URL.`,
|
|
3662
|
+
"Void did not update its routes, workers.dev setting, or other triggers, and did not check /__void/ready.",
|
|
3663
|
+
recovery,
|
|
3664
|
+
"Then inspect `void project status` before you deploy again."
|
|
3665
|
+
].join("\n");
|
|
3666
|
+
}
|
|
3524
3667
|
/** Capture the Access credential used only by the guarded Worker readiness probe. */
|
|
3525
3668
|
function cloudflareWorkerReadinessHeaders() {
|
|
3526
3669
|
return trustedCloudflareWorkerAccessHeaders({
|
|
@@ -3648,10 +3791,11 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3648
3791
|
configPath,
|
|
3649
3792
|
rootConfig: parseRootWranglerConfig(configPath),
|
|
3650
3793
|
deps,
|
|
3651
|
-
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink)
|
|
3794
|
+
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
3795
|
+
readinessAccessOrigin: options.readinessAccessOrigin
|
|
3652
3796
|
});
|
|
3653
3797
|
if (!connection || !await confirmCloudflareDeployAuthentication(connection, configPath)) return exit(1);
|
|
3654
|
-
const { apiBaseUrl, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, runWrangler } = connection;
|
|
3798
|
+
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
3655
3799
|
const existingWorker = await prepareExistingCloudflareDeployWithAuth({
|
|
3656
3800
|
root,
|
|
3657
3801
|
configPath,
|
|
@@ -3699,6 +3843,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3699
3843
|
const merged = mergeAndLintRoutingRules(preset.outputDir, voidConfig.routing);
|
|
3700
3844
|
const manifest = buildStaticManifest({
|
|
3701
3845
|
appType: preset.appType,
|
|
3846
|
+
alwaysUseHttps: voidConfig.routing?.alwaysUseHttps,
|
|
3702
3847
|
hashedAssetsPrefix: "assets",
|
|
3703
3848
|
headerRules: merged.headerRules,
|
|
3704
3849
|
redirectRules: merged.redirectRules,
|
|
@@ -3731,6 +3876,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3731
3876
|
}, null, 2)}\n`, { mode: 384 });
|
|
3732
3877
|
writeFileSync(entryPath, renderCloudflareStaticEntry({
|
|
3733
3878
|
runtimeImport: "void/edge",
|
|
3879
|
+
alwaysUseHttps: manifest.alwaysUseHttps,
|
|
3734
3880
|
headerRules: manifest.headerRules,
|
|
3735
3881
|
redirectRules: manifest.redirectRules,
|
|
3736
3882
|
fallbackRules: manifest.fallbackRules,
|
|
@@ -3779,8 +3925,10 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3779
3925
|
uploadConfigPath: staticConfigPath,
|
|
3780
3926
|
accountId,
|
|
3781
3927
|
apiBaseUrl,
|
|
3928
|
+
complianceRegion,
|
|
3782
3929
|
workerName,
|
|
3783
3930
|
workersDevSubdomain,
|
|
3931
|
+
readinessAccessOrigin,
|
|
3784
3932
|
runWrangler,
|
|
3785
3933
|
readExistingWorker: deps.readExistingWorker,
|
|
3786
3934
|
existingWorker,
|
|
@@ -4368,7 +4516,7 @@ async function buildCloudflareWorker(input) {
|
|
|
4368
4516
|
projectRoot: root,
|
|
4369
4517
|
configPath: generatedConfigPath,
|
|
4370
4518
|
accountId
|
|
4371
|
-
}) : prepareCfBuildOutput(dirname(generatedConfigPath), accountId);
|
|
4519
|
+
}) : prepareCfBuildOutput(dirname(generatedConfigPath), accountId, void 0, root);
|
|
4372
4520
|
if (usesCf) {
|
|
4373
4521
|
const preflight = await prepareBuildOutput();
|
|
4374
4522
|
if (!preflight) {
|
|
@@ -4891,10 +5039,11 @@ async function preflightCloudflareWorker(input) {
|
|
|
4891
5039
|
configPath,
|
|
4892
5040
|
rootConfig,
|
|
4893
5041
|
deps,
|
|
4894
|
-
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink)
|
|
5042
|
+
persistAccount: !(options.reuseExistingWorker || initialCloudflareLink),
|
|
5043
|
+
readinessAccessOrigin: options.readinessAccessOrigin
|
|
4895
5044
|
});
|
|
4896
5045
|
if (!connection) return exit(1);
|
|
4897
|
-
const { apiBaseUrl, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, runWrangler } = connection;
|
|
5046
|
+
const { apiBaseUrl, complianceRegion, usesCf, cfUploaderIsPinned, assertUploaderStillPinned, accountId, workersDevSubdomain, readinessAccessOrigin, runWrangler } = connection;
|
|
4898
5047
|
rootConfig = connection.rootConfig;
|
|
4899
5048
|
const workerName = readWranglerTopLevelString(rootConfig, "name") ?? deriveWorkerName(root);
|
|
4900
5049
|
printDeployContext(workerName, "Cloudflare");
|
|
@@ -5122,11 +5271,13 @@ async function preflightCloudflareWorker(input) {
|
|
|
5122
5271
|
});
|
|
5123
5272
|
return {
|
|
5124
5273
|
apiBaseUrl,
|
|
5274
|
+
complianceRegion,
|
|
5125
5275
|
usesCf,
|
|
5126
5276
|
cfUploaderIsPinned,
|
|
5127
5277
|
assertUploaderStillPinned,
|
|
5128
5278
|
accountId,
|
|
5129
5279
|
workersDevSubdomain,
|
|
5280
|
+
readinessAccessOrigin,
|
|
5130
5281
|
runWrangler,
|
|
5131
5282
|
workerName,
|
|
5132
5283
|
emailMap,
|
|
@@ -5147,7 +5298,7 @@ async function preflightCloudflareWorker(input) {
|
|
|
5147
5298
|
async function publishCloudflareWorker(input) {
|
|
5148
5299
|
const { root, deps, exit, cliLog, atomic, detectedFramework, initialCloudflareCandidate } = input;
|
|
5149
5300
|
const { configPath, needsSandbox, desired, analysis } = input.source;
|
|
5150
|
-
const { usesCf, existingWorker, pinnedHandoffLink, accountId, workerName, cfUploaderIsPinned, apiBaseUrl, runWrangler, assertUploaderStillPinned, schemaFacts, approvedHandoffKv, workersDevSubdomain } = input.preflight;
|
|
5301
|
+
const { usesCf, existingWorker, pinnedHandoffLink, accountId, workerName, cfUploaderIsPinned, apiBaseUrl, complianceRegion, runWrangler, assertUploaderStillPinned, schemaFacts, approvedHandoffKv, workersDevSubdomain, readinessAccessOrigin } = input.preflight;
|
|
5151
5302
|
const { migrations, d1MigrateToken, generatedConfigPath, prepareBuildOutput } = input.build;
|
|
5152
5303
|
const { workerWasMissingBeforeSecretProvisioning, initialAuthSecret, appliedMigrations } = input.migration;
|
|
5153
5304
|
const queueConsumerCleanup = readWranglerManagedQueueCleanupCandidates(configPath);
|
|
@@ -5189,8 +5340,10 @@ async function publishCloudflareWorker(input) {
|
|
|
5189
5340
|
uploadConfigPath: generatedConfigPath,
|
|
5190
5341
|
accountId,
|
|
5191
5342
|
apiBaseUrl,
|
|
5343
|
+
complianceRegion,
|
|
5192
5344
|
workerName,
|
|
5193
5345
|
workersDevSubdomain,
|
|
5346
|
+
readinessAccessOrigin,
|
|
5194
5347
|
runWrangler,
|
|
5195
5348
|
readExistingWorker: deps.readExistingWorker,
|
|
5196
5349
|
existingWorker,
|
|
@@ -5241,6 +5394,7 @@ async function publishCloudflareWorker(input) {
|
|
|
5241
5394
|
//#region src/cli/deploy-cloudflare.ts
|
|
5242
5395
|
/** Deploy to the user's own Cloudflare account through the guarded native Worker flow. */
|
|
5243
5396
|
async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
5397
|
+
options = withRecordedReadinessAccessOrigin(options);
|
|
5244
5398
|
const initialCloudflareLink = readCloudflareLink(root);
|
|
5245
5399
|
const initialCloudflareCandidate = readCloudflareCandidate(root);
|
|
5246
5400
|
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
@@ -5277,6 +5431,14 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5277
5431
|
}
|
|
5278
5432
|
return runCloudflareStaticDeploy(root, options, voidConfig, staticPreset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate);
|
|
5279
5433
|
}
|
|
5434
|
+
if (detectedFramework && voidConfig.routing?.alwaysUseHttps === true) {
|
|
5435
|
+
log$1.error([
|
|
5436
|
+
`deploy: native Cloudflare deployment cannot apply Void routing.alwaysUseHttps to ${detectedFramework.name}.`,
|
|
5437
|
+
"This framework owns its Worker request handler, so the HTTPS redirect would otherwise be ignored.",
|
|
5438
|
+
"Redirect HTTP to HTTPS in the framework, or turn on Cloudflare's Always Use HTTPS setting for your zone, then remove routing.alwaysUseHttps and retry."
|
|
5439
|
+
].join("\n"));
|
|
5440
|
+
return exit(1);
|
|
5441
|
+
}
|
|
5280
5442
|
const source = await prepareCloudflareDeploySource(root, options, voidConfig);
|
|
5281
5443
|
if (!source) return exit(1);
|
|
5282
5444
|
const preflight = await preflightCloudflareWorker({
|
|
@@ -5446,6 +5608,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
5446
5608
|
};
|
|
5447
5609
|
const manifest = buildFrameworkManifest({
|
|
5448
5610
|
frameworkName: detected.name,
|
|
5611
|
+
alwaysUseHttps: voidConfig.routing?.alwaysUseHttps,
|
|
5449
5612
|
workerMain: actualWorkerMain,
|
|
5450
5613
|
bindings,
|
|
5451
5614
|
migrations: validatedMigrations,
|
|
@@ -5619,7 +5782,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5619
5782
|
buildCommand: null,
|
|
5620
5783
|
outputDir: clientDir,
|
|
5621
5784
|
appType: "static"
|
|
5622
|
-
}, true, gitMetadata, assetsPrefix, headerRules, redirectRules, fallbackRules, void 0, cliLog, voidConfig.routing?.notFound);
|
|
5785
|
+
}, true, gitMetadata, assetsPrefix, headerRules, redirectRules, fallbackRules, void 0, cliLog, voidConfig.routing?.notFound, voidConfig.routing?.alwaysUseHttps);
|
|
5623
5786
|
}
|
|
5624
5787
|
}
|
|
5625
5788
|
const prerenderSourcesPresent = hasPrerenderSources({
|
|
@@ -5702,6 +5865,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5702
5865
|
...bindings,
|
|
5703
5866
|
needsLive: true
|
|
5704
5867
|
} : bindings,
|
|
5868
|
+
alwaysUseHttps: voidConfig.routing?.alwaysUseHttps,
|
|
5705
5869
|
hasEmailHandlers: !isFrameworkMode && routeScan.email !== void 0 && hasEmailHandlers(routeScan.email),
|
|
5706
5870
|
migrations: validatedMigrations,
|
|
5707
5871
|
schedules,
|
|
@@ -6204,6 +6368,7 @@ function resolveDeploymentPlatform(root, options) {
|
|
|
6204
6368
|
}
|
|
6205
6369
|
/** Run `void deploy`; a failure carries a summary of the deploy log in its message. */
|
|
6206
6370
|
async function runDeploy(root, options) {
|
|
6371
|
+
options = withRecordedReadinessAccessOrigin(options ?? {});
|
|
6207
6372
|
console.log();
|
|
6208
6373
|
const cliLog = openDeployLog({ mirrorToStderr: options?.debug === true || process.env.VOID_DEPLOY_DEBUG === "1" });
|
|
6209
6374
|
cliLog.info("deploy_start", {
|