void 1.1.11 → 1.2.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.
Files changed (233) hide show
  1. package/dist/{account-cmd-R35a4Oa8.mjs → account-cmd-CdUll_35.mjs} +5 -5
  2. package/dist/action-key-XZ9HkWAO.mjs +26 -0
  3. package/dist/{application-analysis-D7nNmNJb.mjs → application-analysis-fEqoSeMp.mjs} +11 -11
  4. package/dist/{application-routing-CZH66gXn.mjs → application-routing-DAhNP4u3.mjs} +1 -1
  5. package/dist/{ast-CPGPjb0V.mjs → ast-CsZ_q_gc.mjs} +6 -1
  6. package/dist/ast-bindings-C3yaPs1y.mjs +296 -0
  7. package/dist/{auth-link-VHmiKZmP.mjs → auth-link-C87vGXM-.mjs} +5 -5
  8. package/dist/{auth-router-O_Wrs5kg.mjs → auth-router-6I81r-ix.mjs} +3 -3
  9. package/dist/{better-auth-shared-Bv18bB-l.d.mts → better-auth-shared-DVk2DkTW.d.mts} +1 -1
  10. package/dist/{build-cmd-CMZiMn46.mjs → build-cmd-ex1g-j_e.mjs} +4 -4
  11. package/dist/{cache-TZ5Ab3d7.mjs → cache-oHzrnY3z.mjs} +4 -4
  12. package/dist/{cancel-deploy-DXoR6oC3.mjs → cancel-deploy-viAMD0Q_.mjs} +3 -3
  13. package/dist/cf-build-output-BJHuSsVN.mjs +1 -0
  14. package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-BhVxldCw.mjs} +75 -10
  15. package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-ByHk0xg4.mjs} +6 -16
  16. package/dist/cf-worker-settings-BECvvTVd.mjs +37 -0
  17. package/dist/cli/cli.mjs +139 -35
  18. package/dist/cli/cloudflare-operation-process.mjs +65 -18
  19. package/dist/cli/env-schema-probe.d.mts +1 -1
  20. package/dist/cli/env-schema-probe.mjs +3 -3
  21. package/dist/{client-GuSO3v_x.mjs → client-BEkdj1kx.mjs} +58 -13
  22. package/dist/client-BiRDZTSd.mjs +1 -0
  23. package/dist/{cloudflare-auth-DSvBc1Gu.mjs → cloudflare-auth-Byo_0_N9.mjs} +1 -1
  24. package/dist/{cloudflare-cmd-ZSErUl6Y.mjs → cloudflare-cmd-DMzCv12s.mjs} +5 -5
  25. package/dist/{cloudflare-config-rdFOys4X.mjs → cloudflare-config-DchHxPTo.mjs} +1 -1
  26. package/dist/{cloudflare-connect-BN-k2kD-.mjs → cloudflare-connect-CCRTVg-I.mjs} +3 -3
  27. package/dist/{cloudflare-operations-DH3GedbV.mjs → cloudflare-operations-Dh9dEHJj.mjs} +17 -7
  28. package/dist/{cloudflare-operations-Cm8lVx7W.mjs → cloudflare-operations-DsSaw2BT.mjs} +1 -1
  29. package/dist/{cloudflare-process-CZJ4viYl.mjs → cloudflare-process-8jEYIeim.mjs} +3 -2
  30. package/dist/{config-DC5llZaI.mjs → config-BIaXIkkv.mjs} +8 -3
  31. package/dist/{config-DYJV8aEH.mjs → config-BU6hMu1W.mjs} +1 -1
  32. package/dist/{config-D26zcdKy.mjs → config-DHgSEWT7.mjs} +39 -6
  33. package/dist/{config-7qoq2p9v.d.mts → config-DQfHOKh9.d.mts} +10 -1
  34. package/dist/config-entry.d.mts +1 -1
  35. package/dist/{connect-yQuLbuiJ.mjs → connect-k7R2rPVA.mjs} +6 -6
  36. package/dist/{create-project-CGOo_OL_.mjs → create-project-DTuy-l0z.mjs} +1 -1
  37. package/dist/{create-project-DEEWJX_M.mjs → create-project-DV71ol5d.mjs} +4 -4
  38. package/dist/{db-COI-yTJE.mjs → db-DVOkLH5X.mjs} +79 -23
  39. package/dist/{delete-PgN6L_9N.mjs → delete-BbP5eopu.mjs} +4 -4
  40. package/dist/{deploy-DsW-PrRQ.mjs → deploy-7H32EnUs.mjs} +220 -95
  41. package/dist/deploy-CE0Ev0Ob.mjs +2 -0
  42. package/dist/{deploy-managed-static-Dqz06S2u.mjs → deploy-managed-static-DlvcvnQT.mjs} +74 -28
  43. package/dist/{deploy-transport-nY3vLXPL.mjs → deploy-transport-BzGEj0Ge.mjs} +2 -2
  44. package/dist/deploy.d.mts +22 -1
  45. package/dist/deploy.mjs +49 -8
  46. package/dist/{dev-inbox-Rd6j_8vM.mjs → dev-inbox-D0jxye_D.mjs} +1 -1
  47. package/dist/{dispatch-BAbbn3jg.mjs → dispatch-DoUnxTNo.mjs} +15 -11
  48. package/dist/{dist-CfgIkieS.mjs → dist-B1PLt4_8.mjs} +1 -1
  49. package/dist/{dist-BVdsO7Py.mjs → dist-Cor9XGoz.mjs} +94 -200
  50. package/dist/{dist-Bn8Kodjp.mjs → dist-D15hFhP0.mjs} +1 -1
  51. package/dist/{domain-DKlNI0SR.mjs → domain-CA2wBgra.mjs} +5 -5
  52. package/dist/drizzle-9TubSZvI.mjs +1 -0
  53. package/dist/{email-BcjSyAL0.mjs → email-B9ayYQEG.mjs} +1 -1
  54. package/dist/{email-C0s3OvJk.mjs → email-DXpCc77w.mjs} +10 -10
  55. package/dist/{email-cloudflare-etpKiITL.mjs → email-cloudflare-D03g2TkS.mjs} +7 -7
  56. package/dist/{entry-B_0IhV64.mjs → entry-BEM8ZuGP.mjs} +40 -12
  57. package/dist/{env-BX2JFsgF.mjs → env-DgOQ9_8S.mjs} +6 -6
  58. package/dist/{env-public-CCdykygU.d.mts → env-public-6lqiSD2b.d.mts} +1 -0
  59. package/dist/{env-types-GRchm5dw.mjs → env-types-BicfKBhV.mjs} +1 -1
  60. package/dist/{env-validation-CuGfWRJd.mjs → env-validation-BmsdCZEk.mjs} +1 -1
  61. package/dist/{env-validation-D_KyMdab.mjs → env-validation-Dwq3PJzK.mjs} +3 -3
  62. package/dist/{fetch-DHLOuPyk.d.mts → fetch-CUX0tB78.d.mts} +14 -1
  63. package/dist/fetch-CtESUYWd.mjs +26 -0
  64. package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
  65. package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
  66. package/dist/{fetch-stream-CNxOrBdP.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
  67. package/dist/{gen-Bj6ZkOcI.mjs → gen-BfmcIi2g.mjs} +5 -5
  68. package/dist/gen-NrOlWZaG.mjs +1 -0
  69. package/dist/{github-cmd-DQDryS-5.mjs → github-cmd-CY9LUqLh.mjs} +4 -4
  70. package/dist/{handler-_PqY82xe.d.mts → handler-BbkSPzGF.d.mts} +91 -9
  71. package/dist/{headers-Bi4bOAwp.mjs → headers-D522zd0A.mjs} +2 -2
  72. package/dist/help-BeAFFE5C.mjs +1 -0
  73. package/dist/{help-D49SL_lN.mjs → help-CxSlPpzJ.mjs} +83 -12
  74. package/dist/{inbound-BuTfm11U.mjs → inbound-VrOLqwZY.mjs} +1 -1
  75. package/dist/index.d.mts +1 -1
  76. package/dist/index.mjs +125 -124
  77. package/dist/{info-Bxunp14X.mjs → info-7VDlhtyy.mjs} +4 -4
  78. package/dist/{init-DyTEY04s.mjs → init-DxYyOs4-.mjs} +103 -43
  79. package/dist/{link-CgOVn9EC.mjs → link-Ddmod1dZ.mjs} +5 -5
  80. package/dist/{list-CUfD9RSb.mjs → list-MogaugiO.mjs} +5 -5
  81. package/dist/{live-DJONVlQK.d.mts → live-Bt8Y_0bg.d.mts} +1 -1
  82. package/dist/{local-d1-CpaPbd_L.mjs → local-d1-BHBnKWRb.mjs} +1 -1
  83. package/dist/{log-vqY3pqwI.mjs → log-BMwmN5Ae.mjs} +2 -2
  84. package/dist/{login-BJvGW5Eu.mjs → login-Cttnagmm.mjs} +4 -4
  85. package/dist/login-DgDwlKc_.mjs +1 -0
  86. package/dist/{logs-DeizBI4j.mjs → logs-CAszUWZI.mjs} +4 -4
  87. package/dist/{migrate-8rk56vV8.mjs → migrate-DyT2jJ8y.mjs} +5 -5
  88. package/dist/migrate-n49ZeS1X.mjs +1 -0
  89. package/dist/{mime-srOklVVv.mjs → mime-BAyHPskU.mjs} +1 -1
  90. package/dist/nitro.mjs +3 -3
  91. package/dist/{node-uN8_zxJr.mjs → node-WB7c2N4L.mjs} +2 -2
  92. package/dist/operator-cmd-d2MvJOrl.mjs +1 -0
  93. package/dist/{operator-cmd-CA5QQyvE.mjs → operator-cmd-skshjMGl.mjs} +4 -4
  94. package/dist/output-BW9uK099.mjs +1 -0
  95. package/dist/{output-Ba6ZbrzY.mjs → output-BpgYODYx.mjs} +16 -4
  96. package/dist/pages/client.d.mts +2 -2
  97. package/dist/pages/client.mjs +48 -25
  98. package/dist/pages/index.d.mts +2 -2
  99. package/dist/pages/index.mjs +4 -4
  100. package/dist/pages/islands-plugin.d.mts +43 -5
  101. package/dist/pages/islands-plugin.mjs +100 -28
  102. package/dist/pages/protocol.d.mts +2 -2
  103. package/dist/pages/protocol.mjs +1 -1
  104. package/dist/pages/serialize.d.mts +2 -2
  105. package/dist/pages/serialize.mjs +1 -1
  106. package/dist/{parse-filename-CUbj-1MP.mjs → parse-filename-DioPHiR9.mjs} +1 -35
  107. package/dist/{picocolors-BTps1_gs.mjs → picocolors-BsDfhxIw.mjs} +1 -1
  108. package/dist/{platform-args-B7ke06up.mjs → platform-args-DVbVClZl.mjs} +12 -4
  109. package/dist/platform-args-kQrgxScY.mjs +1 -0
  110. package/dist/{platform-auth-config-CZaY812e.mjs → platform-auth-config-C-pm5Qzx.mjs} +6 -6
  111. package/dist/{platform-auth-protection-U9HCqoXv.mjs → platform-auth-protection-SHhvim1L.mjs} +4 -4
  112. package/dist/{platform-auth-recovery-B0BV2hfV.mjs → platform-auth-recovery-DXVWs-wA.mjs} +4 -4
  113. package/dist/{platform-cmd-CXrjk4fb.mjs → platform-cmd-D5I1beUX.mjs} +7 -7
  114. package/dist/{platform-cmd-D9lwFpcl.mjs → platform-cmd-PiNRkopU.mjs} +1 -1
  115. package/dist/{platform-domain-CXyq-68_.mjs → platform-domain-jpmBfZeb.mjs} +4 -4
  116. package/dist/{platform-lifecycle-Dz2cJsLX.mjs → platform-lifecycle-DH3Yr1qQ.mjs} +1 -1
  117. package/dist/{platform-lifecycle-D0TdyXbN.mjs → platform-lifecycle-DyKmuNY6.mjs} +405 -44
  118. package/dist/{platform-management-CnXhgxTM.mjs → platform-management--vDwSn35.mjs} +49 -5
  119. package/dist/{platform-management-BvgbusqL.mjs → platform-management-7m-PLaPJ.mjs} +1 -1
  120. package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CeydDSj0.mjs} +2 -2
  121. package/dist/{platform-recovery-CH_fThW6.mjs → platform-recovery-BiNpZZab.mjs} +2 -2
  122. package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-Ca53gtt0.mjs} +3 -2
  123. package/dist/{plugin-inference-Bekzjuqw.mjs → plugin-inference-DUjCd55H.mjs} +145 -218
  124. package/dist/{prepare-2XD6kh77.mjs → prepare-BcAE5Sdj.mjs} +3 -3
  125. package/dist/prepare-C4I0f--h.mjs +1 -0
  126. package/dist/{prepare-DepAGBcV.mjs → prepare-DA-17DhO.mjs} +5 -5
  127. package/dist/{prerender-render-Bfsumdkv.mjs → prerender-render-Cijv7UFo.mjs} +11 -6
  128. package/dist/prerender-render.mjs +1 -1
  129. package/dist/{project-cmd-CpLYflCH.mjs → project-cmd-DA4K5faU.mjs} +18 -18
  130. package/dist/{project-team-CTSY7W7Q.mjs → project-team-CQBNveX3.mjs} +4 -4
  131. package/dist/{project-token-Cybtlfbl.mjs → project-token-CCalFyQf.mjs} +4 -4
  132. package/dist/{project-zero-trust-DKOtqyvu.mjs → project-zero-trust-DPnkiEuT.mjs} +4 -4
  133. package/dist/{protocol-B8sI8dRD.d.mts → protocol-BBDpJz3G.d.mts} +3 -1
  134. package/dist/{protocol-RNP0u7UY.mjs → protocol-DimNxVRr.mjs} +42 -17
  135. package/dist/{provision-UcYjpTRh.mjs → provision-BFLCrnUp.mjs} +1 -1
  136. package/dist/{provision-BuifYvLc.mjs → provision-DtROpNNI.mjs} +6 -5
  137. package/dist/{requests-Ryiazz9i.mjs → requests-BpH0kImL.mjs} +3 -3
  138. package/dist/resolve-project-DD1vu8s9.mjs +1 -0
  139. package/dist/{resolve-project-WpwkCB_c.mjs → resolve-project-Xoi6eTWY.mjs} +1 -1
  140. package/dist/{rollback-Or0EV3rP.mjs → rollback-CXS1tAa-.mjs} +10 -9
  141. package/dist/{rolldown-runtime-DXIUcv95.mjs → rolldown-runtime-3h0WiCiA.mjs} +1 -1
  142. package/dist/{routing-assets-VkrKIbxE.mjs → routing-assets-DdSFxoLp.mjs} +10 -4
  143. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  144. package/dist/runtime/better-auth-pg.d.mts +1 -1
  145. package/dist/runtime/better-auth.d.mts +1 -1
  146. package/dist/runtime/client-react.d.mts +2 -2
  147. package/dist/runtime/client-react.mjs +3 -3
  148. package/dist/runtime/client-solid.d.mts +2 -2
  149. package/dist/runtime/client-solid.mjs +3 -3
  150. package/dist/runtime/client-svelte.d.mts +2 -2
  151. package/dist/runtime/client-svelte.mjs +3 -3
  152. package/dist/runtime/client-vue.d.mts +2 -2
  153. package/dist/runtime/client-vue.mjs +3 -3
  154. package/dist/runtime/client.d.mts +2 -2
  155. package/dist/runtime/client.mjs +3 -3
  156. package/dist/runtime/email/testing.mjs +4 -4
  157. package/dist/runtime/email.mjs +3 -3
  158. package/dist/runtime/env-public.d.mts +1 -1
  159. package/dist/runtime/fetch-server.d.mts +8 -0
  160. package/dist/runtime/fetch-server.mjs +30 -0
  161. package/dist/runtime/fetch-stream.d.mts +2 -2
  162. package/dist/runtime/fetch-stream.mjs +2 -2
  163. package/dist/runtime/fetch.d.mts +2 -2
  164. package/dist/runtime/fetch.mjs +3 -3
  165. package/dist/runtime/handler.d.mts +1 -1
  166. package/dist/runtime/live-client.d.mts +1 -1
  167. package/dist/runtime/live.d.mts +1 -1
  168. package/dist/runtime/routing.d.mts +17 -76
  169. package/dist/runtime/routing.mjs +277 -216
  170. package/dist/runtime/validator.d.mts +1 -1
  171. package/dist/runtime/ws-server.d.mts +2 -2
  172. package/dist/runtime/ws.d.mts +1 -1
  173. package/dist/{scan-D2-FcLHs.mjs → scan-8IzYXiU_.mjs} +12 -11
  174. package/dist/{secret-CClHaFxm.mjs → secret-BbXHfLAt.mjs} +6 -6
  175. package/dist/serialize-DtR8Vwa_.d.mts +18 -0
  176. package/dist/serialize-YHvlcG3Q.mjs +31 -0
  177. package/dist/{skills-C_yRTg0g.mjs → skills-CrUO3PJ0.mjs} +1 -1
  178. package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-D9OhhbGG.mjs} +2 -2
  179. package/dist/{version-metadata-B1Bm2wSq.mjs → version-metadata-tS39iW09.mjs} +1 -1
  180. package/dist/wrangler-BLb3_luP.mjs +1 -0
  181. package/dist/{wrangler-C9XSzrju.mjs → wrangler-F96NnLyb.mjs} +13 -5
  182. package/dist/{wrapper-BOigE1xJ.mjs → wrapper-D3sZyh2C.mjs} +5 -3
  183. package/dist/{ws-CsBNxv86.d.mts → ws-BH-im_tX.d.mts} +1 -1
  184. package/docs/guide/ai.md +1 -1
  185. package/docs/guide/database/postgresql.md +1 -1
  186. package/docs/guide/database.md +26 -0
  187. package/docs/guide/deployment.md +2 -0
  188. package/docs/guide/edge/headers.md +1 -1
  189. package/docs/guide/email/domains.md +1 -1
  190. package/docs/guide/email/receiving.md +1 -1
  191. package/docs/guide/email/sending.md +3 -3
  192. package/docs/guide/pages-routing/actions-and-forms.md +1 -1
  193. package/docs/guide/pages-routing/markdown.md +3 -1
  194. package/docs/guide/platform/administration/email.md +7 -1
  195. package/docs/guide/platform/installation/ci.md +2 -0
  196. package/docs/guide/platform/installation/credentials.md +24 -6
  197. package/docs/guide/platform/installation/domains.md +16 -0
  198. package/docs/guide/platform/installation/maintenance.md +32 -2
  199. package/docs/guide/platform/installation/setup.md +1 -1
  200. package/docs/guide/self-hosted-platform.md +1 -1
  201. package/docs/guide/server-routing.md +1 -1
  202. package/docs/guide/typed-fetch.md +1 -1
  203. package/docs/integrations/cloudflare.md +2 -1
  204. package/docs/integrations/frameworks/tanstack-start.md +25 -0
  205. package/docs/reference/api/deploy.md +35 -3
  206. package/docs/reference/api/env.md +1 -1
  207. package/docs/reference/api/rewrites.md +1 -1
  208. package/docs/reference/api/types.md +1 -0
  209. package/docs/reference/cli/database.md +15 -0
  210. package/docs/reference/cli/platform-installation.md +5 -2
  211. package/docs/reference/cli/project.md +4 -2
  212. package/docs/reference/cli/setup.md +17 -0
  213. package/docs/reference/cli.md +1 -0
  214. package/docs/reference/config.md +14 -1
  215. package/docs/reference/resource-inference.md +4 -0
  216. package/package.json +23 -22
  217. package/sandbox.Dockerfile +1 -1
  218. package/schema.json +23 -3
  219. package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
  220. package/dist/client-DrdeJgHR.mjs +0 -1
  221. package/dist/deploy-CxNgEYr4.mjs +0 -2
  222. package/dist/fetch-sAcwjzLO.mjs +0 -18
  223. package/dist/gen-DsCukhuw.mjs +0 -1
  224. package/dist/help-DOFygYi4.mjs +0 -1
  225. package/dist/login-alAlxw4S.mjs +0 -1
  226. package/dist/migrate-D2odrAmh.mjs +0 -1
  227. package/dist/operator-cmd-D7toMPJ9.mjs +0 -1
  228. package/dist/platform-args-B_LrqEZB.mjs +0 -1
  229. package/dist/prepare-EVEbQ9n2.mjs +0 -1
  230. package/dist/resolve-project-PnhzMtY6.mjs +0 -1
  231. package/dist/serialize-BtQyaYoC.mjs +0 -20
  232. package/dist/serialize-CfSwWfF2.d.mts +0 -10
  233. package/dist/wrangler-DAdxHEzh.mjs +0 -1
@@ -1,47 +1,49 @@
1
- import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-DXIUcv95.mjs";
1
+ import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-3h0WiCiA.mjs";
2
2
  import { a as join, c as resolve, n as dirname, o as normalize, r as extname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
3
- import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
4
- import { r as detectFramework } from "./plugin-inference-Bekzjuqw.mjs";
3
+ import { t as require_picocolors } from "./picocolors-BsDfhxIw.mjs";
4
+ import { r as detectFramework } from "./plugin-inference-DUjCd55H.mjs";
5
5
  import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DGu_QZ_Q.mjs";
6
- import { c as isNodeTarget, d as readConfig, f as resolveBindingNames } from "./config-D26zcdKy.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-D7nNmNJb.mjs";
6
+ import { m as resolveBindingNames, p as readConfig, u as isNodeTarget } from "./config-DHgSEWT7.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-fEqoSeMp.mjs";
8
8
  import { t as collectMigrations } from "./collect-Dew86qce.mjs";
9
- import { o as validateSsrEntry } from "./entry-B_0IhV64.mjs";
10
- import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
11
- import { i as voidWarn } from "./log-vqY3pqwI.mjs";
9
+ import { o as validateSsrEntry } from "./entry-BEM8ZuGP.mjs";
10
+ import { r as hasEmailHandlers } from "./email-B9ayYQEG.mjs";
11
+ import { i as voidWarn } from "./log-BMwmN5Ae.mjs";
12
12
  import { a as resolveDistDir, c as hasDocumentRoutes, l as resolveAssetConfig, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, s as hasApiRoutes } from "./isr-config-fZaJJ8t7.mjs";
13
13
  import { t as writeFileAtomic } from "./atomic-write-Dq6R0BPN.mjs";
14
14
  import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
15
15
  import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
16
16
  import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-DeWj5F9Y.mjs";
17
- import { i as persistCloudflareConfig, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-rdFOys4X.mjs";
18
- import { C as readWranglerManagedQueueCleanupCandidates, E as resolveLiveBindingConfig, M as writeWranglerPublishedTrafficSnapshot, O as syncWranglerDurableObjects, a as LIVE_MIGRATION_TAG, c as bindingEntriesForField, h as nextDurableObjectMigrationTag, j as writeProvisionedWranglerConfig, k as syncWranglerWebSockets, m as hasDurableObjectSqliteMigration, o as acknowledgeWranglerManagedQueueRemovals, r as FRIENDLY_BINDING_NAMES, v as readExistingLiveBindingConfig, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-C9XSzrju.mjs";
17
+ import { i as persistCloudflareConfig, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-DchHxPTo.mjs";
18
+ 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-F96NnLyb.mjs";
19
19
  import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
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
- 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";
24
22
  import { c as resolveRemoteMode, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-BJjULvL0.mjs";
25
- import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-B1Bm2wSq.mjs";
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
- import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-CZH66gXn.mjs";
23
+ import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-tS39iW09.mjs";
24
+ 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-D03g2TkS.mjs";
25
+ import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-DAhNP4u3.mjs";
26
+ import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-BhVxldCw.mjs";
28
27
  import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
28
+ import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
29
29
  import { r as getPackageDir } from "./agents-CuNtT0D_.mjs";
30
- import { a as isExpiredTokenError, r as PlatformClient } from "./client-GuSO3v_x.mjs";
31
- import { t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
32
- 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
- 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";
41
- 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";
30
+ import { a as isExpiredTokenError, r as PlatformClient } from "./client-BEkdj1kx.mjs";
31
+ import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-BpgYODYx.mjs";
32
+ import { t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
33
+ import { i as safePositional, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "./cf-command-values-ByHk0xg4.mjs";
34
+ 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";
35
+ 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-Dwq3PJzK.mjs";
36
+ import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-D3sZyh2C.mjs";
37
+ 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-DlvcvnQT.mjs";
38
+ import { a as checkCloudflareProvisionDrift, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-DtROpNNI.mjs";
39
+ 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-BzGEj0Ge.mjs";
40
+ import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareObservability } from "./cf-worker-settings-BECvvTVd.mjs";
41
+ import { t as sanitizeTerminalLogText } from "./terminal-log-text-D9ACPOuG.mjs";
42
+ import { t as promptForLoginToken } from "./login-Cttnagmm.mjs";
43
+ import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-Byo_0_N9.mjs";
44
+ import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-Dh9dEHJj.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-DyT2jJ8y.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,10 @@ 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 { convertToWranglerConfig } from "@cloudflare/config";
61
+ import ignore from "ignore";
62
+ 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
63
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
61
64
  import mime from "mime";
62
65
  import { Minimatch } from "minimatch";
@@ -1898,6 +1901,14 @@ function bindingsFromOutput(env, workerName, activeSecrets, explicitSecrets) {
1898
1901
  ...value.deliveryDelay === void 0 ? {} : { delivery_delay: value.deliveryDelay }
1899
1902
  });
1900
1903
  break;
1904
+ case "rate-limit":
1905
+ bindings.push({
1906
+ name,
1907
+ type: "ratelimit",
1908
+ namespace_id: requiredString(value.namespace, name),
1909
+ simple: value.simple
1910
+ });
1911
+ break;
1901
1912
  case "ai":
1902
1913
  case "browser":
1903
1914
  case "images":
@@ -1983,11 +1994,25 @@ function bindingsFromOutput(env, workerName, activeSecrets, explicitSecrets) {
1983
1994
  }
1984
1995
  return bindings;
1985
1996
  }
1997
+ const durableObjectStates = /* @__PURE__ */ new Set([
1998
+ "created",
1999
+ "deleted",
2000
+ "renamed",
2001
+ "transferred",
2002
+ "expecting-transfer"
2003
+ ]);
2004
+ /**
2005
+ * The `exports` that cf uploads for the same Build Output. cf converts them with
2006
+ * `@cloudflare/config`'s `convertToWranglerConfig` (cf `build-*.mjs`), and its
2007
+ * `resolveExportsUploadPayload` (cf `containers-*.mjs`) sends Worker entrypoints,
2008
+ * then Durable Objects, then Workflows reduced to their identity. Cloudflare
2009
+ * stages a version at 0% only when its exports are identical to the live
2010
+ * version's, and that version may have been uploaded by cf.
2011
+ */
1986
2012
  function exportsFromOutput(exports, bindings) {
1987
2013
  if (exports === void 0) return;
1988
2014
  const entries = record(exports);
1989
2015
  if (!entries) throw new Error("Cloudflare Durable Object exports were not readable.");
1990
- const result = {};
1991
2016
  const workflows = /* @__PURE__ */ new Map();
1992
2017
  for (const [name, raw] of Object.entries(entries)) {
1993
2018
  const value = record(raw);
@@ -1995,48 +2020,42 @@ function exportsFromOutput(exports, bindings) {
1995
2020
  const workflowName = requiredString(value.name, `Workflow export ${name} name`);
1996
2021
  if (workflows.has(workflowName)) throw new Error(`Cloudflare Workflow ${workflowName} has multiple local exports.`);
1997
2022
  workflows.set(workflowName, name);
1998
- result[name] = {
1999
- type: "workflow",
2000
- name: workflowName
2001
- };
2002
- continue;
2003
- }
2004
- if (value?.type === "worker") {
2005
- result[name] = {
2006
- type: "worker",
2007
- ...value.cache === void 0 ? {} : { cache: value.cache }
2008
- };
2009
2023
  continue;
2010
2024
  }
2025
+ if (value?.type === "worker") continue;
2011
2026
  if (!value || value.type !== "durable-object") throw new Error(`Cloudflare export ${name} cannot be uploaded with pinned secrets.`);
2012
- if (value.state === "deleted") result[name] = {
2013
- type: "durable-object",
2014
- state: "deleted"
2015
- };
2016
- else if (value.state === "renamed" || value.state === "transferred") {
2017
- const renamed = value.state === "renamed";
2018
- result[name] = {
2019
- type: "durable-object",
2020
- state: value.state,
2021
- [renamed ? "renamed_to" : "transferred_to"]: requiredString(value[renamed ? "renamedTo" : "transferredTo"], name)
2022
- };
2023
- } else if (value.storage === "sqlite" || value.storage === "legacy-kv") {
2024
- if (value.state !== void 0 && !["created", "expecting-transfer"].includes(String(value.state))) throw new Error(`Cloudflare Durable Object export ${name} has an unsupported state.`);
2025
- result[name] = {
2026
- type: "durable-object",
2027
- storage: value.storage,
2028
- state: value.state ?? "created",
2029
- ...value.container === void 0 ? {} : { container: requiredString(value.container, name) },
2030
- ...value.state === "expecting-transfer" ? { transfer_from: requiredString(value.transferFrom, name) } : {}
2031
- };
2032
- } else throw new Error(`Cloudflare Durable Object export ${name} has no storage type.`);
2027
+ const state = value.state ?? "created";
2028
+ if (!durableObjectStates.has(String(state))) throw new Error(`Cloudflare Durable Object export ${name} has an unsupported state.`);
2029
+ if (state === "renamed" || state === "transferred") requiredString(value[state === "renamed" ? "renamedTo" : "transferredTo"], name);
2030
+ else if (state !== "deleted") {
2031
+ if (value.storage !== "sqlite" && value.storage !== "legacy-kv") throw new Error(`Cloudflare Durable Object export ${name} has no storage type.`);
2032
+ if (value.container !== void 0) requiredString(value.container, name);
2033
+ if (state === "expecting-transfer") requiredString(value.transferFrom, name);
2034
+ }
2033
2035
  }
2034
2036
  for (const binding of bindings) {
2035
2037
  if (binding.type !== "workflow") continue;
2036
2038
  const localExport = workflows.get(String(binding.workflow_name));
2037
2039
  if (localExport !== void 0 && (binding.script_name !== void 0 || binding.class_name !== localExport)) throw new Error(`Cloudflare Workflow binding ${binding.name} conflicts with its local export.`);
2038
2040
  }
2039
- return result;
2041
+ const converted = record(convertToWranglerConfig({
2042
+ worker: { exports: entries },
2043
+ containers: []
2044
+ }).exports) ?? {};
2045
+ const result = {};
2046
+ for (const type of [
2047
+ "worker",
2048
+ "durable-object",
2049
+ "workflow"
2050
+ ]) for (const [name, value] of Object.entries(converted)) {
2051
+ const entry = record(value);
2052
+ if (entry?.type !== type) continue;
2053
+ result[name] = type === "workflow" ? {
2054
+ type,
2055
+ name: entry.name
2056
+ } : entry;
2057
+ }
2058
+ return Object.keys(result).length > 0 ? result : void 0;
2040
2059
  }
2041
2060
  async function preflightWorkflowExports(options) {
2042
2061
  for (const raw of Object.values(options.exports ?? {})) {
@@ -2904,7 +2923,7 @@ function createCfVersionRunner(options) {
2904
2923
  cwd: output.directory,
2905
2924
  capture: true,
2906
2925
  timeoutMs: 3e4,
2907
- maxOutputBytes: 1048576
2926
+ maxOutputBytes: CF_VERSION_SOURCE_MAX_OUTPUT_BYTES
2908
2927
  }) : await run(args, true);
2909
2928
  const result = {
2910
2929
  ...called,
@@ -2912,12 +2931,15 @@ function createCfVersionRunner(options) {
2912
2931
  };
2913
2932
  if (!isCleanCloudflareExit(result)) return result;
2914
2933
  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.");
2934
+ if (!isRecord(version) || version.id !== operation.versionId) return failed("The Cloudflare Worker version was not readable.");
2935
+ const bindings = version.bindings === void 0 ? [] : version.bindings;
2936
+ if (!Array.isArray(bindings)) return failed("The Cloudflare Worker version was not readable.");
2916
2937
  return {
2917
2938
  ...result,
2918
2939
  data: {
2919
2940
  ...version,
2920
- resources: { bindings: version.bindings }
2941
+ bindings,
2942
+ resources: { bindings }
2921
2943
  }
2922
2944
  };
2923
2945
  }
@@ -3010,12 +3032,30 @@ function createCfVersionRunner(options) {
3010
3032
  await readBuildOutput(directory);
3011
3033
  const verified = await verifyResources(directory);
3012
3034
  if (!isCleanCloudflareExit(verified)) return verified;
3013
- return await run([
3035
+ const deployed = await run([
3014
3036
  "workers",
3015
3037
  "triggers",
3016
3038
  "deploy",
3017
3039
  "--prebuilt"
3018
3040
  ], command.capture, directory);
3041
+ if (isCleanCloudflareExit(deployed) && raw.observability !== void 0) {
3042
+ const credentials = options.pinnedUpload;
3043
+ if (!credentials || !credentials.verifyUploader()) return failed("The Cloudflare settings publisher is unavailable.");
3044
+ try {
3045
+ const token = await credentials.getToken();
3046
+ if (!token || !credentials.verifyUploader()) return failed("Cloudflare session is unavailable for publishing Worker settings.");
3047
+ await publishCloudflareObservability({
3048
+ apiBaseUrl: credentials.apiBaseUrl,
3049
+ accountId: credentials.accountId,
3050
+ workerName,
3051
+ observability: raw.observability,
3052
+ headers: { Authorization: `Bearer ${token}` }
3053
+ });
3054
+ } catch (cause) {
3055
+ return failed(cause instanceof Error ? cause.message : "Cloudflare settings update failed.");
3056
+ }
3057
+ }
3058
+ return deployed;
3019
3059
  } finally {
3020
3060
  rmSync(directory, {
3021
3061
  recursive: true,
@@ -3378,7 +3418,7 @@ function formatCloudflareActivationError(result) {
3378
3418
  "Set CLOUDFLARE_WORKERS_SUBDOMAIN to your account subdomain (for example \"my-team\")",
3379
3419
  "and retry. Void caches it after a successful workers.dev deployment; production traffic is unchanged."
3380
3420
  ].join("\n");
3381
- 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 && /Durable Object migration/i.test(result.diagnostic ?? "") ? "\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." : ""}`;
3421
+ 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." : ""}`;
3382
3422
  case "atomic-failed": return `deploy: Cloudflare could not publish the Worker atomically${status}; inspect production status before retrying.${cloudflareCode}${diagnostic}`;
3383
3423
  case "atomic-output-invalid": return "deploy: Cloudflare published atomically but did not report a version id or URL. Inspect `void project status` immediately.";
3384
3424
  case "atomic-readiness-failed":
@@ -4011,33 +4051,87 @@ async function checkWranglerMigrationApplySet(configPath, config, binding, migra
4011
4051
  };
4012
4052
  return { ok: true };
4013
4053
  }
4014
- /** Apply remote D1 changes and prove no migrations remain pending. */
4015
- async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned) {
4054
+ function cloudflareReason(result) {
4055
+ const detail = cloudflareCommandDiagnostic({
4056
+ ...result,
4057
+ stdout: ""
4058
+ });
4059
+ return detail ? `\nCloudflare: ${sanitizeTerminalLogText(detail)}` : "";
4060
+ }
4061
+ /** Name the restore point when deploy stops after it applied D1 migrations. */
4062
+ function logD1RestoreAfterDeployFailure(restoreCommand) {
4063
+ log$1.error(`deploy: D1 migrations were applied before the deploy stopped. Fix the error and deploy again.
4064
+ If the live version cannot run against the new schema, restore the point saved before them (discards every later write):\n ${restoreCommand}`);
4065
+ }
4066
+ /**
4067
+ * Apply remote D1 changes and prove no migrations remain pending. Returns the command that
4068
+ * restores the point saved before them, if this deploy applied any.
4069
+ */
4070
+ async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, restorePlatformFlag = false) {
4071
+ let restoreCommand;
4016
4072
  if (d1MigrateToken) {
4017
4073
  log$1.step("Applying D1 migrations...");
4018
4074
  if (!assertUploaderStillPinned()) return false;
4075
+ const readPending = async () => {
4076
+ const listed = await Promise.resolve(runWrangler({
4077
+ type: "d1.migrations.list",
4078
+ database: d1MigrateToken,
4079
+ configPath
4080
+ }, { capture: true }));
4081
+ const pending = listed.data?.pending;
4082
+ if (isCleanCloudflareExit(listed) && Array.isArray(pending)) return pending;
4083
+ 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));
4084
+ };
4085
+ const pendingBefore = await readPending();
4086
+ if (!pendingBefore) return false;
4087
+ let restoreHint = "";
4088
+ if (pendingBefore.length > 0) {
4089
+ const restorePoint = await Promise.resolve(runWrangler({
4090
+ type: "d1.time-travel.bookmark",
4091
+ database: d1MigrateToken,
4092
+ configPath
4093
+ }, { capture: true }));
4094
+ const bookmark = restorePoint.data?.bookmark;
4095
+ if (!isCleanCloudflareExit(restorePoint) || typeof bookmark !== "string") {
4096
+ 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));
4097
+ return false;
4098
+ }
4099
+ const pendingAfterBookmark = await readPending();
4100
+ if (!pendingAfterBookmark) return false;
4101
+ if (pendingAfterBookmark.length > 0) {
4102
+ restoreCommand = `void db restore${restorePlatformFlag ? " --platform cloudflare" : ""} --bookmark=${bookmark}`;
4103
+ restoreHint = `
4104
+ To undo these migrations, restore this point (discards every later write):
4105
+ ${restoreCommand}`;
4106
+ log$1.info(`Saved a D1 restore point before applying ${formatCount(pendingAfterBookmark.length, "migration")}.${restoreHint}`);
4107
+ }
4108
+ if (!assertUploaderStillPinned()) return false;
4109
+ }
4019
4110
  const migrate = await Promise.resolve(runWrangler({
4020
4111
  type: "d1.migrations.apply",
4021
4112
  database: d1MigrateToken,
4022
4113
  configPath
4023
4114
  }, { capture: false }));
4024
4115
  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.`);
4116
+ 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);
4117
+ return false;
4118
+ }
4119
+ if (!assertUploaderStillPinned()) {
4120
+ if (restoreCommand) logD1RestoreAfterDeployFailure(restoreCommand);
4026
4121
  return false;
4027
4122
  }
4028
- if (!assertUploaderStillPinned()) return false;
4029
4123
  const migrateList = await Promise.resolve(runWrangler({
4030
4124
  type: "d1.migrations.list",
4031
4125
  database: d1MigrateToken,
4032
4126
  configPath
4033
4127
  }, { capture: true }));
4034
4128
  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.`);
4129
+ 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
4130
  return false;
4037
4131
  }
4038
4132
  const migrationState = migrateList.data;
4039
4133
  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"));
4134
+ 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
4135
  return false;
4042
4136
  }
4043
4137
  if (!Array.isArray(migrationState?.pending) || !migrationState.pending.every((name) => typeof name === "string")) {
@@ -4045,11 +4139,11 @@ async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runW
4045
4139
  `deploy: could not confirm the remote migration state for "${d1MigrateToken}".`,
4046
4140
  "Cloudflare returned an invalid pending migration set. Refusing to deploy against an unverified schema.",
4047
4141
  "Retry once the database migration state can be read."
4048
- ].join("\n"));
4142
+ ].join("\n") + restoreHint);
4049
4143
  return false;
4050
4144
  }
4051
4145
  }
4052
- return true;
4146
+ return { restoreCommand };
4053
4147
  }
4054
4148
  //#endregion
4055
4149
  //#region src/cli/deploy-cloudflare-build.ts
@@ -4293,15 +4387,21 @@ async function migrateCloudflareWorker(input) {
4293
4387
  return exit(1);
4294
4388
  }
4295
4389
  }
4296
- if (!await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned)) return exit(1);
4390
+ const d1 = await applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runWrangler, assertUploaderStillPinned, readDeploymentPlatform(root) !== "cloudflare");
4391
+ if (!d1) return exit(1);
4392
+ const d1RestoreCommand = d1.restoreCommand;
4297
4393
  if (!verifyCloudflareDeployArtifact(root, deps, {
4298
4394
  ...verifyOptions,
4299
4395
  requiredSecretNames: schemaFacts.requiredKeys
4300
- })) return exit(1);
4396
+ })) {
4397
+ if (d1RestoreCommand) logD1RestoreAfterDeployFailure(d1RestoreCommand);
4398
+ return exit(1);
4399
+ }
4301
4400
  return {
4302
4401
  workerWasMissingBeforeSecretProvisioning,
4303
4402
  initialAuthSecret,
4304
- appliedMigrations
4403
+ appliedMigrations,
4404
+ d1RestoreCommand
4305
4405
  };
4306
4406
  }
4307
4407
  //#endregion
@@ -4580,8 +4680,16 @@ async function prepareCloudflareDeploySource(root, options, voidConfig) {
4580
4680
  ].join("\n"));
4581
4681
  return null;
4582
4682
  }
4683
+ const storedDir = desired.d1 && readStoredResourceName(parseRootWranglerConfig(configPath), "d1_databases", desired.d1.binding, "migrations_dir");
4684
+ if (!(options.reuseExistingWorker || readCloudflareLink(root)) && desired.d1?.migrationsDir !== void 0 && storedDir !== void 0 && !sameMigrationsDir(configPath, storedDir, desired.d1.migrationsDir)) {
4685
+ const expected = JSON.stringify(desired.d1.migrationsDir);
4686
+ let fix = `Set migrations_dir to ${expected} in d1_databases of ${basename(configPath)}, or remove it and Void will fill it in.`;
4687
+ if (basename(configPath) === ".void-wrangler.jsonc") fix = `Set migrations_dir to ${expected} in cloudflare.d1_databases of void.config.ts${readStoredResourceName(voidConfig.cloudflare ?? {}, "d1_databases", desired.d1.binding, "migrations_dir") === void 0 ? "." : ", or remove it and Void will fill it in."}`;
4688
+ log$1.error(`deploy: D1 binding ${JSON.stringify(desired.d1.binding)} sets migrations_dir ${JSON.stringify(storedDir)}, but Void generates and applies migrations from ${expected}. ${fix}`);
4689
+ return null;
4690
+ }
4583
4691
  if (desired.d1) {
4584
- const migrationsPattern = resolveWranglerMigrationPattern(parseRootWranglerConfig(configPath), desired.d1.binding, desired.d1.migrationsDir ?? relative(dirname(configPath), migrationsDir));
4692
+ const migrationsPattern = resolveWranglerMigrationPattern(parseRootWranglerConfig(configPath), desired.d1.binding, storedDir ?? desired.d1.migrationsDir ?? relative(dirname(configPath), migrationsDir));
4585
4693
  if (!migrationsPattern.ok) {
4586
4694
  log$1.error(migrationsPattern.reason);
4587
4695
  return null;
@@ -4740,7 +4848,7 @@ async function preflightCloudflareWorker(input) {
4740
4848
  }
4741
4849
  cliLog.info("cloudflare_sandbox_available");
4742
4850
  }
4743
- const d1MigrationsDirDiffers = () => desired.d1 != null && readStoredResourceName(parseRootWranglerConfig(configPath), "d1_databases", desired.d1.binding, "migrations_dir") !== desired.d1.migrationsDir;
4851
+ const d1MigrationsDirMissing = () => desired.d1?.migrationsDir !== void 0 && readStoredResourceName(parseRootWranglerConfig(configPath), "d1_databases", desired.d1.binding, "migrations_dir") === void 0;
4744
4852
  const provisionAndVerify = async () => {
4745
4853
  if (existingWorker) {
4746
4854
  const { missing } = checkCloudflareProvisionDrift(configPath, desired);
@@ -4782,13 +4890,13 @@ async function preflightCloudflareWorker(input) {
4782
4890
  log$1.error(formatCloudflareDriftMessage(missing, reasons, "deploy: provisioning did not satisfy every required resource:", "Retry `void deploy --platform cloudflare`, or provision the listed resources manually."));
4783
4891
  return exit(1);
4784
4892
  }
4785
- if (desired.d1 && d1MigrationsDirDiffers()) {
4893
+ if (desired.d1 && d1MigrationsDirMissing()) {
4786
4894
  log$1.error(`deploy: provisioning did not set migrations_dir for D1 binding ${desired.d1.binding}. Retry \`void deploy --platform cloudflare\`.`);
4787
4895
  return exit(1);
4788
4896
  }
4789
4897
  };
4790
4898
  const { missing: initiallyMissing } = checkCloudflareProvisionDrift(configPath, desired);
4791
- const d1NeedsConfigReconciliation = !existingWorker && d1MigrationsDirDiffers();
4899
+ const d1NeedsConfigReconciliation = !existingWorker && d1MigrationsDirMissing();
4792
4900
  if (options.provision || initiallyMissing.length > 0 || d1NeedsConfigReconciliation) await provisionAndVerify();
4793
4901
  else {
4794
4902
  const invalidQueues = desired.queues.filter((name) => {
@@ -5034,27 +5142,44 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
5034
5142
  source,
5035
5143
  preflight
5036
5144
  });
5037
- await publishCloudflareWorker({
5145
+ const migration = await migrateCloudflareWorker({
5038
5146
  root,
5039
5147
  deps,
5040
5148
  exit,
5041
5149
  cliLog,
5042
- atomic,
5043
- detectedFramework,
5044
- initialCloudflareCandidate,
5045
5150
  source,
5046
5151
  preflight,
5047
- build,
5048
- migration: await migrateCloudflareWorker({
5152
+ build
5153
+ });
5154
+ let restoreReported = false;
5155
+ const reportRestore = () => {
5156
+ if (migration.d1RestoreCommand && !restoreReported) {
5157
+ restoreReported = true;
5158
+ logD1RestoreAfterDeployFailure(migration.d1RestoreCommand);
5159
+ }
5160
+ };
5161
+ const exitAfterMigrations = (code) => {
5162
+ if (code !== 0) reportRestore();
5163
+ return exit(code);
5164
+ };
5165
+ try {
5166
+ await publishCloudflareWorker({
5049
5167
  root,
5050
5168
  deps,
5051
- exit,
5169
+ exit: exitAfterMigrations,
5052
5170
  cliLog,
5171
+ atomic,
5172
+ detectedFramework,
5173
+ initialCloudflareCandidate,
5053
5174
  source,
5054
5175
  preflight,
5055
- build
5056
- })
5057
- });
5176
+ build,
5177
+ migration
5178
+ });
5179
+ } catch (error) {
5180
+ reportRestore();
5181
+ throw error;
5182
+ }
5058
5183
  if (preflight.emailMap) log$1.message(renderAddressMap(preflight.emailMap));
5059
5184
  printDeploySuccess();
5060
5185
  }
@@ -0,0 +1,2 @@
1
+ import "./deploy-transport-BzGEj0Ge.mjs";
2
+ export { i as checkWranglerMigrationApplySet, t as parseRootWranglerConfig, r as runDeploy } from "./deploy-7H32EnUs.mjs";