void 0.20.2 → 0.21.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 (310) hide show
  1. package/README.md +2 -2
  2. package/dist/agents-gni4eqBu.mjs +111 -0
  3. package/dist/auth-3sGB0zJ1.mjs +22 -0
  4. package/dist/{auth-DPl6kck4.mjs → auth-B9_D6ygs.mjs} +6 -241
  5. package/dist/auth-CAw7zHqj.mjs +2 -0
  6. package/dist/auth-client-BWBT8HLp.mjs +6 -0
  7. package/dist/auth-client-Bawdj38n.d.mts +7 -0
  8. package/dist/auth-client-react-7GFffu8R.d.mts +7 -0
  9. package/dist/auth-client-react-CMLwT2xI.mjs +6 -0
  10. package/dist/auth-client-solid-DyTFL4cq.d.mts +7 -0
  11. package/dist/auth-client-solid-UoreJWZG.mjs +6 -0
  12. package/dist/auth-client-svelte-Cv_WvrRk.mjs +6 -0
  13. package/dist/auth-client-svelte-zetW0KIH.d.mts +7 -0
  14. package/dist/auth-client-vue-CFk7Xbv3.mjs +6 -0
  15. package/dist/auth-client-vue-bChShbQP.d.mts +7 -0
  16. package/dist/{auth-cmd-gniL2fNt.mjs → auth-cmd-MkBG2u1f.mjs} +5 -5
  17. package/dist/{auth-link-NZdjCmSc.mjs → auth-link-Devmv96E.mjs} +5 -5
  18. package/dist/{better-auth-shared-DSCeohOK.d.mts → better-auth-shared-BoVwA5Vm.d.mts} +1 -6
  19. package/dist/{better-auth-shared-CYw1T3k4.mjs → better-auth-shared-syGYYmnY.mjs} +1 -1
  20. package/dist/{build-cmd-sI18tX_O.mjs → build-cmd-DsBGwtfs.mjs} +6 -4
  21. package/dist/{cache-IHn5MwBC.mjs → cache-BMw8eMyF.mjs} +6 -4
  22. package/dist/{cancel-deploy-C5qTOdLi.mjs → cancel-deploy-B3_s9NIN.mjs} +5 -3
  23. package/dist/cf-access-rAZxzMkL.mjs +181 -0
  24. package/dist/cf-build-output-CTdlo6Rt.mjs +520 -0
  25. package/dist/cli/cf-compat.d.mts +1 -0
  26. package/dist/cli/cf-compat.mjs +934 -0
  27. package/dist/cli/cli.mjs +61 -38
  28. package/dist/cli/env-schema-probe.mjs +3 -3
  29. package/dist/client-DAAivdid.mjs +2 -0
  30. package/dist/{client-dHfSJvAN.mjs → client-PdAJ-F0t.mjs} +148 -89
  31. package/dist/{cloudflare-auth-6M5llVPC.mjs → cloudflare-auth-BCmTc1X_.mjs} +13 -44
  32. package/dist/{cloudflare-cmd-4RPGN3KB.mjs → cloudflare-cmd-D6PrKn7o.mjs} +4 -7
  33. package/dist/{cloudflare-connect-t1UU5svD.mjs → cloudflare-connect-DloREDlc.mjs} +6 -6
  34. package/dist/cloudflare-operations-BHNJVDbN.mjs +2 -0
  35. package/dist/{cloudflare-operations-BzWnlC1_.mjs → cloudflare-operations-CPEdHYhM.mjs} +37 -39
  36. package/dist/cloudflare-user-output-Q-k0QoNQ.mjs +20 -0
  37. package/dist/collect-DAUItMDS.mjs +2 -0
  38. package/dist/collect-DXHNWHcT.mjs +48 -0
  39. package/dist/config--T87TD8T.mjs +2 -0
  40. package/dist/{config-NOG_U1aK.mjs → config-BSe70f4T.mjs} +4 -6
  41. package/dist/config-DDIFxQYx.mjs +2 -0
  42. package/dist/{config-uNGuFsI2.mjs → config-Dxr6cTXn.mjs} +22 -37
  43. package/dist/config-DywxBLQC.d.mts +185 -0
  44. package/dist/config-entry.d.mts +6 -0
  45. package/dist/config-entry.mjs +7 -0
  46. package/dist/config-uP7ZDtVZ.mjs +21 -0
  47. package/dist/config-write-y3CBI_ux.mjs +60 -0
  48. package/dist/{connect-Bfk31O_8.mjs → connect-BvC9kolB.mjs} +8 -6
  49. package/dist/{create-project-Bk9Z0-Jg.mjs → create-project-C9lQhRzj.mjs} +9 -25
  50. package/dist/create-project-CI-17RVJ.mjs +2 -0
  51. package/dist/database-provider-Cx525bwX.mjs +6 -0
  52. package/dist/database-provider.mjs +1 -5
  53. package/dist/{db-BkRoptAt.mjs → db-R7IQgOv5.mjs} +48 -44
  54. package/dist/{delete-DouASY9P.mjs → delete-CghI_NXn.mjs} +6 -4
  55. package/dist/deploy-CYPymbtG.mjs +2 -0
  56. package/dist/{deploy-DTaWUS1S.mjs → deploy-H968Lo4T.mjs} +765 -197
  57. package/dist/discover-BBzDZe_o.mjs +2 -0
  58. package/dist/{discover-xvfrgJeo.mjs → discover-C4O6YxVS.mjs} +3 -8
  59. package/dist/{dist-BrsS7cai.mjs → dist-4WkAWhWx.mjs} +1 -15
  60. package/dist/{dist-m40_XgNh.mjs → dist-Bn8Kodjp.mjs} +1 -1
  61. package/dist/dist-C5fND3R0.mjs +2 -0
  62. package/dist/dist-D7-nEOXi.mjs +2 -0
  63. package/dist/{output-B0cfNSx5.mjs → dist-Dn6nn2IU.mjs} +3 -926
  64. package/dist/{domain-1RhhOVrC.mjs → domain-CITt8lC-.mjs} +7 -5
  65. package/dist/{route-types-Da-DpyUp.mjs → drizzle-Beb2Am5S.mjs} +1 -280
  66. package/dist/{email-Ce6SQq-i.mjs → email-C5kaZXzJ.mjs} +2 -2
  67. package/dist/{email-C-lGh51B.mjs → email-_8VmyX7V.mjs} +14 -12
  68. package/dist/{entry-DU3oDoQ3.mjs → entry-DdRFGK0y.mjs} +2 -2
  69. package/dist/{env-DJHsPE7Z.mjs → env-DV4r3nHz.mjs} +9 -7
  70. package/dist/{env-DBKmK4vc.mjs → env-DX_v-Q-v.mjs} +1 -1
  71. package/dist/env-Yz4HcvHs.mjs +78 -0
  72. package/dist/env-helpers--wFmQ_5Q.mjs +136 -0
  73. package/dist/{env-types-BNPhro-M.mjs → env-types-CWDtqHgw.mjs} +6 -2
  74. package/dist/{env-validation-CF6KvTRf.mjs → env-validation-BsFEXps5.mjs} +19 -28
  75. package/dist/env-validation-DIDGM7h4.mjs +2 -0
  76. package/dist/fetch-CXDChK7B.mjs +18 -0
  77. package/dist/fetch-_SeGZao9.d.mts +57 -0
  78. package/dist/fetch-stream-AOByI7Ki.mjs +81 -0
  79. package/dist/fetch-stream-Bjf0hoZb.d.mts +49 -0
  80. package/dist/gen-BBiIZw6g.mjs +2 -0
  81. package/dist/{gen-B_wPnVTK.mjs → gen-CFOEEc-t.mjs} +13 -11
  82. package/dist/{generate-RTK8_kK1.mjs → generate-C0VY6RVf.mjs} +2 -2
  83. package/dist/{github-cmd-PW7ZnWTp.mjs → github-cmd-jYjha2LO.mjs} +18 -22
  84. package/dist/{handler-D1hLsObx.d.mts → handler-BXJTXd02.d.mts} +6 -1
  85. package/dist/handler-DghKr6dU.mjs +150 -0
  86. package/dist/head-D_QRR5Yd.mjs +112 -0
  87. package/dist/head-client-DzmJGN4C.mjs +90 -0
  88. package/dist/{headers-BAHwgHdW.mjs → headers-B_HBMgi0.mjs} +2 -2
  89. package/dist/{help-CwOX-zmI.mjs → help-C46mnlUS.mjs} +17 -12
  90. package/dist/help-CS_nAsWu.mjs +2 -0
  91. package/dist/index.d.mts +2 -20
  92. package/dist/index.mjs +116 -60
  93. package/dist/{init-BWZ7q5Z4.mjs → init-CSXmvxKu.mjs} +49 -50
  94. package/dist/{link-Rmvu2Wl_.mjs → link-DxMOALXk.mjs} +7 -5
  95. package/dist/{list-DEE2S6mY.mjs → list-0wQs0oYg.mjs} +7 -5
  96. package/dist/live-CB1y5IuC.mjs +411 -0
  97. package/dist/live-CKiJilLr.d.mts +105 -0
  98. package/dist/local-d1-DzykTWY8.mjs +104 -0
  99. package/dist/{login-Uvferzmm.mjs → login-CKk5NX4d.mjs} +6 -11
  100. package/dist/login-Ch9cgWRF.mjs +2 -0
  101. package/dist/{logs-27FenuiC.mjs → logs-hxWBSoej.mjs} +6 -4
  102. package/dist/migrate-CLty4mZR.mjs +2 -0
  103. package/dist/migrate-DcW8F2W8.mjs +285 -0
  104. package/dist/migration-handler-DM4clYj5.d.mts +51 -0
  105. package/dist/{neon-DHwd2zvC.mjs → neon-n74ta1Pr.mjs} +1 -1
  106. package/dist/{node-Ez5KW5rn.mjs → node-Cupyf7-s.mjs} +6 -6
  107. package/dist/{operator-auth-B3e08unv.mjs → operator-auth-BkVgJqv-.mjs} +2 -2
  108. package/dist/{operator-client-LUZnlnYk.mjs → operator-client-A0iex2yi.mjs} +2 -1
  109. package/dist/{operator-cmd-CjOTmAYE.mjs → operator-cmd-BEUYhaHB.mjs} +6 -6
  110. package/dist/output-urU86XeT.mjs +146 -0
  111. package/dist/{package-json-CPoWX79C.mjs → package-json-iCbMg5XF.mjs} +1 -1
  112. package/dist/pages/client.d.mts +5 -2
  113. package/dist/pages/client.mjs +5 -3
  114. package/dist/pages/head-client.mjs +1 -89
  115. package/dist/pages/head.mjs +1 -111
  116. package/dist/pages/index.d.mts +2 -3
  117. package/dist/pages/index.mjs +7 -7
  118. package/dist/pages/islands-plugin.mjs +2 -2
  119. package/dist/pages/prefetch.d.mts +2 -30
  120. package/dist/pages/prefetch.mjs +1 -89
  121. package/dist/pages/protocol.d.mts +2 -2
  122. package/dist/pages/protocol.mjs +3 -3
  123. package/dist/pages/serialize.d.mts +2 -9
  124. package/dist/pages/serialize.mjs +1 -13
  125. package/dist/plan-BEZ8VJW0.mjs +256 -0
  126. package/dist/plan-DpuOr14e.mjs +2 -0
  127. package/dist/{platform-auth-config-DrbQXXiW.mjs → platform-auth-config-Df6yVw-e.mjs} +6 -6
  128. package/dist/{platform-auth-protection-Bhtvp0B_.mjs → platform-auth-protection-Jb0yftay.mjs} +7 -5
  129. package/dist/{platform-auth-recovery-CeOKGVeJ.mjs → platform-auth-recovery-DmRyIfW0.mjs} +6 -5
  130. package/dist/platform-cmd-C9Vt7m-d.mjs +2 -0
  131. package/dist/{platform-cmd-BFhieCdV.mjs → platform-cmd-DRxCOTwy.mjs} +8 -5
  132. package/dist/{platform-domain-C74PULqV.mjs → platform-domain-IjiXgrXJ.mjs} +4 -3
  133. package/dist/{platform-lifecycle-BwAIgz-t.mjs → platform-lifecycle-BquAaU-5.mjs} +263 -56
  134. package/dist/platform-lifecycle-CuJIZNvA.mjs +2 -0
  135. package/dist/{platform-management-COogu_Se.mjs → platform-management-CCQKGsq4.mjs} +12 -7
  136. package/dist/platform-management-Cgyed0WY.mjs +2 -0
  137. package/dist/{platform-recovery-ewqLefp1.mjs → platform-recovery-DS8ih1SW.mjs} +3 -3
  138. package/dist/platform-registry-BJbgZLS1.mjs +431 -0
  139. package/dist/{plugin-inference-BDRfZngg.mjs → plugin-inference-DsvtJLll.mjs} +4 -4
  140. package/dist/prefetch-Bsc_Pb6c.mjs +90 -0
  141. package/dist/prefetch-Ce6la4EI.d.mts +31 -0
  142. package/dist/{prepare-blNRQvQl.mjs → prepare-CaUxODOU.mjs} +3 -2
  143. package/dist/prepare-D4CkM3_v.mjs +2 -0
  144. package/dist/{prepare-CtDJjoOj.mjs → prepare-pcWcxSCh.mjs} +13 -11
  145. package/dist/prerender-render-Cf_WDE9W.mjs +111 -0
  146. package/dist/prerender-render.mjs +1 -110
  147. package/dist/{preset-lAy0B0BQ.mjs → preset-Dowh9tTt.mjs} +16 -118
  148. package/dist/project-BEBFDFLz.mjs +2 -0
  149. package/dist/project-CWNIPoXc.mjs +209 -0
  150. package/dist/{project-cmd-DmZK9Hxf.mjs → project-cmd-2lN--YAX.mjs} +18 -16
  151. package/dist/{project-paths-SK8nMHPp.mjs → project-paths-CKQ-Q5JS.mjs} +47 -14
  152. package/dist/project-slug-23TpquG4.mjs +8 -0
  153. package/dist/project-slug-DofjTFd-.mjs +2 -0
  154. package/dist/{project-team-D8jOJMUJ.mjs → project-team-Dapn9HZn.mjs} +9 -5
  155. package/dist/{project-token-DA34bf-C.mjs → project-token-C90v9SJK.mjs} +6 -4
  156. package/dist/{project-tsconfig-Ql2XsSQp.mjs → project-tsconfig-CwfqUnVp.mjs} +2 -2
  157. package/dist/{protocol-C-pqYJjE.d.mts → protocol-ZH3jP4a7.d.mts} +1 -1
  158. package/dist/providers-BNKRacMr.d.mts +7 -0
  159. package/dist/provision-CNgEBkVA.mjs +3 -0
  160. package/dist/{provision-CSJOjjQk.mjs → provision-Cck2m3jJ.mjs} +11 -25
  161. package/dist/queues-BWKt1Xo4.d.mts +7 -0
  162. package/dist/{requests-CUExwGQQ.mjs → requests-CzX46I0i.mjs} +5 -3
  163. package/dist/resolve-project-BTotl8Nn.mjs +2 -0
  164. package/dist/{resolve-project--Vxawf7z.mjs → resolve-project-Xvis70DG.mjs} +2 -8
  165. package/dist/response-Tn7rU0MV.mjs +30 -0
  166. package/dist/{rollback-CDNGU1gr.mjs → rollback-BEeyc73H.mjs} +6 -4
  167. package/dist/{rolldown-runtime-rQ84J-ij.mjs → rolldown-runtime-DXIUcv95.mjs} +1 -10
  168. package/dist/route-types-Id82-veQ.mjs +280 -0
  169. package/dist/{local-d1-D2I6Ox5F.mjs → runner-BGVsGgkb.mjs} +6 -114
  170. package/dist/runner-CQs_cDSG.mjs +2 -0
  171. package/dist/runner-mysql-1o47achK.mjs +2 -0
  172. package/dist/{runner-mysql-7BPUNGmL.mjs → runner-mysql-BhwMk2Bm.mjs} +2 -9
  173. package/dist/{runner-pg-BkEza-dX.mjs → runner-pg-CJ_JeGF6.mjs} +2 -9
  174. package/dist/runner-pg-D7z01mQS.mjs +2 -0
  175. package/dist/runtime/ai.mjs +1 -1
  176. package/dist/runtime/auth-client-react.d.mts +2 -6
  177. package/dist/runtime/auth-client-react.mjs +1 -5
  178. package/dist/runtime/auth-client-solid.d.mts +2 -6
  179. package/dist/runtime/auth-client-solid.mjs +1 -5
  180. package/dist/runtime/auth-client-svelte.d.mts +2 -6
  181. package/dist/runtime/auth-client-svelte.mjs +1 -5
  182. package/dist/runtime/auth-client-vue.d.mts +2 -6
  183. package/dist/runtime/auth-client-vue.mjs +1 -5
  184. package/dist/runtime/auth-client.d.mts +2 -6
  185. package/dist/runtime/auth-client.mjs +1 -5
  186. package/dist/runtime/auth.mjs +1 -21
  187. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  188. package/dist/runtime/better-auth-mysql.mjs +1 -1
  189. package/dist/runtime/better-auth-pg.d.mts +1 -1
  190. package/dist/runtime/better-auth-pg.mjs +1 -1
  191. package/dist/runtime/better-auth.d.mts +1 -1
  192. package/dist/runtime/better-auth.mjs +1 -1
  193. package/dist/runtime/client-react.d.mts +3 -3
  194. package/dist/runtime/client-react.mjs +3 -3
  195. package/dist/runtime/client-solid.d.mts +3 -3
  196. package/dist/runtime/client-solid.mjs +3 -3
  197. package/dist/runtime/client-svelte.d.mts +3 -3
  198. package/dist/runtime/client-svelte.mjs +3 -3
  199. package/dist/runtime/client-vue.d.mts +3 -3
  200. package/dist/runtime/client-vue.mjs +3 -3
  201. package/dist/runtime/client.d.mts +3 -3
  202. package/dist/runtime/client.mjs +3 -3
  203. package/dist/runtime/db.mjs +1 -1
  204. package/dist/runtime/durable.mjs +1 -1
  205. package/dist/runtime/email/testing.mjs +1 -1
  206. package/dist/runtime/env-helpers.mjs +1 -135
  207. package/dist/runtime/env-public-client.mjs +1 -1
  208. package/dist/runtime/env-public.mjs +2 -2
  209. package/dist/runtime/env.mjs +1 -77
  210. package/dist/runtime/fetch-stream.d.mts +2 -49
  211. package/dist/runtime/fetch-stream.mjs +2 -80
  212. package/dist/runtime/fetch.d.mts +2 -57
  213. package/dist/runtime/fetch.mjs +2 -17
  214. package/dist/runtime/handler.d.mts +1 -1
  215. package/dist/runtime/handler.mjs +1 -149
  216. package/dist/runtime/kv.mjs +1 -1
  217. package/dist/runtime/live-client.d.mts +1 -1
  218. package/dist/runtime/live-server.mjs +2 -2
  219. package/dist/runtime/live.d.mts +2 -104
  220. package/dist/runtime/live.mjs +1 -410
  221. package/dist/runtime/migration-handler-mysql.d.mts +1 -1
  222. package/dist/runtime/migration-handler-pg.d.mts +1 -1
  223. package/dist/runtime/migration-handler.d.mts +2 -50
  224. package/dist/runtime/queues.d.mts +2 -6
  225. package/dist/runtime/queues.mjs +1 -1
  226. package/dist/runtime/remote/index.mjs +49 -8
  227. package/dist/runtime/response.mjs +1 -29
  228. package/dist/runtime/sandbox.d.mts +4 -56
  229. package/dist/runtime/sandbox.mjs +82 -221
  230. package/dist/runtime/sse.mjs +1 -171
  231. package/dist/runtime/storage.mjs +1 -1
  232. package/dist/runtime/validator.d.mts +1 -1
  233. package/dist/runtime/validator.mjs +1 -71
  234. package/dist/runtime/ws-server.d.mts +2 -2
  235. package/dist/runtime/ws-server.mjs +2 -2
  236. package/dist/runtime/ws.d.mts +2 -121
  237. package/dist/{scan-CpK-57ug.mjs → scan-DJbooZm2.mjs} +3 -3
  238. package/dist/{scan-BMH4rzlv.mjs → scan-DdDvRCU1.mjs} +8 -26
  239. package/dist/{secret-Bzzi2e9E.mjs → secret-wnTel5Yw.mjs} +8 -6
  240. package/dist/serialize-BPvnNQuA.mjs +14 -0
  241. package/dist/serialize-CfSwWfF2.d.mts +10 -0
  242. package/dist/{skills-C0RvGjeE.mjs → skills-B-690E7h.mjs} +3 -2
  243. package/dist/sse-BaC1jXko.mjs +172 -0
  244. package/dist/{subcommand-prompt-Bmyn5Rlc.mjs → subcommand-prompt-Gj3VzLIh.mjs} +2 -1
  245. package/dist/sveltekit.d.mts +2 -1
  246. package/dist/sveltekit.mjs +3 -2
  247. package/dist/validate-DqJ33oHj.mjs +2 -0
  248. package/dist/validate-qNhV00PD.mjs +180 -0
  249. package/dist/validator-BTOu0fB0.mjs +72 -0
  250. package/dist/{wrangler--imS8n0d.mjs → wrangler-D01qs6VB.mjs} +259 -71
  251. package/dist/ws-BwcqizuH.d.mts +122 -0
  252. package/dist/{yarn-pnp-DxSInkzL.mjs → yarn-pnp-CVEc3gE7.mjs} +1 -1
  253. package/package.json +19 -8
  254. package/skills/void/SKILL.md +7 -5
  255. package/skills/void/docs/guide/ai.md +3 -3
  256. package/skills/void/docs/guide/app-types.md +12 -11
  257. package/skills/void/docs/guide/auth.md +2 -2
  258. package/skills/void/docs/guide/database/d1.md +1 -1
  259. package/skills/void/docs/guide/database/mysql.md +1 -1
  260. package/skills/void/docs/guide/database/postgresql.md +3 -3
  261. package/skills/void/docs/guide/deployment.md +16 -16
  262. package/skills/void/docs/guide/durable-state.md +2 -2
  263. package/skills/void/docs/guide/edge/headers.md +3 -3
  264. package/skills/void/docs/guide/edge/prerendering.md +1 -1
  265. package/skills/void/docs/guide/edge/redirects.md +4 -4
  266. package/skills/void/docs/guide/edge/revalidation.md +6 -6
  267. package/skills/void/docs/guide/edge/rewrites.md +28 -27
  268. package/skills/void/docs/guide/edge/static-assets.md +1 -1
  269. package/skills/void/docs/guide/email.md +27 -25
  270. package/skills/void/docs/guide/env-migration.md +1 -1
  271. package/skills/void/docs/guide/index.md +1 -1
  272. package/skills/void/docs/guide/pages-routing/head.md +1 -1
  273. package/skills/void/docs/guide/platform/administration/access.md +171 -0
  274. package/skills/void/docs/guide/platform/administration/email.md +121 -0
  275. package/skills/void/docs/guide/platform/administration/operations.md +97 -0
  276. package/skills/void/docs/guide/platform/administration/projects.md +56 -0
  277. package/skills/void/docs/guide/platform/development/local.md +119 -0
  278. package/skills/void/docs/guide/platform/development/runtime.md +124 -0
  279. package/skills/void/docs/guide/platform/development/schema-ci.md +95 -0
  280. package/skills/void/docs/guide/platform/installation/ci.md +58 -0
  281. package/skills/void/docs/guide/platform/installation/credentials.md +90 -0
  282. package/skills/void/docs/guide/platform/installation/domains.md +68 -0
  283. package/skills/void/docs/guide/platform/installation/first-deployment.md +82 -0
  284. package/skills/void/docs/guide/platform/installation/maintenance.md +137 -0
  285. package/skills/void/docs/guide/platform/installation/prerequisites.md +88 -0
  286. package/skills/void/docs/guide/platform/installation/setup.md +169 -0
  287. package/skills/void/docs/guide/platform/installation/uninstall.md +54 -0
  288. package/skills/void/docs/guide/platform-administration.md +6 -414
  289. package/skills/void/docs/guide/platform-development.md +5 -316
  290. package/skills/void/docs/guide/project-collaboration.md +1 -1
  291. package/skills/void/docs/guide/remote-dev.md +2 -2
  292. package/skills/void/docs/guide/sandboxes.md +10 -25
  293. package/skills/void/docs/guide/self-hosted-platform.md +11 -694
  294. package/skills/void/docs/guide/ssg.md +1 -1
  295. package/skills/void/docs/guide/websockets.md +1 -1
  296. package/skills/void/docs/integrations/cloudflare.md +86 -84
  297. package/skills/void/docs/integrations/frameworks/analog.md +14 -9
  298. package/skills/void/docs/integrations/frameworks/astro.md +14 -10
  299. package/skills/void/docs/integrations/frameworks/nuxt.md +14 -9
  300. package/skills/void/docs/integrations/frameworks/overview.md +35 -29
  301. package/skills/void/docs/integrations/frameworks/react-router.md +1 -1
  302. package/skills/void/docs/integrations/frameworks/sveltekit.md +33 -30
  303. package/skills/void/docs/integrations/frameworks/tanstack-start.md +1 -1
  304. package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -5
  305. package/skills/void/docs/reference/api.md +55 -38
  306. package/skills/void/docs/reference/cli.md +60 -34
  307. package/skills/void/docs/reference/config.md +57 -34
  308. package/skills/void/docs/reference/resource-inference.md +10 -10
  309. package/skills/void/docs/reference/structure.md +2 -2
  310. package/dist/validate-tBBN_dXH.mjs +0 -505
@@ -1,90 +1,2 @@
1
- //#region src/pages/head-client.ts
2
- const ATTR = "data-void-head";
3
- function elementDescriptorSignature(descriptor) {
4
- const attrs = Object.entries(descriptor.attrs).sort(([a], [b]) => a.localeCompare(b));
5
- return `${encodeURIComponent(descriptor.tag)}:${attrs.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")}`;
6
- }
7
- function elementSignature(el) {
8
- const attrs = {};
9
- for (const attr of Array.from(el.attributes)) if (attr.name !== ATTR) attrs[attr.name] = attr.value;
10
- return elementDescriptorSignature({
11
- tag: el.tagName.toLowerCase(),
12
- attrs
13
- });
14
- }
15
- function createHeadElement(descriptor) {
16
- const el = document.createElement(descriptor.tag);
17
- for (const [key, value] of Object.entries(descriptor.attrs)) el.setAttribute(key, value);
18
- el.setAttribute(ATTR, "");
19
- return el;
20
- }
21
- function collectDesiredHeadElements(head) {
22
- const desired = [];
23
- if (head.meta) for (const entry of head.meta) {
24
- const attrs = {};
25
- if (entry.charset) attrs.charset = entry.charset;
26
- if (entry.name) attrs.name = entry.name;
27
- if (entry.property) attrs.property = entry.property;
28
- if (entry.content !== void 0) attrs.content = entry.content;
29
- desired.push({
30
- tag: "meta",
31
- attrs
32
- });
33
- }
34
- if (head.link) for (const entry of head.link) {
35
- const attrs = {};
36
- for (const [key, value] of Object.entries(entry)) if (value != null) attrs[key] = value;
37
- desired.push({
38
- tag: "link",
39
- attrs
40
- });
41
- }
42
- return desired;
43
- }
44
- /**
45
- * Mark SSR-rendered head tags so they are cleaned up on the first SPA navigation.
46
- * Call once after hydration with the initial page's head descriptor.
47
- */
48
- function initClientHead(head) {
49
- if (!head) return;
50
- if (head.meta) for (const entry of head.meta) {
51
- const selector = entry.charset ? "meta[charset]" : entry.property ? `meta[property="${entry.property}"]` : entry.name ? `meta[name="${entry.name}"]` : null;
52
- if (!selector) continue;
53
- const el = document.head.querySelector(selector);
54
- if (el) el.setAttribute(ATTR, "");
55
- }
56
- if (head.link) for (const entry of head.link) {
57
- const el = document.head.querySelector(`link[rel="${entry.rel}"][href="${entry.href}"]`);
58
- if (el) el.setAttribute(ATTR, "");
59
- }
60
- }
61
- /**
62
- * Apply head changes on SPA navigation.
63
- * Preserves existing managed tags when their final attributes are unchanged.
64
- */
65
- function applyClientHead(head) {
66
- const existing = /* @__PURE__ */ new Map();
67
- for (const el of document.head.querySelectorAll(`[${ATTR}]`)) {
68
- const signature = elementSignature(el);
69
- const elements = existing.get(signature);
70
- if (elements) elements.push(el);
71
- else existing.set(signature, [el]);
72
- }
73
- const desiredElements = [];
74
- for (const descriptor of head ? collectDesiredHeadElements(head) : []) {
75
- const signature = elementDescriptorSignature(descriptor);
76
- const elements = existing.get(signature);
77
- const preserved = elements?.shift();
78
- if (elements && elements.length === 0) existing.delete(signature);
79
- desiredElements.push(preserved ?? createHeadElement(descriptor));
80
- }
81
- for (const elements of existing.values()) for (const el of elements) el.remove();
82
- let cursor = document.head.querySelector(`[${ATTR}]`);
83
- for (const el of desiredElements) {
84
- if (el !== cursor) document.head.insertBefore(el, cursor);
85
- cursor = el.nextSibling;
86
- }
87
- if (head?.title !== void 0) document.title = head.title;
88
- }
89
- //#endregion
1
+ import { n as initClientHead, t as applyClientHead } from "../head-client-DzmJGN4C.mjs";
90
2
  export { applyClientHead, initClientHead };
@@ -1,112 +1,2 @@
1
- //#region src/pages/head.ts
2
- /**
3
- * Merge head descriptors with precedence: page > middleware > config.
4
- *
5
- * - `title`: page wins; `titleTemplate` from config wraps it (`%s` replaced)
6
- * - `meta`: page overrides entries with same `name`/`property`; others appended
7
- * - `link`/`script`: concatenated (config first, then middleware, then page)
8
- * - `htmlAttrs`/`bodyAttrs`: shallow merge, page wins conflicts
9
- */
10
- function resolveHead(configHead, middlewareHead, pageHead) {
11
- if (!configHead && !middlewareHead && !pageHead) return;
12
- const result = {};
13
- const title = pageHead?.title ?? middlewareHead?.title ?? configHead?.title;
14
- if (title !== void 0) {
15
- const template = configHead?.titleTemplate;
16
- result.title = template ? template.replace("%s", title) : title;
17
- }
18
- const metaMap = /* @__PURE__ */ new Map();
19
- const metaOrder = [];
20
- for (const layer of [
21
- configHead,
22
- middlewareHead,
23
- pageHead
24
- ]) {
25
- if (!layer?.meta) continue;
26
- for (const entry of layer.meta) {
27
- const key = entry.charset ? "charset" : entry.property ? `property:${entry.property}` : `name:${entry.name ?? ""}`;
28
- if (!metaMap.has(key)) metaOrder.push(key);
29
- metaMap.set(key, entry);
30
- }
31
- }
32
- if (metaMap.size > 0) result.meta = metaOrder.map((key) => metaMap.get(key));
33
- const links = [];
34
- for (const layer of [
35
- configHead,
36
- middlewareHead,
37
- pageHead
38
- ]) if (layer?.link) links.push(...layer.link);
39
- if (links.length > 0) result.link = links;
40
- const scripts = [];
41
- for (const layer of [
42
- configHead,
43
- middlewareHead,
44
- pageHead
45
- ]) if (layer?.script) scripts.push(...layer.script);
46
- if (scripts.length > 0) result.script = scripts;
47
- const htmlAttrs = {};
48
- let hasHtmlAttrs = false;
49
- for (const layer of [
50
- configHead,
51
- middlewareHead,
52
- pageHead
53
- ]) if (layer?.htmlAttrs) {
54
- Object.assign(htmlAttrs, layer.htmlAttrs);
55
- hasHtmlAttrs = true;
56
- }
57
- if (hasHtmlAttrs) result.htmlAttrs = htmlAttrs;
58
- const bodyAttrs = {};
59
- let hasBodyAttrs = false;
60
- for (const layer of [
61
- configHead,
62
- middlewareHead,
63
- pageHead
64
- ]) if (layer?.bodyAttrs) {
65
- Object.assign(bodyAttrs, layer.bodyAttrs);
66
- hasBodyAttrs = true;
67
- }
68
- if (hasBodyAttrs) result.bodyAttrs = bodyAttrs;
69
- if (result.title === void 0 && !result.meta && !result.link && !result.script && !result.htmlAttrs && !result.bodyAttrs) return;
70
- return result;
71
- }
72
- function escapeHtml(s) {
73
- return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
74
- }
75
- /** Serialize a HeadDescriptor to HTML tags for injection into `<head>`. */
76
- function renderHeadToString(head) {
77
- const parts = [];
78
- if (head.title !== void 0) parts.push(`<title>${escapeHtml(head.title)}</title>`);
79
- if (head.meta) for (const entry of head.meta) {
80
- const attrs = [];
81
- if (entry.charset) attrs.push(`charset="${escapeHtml(entry.charset)}"`);
82
- if (entry.name) attrs.push(`name="${escapeHtml(entry.name)}"`);
83
- if (entry.property) attrs.push(`property="${escapeHtml(entry.property)}"`);
84
- if (entry.content !== void 0) attrs.push(`content="${escapeHtml(entry.content)}"`);
85
- parts.push(`<meta ${attrs.join(" ")}>`);
86
- }
87
- if (head.link) for (const entry of head.link) {
88
- const attrs = Object.entries(entry).filter(([, value]) => value != null).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
89
- parts.push(`<link ${attrs}>`);
90
- }
91
- if (head.script) for (const entry of head.script) {
92
- const { innerHTML, ...rest } = entry;
93
- const attrs = Object.entries(rest).filter(([, value]) => value != null).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
94
- if (innerHTML) parts.push(`<script${attrs ? " " + attrs : ""}>${innerHTML}<\/script>`);
95
- else if (attrs) parts.push(`<script ${attrs}><\/script>`);
96
- }
97
- return parts.join("\n");
98
- }
99
- /** Serialize htmlAttrs to an attribute string (includes leading space). */
100
- function renderHtmlAttrs(head) {
101
- if (!head.htmlAttrs) return "";
102
- const attrs = Object.entries(head.htmlAttrs).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
103
- return attrs ? " " + attrs : "";
104
- }
105
- /** Serialize bodyAttrs to an attribute string (includes leading space). */
106
- function renderBodyAttrs(head) {
107
- if (!head.bodyAttrs) return "";
108
- const attrs = Object.entries(head.bodyAttrs).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
109
- return attrs ? " " + attrs : "";
110
- }
111
- //#endregion
1
+ import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-D_QRR5Yd.mjs";
112
2
  export { renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead };
@@ -1,8 +1,7 @@
1
- import "../types-CKWnYgfy.mjs";
2
1
  import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-Do8P4puT.mjs";
2
+ import "../config-DywxBLQC.mjs";
3
3
  import { i as PageDefinition, n as LayoutDefinition, o as PageScanResult, r as NamedLayoutDefinition } from "../types-BAp5AEBU.mjs";
4
- import { serializePageData } from "./serialize.mjs";
5
- import { RewriteDestination } from "void/routes";
4
+ import { t as serializePageData } from "../serialize-CfSwWfF2.mjs";
6
5
  //#region src/project-paths.d.ts
7
6
  type ProjectPaths = {
8
7
  root: string;
@@ -1,10 +1,10 @@
1
- import { o as join } from "../dist-BrsS7cai.mjs";
2
- import { r as resolvePagesDir } from "../project-paths-SK8nMHPp.mjs";
3
- import { f as readConfig } from "../config-uNGuFsI2.mjs";
4
- import { i as parseRedirectsFile } from "../headers-BAHwgHdW.mjs";
5
- import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-CpK-57ug.mjs";
6
- import { renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead } from "./head.mjs";
7
- import { serializePageData } from "./serialize.mjs";
1
+ import { a as join } from "../dist-4WkAWhWx.mjs";
2
+ import { r as resolvePagesDir } from "../project-paths-CKQ-Q5JS.mjs";
3
+ import { m as readConfig } from "../config-Dxr6cTXn.mjs";
4
+ import { i as parseRedirectsFile } from "../headers-B_HBMgi0.mjs";
5
+ import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-DJbooZm2.mjs";
6
+ import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-D_QRR5Yd.mjs";
7
+ import { t as serializePageData } from "../serialize-BPvnNQuA.mjs";
8
8
  //#region src/pages/manifest.ts
9
9
  /**
10
10
  * Generates the component import map and layout tree as code strings.
@@ -1,5 +1,5 @@
1
- import { l as resolve, n as dirname } from "../dist-BrsS7cai.mjs";
2
- import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-CpK-57ug.mjs";
1
+ import { n as dirname, u as resolve } from "../dist-4WkAWhWx.mjs";
2
+ import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-DJbooZm2.mjs";
3
3
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
4
  import { normalizePath } from "vite";
5
5
  //#region src/pages/islands-plugin.ts
@@ -1,30 +1,2 @@
1
- //#region src/pages/prefetch.d.ts
2
- export type CacheForResult = {
3
- stale: number;
4
- expires: number;
5
- };
6
- export type CacheForInput = number | string | [string, string];
7
- export declare function parseCacheFor(value: CacheForInput): CacheForResult;
8
- export type CacheEntry = {
9
- url: string;
10
- method: string;
11
- response: Promise<unknown>;
12
- staleAt: number;
13
- expiresAt: number;
14
- singleUse: boolean;
15
- timer: ReturnType<typeof setTimeout> | null;
16
- };
17
- export declare class PrefetchCache {
18
- private readonly entries;
19
- private key;
20
- has(url: string, method?: string): boolean;
21
- get(url: string, method?: string): CacheEntry | null;
22
- isFresh(entry: CacheEntry): boolean;
23
- isUsable(entry: CacheEntry): boolean;
24
- set(url: string, method: string, response: Promise<unknown>, ttl: CacheForResult): void;
25
- /** Mark entry as consumed — removes it if singleUse. */
26
- consume(url: string, method?: string): void;
27
- flush(url: string, method?: string): void;
28
- flushAll(): void;
29
- }
30
- //#endregion
1
+ import { a as parseCacheFor, i as PrefetchCache, n as CacheForInput, r as CacheForResult, t as CacheEntry } from "../prefetch-Ce6la4EI.mjs";
2
+ export { CacheEntry, CacheForInput, CacheForResult, PrefetchCache, parseCacheFor };
@@ -1,90 +1,2 @@
1
- //#region src/pages/prefetch.ts
2
- const UNITS = {
3
- ms: 1,
4
- s: 1e3,
5
- m: 6e4,
6
- h: 36e5,
7
- d: 864e5
8
- };
9
- function parseUnit(value) {
10
- const match = value.match(/^(\d+(?:\.\d+)?)\s*(ms|s|m|h|d)$/);
11
- if (!match) throw new Error(`prefetch: Invalid cacheFor value '${value}'. Use a number with ms, s, m, h, or d.`);
12
- return Number(match[1]) * UNITS[match[2]];
13
- }
14
- function parseCacheFor(value) {
15
- if (typeof value === "number") return {
16
- stale: value,
17
- expires: value
18
- };
19
- if (Array.isArray(value)) return {
20
- stale: parseUnit(value[0]),
21
- expires: parseUnit(value[1])
22
- };
23
- const ms = parseUnit(value);
24
- return {
25
- stale: ms,
26
- expires: ms
27
- };
28
- }
29
- var PrefetchCache = class {
30
- entries = /* @__PURE__ */ new Map();
31
- key(url, method = "GET") {
32
- return `${method}:${url}`;
33
- }
34
- has(url, method = "GET") {
35
- return this.get(url, method) !== null;
36
- }
37
- get(url, method = "GET") {
38
- const entry = this.entries.get(this.key(url, method));
39
- if (!entry) return null;
40
- if (Date.now() >= entry.expiresAt && !entry.singleUse) {
41
- this.entries.delete(this.key(url, method));
42
- return null;
43
- }
44
- return entry;
45
- }
46
- isFresh(entry) {
47
- return Date.now() < entry.staleAt;
48
- }
49
- isUsable(entry) {
50
- return Date.now() < entry.expiresAt || entry.singleUse;
51
- }
52
- set(url, method, response, ttl) {
53
- const k = this.key(url, method);
54
- const existing = this.entries.get(k);
55
- if (existing && this.isUsable(existing)) return;
56
- const now = Date.now();
57
- const singleUse = ttl.stale === 0 && ttl.expires === 0;
58
- const entry = {
59
- url,
60
- method,
61
- response,
62
- staleAt: now + ttl.stale,
63
- expiresAt: now + ttl.expires,
64
- singleUse,
65
- timer: null
66
- };
67
- if (!singleUse && ttl.expires > 0) entry.timer = setTimeout(() => this.entries.delete(k), ttl.expires);
68
- this.entries.set(k, entry);
69
- }
70
- /** Mark entry as consumed — removes it if singleUse. */
71
- consume(url, method = "GET") {
72
- const entry = this.entries.get(this.key(url, method));
73
- if (entry?.singleUse) {
74
- if (entry.timer) clearTimeout(entry.timer);
75
- this.entries.delete(this.key(url, method));
76
- }
77
- }
78
- flush(url, method = "GET") {
79
- const k = this.key(url, method);
80
- const entry = this.entries.get(k);
81
- if (entry?.timer) clearTimeout(entry.timer);
82
- this.entries.delete(k);
83
- }
84
- flushAll() {
85
- for (const entry of this.entries.values()) if (entry.timer) clearTimeout(entry.timer);
86
- this.entries.clear();
87
- }
88
- };
89
- //#endregion
1
+ import { n as parseCacheFor, t as PrefetchCache } from "../prefetch-Bsc_Pb6c.mjs";
90
2
  export { PrefetchCache, parseCacheFor };
@@ -1,3 +1,3 @@
1
- import { w as ValidationError } from "../handler-D1hLsObx.mjs";
2
- import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-C-pqYJjE.mjs";
1
+ import { w as ValidationError } from "../handler-BXJTXd02.mjs";
2
+ import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-ZH3jP4a7.mjs";
3
3
  export { PageObject, PageRenderResult, ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
@@ -1,7 +1,7 @@
1
- import { isConvertedResponse } from "../runtime/response.mjs";
1
+ import { n as isConvertedResponse } from "../response-Tn7rU0MV.mjs";
2
2
  import { i as ValidationError, r as separateDeferred, t as DEFERRED } from "../defer-YsYDUoii.mjs";
3
- import { renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead } from "./head.mjs";
4
- import { serializePageData } from "./serialize.mjs";
3
+ import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-D_QRR5Yd.mjs";
4
+ import { t as serializePageData } from "../serialize-BPvnNQuA.mjs";
5
5
  //#region src/pages/protocol.ts
6
6
  const POWERED_BY = { "X-Powered-By": "Void" };
7
7
  const RENDER_ERROR_ASSET_TAGS_KEY = "__voidPageAssetTags";
@@ -1,9 +1,2 @@
1
- //#region src/pages/serialize.d.ts
2
- /**
3
- * Escape JSON for embedding inside an inline `<script type="application/json">`
4
- * tag. Replaces `<`, `>`, `&`, U+2028, U+2029 with their `\uXXXX` JSON escape
5
- * sequences so the script tag cannot be closed early and the payload survives
6
- * `JSON.parse` on hydration.
7
- */
8
- export declare function serializePageData(pageObj: unknown): string;
9
- //#endregion
1
+ import { t as serializePageData } from "../serialize-CfSwWfF2.mjs";
2
+ export { serializePageData };
@@ -1,14 +1,2 @@
1
- //#region src/pages/serialize.ts
2
- /**
3
- * Escape JSON for embedding inside an inline `<script type="application/json">`
4
- * tag. Replaces `<`, `>`, `&`, U+2028, U+2029 with their `\uXXXX` JSON escape
5
- * sequences so the script tag cannot be closed early and the payload survives
6
- * `JSON.parse` on hydration.
7
- */
8
- function serializePageData(pageObj) {
9
- return JSON.stringify(pageObj).replace(/[<>&\u2028\u2029]/g, (c) => {
10
- return `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`;
11
- });
12
- }
13
- //#endregion
1
+ import { t as serializePageData } from "../serialize-BPvnNQuA.mjs";
14
2
  export { serializePageData };
@@ -0,0 +1,256 @@
1
+ import { t as canonicalJson } from "./canonical-json-DuDiiUsQ.mjs";
2
+ import { createHash } from "node:crypto";
3
+ //#region src/migrations/tokenize.ts
4
+ function* tokenizeSql(sql) {
5
+ const sqlLength = sql.length;
6
+ let index = 0;
7
+ let runStart = 0;
8
+ const flushRun = (upTo) => {
9
+ if (upTo > runStart) return {
10
+ kind: "sql",
11
+ start: runStart,
12
+ end: upTo
13
+ };
14
+ };
15
+ while (index < sqlLength) {
16
+ const character = sql[index];
17
+ const next = index + 1 < sqlLength ? sql[index + 1] : "";
18
+ if (character === "-" && next === "-") {
19
+ const run = flushRun(index);
20
+ if (run) yield run;
21
+ let scanIndex = index + 2;
22
+ while (scanIndex < sqlLength && sql[scanIndex] !== "\n") scanIndex++;
23
+ yield {
24
+ kind: "line-comment",
25
+ start: index,
26
+ end: scanIndex
27
+ };
28
+ index = scanIndex;
29
+ runStart = index;
30
+ continue;
31
+ }
32
+ if (character === "/" && next === "*") {
33
+ const run = flushRun(index);
34
+ if (run) yield run;
35
+ let scanIndex = index + 2;
36
+ while (scanIndex < sqlLength - 1 && !(sql[scanIndex] === "*" && sql[scanIndex + 1] === "/")) scanIndex++;
37
+ const end = Math.min(scanIndex + 2, sqlLength);
38
+ yield {
39
+ kind: "block-comment",
40
+ start: index,
41
+ end
42
+ };
43
+ index = end;
44
+ runStart = index;
45
+ continue;
46
+ }
47
+ if (character === "'") {
48
+ const run = flushRun(index);
49
+ if (run) yield run;
50
+ let scanIndex = index + 1;
51
+ while (scanIndex < sqlLength) {
52
+ if (sql[scanIndex] === "'" && sql[scanIndex + 1] === "'") {
53
+ scanIndex += 2;
54
+ continue;
55
+ }
56
+ if (sql[scanIndex] === "'") {
57
+ scanIndex++;
58
+ break;
59
+ }
60
+ scanIndex++;
61
+ }
62
+ yield {
63
+ kind: "string",
64
+ start: index,
65
+ end: scanIndex
66
+ };
67
+ index = scanIndex;
68
+ runStart = index;
69
+ continue;
70
+ }
71
+ if (character === "\"" || character === "`" || character === "[") {
72
+ const run = flushRun(index);
73
+ if (run) yield run;
74
+ const close = character === "[" ? "]" : character;
75
+ let scanIndex = index + 1;
76
+ while (scanIndex < sqlLength) {
77
+ if (close !== "]" && sql[scanIndex] === close && sql[scanIndex + 1] === close) {
78
+ scanIndex += 2;
79
+ continue;
80
+ }
81
+ if (sql[scanIndex] === close) {
82
+ scanIndex++;
83
+ break;
84
+ }
85
+ scanIndex++;
86
+ }
87
+ yield {
88
+ kind: "ident-quote",
89
+ open: character,
90
+ start: index,
91
+ end: scanIndex
92
+ };
93
+ index = scanIndex;
94
+ runStart = index;
95
+ continue;
96
+ }
97
+ index++;
98
+ }
99
+ const tail = flushRun(sqlLength);
100
+ if (tail) yield tail;
101
+ }
102
+ const UNSPLIT_MULTI_STATEMENT_PRAGMA = "-- void:allow-unsplit-multi-statement";
103
+ const DESTRUCTIVE_PRAGMA = "-- void:allow-destructive";
104
+ function canonicalSql(sql) {
105
+ return (sql.charCodeAt(0) === 65279 ? sql.slice(1) : sql).replace(/\r\n?/g, "\n");
106
+ }
107
+ function sha256Hex(value) {
108
+ return `sha256:${createHash("sha256").update(value).digest("hex")}`;
109
+ }
110
+ function getPlanHashInput(plan) {
111
+ const base = {
112
+ classifierVersion: plan.classifierVersion,
113
+ dialect: plan.dialect,
114
+ kind: plan.kind,
115
+ name: plan.name,
116
+ sqlHash: plan.sqlHash,
117
+ stability: plan.stability
118
+ };
119
+ if (plan.kind === "breakpoint-framed") base.statements = plan.statements;
120
+ return base;
121
+ }
122
+ function hashPlan(plan) {
123
+ return sha256Hex(canonicalJson(getPlanHashInput(plan)));
124
+ }
125
+ function computeMigrationListHash(plans) {
126
+ return sha256Hex(canonicalJson(plans.map((plan) => [
127
+ plan.name,
128
+ plan.sqlHash,
129
+ plan.planHash
130
+ ])));
131
+ }
132
+ function isStandalonePragmaLine(line, pragma) {
133
+ return line.trim() === pragma;
134
+ }
135
+ function hasStandalonePragma(sql, pragma) {
136
+ return canonicalSql(sql).split("\n").some((line) => isStandalonePragmaLine(line, pragma));
137
+ }
138
+ function isBreakpointComment(text) {
139
+ return text.trim() === "--> statement-breakpoint";
140
+ }
141
+ function splitBreakpointFramedSql(sql) {
142
+ const normalized = canonicalSql(sql);
143
+ const statements = [];
144
+ let cursor = 0;
145
+ for (const segment of tokenizeSql(normalized)) {
146
+ if (segment.kind !== "line-comment") continue;
147
+ if (isBreakpointComment(normalized.slice(segment.start, segment.end))) {
148
+ const statement = normalized.slice(cursor, segment.start).trim();
149
+ if (statement) statements.push(statement);
150
+ cursor = segment.end;
151
+ }
152
+ }
153
+ const statement = normalized.slice(cursor).trim();
154
+ if (statement) statements.push(statement);
155
+ return statements;
156
+ }
157
+ function getExecutableSql(sql) {
158
+ let out = "";
159
+ for (const segment of tokenizeSql(sql)) if (segment.kind === "sql") out += sql.slice(segment.start, segment.end);
160
+ else out += " ".repeat(segment.end - segment.start);
161
+ return out;
162
+ }
163
+ function hasStatementBreakpointOutsideLiterals(sql) {
164
+ const normalized = canonicalSql(sql);
165
+ for (const segment of tokenizeSql(normalized)) {
166
+ if (segment.kind !== "line-comment") continue;
167
+ if (isBreakpointComment(normalized.slice(segment.start, segment.end))) return true;
168
+ }
169
+ return false;
170
+ }
171
+ function isSingleStatement(sql) {
172
+ const normalized = canonicalSql(sql);
173
+ let statements = 0;
174
+ let inStatement = false;
175
+ for (const segment of tokenizeSql(normalized)) {
176
+ if (segment.kind === "line-comment" || segment.kind === "block-comment") continue;
177
+ if (segment.kind === "string" || segment.kind === "ident-quote") {
178
+ inStatement = true;
179
+ continue;
180
+ }
181
+ for (let index = segment.start; index < segment.end; index++) {
182
+ const character = normalized[index];
183
+ if (character === ";") {
184
+ if (inStatement) {
185
+ statements++;
186
+ inStatement = false;
187
+ }
188
+ continue;
189
+ }
190
+ if (character !== " " && character !== " " && character !== "\n" && character !== "\r") inStatement = true;
191
+ }
192
+ }
193
+ if (inStatement) statements++;
194
+ return statements === 1;
195
+ }
196
+ function includesTransactionControl(sql) {
197
+ return getExecutableSql(sql).match(/(?:^|;)\s*(BEGIN(?:\s+(?:DEFERRED|IMMEDIATE|EXCLUSIVE|TRANSACTION))?|COMMIT|ROLLBACK|SAVEPOINT|RELEASE)\b/i)?.[1]?.toUpperCase() ?? null;
198
+ }
199
+ function classifyMigration(migration) {
200
+ const sql = canonicalSql(migration.sql);
201
+ const sqlHash = sha256Hex(sql);
202
+ const transactionControl = includesTransactionControl(sql);
203
+ if (transactionControl) throw new Error(`Migration ${migration.name} contains ${transactionControl}; Void owns the stable D1 transaction boundary.`);
204
+ let base;
205
+ const warnings = [];
206
+ if (hasStatementBreakpointOutsideLiterals(sql)) {
207
+ const statements = splitBreakpointFramedSql(sql);
208
+ if (statements.length === 0) throw new Error(`Migration ${migration.name} has statement breakpoints but no SQL statements.`);
209
+ base = {
210
+ classifierVersion: 1,
211
+ dialect: "sqlite",
212
+ kind: "breakpoint-framed",
213
+ name: migration.name,
214
+ sqlHash,
215
+ stability: "stable",
216
+ statements
217
+ };
218
+ } else if (isSingleStatement(sql)) base = {
219
+ classifierVersion: 1,
220
+ dialect: "sqlite",
221
+ kind: "single-statement",
222
+ name: migration.name,
223
+ sqlHash,
224
+ stability: "stable"
225
+ };
226
+ else {
227
+ const allowLegacy = hasStandalonePragma(sql, UNSPLIT_MULTI_STATEMENT_PRAGMA);
228
+ warnings.push(`Migration ${migration.name} contains multiple statements without Drizzle statement breakpoints; it will run through the legacy D1 path.`);
229
+ base = {
230
+ allowLegacy,
231
+ classifierVersion: 1,
232
+ dialect: "sqlite",
233
+ kind: "legacy-unsplit-multi-statement",
234
+ name: migration.name,
235
+ sqlHash,
236
+ stability: "legacy"
237
+ };
238
+ }
239
+ return {
240
+ ...base,
241
+ planHash: hashPlan(base),
242
+ ...warnings.length > 0 ? { warnings } : {}
243
+ };
244
+ }
245
+ function buildMigrationPlanBundle(migrations) {
246
+ const plans = migrations.map((migration) => classifyMigration(migration));
247
+ return {
248
+ classifierVersion: 1,
249
+ destructiveValidation: "passed",
250
+ migrationListHash: computeMigrationListHash(plans),
251
+ plans,
252
+ protocolVersion: 2
253
+ };
254
+ }
255
+ //#endregion
256
+ export { classifyMigration as a, isSingleStatement as c, canonicalSql as i, sha256Hex as l, UNSPLIT_MULTI_STATEMENT_PRAGMA as n, computeMigrationListHash as o, buildMigrationPlanBundle as r, hasStandalonePragma as s, DESTRUCTIVE_PRAGMA as t, tokenizeSql as u };
@@ -0,0 +1,2 @@
1
+ import { r as buildMigrationPlanBundle } from "./plan-BEZ8VJW0.mjs";
2
+ export { buildMigrationPlanBundle };