void 0.10.13 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/AGENTS_TEMPLATE.md +6 -0
  2. package/{skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md → LICENSE} +1 -1
  3. package/README.md +34 -8
  4. package/dist/{auth-qgMlYp7Z.d.mts → auth-DkcFflXV.d.mts} +10 -11
  5. package/dist/auth-W9WII-mN.mjs +630 -0
  6. package/dist/{auth-cmd-BqsdZJp5.mjs → auth-cmd-CYVhSNFy.mjs} +4 -3
  7. package/dist/{auth-migrations-BTZ-ATvQ.mjs → auth-migrations-9vif1uj8.mjs} +53 -12
  8. package/dist/{better-auth-shared-BQooDxbw.mjs → better-auth-shared-CYw1T3k4.mjs} +7 -10
  9. package/dist/{better-auth-shared-DealXecJ.d.mts → better-auth-shared-DSCeohOK.d.mts} +10 -5
  10. package/dist/{build-cmd-Bujrv5q-.mjs → build-cmd-CkVD1uOh.mjs} +6 -4
  11. package/dist/{cache-C11V8Fxq.mjs → cache-QcUfR-ff.mjs} +9 -5
  12. package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-DsvWKFTe.mjs} +3 -2
  13. package/dist/cf-access-AJ1ehiFR.mjs +42 -0
  14. package/dist/cf-access-DsSsZUPr.mjs +67 -0
  15. package/dist/cli/cli.d.mts +1 -1
  16. package/dist/cli/cli.mjs +1592 -153
  17. package/dist/cli/env-schema-probe.d.mts +48 -61
  18. package/dist/cli/env-schema-probe.mjs +10 -58
  19. package/dist/{client-Gb71-XkG.mjs → client-CyCHWSO_.mjs} +61 -463
  20. package/dist/cloudflare-auth-DRkGe7-s.mjs +170 -0
  21. package/dist/cloudflare-cmd-D3ME2GAe.mjs +62 -0
  22. package/dist/cloudflare-connect-BivMefMA.mjs +56 -0
  23. package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
  24. package/dist/{config-qHGgPuWT.mjs → config-BQFq7QvD.mjs} +75 -41
  25. package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
  26. package/dist/connect-D9Yr-T5f.mjs +79 -0
  27. package/dist/{create-project-DsYvl3TB.mjs → create-project-DMV-csEm.mjs} +26 -16
  28. package/dist/database-provider.d.mts +21 -0
  29. package/dist/database-provider.mjs +6 -0
  30. package/dist/{db-C0i0sYMS.mjs → db-BxoUWL0F.mjs} +600 -115
  31. package/dist/{delete-mh6p-zkQ.mjs → delete-iJOqxBz1.mjs} +9 -6
  32. package/dist/{deploy-jBJT1fUT.mjs → deploy-CcDoeBIf.mjs} +3249 -1990
  33. package/dist/dev-inbox-DkgRWLkW.mjs +307 -0
  34. package/dist/{discover-CJHyvYfR.mjs → discover-xvfrgJeo.mjs} +3 -3
  35. package/dist/{magic-string.es-ZQjdJFFn.mjs → dist-BR1quN_w.mjs} +570 -216
  36. package/dist/{dist-DaKKDf8D.mjs → dist-BrsS7cai.mjs} +17 -2
  37. package/dist/{dist-BuiRJkTd.mjs → dist-m40_XgNh.mjs} +48 -33
  38. package/dist/{domain-DiaNQbrl.mjs → domain-gu_iaHmn.mjs} +41 -4
  39. package/dist/dotenv-VQxupEUv.mjs +181 -0
  40. package/dist/edge.d.mts +2 -0
  41. package/dist/edge.mjs +2 -0
  42. package/dist/email-Ce6SQq-i.mjs +182 -0
  43. package/dist/email-r6DHJyAB.mjs +262 -0
  44. package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
  45. package/dist/env-D4Emu-M_.mjs +95 -0
  46. package/dist/env-DmU2To0C.mjs +73 -0
  47. package/dist/env-helpers-CyKtOBpj.d.mts +22 -0
  48. package/dist/env-public-D_6u46fX.d.mts +135 -0
  49. package/dist/{env-types-QBj-ndax.mjs → env-types-BNPhro-M.mjs} +2 -2
  50. package/dist/{env-validation-Dea3v3ej.mjs → env-validation-ENpMy6Ez.mjs} +68 -122
  51. package/dist/{gen-BzXf3Jh2.mjs → gen-BKw6qHIg.mjs} +70 -15
  52. package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-DJS5Ab-H.mjs} +39 -31
  53. package/dist/{handler-Cjh8uM3Y.d.mts → handler-D1hLsObx.d.mts} +124 -122
  54. package/dist/{head-nmvOgFjd.d.mts → head-Do8P4puT.d.mts} +9 -8
  55. package/dist/{headers-ChAADPQu.mjs → headers-D8QfRX9Y.mjs} +12 -10
  56. package/dist/inbound-BJ70in1n.d.mts +354 -0
  57. package/dist/inbound-CNKxb3FY.mjs +694 -0
  58. package/dist/index.d.mts +61 -34
  59. package/dist/index.mjs +1010 -293
  60. package/dist/{init-7JCAcKNQ.mjs → init-Dx5cgKqK.mjs} +329 -271
  61. package/dist/link-D_rm5sRH.mjs +52 -0
  62. package/dist/{list-CPwFDZ_c.mjs → list-M8XShti7.mjs} +37 -5
  63. package/dist/{runner-kapo9aPs.mjs → local-d1-BE8KBbMy.mjs} +116 -6
  64. package/dist/{login-BT3H8PN3.mjs → login-C8-UuLnp.mjs} +17 -15
  65. package/dist/{logs-Bt313ax7.mjs → logs-DwFU7dMW.mjs} +16 -2
  66. package/dist/mime-BJD7d_qL.mjs +1216 -0
  67. package/dist/neon-DHwd2zvC.mjs +54 -0
  68. package/dist/{node-pRg81HqV.mjs → node-BkaXcpAc.mjs} +29 -8
  69. package/dist/operator-cmd-DYWRbWUA.mjs +348 -0
  70. package/dist/{agents-CtgBYqld.mjs → output-tFQLLj26.mjs} +676 -211
  71. package/dist/{package-json-Cx1osYo6.mjs → package-json-CPoWX79C.mjs} +1 -1
  72. package/dist/pages/client.d.mts +43 -41
  73. package/dist/pages/client.mjs +40 -33
  74. package/dist/pages/head-client.d.mts +10 -12
  75. package/dist/pages/head.d.mts +1 -1
  76. package/dist/pages/index.d.mts +37 -14
  77. package/dist/pages/index.mjs +5 -5
  78. package/dist/pages/islands-plugin.d.mts +25 -27
  79. package/dist/pages/islands-plugin.mjs +6 -4
  80. package/dist/pages/prefetch.d.mts +6 -7
  81. package/dist/pages/protocol.d.mts +2 -2
  82. package/dist/pages/protocol.mjs +2 -1
  83. package/dist/pages/serialize.d.mts +7 -8
  84. package/dist/platform-cmd-BEOVv1PN.mjs +123 -0
  85. package/dist/platform-domain-BszUfiS8.mjs +228 -0
  86. package/dist/platform-lifecycle-CjSr6xf0.mjs +4450 -0
  87. package/dist/platform-management-W30iCaTL.mjs +698 -0
  88. package/dist/platform-recovery-pHHv4ZSg.mjs +99 -0
  89. package/dist/{plugin-inference-DMeavIJ6.mjs → plugin-inference-BDRfZngg.mjs} +35 -19
  90. package/dist/prepare-BfJvFUtJ.mjs +14 -0
  91. package/dist/{prepare-BvvgAz-3.mjs → prepare-CBetXvsN.mjs} +15 -24
  92. package/dist/{preset-BjyR3lzz.mjs → preset-lAy0B0BQ.mjs} +25 -212
  93. package/dist/{project-cmd-D_w-4w5B.mjs → project-cmd-DCpk1cDt.mjs} +25 -12
  94. package/dist/{project-paths-BQd7OmIo.mjs → project-paths-SK8nMHPp.mjs} +3 -1
  95. package/dist/{project-tsconfig-B-QtXjLQ.mjs → project-tsconfig-Ql2XsSQp.mjs} +2 -2
  96. package/dist/{protocol-Bnb0LFp3.d.mts → protocol-C-pqYJjE.d.mts} +3 -4
  97. package/dist/{provision-CPx2ZxsH.mjs → provision-Blnstcm2.mjs} +78 -45
  98. package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
  99. package/dist/{requests-B8sZxaFM.mjs → requests-Dn8Vheh1.mjs} +5 -3
  100. package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
  101. package/dist/rollback-CtlPXEBi.mjs +166 -0
  102. package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
  103. package/dist/{route-types-z1jtHEi_.mjs → route-types-Da-DpyUp.mjs} +77 -25
  104. package/dist/routes-stub.d.mts +22 -23
  105. package/dist/runner-mysql-CgRFl3s6.mjs +61 -0
  106. package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-DCkWPsWS.mjs} +18 -6
  107. package/dist/runtime/ai.d.mts +21 -14
  108. package/dist/runtime/ai.mjs +5 -4
  109. package/dist/runtime/auth-client-react.d.mts +3 -5
  110. package/dist/runtime/auth-client-solid.d.mts +3 -5
  111. package/dist/runtime/auth-client-svelte.d.mts +3 -5
  112. package/dist/runtime/auth-client-vue.d.mts +3 -5
  113. package/dist/runtime/auth-client.d.mts +3 -5
  114. package/dist/runtime/auth.d.mts +1 -1
  115. package/dist/runtime/better-auth-mysql.d.mts +10 -0
  116. package/dist/runtime/better-auth-mysql.mjs +49 -0
  117. package/dist/runtime/better-auth-pg.d.mts +8 -9
  118. package/dist/runtime/better-auth-pg.mjs +2 -2
  119. package/dist/runtime/better-auth.d.mts +8 -9
  120. package/dist/runtime/better-auth.mjs +2 -2
  121. package/dist/runtime/client-react.d.mts +1 -1
  122. package/dist/runtime/client-solid.d.mts +1 -1
  123. package/dist/runtime/client-svelte.d.mts +1 -1
  124. package/dist/runtime/client-vue.d.mts +1 -1
  125. package/dist/runtime/client.d.mts +1 -1
  126. package/dist/runtime/db-mysql.d.mts +2 -0
  127. package/dist/runtime/db-mysql.mjs +1 -0
  128. package/dist/runtime/db.d.mts +10 -11
  129. package/dist/runtime/durable.d.mts +47 -0
  130. package/dist/runtime/durable.mjs +146 -0
  131. package/dist/runtime/email/testing.d.mts +112 -0
  132. package/dist/runtime/email/testing.mjs +283 -0
  133. package/dist/runtime/email.d.mts +30 -0
  134. package/dist/runtime/email.mjs +573 -0
  135. package/dist/runtime/env-helpers.d.mts +2 -2
  136. package/dist/runtime/env-helpers.mjs +5 -42
  137. package/dist/runtime/env-public-client.d.mts +10 -11
  138. package/dist/runtime/env-public-client.mjs +1 -1
  139. package/dist/runtime/env-public.d.mts +2 -2
  140. package/dist/runtime/env-public.mjs +104 -49
  141. package/dist/runtime/env.d.mts +19 -18
  142. package/dist/runtime/env.mjs +15 -2
  143. package/dist/runtime/fetch-stream.d.mts +20 -21
  144. package/dist/runtime/fetch.d.mts +15 -16
  145. package/dist/runtime/handler.d.mts +1 -1
  146. package/dist/runtime/isr.d.mts +21 -22
  147. package/dist/runtime/isr.mjs +26 -8
  148. package/dist/runtime/kv.d.mts +9 -10
  149. package/dist/runtime/live-client.d.mts +5 -7
  150. package/dist/runtime/live-client.mjs +9 -7
  151. package/dist/runtime/live-server.d.mts +4 -5
  152. package/dist/runtime/live.d.mts +22 -24
  153. package/dist/runtime/live.mjs +1 -1
  154. package/dist/runtime/log.d.mts +16 -17
  155. package/dist/runtime/migration-handler-mysql.d.mts +4 -0
  156. package/dist/runtime/migration-handler-mysql.mjs +81 -0
  157. package/dist/runtime/migration-handler-pg.d.mts +2 -4
  158. package/dist/runtime/migration-handler.d.mts +5 -6
  159. package/dist/runtime/migration-handler.mjs +4 -3
  160. package/dist/runtime/queues.d.mts +3 -4
  161. package/dist/runtime/queues.mjs +2 -1
  162. package/dist/runtime/remote/binding-handler.d.mts +10 -12
  163. package/dist/runtime/remote/binding-handler.mjs +24 -3
  164. package/dist/runtime/remote/index.d.mts +5 -6
  165. package/dist/runtime/remote/index.mjs +21 -18
  166. package/dist/runtime/response.d.mts +10 -11
  167. package/dist/runtime/sandbox.d.mts +56 -55
  168. package/dist/runtime/sandbox.mjs +57 -49
  169. package/dist/runtime/schema-mysql.d.mts +1 -0
  170. package/dist/runtime/schema-mysql.mjs +2 -0
  171. package/dist/runtime/seed.d.mts +14 -9
  172. package/dist/runtime/sse-client.d.mts +6 -7
  173. package/dist/runtime/sse.d.mts +11 -12
  174. package/dist/runtime/storage.d.mts +3 -4
  175. package/dist/runtime/validator.d.mts +1 -1
  176. package/dist/runtime/ws-server.d.mts +12 -12
  177. package/dist/runtime/ws-server.mjs +32 -4
  178. package/dist/runtime/ws.d.mts +19 -21
  179. package/dist/{scan-ChWt4pX1.mjs → scan-BMH4rzlv.mjs} +42 -19
  180. package/dist/{scan-NU4xKGci.mjs → scan-CpK-57ug.mjs} +5 -4
  181. package/dist/{secret-Dt32J6RI.mjs → secret-BqTxGqki.mjs} +62 -5
  182. package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
  183. package/dist/{standard-schema-DJ0HW7QP.d.mts → standard-schema-Fo_vCAZh.d.mts} +6 -6
  184. package/dist/{subcommand-prompt-BzV8iQZo.mjs → subcommand-prompt-WfySCQ7S.mjs} +67 -48
  185. package/dist/sveltekit.d.mts +12 -11
  186. package/dist/sveltekit.mjs +1 -1
  187. package/dist/types-BAp5AEBU.d.mts +79 -0
  188. package/dist/types-CKWnYgfy.d.mts +1 -0
  189. package/dist/{validate-Cw_RLeTj.mjs → validate-Bihr8WBi.mjs} +3 -3
  190. package/dist/wrangler--imS8n0d.mjs +1796 -0
  191. package/dist/{yarn-pnp-DJn3SAHF.mjs → yarn-pnp-DxSInkzL.mjs} +1 -1
  192. package/package.json +79 -65
  193. package/schema.json +22 -3
  194. package/skills/void/SKILL.md +59 -2
  195. package/skills/void/docs/guide/ai.md +32 -14
  196. package/skills/void/docs/guide/app-types.md +6 -6
  197. package/skills/void/docs/guide/auth.md +14 -16
  198. package/skills/void/docs/guide/database/d1.md +6 -0
  199. package/skills/void/docs/guide/database/mysql.md +60 -0
  200. package/skills/void/docs/guide/database/postgresql.md +14 -9
  201. package/skills/void/docs/guide/database.md +39 -26
  202. package/skills/void/docs/guide/deployment.md +99 -25
  203. package/skills/void/docs/guide/durable-state.md +140 -0
  204. package/skills/void/docs/guide/edge/headers.md +5 -5
  205. package/skills/void/docs/guide/edge/prerendering.md +2 -0
  206. package/skills/void/docs/guide/edge/revalidation.md +21 -6
  207. package/skills/void/docs/guide/edge/rewrites.md +18 -14
  208. package/skills/void/docs/guide/edge/static-assets.md +12 -10
  209. package/skills/void/docs/guide/email.md +609 -0
  210. package/skills/void/docs/guide/env-migration.md +109 -0
  211. package/skills/void/docs/guide/env-vars.md +70 -248
  212. package/skills/void/docs/guide/index.md +15 -17
  213. package/skills/void/docs/guide/jobs.md +8 -5
  214. package/skills/void/docs/guide/live.md +7 -15
  215. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +8 -4
  216. package/skills/void/docs/guide/pages-routing/islands.md +3 -3
  217. package/skills/void/docs/guide/pages-routing/loaders.md +6 -4
  218. package/skills/void/docs/guide/pages-routing/overview.md +7 -7
  219. package/skills/void/docs/guide/platform-administration.md +212 -0
  220. package/skills/void/docs/guide/platform-development.md +235 -0
  221. package/skills/void/docs/guide/queues.md +10 -10
  222. package/skills/void/docs/guide/quickstart.md +46 -67
  223. package/skills/void/docs/guide/remote-dev.md +8 -6
  224. package/skills/void/docs/guide/sandboxes.md +33 -16
  225. package/skills/void/docs/guide/self-hosted-platform.md +553 -0
  226. package/skills/void/docs/guide/server-routing.md +5 -5
  227. package/skills/void/docs/guide/sse.md +4 -4
  228. package/skills/void/docs/guide/ssg.md +5 -3
  229. package/skills/void/docs/guide/storage.md +2 -2
  230. package/skills/void/docs/guide/websockets.md +15 -7
  231. package/skills/void/docs/index.md +3 -3
  232. package/skills/void/docs/integrations/agents.md +6 -64
  233. package/skills/void/docs/integrations/cloudflare.md +165 -146
  234. package/skills/void/docs/integrations/frameworks/analog.md +4 -4
  235. package/skills/void/docs/integrations/frameworks/astro.md +5 -5
  236. package/skills/void/docs/integrations/frameworks/nuxt.md +5 -5
  237. package/skills/void/docs/integrations/frameworks/overview.md +3 -3
  238. package/skills/void/docs/integrations/frameworks/react-router.md +3 -3
  239. package/skills/void/docs/integrations/frameworks/sveltekit.md +3 -3
  240. package/skills/void/docs/integrations/frameworks/tanstack-start.md +2 -2
  241. package/skills/void/docs/integrations/nodejs-bun-deno.md +11 -4
  242. package/skills/void/docs/reference/api.md +42 -6
  243. package/skills/void/docs/reference/cli.md +614 -160
  244. package/skills/void/docs/reference/config.md +67 -27
  245. package/skills/void/docs/reference/resource-inference.md +13 -9
  246. package/skills/void/docs/reference/structure.md +9 -11
  247. package/AGENT_PROMPT.md +0 -19
  248. package/dist/cf-access-Bqw81xAf.mjs +0 -22
  249. package/dist/env-CZy5MorI.mjs +0 -299
  250. package/dist/env-helpers-z4stu8uc.d.mts +0 -52
  251. package/dist/env-mask-Dd47NbR6.mjs +0 -90
  252. package/dist/env-public-BfiLcMBk.d.mts +0 -140
  253. package/dist/link-CdGHSIy-.mjs +0 -45
  254. package/dist/mcp-DoM3_nhd.mjs +0 -377
  255. package/dist/project-paths-GpziKeQQ.d.mts +0 -25
  256. package/dist/providers-BNKRacMr.d.mts +0 -7
  257. package/dist/proxy-D-3_D-Gl.mjs +0 -5
  258. package/dist/rollback-CkvTFXx5.mjs +0 -90
  259. package/dist/runtime/isr-cache.d.mts +0 -207
  260. package/dist/runtime/isr-cache.mjs +0 -523
  261. package/dist/types-lLjNE9Qp.d.mts +0 -51
  262. package/getting-started-prompt.txt +0 -28
  263. package/skills/void/command/void.md +0 -7
  264. package/skills/void/docs/integrations/auth-providers.md +0 -0
  265. package/skills/void/docs/integrations/payment-processors.md +0 -0
  266. package/skills/void/docs/node_modules/@iconify/vue/README.md +0 -408
  267. package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +0 -5
  268. package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +0 -103
  269. package/skills/void/docs/node_modules/oxc-minify/README.md +0 -78
  270. package/skills/void/docs/node_modules/reka-ui/README.md +0 -80
  271. package/skills/void/docs/node_modules/vitepress/README.md +0 -28
  272. package/skills/void/docs/node_modules/vitepress/template/api-examples.md +0 -49
  273. package/skills/void/docs/node_modules/vitepress/template/index.md +0 -28
  274. package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +0 -85
  275. package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +0 -101
  276. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +0 -19
  277. package/skills/void/docs/node_modules/void/CLAUDE.md +0 -221
  278. package/skills/void/docs/node_modules/void/README.md +0 -90
  279. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +0 -685
  280. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +0 -396
  281. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +0 -219
  282. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +0 -37
  283. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +0 -135
  284. package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +0 -189
  285. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +0 -143
  286. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +0 -1272
  287. package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +0 -19
  288. package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +0 -15
  289. package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +0 -15
  290. package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +0 -15
  291. package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +0 -51
  292. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +0 -22
  293. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +0 -69
  294. package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +0 -153
  295. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +0 -9
  296. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +0 -9
  297. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +0 -15
  298. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +0 -24
  299. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +0 -565
  300. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +0 -127
  301. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +0 -600
  302. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +0 -386
  303. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +0 -95
  304. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +0 -101
  305. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-footnote/README.md +0 -135
  306. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +0 -64
  307. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +0 -15
  308. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +0 -25
  309. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +0 -16
  310. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +0 -220
  311. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +0 -21
  312. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +0 -35
  313. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +0 -70
  314. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +0 -20
  315. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +0 -35
  316. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +0 -26
  317. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +0 -17
  318. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +0 -364
  319. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +0 -15
  320. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +0 -18
  321. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
  322. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +0 -40
  323. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +0 -107
  324. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +0 -60
  325. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +0 -62
  326. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
  327. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +0 -341
  328. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +0 -24
  329. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +0 -175
  330. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +0 -167
  331. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +0 -41
  332. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
  333. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
  334. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +0 -23
  335. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +0 -134
  336. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +0 -199
  337. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +0 -50
  338. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
  339. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +0 -197
  340. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
  341. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +0 -69
  342. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +0 -356
  343. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +0 -35
  344. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
  345. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
  346. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +0 -66
  347. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +0 -39
  348. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +0 -12
  349. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +0 -35
  350. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +0 -35
  351. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +0 -29
  352. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +0 -58
  353. package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +0 -165
  354. package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +0 -20
  355. package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +0 -32
  356. package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +0 -99
  357. package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +0 -108
  358. package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +0 -51
  359. package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +0 -79
  360. package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +0 -44
  361. package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +0 -51
  362. package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +0 -65
  363. package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +0 -403
  364. package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +0 -48
  365. package/skills/void/docs/node_modules/void/node_modules/hono/README.md +0 -85
  366. package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +0 -452
  367. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +0 -76
  368. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md +0 -21
  369. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +0 -364
  370. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +0 -41
  371. package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +0 -325
  372. package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +0 -398
  373. package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +0 -64
  374. package/skills/void/docs/node_modules/void/node_modules/pg/README.md +0 -96
  375. package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +0 -135
  376. package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +0 -21
  377. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +0 -108
  378. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +0 -183
  379. package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +0 -25
  380. package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +0 -9
  381. package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +0 -94
  382. package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +0 -16
  383. package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +0 -220
  384. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +0 -21
  385. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +0 -35
  386. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +0 -70
  387. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +0 -20
  388. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +0 -35
  389. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +0 -26
  390. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +0 -17
  391. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +0 -364
  392. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +0 -15
  393. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +0 -18
  394. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
  395. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +0 -40
  396. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +0 -107
  397. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +0 -60
  398. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +0 -62
  399. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
  400. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +0 -341
  401. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +0 -24
  402. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +0 -175
  403. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +0 -167
  404. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +0 -41
  405. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
  406. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
  407. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +0 -23
  408. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +0 -134
  409. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +0 -199
  410. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +0 -50
  411. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
  412. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +0 -197
  413. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
  414. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +0 -69
  415. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +0 -356
  416. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +0 -35
  417. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
  418. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
  419. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +0 -66
  420. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +0 -39
  421. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +0 -12
  422. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +0 -35
  423. package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +0 -35
  424. package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +0 -29
  425. package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +0 -63
  426. package/skills/void/docs/node_modules/void/node_modules/zod/README.md +0 -191
  427. package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +0 -175
  428. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +0 -76
  429. package/skills/void/docs/node_modules/void/skills/void/command/void.md +0 -7
  430. package/skills/void/docs/node_modules/void/test/e2e/README.md +0 -85
@@ -0,0 +1,166 @@
1
+ import { C as cancel, D as log, E as intro, F as isCancel, a as dim, c as import_picocolors, i as createSpinner, j as select, k as outro, o as ensureUtc, r as cliTitle, w as confirm } from "./output-tFQLLj26.mjs";
2
+ import { b as readDeploymentPlatform, c as getToken, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
3
+ import { n as PlatformClient } from "./client-CyCHWSO_.mjs";
4
+ //#region src/cli/rollback.ts
5
+ async function runRollbackCommand(root, deployId) {
6
+ console.log();
7
+ intro(cliTitle("project rollback"));
8
+ const platform = readDeploymentPlatform(root);
9
+ if (platform === "cloudflare") return runCloudflareRollback(root, deployId);
10
+ if (platform === "none") throw new Error("rollback: Deployment is disabled. Run `void init` to choose a platform.");
11
+ const token = getToken(root);
12
+ if (!token) {
13
+ log.error("Not logged in. Run `void auth login` first.");
14
+ process.exit(1);
15
+ }
16
+ const linked = readProjectConfig(root);
17
+ if (!linked) {
18
+ log.error("No linked project. Run `void project link` first.");
19
+ process.exit(1);
20
+ }
21
+ const client = new PlatformClient(token, { root });
22
+ const { deployments, activeDeploymentId } = await client.listDeployments(linked.projectId);
23
+ const candidates = deployments.filter((d) => d.retained && d.status === "live" && d.id !== activeDeploymentId);
24
+ if (candidates.length === 0) {
25
+ log.warn("No retained deployments available for rollback.");
26
+ outro(dim("Deploy more versions to enable rollback."));
27
+ return;
28
+ }
29
+ let targetId;
30
+ if (deployId) {
31
+ if (!candidates.find((d) => d.id === deployId)) {
32
+ log.error(`Deployment ${deployId} is not available for rollback (not retained or not found).`);
33
+ process.exit(1);
34
+ }
35
+ targetId = deployId;
36
+ } else {
37
+ const result = await select({
38
+ message: "Select a deployment to roll back to:",
39
+ options: candidates.map((d) => ({
40
+ value: d.id,
41
+ label: `${d.id} ${dim(formatAge(d.deployed_at))}`,
42
+ hint: d.source ? `via ${d.source}` : void 0
43
+ }))
44
+ });
45
+ if (isCancel(result)) {
46
+ cancel("Rollback cancelled.");
47
+ process.exit(0);
48
+ }
49
+ targetId = result;
50
+ }
51
+ const active = deployments.find((d) => d.id === activeDeploymentId);
52
+ const target = candidates.find((d) => d.id === targetId);
53
+ const currentMigrations = active?.applied_migrations ? JSON.parse(active.applied_migrations) : [];
54
+ const targetMigrations = target.applied_migrations ? JSON.parse(target.applied_migrations) : [];
55
+ const migrationDiff = currentMigrations.filter((m) => !targetMigrations.includes(m));
56
+ if (migrationDiff.length > 0) {
57
+ log.warn(`The current database has ${migrationDiff.length} migration(s) applied after this deployment:`);
58
+ for (const m of migrationDiff) log.message(` ${dim("•")} ${m}`);
59
+ log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
60
+ const proceed = await confirm({ message: "Proceed with rollback?" });
61
+ if (isCancel(proceed) || !proceed) {
62
+ cancel("Rollback cancelled.");
63
+ process.exit(0);
64
+ }
65
+ }
66
+ const s = createSpinner();
67
+ s.start("Rolling back...");
68
+ try {
69
+ const result = await client.rollback(linked.projectId, targetId, { allowDestructive: migrationDiff.length > 0 ? migrationDiff : void 0 });
70
+ s.stop("Rollback complete.");
71
+ if (result.ok) log.success(`Rolled back to ${import_picocolors.default.bold(targetId)}`);
72
+ else {
73
+ log.error(result.error ?? "Rollback failed.");
74
+ process.exit(1);
75
+ }
76
+ } catch (err) {
77
+ s.stop("Rollback failed.");
78
+ log.error(err instanceof Error ? err.message : String(err));
79
+ process.exit(1);
80
+ }
81
+ outro(dim("Traffic is now serving the rolled-back deployment."));
82
+ }
83
+ async function runCloudflareRollback(root, deployId) {
84
+ const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-CPTpRW6d.mjs").then((n) => n.t);
85
+ const context = resolveCloudflareOperationContext(root);
86
+ const status = await readCloudflareWorkerStatus(context);
87
+ const deployedVersionIds = new Set(status.deployedVersionIds);
88
+ const candidates = [...status.versions].reverse().filter((version) => version.id !== status.activeVersionId && deployedVersionIds.has(version.id));
89
+ if (candidates.length === 0) {
90
+ log.warn("No previous Cloudflare Worker Versions are available for rollback.");
91
+ outro(dim("Deploy more versions to enable rollback."));
92
+ return;
93
+ }
94
+ const requestedMatches = deployId ? candidates.filter((version) => version.id === deployId || version.id.startsWith(deployId)) : [];
95
+ if (requestedMatches.length > 1) {
96
+ log.error(`Version prefix ${deployId} is ambiguous; pass the complete version id.`);
97
+ process.exit(1);
98
+ }
99
+ let target = requestedMatches[0];
100
+ if (deployId && !target) {
101
+ log.error(`Version ${deployId} is not available for rollback.`);
102
+ process.exit(1);
103
+ }
104
+ if (!target) {
105
+ const result = await select({
106
+ message: "Select a version to roll back to:",
107
+ options: candidates.map((version) => ({
108
+ value: version.id,
109
+ label: `${version.id} ${dim(formatAge(version.createdAt))}`,
110
+ hint: version.metadata ? `${version.metadata.migrations.length} migration(s)` : "migration state unknown"
111
+ }))
112
+ });
113
+ if (isCancel(result)) {
114
+ cancel("Rollback cancelled.");
115
+ process.exit(0);
116
+ }
117
+ target = candidates.find((version) => version.id === result);
118
+ }
119
+ const current = status.versions.find((version) => version.id === status.activeVersionId);
120
+ if (target.metadata?.schema !== 2 || current?.metadata?.schema !== 2 || target.metadata.triggerConfig.preserve || current.metadata.triggerConfig.preserve) log.info("This rollback keeps the current domains, routes, and schedules. The selected version has no complete trigger snapshot.");
121
+ if (!current?.metadata || !target.metadata) {
122
+ log.warn("Void migration metadata is unavailable for one of these versions. Database migrations are forward-only and will not be reverted.");
123
+ const proceed = await confirm({ message: "Proceed with rollback?" });
124
+ if (isCancel(proceed) || !proceed) {
125
+ cancel("Rollback cancelled.");
126
+ process.exit(0);
127
+ }
128
+ } else {
129
+ const targetSet = new Set(target.metadata.migrations);
130
+ const migrationDiff = current.metadata.migrations.filter((migration) => !targetSet.has(migration));
131
+ if (migrationDiff.length > 0) {
132
+ log.warn(`The current database has ${migrationDiff.length} migration(s) applied after this version:`);
133
+ for (const migration of migrationDiff) log.message(` ${dim("•")} ${migration}`);
134
+ log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
135
+ const proceed = await confirm({ message: "Proceed with rollback?" });
136
+ if (isCancel(proceed) || !proceed) {
137
+ cancel("Rollback cancelled.");
138
+ process.exit(0);
139
+ }
140
+ }
141
+ }
142
+ const spinner = createSpinner();
143
+ spinner.start("Rolling back...");
144
+ try {
145
+ await activateCloudflareExistingVersion(context, target, current);
146
+ spinner.stop("Rollback complete.");
147
+ } catch (error) {
148
+ spinner.stop("Rollback failed.");
149
+ log.error(error instanceof Error ? error.message : String(error));
150
+ process.exit(1);
151
+ }
152
+ log.success(`Rolled back to ${import_picocolors.default.bold(target.id)}`);
153
+ outro(dim("Traffic is now serving the selected Cloudflare Worker Version."));
154
+ }
155
+ function formatAge(deployedAt) {
156
+ if (!deployedAt) return "";
157
+ const diffMs = Date.now() - new Date(ensureUtc(deployedAt)).getTime();
158
+ if (diffMs < 6e4) return "just now";
159
+ const minutes = Math.floor(diffMs / 6e4);
160
+ if (minutes < 60) return `${minutes}m ago`;
161
+ const hours = Math.floor(minutes / 60);
162
+ if (hours < 24) return `${hours}h ago`;
163
+ return `${Math.floor(hours / 24)}d ago`;
164
+ }
165
+ //#endregion
166
+ export { runRollbackCommand };
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
26
26
  }
27
27
  return to;
28
28
  };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
30
30
  value: mod,
31
31
  enumerable: true
32
32
  }) : target, mod));
@@ -1,6 +1,6 @@
1
- import { a as join, s as relative } from "./dist-DaKKDf8D.mjs";
2
- import { r as writeFileIfChanged } from "./project-tsconfig-B-QtXjLQ.mjs";
1
+ import { c as relative, o as join } from "./dist-BrsS7cai.mjs";
3
2
  import { a as isVoidSocialAuthProvider } from "./providers-CJlNS3kT.mjs";
3
+ import { r as writeFileIfChanged } from "./project-tsconfig-Ql2XsSQp.mjs";
4
4
  import { mkdirSync } from "node:fs";
5
5
  import { getAuthTables, getSchema } from "better-auth/db";
6
6
  //#region src/codegen/db-types.ts
@@ -17,7 +17,25 @@ const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, as
17
17
  */
18
18
  function generateDbDts(outDir, schema, dialect) {
19
19
  mkdirSync(outDir, { recursive: true });
20
- const lines = dialect === "postgresql" ? schema ? [
20
+ const lines = dialect === "mysql" ? schema ? [
21
+ "// Auto-generated by void — do not edit",
22
+ "import type { MySql2Database } from \"void/_db-mysql\";",
23
+ "import type * as schema from \"@schema\";",
24
+ "type Schema = typeof schema;",
25
+ "export declare const db: MySql2Database<Schema>;",
26
+ "export declare function createDb(connectionString: string): MySql2Database<Schema>;",
27
+ `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
28
+ "export type { MySql2Database } from \"void/_db-mysql\";",
29
+ ""
30
+ ] : [
31
+ "// Auto-generated by void — do not edit",
32
+ "import type { MySql2Database } from \"void/_db-mysql\";",
33
+ "export declare const db: MySql2Database<Record<string, never>>;",
34
+ "export declare function createDb(connectionString: string): MySql2Database<Record<string, never>>;",
35
+ `export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
36
+ "export type { MySql2Database } from \"void/_db-mysql\";",
37
+ ""
38
+ ] : dialect === "postgresql" ? schema ? [
21
39
  "// Auto-generated by void — do not edit",
22
40
  "import type { NodePgDatabase } from \"void/_db-pg\";",
23
41
  "import type * as schema from \"@schema\";",
@@ -123,13 +141,32 @@ function renderEnumValues(values) {
123
141
  function resolveFieldName(defaultFieldName, field) {
124
142
  return field.fieldName ?? defaultFieldName;
125
143
  }
144
+ const UNBOUNDED_MYSQL_AUTH_FIELDS = /* @__PURE__ */ new Set([
145
+ "account.accessToken",
146
+ "account.refreshToken",
147
+ "account.idToken"
148
+ ]);
149
+ function usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) {
150
+ return field.type === "string" && !field.unique && !field.index && !field.references && !field.sortable && UNBOUNDED_MYSQL_AUTH_FIELDS.has(`${defaultModelName}.${defaultFieldName}`);
151
+ }
126
152
  function resolveReferenceFieldName(schema, model, field) {
127
153
  if (field === "id") return "id";
128
154
  const referencedField = schema[model]?.fields[field];
129
155
  return referencedField ? resolveFieldName(field, referencedField) : field;
130
156
  }
131
- function createColumnBuilder(dialect, idStrategy, fieldName, field) {
157
+ function createColumnBuilder(dialect, idStrategy, defaultModelName, defaultFieldName, fieldName, field) {
132
158
  const useIdType = fieldName === "id" || field.references?.field === "id";
159
+ if (dialect === "mysql") {
160
+ if (useIdType) return idStrategy === "serial" ? `int(${JSON.stringify(fieldName)})` : `varchar(${JSON.stringify(fieldName)}, { length: ${idStrategy === "uuid" ? 36 : 255} })`;
161
+ if (Array.isArray(field.type)) return `varchar(${JSON.stringify(fieldName)}, { length: 255, enum: ${renderEnumValues(field.type)} })`;
162
+ if (isJsonField(field)) return `json(${JSON.stringify(fieldName)})`;
163
+ switch (field.type) {
164
+ case "boolean": return `boolean(${JSON.stringify(fieldName)})`;
165
+ case "date": return `timestamp(${JSON.stringify(fieldName)}, { mode: "date", fsp: 3 })`;
166
+ case "number": return field.bigint ? `bigint(${JSON.stringify(fieldName)}, { mode: "number" })` : `int(${JSON.stringify(fieldName)})`;
167
+ default: return usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) ? `text(${JSON.stringify(fieldName)})` : `varchar(${JSON.stringify(fieldName)}, { length: 255 })`;
168
+ }
169
+ }
133
170
  if (dialect === "postgresql") {
134
171
  if (useIdType) {
135
172
  if (idStrategy === "serial") return `integer(${JSON.stringify(fieldName)})`;
@@ -160,10 +197,13 @@ function createColumnBuilder(dialect, idStrategy, fieldName, field) {
160
197
  default: return `text(${JSON.stringify(fieldName)})`;
161
198
  }
162
199
  }
163
- function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable, defaultFieldName, field) {
200
+ function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable, defaultModelName, defaultFieldName, field) {
164
201
  const actualFieldName = resolveFieldName(defaultFieldName, field);
165
- const parts = [createColumnBuilder(dialect, idStrategy, actualFieldName, field)];
166
- if (actualFieldName === "id") parts.push(".primaryKey()");
202
+ const parts = [createColumnBuilder(dialect, idStrategy, defaultModelName, defaultFieldName, actualFieldName, field)];
203
+ if (actualFieldName === "id") {
204
+ parts.push(".primaryKey()");
205
+ if (dialect === "mysql" && idStrategy === "serial") parts.push(".autoincrement()");
206
+ }
167
207
  if (field.required !== false || actualFieldName === "id") parts.push(".notNull()");
168
208
  if (field.references) {
169
209
  const referenceModel = Object.entries(schema).find(([_, value]) => value.modelName === field.references?.model)?.[0] ?? field.references.model;
@@ -177,10 +217,10 @@ function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable,
177
217
  return parts.join("");
178
218
  }
179
219
  function collectCoreImports(dialect, schema, idStrategy) {
180
- const imports = /* @__PURE__ */ new Set([dialect === "postgresql" ? "pgTable" : "sqliteTable", "text"]);
181
- if (idStrategy === "serial") imports.add("integer");
220
+ const imports = /* @__PURE__ */ new Set([dialect === "postgresql" ? "pgTable" : dialect === "mysql" ? "mysqlTable" : "sqliteTable", dialect === "mysql" ? "varchar" : "text"]);
221
+ if (idStrategy === "serial") imports.add(dialect === "mysql" ? "int" : "integer");
182
222
  if (idStrategy === "uuid" && dialect === "postgresql") imports.add("uuid");
183
- for (const [, table] of Object.entries(schema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) {
223
+ for (const [defaultModelName, table] of Object.entries(schema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) {
184
224
  if (resolveFieldName(defaultFieldName, field) === "id" || field.references?.field === "id") {
185
225
  if (idStrategy === "serial") imports.add("integer");
186
226
  if (idStrategy === "uuid" && dialect === "postgresql") imports.add("uuid");
@@ -188,24 +228,24 @@ function collectCoreImports(dialect, schema, idStrategy) {
188
228
  }
189
229
  if (field.index) imports.add("index");
190
230
  if (Array.isArray(field.type) || field.type === "string") {
191
- imports.add("text");
231
+ imports.add(dialect === "mysql" && !usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) ? "varchar" : "text");
192
232
  continue;
193
233
  }
194
234
  if (isJsonField(field)) {
195
- imports.add(dialect === "postgresql" ? "jsonb" : "text");
235
+ imports.add(dialect === "postgresql" ? "jsonb" : dialect === "mysql" ? "json" : "text");
196
236
  continue;
197
237
  }
198
238
  if (field.type === "boolean") {
199
- imports.add(dialect === "postgresql" ? "boolean" : "integer");
239
+ imports.add(dialect === "postgresql" ? "boolean" : dialect === "mysql" ? "boolean" : "integer");
200
240
  continue;
201
241
  }
202
242
  if (field.type === "date") {
203
- imports.add(dialect === "postgresql" ? "timestamp" : "integer");
243
+ imports.add(dialect === "postgresql" ? "timestamp" : dialect === "mysql" ? "timestamp" : "integer");
204
244
  continue;
205
245
  }
206
246
  if (field.type === "number") {
207
- imports.add("integer");
208
- if (field.bigint && dialect === "postgresql") imports.add("bigint");
247
+ imports.add(dialect === "mysql" ? "int" : "integer");
248
+ if (field.bigint && dialect !== "sqlite") imports.add("bigint");
209
249
  }
210
250
  }
211
251
  return [...imports].sort();
@@ -218,8 +258,8 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
218
258
  const defaultToVariable = /* @__PURE__ */ new Map();
219
259
  const entries = Object.entries(schema).sort(([, left], [, right]) => (left.order ?? DEFAULT_TABLE_ORDER) - (right.order ?? DEFAULT_TABLE_ORDER));
220
260
  for (const [defaultModelName] of entries) defaultToVariable.set(defaultModelName, `${sanitizeIdentifier(defaultModelName)}Table`);
221
- const tableFactory = runtime.dialect === "postgresql" ? "pgTable" : "sqliteTable";
222
- const importPath = runtime.dialect === "postgresql" ? "void/schema-pg" : "void/schema-d1";
261
+ const tableFactory = runtime.dialect === "postgresql" ? "pgTable" : runtime.dialect === "mysql" ? "mysqlTable" : "sqliteTable";
262
+ const importPath = runtime.dialect === "postgresql" ? "void/schema-pg" : runtime.dialect === "mysql" ? "void/schema-mysql" : "void/schema-d1";
223
263
  const lines = [
224
264
  "// Auto-generated by void — do not edit",
225
265
  `import { ${collectCoreImports(runtime.dialect, schema, idStrategy).join(", ")} } from ${JSON.stringify(importPath)};`,
@@ -228,12 +268,12 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
228
268
  for (const [defaultModelName, table] of entries) {
229
269
  const variableName = defaultToVariable.get(defaultModelName);
230
270
  const fieldEntries = Object.entries(table.fields);
231
- const renderedFields = [` "id": ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, "id", {
271
+ const renderedFields = [` "id": ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultModelName, "id", {
232
272
  type: idStrategy === "serial" ? "number" : "string",
233
273
  required: true
234
274
  })},`, ...fieldEntries.map(([defaultFieldName, field]) => {
235
275
  const actualFieldName = resolveFieldName(defaultFieldName, field);
236
- return ` ${JSON.stringify(actualFieldName)}: ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultFieldName, field)},`;
276
+ return ` ${JSON.stringify(actualFieldName)}: ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultModelName, defaultFieldName, field)},`;
237
277
  })];
238
278
  const indexedFields = fieldEntries.filter(([, field]) => field.index && !field.unique);
239
279
  if (indexedFields.length > 0) lines.push(`export const ${variableName} = ${tableFactory}(${JSON.stringify(table.modelName)}, {`, ...renderedFields, `}, (table) => [`, ...indexedFields.map(([defaultFieldName, field]) => {
@@ -252,7 +292,12 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
252
292
  }
253
293
  function resolveVoidAuthMigrationSchema(runtime, env = {}) {
254
294
  const options = resolveSchemaOptions(runtime, env);
295
+ const logicalSchema = getAuthTables(options);
255
296
  const schema = getSchema(options);
297
+ const unboundedMySqlFields = /* @__PURE__ */ new Set();
298
+ if (runtime.dialect === "mysql") {
299
+ for (const [defaultModelName, table] of Object.entries(logicalSchema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) if (usesUnboundedMySqlText(defaultModelName, defaultFieldName, field)) unboundedMySqlFields.add(`${table.modelName}\0${resolveFieldName(defaultFieldName, field)}`);
300
+ }
256
301
  return {
257
302
  dialect: runtime.dialect,
258
303
  idStrategy: resolveIdStrategy(options),
@@ -265,6 +310,7 @@ function resolveVoidAuthMigrationSchema(runtime, env = {}) {
265
310
  unique: field.unique === true,
266
311
  index: field.index === true,
267
312
  bigint: field.bigint === true,
313
+ ...unboundedMySqlFields.has(`${name}\0${fieldName}`) ? { unbounded: true } : {},
268
314
  ...field.references ? { references: {
269
315
  table: field.references.model,
270
316
  field: field.references.field,
@@ -276,7 +322,7 @@ function resolveVoidAuthMigrationSchema(runtime, env = {}) {
276
322
  }
277
323
  function generateVoidAuthDatabaseModule(options) {
278
324
  const schemaImport = JSON.stringify(options.schemaImportPath);
279
- const provider = options.dialect === "postgresql" ? "pg" : "sqlite";
325
+ const provider = options.dialect === "postgresql" ? "pg" : options.dialect === "mysql" ? "mysql" : "sqlite";
280
326
  return [
281
327
  "// Auto-generated by void — do not edit",
282
328
  `import { drizzleAdapter } from ${JSON.stringify(options.drizzleAdapterPath)};`,
@@ -308,7 +354,8 @@ function generateQueueTypes(queues, queuesDir, outDir) {
308
354
  lines.push("// Auto-generated by void — do not edit");
309
355
  lines.push("export interface QueueMap {");
310
356
  for (const q of queues) {
311
- const importPath = relative(outDir, `${queuesDir}/${q.filePath}`);
357
+ const absPath = `${queuesDir}/${q.filePath}`;
358
+ const importPath = relative(outDir, absPath);
312
359
  lines.push(` ${JSON.stringify(q.name)}: Queue<(typeof import(${JSON.stringify(importPath)}))["default"]["__payload"]>;`);
313
360
  }
314
361
  lines.push("}");
@@ -435,7 +482,8 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
435
482
  lines.push(" interface RouteMap {");
436
483
  for (const route of scan.routes) {
437
484
  if (route.methods.length === 0) continue;
438
- const importPath = relative(outDir, `${routesDir}/${route.filePath}`);
485
+ const absRoutePath = `${routesDir}/${route.filePath}`;
486
+ const importPath = relative(outDir, absRoutePath);
439
487
  lines.push(` ${JSON.stringify(route.pattern)}: {`);
440
488
  for (const method of route.methods) {
441
489
  lines.push(` ${method}: {`);
@@ -449,7 +497,8 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
449
497
  lines.push("");
450
498
  lines.push(" interface WebSocketRouteMap {");
451
499
  for (const route of scan.websockets ?? []) {
452
- const importPath = relative(outDir, `${routesDir}/${route.filePath}`);
500
+ const absRoutePath = `${routesDir}/${route.filePath}`;
501
+ const importPath = relative(outDir, absRoutePath);
453
502
  lines.push(` ${JSON.stringify(route.pattern)}: {`);
454
503
  lines.push(` params: RouteParams<${JSON.stringify(route.params)}>;`);
455
504
  lines.push(` client: ExtractInput<(typeof import(${JSON.stringify(importPath)}))["default"]["messages"]["client"]>;`);
@@ -466,7 +515,10 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
466
515
  if (hasAction && hasActions) throw new Error(`pages: Page '${page.pattern}' exports both "action" and "actions". Use one or the other.`);
467
516
  lines.push(` ${JSON.stringify(page.pattern)}: {`);
468
517
  let importPath = null;
469
- if (page.serverPath) importPath = relative(outDir, `${pagesDir}/${page.serverPath}`);
518
+ if (page.serverPath) {
519
+ const absPath = `${pagesDir}/${page.serverPath}`;
520
+ importPath = relative(outDir, absPath);
521
+ }
470
522
  if (hasActions) {
471
523
  if (importPath) {
472
524
  const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
@@ -1,24 +1,24 @@
1
1
  //#region src/routes-stub.d.ts
2
2
  /** Stub interface augmented by the generated .void/routes.d.ts */
3
- interface RouteMap {}
3
+ export interface RouteMap {}
4
4
  /** Stub interface augmented by the generated .void/routes.d.ts */
5
- interface WebSocketRouteMap {}
5
+ export interface WebSocketRouteMap {}
6
6
  /** Union of known route patterns (keys of the generated RouteMap). */
7
- type RouteName = keyof RouteMap;
7
+ export type RouteName = keyof RouteMap;
8
8
  /**
9
- * Destination type for rewrites / fallbacks / c.rewrite().
10
- *
11
- * The `string & {}` branch keeps IDE autocomplete of known routes while
12
- * still accepting arbitrary strings (needed for dynamic paths like
13
- * `/users/${id}`). When no routes are generated yet, `RouteName` is
14
- * `never` and this degenerates to `string & {}`, which is assignable
15
- * from any string.
16
- */
17
- type RewriteDestination = RouteName | (string & {});
9
+ * Destination type for rewrites / fallbacks / c.rewrite().
10
+ *
11
+ * The `string & {}` branch keeps IDE autocomplete of known routes while
12
+ * still accepting arbitrary strings (needed for dynamic paths like
13
+ * `/users/${id}`). When no routes are generated yet, `RouteName` is
14
+ * `never` and this degenerates to `string & {}`, which is assignable
15
+ * from any string.
16
+ */
17
+ export type RewriteDestination = RouteName | (string & {});
18
18
  /** Stub interface for page action types — augmented by generated routes.d.ts */
19
- interface PageActionMap {}
19
+ export interface PageActionMap {}
20
20
  /** Parse "/path?action" into base path and action name */
21
- type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}` ? {
21
+ export type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}` ? {
22
22
  base: Base;
23
23
  action: Action;
24
24
  } : {
@@ -26,7 +26,7 @@ type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}
26
26
  action: never;
27
27
  };
28
28
  /** Resolve body type for a useForm URL (single action or named action) */
29
- type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? ParseActionUrl<U>["action"] extends never ? PageActionMap[ParseActionUrl<U>["base"]] extends {
29
+ export type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? ParseActionUrl<U>["action"] extends never ? PageActionMap[ParseActionUrl<U>["base"]] extends {
30
30
  body: infer B;
31
31
  } ? B : Record<string, unknown> : PageActionMap[ParseActionUrl<U>["base"]] extends {
32
32
  actions: infer A;
@@ -34,22 +34,21 @@ type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends key
34
34
  body: infer B;
35
35
  } ? B : Record<string, unknown> : never : never : Record<string, unknown>;
36
36
  /** Resolve params type */
37
- type ResolveActionParams<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? PageActionMap[ParseActionUrl<U>["base"]] extends {
37
+ export type ResolveActionParams<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? PageActionMap[ParseActionUrl<U>["base"]] extends {
38
38
  params: infer P;
39
39
  } ? P : never : never;
40
40
  /** Has params check */
41
- type HasActionParams<U extends string> = ResolveActionParams<U> extends Record<string, string> ? true : false;
41
+ export type HasActionParams<U extends string> = ResolveActionParams<U> extends Record<string, string> ? true : false;
42
42
  /** Form options type (requires params for dynamic routes) */
43
- type ActionFormOptions<U extends string> = HasActionParams<U> extends true ? {
43
+ export type ActionFormOptions<U extends string> = HasActionParams<U> extends true ? {
44
44
  params: ResolveActionParams<U>;
45
45
  } : {
46
46
  params?: never;
47
47
  };
48
48
  /** Valid useForm URLs — single-action pages + "page?name" combos + default actions */
49
- type ActionUrl = { [K in keyof PageActionMap]: PageActionMap[K] extends {
49
+ export type ActionUrl = { [K in keyof PageActionMap]: PageActionMap[K] extends {
50
50
  body: unknown;
51
- } ? K : never }[keyof PageActionMap] | { [K in keyof PageActionMap]: PageActionMap[K] extends {
51
+ } ? K : never; }[keyof PageActionMap] | { [K in keyof PageActionMap]: PageActionMap[K] extends {
52
52
  actions: infer A;
53
- } ? `${K & string}?${keyof A & string}` : never }[keyof PageActionMap];
54
- //#endregion
55
- export { ActionFormOptions, ActionUrl, HasActionParams, PageActionMap, ParseActionUrl, ResolveActionBody, ResolveActionParams, RewriteDestination, RouteMap, RouteName, WebSocketRouteMap };
53
+ } ? `${K & string}?${keyof A & string}` : never; }[keyof PageActionMap];
54
+ //#endregion
@@ -0,0 +1,61 @@
1
+ import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
2
+ import { c as collectMigrations } from "./validate-Bihr8WBi.mjs";
3
+ //#region src/migrations/runner-mysql.ts
4
+ var runner_mysql_exports = /* @__PURE__ */ __exportAll({
5
+ applyMySqlMigrations: () => applyMySqlMigrations,
6
+ getMySqlAppliedMigrations: () => getMySqlAppliedMigrations,
7
+ readMySqlAppliedMigrations: () => readMySqlAppliedMigrations,
8
+ runMySqlMigrations: () => runMySqlMigrations
9
+ });
10
+ async function readMySqlAppliedMigrations(client) {
11
+ try {
12
+ return (await client.query("SELECT `name` FROM `_void_migrations`")).map((row) => String(row.name));
13
+ } catch (error) {
14
+ const value = typeof error === "object" && error !== null ? error : void 0;
15
+ if (value?.code === "ER_NO_SUCH_TABLE" || value?.errno === 1146) return [];
16
+ throw error;
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({ async query(sql, params) {
24
+ const [rows] = await connection.query(sql, params);
25
+ return Array.isArray(rows) ? rows : [];
26
+ } });
27
+ } finally {
28
+ await connection.end();
29
+ }
30
+ }
31
+ async function applyMySqlMigrations(client, migrations) {
32
+ if (migrations.length === 0) return [];
33
+ await client.query("CREATE TABLE IF NOT EXISTS `_void_migrations` (`name` VARCHAR(255) PRIMARY KEY, `applied_at` VARCHAR(64) NOT NULL)");
34
+ const existing = await client.query("SELECT `name` FROM `_void_migrations`");
35
+ const appliedSet = new Set(existing.map((row) => String(row.name)));
36
+ const pending = migrations.filter((migration) => !appliedSet.has(migration.name));
37
+ for (const migration of pending) {
38
+ await client.query(migration.sql);
39
+ await client.query("INSERT INTO `_void_migrations` (`name`, `applied_at`) VALUES (?, ?)", [migration.name, (/* @__PURE__ */ new Date()).toISOString()]);
40
+ }
41
+ return pending.map((migration) => migration.name);
42
+ }
43
+ async function runMySqlMigrations(migrationsDir, url) {
44
+ const migrations = collectMigrations(migrationsDir);
45
+ if (migrations.length === 0) return [];
46
+ const { createConnection } = await import("mysql2/promise");
47
+ const connection = await createConnection({
48
+ uri: url,
49
+ multipleStatements: true
50
+ });
51
+ try {
52
+ return await applyMySqlMigrations({ async query(sql, params) {
53
+ const [rows] = await connection.query(sql, params);
54
+ return Array.isArray(rows) ? rows : [];
55
+ } }, migrations);
56
+ } finally {
57
+ await connection.end();
58
+ }
59
+ }
60
+ //#endregion
61
+ export { runner_mysql_exports as n, runMySqlMigrations as t };
@@ -1,5 +1,20 @@
1
- import { c as collectMigrations } from "./validate-Cw_RLeTj.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
2
+ import { c as collectMigrations } from "./validate-Bihr8WBi.mjs";
2
3
  //#region src/migrations/runner-pg.ts
4
+ var runner_pg_exports = /* @__PURE__ */ __exportAll({
5
+ applyPgMigrations: () => applyPgMigrations,
6
+ getPgAppliedMigrations: () => getPgAppliedMigrations,
7
+ readPgAppliedMigrations: () => readPgAppliedMigrations,
8
+ runPgMigrations: () => runPgMigrations
9
+ });
10
+ async function readPgAppliedMigrations(client) {
11
+ try {
12
+ return (await client.query("SELECT name FROM _void_migrations")).rows.map((row) => String(row.name));
13
+ } catch (error) {
14
+ if (typeof error === "object" && error !== null && error.code === "42P01") return [];
15
+ throw error;
16
+ }
17
+ }
3
18
  /**
4
19
  * Apply unapplied SQL migrations via a connected PostgreSQL client.
5
20
  * Each migration runs in its own transaction (BEGIN/COMMIT).
@@ -9,10 +24,7 @@ async function getPgAppliedMigrations(url) {
9
24
  const client = new Client({ connectionString: url });
10
25
  await client.connect();
11
26
  try {
12
- await client.query(`CREATE TABLE IF NOT EXISTS _void_migrations (name TEXT PRIMARY KEY, applied_at TEXT NOT NULL)`);
13
- return (await client.query("SELECT name FROM _void_migrations")).rows.map((row) => String(row.name));
14
- } catch {
15
- return [];
27
+ return await readPgAppliedMigrations(client);
16
28
  } finally {
17
29
  await client.end();
18
30
  }
@@ -54,4 +66,4 @@ async function runPgMigrations(migrationsDir, url) {
54
66
  }
55
67
  }
56
68
  //#endregion
57
- export { applyPgMigrations, getPgAppliedMigrations, runPgMigrations };
69
+ export { runner_pg_exports as n, runPgMigrations as t };
@@ -19,22 +19,29 @@ type AiProviderFetchInit = {
19
19
  //#endregion
20
20
  //#region src/runtime/ai.d.ts
21
21
  /**
22
- * Extended AI type with a convenience `stream()` method.
23
- *
24
- * `stream()` calls `ai.run()` with `stream: true` and wraps the result
25
- * in a `Response` with SSE headers — ready to return from a route handler.
26
- */
27
- type VoidAi = Omit<Ai, "run"> & {
28
- /** Workers AI inference (existing) */run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<AiModels[Name]["postProcessedOutputs"]>; /** Cloudflare AI Gateway model inference. Accepts Cloudflare model IDs unchanged. */
29
- run(model: string, inputs: unknown, options?: AiOptions): Promise<unknown>; /** Image generation. Returns the proxy response so callers can return or parse it. */
30
- image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<Response>; /** Cloudflare AI Gateway model inference returned as a Response. */
31
- image(model: string, inputs: unknown, options?: AiOptions): Promise<Response>; /** Provider-native AI Gateway requests using a project secret for the provider API key. */
22
+ * Extended AI type with a convenience `stream()` method.
23
+ *
24
+ * `stream()` calls `ai.run()` with `stream: true` and wraps the result
25
+ * in a `Response` with SSE headers — ready to return from a route handler.
26
+ */
27
+ export type VoidAi = Omit<Ai, "run"> & {
28
+ /** Workers AI inference (existing) */
29
+ run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<AiModels[Name]["postProcessedOutputs"]>;
30
+ /** Cloudflare AI Gateway model inference. Accepts Cloudflare model IDs unchanged. */
31
+ run(model: string, inputs: unknown, options?: AiOptions): Promise<unknown>;
32
+ /** Image generation. Returns the proxy response so callers can return or parse it. */
33
+ image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<Response>;
34
+ /** Cloudflare AI Gateway model inference returned as a Response. */
35
+ image(model: string, inputs: unknown, options?: AiOptions): Promise<Response>;
36
+ /** Provider-native AI Gateway requests using a project secret for the provider API key. */
32
37
  provider(provider: AiProvider, options?: AiProviderOptions): {
33
38
  fetch(path: string, init?: AiProviderFetchInit): Promise<Response>;
34
- }; /** Stream Workers AI response as SSE */
35
- stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): Promise<Response>; /** Stream any Cloudflare AI Gateway model response as SSE */
39
+ };
40
+ /** Stream Workers AI response as SSE */
41
+ stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): Promise<Response>;
42
+ /** Stream any Cloudflare AI Gateway model response as SSE */
36
43
  stream(model: string, inputs: Record<string, unknown>, options?: AiOptions): Promise<Response>;
37
44
  };
38
- declare const ai: VoidAi;
45
+ export declare const ai: VoidAi;
39
46
  //#endregion
40
- export { type AiProvider, type AiProviderFetchInit, type AiProviderName, type AiProviderOptions, type ImageFileInput, VoidAi, ai };
47
+ export type { AiProvider, AiProviderFetchInit, AiProviderName, AiProviderOptions, ImageFileInput };