void 0.27.0 → 1.0.3

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 (337) hide show
  1. package/README.md +3 -1
  2. package/dist/{account-cmd-l-FM7Ioq.mjs → account-cmd-BTcUzv9L.mjs} +6 -6
  3. package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
  4. package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-AB_YYWgH.mjs} +118 -135
  5. package/dist/{application-routing-DQyUh_5S.mjs → application-routing-L7V-TFhZ.mjs} +1 -2
  6. package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
  7. package/dist/{auth-Dn2vw-SG.mjs → auth-B6iOCjKI.mjs} +23 -56
  8. package/dist/auth-Cbqi1iVX.mjs +1 -0
  9. package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DUJuvRx5.mjs} +11 -11
  10. package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
  11. package/dist/{auth-router-DvsCUVw4.mjs → auth-router-CIxiMG7i.mjs} +5 -5
  12. package/dist/base64-DVrOndmI.mjs +16 -0
  13. package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
  14. package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
  15. package/dist/{build-cmd-D6we0VjO.mjs → build-cmd-BkIv25PA.mjs} +6 -6
  16. package/dist/{cache-CZRdzKx1.mjs → cache-Ctzfig-W.mjs} +6 -6
  17. package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CD9o-SsC.mjs} +5 -5
  18. package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
  19. package/dist/{cf-access-BcIBSKqG.mjs → cf-access-CWP4avfP.mjs} +3 -7
  20. package/dist/cf-build-output-BU3hqdHu.mjs +1 -0
  21. package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
  22. package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
  23. package/dist/cli/cli.mjs +199 -312
  24. package/dist/cli/cloudflare-operation-process.mjs +41 -15
  25. package/dist/cli/env-schema-probe.d.mts +7 -44
  26. package/dist/cli/env-schema-probe.mjs +14 -80
  27. package/dist/client-B60PwCC4.mjs +1 -0
  28. package/dist/{client-DlDJuY0s.mjs → client-DM9Kcf4e.mjs} +161 -415
  29. package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
  30. package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-BIAF_BIY.mjs} +7 -6
  31. package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
  32. package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-WjwnVOJA.mjs} +4 -4
  33. package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-B42EZeJy.mjs} +26 -34
  34. package/dist/cloudflare-operations-CrSUFRzJ.mjs +1 -0
  35. package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
  36. package/dist/collect-Cae8A7Zr.mjs +1 -0
  37. package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
  38. package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
  39. package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
  40. package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
  41. package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
  42. package/dist/config-QrJWu0IX.mjs +1 -0
  43. package/dist/config-entry.d.mts +1 -1
  44. package/dist/{connect-BfPBHHm-.mjs → connect-CKtk-EZe.mjs} +9 -9
  45. package/dist/create-project-B-ewF_Af.mjs +1 -0
  46. package/dist/{create-project-BdXEFKal.mjs → create-project-yInGo72M.mjs} +8 -8
  47. package/dist/database-provider.mjs +1 -2
  48. package/dist/{db-Xs80hcaA.mjs → db-7I_gfdVq.mjs} +177 -268
  49. package/dist/db-types-Bb4WBWIs.mjs +49 -0
  50. package/dist/{delete-d2vuou3j.mjs → delete-Cy-M1u-r.mjs} +6 -6
  51. package/dist/deploy-9lgfhrXS.mjs +2 -0
  52. package/dist/deploy-BYYlnsiy.mjs +6164 -0
  53. package/dist/deploy-managed-static-Ca4TFdmx.mjs +1595 -0
  54. package/dist/deploy-transport-DWlWBe6M.mjs +180 -0
  55. package/dist/deploy.d.mts +10 -0
  56. package/dist/deploy.mjs +82 -0
  57. package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
  58. package/dist/discover-ClzFSwns.mjs +1 -0
  59. package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
  60. package/dist/dispatch-DrTTk8Xg.mjs +431 -0
  61. package/dist/{dist-D3m88sjf.mjs → dist-BVdsO7Py.mjs} +5 -6
  62. package/dist/dist-CfgIkieS.mjs +1 -0
  63. package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
  64. package/dist/{domain-BsDUBAvt.mjs → domain-CZGxPv9u.mjs} +8 -23
  65. package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
  66. package/dist/edge.mjs +1 -2
  67. package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
  68. package/dist/{email-_lGAHOhp.mjs → email-DzyNVuoU.mjs} +100 -192
  69. package/dist/email-cloudflare-DfG6UEMm.mjs +1096 -0
  70. package/dist/email-protocol-D9nTvhCp.mjs +82 -0
  71. package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
  72. package/dist/{env-DMA3cXZt.mjs → env-0jrMQJI_.mjs} +6 -14
  73. package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
  74. package/dist/{env-C74QepDE.mjs → env-Nx3yf50r.mjs} +9 -9
  75. package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
  76. package/dist/{env-raw-jZpP5n47.mjs → env-raw-D74P4ebM.mjs} +15 -21
  77. package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
  78. package/dist/env-validation-BT7z-qpQ.mjs +1 -0
  79. package/dist/env-validation-DYxjz_Wo.mjs +488 -0
  80. package/dist/{gen-DtkQhvQg.mjs → gen-CufHEf42.mjs} +132 -254
  81. package/dist/gen-sXyp5DFO.mjs +1 -0
  82. package/dist/generate-ClI89brV.mjs +1 -0
  83. package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
  84. package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
  85. package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-FU8EjFyU.mjs} +28 -72
  86. package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
  87. package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
  88. package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
  89. package/dist/{help-0bTe_lID.mjs → help-BT2hovNI.mjs} +26 -14
  90. package/dist/help-i2YGGnTH.mjs +1 -0
  91. package/dist/{inbound-PfQDLXc5.mjs → inbound-BuTfm11U.mjs} +71 -222
  92. package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
  93. package/dist/index.d.mts +2 -18
  94. package/dist/index.mjs +714 -762
  95. package/dist/{info-PYWwkWyt.mjs → info-l249eUdH.mjs} +5 -5
  96. package/dist/{init-DaBGmaXC.mjs → init-D0A6M64Q.mjs} +229 -392
  97. package/dist/isr-config-fZaJJ8t7.mjs +165 -0
  98. package/dist/{link-C6fjafep.mjs → link-WMoJFf4i.mjs} +9 -9
  99. package/dist/{list-BTFBlqKl.mjs → list-CQ2EQEHL.mjs} +7 -18
  100. package/dist/{live-CgQuTpqD.mjs → live-BcHoTDFe.mjs} +19 -17
  101. package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
  102. package/dist/load-user-env-DD5qveNU.mjs +49 -0
  103. package/dist/{local-d1-ga5O_idV.mjs → local-d1-BxvQYEFi.mjs} +6 -6
  104. package/dist/{login-GKcNUmtI.mjs → login-C2T1oVG-.mjs} +12 -12
  105. package/dist/login-XD844Xs-.mjs +1 -0
  106. package/dist/{logs-BiMSULmc.mjs → logs-DnC1d7xB.mjs} +6 -6
  107. package/dist/{migrate-NLsjBbuM.mjs → migrate-BDIprOYd.mjs} +70 -22
  108. package/dist/migrate-BRwU-blY.mjs +1 -0
  109. package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
  110. package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
  111. package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
  112. package/dist/mysql-migration-sql-BIS5vbNk.mjs +241 -0
  113. package/dist/nitro.d.mts +30 -0
  114. package/dist/nitro.mjs +88 -0
  115. package/dist/{node-DJicPvPj.mjs → node-cPadMgUO.mjs} +9 -25
  116. package/dist/{operator-args-DOBhIaIg.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
  117. package/dist/{operator-auth-BEZ_u0Cz.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
  118. package/dist/{operator-client-DbDv4vtE.mjs → operator-client-C-ROjk1I.mjs} +4 -4
  119. package/dist/operator-cmd-D6gnZsnK.mjs +1 -0
  120. package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-DHieWtFp.mjs} +8 -8
  121. package/dist/{output-C50ag2r3.mjs → output-Ba6ZbrzY.mjs} +37 -6
  122. package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
  123. package/dist/pages/client.d.mts +1 -1
  124. package/dist/pages/client.mjs +91 -5
  125. package/dist/pages/head.mjs +1 -2
  126. package/dist/pages/index.d.mts +1 -2
  127. package/dist/pages/index.mjs +6 -6
  128. package/dist/pages/islands-plugin.mjs +5 -83
  129. package/dist/pages/prefetch.mjs +1 -2
  130. package/dist/pages/protocol.d.mts +2 -2
  131. package/dist/pages/protocol.mjs +1 -1
  132. package/dist/pages/serialize.mjs +1 -2
  133. package/dist/plan-CKX_jWnD.mjs +1 -0
  134. package/dist/platform-args-B0HeTh0C.mjs +1 -0
  135. package/dist/{platform-args-DUeXY9Om.mjs → platform-args-CaCL_1Ch.mjs} +43 -60
  136. package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-Z16-I8nT.mjs} +11 -12
  137. package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-BXwZiJSF.mjs} +37 -27
  138. package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-CXjfqyOv.mjs} +9 -10
  139. package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DaAOiWTl.mjs} +16 -16
  140. package/dist/platform-cmd-PT4YwMLM.mjs +1 -0
  141. package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
  142. package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-CxpvUeo0.mjs} +6 -6
  143. package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DBiS0cJd.mjs} +1693 -2120
  144. package/dist/platform-lifecycle-u9pMOvxC.mjs +1 -0
  145. package/dist/{platform-management-CuuVDhyt.mjs → platform-management-DhEFdQAf.mjs} +696 -130
  146. package/dist/platform-management-DvBS83rC.mjs +1 -0
  147. package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-BWn1S2Rv.mjs} +16 -12
  148. package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-BUGOB4RC.mjs} +6 -9
  149. package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
  150. package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-YvN9VQXV.mjs} +21 -28
  151. package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
  152. package/dist/prepare-CYT6tAzD.mjs +1 -0
  153. package/dist/{prepare-Do96654b.mjs → prepare-DEB5SeVJ.mjs} +12 -13
  154. package/dist/{prepare-Dq9hTIbo.mjs → prepare-PQCgsny0.mjs} +4 -4
  155. package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
  156. package/dist/prerender-render.d.mts +2 -0
  157. package/dist/prerender-render.mjs +1 -2
  158. package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-DVatD8Ev.mjs} +20 -20
  159. package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
  160. package/dist/{project-BAm2aB6Q.mjs → project-rqDnVsJN.mjs} +8 -4
  161. package/dist/project-slug-6cyz8E7k.mjs +1 -0
  162. package/dist/{project-team-Q_lCA7Io.mjs → project-team-DJrWEAG1.mjs} +7 -7
  163. package/dist/{project-token-BArgK9o1.mjs → project-token-CBgLBuL6.mjs} +6 -6
  164. package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
  165. package/dist/project-zdB3fs9G.mjs +1 -0
  166. package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-92gLtZ25.mjs} +6 -6
  167. package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
  168. package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
  169. package/dist/{provision-BfaLiWbj.mjs → provision-BnSSkiED.mjs} +119 -866
  170. package/dist/{requests-C7Oeoh5u.mjs → requests-7W1Pygt2.mjs} +5 -5
  171. package/dist/resolve-project-PnhzMtY6.mjs +1 -0
  172. package/dist/resolve-project-WpwkCB_c.mjs +48 -0
  173. package/dist/{rollback-DVAtrLAl.mjs → rollback-BcASVnwP.mjs} +8 -18
  174. package/dist/{route-types-CbtsIeFn.mjs → route-types-BZi26DVS.mjs} +9 -91
  175. package/dist/routing-assets-VkrKIbxE.mjs +139 -0
  176. package/dist/{runner-DMBKSrRk.mjs → runner-CabsQ-iM.mjs} +22 -34
  177. package/dist/runner-So9mYfcm.mjs +1 -0
  178. package/dist/runner-mysql-BhRaONkO.mjs +146 -0
  179. package/dist/runner-mysql-DWwE8jKi.mjs +1 -0
  180. package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-BRemq_GX.mjs} +3 -3
  181. package/dist/runner-pg-_Xncr3H5.mjs +1 -0
  182. package/dist/runtime/ai.mjs +23 -25
  183. package/dist/runtime/auth-client-react.mjs +1 -2
  184. package/dist/runtime/auth-client-solid.mjs +1 -2
  185. package/dist/runtime/auth-client-svelte.mjs +1 -2
  186. package/dist/runtime/auth-client-vue.mjs +1 -2
  187. package/dist/runtime/auth-client.mjs +1 -2
  188. package/dist/runtime/auth.mjs +1 -2
  189. package/dist/runtime/better-auth-mysql.d.mts +2 -5
  190. package/dist/runtime/better-auth-mysql.mjs +9 -31
  191. package/dist/runtime/better-auth-pg.d.mts +2 -5
  192. package/dist/runtime/better-auth-pg.mjs +6 -32
  193. package/dist/runtime/better-auth.d.mts +2 -4
  194. package/dist/runtime/better-auth.mjs +9 -19
  195. package/dist/runtime/db.mjs +6 -2
  196. package/dist/runtime/durable.d.mts +18 -1
  197. package/dist/runtime/durable.mjs +26 -2
  198. package/dist/runtime/email/testing.d.mts +1 -1
  199. package/dist/runtime/email/testing.mjs +9 -23
  200. package/dist/runtime/email-protocol.d.mts +12 -0
  201. package/dist/runtime/email-protocol.mjs +1 -70
  202. package/dist/runtime/email.d.mts +1 -1
  203. package/dist/runtime/email.mjs +79 -221
  204. package/dist/runtime/env-public.d.mts +1 -1
  205. package/dist/runtime/env-public.mjs +12 -38
  206. package/dist/runtime/env.d.mts +1 -12
  207. package/dist/runtime/env.mjs +1 -2
  208. package/dist/runtime/handler.d.mts +1 -1
  209. package/dist/runtime/handler.mjs +1 -1
  210. package/dist/runtime/isr.mjs +1 -1
  211. package/dist/runtime/kv.mjs +1 -1
  212. package/dist/runtime/limits.mjs +1 -2
  213. package/dist/runtime/live-client.d.mts +3 -2
  214. package/dist/runtime/live-server.d.mts +2 -1
  215. package/dist/runtime/live-server.mjs +1 -16
  216. package/dist/runtime/live.d.mts +1 -1
  217. package/dist/runtime/live.mjs +1 -2
  218. package/dist/runtime/log.d.mts +2 -1
  219. package/dist/runtime/migration-handler-mysql.d.mts +2 -2
  220. package/dist/runtime/migration-handler-mysql.mjs +39 -8
  221. package/dist/runtime/migration-handler-pg.d.mts +2 -2
  222. package/dist/runtime/migration-handler-pg.mjs +1 -1
  223. package/dist/runtime/migration-handler.d.mts +2 -2
  224. package/dist/runtime/migration-handler.mjs +1 -470
  225. package/dist/runtime/queues.mjs +1 -1
  226. package/dist/runtime/remote/binding-handler.mjs +62 -62
  227. package/dist/runtime/remote/index.mjs +16 -77
  228. package/dist/runtime/response.mjs +1 -2
  229. package/dist/runtime/route-url.mjs +1 -2
  230. package/dist/runtime/routing.d.mts +3 -5
  231. package/dist/runtime/routing.mjs +82 -218
  232. package/dist/runtime/sandbox-container.d.mts +2 -2
  233. package/dist/runtime/sandbox-container.mjs +1 -2
  234. package/dist/runtime/sandbox.d.mts +2 -2
  235. package/dist/runtime/sandbox.mjs +13 -6
  236. package/dist/runtime/seed.d.mts +2 -1
  237. package/dist/runtime/sse.mjs +1 -2
  238. package/dist/runtime/storage.mjs +1 -1
  239. package/dist/runtime/validator.d.mts +1 -1
  240. package/dist/runtime/validator.mjs +1 -2
  241. package/dist/runtime/ws-server.d.mts +4 -4
  242. package/dist/runtime/ws-server.mjs +6 -28
  243. package/dist/runtime/ws.d.mts +1 -1
  244. package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
  245. package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-a9LRUtii.mjs} +13 -2
  246. package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
  247. package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
  248. package/dist/{secret-BvtB7IjY.mjs → secret-bg73f1Ge.mjs} +63 -81
  249. package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
  250. package/dist/{skills-BgVMvQdy.mjs → skills-C_yRTg0g.mjs} +3 -3
  251. package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-Bm3ZlYgA.mjs} +39 -44
  252. package/dist/sveltekit.d.mts +2 -1
  253. package/dist/sveltekit.mjs +1 -1
  254. package/dist/validate-BQFdf0Pi.mjs +1 -0
  255. package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
  256. package/dist/version-metadata-DIrqEHQo.mjs +73 -0
  257. package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
  258. package/dist/wrapper-CwhpNWtH.mjs +663 -0
  259. package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
  260. package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
  261. package/docs/guide/ai.md +8 -2
  262. package/docs/guide/auth.md +2 -0
  263. package/docs/guide/database/mysql.md +14 -3
  264. package/docs/guide/database/postgresql.md +2 -0
  265. package/docs/guide/database.md +3 -5
  266. package/docs/guide/durable-state.md +32 -4
  267. package/docs/guide/platform/administration/access.md +4 -0
  268. package/docs/guide/platform/administration/connected-apps.md +55 -0
  269. package/docs/guide/platform/installation/credentials.md +21 -3
  270. package/docs/guide/platform/installation/domains.md +1 -1
  271. package/docs/guide/platform/installation/maintenance.md +38 -1
  272. package/docs/guide/platform/installation/prerequisites.md +6 -2
  273. package/docs/guide/platform/installation/setup.md +23 -1
  274. package/docs/guide/platform/installation/uninstall.md +6 -1
  275. package/docs/guide/quickstart.md +2 -0
  276. package/docs/guide/sandboxes.md +3 -1
  277. package/docs/guide/self-hosted-platform.md +1 -1
  278. package/docs/integrations/cloudflare.md +2 -2
  279. package/docs/integrations/frameworks/analog.md +3 -11
  280. package/docs/integrations/frameworks/nuxt.md +7 -10
  281. package/docs/integrations/nodejs-bun-deno.md +2 -0
  282. package/docs/reference/api/deploy.md +23 -0
  283. package/docs/reference/api/pages.md +2 -0
  284. package/docs/reference/api.md +3 -1
  285. package/docs/reference/cli/database.md +9 -3
  286. package/docs/reference/cli/platform-installation.md +19 -7
  287. package/docs/reference/cli/setup.md +2 -0
  288. package/docs/reference/config.md +2 -0
  289. package/package.json +39 -36
  290. package/sandbox.Dockerfile +1 -1
  291. package/skills/void/SKILL.md +2 -1
  292. package/dist/auth-LMJcNESe.mjs +0 -2
  293. package/dist/cf-build-output-H9a97vME.mjs +0 -2
  294. package/dist/cf-user-agent-lKblH3zU.mjs +0 -17
  295. package/dist/client-tso2OfcG.mjs +0 -2
  296. package/dist/cloudflare-operations-BlYLlowZ.mjs +0 -2
  297. package/dist/collect-DLyFDiKW.mjs +0 -2
  298. package/dist/config-5r-YpMC-.mjs +0 -2
  299. package/dist/config-B_ggY-IO.mjs +0 -89
  300. package/dist/config-BtSFvXZx.mjs +0 -2
  301. package/dist/config-write-AHGesphx.mjs +0 -61
  302. package/dist/create-project-qFDC45zg.mjs +0 -2
  303. package/dist/deploy-Bqe1PYBw.mjs +0 -10458
  304. package/dist/deploy-VsWsVQkw.mjs +0 -2
  305. package/dist/dev-inbox-CK-UuPob.mjs +0 -297
  306. package/dist/discover-EDUf6JJw.mjs +0 -2
  307. package/dist/dist-Bx1z6Eva.mjs +0 -2
  308. package/dist/dist-_UUlL6bg.mjs +0 -2
  309. package/dist/env-validation-CrVNjsPm.mjs +0 -2
  310. package/dist/env-validation-Dxdx_5wo.mjs +0 -951
  311. package/dist/gen-dA9hW7AV.mjs +0 -2
  312. package/dist/head-client-DzmJGN4C.mjs +0 -90
  313. package/dist/help-DfQYVfGY.mjs +0 -2
  314. package/dist/login-mx_ydhmp.mjs +0 -2
  315. package/dist/migrate-BHp07yJE.mjs +0 -2
  316. package/dist/operator-cmd-CwBB-1yb.mjs +0 -2
  317. package/dist/pages/head-client.d.mts +0 -13
  318. package/dist/pages/head-client.mjs +0 -2
  319. package/dist/plan-CH2G51je.mjs +0 -2
  320. package/dist/platform-args-D4E1PjVw.mjs +0 -2
  321. package/dist/platform-cmd-BbmJiq5O.mjs +0 -2
  322. package/dist/platform-lifecycle-ByAlpkhV.mjs +0 -2
  323. package/dist/platform-management-CBOT4BSM.mjs +0 -2
  324. package/dist/prepare-DRUV-g3X.mjs +0 -2
  325. package/dist/project-DedqCp59.mjs +0 -2
  326. package/dist/project-slug-DofjTFd-.mjs +0 -2
  327. package/dist/provision-Wu9ZBk9L.mjs +0 -2
  328. package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
  329. package/dist/resolve-project-CP8rZs_p.mjs +0 -28
  330. package/dist/runner-9wjsSZx-.mjs +0 -2
  331. package/dist/runner-mysql-CEzKtmFb.mjs +0 -54
  332. package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
  333. package/dist/runner-pg-BGYRFdRp.mjs +0 -2
  334. package/dist/runtime/env-helpers.d.mts +0 -2
  335. package/dist/runtime/env-helpers.mjs +0 -2
  336. package/dist/validate-BJr9LfXy.mjs +0 -2
  337. package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
@@ -1,8 +1,8 @@
1
- import { r as readProjectConfig } from "./project-BAm2aB6Q.mjs";
2
- import { c as getToken } from "./auth-Dn2vw-SG.mjs";
3
- import { H as outro, L as log } from "./dist-D3m88sjf.mjs";
4
- import { i as dim, l as import_picocolors } from "./output-C50ag2r3.mjs";
5
- import { r as PlatformClient } from "./client-DlDJuY0s.mjs";
1
+ import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
+ import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
+ import { H as outro, L as log } from "./dist-BVdsO7Py.mjs";
4
+ import { f as import_picocolors, i as dim } from "./output-Ba6ZbrzY.mjs";
5
+ import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
6
6
  //#region src/cli/requests.ts
7
7
  async function runRequestsCommand(root, range, status) {
8
8
  console.log();
@@ -0,0 +1 @@
1
+ export { n as inferDefaultSlug } from "./resolve-project-WpwkCB_c.mjs";
@@ -0,0 +1,48 @@
1
+ import { a as join } from "./dist-ipQi0Q8y.mjs";
2
+ import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
3
+ import { L as log } from "./dist-BVdsO7Py.mjs";
4
+ import { readFileSync } from "node:fs";
5
+ //#region src/cli/resolve-project.ts
6
+ function getRequestedProjectSlug(options) {
7
+ const cliSlug = options?.projectSlug?.trim();
8
+ if (cliSlug) return cliSlug;
9
+ const envSlug = process.env.VOID_PROJECT?.trim();
10
+ if (envSlug) return envSlug;
11
+ return null;
12
+ }
13
+ function resolveProjectBySlug(projects, slug) {
14
+ const project = projects.find((candidate) => candidate.slug === slug);
15
+ return project ? {
16
+ projectId: project.id,
17
+ slug: project.slug
18
+ } : null;
19
+ }
20
+ async function requireProjectBySlug(client, slug) {
21
+ const project = resolveProjectBySlug(await client.listProjects(), slug);
22
+ if (!project) throw new Error(`project: No project found with slug '${slug}'.`);
23
+ return project;
24
+ }
25
+ /** Resolves --project, then VOID_PROJECT, then the linked project; exits with an error otherwise. */
26
+ async function resolveCommandProjectId(client, root, projectSlug) {
27
+ const requestedSlug = projectSlug ?? process.env.VOID_PROJECT?.trim();
28
+ if (requestedSlug) {
29
+ const project = resolveProjectBySlug(await client.listProjects(), requestedSlug);
30
+ if (!project) {
31
+ log.error(`project: No project found with slug '${requestedSlug}'.`);
32
+ process.exit(1);
33
+ }
34
+ return project.projectId;
35
+ }
36
+ const config = readProjectConfig(root);
37
+ if (!config) {
38
+ log.error("No linked project. Run `void project link` or pass --project <name>.");
39
+ process.exit(1);
40
+ }
41
+ return config.projectId;
42
+ }
43
+ function inferDefaultSlug(root) {
44
+ const pkgPath = join(root, "package.json");
45
+ return (JSON.parse(readFileSync(pkgPath, "utf-8")).name ?? "my-app").replace(/^@[^/]+\//, "").replace(/[^a-z0-9-]/g, "-");
46
+ }
47
+ //#endregion
48
+ export { resolveProjectBySlug as a, resolveCommandProjectId as i, inferDefaultSlug as n, requireProjectBySlug as r, getRequestedProjectSlug as t };
@@ -1,8 +1,8 @@
1
- import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-BAm2aB6Q.mjs";
2
- import { c as getToken } from "./auth-Dn2vw-SG.mjs";
3
- import { A as confirm, H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-D3m88sjf.mjs";
4
- import { a as ensureUtc, d as printSuccess, i as dim, r as createSpinner, s as formatCount } from "./output-C50ag2r3.mjs";
5
- import { r as PlatformClient } from "./client-DlDJuY0s.mjs";
1
+ import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
+ import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
+ import { A as confirm, H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-BVdsO7Py.mjs";
4
+ import { c as formatRelativeTime, i as dim, m as printSuccess, o as formatCount, r as createSpinner } from "./output-Ba6ZbrzY.mjs";
5
+ import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
6
6
  //#region src/cli/rollback.ts
7
7
  async function runRollbackCommand(root, deployId) {
8
8
  console.log();
@@ -39,7 +39,7 @@ async function runRollbackCommand(root, deployId) {
39
39
  message: "Select a deployment to roll back to:",
40
40
  options: candidates.map((d) => ({
41
41
  value: d.id,
42
- label: `${d.id} ${dim(formatAge(d.deployed_at))}`,
42
+ label: `${d.id} ${dim(d.deployed_at ? formatRelativeTime(d.deployed_at) : "")}`,
43
43
  hint: d.source ? `via ${d.source}` : void 0
44
44
  }))
45
45
  });
@@ -74,7 +74,7 @@ async function runRollbackCommand(root, deployId) {
74
74
  }
75
75
  }
76
76
  async function runCloudflareRollback(root, deployId) {
77
- const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BlYLlowZ.mjs");
77
+ const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-CrSUFRzJ.mjs");
78
78
  const context = resolveCloudflareOperationContext(root);
79
79
  const status = await readCloudflareWorkerStatus(context);
80
80
  const deployedVersionIds = new Set(status.deployedVersionIds);
@@ -99,7 +99,7 @@ async function runCloudflareRollback(root, deployId) {
99
99
  message: "Select a version to roll back to:",
100
100
  options: candidates.map((version) => ({
101
101
  value: version.id,
102
- label: `${version.id} ${dim(formatAge(version.createdAt))}`,
102
+ label: `${version.id} ${dim(version.createdAt ? formatRelativeTime(version.createdAt) : "")}`,
103
103
  hint: version.metadata ? formatCount(version.metadata.migrations.length, "migration") : "migration state unknown"
104
104
  }))
105
105
  });
@@ -146,15 +146,5 @@ async function confirmUnrevertedMigrations(migrationDiff, noun) {
146
146
  log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
147
147
  await confirmRollbackOrExit();
148
148
  }
149
- function formatAge(deployedAt) {
150
- if (!deployedAt) return "";
151
- const diffMs = Date.now() - new Date(ensureUtc(deployedAt)).getTime();
152
- if (diffMs < 6e4) return "just now";
153
- const minutes = Math.floor(diffMs / 6e4);
154
- if (minutes < 60) return `${minutes}m ago`;
155
- const hours = Math.floor(minutes / 60);
156
- if (hours < 24) return `${hours}h ago`;
157
- return `${Math.floor(hours / 24)}d ago`;
158
- }
159
149
  //#endregion
160
150
  export { runRollbackCommand };
@@ -1,80 +1,4 @@
1
- import { a as join, l as relative } from "./dist-BVqXeR_h.mjs";
2
- import { r as writeFileIfChanged } from "./project-tsconfig-CVJhNMxs.mjs";
3
- import { mkdirSync } from "node:fs";
4
- //#region src/codegen/db-types.ts
5
- 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";
6
- /**
7
- * Generate `.void/db.d.ts` with Drizzle types referencing the user's schema.
8
- *
9
- * This is a proper module file (not `declare module`) whose types override
10
- * the base `void/db` package via a tsconfig `paths` redirect:
11
- * "void/db": ["./.void/db.d.ts"]
12
- *
13
- * Imports reference `void/_db` (internal subpath pointing at the same
14
- * base module) to avoid circular resolution through the paths redirect.
15
- */
16
- function generateDbDts(outDir, schema, dialect) {
17
- mkdirSync(outDir, { recursive: true });
18
- const lines = dialect === "mysql" ? schema ? [
19
- "// Auto-generated by void — do not edit",
20
- "import type { MySql2Database } from \"void/_db-mysql\";",
21
- "import type * as schema from \"@schema\";",
22
- "type Schema = typeof schema;",
23
- "export declare const db: MySql2Database<Schema>;",
24
- "export declare function createDb(connectionString: string): MySql2Database<Schema>;",
25
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
26
- "export type { MySql2Database } from \"void/_db-mysql\";",
27
- ""
28
- ] : [
29
- "// Auto-generated by void — do not edit",
30
- "import type { MySql2Database } from \"void/_db-mysql\";",
31
- "export declare const db: MySql2Database<Record<string, never>>;",
32
- "export declare function createDb(connectionString: string): MySql2Database<Record<string, never>>;",
33
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
34
- "export type { MySql2Database } from \"void/_db-mysql\";",
35
- ""
36
- ] : dialect === "postgresql" ? schema ? [
37
- "// Auto-generated by void — do not edit",
38
- "import type { NodePgDatabase } from \"void/_db-pg\";",
39
- "import type * as schema from \"@schema\";",
40
- "type Schema = typeof schema;",
41
- "export declare const db: NodePgDatabase<Schema>;",
42
- "export declare function createDb(connectionString: string): NodePgDatabase<Schema>;",
43
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
44
- "export type { NodePgDatabase } from \"void/_db-pg\";",
45
- ""
46
- ] : [
47
- "// Auto-generated by void — do not edit",
48
- "import type { NodePgDatabase } from \"void/_db-pg\";",
49
- "export declare const db: NodePgDatabase<Record<string, never>>;",
50
- "export declare function createDb(connectionString: string): NodePgDatabase<Record<string, never>>;",
51
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
52
- "export type { NodePgDatabase } from \"void/_db-pg\";",
53
- ""
54
- ] : schema ? [
55
- "// Auto-generated by void — do not edit",
56
- "/// <reference types=\"@cloudflare/workers-types\" />",
57
- "import type { DrizzleD1Database } from \"void/_db\";",
58
- "import type * as schema from \"@schema\";",
59
- "type Schema = typeof schema;",
60
- "export declare const db: DrizzleD1Database<Schema>;",
61
- "export declare function createDb(d1: D1Database): DrizzleD1Database<Schema>;",
62
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
63
- "export type { DrizzleD1Database } from \"void/_db\";",
64
- ""
65
- ] : [
66
- "// Auto-generated by void — do not edit",
67
- "/// <reference types=\"@cloudflare/workers-types\" />",
68
- "import type { DrizzleD1Database } from \"void/_db\";",
69
- "export declare const db: DrizzleD1Database<Record<string, never>>;",
70
- "export declare function createDb(d1: D1Database): DrizzleD1Database<Record<string, never>>;",
71
- `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
72
- "export type { DrizzleD1Database } from \"void/_db\";",
73
- ""
74
- ];
75
- return writeFileIfChanged(join(outDir, "db.d.ts"), lines.join("\n"));
76
- }
77
- //#endregion
1
+ import { s as relative } from "./dist-ipQi0Q8y.mjs";
78
2
  //#region src/codegen/queue-types.ts
79
3
  /**
80
4
  * Generate .void/queues.d.ts content.
@@ -271,22 +195,16 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
271
195
  const hasActions = page.methods.includes("actions");
272
196
  if (hasAction && hasActions) throw new Error(`pages: Page '${page.pattern}' exports both "action" and "actions". Use one or the other.`);
273
197
  lines.push(` ${JSON.stringify(page.pattern)}: {`);
274
- let importPath = null;
275
- if (page.serverPath) {
276
- const absPath = `${pagesDir}/${page.serverPath}`;
277
- importPath = relative(outDir, absPath);
278
- }
198
+ const importPath = relative(outDir, `${pagesDir}/${page.serverPath}`);
279
199
  if (hasActions) {
280
- if (importPath) {
281
- const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
282
- lines.push(` actions: { [K in keyof ${actionsImport}]: {`);
283
- lines.push(` body: ExtractInput<${actionsImport}[K]["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
284
- lines.push(" } };");
285
- }
286
- } else if (importPath) {
200
+ const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
201
+ lines.push(` actions: { [K in keyof ${actionsImport}]: {`);
202
+ lines.push(` body: ExtractInput<${actionsImport}[K]["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
203
+ lines.push(" } };");
204
+ } else {
287
205
  const importExpr = `(typeof import(${JSON.stringify(importPath)}))["action"]`;
288
206
  lines.push(` body: ExtractInput<${importExpr}["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
289
- } else lines.push(" body: Record<string, unknown>;");
207
+ }
290
208
  if (page.params.length > 0) {
291
209
  const paramsType = page.params.map((p) => `${p}: string`).join("; ");
292
210
  lines.push(` params: { ${paramsType} };`);
@@ -300,4 +218,4 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
300
218
  return { dts: lines.join("\n") };
301
219
  }
302
220
  //#endregion
303
- export { generateDbDts as i, generateQueueTypes as n, DRIZZLE_OPERATORS as r, generateRouteTypes as t };
221
+ export { generateQueueTypes as n, generateRouteTypes as t };
@@ -0,0 +1,139 @@
1
+ //#region src/runtime/routing-assets.ts
2
+ const ASSET_EXTENSIONS = [
3
+ "png",
4
+ "jpg",
5
+ "jpeg",
6
+ "gif",
7
+ "webp",
8
+ "avif",
9
+ "svg",
10
+ "ico",
11
+ "css",
12
+ "js",
13
+ "mjs",
14
+ "cjs",
15
+ "woff",
16
+ "woff2",
17
+ "ttf",
18
+ "otf",
19
+ "eot",
20
+ "mp4",
21
+ "webm",
22
+ "mp3",
23
+ "wav",
24
+ "pdf",
25
+ "txt",
26
+ "xml",
27
+ "json",
28
+ "wasm",
29
+ "map"
30
+ ];
31
+ function createManifestLoader() {
32
+ let cached = null;
33
+ return async (request, env) => {
34
+ if (cached) return cached;
35
+ const injected = globalThis.__VITE_MANIFEST__;
36
+ if (typeof injected === "object" && injected) {
37
+ cached = injected;
38
+ return cached;
39
+ }
40
+ const assets = env?.ASSETS;
41
+ if (!assets || typeof assets.fetch !== "function") return null;
42
+ const response = await assets.fetch(new Request(new URL("/.vite/manifest.json", request.url).toString()));
43
+ if (!response.ok) return null;
44
+ cached = await response.json();
45
+ return cached;
46
+ };
47
+ }
48
+ const BINDING_HINT_SCRIPT = "<script type=\"module\" src=\"/@id/virtual:void/binding-hint\"><\/script>";
49
+ const REACT_REFRESH_SCRIPT = `<script type="module">
50
+ import RefreshRuntime from "/@react-refresh";
51
+ RefreshRuntime.injectIntoGlobalHook(window);
52
+ window.$RefreshReg$ = () => {};
53
+ window.$RefreshSig$ = () => (type) => type;
54
+ window.__vite_plugin_react_preamble_installed__ = true;
55
+ <\/script>`;
56
+ const escapeAttribute = (value) => String(value).replace(/"/g, "&quot;");
57
+ const script = (url) => `<script type="module" src="${escapeAttribute(url)}"><\/script>`;
58
+ function collectManifestFiles(manifest, entryId, depthFirst) {
59
+ const seen = /* @__PURE__ */ new Set();
60
+ const pending = [entryId];
61
+ for (let index = 0; depthFirst ? pending.length > 0 : index < pending.length;) {
62
+ const id = depthFirst ? pending.pop() : pending[index++];
63
+ if (seen.has(id)) continue;
64
+ seen.add(id);
65
+ const imports = manifest[id]?.imports;
66
+ if (Array.isArray(imports)) pending.push(...imports);
67
+ }
68
+ return [...seen];
69
+ }
70
+ function collectRouteCss(manifest, roots) {
71
+ const css = /* @__PURE__ */ new Set();
72
+ const visited = /* @__PURE__ */ new Set();
73
+ const visit = (id) => {
74
+ if (visited.has(id)) return;
75
+ visited.add(id);
76
+ const chunk = manifest[id];
77
+ if (!chunk) return;
78
+ if (Array.isArray(chunk.css)) for (const file of chunk.css) css.add(file);
79
+ if (Array.isArray(chunk.imports)) for (const imported of chunk.imports) visit(imported);
80
+ };
81
+ for (const root of roots) visit(root);
82
+ return css;
83
+ }
84
+ /** Frameworks supply only client entry IDs and active layout/page roots. */
85
+ function createClientAssetTags(options, loadManifest = createManifestLoader()) {
86
+ return async (request, env, componentId = "") => {
87
+ const empty = {
88
+ css: "",
89
+ preloads: "",
90
+ body: ""
91
+ };
92
+ const manifest = await loadManifest(request, env);
93
+ if (!manifest || typeof manifest !== "object") {
94
+ if (!options.dev) return empty;
95
+ const preloads = [script("/@vite/client"), BINDING_HINT_SCRIPT];
96
+ if (options.kind === "ssr" && options.reactRefresh) preloads.push(REACT_REFRESH_SCRIPT);
97
+ let body = script(options.entryUrl);
98
+ if (options.extraEntryUrl) body += "\n" + script(options.extraEntryUrl);
99
+ const tags = {
100
+ css: "",
101
+ preloads: preloads.join("\n"),
102
+ body
103
+ };
104
+ if (options.devCss && options.kind !== "ssr") {
105
+ const css = await options.devCss(request, env, {
106
+ kind: options.kind,
107
+ componentId,
108
+ rootPhases: options.devRootPhases?.[componentId] || [[options.entryUrl]]
109
+ });
110
+ tags.devCss = Array.isArray(css) ? css : [];
111
+ }
112
+ return tags;
113
+ }
114
+ const entry = manifest[options.entryId];
115
+ if (!entry || typeof entry !== "object" || typeof entry.file !== "string") return empty;
116
+ const ids = collectManifestFiles(manifest, options.entryId, options.kind === "ssr");
117
+ const extraEntry = options.extraEntryId ? manifest[options.extraEntryId] : void 0;
118
+ const hasExtra = extraEntry && typeof extraEntry.file === "string";
119
+ if (hasExtra) ids.push(...collectManifestFiles(manifest, options.extraEntryId, false));
120
+ const css = options.kind === "ssr" ? /* @__PURE__ */ new Set() : collectRouteCss(manifest, [options.entryId, ...options.pageCssKeys?.[componentId] ?? []]);
121
+ if (hasExtra) for (const file of collectRouteCss(manifest, [options.extraEntryId])) css.add(file);
122
+ const preloads = /* @__PURE__ */ new Set();
123
+ for (const id of ids) {
124
+ const chunk = manifest[id];
125
+ if (!chunk || typeof chunk !== "object") continue;
126
+ if (options.kind === "ssr" && Array.isArray(chunk.css)) for (const file of chunk.css) css.add(file);
127
+ if (id !== options.entryId && id !== options.extraEntryId && typeof chunk.file === "string") preloads.add(chunk.file);
128
+ }
129
+ let body = script("/" + entry.file);
130
+ if (hasExtra) body += "\n" + script("/" + extraEntry.file);
131
+ return {
132
+ css: [...css].map((file) => `<link rel="stylesheet" href="/${escapeAttribute(file)}">`).join("\n"),
133
+ preloads: [...preloads].map((file) => `<link rel="modulepreload" href="/${escapeAttribute(file)}">`).join("\n"),
134
+ body
135
+ };
136
+ };
137
+ }
138
+ //#endregion
139
+ export { createClientAssetTags as n, createManifestLoader as r, ASSET_EXTENSIONS as t };
@@ -1,6 +1,6 @@
1
- import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
2
- import { t as collectMigrations } from "./collect-DiTn9yr6.mjs";
3
- import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-DXfiT1jV.mjs";
1
+ import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
2
+ import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
3
+ import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-BjYqR-So.mjs";
4
4
  import { r as classifyMigration } from "./plan-BhLO2p4w.mjs";
5
5
  import { existsSync, mkdirSync } from "node:fs";
6
6
  import { createHash, createHmac } from "node:crypto";
@@ -64,14 +64,8 @@ function getMiniflareDatabasePath(persistRoot, databaseId) {
64
64
  return join(persistRoot, "v3", "d1", uniqueKey, `${hash}.sqlite`);
65
65
  }
66
66
  /**
67
- * One-time migration: rename legacy `_migrations` table to `_void_migrations`.
68
- * Copies all rows from the old table to the new one, then drops the old table.
69
- *
70
- * Wrapped in an IMMEDIATE transaction + re-checked inside, so two concurrent
71
- * local runners (e.g. two `vite dev` processes against the same DB file)
72
- * don't race each other. Without the lock, both could observe `_migrations`
73
- * exists, both enter the body, and the loser crashes on `SELECT … FROM
74
- * _migrations` after the winner already dropped it.
67
+ * Move the legacy `_migrations` rows into `_void_migrations`. The check runs inside an
68
+ * IMMEDIATE transaction so two local runners cannot both copy and drop the old table.
75
69
  */
76
70
  function upgradeTrackingTable(db) {
77
71
  db.transaction(() => {
@@ -120,23 +114,8 @@ function assertLocalMigrationState(migrations, appliedNames, applicationTables)
120
114
  ].join("\n"));
121
115
  }
122
116
  /**
123
- * Apply unapplied SQL migrations from the migrations directory.
124
- * Tracks applied migrations in the `_void_migrations` table.
125
- *
126
- * Each .sql file is executed as a single `db.exec()` call — better-sqlite3's
127
- * `exec` natively handles multi-statement SQL and lets SQLite do the parsing,
128
- * so semicolons inside string literals, comments, or trigger bodies don't
129
- * fracture the migration. A naive `split(';')` pre-processor would misparse
130
- * a statement like `CREATE TABLE t (msg TEXT DEFAULT 'a;b')` into garbage
131
- * fragments.
132
- *
133
- * Concurrent-runner safety: two local `void` processes can race against the
134
- * same SQLite file. Both can snapshot the applied-set before either writes,
135
- * and if both decide a migration is pending, the loser would crash on a
136
- * `table already exists` error. Each per-migration apply therefore runs
137
- * inside an IMMEDIATE transaction that re-checks the tracking row under the
138
- * SQLite write lock — the loser sees the winner's insert and skips, instead
139
- * of re-running the DDL.
117
+ * Apply pending SQL migrations and record them in `_void_migrations`.
118
+ * Each file runs through one `exec` so SQLite parses multi-statement SQL itself.
140
119
  */
141
120
  async function runMigrations(migrationsDir, dbPath) {
142
121
  const allMigrations = collectMigrations(migrationsDir);
@@ -159,12 +138,21 @@ async function runMigrations(migrationsDir, dbPath) {
159
138
  const insertStmt = db.prepare("INSERT INTO _void_migrations (name) VALUES (?)");
160
139
  const checkStmt = db.prepare("SELECT 1 FROM _void_migrations WHERE name = ?");
161
140
  const appliedNames = [];
162
- for (const migration of pending) if (db.transaction(() => {
163
- if (checkStmt.get(migration.name)) return false;
164
- db.exec(migration.sql);
165
- insertStmt.run(migration.name);
166
- return true;
167
- }).immediate()) appliedNames.push(migration.name);
141
+ for (const migration of pending) {
142
+ const tx = db.transaction(() => {
143
+ if (checkStmt.get(migration.name)) return false;
144
+ db.exec(migration.sql);
145
+ insertStmt.run(migration.name);
146
+ return true;
147
+ });
148
+ let applied;
149
+ try {
150
+ applied = tx.immediate();
151
+ } catch (err) {
152
+ throw new Error(`migration ${migration.name} failed: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
153
+ }
154
+ if (applied) appliedNames.push(migration.name);
155
+ }
168
156
  return appliedNames;
169
157
  } finally {
170
158
  db.close();
@@ -0,0 +1 @@
1
+ export { t as getApplicationTables, n as getAppliedMigrations, r as getMiniflareDatabasePath, i as openSqliteDatabase, a as runMigrations } from "./runner-CabsQ-iM.mjs";
@@ -0,0 +1,146 @@
1
+ import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
2
+ import { a as mySqlMigrationLockError, o as mySqlMigrationLockName, s as readMySqlMigrationLease, t as splitMySqlMigrationSql } from "./mysql-migration-sql-BIS5vbNk.mjs";
3
+ //#region src/migrations/runner-mysql.ts
4
+ async function readMySqlAppliedMigrations(client) {
5
+ try {
6
+ return (await client.query("SELECT `name` FROM `_void_migrations`")).map((row) => String(row.name));
7
+ } catch (error) {
8
+ const value = typeof error === "object" && error !== null ? error : void 0;
9
+ if (value?.code === "ER_NO_SUCH_TABLE" || value?.errno === 1146) return [];
10
+ throw error;
11
+ }
12
+ }
13
+ function toMySqlClient(connection) {
14
+ return { async query(sql, params) {
15
+ const [rows] = await connection.query(sql, params);
16
+ return Array.isArray(rows) ? rows : [];
17
+ } };
18
+ }
19
+ async function getMySqlAppliedMigrations(url) {
20
+ const { createConnection } = await import("mysql2/promise");
21
+ const connection = await createConnection(url);
22
+ try {
23
+ return await readMySqlAppliedMigrations(toMySqlClient(connection));
24
+ } finally {
25
+ await connection.end();
26
+ }
27
+ }
28
+ const MIGRATION_LOCK_TIMEOUT_SECONDS = 10;
29
+ /**
30
+ * Take a named lock so two runs on one database cannot both apply a pending file. The lock
31
+ * survives the commits MySQL makes for DDL and ends with the session. A deploy cannot hold a
32
+ * session lock and writes a lease row instead, so this also waits for that lease.
33
+ */
34
+ async function acquireMySqlMigrationLock(client) {
35
+ const [row] = await client.query("SELECT DATABASE() AS db");
36
+ const database = row?.db ?? "";
37
+ const name = mySqlMigrationLockName(database);
38
+ const [lock] = await client.query("SELECT GET_LOCK(?, ?) AS acquired", [name, MIGRATION_LOCK_TIMEOUT_SECONDS]);
39
+ if (Number(Object.values(lock ?? {})[0]) !== 1) throw mySqlMigrationLockError(database, "run the command again");
40
+ const readLease = () => readMySqlMigrationLease((sql, params) => client.query(sql, params));
41
+ const deadline = Date.now() + MIGRATION_LOCK_TIMEOUT_SECONDS * 1e3;
42
+ let remaining = await readLease();
43
+ while (remaining !== void 0 && Date.now() < deadline) {
44
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
45
+ remaining = await readLease();
46
+ }
47
+ if (remaining !== void 0) {
48
+ await client.query("SELECT RELEASE_LOCK(?)", [name]).catch(() => {});
49
+ throw new Error(`A deploy is applying migrations to MySQL database "${database}". Wait for it to finish, then run the command again. If that deploy stopped, its lock expires in ${remaining} seconds.`);
50
+ }
51
+ return name;
52
+ }
53
+ /**
54
+ * A DDL statement makes MySQL commit and close the open transaction. A savepoint can only be
55
+ * rolled back to inside a transaction, so this tells whether the file's changes can still be undone.
56
+ */
57
+ async function isTransactionOpen(client) {
58
+ try {
59
+ await client.query("SAVEPOINT `void_migration`");
60
+ await client.query("ROLLBACK TO SAVEPOINT `void_migration`");
61
+ return true;
62
+ } catch {
63
+ return false;
64
+ }
65
+ }
66
+ const ROLLED_BACK_BY_SERVER_ERRNOS = /* @__PURE__ */ new Set([1213, 3101]);
67
+ function isRolledBackByServer(error) {
68
+ const errno = typeof error === "object" && error !== null ? error.errno : void 0;
69
+ return typeof errno === "number" && ROLLED_BACK_BY_SERVER_ERRNOS.has(errno);
70
+ }
71
+ function mySqlMigrationError(name, error, committed) {
72
+ const lines = [`migration ${name} failed: ${error instanceof Error ? error.message : String(error)}`];
73
+ if (committed) lines.push(`MySQL commits schema changes immediately, so earlier statements in ${name} may already be applied. Undo them, fix the file, then run the command again.`, "See https://void.cloud/guide/database/mysql#failed-migrations");
74
+ return new Error(lines.join("\n"), { cause: error });
75
+ }
76
+ /**
77
+ * Runs `work` while this session holds the database's migration lock, so no other migration run,
78
+ * deploy or reset changes the schema meanwhile.
79
+ */
80
+ async function withMySqlMigrationLock(client, work) {
81
+ const lock = await acquireMySqlMigrationLock(client);
82
+ try {
83
+ return await work();
84
+ } finally {
85
+ await client.query("SELECT RELEASE_LOCK(?)", [lock]).catch(() => {});
86
+ }
87
+ }
88
+ async function applyMySqlMigrations(client, migrations) {
89
+ if (migrations.length === 0) return [];
90
+ return withMySqlMigrationLock(client, () => applyPendingMySqlMigrations(client, migrations));
91
+ }
92
+ /** Applies the files not yet recorded. The caller holds the migration lock. */
93
+ async function applyPendingMySqlMigrations(client, migrations) {
94
+ if (migrations.length === 0) return [];
95
+ await client.query("CREATE TABLE IF NOT EXISTS `_void_migrations` (`name` VARCHAR(255) PRIMARY KEY, `applied_at` VARCHAR(64) NOT NULL)");
96
+ const existing = await client.query("SELECT `name` FROM `_void_migrations`");
97
+ const appliedSet = new Set(existing.map((row) => String(row.name)));
98
+ const pending = migrations.filter((migration) => !appliedSet.has(migration.name));
99
+ for (const migration of pending) {
100
+ let ran = 0;
101
+ await client.query("BEGIN");
102
+ try {
103
+ for (const statement of splitMySqlMigrationSql(migration.sql)) {
104
+ await client.query(statement);
105
+ ran++;
106
+ }
107
+ await client.query("INSERT INTO `_void_migrations` (`name`, `applied_at`) VALUES (?, ?)", [migration.name, (/* @__PURE__ */ new Date()).toISOString()]);
108
+ await client.query("COMMIT");
109
+ } catch (error) {
110
+ const committed = ran > 0 && !isRolledBackByServer(error) && !await isTransactionOpen(client);
111
+ await client.query("ROLLBACK").catch(() => {});
112
+ throw mySqlMigrationError(migration.name, error, committed);
113
+ }
114
+ }
115
+ return pending.map((migration) => migration.name);
116
+ }
117
+ /** Connects to `url` and runs `work` while holding that database's migration lock. */
118
+ async function withMySqlMigrationLockAt(url, work) {
119
+ const { createConnection } = await import("mysql2/promise");
120
+ const connection = await createConnection({
121
+ uri: url,
122
+ multipleStatements: true
123
+ });
124
+ try {
125
+ const client = toMySqlClient(connection);
126
+ return await withMySqlMigrationLock(client, () => work(client));
127
+ } finally {
128
+ await connection.end();
129
+ }
130
+ }
131
+ /**
132
+ * Applies the pending files in `migrationsDir`. `afterApply` gets the applied names and runs before
133
+ * the lock is released, so the schema changes it makes (Better Auth's tables) do not overlap
134
+ * another run either.
135
+ */
136
+ async function runMySqlMigrations(migrationsDir, url, afterApply) {
137
+ const migrations = collectMigrations(migrationsDir);
138
+ if (migrations.length === 0 && !afterApply) return [];
139
+ return withMySqlMigrationLockAt(url, async (client) => {
140
+ const applied = await applyPendingMySqlMigrations(client, migrations);
141
+ await afterApply?.(applied);
142
+ return applied;
143
+ });
144
+ }
145
+ //#endregion
146
+ export { runMySqlMigrations as a, withMySqlMigrationLockAt as c, readMySqlAppliedMigrations as i, applyPendingMySqlMigrations as n, toMySqlClient as o, getMySqlAppliedMigrations as r, withMySqlMigrationLock as s, applyMySqlMigrations as t };
@@ -0,0 +1 @@
1
+ export { t as applyMySqlMigrations, n as applyPendingMySqlMigrations, r as getMySqlAppliedMigrations, i as readMySqlAppliedMigrations, a as runMySqlMigrations, o as toMySqlClient, s as withMySqlMigrationLock, c as withMySqlMigrationLockAt } from "./runner-mysql-BhRaONkO.mjs";
@@ -1,4 +1,4 @@
1
- import { t as collectMigrations } from "./collect-DiTn9yr6.mjs";
1
+ import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
2
2
  //#region src/migrations/runner-pg.ts
3
3
  async function readPgAppliedMigrations(client) {
4
4
  try {
@@ -36,8 +36,8 @@ async function applyPgMigrations(client, migrations) {
36
36
  await client.query("INSERT INTO _void_migrations (name, applied_at) VALUES ($1, $2)", [m.name, (/* @__PURE__ */ new Date()).toISOString()]);
37
37
  await client.query("COMMIT");
38
38
  } catch (err) {
39
- await client.query("ROLLBACK");
40
- throw err;
39
+ await client.query("ROLLBACK").catch(() => {});
40
+ throw new Error(`migration ${m.name} failed: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
41
41
  }
42
42
  }
43
43
  return pending.map((m) => m.name);
@@ -0,0 +1 @@
1
+ export { t as applyPgMigrations, n as getPgAppliedMigrations, r as readPgAppliedMigrations, i as runPgMigrations } from "./runner-pg-BRemq_GX.mjs";