void 1.1.11 → 1.1.12

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.
Files changed (152) hide show
  1. package/dist/{account-cmd-R35a4Oa8.mjs → account-cmd-Cj6sCMTk.mjs} +4 -4
  2. package/dist/{auth-link-VHmiKZmP.mjs → auth-link-Dj7lAC_K.mjs} +4 -4
  3. package/dist/{auth-router-O_Wrs5kg.mjs → auth-router-CNsMOFCa.mjs} +2 -2
  4. package/dist/{build-cmd-CMZiMn46.mjs → build-cmd-ByhegwRC.mjs} +2 -2
  5. package/dist/{cache-TZ5Ab3d7.mjs → cache-CEFb5ban.mjs} +2 -2
  6. package/dist/{cancel-deploy-DXoR6oC3.mjs → cancel-deploy-CaARY26n.mjs} +2 -2
  7. package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-ChEKWan2.mjs} +71 -7
  8. package/dist/cf-build-output-Dcmxa-Zm.mjs +1 -0
  9. package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-b8OqDoo9.mjs} +5 -16
  10. package/dist/cf-user-agent-BkEHPDLA.mjs +16 -0
  11. package/dist/cli/cli.mjs +135 -31
  12. package/dist/cli/cloudflare-operation-process.mjs +46 -9
  13. package/dist/{client-GuSO3v_x.mjs → client-BdzxubTS.mjs} +57 -12
  14. package/dist/client-DAnfyMe9.mjs +1 -0
  15. package/dist/{cloudflare-cmd-ZSErUl6Y.mjs → cloudflare-cmd-D_2-Q-_i.mjs} +1 -1
  16. package/dist/{cloudflare-operations-Cm8lVx7W.mjs → cloudflare-operations-BFLCpUCV.mjs} +1 -1
  17. package/dist/{cloudflare-operations-DH3GedbV.mjs → cloudflare-operations-D5PLrOqD.mjs} +14 -4
  18. package/dist/{connect-yQuLbuiJ.mjs → connect-C4_m2moF.mjs} +4 -4
  19. package/dist/{create-project-CGOo_OL_.mjs → create-project-CvuYDD-l.mjs} +1 -1
  20. package/dist/{create-project-DEEWJX_M.mjs → create-project-D8jQTwVQ.mjs} +2 -2
  21. package/dist/{db-COI-yTJE.mjs → db-BsiOAa0A.mjs} +58 -8
  22. package/dist/{delete-PgN6L_9N.mjs → delete-CAma7nFi.mjs} +2 -2
  23. package/dist/{deploy-DsW-PrRQ.mjs → deploy-D1gIPiAq.mjs} +118 -36
  24. package/dist/deploy-Dc0XsCQj.mjs +2 -0
  25. package/dist/{deploy-managed-static-Dqz06S2u.mjs → deploy-managed-static-B9KVxY3X.mjs} +64 -18
  26. package/dist/{deploy-transport-nY3vLXPL.mjs → deploy-transport-B3mtEi_q.mjs} +1 -1
  27. package/dist/deploy.d.mts +22 -1
  28. package/dist/deploy.mjs +45 -4
  29. package/dist/{domain-DKlNI0SR.mjs → domain-BAdwm-QS.mjs} +3 -3
  30. package/dist/{email-C0s3OvJk.mjs → email-MwjA7kaL.mjs} +4 -4
  31. package/dist/{env-BX2JFsgF.mjs → env-B163-G1s.mjs} +3 -3
  32. package/dist/{fetch-DHLOuPyk.d.mts → fetch-CUX0tB78.d.mts} +14 -1
  33. package/dist/fetch-CtESUYWd.mjs +26 -0
  34. package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
  35. package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
  36. package/dist/{fetch-stream-CNxOrBdP.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
  37. package/dist/{gen-Bj6ZkOcI.mjs → gen-CYN3wiov.mjs} +1 -1
  38. package/dist/gen-Cf-RBVg4.mjs +1 -0
  39. package/dist/{github-cmd-DQDryS-5.mjs → github-cmd-C8QsnJQs.mjs} +2 -2
  40. package/dist/{handler-_PqY82xe.d.mts → handler-D5K_yP6T.d.mts} +1 -1
  41. package/dist/{help-D49SL_lN.mjs → help-B2sFwn9b.mjs} +44 -3
  42. package/dist/help-w-xlx_kq.mjs +1 -0
  43. package/dist/index.d.mts +1 -1
  44. package/dist/index.mjs +38 -71
  45. package/dist/{init-DyTEY04s.mjs → init-DGFQMnbk.mjs} +6 -6
  46. package/dist/{link-CgOVn9EC.mjs → link-CwrfpjIM.mjs} +3 -3
  47. package/dist/{list-CUfD9RSb.mjs → list-hKoW5z-b.mjs} +3 -3
  48. package/dist/{live-DJONVlQK.d.mts → live-JheIDZKc.d.mts} +1 -1
  49. package/dist/login-08mBwZfI.mjs +1 -0
  50. package/dist/{login-BJvGW5Eu.mjs → login-f2eu2TQh.mjs} +3 -3
  51. package/dist/{logs-DeizBI4j.mjs → logs-CEWqD-_B.mjs} +3 -3
  52. package/dist/{migrate-8rk56vV8.mjs → migrate-DYfdWBXt.mjs} +1 -1
  53. package/dist/migrate-Di-4EuoE.mjs +1 -0
  54. package/dist/nitro.mjs +1 -1
  55. package/dist/operator-cmd-Bv20yLu2.mjs +1 -0
  56. package/dist/{operator-cmd-CA5QQyvE.mjs → operator-cmd-DCr_QGMH.mjs} +4 -4
  57. package/dist/{output-Ba6ZbrzY.mjs → output-CKguMgr7.mjs} +13 -1
  58. package/dist/pages/client.d.mts +2 -2
  59. package/dist/pages/client.mjs +18 -5
  60. package/dist/pages/index.d.mts +1 -1
  61. package/dist/pages/index.mjs +1 -1
  62. package/dist/pages/islands-plugin.d.mts +43 -5
  63. package/dist/pages/islands-plugin.mjs +98 -27
  64. package/dist/pages/protocol.d.mts +2 -2
  65. package/dist/pages/protocol.mjs +1 -1
  66. package/dist/pages/serialize.d.mts +2 -2
  67. package/dist/pages/serialize.mjs +1 -1
  68. package/dist/{platform-auth-config-CZaY812e.mjs → platform-auth-config-qGvEuns3.mjs} +5 -5
  69. package/dist/{platform-auth-protection-U9HCqoXv.mjs → platform-auth-protection-CyLcD6ot.mjs} +3 -3
  70. package/dist/{platform-auth-recovery-B0BV2hfV.mjs → platform-auth-recovery-B2LKI8V2.mjs} +3 -3
  71. package/dist/{platform-cmd-D9lwFpcl.mjs → platform-cmd-B2ec5eFg.mjs} +1 -1
  72. package/dist/{platform-cmd-CXrjk4fb.mjs → platform-cmd-CX7phm7V.mjs} +5 -5
  73. package/dist/{platform-domain-CXyq-68_.mjs → platform-domain-DDNK2y-4.mjs} +3 -3
  74. package/dist/{platform-lifecycle-D0TdyXbN.mjs → platform-lifecycle-3CR98Tg2.mjs} +386 -36
  75. package/dist/{platform-lifecycle-Dz2cJsLX.mjs → platform-lifecycle-CWc5gr6c.mjs} +1 -1
  76. package/dist/{platform-management-BvgbusqL.mjs → platform-management-DAE6g2QU.mjs} +1 -1
  77. package/dist/{platform-management-CnXhgxTM.mjs → platform-management-o3LCCeE4.mjs} +40 -2
  78. package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CBMZxCep.mjs} +1 -1
  79. package/dist/{platform-recovery-CH_fThW6.mjs → platform-recovery-Dmsg7lWA.mjs} +2 -2
  80. package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-hFbnWAVQ.mjs} +1 -1
  81. package/dist/{prepare-2XD6kh77.mjs → prepare-HKo7Rh5V.mjs} +1 -1
  82. package/dist/{project-cmd-CpLYflCH.mjs → project-cmd-8ylYGx-O.mjs} +17 -17
  83. package/dist/{project-team-CTSY7W7Q.mjs → project-team-Bvpl78we.mjs} +2 -2
  84. package/dist/{project-token-Cybtlfbl.mjs → project-token-QWHoJH2t.mjs} +2 -2
  85. package/dist/{project-zero-trust-DKOtqyvu.mjs → project-zero-trust-8tJ-RFvu.mjs} +2 -2
  86. package/dist/{protocol-B8sI8dRD.d.mts → protocol-Ssc_LhHj.d.mts} +1 -1
  87. package/dist/{protocol-RNP0u7UY.mjs → protocol-bAUUkx70.mjs} +1 -1
  88. package/dist/{provision-UcYjpTRh.mjs → provision-BgXFDv0d.mjs} +1 -1
  89. package/dist/{provision-BuifYvLc.mjs → provision-DZKYCEJg.mjs} +3 -2
  90. package/dist/{requests-Ryiazz9i.mjs → requests-Vk5Zyhcy.mjs} +2 -2
  91. package/dist/{rollback-Or0EV3rP.mjs → rollback-CH4yMQys.mjs} +9 -8
  92. package/dist/runtime/client-react.d.mts +2 -2
  93. package/dist/runtime/client-react.mjs +3 -3
  94. package/dist/runtime/client-solid.d.mts +2 -2
  95. package/dist/runtime/client-solid.mjs +3 -3
  96. package/dist/runtime/client-svelte.d.mts +2 -2
  97. package/dist/runtime/client-svelte.mjs +3 -3
  98. package/dist/runtime/client-vue.d.mts +2 -2
  99. package/dist/runtime/client-vue.mjs +3 -3
  100. package/dist/runtime/client.d.mts +2 -2
  101. package/dist/runtime/client.mjs +3 -3
  102. package/dist/runtime/fetch-server.d.mts +8 -0
  103. package/dist/runtime/fetch-server.mjs +30 -0
  104. package/dist/runtime/fetch-stream.d.mts +2 -2
  105. package/dist/runtime/fetch-stream.mjs +2 -2
  106. package/dist/runtime/fetch.d.mts +2 -2
  107. package/dist/runtime/fetch.mjs +3 -3
  108. package/dist/runtime/handler.d.mts +1 -1
  109. package/dist/runtime/live-client.d.mts +1 -1
  110. package/dist/runtime/live.d.mts +1 -1
  111. package/dist/runtime/routing.d.mts +1 -1
  112. package/dist/runtime/routing.mjs +1 -1
  113. package/dist/runtime/validator.d.mts +1 -1
  114. package/dist/runtime/ws-server.d.mts +1 -1
  115. package/dist/runtime/ws.d.mts +1 -1
  116. package/dist/{secret-CClHaFxm.mjs → secret-wr6Sn4Xa.mjs} +3 -3
  117. package/dist/serialize-DtR8Vwa_.d.mts +18 -0
  118. package/dist/serialize-YHvlcG3Q.mjs +31 -0
  119. package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-CNZc4XUd.mjs} +1 -1
  120. package/dist/{wrapper-BOigE1xJ.mjs → wrapper-DGsYwNi6.mjs} +2 -0
  121. package/dist/{ws-CsBNxv86.d.mts → ws-nnFnAyQb.d.mts} +1 -1
  122. package/docs/guide/deployment.md +2 -0
  123. package/docs/guide/edge/headers.md +1 -1
  124. package/docs/guide/email/receiving.md +1 -1
  125. package/docs/guide/email/sending.md +3 -3
  126. package/docs/guide/pages-routing/markdown.md +3 -1
  127. package/docs/guide/platform/administration/email.md +7 -1
  128. package/docs/guide/platform/installation/ci.md +2 -0
  129. package/docs/guide/platform/installation/credentials.md +23 -5
  130. package/docs/guide/platform/installation/maintenance.md +32 -2
  131. package/docs/guide/platform/installation/setup.md +1 -1
  132. package/docs/guide/typed-fetch.md +1 -1
  133. package/docs/integrations/cloudflare.md +1 -1
  134. package/docs/integrations/frameworks/tanstack-start.md +25 -0
  135. package/docs/reference/api/deploy.md +35 -3
  136. package/docs/reference/cli/database.md +15 -0
  137. package/docs/reference/cli/platform-installation.md +2 -0
  138. package/docs/reference/cli/project.md +4 -2
  139. package/docs/reference/cli.md +1 -0
  140. package/docs/reference/config.md +1 -1
  141. package/package.json +8 -7
  142. package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
  143. package/dist/client-DrdeJgHR.mjs +0 -1
  144. package/dist/deploy-CxNgEYr4.mjs +0 -2
  145. package/dist/fetch-sAcwjzLO.mjs +0 -18
  146. package/dist/gen-DsCukhuw.mjs +0 -1
  147. package/dist/help-DOFygYi4.mjs +0 -1
  148. package/dist/login-alAlxw4S.mjs +0 -1
  149. package/dist/migrate-D2odrAmh.mjs +0 -1
  150. package/dist/operator-cmd-D7toMPJ9.mjs +0 -1
  151. package/dist/serialize-BtQyaYoC.mjs +0 -20
  152. package/dist/serialize-CfSwWfF2.d.mts +0 -10
@@ -20,28 +20,30 @@ import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from
20
20
  import { t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
21
21
  import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-B6iOCjKI.mjs";
22
22
  import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-BVdsO7Py.mjs";
23
- import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-Ba6ZbrzY.mjs";
23
+ import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-CKguMgr7.mjs";
24
24
  import { c as resolveRemoteMode, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-BJjULvL0.mjs";
25
25
  import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-B1Bm2wSq.mjs";
26
26
  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-etpKiITL.mjs";
27
27
  import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-CZH66gXn.mjs";
28
+ import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-ChEKWan2.mjs";
28
29
  import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
29
30
  import { r as getPackageDir } from "./agents-CuNtT0D_.mjs";
30
- import { a as isExpiredTokenError, r as PlatformClient } from "./client-GuSO3v_x.mjs";
31
+ import { a as isExpiredTokenError, r as PlatformClient } from "./client-BdzxubTS.mjs";
31
32
  import { t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
32
33
  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-CZJ4viYl.mjs";
33
34
  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-D_KyMdab.mjs";
34
- import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-BOigE1xJ.mjs";
35
- import { A as resolveDeployLiveBindingConfig, C as generateDeployWrapperIfNeeded, D as hasPrerenderSources, E as hasNonPageBackend, F as resolveStaticDeployPreset, I as toManifestSchedulesAndQueues, L as validateDeployMigrations, M as resolveDeployWranglerCompat, N as resolveFullDeployBuildCommand, O as log$1, P as resolveStaticBuildCommand, S as ensureManagedHyperdrive, T as getGitCommit, _ as hasDeploySchemaDrift, a as collectAndHashAssets, b as assertWorkerMainUploaded, c as formatDeploySummary, d as mergeAndLintRoutingRules, f as streamDirectR2Deploy, g as getDeploySchemaDriftMessage, h as assertDeploySchemaDriftFree, i as buildStaticManifest, j as resolveDeployWorkerMain, k as promptDeployProjectConfig, l as printDeployContext, m as warnUnpublishedRouting, n as runStaticDeploy, o as collectWorkerFiles, p as warnIgnoredNotFoundForFramework, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeploySuccess, v as assertEnvSchemaValid, w as getExitCode, x as createProjectFromSlug, y as assertProjectDeployAccess } from "./deploy-managed-static-Dqz06S2u.mjs";
36
- import { a as checkCloudflareProvisionDrift, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-BuifYvLc.mjs";
37
- 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-nY3vLXPL.mjs";
38
- import { i as safePositional, n as getVoidUserAgent, r as readCfUploadOutput, t as getCfCliVersion } from "./cf-user-agent-ChjQp2MU.mjs";
39
- import { t as promptForLoginToken } from "./login-BJvGW5Eu.mjs";
40
- import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-Bc8i3dzE.mjs";
35
+ import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-DGsYwNi6.mjs";
36
+ import { A as resolveDeployLiveBindingConfig, C as generateDeployWrapperIfNeeded, D as hasPrerenderSources, E as hasNonPageBackend, F as resolveStaticDeployPreset, I as toManifestSchedulesAndQueues, L as validateDeployMigrations, M as resolveDeployWranglerCompat, N as resolveFullDeployBuildCommand, O as log$1, P as resolveStaticBuildCommand, S as ensureManagedHyperdrive, T as getGitCommit, _ as hasDeploySchemaDrift, a as collectAndHashAssets, b as assertWorkerMainUploaded, c as formatDeploySummary, d as mergeAndLintRoutingRules, f as streamDirectR2Deploy, g as getDeploySchemaDriftMessage, h as assertDeploySchemaDriftFree, i as buildStaticManifest, j as resolveDeployWorkerMain, k as promptDeployProjectConfig, l as printDeployContext, m as warnUnpublishedRouting, n as runStaticDeploy, o as collectWorkerFiles, p as warnIgnoredNotFoundForFramework, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeploySuccess, v as assertEnvSchemaValid, w as getExitCode, x as createProjectFromSlug, y as assertProjectDeployAccess } from "./deploy-managed-static-B9KVxY3X.mjs";
37
+ import { a as checkCloudflareProvisionDrift, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-DZKYCEJg.mjs";
38
+ 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-B3mtEi_q.mjs";
39
+ import { n as readCfUploadOutput, r as safePositional } from "./cf-command-values-b8OqDoo9.mjs";
40
+ import { n as getVoidUserAgent, t as getCfCliVersion } from "./cf-user-agent-BkEHPDLA.mjs";
41
+ import { t as sanitizeTerminalLogText } from "./terminal-log-text-D9ACPOuG.mjs";
42
+ import { t as promptForLoginToken } from "./login-f2eu2TQh.mjs";
41
43
  import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-DSvBc1Gu.mjs";
42
- import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-DH3GedbV.mjs";
44
+ import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-D5PLrOqD.mjs";
43
45
  import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-BzKMWnO4.mjs";
44
- import { a as discoverFrameworkWranglerFiles, i as writeVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-8rk56vV8.mjs";
46
+ import { a as discoverFrameworkWranglerFiles, i as writeVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-DYfdWBXt.mjs";
45
47
  import { a as runMySqlMigrations } from "./runner-mysql-BWmbk5IE.mjs";
46
48
  import { i as runPgMigrations } from "./runner-pg-Cr3qrqi4.mjs";
47
49
  import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
@@ -54,9 +56,9 @@ import { homedir, tmpdir } from "node:os";
54
56
  import { isDeepStrictEqual } from "node:util";
55
57
  import { applyEdits, modify, parse } from "jsonc-parser";
56
58
  import { execFile, execSync, spawn } from "node:child_process";
57
- import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
58
- import ignore from "ignore";
59
59
  import { getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
60
+ import ignore from "ignore";
61
+ 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";
60
62
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
61
63
  import mime from "mime";
62
64
  import { Minimatch } from "minimatch";
@@ -2912,12 +2914,15 @@ function createCfVersionRunner(options) {
2912
2914
  };
2913
2915
  if (!isCleanCloudflareExit(result)) return result;
2914
2916
  const version = result.data;
2915
- if (!isRecord(version) || version.id !== operation.versionId || !Array.isArray(version.bindings)) return failed("The Cloudflare Worker version was not readable.");
2917
+ if (!isRecord(version) || version.id !== operation.versionId) return failed("The Cloudflare Worker version was not readable.");
2918
+ const bindings = version.bindings === void 0 ? [] : version.bindings;
2919
+ if (!Array.isArray(bindings)) return failed("The Cloudflare Worker version was not readable.");
2916
2920
  return {
2917
2921
  ...result,
2918
2922
  data: {
2919
2923
  ...version,
2920
- resources: { bindings: version.bindings }
2924
+ bindings,
2925
+ resources: { bindings }
2921
2926
  }
2922
2927
  };
2923
2928
  }
@@ -4011,33 +4016,87 @@ async function checkWranglerMigrationApplySet(configPath, config, binding, migra
4011
4016
  };
4012
4017
  return { ok: true };
4013
4018
  }
4014
- /** Apply remote D1 changes and prove no migrations remain pending. */
4015
- async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned) {
4019
+ function cloudflareReason(result) {
4020
+ const detail = cloudflareCommandDiagnostic({
4021
+ ...result,
4022
+ stdout: ""
4023
+ });
4024
+ return detail ? `\nCloudflare: ${sanitizeTerminalLogText(detail)}` : "";
4025
+ }
4026
+ /** Name the restore point when deploy stops after it applied D1 migrations. */
4027
+ function logD1RestoreAfterDeployFailure(restoreCommand) {
4028
+ log$1.error(`deploy: D1 migrations were applied before the deploy stopped. Fix the error and deploy again.
4029
+ If the live version cannot run against the new schema, restore the point saved before them (discards every later write):\n ${restoreCommand}`);
4030
+ }
4031
+ /**
4032
+ * Apply remote D1 changes and prove no migrations remain pending. Returns the command that
4033
+ * restores the point saved before them, if this deploy applied any.
4034
+ */
4035
+ async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, restorePlatformFlag = false) {
4036
+ let restoreCommand;
4016
4037
  if (d1MigrateToken) {
4017
4038
  log$1.step("Applying D1 migrations...");
4018
4039
  if (!assertUploaderStillPinned()) return false;
4040
+ const readPending = async () => {
4041
+ const listed = await Promise.resolve(runWrangler({
4042
+ type: "d1.migrations.list",
4043
+ database: d1MigrateToken,
4044
+ configPath
4045
+ }, { capture: true }));
4046
+ const pending = listed.data?.pending;
4047
+ if (isCleanCloudflareExit(listed) && Array.isArray(pending)) return pending;
4048
+ log$1.error(`deploy: could not read the pending D1 migrations for "${d1MigrateToken}" before applying them ` + (isCleanCloudflareExit(listed) ? "(Cloudflare returned no pending migration list). " : `(exit ${String(listed.status)}). `) + "Refusing to migrate without knowing whether a restore point is needed. Rerun once Cloudflare can be reached." + cloudflareReason(listed));
4049
+ };
4050
+ const pendingBefore = await readPending();
4051
+ if (!pendingBefore) return false;
4052
+ let restoreHint = "";
4053
+ if (pendingBefore.length > 0) {
4054
+ const restorePoint = await Promise.resolve(runWrangler({
4055
+ type: "d1.time-travel.bookmark",
4056
+ database: d1MigrateToken,
4057
+ configPath
4058
+ }, { capture: true }));
4059
+ const bookmark = restorePoint.data?.bookmark;
4060
+ if (!isCleanCloudflareExit(restorePoint) || typeof bookmark !== "string") {
4061
+ log$1.error(`deploy: could not save a D1 restore point for "${d1MigrateToken}" before applying ${formatCount(pendingBefore.length, "migration")}. A Worker rollback does not undo a migration. Refusing to migrate without a restore point. Rerun once the restore point can be saved.` + cloudflareReason(restorePoint));
4062
+ return false;
4063
+ }
4064
+ const pendingAfterBookmark = await readPending();
4065
+ if (!pendingAfterBookmark) return false;
4066
+ if (pendingAfterBookmark.length > 0) {
4067
+ restoreCommand = `void db restore${restorePlatformFlag ? " --platform cloudflare" : ""} --bookmark=${bookmark}`;
4068
+ restoreHint = `
4069
+ To undo these migrations, restore this point (discards every later write):
4070
+ ${restoreCommand}`;
4071
+ log$1.info(`Saved a D1 restore point before applying ${formatCount(pendingAfterBookmark.length, "migration")}.${restoreHint}`);
4072
+ }
4073
+ if (!assertUploaderStillPinned()) return false;
4074
+ }
4019
4075
  const migrate = await Promise.resolve(runWrangler({
4020
4076
  type: "d1.migrations.apply",
4021
4077
  database: d1MigrateToken,
4022
4078
  configPath
4023
4079
  }, { capture: false }));
4024
4080
  if (!isCleanCloudflareExit(migrate)) {
4025
- log$1.error(`deploy: remote D1 migrations failed for "${d1MigrateToken}" (exit ${String(migrate.status)}). Fix the migration and rerun. Note: D1 always enforces foreign_keys=ON — a Drizzle table-rebuild using PRAGMA foreign_keys=OFF must use PRAGMA defer_foreign_keys instead.`);
4081
+ log$1.error(`deploy: remote D1 migrations failed for "${d1MigrateToken}" (exit ${String(migrate.status)}). Fix the migration and rerun. Note: D1 always enforces foreign_keys=ON — a Drizzle table-rebuild using PRAGMA foreign_keys=OFF must use PRAGMA defer_foreign_keys instead.` + restoreHint);
4082
+ return false;
4083
+ }
4084
+ if (!assertUploaderStillPinned()) {
4085
+ if (restoreCommand) logD1RestoreAfterDeployFailure(restoreCommand);
4026
4086
  return false;
4027
4087
  }
4028
- if (!assertUploaderStillPinned()) return false;
4029
4088
  const migrateList = await Promise.resolve(runWrangler({
4030
4089
  type: "d1.migrations.list",
4031
4090
  database: d1MigrateToken,
4032
4091
  configPath
4033
4092
  }, { capture: true }));
4034
4093
  if (!isCleanCloudflareExit(migrateList)) {
4035
- log$1.error(`deploy: could not verify the remote migration state for "${d1MigrateToken}" (\`d1 migrations list\` exit ${String(migrateList.status)}). Refusing to deploy against an unverified schema — rerun once wrangler can reach your account.`);
4094
+ log$1.error(`deploy: could not verify the remote migration state for "${d1MigrateToken}" (\`d1 migrations list\` exit ${String(migrateList.status)}). Refusing to deploy against an unverified schema — rerun once wrangler can reach your account.` + restoreHint);
4036
4095
  return false;
4037
4096
  }
4038
4097
  const migrationState = migrateList.data;
4039
4098
  if (Array.isArray(migrationState?.pending) && migrationState.pending.length > 0) {
4040
- log$1.error([`deploy: remote D1 still has UNAPPLIED migrations for "${d1MigrateToken}" after apply.`, "The schema is not current for this deployment. Fix or apply the pending migrations, then retry."].join("\n"));
4099
+ log$1.error([`deploy: remote D1 still has UNAPPLIED migrations for "${d1MigrateToken}" after apply.`, "The schema is not current for this deployment. Fix or apply the pending migrations, then retry."].join("\n") + restoreHint);
4041
4100
  return false;
4042
4101
  }
4043
4102
  if (!Array.isArray(migrationState?.pending) || !migrationState.pending.every((name) => typeof name === "string")) {
@@ -4045,11 +4104,11 @@ async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runW
4045
4104
  `deploy: could not confirm the remote migration state for "${d1MigrateToken}".`,
4046
4105
  "Cloudflare returned an invalid pending migration set. Refusing to deploy against an unverified schema.",
4047
4106
  "Retry once the database migration state can be read."
4048
- ].join("\n"));
4107
+ ].join("\n") + restoreHint);
4049
4108
  return false;
4050
4109
  }
4051
4110
  }
4052
- return true;
4111
+ return { restoreCommand };
4053
4112
  }
4054
4113
  //#endregion
4055
4114
  //#region src/cli/deploy-cloudflare-build.ts
@@ -4293,15 +4352,21 @@ async function migrateCloudflareWorker(input) {
4293
4352
  return exit(1);
4294
4353
  }
4295
4354
  }
4296
- if (!await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned)) return exit(1);
4355
+ const d1 = await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, readDeploymentPlatform(root) !== "cloudflare");
4356
+ if (!d1) return exit(1);
4357
+ const d1RestoreCommand = d1.restoreCommand;
4297
4358
  if (!verifyCloudflareDeployArtifact(root, deps, {
4298
4359
  ...verifyOptions,
4299
4360
  requiredSecretNames: schemaFacts.requiredKeys
4300
- })) return exit(1);
4361
+ })) {
4362
+ if (d1RestoreCommand) logD1RestoreAfterDeployFailure(d1RestoreCommand);
4363
+ return exit(1);
4364
+ }
4301
4365
  return {
4302
4366
  workerWasMissingBeforeSecretProvisioning,
4303
4367
  initialAuthSecret,
4304
- appliedMigrations
4368
+ appliedMigrations,
4369
+ d1RestoreCommand
4305
4370
  };
4306
4371
  }
4307
4372
  //#endregion
@@ -5034,27 +5099,44 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
5034
5099
  source,
5035
5100
  preflight
5036
5101
  });
5037
- await publishCloudflareWorker({
5102
+ const migration = await migrateCloudflareWorker({
5038
5103
  root,
5039
5104
  deps,
5040
5105
  exit,
5041
5106
  cliLog,
5042
- atomic,
5043
- detectedFramework,
5044
- initialCloudflareCandidate,
5045
5107
  source,
5046
5108
  preflight,
5047
- build,
5048
- migration: await migrateCloudflareWorker({
5109
+ build
5110
+ });
5111
+ let restoreReported = false;
5112
+ const reportRestore = () => {
5113
+ if (migration.d1RestoreCommand && !restoreReported) {
5114
+ restoreReported = true;
5115
+ logD1RestoreAfterDeployFailure(migration.d1RestoreCommand);
5116
+ }
5117
+ };
5118
+ const exitAfterMigrations = (code) => {
5119
+ if (code !== 0) reportRestore();
5120
+ return exit(code);
5121
+ };
5122
+ try {
5123
+ await publishCloudflareWorker({
5049
5124
  root,
5050
5125
  deps,
5051
- exit,
5126
+ exit: exitAfterMigrations,
5052
5127
  cliLog,
5128
+ atomic,
5129
+ detectedFramework,
5130
+ initialCloudflareCandidate,
5053
5131
  source,
5054
5132
  preflight,
5055
- build
5056
- })
5057
- });
5133
+ build,
5134
+ migration
5135
+ });
5136
+ } catch (error) {
5137
+ reportRestore();
5138
+ throw error;
5139
+ }
5058
5140
  if (preflight.emailMap) log$1.message(renderAddressMap(preflight.emailMap));
5059
5141
  printDeploySuccess();
5060
5142
  }
@@ -0,0 +1,2 @@
1
+ import "./deploy-transport-B3mtEi_q.mjs";
2
+ export { i as checkWranglerMigrationApplySet, t as parseRootWranglerConfig, r as runDeploy } from "./deploy-D1gIPiAq.mjs";
@@ -10,27 +10,27 @@ import { D as syncWranglerBindings, E as resolveLiveBindingConfig, a as LIVE_MIG
10
10
  import { n as buildMigrationPlanBundle } from "./plan-BhLO2p4w.mjs";
11
11
  import { l as getTokenSource } from "./auth-B6iOCjKI.mjs";
12
12
  import { L as log$1, N as intro, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
13
- import { f as import_picocolors, h as sanitizeTerminalText, m as printSuccess, o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-Ba6ZbrzY.mjs";
13
+ import { f as import_picocolors, h as sanitizeTerminalText, m as printSuccess, o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-CKguMgr7.mjs";
14
14
  import { t as discoverSchema } from "./discover-LaV0tbIu.mjs";
15
15
  import { t as findEnvFile } from "./env-types-GRchm5dw.mjs";
16
16
  import { a as buildEnv } from "./version-metadata-B1Bm2wSq.mjs";
17
17
  import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-DC5llZaI.mjs";
18
18
  import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
19
19
  import { t as formatCloudflareUserMessage } from "./cloudflare-user-output-Q-k0QoNQ.mjs";
20
- import { c as platformErrorMessage, i as isCliOutdatedError, n as PlatformApiError, o as isHeadersTimeoutError, s as parsePlatformErrorBody } from "./client-GuSO3v_x.mjs";
21
- import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-DEEWJX_M.mjs";
20
+ import { c as platformErrorMessage, i as isCliOutdatedError, n as PlatformApiError, o as isHeadersTimeoutError, s as parsePlatformErrorBody } from "./client-BdzxubTS.mjs";
21
+ import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-D8jQTwVQ.mjs";
22
22
  import { o as detectPreset, s as formatProjectCommand, u as resolveProjectCommand } from "./cloudflare-process-CZJ4viYl.mjs";
23
23
  import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-D_KyMdab.mjs";
24
- import { a as needsWrapper, i as generateWrapper } from "./wrapper-BOigE1xJ.mjs";
24
+ import { a as needsWrapper, i as generateWrapper } from "./wrapper-DGsYwNi6.mjs";
25
25
  import { n as drizzleKitBin } from "./yarn-pnp-DLbEFMT0.mjs";
26
- import { t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-nY3vLXPL.mjs";
26
+ import { t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-B3mtEi_q.mjs";
27
27
  import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync } from "node:fs";
28
28
  import { createDeployArtifact, createDeployUploadPayload } from "@void/deploy-core";
29
29
  import { createHash } from "node:crypto";
30
30
  import { execSync, spawnSync } from "node:child_process";
31
31
  import { getContentType } from "@void/edge";
32
- import { hash } from "blake3-jit";
33
32
  import ignore from "ignore";
33
+ import { hash } from "blake3-jit";
34
34
  //#region src/cli/deploy-helpers.ts
35
35
  const log = {
36
36
  error: (message) => log$1.error(formatCloudflareUserMessage(message)),
@@ -628,10 +628,11 @@ var DirectR2PutError = class extends Error {
628
628
  }
629
629
  };
630
630
  /**
631
- * Issue direct-to-R2 PUTs for every item in `items`, bounded to
632
- * `R2_PUT_CONCURRENCY`. Surfaces the first failure (4xx immediately, 5xx
633
- * after retry exhaustion) as a `DirectR2PutError` carrying the asset path
634
- * and hash so the user can correlate against the JSONL log.
631
+ * Issue direct-to-R2 PUTs for every item in `items` (assets or Worker
632
+ * modules), bounded to `R2_PUT_CONCURRENCY`. Surfaces the first failure
633
+ * (4xx immediately, 5xx after retry exhaustion) as a `DirectR2PutError`
634
+ * carrying the item path and hash so the user can correlate against the
635
+ * JSONL log.
635
636
  *
636
637
  * Logs `r2_put_start` / `r2_put_end` per asset, plus `r2_put_retry` on
637
638
  * each retry attempt. Per-asset durations help identify slow uploads.
@@ -894,20 +895,64 @@ async function streamDeployEvents(projectId, events, s, cliLog) {
894
895
  throw new Error(formatConnectionLostMessage(deploymentId, cliLog?.path ?? null));
895
896
  }
896
897
  /**
898
+ * Upload Worker modules straight to R2 and return the `workerInput` that
899
+ * finalization names them by. The platform checks the Worker against
900
+ * Cloudflare's size limit when it issues the URLs, so a Worker that is too
901
+ * large fails before any bytes are sent. Each buffer leaves `workerFiles`
902
+ * once R2 acknowledges its PUT.
903
+ */
904
+ async function uploadWorkerModules(client, projectId, workerFiles, s, cliLog) {
905
+ const modules = Array.from(workerFiles, ([name, body]) => ({
906
+ name,
907
+ size: body.length,
908
+ sha256: createHash("sha256").update(body).digest("hex")
909
+ }));
910
+ s.message(`Requesting upload URLs for ${formatCount(modules.length, "worker module")}...`);
911
+ cliLog?.info("worker_presign_request_start", {
912
+ moduleCount: modules.length,
913
+ totalBytes: modules.reduce((total, module) => total + module.size, 0)
914
+ });
915
+ const presignStartedAt = Date.now();
916
+ const { id, urls } = await client.requestWorkerUploadUrls(projectId, modules);
917
+ cliLog?.info("worker_presign_request_end", {
918
+ uploadId: id,
919
+ durationMs: Date.now() - presignStartedAt
920
+ });
921
+ const items = modules.map((module, index) => ({
922
+ path: module.name,
923
+ hash: module.sha256,
924
+ body: workerFiles.get(module.name),
925
+ url: urls[index].url,
926
+ headers: urls[index].headers
927
+ }));
928
+ s.message(`Uploading ${formatCount(items.length, "worker module")} to R2...`);
929
+ await uploadAssetsToR2(items, cliLog, void 0, (item) => {
930
+ workerFiles.delete(item.path);
931
+ });
932
+ return {
933
+ id,
934
+ modules
935
+ };
936
+ }
937
+ /**
897
938
  * Direct-to-R2 deploy orchestration. Issues presigned PUT URLs for each
898
939
  * needed asset, uploads bytes directly to R2, then calls the manifest-only
899
- * deploy endpoint to finalize.
940
+ * deploy endpoint to finalize. When the platform supports it, Worker modules
941
+ * go to R2 the same way, before the assets.
900
942
  *
901
943
  * Key invariants:
902
944
  * 1. No needed assets → skip presign + R2 PUT phase entirely (saves a
903
945
  * round-trip when every asset was already present from a prior deploy).
904
- * 2. Asset bytes come exclusively from the in-memory `assetFiles` cache
905
- * computed by `collectAndHashAssets` — files are NEVER re-read from
906
- * disk during this flow.
946
+ * 2. Asset and Worker bytes come exclusively from the in-memory
947
+ * `assetFiles` / `workerFiles` caches computed by `collectAndHashAssets`
948
+ * and `collectWorkerFiles` — files are NEVER re-read from disk during
949
+ * this flow.
907
950
  * 3. R2 PUT failures (4xx, 5xx, network) are surfaced with the asset
908
- * path + hash so the user can correlate against the JSONL trace.
951
+ * path + hash (or Worker module name + SHA-256) so the user can
952
+ * correlate against the JSONL trace.
909
953
  */
910
954
  async function streamDirectR2Deploy({ client, projectId, manifest, assetManifest, assetFiles, needed, gitMetadata, preflightUsed, workerFiles, spinner: s, cliLog }) {
955
+ const workerInput = workerFiles && workerFiles.size > 0 && await client.supportsDirectWorkerUpload() ? await uploadWorkerModules(client, projectId, workerFiles, s, cliLog) : void 0;
911
956
  if (needed.length > 0) {
912
957
  const neededPaths = new Set(needed);
913
958
  const preBufferCount = assetFiles.size;
@@ -968,7 +1013,7 @@ async function streamDirectR2Deploy({ client, projectId, manifest, assetManifest
968
1013
  cliLog?.info("presign_skipped", { reason: "no_needed_assets" });
969
1014
  }
970
1015
  let encodedWorkerFiles;
971
- if (workerFiles && workerFiles.size > 0) {
1016
+ if (!workerInput && workerFiles && workerFiles.size > 0) {
972
1017
  encodedWorkerFiles = {};
973
1018
  for (const [relPath, buf] of workerFiles) encodedWorkerFiles[relPath] = buf.toString("base64");
974
1019
  }
@@ -984,10 +1029,11 @@ async function streamDirectR2Deploy({ client, projectId, manifest, assetManifest
984
1029
  commitUrl: gitMetadata?.commitUrl ?? null,
985
1030
  gitRef: gitMetadata?.gitRef ?? null,
986
1031
  preflight: preflightUsed ? "true" : null
987
- });
1032
+ }, workerInput);
988
1033
  s.message("Finalizing deploy...");
989
1034
  cliLog?.info("finalize_start", {
990
- workerFileCount: workerFiles?.size ?? 0,
1035
+ workerFileCount: workerInput?.modules.length ?? workerFiles?.size ?? 0,
1036
+ ...workerInput && { workerUploadId: workerInput.id },
991
1037
  assetCount: Object.keys(assetManifest).length
992
1038
  });
993
1039
  const finalizeStartedAt = Date.now();
@@ -2,7 +2,7 @@ import { a as join } from "./dist-ipQi0Q8y.mjs";
2
2
  import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
3
3
  import { t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-BJjULvL0.mjs";
4
4
  import { i as WRANGLER_AUTH_CREDENTIAL_ENV_VARS, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-B1Bm2wSq.mjs";
5
- import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-BuifYvLc.mjs";
5
+ import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-DZKYCEJg.mjs";
6
6
  import { readWranglerTopLevelString } from "@void/deploy-cloudflare";
7
7
  //#region src/cli/deploy-transport.ts
8
8
  /**
package/dist/deploy.d.mts CHANGED
@@ -1,10 +1,31 @@
1
1
  import { DeployArtifact } from "@void/deploy-core";
2
2
  //#region src/deploy.d.ts
3
+ /**
4
+ * A disposable Cloudflare Build Output directory. Experimental: it follows Cloudflare's draft
5
+ * Build Output format, which can change between Void releases.
6
+ */
7
+ export type CfBuildOutput = {
8
+ directory: string;
9
+ /** The input's static assets, when the Worker has any. */
10
+ assetsDirectory?: string;
11
+ dispose(): Promise<void>;
12
+ };
13
+ export type PrepareCfBuildOutputOptions = {
14
+ /** The Cloudflare account the build must target. */
15
+ accountId?: string;
16
+ /** The Vite build mode. Native output must match it; legacy output defaults to production. */
17
+ mode?: string;
18
+ };
19
+ /**
20
+ * Convert an existing Cloudflare Worker build into a disposable Cloudflare Build Output directory.
21
+ * Experimental. Returns null for an unsupported build or a conflicting account or mode.
22
+ */
23
+ export declare function prepareCfBuildOutput(directory: string, options?: PrepareCfBuildOutputOptions): Promise<CfBuildOutput | null>;
3
24
  export type PreparedDeployArtifact = {
4
25
  artifact: DeployArtifact;
5
26
  /** Static asset bytes keyed by URL path, encoded as base64. */
6
27
  assets: Record<string, string>;
7
28
  };
8
- /** Package an already-built Void app for managed deployment, without platform credentials. */
29
+ /** Package an already-built app for managed deployment, without platform credentials. */
9
30
  export declare function prepareDeployArtifact(root?: string): Promise<PreparedDeployArtifact>;
10
31
  //#endregion
package/dist/deploy.mjs CHANGED
@@ -4,16 +4,57 @@ import { o as validateSsrEntry } from "./entry-B_0IhV64.mjs";
4
4
  import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
5
5
  import { a as resolveDistDir, c as hasDocumentRoutes, l as resolveAssetConfig, n as collectRevalidate, o as resolveWorkerDirName, s as hasApiRoutes } from "./isr-config-fZaJJ8t7.mjs";
6
6
  import { t as analyzeApplication } from "./application-routing-CZH66gXn.mjs";
7
- import { I as toManifestSchedulesAndQueues, L as validateDeployMigrations, M as resolveDeployWranglerCompat, a as collectAndHashAssets, b as assertWorkerMainUploaded, d as mergeAndLintRoutingRules, h as assertDeploySchemaDriftFree, j as resolveDeployWorkerMain, o as collectWorkerFiles, t as assembleVoidManifest } from "./deploy-managed-static-Dqz06S2u.mjs";
7
+ import { t as prepareCfBuildOutput$1 } from "./cf-build-output-ChEKWan2.mjs";
8
+ import { o as detectPreset } from "./cloudflare-process-CZJ4viYl.mjs";
9
+ import { F as resolveStaticDeployPreset, I as toManifestSchedulesAndQueues, L as validateDeployMigrations, M as resolveDeployWranglerCompat, a as collectAndHashAssets, b as assertWorkerMainUploaded, d as mergeAndLintRoutingRules, h as assertDeploySchemaDriftFree, i as buildStaticManifest, j as resolveDeployWorkerMain, o as collectWorkerFiles, t as assembleVoidManifest } from "./deploy-managed-static-B9KVxY3X.mjs";
8
10
  import { existsSync } from "node:fs";
9
11
  import { createDeployArtifact } from "@void/deploy-core";
10
12
  //#region src/deploy.ts
11
- /** Package an already-built Void app for managed deployment, without platform credentials. */
13
+ /**
14
+ * Convert an existing Cloudflare Worker build into a disposable Cloudflare Build Output directory.
15
+ * Experimental. Returns null for an unsupported build or a conflicting account or mode.
16
+ */
17
+ async function prepareCfBuildOutput(directory, options = {}) {
18
+ const prepared = await prepareCfBuildOutput$1(directory, options.accountId, options.mode);
19
+ return prepared && {
20
+ directory: prepared.directory,
21
+ ...prepared.assetsDirectory ? { assetsDirectory: prepared.assetsDirectory } : {},
22
+ dispose: prepared.dispose
23
+ };
24
+ }
25
+ /** Package an already-built app for managed deployment, without platform credentials. */
12
26
  async function prepareDeployArtifact(root = process.cwd()) {
13
27
  root = resolve(root);
14
28
  const config = readConfig(root);
15
29
  if (isNodeTarget(config.target) || config.output === "static") throw new Error("Artifact preparation requires a Void Cloudflare Worker build.");
16
- const analysis = await analyzeApplication(root, {
30
+ let preset = resolveStaticDeployPreset(root, config);
31
+ let analysis;
32
+ if (!preset) {
33
+ analysis = await analyzeApplication(root, {
34
+ config,
35
+ environment: "prod"
36
+ });
37
+ if (!config.inference?.appType && !analysis.framework && !analysis.durableObjects.length && !analysis.websockets.length && !Object.values(analysis.bindings).some(Boolean)) preset = detectPreset(root, { strictBackend: true });
38
+ }
39
+ if (preset) {
40
+ if (!existsSync(preset.outputDir)) throw new Error("Static build output is missing. Run the app build first.");
41
+ const rules = mergeAndLintRoutingRules(preset.outputDir, config.routing);
42
+ const { assetManifest, assetFiles } = await collectAndHashAssets(preset.outputDir);
43
+ if (!assetFiles.size) throw new Error("Static build output is empty. Run the app build first.");
44
+ return {
45
+ artifact: createDeployArtifact({
46
+ manifest: buildStaticManifest({
47
+ appType: preset.appType,
48
+ hashedAssetsPrefix: "assets",
49
+ notFound: config.routing?.notFound,
50
+ ...rules
51
+ }),
52
+ assetManifest
53
+ }),
54
+ assets: Object.fromEntries([...assetFiles].map(([path, bytes]) => [path, bytes.toString("base64")]))
55
+ };
56
+ }
57
+ analysis ??= await analyzeApplication(root, {
17
58
  config,
18
59
  environment: "prod"
19
60
  });
@@ -79,4 +120,4 @@ async function prepareDeployArtifact(root = process.cwd()) {
79
120
  };
80
121
  }
81
122
  //#endregion
82
- export { prepareDeployArtifact };
123
+ export { prepareCfBuildOutput, prepareDeployArtifact };
@@ -1,8 +1,8 @@
1
1
  import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
3
  import { L as log } from "./dist-BVdsO7Py.mjs";
4
- import { f as import_picocolors, m as printSuccess, p as note } from "./output-Ba6ZbrzY.mjs";
5
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
4
+ import { f as import_picocolors, m as printSuccess, p as note } from "./output-CKguMgr7.mjs";
5
+ import { r as PlatformClient } from "./client-BdzxubTS.mjs";
6
6
  import { i as resolveCommandProjectId } from "./resolve-project-WpwkCB_c.mjs";
7
7
  //#region src/cli/domain.ts
8
8
  async function runDomainCommand(root, args) {
@@ -25,7 +25,7 @@ async function runDomainCommand(root, args) {
25
25
  }
26
26
  async function runCloudflareDomainCommand(root, args) {
27
27
  if (args.projectSlug) throw new Error("domain: --project selects a Void platform project and is not used for direct Cloudflare apps.");
28
- const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-Cm8lVx7W.mjs");
28
+ const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-BFLCpUCV.mjs");
29
29
  if (args.subcommand === "add") {
30
30
  const result = await changeCloudflareDomain(root, args.hostname, "add");
31
31
  note("Cloudflare Custom Domains manages the DNS record and TLS certificate in the zone on your account.", "Cloudflare Domain");
@@ -5,12 +5,12 @@ import { i as scanEmailHandlersSync } from "./email-BcjSyAL0.mjs";
5
5
  import { j as writeProvisionedWranglerConfig } from "./wrangler-C9XSzrju.mjs";
6
6
  import { c as getToken, u as openBrowser } from "./auth-B6iOCjKI.mjs";
7
7
  import { A as confirm, L as log, U as password, tt as isCancel } from "./dist-BVdsO7Py.mjs";
8
- import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note, r as createSpinner } from "./output-Ba6ZbrzY.mjs";
8
+ import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note, r as createSpinner } from "./output-CKguMgr7.mjs";
9
9
  import { a as emailConfigInputs, c as renderAddressMap, i as createNodeEmailDns, l as renderEmailChecklist, o as preflightEmail, r as applyEmailSetup, s as probeMx } from "./email-cloudflare-etpKiITL.mjs";
10
- import { n as PlatformApiError, r as PlatformClient } from "./client-GuSO3v_x.mjs";
10
+ import { n as PlatformApiError, r as PlatformClient } from "./client-BdzxubTS.mjs";
11
11
  import { i as resolveCommandProjectId } from "./resolve-project-WpwkCB_c.mjs";
12
- import { o as resolveDeployTransport } from "./deploy-transport-nY3vLXPL.mjs";
13
- import { a as discoverRootWranglerConfig, c as runWranglerAuthToken, l as deriveWorkerName, o as createDeployWranglerRunner, s as isWranglerNonInteractiveOrCI } from "./deploy-DsW-PrRQ.mjs";
12
+ import { o as resolveDeployTransport } from "./deploy-transport-B3mtEi_q.mjs";
13
+ import { a as discoverRootWranglerConfig, c as runWranglerAuthToken, l as deriveWorkerName, o as createDeployWranglerRunner, s as isWranglerNonInteractiveOrCI } from "./deploy-D1gIPiAq.mjs";
14
14
  import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
15
15
  import { tmpdir } from "node:os";
16
16
  import { execSync } from "node:child_process";
@@ -2,9 +2,9 @@ import { a as join } from "./dist-ipQi0Q8y.mjs";
2
2
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
3
3
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
4
4
  import { H as outro, L as log } from "./dist-BVdsO7Py.mjs";
5
- import { m as printSuccess, p as note } from "./output-Ba6ZbrzY.mjs";
5
+ import { m as printSuccess, p as note } from "./output-CKguMgr7.mjs";
6
6
  import { r as generateEnvTypes, t as findEnvFile } from "./env-types-GRchm5dw.mjs";
7
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
7
+ import { r as PlatformClient } from "./client-BdzxubTS.mjs";
8
8
  import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-D_KyMdab.mjs";
9
9
  import { mkdirSync, writeFileSync } from "node:fs";
10
10
  //#region src/cli/env.ts
@@ -25,7 +25,7 @@ async function runCheck(root, useRemoteSecrets) {
25
25
  const platform = readDeploymentPlatform(root);
26
26
  if (platform === "none") throw new Error("env: Deployment is disabled. Run `void init` to choose a platform.");
27
27
  if (platform === "cloudflare") {
28
- const { listCloudflareSecrets, resolveCloudflareOperationContext } = await import("./cloudflare-operations-Cm8lVx7W.mjs");
28
+ const { listCloudflareSecrets, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BFLCpUCV.mjs");
29
29
  remoteSecrets = await listCloudflareSecrets(resolveCloudflareOperationContext(root));
30
30
  } else {
31
31
  const token = getToken(root);
@@ -57,6 +57,17 @@ type FetchOptions<P extends keyof RouteMap, M extends MethodsOf<P>> = BodyOption
57
57
  retry?: number;
58
58
  timeout?: number;
59
59
  };
60
+ type UntypedFetchOptions = {
61
+ method?: string;
62
+ params?: Record<string, string>;
63
+ body?: unknown;
64
+ query?: Record<string, string>;
65
+ headers?: HeadersInit;
66
+ signal?: AbortSignal;
67
+ baseURL?: string;
68
+ retry?: number;
69
+ timeout?: number;
70
+ };
60
71
  /**
61
72
  * Typed fetch client for Void API routes.
62
73
  *
@@ -72,5 +83,7 @@ type FetchOptions<P extends keyof RouteMap, M extends MethodsOf<P>> = BodyOption
72
83
  */
73
84
  declare function fetch<P extends keyof RouteMap & string>(path: HasRequiredInput<P, DefaultMethod<P>> extends false ? P : never): Promise<OutputOf<P, DefaultMethod<P>>>;
74
85
  declare function fetch<P extends keyof RouteMap & string, M extends MethodsOf<P> = DefaultMethod<P>>(path: P, options: FetchOptions<P, M>): Promise<OutputOf<P, M>>;
86
+ /** Apply the same route interpolation and request options to browser and server transports. */
87
+ declare function createRouteFetch(transport: typeof globalThis.fetch): (path: string, options?: UntypedFetchOptions) => Promise<unknown>;
75
88
  //#endregion
76
- export { fetch as a, QueryOption as i, MethodsOf as n, FetchError as o, ParamsOption as r, BodyOption as t };
89
+ export { UntypedFetchOptions as a, FetchError as c, QueryOption as i, MethodsOf as n, createRouteFetch as o, ParamsOption as r, fetch as s, BodyOption as t };