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
package/dist/index.mjs CHANGED
@@ -1,43 +1,43 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
2
- import { a as join, c as resolve, n as dirname, o as normalize, s as relative } from "./dist-ipQi0Q8y.mjs";
2
+ import { a as join, c as resolve, i as isAbsolute, n as dirname, o as normalize, s as relative } from "./dist-ipQi0Q8y.mjs";
3
3
  import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
4
- import { d as walk, l as inferBindingsFromSource, m as applyBindingOverrides, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS, u as staticModuleReferences } from "./plugin-inference-DsARdQKE.mjs";
5
- import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DMvEeSau.mjs";
6
- import { n as loadVoidAuthConfig } from "./config-D0GY5ItR.mjs";
7
- import { c as isNodeTarget, d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
4
+ import { d as walk, l as inferBindingsFromSource, m as applyBindingOverrides, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS, u as staticModuleReferences } from "./plugin-inference-Bekzjuqw.mjs";
5
+ import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DGu_QZ_Q.mjs";
6
+ import { n as loadVoidAuthConfig } from "./config-CyUJzi3q.mjs";
7
+ import { c as isNodeTarget, d as readConfig, s as getDatabaseDialect } from "./config-D26zcdKy.mjs";
8
8
  import { i as isMemberExpression, n as isIdentifier, r as isLiteral } from "./ast-CPGPjb0V.mjs";
9
9
  import { t as isRouteEnabledForEnvironment } from "./parse-filename-CUbj-1MP.mjs";
10
- import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-AB_YYWgH.mjs";
11
- import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-ehmBvs5w.mjs";
10
+ import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-D7nNmNJb.mjs";
11
+ import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-B_0IhV64.mjs";
12
12
  import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
13
+ import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-vqY3pqwI.mjs";
13
14
  import { t as MagicString } from "./dist-Cegxq8gs.mjs";
14
- import { i as resolveLayoutIds } from "./scan-C0BMdmEd.mjs";
15
+ import { i as resolveLayoutIds } from "./scan-D2-FcLHs.mjs";
15
16
  import { a as resolveDistDir, c as hasDocumentRoutes, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, s as hasApiRoutes, t as collectPages, u as resolveAssetRoutingPolicy } from "./isr-config-fZaJJ8t7.mjs";
16
- import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-vqY3pqwI.mjs";
17
- import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Di1FsD3e.mjs";
17
+ import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Bi4bOAwp.mjs";
18
18
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
19
- import { a as restoreCloudflarePreviewPointer, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-DV60XFFK.mjs";
20
- import { D as syncWranglerBindings, E as resolveLiveBindingConfig, O as syncWranglerDurableObjects, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerWebSockets, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-BYs07Rxy.mjs";
21
- import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-BxvQYEFi.mjs";
19
+ import { a as restoreCloudflarePreviewPointer, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-rdFOys4X.mjs";
20
+ import { D as syncWranglerBindings, E as resolveLiveBindingConfig, O as syncWranglerDurableObjects, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, b as readRootWranglerConfig, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerWebSockets, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-C9XSzrju.mjs";
21
+ import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-CpaPbd_L.mjs";
22
22
  import { n as scopedAccessCredentials } from "./cf-access-BM9G0lhO.mjs";
23
23
  import { n as ensurePlatformProxyAccess } from "./cf-access-CWP4avfP.mjs";
24
24
  import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
25
- import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
26
- import { r as writeFileIfChanged } from "./project-tsconfig-bveqhlYA.mjs";
27
- import { n as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-DrTTk8Xg.mjs";
25
+ import { m as printSuccess } from "./output-CKguMgr7.mjs";
26
+ import { r as writeFileIfChanged } from "./project-tsconfig-Itv1f4WC.mjs";
27
+ import { n as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-BAbbn3jg.mjs";
28
28
  import { _ as parseCapturedMessage, a as DEV_INBOX_ENV_VAR, c as DEV_INBOX_TOKEN_ENV_VAR, f as clearDevBuffer, g as listDevMessages, l as DEV_INBOX_TOKEN_HEADER, m as findDevMessage, n as DEV_INBOX_ACK_VALUE, o as DEV_INBOX_MAX_CAPTURE_BYTES, s as DEV_INBOX_PREFIX, t as DEV_INBOX_ACK_HEADER, u as DEV_INBOX_TOKEN_QUERY, v as pushToDevBuffer } from "./dev-inbox-Rd6j_8vM.mjs";
29
29
  import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
30
30
  import { a as isClientEnvKey, c as resolveRemoteMode, i as findReservedEnvKeys, n as LOCAL_ENV_FILE, o as loadLocalEnv, r as findLegacyEnvFiles, s as reservedEnvKeysMessage } from "./env-BJjULvL0.mjs";
31
- import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-DS2_y4X8.mjs";
31
+ import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-GRchm5dw.mjs";
32
32
  import { t as loadUserEnvFile } from "./load-user-env-DD5qveNU.mjs";
33
33
  import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-D74P4ebM.mjs";
34
34
  import { t as ASSET_EXTENSIONS } from "./routing-assets-VkrKIbxE.mjs";
35
- import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DIrqEHQo.mjs";
36
- import { f as prerenderPages, n as SEND_EMAIL_BINDING, p as prerenderPagesNode } from "./email-cloudflare-DfG6UEMm.mjs";
35
+ import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-B1Bm2wSq.mjs";
36
+ import { f as prerenderPages, n as SEND_EMAIL_BINDING, p as prerenderPagesNode } from "./email-cloudflare-etpKiITL.mjs";
37
37
  import { r as defer } from "./validation-error-Dg9Recn1.mjs";
38
- import { i as safeJsonStringify } from "./protocol-RNP0u7UY.mjs";
39
- import { n as completeApplicationAnalysis } from "./application-routing-L7V-TFhZ.mjs";
40
- import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-CF84FOVM.mjs";
38
+ import { i as safeJsonStringify } from "./protocol-bAUUkx70.mjs";
39
+ import { n as completeApplicationAnalysis } from "./application-routing-CZH66gXn.mjs";
40
+ import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-BQfyvQKX.mjs";
41
41
  import { n as generateQueueTypes, t as generateRouteTypes } from "./route-types-BZi26DVS.mjs";
42
42
  import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-BZ1t7-Rv.mjs";
43
43
  import module, { builtinModules, createRequire } from "node:module";
@@ -490,7 +490,7 @@ function readVoidDevCredentials(root) {
490
490
  */
491
491
  async function runAiSetupPrompt(root, token, apiUrl, server) {
492
492
  const { select, text, isCancel, log } = await import("./dist-CfgIkieS.mjs");
493
- const { PlatformClient } = await import("./client-B60PwCC4.mjs");
493
+ const { PlatformClient } = await import("./client-DAnfyMe9.mjs");
494
494
  const { attachSelectedPlatform, writeProjectConfig } = await import("./project-zdB3fs9G.mjs");
495
495
  const { inferDefaultSlug } = await import("./resolve-project-PnhzMtY6.mjs");
496
496
  const client = new PlatformClient(token, { apiUrl });
@@ -519,7 +519,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
519
519
  let slug;
520
520
  if (result === "__create__") {
521
521
  const { validateProjectSlug } = await import("./project-slug-6cyz8E7k.mjs");
522
- const { createProjectWithSlugRetry } = await import("./create-project-B-ewF_Af.mjs");
522
+ const { createProjectWithSlugRetry } = await import("./create-project-CvuYDD-l.mjs");
523
523
  let created;
524
524
  try {
525
525
  created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
@@ -1645,9 +1645,9 @@ function writeFrameworkTriggersDispatch(root, devTriggerToken) {
1645
1645
  /**
1646
1646
  * Writes a real file at `<root>/.void/dev-triggers.ts` exporting
1647
1647
  * `handleDevTrigger(request, env, ctx)`. We use a real file (not a Vite
1648
- * virtual module) because Nitro and Astro have their own server bundlers
1649
- * that don't go through Vite's plugin pipeline. The framework injection
1650
- * code imports this path at runtime to dispatch cron and queue handlers
1648
+ * virtual module) because Nitro has its own server bundler that doesn't go
1649
+ * through Vite's plugin pipeline. The framework injection code imports
1650
+ * this path at runtime to dispatch cron and queue handlers
1651
1651
  * with the framework adapter's real bindings.
1652
1652
  */
1653
1653
  function frameworkTriggersPlugin(root, options) {
@@ -2041,13 +2041,34 @@ function astroMiddlewareClaims() {
2041
2041
  return store[ASTRO_MIDDLEWARE_CLAIMS] ??= /* @__PURE__ */ new Map();
2042
2042
  }
2043
2043
  /**
2044
+ * Whether the Astro app has middleware that Void did not write. Void cannot add its dev trigger
2045
+ * middleware then, so the wrapper around Astro's Cloudflare server entry answers the triggers.
2046
+ */
2047
+ function hasOwnAstroMiddleware(root) {
2048
+ const middlewarePath = join(root, ASTRO_MIDDLEWARE_RELATIVE);
2049
+ if (existsSync(middlewarePath)) return !astroMiddlewareClaims().has(middlewarePath);
2050
+ return existsSync(join(root, "src", "middleware", "index.ts"));
2051
+ }
2052
+ /** The Worker entry from the app's Cloudflare config, unless it is Astro's server entry. */
2053
+ function customAstroWorkerEntry(root) {
2054
+ let main;
2055
+ try {
2056
+ main = readRootWranglerConfig(root)?.config.main;
2057
+ } catch {
2058
+ return;
2059
+ }
2060
+ return typeof main === "string" && !/^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)?$/.test(main) ? main : void 0;
2061
+ }
2062
+ /**
2044
2063
  * Writes a tiny Astro middleware to the user's project so
2045
2064
  * `/__void/scheduled` and `/__void/queue` are intercepted inside Astro's
2046
- * request pipeline, with bindings from `cloudflare:workers`.
2065
+ * request pipeline, with bindings from `cloudflare:workers`. Astro runs
2066
+ * middleware for a custom Worker entry too.
2047
2067
  *
2048
2068
  * Astro middleware lives at a single discoverable entry, so if the user
2049
- * already has `src/middleware.ts` we don't overwrite it — instead we log a
2050
- * one-shot snippet they can paste into their existing middleware.
2069
+ * already has `src/middleware.ts` we don't overwrite it. The wrapper around
2070
+ * Astro's Cloudflare server entry answers the triggers then. A custom Worker
2071
+ * entry can skip that server entry, so we warn when the app sets one.
2051
2072
  *
2052
2073
  * If we wrote the file we remove it when the last dev server using it closes,
2053
2074
  * so the user's source tree stays clean. `src/middleware.ts` belongs to the
@@ -2056,19 +2077,21 @@ function astroMiddlewareClaims() {
2056
2077
  */
2057
2078
  function astroDevTriggerInjectPlugin(root) {
2058
2079
  const middlewarePath = join(root, ASTRO_MIDDLEWARE_RELATIVE);
2059
- const middlewareDirIndexPath = join(root, "src", "middleware", "index.ts");
2060
2080
  const claims = astroMiddlewareClaims();
2061
2081
  /** Whether the dev server being set up now holds the middleware Void wrote. */
2062
2082
  const ensureFile = () => {
2083
+ if (hasOwnAstroMiddleware(root)) {
2084
+ const entry = customAstroWorkerEntry(root);
2085
+ if (entry) voidWarn(`Your Astro app has its own middleware and its own Worker entry (${entry}).\n In dev, /__void/scheduled and /__void/queue do not work if this entry calls
2086
+ handle() from @astrojs/cloudflare/handler. To use them, call fetch() on the
2087
+ default export of @astrojs/cloudflare/entrypoints/server instead.`);
2088
+ return false;
2089
+ }
2063
2090
  const claim = claims.get(middlewarePath);
2064
2091
  if (claim && existsSync(middlewarePath)) {
2065
2092
  claim.servers++;
2066
2093
  return true;
2067
2094
  }
2068
- if (existsSync(middlewarePath) || existsSync(middlewareDirIndexPath)) {
2069
- voidWarn("Astro middleware already exists. To enable /__void/scheduled and /__void/queue,\n add the Void dev-trigger middleware to your existing onRequest sequence.\n See https://void.cloud/guide/jobs#local-development.");
2070
- return false;
2071
- }
2072
2095
  mkdirSync(dirname(middlewarePath), { recursive: true });
2073
2096
  writeFileSync(middlewarePath, astroMiddlewareSource(frameworkTriggersDispatchPath(root)));
2074
2097
  if (claim) claim.servers++;
@@ -2104,7 +2127,7 @@ function astroDevTriggerInjectPlugin(root) {
2104
2127
  }
2105
2128
  //#endregion
2106
2129
  //#region src/router/compile.ts
2107
- const ROUTE_URL_PATH = fileURLToPath(import.meta.resolve("#self/runtime/route-url"));
2130
+ const FETCH_SERVER_PATH = fileURLToPath(import.meta.resolve("#self/runtime/fetch-server"));
2108
2131
  const ROUTING_RUNTIME_PATH = fileURLToPath(import.meta.resolve("#self/runtime/routing"));
2109
2132
  function pushDefaultErrorPageHelpers(lines, options) {
2110
2133
  lines.push(`const __errorRenderer = __createErrorRenderer(${JSON.stringify({
@@ -2873,68 +2896,17 @@ function compileHeaderMiddleware(lines, rules) {
2873
2896
  /** Generate the server-side fetch client, which calls `app.fetch()` with the current request's credentials. */
2874
2897
  function compileWorkerClient(authClientPath, nodeTarget = false) {
2875
2898
  const envImport = nodeTarget ? "" : "import { env } from \"cloudflare:workers\";\n";
2876
- const dispatch = nodeTarget ? "const response = await app.fetch(request);" : "const executionCtx = store?.executionCtx ?? { waitUntil() {}, passThroughOnException() {} };\n const response = await app.fetch(request, env, executionCtx);";
2899
+ const dispatch = nodeTarget ? "app.fetch(request)" : "app.fetch(request, env, store?.executionCtx ?? { waitUntil() {}, passThroughOnException() {} })";
2877
2900
  return `import app, { requestContext } from "virtual:void-routes";
2878
- import { interpolateRouteParams } from ${JSON.stringify(ROUTE_URL_PATH)};
2901
+ import { createServerFetch } from ${JSON.stringify(FETCH_SERVER_PATH)};
2902
+ export { FetchError } from ${JSON.stringify(FETCH_SERVER_PATH)};
2879
2903
  ${envImport}export { auth, createAuthClient } from ${JSON.stringify(authClientPath)};
2880
2904
 
2881
- export class FetchError extends Error {
2882
- constructor(status, statusText, data) {
2883
- super(\`fetch: Request failed with status \${status}.\`);
2884
- this.name = "FetchError";
2885
- this.status = status;
2886
- this.statusText = statusText;
2887
- this.data = data;
2888
- }
2889
- }
2890
-
2891
- export async function fetch(path, options) {
2892
- let url = interpolateRouteParams(path, options?.params);
2893
-
2894
- if (options?.query) {
2895
- const qs = new URLSearchParams(options.query).toString();
2896
- if (qs) url += "?" + qs;
2897
- }
2898
-
2899
- const method = options?.method ?? "GET";
2900
- const headers = new Headers(options?.headers);
2901
-
2902
- const store = requestContext.getStore();
2903
- if (store?.request) {
2904
- const outerReq = store.request;
2905
- if (!headers.has("cookie")) {
2906
- const cookie = outerReq.headers.get("cookie");
2907
- if (cookie) headers.set("cookie", cookie);
2908
- }
2909
- if (!headers.has("authorization")) {
2910
- const auth = outerReq.headers.get("authorization");
2911
- if (auth) headers.set("authorization", auth);
2912
- }
2913
- }
2914
-
2915
- if (options?.body != null && !headers.has("content-type")) {
2916
- headers.set("content-type", "application/json");
2917
- }
2918
-
2919
- const request = new Request("${nodeTarget ? "http://localhost" : "http://worker.local"}" + url, {
2920
- method,
2921
- headers,
2922
- body: options?.body != null ? JSON.stringify(options.body) : undefined,
2923
- });
2924
-
2925
- ${dispatch}
2926
-
2927
- if (response.status === 204) return undefined;
2928
-
2929
- const contentType = response.headers.get("content-type") ?? "";
2930
- const data = contentType.includes("application/json") ? await response.json() : await response.text();
2931
-
2932
- if (!response.ok) {
2933
- throw new FetchError(response.status, response.statusText, data);
2934
- }
2935
-
2936
- return data;
2937
- }
2905
+ export const fetch = createServerFetch(
2906
+ (request, store) => ${dispatch},
2907
+ () => requestContext.getStore(),
2908
+ "${nodeTarget ? "http://localhost" : "http://worker.local"}",
2909
+ );
2938
2910
  `;
2939
2911
  }
2940
2912
  //#endregion
@@ -2947,15 +2919,32 @@ export async function fetch(path, options) {
2947
2919
  * (see `generateClassATriggerWrapper`). Production deploys go through
2948
2920
  * `cli/wrapper.ts` instead.
2949
2921
  */
2950
- function getFrameworkEntry(framework, root, devTriggerToken, dialect, notFound) {
2922
+ function getFrameworkEntry(framework, root, devTriggerToken, dialect, notFound, configuredMain) {
2951
2923
  const isBuild = isViteBuildOrPreview();
2952
2924
  if (!isBuild) writeFrameworkTriggersDispatch(root, devTriggerToken);
2953
- return generateClassATriggerWrapper(root, framework, getOriginalFrameworkEntry(framework, root), isBuild, dialect, void 0, notFound);
2925
+ return generateClassATriggerWrapper(root, framework, getOriginalFrameworkEntry(framework, root, configuredMain), isBuild, dialect, void 0, notFound);
2926
+ }
2927
+ const TANSTACK_SERVER_ENTRY = "@tanstack/react-start/server-entry";
2928
+ /**
2929
+ * Whether `main` names a file in the app rather than a package. A migrated TanStack config keeps
2930
+ * `main: "@tanstack/react-start/server-entry"`, and a package subpath may end in `.js`, so a
2931
+ * bare name counts as a file only when it exists in the app.
2932
+ */
2933
+ function isFileEntry(root, main) {
2934
+ if (main.startsWith(".") || isAbsolute(main)) return true;
2935
+ return statSync(resolve(root, main), { throwIfNoEntry: false })?.isFile() === true;
2954
2936
  }
2955
2937
  /** The framework's own server entry, before our trigger wrapper. */
2956
- function getOriginalFrameworkEntry(framework, root) {
2938
+ function getOriginalFrameworkEntry(framework, root, configuredMain) {
2957
2939
  switch (framework) {
2958
- case "tanstack-start": return "@tanstack/react-start/server-entry";
2940
+ case "tanstack-start": {
2941
+ if (configuredMain === void 0 || configuredMain === TANSTACK_SERVER_ENTRY || configuredMain === `${TANSTACK_SERVER_ENTRY}.js`) return TANSTACK_SERVER_ENTRY;
2942
+ if (typeof configuredMain !== "string" || configuredMain.trim() === "") throw new Error("config: cloudflare.main must be a non-empty Worker entry path.");
2943
+ if (!isFileEntry(root, configuredMain)) return configuredMain;
2944
+ const original = resolve(root, configuredMain);
2945
+ if (original === resolve(root, ".void", "tanstack-start-trigger-wrapper.ts")) throw new Error("config: cloudflare.main cannot point to Void's generated framework wrapper.");
2946
+ return original;
2947
+ }
2959
2948
  case "react-router": return generateReactRouterEntry(root);
2960
2949
  case "vinext-app": return "vinext/server/app-router-entry";
2961
2950
  case "vinext-pages": return generateVinextPagesEntry(root);
@@ -3007,6 +2996,7 @@ ${fetchBody}
3007
2996
  },`;
3008
2997
  const body = `// @ts-nocheck — Auto-generated by Void ${isBuild ? "for vite build" : "in dev"}. Do NOT edit.
3009
2998
  import original from ${JSON.stringify(original)};
2999
+ export * from ${JSON.stringify(original)};
3010
3000
  ${scoped ? "import { withRuntimeEnv } from \"void/_env\";\n" : ""}
3011
3001
  export default {
3012
3002
  ...original,
@@ -3262,9 +3252,12 @@ function findDependencyClosure(name, fromDir) {
3262
3252
  function readDatabaseUrl(root) {
3263
3253
  return loadLocalEnv(root).DATABASE_URL;
3264
3254
  }
3265
- /** DATABASE_URL as Better Auth's local migrations read it: the shell before `.env`. */
3255
+ /**
3256
+ * DATABASE_URL as Better Auth's local migrations read it: the shell before `.env`. An empty
3257
+ * shell value counts as unset.
3258
+ */
3266
3259
  function readAuthDatabaseUrl(root) {
3267
- return (process.env.DATABASE_URL ?? readDatabaseUrl(root)) || void 0;
3260
+ return process.env.DATABASE_URL || readDatabaseUrl(root) || void 0;
3268
3261
  }
3269
3262
  /**
3270
3263
  * Vite plugin that runs local migrations on dev server startup.
@@ -3276,25 +3269,32 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3276
3269
  name: "void:migrations",
3277
3270
  apply: "serve",
3278
3271
  async configureServer(server) {
3279
- const migrationsDir = readProjectPaths(root).migrationsDir;
3272
+ const paths = readProjectPaths(root);
3273
+ const migrationsDir = paths.migrationsDir;
3280
3274
  const hasSqlMigrations = existsSync(migrationsDir);
3281
3275
  if (!hasSqlMigrations && !auth?.enabled) return;
3282
3276
  const migrateAuth = async (databaseUrl) => {
3283
- const { runLocalVoidAuthMigrations } = await import("./node-cPadMgUO.mjs");
3277
+ const { runLocalVoidAuthMigrations } = await import("./node-uN8_zxJr.mjs");
3284
3278
  await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth?.configPath, databaseUrl);
3285
3279
  };
3286
3280
  const mysqlAuth = dialect === "mysql" && auth?.enabled === true;
3287
3281
  const logApplied = (applied) => {
3288
3282
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
3289
3283
  };
3284
+ const refuse = (err) => {
3285
+ afterServerReady(server, () => {
3286
+ console.log();
3287
+ voidError(`${err instanceof Error ? err.message : String(err)}\nNo migrations were applied. Fix the files, then restart the dev server.`);
3288
+ });
3289
+ };
3290
3290
  try {
3291
3291
  if (dialect !== "sqlite") {
3292
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
3292
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
3293
3293
  const allMigrations = collectMigrations(migrationsDir);
3294
3294
  const runFiles = dialect === "mysql" ? allMigrations.length > 0 : hasSqlMigrations;
3295
3295
  const url = runFiles ? readDatabaseUrl(root) : void 0;
3296
3296
  const authUrl = mysqlAuth ? readAuthDatabaseUrl(root) : void 0;
3297
- if (runFiles && !url || mysqlAuth && !authUrl) {
3297
+ if (runFiles && !url || auth?.enabled && !readAuthDatabaseUrl(root)) {
3298
3298
  afterServerReady(server, () => {
3299
3299
  console.log();
3300
3300
  voidError(`DATABASE_URL not found in .env — skipping ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} migrations.`);
@@ -3303,29 +3303,30 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3303
3303
  }
3304
3304
  const authWithFiles = authUrl !== void 0 && authUrl === url;
3305
3305
  if (url) {
3306
- const { validateMigrations } = await import("./validate-BQFdf0Pi.mjs");
3307
- const appliedNames = dialect === "mysql" ? await import("./runner-mysql-DWwE8jKi.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-_Xncr3H5.mjs").then((runner) => runner.getPgAppliedMigrations(url));
3306
+ const { validateMigrations } = await import("./validate-D7Wn8PUX.mjs");
3307
+ const appliedNames = dialect === "mysql" ? await import("./runner-mysql-BcHnLUuM.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-Cgp-cr_p.mjs").then((runner) => runner.getPgAppliedMigrations(url));
3308
3308
  const appliedSet = new Set(appliedNames);
3309
3309
  const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
3310
3310
  if (pending.length > 0) try {
3311
3311
  validateMigrations(pending);
3312
3312
  } catch (err) {
3313
- voidWarn(err instanceof Error ? err.message : String(err));
3313
+ refuse(err);
3314
+ return;
3314
3315
  }
3315
- const applied = dialect === "mysql" ? await import("./runner-mysql-DWwE8jKi.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
3316
+ const applied = dialect === "mysql" ? await import("./runner-mysql-BcHnLUuM.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
3316
3317
  logApplied(names);
3317
3318
  await migrateAuth(url);
3318
- } : void 0)) : await import("./runner-pg-_Xncr3H5.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
3319
+ } : void 0)) : await import("./runner-pg-Cgp-cr_p.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
3319
3320
  if (!authWithFiles) logApplied(applied);
3320
3321
  }
3321
3322
  if (authUrl && !authWithFiles) {
3322
- const { withMySqlMigrationLockAt } = await import("./runner-mysql-DWwE8jKi.mjs");
3323
+ const { withMySqlMigrationLockAt } = await import("./runner-mysql-BcHnLUuM.mjs");
3323
3324
  await withMySqlMigrationLockAt(authUrl, () => migrateAuth(authUrl));
3324
3325
  }
3325
3326
  } else if (hasSqlMigrations) {
3326
- const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-So9mYfcm.mjs");
3327
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
3328
- const { validateMigrations } = await import("./validate-BQFdf0Pi.mjs");
3327
+ const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-WCdfeI0q.mjs");
3328
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
3329
+ const { validateMigrations } = await import("./validate-D7Wn8PUX.mjs");
3329
3330
  const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
3330
3331
  const allMigrations = collectMigrations(migrationsDir);
3331
3332
  const appliedRows = await getAppliedMigrations(dbPath);
@@ -3334,9 +3335,10 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3334
3335
  if (pending.length > 0) try {
3335
3336
  validateMigrations(pending);
3336
3337
  } catch (err) {
3337
- voidWarn(err instanceof Error ? err.message : String(err));
3338
+ refuse(err);
3339
+ return;
3338
3340
  }
3339
- const applied = await runMigrations(migrationsDir, dbPath);
3341
+ const applied = await runMigrations(migrationsDir, dbPath, paths.sourceRelative);
3340
3342
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
3341
3343
  }
3342
3344
  if (auth?.enabled) {
@@ -3631,27 +3633,38 @@ function createFrameworkPlugins(input) {
3631
3633
  return injectSvelteKitHooks(code, id, frameworkTriggersDispatchPath(root));
3632
3634
  }
3633
3635
  };
3634
- const astroRequestScopePlugin = detected.name === "astro" && dialect !== "sqlite" ? {
3635
- name: "void:astro-request-scope",
3636
+ const scopeAstroRequests = dialect !== "sqlite";
3637
+ let astroDevTriggers = false;
3638
+ const astroServerEntryPlugin = detected.name === "astro" ? {
3639
+ name: "void:astro-server-entry",
3636
3640
  enforce: "pre",
3641
+ configResolved(resolvedConfig) {
3642
+ astroDevTriggers = resolvedConfig.command === "serve" && hasOwnAstroMiddleware(root);
3643
+ },
3637
3644
  resolveId: {
3638
3645
  filter: { id: /^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)?$/ },
3639
3646
  handler(_id, importer) {
3640
- if (importer === ASTRO_SCOPED_SERVER_ENTRY || this.environment?.name === "client") return;
3647
+ if (!scopeAstroRequests && !astroDevTriggers || importer === ASTRO_SCOPED_SERVER_ENTRY || this.environment?.name === "client") return;
3641
3648
  return ASTRO_SCOPED_SERVER_ENTRY;
3642
3649
  }
3643
3650
  },
3644
3651
  load: {
3645
3652
  filter: { id: /^\0void:astro-server-entry$/ },
3646
3653
  handler() {
3647
- return `import original from ${JSON.stringify(ASTRO_SERVER_ENTRY)};
3648
- import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};
3654
+ const imports = [
3655
+ `import original from ${JSON.stringify(ASTRO_SERVER_ENTRY)};`,
3656
+ ...scopeAstroRequests ? [`import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};`] : [],
3657
+ ...astroDevTriggers ? [`import { handleDevTrigger } from ${JSON.stringify(frameworkTriggersDispatchPath(root))};`] : []
3658
+ ];
3659
+ const handle = astroDevTriggers ? "async () => (await handleDevTrigger(request, env, ctx)) ?? original.fetch(request, env, ctx)" : "() => original.fetch(request, env, ctx)";
3660
+ return `${imports.join("\n")}
3649
3661
  export * from ${JSON.stringify(ASTRO_SERVER_ENTRY)};
3650
3662
 
3651
3663
  export default {
3652
3664
  ...original,
3653
3665
  fetch(request, env, ctx) {
3654
- return withRuntimeEnv(env, () => original.fetch(request, env, ctx));
3666
+ const handle = ${handle};
3667
+ return ${scopeAstroRequests ? "withRuntimeEnv(env, handle)" : "handle()"};
3655
3668
  },
3656
3669
  };
3657
3670
  `;
@@ -3694,7 +3707,7 @@ export default {
3694
3707
  wranglerCompatPlugin,
3695
3708
  wranglerSyncPlugin,
3696
3709
  ...nuxtVite8WebSocketCompatPlugin ? [nuxtVite8WebSocketCompatPlugin] : [],
3697
- ...astroRequestScopePlugin ? [astroRequestScopePlugin] : [],
3710
+ ...astroServerEntryPlugin ? [astroServerEntryPlugin] : [],
3698
3711
  svelteKitHooksInjectPlugin,
3699
3712
  ...svelteKitWorkerBuildPlugin ? [svelteKitWorkerBuildPlugin] : [],
3700
3713
  clientStubsPlugin,
@@ -4456,7 +4469,7 @@ function routingPlugin(root, options) {
4456
4469
  if (!options.target) {
4457
4470
  const migrationsDir = paths.migrationsDir;
4458
4471
  if (existsSync(migrationsDir) || compileOptions.auth) {
4459
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
4472
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
4460
4473
  const { buildMigrationPlanBundle } = await import("./plan-CKX_jWnD.mjs");
4461
4474
  const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
4462
4475
  const dialect = getDatabaseDialect(readConfig(root));
@@ -5163,7 +5176,7 @@ function voidPlugin(options) {
5163
5176
  }
5164
5177
  };
5165
5178
  if (framework) {
5166
- workerConfig.main = getFrameworkEntry(framework, root, devTriggerToken, dialect, config.routing?.notFound);
5179
+ workerConfig.main = getFrameworkEntry(framework, root, devTriggerToken, dialect, config.routing?.notFound, config.cloudflare?.main);
5167
5180
  let notFoundIgnoredWarned = false;
5168
5181
  const frameworkBuildWrapperPlugin = {
5169
5182
  name: "void:framework-build-wrapper",
@@ -5173,7 +5186,7 @@ function voidPlugin(options) {
5173
5186
  notFoundIgnoredWarned = true;
5174
5187
  voidWarn(`Void generates no asset routing policy for a ${framework} build, so "routing.notFound" in void.config.ts is not written to the built worker config. During a self-hosted build and direct Cloudflare deployment, it takes effect only if your own Cloudflare config declares a complete \`assets\` policy (\`binding\`, \`directory\`, \`not_found_handling\`, \`run_worker_first\`); otherwise Cloudflare's default applies. Managed \`void deploy\` supplies the policy for you.`);
5175
5188
  }
5176
- generateClassATriggerWrapper(root, framework, getOriginalFrameworkEntry(framework, root), true, dialect, resolved.build.assetsDir, config.routing?.notFound);
5189
+ generateClassATriggerWrapper(root, framework, getOriginalFrameworkEntry(framework, root, config.cloudflare?.main), true, dialect, resolved.build.assetsDir, config.routing?.notFound);
5177
5190
  }
5178
5191
  };
5179
5192
  const existingFlags = workerConfig.compatibility_flags ?? [];
@@ -1,8 +1,8 @@
1
1
  import { a as join, s as relative } from "./dist-ipQi0Q8y.mjs";
2
- import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-DsARdQKE.mjs";
3
- import { d as readConfig } from "./config-Bx_1SpnO.mjs";
4
- import { d as deriveDurableResourceIdentity, f as inferDurableResourceName, t as analyzeApplicationSync } from "./application-analysis-AB_YYWgH.mjs";
5
- import { n as VOID_LOCK_FILE } from "./cloudflare-config-DV60XFFK.mjs";
2
+ import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-Bekzjuqw.mjs";
3
+ import { d as readConfig } from "./config-D26zcdKy.mjs";
4
+ import { d as deriveDurableResourceIdentity, f as inferDurableResourceName, t as analyzeApplicationSync } from "./application-analysis-D7nNmNJb.mjs";
5
+ import { n as VOID_LOCK_FILE } from "./cloudflare-config-rdFOys4X.mjs";
6
6
  import { existsSync, readFileSync } from "node:fs";
7
7
  import { isRecord } from "@void/deploy-core";
8
8
  //#region src/cli/info.ts
@@ -1,28 +1,28 @@
1
1
  import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
2
- import { r as detectFramework } from "./plugin-inference-DsARdQKE.mjs";
3
- import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-DMvEeSau.mjs";
4
- import { d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
2
+ import { r as detectFramework } from "./plugin-inference-Bekzjuqw.mjs";
3
+ import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-DGu_QZ_Q.mjs";
4
+ import { d as readConfig, s as getDatabaseDialect } from "./config-D26zcdKy.mjs";
5
5
  import { t as MagicString } from "./dist-Cegxq8gs.mjs";
6
6
  import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
7
- import { r as materializeCloudflareConfig } from "./cloudflare-config-DV60XFFK.mjs";
8
- import { i as LATEST_KNOWN_COMPAT_DATE, j as writeProvisionedWranglerConfig } from "./wrangler-BYs07Rxy.mjs";
7
+ import { r as materializeCloudflareConfig } from "./cloudflare-config-rdFOys4X.mjs";
8
+ import { i as LATEST_KNOWN_COMPAT_DATE, j as writeProvisionedWranglerConfig } from "./wrangler-C9XSzrju.mjs";
9
9
  import { i as readPackageJson, n as hasPackageDependency } from "./package-json-BjYqR-So.mjs";
10
10
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
11
11
  import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
12
- import { l as formatUrl, m as printSuccess, p as note } from "./output-Ba6ZbrzY.mjs";
13
- import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-bveqhlYA.mjs";
12
+ import { l as formatUrl, m as printSuccess, p as note } from "./output-CKguMgr7.mjs";
13
+ import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-Itv1f4WC.mjs";
14
14
  import { t as parseDotenvFile } from "./dotenv-CNazY3-w.mjs";
15
- import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BEm9vRvS.mjs";
15
+ import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-DC5llZaI.mjs";
16
16
  import { n as getOwnVersion, r as getPackageDir, t as detectAgents } from "./agents-CuNtT0D_.mjs";
17
- import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
18
- import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-yInGo72M.mjs";
19
- import { s as formatProjectCommand } from "./cloudflare-process-CeDWJRhj.mjs";
17
+ import { r as PlatformClient } from "./client-BdzxubTS.mjs";
18
+ import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-D8jQTwVQ.mjs";
19
+ import { s as formatProjectCommand } from "./cloudflare-process-CZJ4viYl.mjs";
20
20
  import { i as hasLocalLockfile, n as drizzleKitBin, r as findInstalledYarnPnpRuntime, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DLbEFMT0.mjs";
21
- import { t as promptForLoginToken } from "./login-C2T1oVG-.mjs";
22
- import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-DaAOiWTl.mjs";
23
- import { t as connectCloudflare } from "./cloudflare-connect-WjwnVOJA.mjs";
24
- import { n as snapshotDrizzleOutputs } from "./generate-Dat0UTry.mjs";
25
- import { i as writeVoidProjectConfig, o as migrateFrameworkAdapterPaths, r as canRewriteVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-BDIprOYd.mjs";
21
+ import { t as promptForLoginToken } from "./login-f2eu2TQh.mjs";
22
+ import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-CX7phm7V.mjs";
23
+ import { t as connectCloudflare } from "./cloudflare-connect-BN-k2kD-.mjs";
24
+ import { n as snapshotDrizzleOutputs } from "./generate-B1m4Cm4n.mjs";
25
+ import { i as writeVoidProjectConfig, o as migrateFrameworkAdapterPaths, r as canRewriteVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-DYfdWBXt.mjs";
26
26
  import { createRequire } from "node:module";
27
27
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
28
28
  import { parseSync } from "vite";
@@ -2318,15 +2318,27 @@ function setupExistingProject(root, framework) {
2318
2318
  ensureExistingProjectViteConfig(root, framework);
2319
2319
  return dependencyAdded;
2320
2320
  }
2321
- /**
2322
- * Scaffolds the "SQL → types → handler → fetch" demo into an existing project.
2323
- * `setupExistingProject` has already declared `void` in `package.json`.
2324
- */
2325
- function scaffoldDemo(root) {
2326
- const devCommand = getDevCommand(root);
2327
- const paths = readProjectPaths(root);
2328
- mkdirSync(paths.dbDir, { recursive: true });
2329
- writeFileSync(paths.schemaFile, `import { sql } from "void/db";
2321
+ /** The demo `posts` table for the database dialect that init configured. */
2322
+ function demoSchemaSource(dialect) {
2323
+ if (dialect === "postgresql") return `import { pgTable, serial, text, timestamp } from "void/schema-pg";
2324
+
2325
+ export const posts = pgTable("posts", {
2326
+ id: serial("id").primaryKey(),
2327
+ title: text("title").notNull(),
2328
+ body: text("body").notNull(),
2329
+ createdAt: timestamp("created_at").notNull().defaultNow(),
2330
+ });
2331
+ `;
2332
+ if (dialect === "mysql") return `import { int, mysqlTable, text, timestamp } from "void/schema-mysql";
2333
+
2334
+ export const posts = mysqlTable("posts", {
2335
+ id: int("id").autoincrement().primaryKey(),
2336
+ title: text("title").notNull(),
2337
+ body: text("body").notNull(),
2338
+ createdAt: timestamp("created_at").notNull().defaultNow(),
2339
+ });
2340
+ `;
2341
+ return `import { sql } from "void/db";
2330
2342
  import { integer, sqliteTable, text } from "void/schema-d1";
2331
2343
 
2332
2344
  export const posts = sqliteTable("posts", {
@@ -2335,7 +2347,17 @@ export const posts = sqliteTable("posts", {
2335
2347
  body: text("body").notNull(),
2336
2348
  createdAt: text("created_at").notNull().default(sql\`(datetime('now'))\`),
2337
2349
  });
2338
- `);
2350
+ `;
2351
+ }
2352
+ /**
2353
+ * Scaffolds the "SQL → types → handler → fetch" demo into an existing project.
2354
+ * `setupExistingProject` has already declared `void` in `package.json`.
2355
+ */
2356
+ function scaffoldDemo(root, dialect) {
2357
+ const devCommand = getDevCommand(root);
2358
+ const paths = readProjectPaths(root);
2359
+ mkdirSync(paths.dbDir, { recursive: true });
2360
+ writeFileSync(paths.schemaFile, demoSchemaSource(dialect));
2339
2361
  log.step("Created db/schema.ts");
2340
2362
  mkdirSync(join(paths.routesDir, "api"), { recursive: true });
2341
2363
  writeFileSync(join(paths.routesDir, "api", "posts.ts"), `import { defineHandler } from "void";
@@ -2495,14 +2517,15 @@ async function runInitCommand(root, initArgs) {
2495
2517
  process.exit(0);
2496
2518
  }
2497
2519
  if (scaffold) {
2498
- scaffoldDemo(root);
2520
+ const demoDialect = getDatabaseDialect(readConfig(root));
2521
+ scaffoldDemo(root, demoDialect);
2499
2522
  const voidResolvable = isVoidResolvableFrom(root);
2500
2523
  const deferral = resolveWorkspaceDeferral(root, readPackageJson(root));
2501
2524
  if (deferral && !voidResolvable) {
2502
2525
  const relRoot = relative(deferral.workspaceRoot, root) || ".";
2503
2526
  note(`Scaffolded the starter demo in ./${relRoot}.\n\nRun your workspace install from ${deferral.workspaceRoot} to pick up the new \`void\` dep,\nthen run \`void db generate\` from ./${relRoot} to create the initial migration.`, "Workspace subpackage");
2504
2527
  }
2505
- scaffoldedStarterMode = "sqlite";
2528
+ scaffoldedStarterMode = demoDialect;
2506
2529
  }
2507
2530
  }
2508
2531
  }
@@ -1,9 +1,9 @@
1
1
  import { r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken, s as getSiteDomain } from "./auth-B6iOCjKI.mjs";
3
3
  import { H as outro, L as log, O as cancel } from "./dist-BVdsO7Py.mjs";
4
- import { f as import_picocolors, m as printSuccess } from "./output-Ba6ZbrzY.mjs";
5
- import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
6
- import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-yInGo72M.mjs";
4
+ import { f as import_picocolors, m as printSuccess } from "./output-CKguMgr7.mjs";
5
+ import { r as PlatformClient } from "./client-BdzxubTS.mjs";
6
+ import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-D8jQTwVQ.mjs";
7
7
  import { a as resolveProjectBySlug } from "./resolve-project-WpwkCB_c.mjs";
8
8
  //#region src/cli/link.ts
9
9
  function projectLabel(slug, root, url) {