void 1.1.0 → 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 (246) hide show
  1. package/dist/{account-cmd-BTcUzv9L.mjs → account-cmd-Cj6sCMTk.mjs} +4 -4
  2. package/dist/{application-analysis-AB_YYWgH.mjs → application-analysis-D7nNmNJb.mjs} +6 -6
  3. package/dist/{application-routing-L7V-TFhZ.mjs → application-routing-CZH66gXn.mjs} +1 -1
  4. package/dist/{auth-link-DUJuvRx5.mjs → auth-link-Dj7lAC_K.mjs} +4 -4
  5. package/dist/{auth-migrations-Cgs0k6lS.mjs → auth-migrations-BO27GDNr.mjs} +38 -2
  6. package/dist/{auth-router-CIxiMG7i.mjs → auth-router-CNsMOFCa.mjs} +5 -4
  7. package/dist/{better-auth-shared-B74NJIus.d.mts → better-auth-shared-Bv18bB-l.d.mts} +2 -0
  8. package/dist/{better-auth-shared-CMXlZG7W.mjs → better-auth-shared-D-6z0q0f.mjs} +28 -1
  9. package/dist/{build-cmd-BkIv25PA.mjs → build-cmd-ByhegwRC.mjs} +2 -2
  10. package/dist/{cache-Ctzfig-W.mjs → cache-CEFb5ban.mjs} +2 -2
  11. package/dist/{cancel-deploy-CD9o-SsC.mjs → cancel-deploy-CaARY26n.mjs} +2 -2
  12. package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-ChEKWan2.mjs} +71 -7
  13. package/dist/cf-build-output-Dcmxa-Zm.mjs +1 -0
  14. package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-b8OqDoo9.mjs} +5 -16
  15. package/dist/cf-user-agent-BkEHPDLA.mjs +16 -0
  16. package/dist/cli/cli.mjs +180 -57
  17. package/dist/cli/cloudflare-operation-process.mjs +46 -9
  18. package/dist/cli/env-schema-probe.mjs +3 -3
  19. package/dist/{client-DM9Kcf4e.mjs → client-BdzxubTS.mjs} +58 -13
  20. package/dist/client-DAnfyMe9.mjs +1 -0
  21. package/dist/{cloudflare-auth-CqFBDo52.mjs → cloudflare-auth-DSvBc1Gu.mjs} +1 -1
  22. package/dist/{cloudflare-cmd-BIAF_BIY.mjs → cloudflare-cmd-D_2-Q-_i.mjs} +4 -4
  23. package/dist/{cloudflare-config-DV60XFFK.mjs → cloudflare-config-rdFOys4X.mjs} +2 -2
  24. package/dist/{cloudflare-connect-WjwnVOJA.mjs → cloudflare-connect-BN-k2kD-.mjs} +2 -2
  25. package/dist/{cloudflare-operations-CrSUFRzJ.mjs → cloudflare-operations-BFLCpUCV.mjs} +1 -1
  26. package/dist/{cloudflare-operations-B42EZeJy.mjs → cloudflare-operations-D5PLrOqD.mjs} +18 -8
  27. package/dist/{cloudflare-process-CeDWJRhj.mjs → cloudflare-process-CZJ4viYl.mjs} +2 -2
  28. package/dist/collect-BWhkgtAn.mjs +1 -0
  29. package/dist/{collect-xjffdCdk.mjs → collect-Dew86qce.mjs} +4 -3
  30. package/dist/{config-D0GY5ItR.mjs → config-CyUJzi3q.mjs} +1 -1
  31. package/dist/{config-Bx_1SpnO.mjs → config-D26zcdKy.mjs} +2 -2
  32. package/dist/{config-BEm9vRvS.mjs → config-DC5llZaI.mjs} +2 -2
  33. package/dist/{config-QrJWu0IX.mjs → config-DYJV8aEH.mjs} +1 -1
  34. package/dist/{connect-CKtk-EZe.mjs → connect-C4_m2moF.mjs} +5 -5
  35. package/dist/{create-project-B-ewF_Af.mjs → create-project-CvuYDD-l.mjs} +1 -1
  36. package/dist/{create-project-yInGo72M.mjs → create-project-D8jQTwVQ.mjs} +2 -2
  37. package/dist/database-provider.d.mts +6 -0
  38. package/dist/{db-7I_gfdVq.mjs → db-BsiOAa0A.mjs} +306 -111
  39. package/dist/{db-types-Bb4WBWIs.mjs → db-types-NGxPwnlt.mjs} +1 -1
  40. package/dist/{delete-Cy-M1u-r.mjs → delete-CAma7nFi.mjs} +2 -2
  41. package/dist/{deploy-BYYlnsiy.mjs → deploy-D1gIPiAq.mjs} +148 -64
  42. package/dist/deploy-Dc0XsCQj.mjs +2 -0
  43. package/dist/{deploy-managed-static-Ca4TFdmx.mjs → deploy-managed-static-B9KVxY3X.mjs} +80 -34
  44. package/dist/{deploy-transport-DWlWBe6M.mjs → deploy-transport-B3mtEi_q.mjs} +2 -2
  45. package/dist/deploy.d.mts +22 -1
  46. package/dist/deploy.mjs +49 -8
  47. package/dist/discover-D4TPKo57.mjs +1 -0
  48. package/dist/{discover-D2PGT63u.mjs → discover-LaV0tbIu.mjs} +1 -1
  49. package/dist/{dispatch-DrTTk8Xg.mjs → dispatch-BAbbn3jg.mjs} +6 -6
  50. package/dist/{domain-CZGxPv9u.mjs → domain-BAdwm-QS.mjs} +3 -3
  51. package/dist/{drizzle-CF84FOVM.mjs → drizzle-BQfyvQKX.mjs} +13 -2
  52. package/dist/{email-DzyNVuoU.mjs → email-MwjA7kaL.mjs} +11 -12
  53. package/dist/{email-cloudflare-DfG6UEMm.mjs → email-cloudflare-etpKiITL.mjs} +7 -10
  54. package/dist/{entry-ehmBvs5w.mjs → entry-B_0IhV64.mjs} +1 -1
  55. package/dist/{env-Nx3yf50r.mjs → env-B163-G1s.mjs} +5 -5
  56. package/dist/{env-types-DS2_y4X8.mjs → env-types-GRchm5dw.mjs} +1 -1
  57. package/dist/{env-validation-BT7z-qpQ.mjs → env-validation-CuGfWRJd.mjs} +1 -1
  58. package/dist/{env-validation-DYxjz_Wo.mjs → env-validation-D_KyMdab.mjs} +2 -2
  59. package/dist/{fetch-BPCYVi3H.d.mts → fetch-CUX0tB78.d.mts} +16 -3
  60. package/dist/fetch-CtESUYWd.mjs +26 -0
  61. package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
  62. package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
  63. package/dist/{fetch-stream-obvZ7fvO.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
  64. package/dist/{gen-CufHEf42.mjs → gen-CYN3wiov.mjs} +26 -20
  65. package/dist/gen-Cf-RBVg4.mjs +1 -0
  66. package/dist/{generate-Dat0UTry.mjs → generate-B1m4Cm4n.mjs} +1 -1
  67. package/dist/{generate-ClI89brV.mjs → generate-DkEb9rL-.mjs} +1 -1
  68. package/dist/{github-cmd-FU8EjFyU.mjs → github-cmd-C8QsnJQs.mjs} +2 -2
  69. package/dist/{handler-_PqY82xe.d.mts → handler-D5K_yP6T.d.mts} +1 -1
  70. package/dist/{headers-Di1FsD3e.mjs → headers-Bi4bOAwp.mjs} +1 -1
  71. package/dist/{help-BT2hovNI.mjs → help-B2sFwn9b.mjs} +60 -15
  72. package/dist/help-w-xlx_kq.mjs +1 -0
  73. package/dist/{inbound-brj2-TM5.d.mts → inbound-Da7XsjH3.d.mts} +6 -12
  74. package/dist/index.d.mts +1 -1
  75. package/dist/index.mjs +139 -126
  76. package/dist/{info-l249eUdH.mjs → info-Bxunp14X.mjs} +4 -4
  77. package/dist/{init-D0A6M64Q.mjs → init-DGFQMnbk.mjs} +51 -28
  78. package/dist/{link-WMoJFf4i.mjs → link-CwrfpjIM.mjs} +3 -3
  79. package/dist/{list-CQ2EQEHL.mjs → list-hKoW5z-b.mjs} +3 -3
  80. package/dist/{live-DJONVlQK.d.mts → live-JheIDZKc.d.mts} +1 -1
  81. package/dist/{local-d1-BxvQYEFi.mjs → local-d1-CpaPbd_L.mjs} +5 -5
  82. package/dist/login-08mBwZfI.mjs +1 -0
  83. package/dist/{login-C2T1oVG-.mjs → login-f2eu2TQh.mjs} +3 -3
  84. package/dist/{logs-DnC1d7xB.mjs → logs-CEWqD-_B.mjs} +3 -3
  85. package/dist/{migrate-BDIprOYd.mjs → migrate-DYfdWBXt.mjs} +5 -5
  86. package/dist/migrate-Di-4EuoE.mjs +1 -0
  87. package/dist/{neon-n74ta1Pr.mjs → neon-DTZr7Bu7.mjs} +0 -1
  88. package/dist/nitro.mjs +3 -3
  89. package/dist/{node-cPadMgUO.mjs → node-uN8_zxJr.mjs} +15 -9
  90. package/dist/operator-cmd-Bv20yLu2.mjs +1 -0
  91. package/dist/{operator-cmd-DHieWtFp.mjs → operator-cmd-DCr_QGMH.mjs} +4 -4
  92. package/dist/{output-Ba6ZbrzY.mjs → output-CKguMgr7.mjs} +13 -1
  93. package/dist/pages/client.d.mts +2 -2
  94. package/dist/pages/client.mjs +18 -5
  95. package/dist/pages/index.d.mts +2 -2
  96. package/dist/pages/index.mjs +5 -5
  97. package/dist/pages/islands-plugin.d.mts +44 -6
  98. package/dist/pages/islands-plugin.mjs +99 -28
  99. package/dist/pages/protocol.d.mts +2 -2
  100. package/dist/pages/protocol.mjs +1 -1
  101. package/dist/pages/serialize.d.mts +2 -2
  102. package/dist/pages/serialize.mjs +1 -1
  103. package/dist/{platform-args-CaCL_1Ch.mjs → platform-args-B7ke06up.mjs} +1 -4
  104. package/dist/platform-args-B_LrqEZB.mjs +1 -0
  105. package/dist/{platform-auth-config-Z16-I8nT.mjs → platform-auth-config-qGvEuns3.mjs} +5 -5
  106. package/dist/{platform-auth-protection-BXwZiJSF.mjs → platform-auth-protection-CyLcD6ot.mjs} +3 -3
  107. package/dist/{platform-auth-recovery-CXjfqyOv.mjs → platform-auth-recovery-B2LKI8V2.mjs} +3 -3
  108. package/dist/{platform-cmd-PT4YwMLM.mjs → platform-cmd-B2ec5eFg.mjs} +1 -1
  109. package/dist/{platform-cmd-DaAOiWTl.mjs → platform-cmd-CX7phm7V.mjs} +6 -6
  110. package/dist/{platform-domain-CxpvUeo0.mjs → platform-domain-DDNK2y-4.mjs} +3 -3
  111. package/dist/{platform-lifecycle-DBiS0cJd.mjs → platform-lifecycle-3CR98Tg2.mjs} +399 -40
  112. package/dist/{platform-lifecycle-u9pMOvxC.mjs → platform-lifecycle-CWc5gr6c.mjs} +1 -1
  113. package/dist/{platform-management-DvBS83rC.mjs → platform-management-DAE6g2QU.mjs} +1 -1
  114. package/dist/{platform-management-DhEFdQAf.mjs → platform-management-o3LCCeE4.mjs} +40 -4
  115. package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CBMZxCep.mjs} +1 -1
  116. package/dist/{platform-recovery-BUGOB4RC.mjs → platform-recovery-Dmsg7lWA.mjs} +2 -2
  117. package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-hFbnWAVQ.mjs} +1 -1
  118. package/dist/{plugin-inference-DsARdQKE.mjs → plugin-inference-Bekzjuqw.mjs} +2 -2
  119. package/dist/{prepare-DEB5SeVJ.mjs → prepare-DepAGBcV.mjs} +9 -9
  120. package/dist/prepare-EVEbQ9n2.mjs +1 -0
  121. package/dist/{prepare-PQCgsny0.mjs → prepare-HKo7Rh5V.mjs} +2 -2
  122. package/dist/{project-cmd-DVatD8Ev.mjs → project-cmd-8ylYGx-O.mjs} +18 -18
  123. package/dist/{project-paths-DMvEeSau.mjs → project-paths-DGu_QZ_Q.mjs} +1 -1
  124. package/dist/{project-team-DJrWEAG1.mjs → project-team-Bvpl78we.mjs} +2 -2
  125. package/dist/{project-token-CBgLBuL6.mjs → project-token-QWHoJH2t.mjs} +2 -2
  126. package/dist/{project-tsconfig-bveqhlYA.mjs → project-tsconfig-Itv1f4WC.mjs} +1 -1
  127. package/dist/{project-zero-trust-92gLtZ25.mjs → project-zero-trust-8tJ-RFvu.mjs} +2 -2
  128. package/dist/{protocol-4H7V_3Os.d.mts → protocol-Ssc_LhHj.d.mts} +2 -2
  129. package/dist/{protocol-RNP0u7UY.mjs → protocol-bAUUkx70.mjs} +1 -1
  130. package/dist/{providers-BXuhmuub.mjs → providers-BUHwJlmM.mjs} +10 -1
  131. package/dist/provision-BgXFDv0d.mjs +1 -0
  132. package/dist/{provision-BnSSkiED.mjs → provision-DZKYCEJg.mjs} +66 -66
  133. package/dist/r2-conditions-B8xUgJRc.mjs +61 -0
  134. package/dist/{requests-7W1Pygt2.mjs → requests-Vk5Zyhcy.mjs} +2 -2
  135. package/dist/{rollback-BcASVnwP.mjs → rollback-CH4yMQys.mjs} +9 -8
  136. package/dist/{runner-CabsQ-iM.mjs → runner-3uGC-oLF.mjs} +9 -7
  137. package/dist/{runner-So9mYfcm.mjs → runner-WCdfeI0q.mjs} +1 -1
  138. package/dist/{runner-mysql-BhRaONkO.mjs → runner-mysql-BWmbk5IE.mjs} +1 -1
  139. package/dist/{runner-mysql-DWwE8jKi.mjs → runner-mysql-BcHnLUuM.mjs} +1 -1
  140. package/dist/{runner-pg-_Xncr3H5.mjs → runner-pg-Cgp-cr_p.mjs} +1 -1
  141. package/dist/{runner-pg-BRemq_GX.mjs → runner-pg-Cr3qrqi4.mjs} +1 -1
  142. package/dist/runtime/ai.d.mts +4 -0
  143. package/dist/runtime/ai.mjs +2 -37
  144. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  145. package/dist/runtime/better-auth-mysql.mjs +2 -2
  146. package/dist/runtime/better-auth-pg.d.mts +1 -1
  147. package/dist/runtime/better-auth-pg.mjs +2 -2
  148. package/dist/runtime/better-auth.d.mts +1 -1
  149. package/dist/runtime/better-auth.mjs +2 -2
  150. package/dist/runtime/client-react.d.mts +2 -2
  151. package/dist/runtime/client-react.mjs +3 -3
  152. package/dist/runtime/client-solid.d.mts +2 -2
  153. package/dist/runtime/client-solid.mjs +3 -3
  154. package/dist/runtime/client-svelte.d.mts +2 -2
  155. package/dist/runtime/client-svelte.mjs +3 -3
  156. package/dist/runtime/client-vue.d.mts +2 -2
  157. package/dist/runtime/client-vue.mjs +3 -3
  158. package/dist/runtime/client.d.mts +2 -2
  159. package/dist/runtime/client.mjs +3 -3
  160. package/dist/runtime/email/testing.d.mts +1 -1
  161. package/dist/runtime/email.d.mts +2 -3
  162. package/dist/runtime/email.mjs +2 -3
  163. package/dist/runtime/fetch-server.d.mts +8 -0
  164. package/dist/runtime/fetch-server.mjs +30 -0
  165. package/dist/runtime/fetch-stream.d.mts +2 -2
  166. package/dist/runtime/fetch-stream.mjs +2 -2
  167. package/dist/runtime/fetch.d.mts +2 -2
  168. package/dist/runtime/fetch.mjs +3 -3
  169. package/dist/runtime/handler.d.mts +1 -1
  170. package/dist/runtime/live-client.d.mts +1 -1
  171. package/dist/runtime/live.d.mts +1 -1
  172. package/dist/runtime/migration-handler-mysql.mjs +4 -4
  173. package/dist/runtime/migration-handler-pg.mjs +9 -1
  174. package/dist/runtime/remote/binding-handler.mjs +25 -25
  175. package/dist/runtime/remote/index.d.mts +3 -0
  176. package/dist/runtime/remote/index.mjs +86 -23
  177. package/dist/runtime/routing.d.mts +2 -2
  178. package/dist/runtime/routing.mjs +1 -1
  179. package/dist/runtime/sse-client.d.mts +4 -0
  180. package/dist/runtime/validator.d.mts +1 -1
  181. package/dist/runtime/ws-server.d.mts +2 -2
  182. package/dist/runtime/ws.d.mts +1 -1
  183. package/dist/{scan-C0BMdmEd.mjs → scan-D2-FcLHs.mjs} +13 -5
  184. package/dist/{secret-bg73f1Ge.mjs → secret-wr6Sn4Xa.mjs} +4 -4
  185. package/dist/serialize-DtR8Vwa_.d.mts +18 -0
  186. package/dist/serialize-YHvlcG3Q.mjs +31 -0
  187. package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-CNZc4XUd.mjs} +1 -1
  188. package/dist/{types-BAp5AEBU.d.mts → types-7AIz0OZu.d.mts} +1 -1
  189. package/dist/{validate-CheZGRE7.mjs → validate-CnZPMq4q.mjs} +22 -17
  190. package/dist/validate-D7Wn8PUX.mjs +1 -0
  191. package/dist/{version-metadata-DIrqEHQo.mjs → version-metadata-B1Bm2wSq.mjs} +1 -1
  192. package/dist/{wrangler-BYs07Rxy.mjs → wrangler-C9XSzrju.mjs} +3 -3
  193. package/dist/wrangler-DAdxHEzh.mjs +1 -0
  194. package/dist/{wrapper-CwhpNWtH.mjs → wrapper-DGsYwNi6.mjs} +6 -4
  195. package/dist/{ws-aKVYB-fA.d.mts → ws-nnFnAyQb.d.mts} +6 -1
  196. package/docs/guide/auth.md +1 -1
  197. package/docs/guide/database/d1.md +2 -2
  198. package/docs/guide/database/mysql.md +1 -1
  199. package/docs/guide/deployment.md +2 -0
  200. package/docs/guide/edge/headers.md +10 -2
  201. package/docs/guide/edge/revalidation.md +2 -0
  202. package/docs/guide/email/receiving.md +1 -1
  203. package/docs/guide/email/sending.md +3 -3
  204. package/docs/guide/pages-routing/islands.md +2 -2
  205. package/docs/guide/pages-routing/markdown.md +3 -1
  206. package/docs/guide/platform/administration/connected-apps.md +18 -2
  207. package/docs/guide/platform/administration/email.md +7 -1
  208. package/docs/guide/platform/installation/ci.md +2 -0
  209. package/docs/guide/platform/installation/credentials.md +23 -5
  210. package/docs/guide/platform/installation/maintenance.md +32 -2
  211. package/docs/guide/platform/installation/setup.md +1 -1
  212. package/docs/guide/remote-dev.md +2 -0
  213. package/docs/guide/typed-fetch.md +1 -1
  214. package/docs/guide/websockets.md +2 -2
  215. package/docs/index.md +78 -22
  216. package/docs/integrations/cloudflare.md +1 -1
  217. package/docs/integrations/frameworks/tanstack-start.md +25 -0
  218. package/docs/reference/api/deploy.md +35 -3
  219. package/docs/reference/api/pages.md +7 -5
  220. package/docs/reference/api.md +2 -0
  221. package/docs/reference/cli/database.md +22 -5
  222. package/docs/reference/cli/deploy.md +12 -10
  223. package/docs/reference/cli/email.md +1 -1
  224. package/docs/reference/cli/generate.md +1 -1
  225. package/docs/reference/cli/platform-installation.md +4 -2
  226. package/docs/reference/cli/project.md +8 -4
  227. package/docs/reference/cli.md +2 -1
  228. package/docs/reference/config.md +12 -2
  229. package/package.json +8 -7
  230. package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
  231. package/dist/client-B60PwCC4.mjs +0 -1
  232. package/dist/collect-Cae8A7Zr.mjs +0 -1
  233. package/dist/deploy-9lgfhrXS.mjs +0 -2
  234. package/dist/discover-ClzFSwns.mjs +0 -1
  235. package/dist/fetch-sAcwjzLO.mjs +0 -18
  236. package/dist/gen-sXyp5DFO.mjs +0 -1
  237. package/dist/help-i2YGGnTH.mjs +0 -1
  238. package/dist/login-XD844Xs-.mjs +0 -1
  239. package/dist/migrate-BRwU-blY.mjs +0 -1
  240. package/dist/operator-cmd-D6gnZsnK.mjs +0 -1
  241. package/dist/platform-args-B0HeTh0C.mjs +0 -1
  242. package/dist/prepare-CYT6tAzD.mjs +0 -1
  243. package/dist/r2-conditions-D1Wk8i7b.mjs +0 -30
  244. package/dist/serialize-BtQyaYoC.mjs +0 -20
  245. package/dist/serialize-CfSwWfF2.d.mts +0 -10
  246. package/dist/validate-BQFdf0Pi.mjs +0 -1
@@ -1,5 +1,5 @@
1
1
  import { a as join } from "./dist-ipQi0Q8y.mjs";
2
- import { r as writeFileIfChanged } from "./project-tsconfig-bveqhlYA.mjs";
2
+ import { r as writeFileIfChanged } from "./project-tsconfig-Itv1f4WC.mjs";
3
3
  //#region src/codegen/db-types.ts
4
4
  const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, asc, like, ilike, notLike, inArray, notInArray, isNull, isNotNull, between, notBetween, exists, notExists, count, sum, avg, min, max";
5
5
  const DIALECT_DB_TYPES = {
@@ -1,8 +1,8 @@
1
1
  import { o as removeProjectConfig, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
3
  import { L as log, O as cancel, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
4
- import { m as printSuccess, p as note, r as createSpinner } from "./output-Ba6ZbrzY.mjs";
5
- import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
4
+ import { m as printSuccess, p as note, r as createSpinner } from "./output-CKguMgr7.mjs";
5
+ import { r as PlatformClient } from "./client-BdzxubTS.mjs";
6
6
  import { a as resolveProjectBySlug } from "./resolve-project-WpwkCB_c.mjs";
7
7
  //#region src/cli/delete.ts
8
8
  async function runDeleteCommand(root, slug, options) {
@@ -1,49 +1,51 @@
1
1
  import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-DXIUcv95.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
3
  import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
4
- import { r as detectFramework } from "./plugin-inference-DsARdQKE.mjs";
5
- import { t as assertNoRootSourceConventionConflicts } from "./project-paths-DMvEeSau.mjs";
6
- import { c as isNodeTarget, d as readConfig, f as resolveBindingNames } from "./config-Bx_1SpnO.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-AB_YYWgH.mjs";
8
- import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
9
- import { o as validateSsrEntry } from "./entry-ehmBvs5w.mjs";
4
+ import { r as detectFramework } from "./plugin-inference-Bekzjuqw.mjs";
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";
8
+ import { t as collectMigrations } from "./collect-Dew86qce.mjs";
9
+ import { o as validateSsrEntry } from "./entry-B_0IhV64.mjs";
10
10
  import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
11
- 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";
12
11
  import { i as voidWarn } from "./log-vqY3pqwI.mjs";
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-DV60XFFK.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-BYs07Rxy.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";
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
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
- import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DIrqEHQo.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-DfG6UEMm.mjs";
27
- import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-L7V-TFhZ.mjs";
28
- import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CheZGRE7.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";
28
+ import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-ChEKWan2.mjs";
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-DM9Kcf4e.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
- 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-CeDWJRhj.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-DYxjz_Wo.mjs";
34
- import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-CwhpNWtH.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-Ca4TFdmx.mjs";
36
- import { a as deleteEnvVarCaseAware, c as isRealKvId, l as provisionCloudflareResources, n as assertValidResourceName, o as isQueueConfirmedAbsent, r as checkCloudflareProvisionDrift, s as isRealD1Id } from "./provision-BnSSkiED.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-DWlWBe6M.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-C2T1oVG-.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-CqFBDo52.mjs";
42
- import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-B42EZeJy.mjs";
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";
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";
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";
43
+ import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-DSvBc1Gu.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-BDIprOYd.mjs";
45
- import { a as runMySqlMigrations } from "./runner-mysql-BhRaONkO.mjs";
46
- import { i as runPgMigrations } from "./runner-pg-BRemq_GX.mjs";
46
+ import { a as discoverFrameworkWranglerFiles, i as writeVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-DYfdWBXt.mjs";
47
+ import { a as runMySqlMigrations } from "./runner-mysql-BWmbk5IE.mjs";
48
+ import { i as runPgMigrations } from "./runner-pg-Cr3qrqi4.mjs";
47
49
  import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
48
50
  import { createRequire } from "node:module";
49
51
  import { cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
@@ -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
  }
@@ -3880,7 +3885,7 @@ function formatCloudflareDriftMessage(missing, reasons, header, footer) {
3880
3885
  */
3881
3886
  function assertRemoteMigrationsDeployable(root, dialect, migrationsDir, migrations) {
3882
3887
  if (hasDeploySchemaDrift(root, dialect)) throw new Error(getDeploySchemaDriftMessage(root));
3883
- assertJournalCoherence(migrationsDir, migrations);
3888
+ assertJournalCoherence(migrationsDir, migrations, readProjectPaths(root).sourceRelative);
3884
3889
  if (migrations.length > 0) validateMigrations(migrations);
3885
3890
  }
3886
3891
  /**
@@ -3966,13 +3971,14 @@ function listWranglerMigrationFiles(directory, pattern) {
3966
3971
  * Assert the files `d1 migrations apply` would apply from the binding's `migrations_dir` and
3967
3972
  * `migrations_pattern` match the validated migrations by name and content, and in the same
3968
3973
  * order. Otherwise a stray file such as `seed.sql`, or an unpadded `2_` vs `10_` prefix, would
3969
- * reach remote D1 unvalidated or out of order.
3974
+ * reach remote D1 unvalidated or out of order. `displayDir` is the project's migrations folder
3975
+ * as the messages name it.
3970
3976
  */
3971
- async function checkWranglerMigrationApplySet(configPath, config, binding, migrationsDirRaw, gated) {
3977
+ async function checkWranglerMigrationApplySet(configPath, config, binding, migrationsDirRaw, gated, displayDir = "db/migrations") {
3972
3978
  const absDir = resolve(dirname(configPath), migrationsDirRaw);
3973
3979
  if (!existsSync(absDir)) return {
3974
3980
  ok: false,
3975
- reason: `deploy: configured migrations_dir ${JSON.stringify(migrationsDirRaw)} resolves to ${absDir}, which does not exist — wrangler would have nothing to apply (or error). Align "migrations_dir" with your db/migrations, then rerun.`
3981
+ reason: `deploy: configured migrations_dir ${JSON.stringify(migrationsDirRaw)} resolves to ${absDir}, which does not exist — wrangler would have nothing to apply (or error). Align "migrations_dir" with your ${displayDir}, then rerun.`
3976
3982
  };
3977
3983
  const resolvedPattern = resolveWranglerMigrationPattern(config, binding, migrationsDirRaw);
3978
3984
  if (!resolvedPattern.ok) return resolvedPattern;
@@ -3989,7 +3995,7 @@ async function checkWranglerMigrationApplySet(configPath, config, binding, migra
3989
3995
  if (extra.length > 0) lines.push(` • wrangler would ALSO apply (not validated by Void): ${extra.join(", ")}`);
3990
3996
  if (missing.length > 0) lines.push(` • validated by Void but NOT in wrangler's set: ${missing.join(", ")}`);
3991
3997
  if (changed.length > 0) lines.push(` • content differs between Void's copy and wrangler's: ${changed.join(", ")}`);
3992
- lines.push("Only Void-managed db/migrations/*.sql may be applied. Remove stray .sql (e.g. seed.sql) from migrations_dir, then rerun.");
3998
+ lines.push(`Only Void-managed ${displayDir}/*.sql may be applied. Remove stray .sql (e.g. seed.sql) from migrations_dir, then rerun.`);
3993
3999
  return {
3994
4000
  ok: false,
3995
4001
  reason: lines.join("\n")
@@ -4003,39 +4009,94 @@ async function checkWranglerMigrationApplySet(configPath, config, binding, migra
4003
4009
  ` • Void's validated order: ${gatedNames.join(", ")}`,
4004
4010
  "This happens when a migration's numeric prefix is not zero-padded (e.g. `2_` vs `10_`),",
4005
4011
  "so it sorts differently for wrangler (numeric) than for Void (lexicographic) — remote D1",
4006
- "would receive them out of the validated order. Zero-pad the prefixes (0001_, 0002_, …),",
4007
- "e.g. with `void db rename-migrations`, then rerun."
4012
+ "would receive them out of the validated order. Rename only migrations that are not applied",
4013
+ "yet (a renamed applied migration runs again), or give the new file a name that sorts last",
4014
+ "in both orders, then rerun."
4008
4015
  ].join("\n")
4009
4016
  };
4010
4017
  return { ok: true };
4011
4018
  }
4012
- /** Apply remote D1 changes and prove no migrations remain pending. */
4013
- 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;
4014
4037
  if (d1MigrateToken) {
4015
4038
  log$1.step("Applying D1 migrations...");
4016
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
+ }
4017
4075
  const migrate = await Promise.resolve(runWrangler({
4018
4076
  type: "d1.migrations.apply",
4019
4077
  database: d1MigrateToken,
4020
4078
  configPath
4021
4079
  }, { capture: false }));
4022
4080
  if (!isCleanCloudflareExit(migrate)) {
4023
- 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);
4024
4086
  return false;
4025
4087
  }
4026
- if (!assertUploaderStillPinned()) return false;
4027
4088
  const migrateList = await Promise.resolve(runWrangler({
4028
4089
  type: "d1.migrations.list",
4029
4090
  database: d1MigrateToken,
4030
4091
  configPath
4031
4092
  }, { capture: true }));
4032
4093
  if (!isCleanCloudflareExit(migrateList)) {
4033
- 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);
4034
4095
  return false;
4035
4096
  }
4036
4097
  const migrationState = migrateList.data;
4037
4098
  if (Array.isArray(migrationState?.pending) && migrationState.pending.length > 0) {
4038
- 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);
4039
4100
  return false;
4040
4101
  }
4041
4102
  if (!Array.isArray(migrationState?.pending) || !migrationState.pending.every((name) => typeof name === "string")) {
@@ -4043,11 +4104,11 @@ async function applyAndVerifyRemoteD1Migrations(d1MigrateToken, configPath, runW
4043
4104
  `deploy: could not confirm the remote migration state for "${d1MigrateToken}".`,
4044
4105
  "Cloudflare returned an invalid pending migration set. Refusing to deploy against an unverified schema.",
4045
4106
  "Retry once the database migration state can be read."
4046
- ].join("\n"));
4107
+ ].join("\n") + restoreHint);
4047
4108
  return false;
4048
4109
  }
4049
4110
  }
4050
- return true;
4111
+ return { restoreCommand };
4051
4112
  }
4052
4113
  //#endregion
4053
4114
  //#region src/cli/deploy-cloudflare-build.ts
@@ -4192,7 +4253,7 @@ async function buildCloudflareWorker(input) {
4192
4253
  ].join("\n"));
4193
4254
  return exit(1);
4194
4255
  }
4195
- const applyCheck = await (deps.checkMigrationApplySet ?? checkWranglerMigrationApplySet)(configPath, migrateConfig, desired.d1.binding, d1MigrationsDir, migrations);
4256
+ const applyCheck = await (deps.checkMigrationApplySet ?? checkWranglerMigrationApplySet)(configPath, migrateConfig, desired.d1.binding, d1MigrationsDir, migrations, relative(root, migrationsDir));
4196
4257
  if (!applyCheck.ok) {
4197
4258
  log$1.error(applyCheck.reason);
4198
4259
  return exit(1);
@@ -4291,15 +4352,21 @@ async function migrateCloudflareWorker(input) {
4291
4352
  return exit(1);
4292
4353
  }
4293
4354
  }
4294
- 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;
4295
4358
  if (!verifyCloudflareDeployArtifact(root, deps, {
4296
4359
  ...verifyOptions,
4297
4360
  requiredSecretNames: schemaFacts.requiredKeys
4298
- })) return exit(1);
4361
+ })) {
4362
+ if (d1RestoreCommand) logD1RestoreAfterDeployFailure(d1RestoreCommand);
4363
+ return exit(1);
4364
+ }
4299
4365
  return {
4300
4366
  workerWasMissingBeforeSecretProvisioning,
4301
4367
  initialAuthSecret,
4302
- appliedMigrations
4368
+ appliedMigrations,
4369
+ d1RestoreCommand
4303
4370
  };
4304
4371
  }
4305
4372
  //#endregion
@@ -5032,27 +5099,44 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
5032
5099
  source,
5033
5100
  preflight
5034
5101
  });
5035
- await publishCloudflareWorker({
5102
+ const migration = await migrateCloudflareWorker({
5036
5103
  root,
5037
5104
  deps,
5038
5105
  exit,
5039
5106
  cliLog,
5040
- atomic,
5041
- detectedFramework,
5042
- initialCloudflareCandidate,
5043
5107
  source,
5044
5108
  preflight,
5045
- build,
5046
- 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({
5047
5124
  root,
5048
5125
  deps,
5049
- exit,
5126
+ exit: exitAfterMigrations,
5050
5127
  cliLog,
5128
+ atomic,
5129
+ detectedFramework,
5130
+ initialCloudflareCandidate,
5051
5131
  source,
5052
5132
  preflight,
5053
- build
5054
- })
5055
- });
5133
+ build,
5134
+ migration
5135
+ });
5136
+ } catch (error) {
5137
+ reportRestore();
5138
+ throw error;
5139
+ }
5056
5140
  if (preflight.emailMap) log$1.message(renderAddressMap(preflight.emailMap));
5057
5141
  printDeploySuccess();
5058
5142
  }
@@ -5102,7 +5186,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
5102
5186
  process.exit(1);
5103
5187
  }
5104
5188
  assertDeploySchemaDriftFree(root, dialect);
5105
- const validatedMigrations = validateDeployMigrations(paths.migrationsDir, analysis.migrations);
5189
+ const validatedMigrations = validateDeployMigrations(paths.migrationsDir, analysis.migrations, paths.sourceRelative);
5106
5190
  if (dialect !== "sqlite" && analysis.needsDatabase) await ensureManagedHyperdrive(client, config.projectId, dialect);
5107
5191
  const rawJobs = analysis.jobs;
5108
5192
  const rawQueues = analysis.queues;
@@ -5292,7 +5376,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
5292
5376
  const clientDir = join(distDir, "client");
5293
5377
  const { headerRules, redirectRules, fallbackRules } = mergeAndLintRoutingRules(clientDir, voidConfig.routing);
5294
5378
  assertDeploySchemaDriftFree(root, dialect);
5295
- const validatedMigrations = validateDeployMigrations(paths.migrationsDir, analysis.migrations);
5379
+ const validatedMigrations = validateDeployMigrations(paths.migrationsDir, analysis.migrations, paths.sourceRelative);
5296
5380
  if (dialect !== "sqlite" && analysis.needsDatabase) await ensureManagedHyperdrive(client, config.projectId, dialect);
5297
5381
  const rawJobs = analysis.jobs;
5298
5382
  const rawQueues = analysis.queues;
@@ -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";
@@ -1,36 +1,36 @@
1
1
  import { a as join, c as resolve, n as dirname, r as extname, s as relative } from "./dist-ipQi0Q8y.mjs";
2
- import { h as needsApplicationDatabase } from "./plugin-inference-DsARdQKE.mjs";
3
- import { n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
4
- import { c as isNodeTarget } from "./config-Bx_1SpnO.mjs";
5
- import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
2
+ import { h as needsApplicationDatabase } from "./plugin-inference-Bekzjuqw.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
4
+ import { c as isNodeTarget } from "./config-D26zcdKy.mjs";
5
+ import { t as collectMigrations } from "./collect-Dew86qce.mjs";
6
6
  import { i as collectFiles, t as collectPages } from "./isr-config-fZaJJ8t7.mjs";
7
- import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Di1FsD3e.mjs";
7
+ import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Bi4bOAwp.mjs";
8
8
  import { s as shouldLinkDeployProject, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
9
- import { D as syncWranglerBindings, E as resolveLiveBindingConfig, a as LIVE_MIGRATION_TAG, g as normalizeWranglerCompatibilityFlags, u as ensureWranglerCompat, v as readExistingLiveBindingConfig } from "./wrangler-BYs07Rxy.mjs";
9
+ import { D as syncWranglerBindings, E as resolveLiveBindingConfig, a as LIVE_MIGRATION_TAG, g as normalizeWranglerCompatibilityFlags, u as ensureWranglerCompat, v as readExistingLiveBindingConfig } from "./wrangler-C9XSzrju.mjs";
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";
14
- import { t as discoverSchema } from "./discover-D2PGT63u.mjs";
15
- import { t as findEnvFile } from "./env-types-DS2_y4X8.mjs";
16
- import { a as buildEnv } from "./version-metadata-DIrqEHQo.mjs";
17
- import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BEm9vRvS.mjs";
18
- import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-CheZGRE7.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
+ import { t as discoverSchema } from "./discover-LaV0tbIu.mjs";
15
+ import { t as findEnvFile } from "./env-types-GRchm5dw.mjs";
16
+ import { a as buildEnv } from "./version-metadata-B1Bm2wSq.mjs";
17
+ import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-DC5llZaI.mjs";
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-DM9Kcf4e.mjs";
21
- import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-yInGo72M.mjs";
22
- import { o as detectPreset, s as formatProjectCommand, u as resolveProjectCommand } from "./cloudflare-process-CeDWJRhj.mjs";
23
- import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-DYxjz_Wo.mjs";
24
- import { a as needsWrapper, i as generateWrapper } from "./wrapper-CwhpNWtH.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
+ import { o as detectPreset, s as formatProjectCommand, u as resolveProjectCommand } from "./cloudflare-process-CZJ4viYl.mjs";
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-DGsYwNi6.mjs";
25
25
  import { n as drizzleKitBin } from "./yarn-pnp-DLbEFMT0.mjs";
26
- import { t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-DWlWBe6M.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)),
@@ -284,9 +284,9 @@ function getGitCommit(root) {
284
284
  * Check journal coherence and validate the checked-in migrations of a managed
285
285
  * deploy. Logs and exits on failure; returns `undefined` when there are none.
286
286
  */
287
- function validateDeployMigrations(migrationsDir, rawMigrations) {
287
+ function validateDeployMigrations(migrationsDir, rawMigrations, sourceRelative) {
288
288
  try {
289
- assertJournalCoherence(migrationsDir, rawMigrations);
289
+ assertJournalCoherence(migrationsDir, rawMigrations, sourceRelative);
290
290
  } catch (err) {
291
291
  log.error(getErrorMessage(err));
292
292
  process.exit(1);
@@ -430,7 +430,7 @@ function runDrizzleKitGenerate(root, configPath) {
430
430
  function getDeploySchemaDriftMessage(root) {
431
431
  const migrationsDir = readProjectPaths(root).migrationsDir;
432
432
  if (collectMigrations(migrationsDir).length > 0 && !existsSync(join(migrationsDir, "meta", "_journal.json")) && listDrizzleArtifacts(migrationsDir).length === 0) return [`Missing Drizzle metadata in ${`${relative(root, migrationsDir)}/`}.`, "See https://void.cloud/guide/database#hand-written-migrations"].join("\n");
433
- return ["Schema drift detected between your Drizzle schema and db/migrations/.", "Run `void db generate`, review the generated migration, commit it yourself, then rerun `void deploy`."].join("\n");
433
+ return [`Schema drift detected between your Drizzle schema and ${relative(root, migrationsDir)}/.`, "Run `void db generate`, review the generated migration, commit it yourself, then rerun `void deploy`."].join("\n");
434
434
  }
435
435
  function formatDeploySchemaDriftCheckError(error) {
436
436
  const detail = getErrorMessage(error);
@@ -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();
@@ -1,8 +1,8 @@
1
1
  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
- import { i as WRANGLER_AUTH_CREDENTIAL_ENV_VARS, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DIrqEHQo.mjs";
5
- import { a as deleteEnvVarCaseAware, d as resolvePinnedApiBaseUrl, t as assertNoTransportRedirectInProjectDotenv, u as provisionEnv } from "./provision-BnSSkiED.mjs";
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-DZKYCEJg.mjs";
6
6
  import { readWranglerTopLevelString } from "@void/deploy-cloudflare";
7
7
  //#region src/cli/deploy-transport.ts
8
8
  /**