void 0.1.6 → 0.7.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 (333) hide show
  1. package/AGENT_PROMPT.md +15 -0
  2. package/README.md +62 -123
  3. package/dist/auth-BdsJ0Aff.d.mts +43 -0
  4. package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
  5. package/dist/auth-migrations-BAtAck2g.mjs +117 -0
  6. package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
  7. package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
  8. package/dist/cache-W82I8ihI.mjs +47 -0
  9. package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
  10. package/dist/cf-access-Dee5cXxL.mjs +22 -0
  11. package/dist/chunk-DJd-R1mw.mjs +34 -0
  12. package/dist/cli/cli.d.mts +1 -0
  13. package/dist/cli/cli.mjs +1807 -0
  14. package/dist/client-snXOjrp1.mjs +565 -0
  15. package/dist/collect-CjeZgz5D.mjs +55 -0
  16. package/dist/config-BIa9HwVX.mjs +573 -0
  17. package/dist/config-BzM9Dy7T.mjs +37 -0
  18. package/dist/config-CvHtTM0q.mjs +30 -0
  19. package/dist/create-project-BIA15W7z.mjs +90 -0
  20. package/dist/db-DsRoMcfN.mjs +895 -0
  21. package/dist/defer-DcxEsVH1.mjs +49 -0
  22. package/dist/delete-DAP6yDc7.mjs +64 -0
  23. package/dist/deploy-BPKblFx6.mjs +2424 -0
  24. package/dist/discover-B7FkXBLB.mjs +40 -0
  25. package/dist/dist-DUyXJLkq.mjs +2667 -0
  26. package/dist/dist-Dayj3gCK.mjs +1287 -0
  27. package/dist/domain-BGofcQ6I.mjs +79 -0
  28. package/dist/dotenv-DwO4ti0Z.mjs +173 -0
  29. package/dist/drizzle-NnudE_UN.mjs +232 -0
  30. package/dist/env-CyG3tvU0.mjs +301 -0
  31. package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
  32. package/dist/env-raw-BDL4TvdN.mjs +32 -0
  33. package/dist/env-types-DknSA4SO.mjs +64 -0
  34. package/dist/env-validation-DJKjR_8q.mjs +163 -0
  35. package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
  36. package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
  37. package/dist/gen-U0Ktr4Zd.mjs +761 -0
  38. package/dist/handler-B0ds0OHJ.d.mts +269 -0
  39. package/dist/head-P-egrtFE.d.mts +45 -0
  40. package/dist/headers-DCXc7mDs.mjs +279 -0
  41. package/dist/index.d.mts +32 -0
  42. package/dist/index.mjs +4695 -0
  43. package/dist/init-C7wS5iGP.mjs +2625 -0
  44. package/dist/link-p2R6NbgN.mjs +49 -0
  45. package/dist/list-Bfel-QLc.mjs +113 -0
  46. package/dist/log-DXdqnmhF.mjs +26 -0
  47. package/dist/login-CkcXUiIu.mjs +72 -0
  48. package/dist/logs-DmkrRvx6.mjs +98 -0
  49. package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
  50. package/dist/mcp-CaQzfeUi.mjs +373 -0
  51. package/dist/node-DDfXj10V.mjs +54 -0
  52. package/dist/output-BwlcIYSR.mjs +139 -0
  53. package/dist/pages/client.d.mts +198 -0
  54. package/dist/pages/client.mjs +980 -0
  55. package/dist/pages/head-client.d.mts +15 -0
  56. package/dist/pages/head-client.mjs +90 -0
  57. package/dist/pages/head.d.mts +2 -0
  58. package/dist/pages/head.mjs +112 -0
  59. package/dist/pages/index.d.mts +38 -0
  60. package/dist/pages/index.mjs +76 -0
  61. package/dist/pages/islands-plugin.d.mts +50 -0
  62. package/dist/pages/islands-plugin.mjs +195 -0
  63. package/dist/pages/prefetch.d.mts +31 -0
  64. package/dist/pages/prefetch.mjs +90 -0
  65. package/dist/pages/protocol.d.mts +3 -0
  66. package/dist/pages/protocol.mjs +193 -0
  67. package/dist/pages/serialize.d.mts +10 -0
  68. package/dist/pages/serialize.mjs +14 -0
  69. package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
  70. package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
  71. package/dist/prepare-BAtWufvm.mjs +99 -0
  72. package/dist/preset-D4I73kT4.mjs +221 -0
  73. package/dist/project-TqORyHn8.mjs +72 -0
  74. package/dist/project-cmd-B7lQp3F3.mjs +67 -0
  75. package/dist/project-slug-CKam8lF9.mjs +11 -0
  76. package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
  77. package/dist/protocol-BWzXs2A2.d.mts +34 -0
  78. package/dist/providers-B3aMxWzP.mjs +67 -0
  79. package/dist/resolve-project-Br5BR03U.mjs +29 -0
  80. package/dist/rollback-gyC59l7U.mjs +92 -0
  81. package/dist/route-types-DReF1gUY.mjs +255 -0
  82. package/dist/routes-stub.d.mts +55 -0
  83. package/dist/routes-stub.mjs +1 -0
  84. package/dist/runner-6Ep3fNQu.mjs +123 -0
  85. package/dist/runner-pg-D0wWHYnr.mjs +57 -0
  86. package/dist/runtime/ai.d.mts +127 -0
  87. package/dist/runtime/ai.mjs +348 -0
  88. package/dist/runtime/auth-client-react.d.mts +8 -0
  89. package/dist/runtime/auth-client-react.mjs +6 -0
  90. package/dist/runtime/auth-client-solid.d.mts +8 -0
  91. package/dist/runtime/auth-client-solid.mjs +6 -0
  92. package/dist/runtime/auth-client-svelte.d.mts +8 -0
  93. package/dist/runtime/auth-client-svelte.mjs +6 -0
  94. package/dist/runtime/auth-client-vue.d.mts +8 -0
  95. package/dist/runtime/auth-client-vue.mjs +6 -0
  96. package/dist/runtime/auth-client.d.mts +8 -0
  97. package/dist/runtime/auth-client.mjs +6 -0
  98. package/dist/runtime/auth.d.mts +2 -0
  99. package/dist/runtime/auth.mjs +22 -0
  100. package/dist/runtime/better-auth-pg.d.mts +11 -0
  101. package/dist/runtime/better-auth-pg.mjs +51 -0
  102. package/dist/runtime/better-auth.d.mts +11 -0
  103. package/dist/runtime/better-auth.mjs +33 -0
  104. package/dist/runtime/client.d.mts +6 -0
  105. package/dist/runtime/client.mjs +5 -0
  106. package/dist/runtime/db-pg.d.mts +2 -0
  107. package/dist/runtime/db-pg.mjs +1 -0
  108. package/dist/runtime/db.d.mts +17 -0
  109. package/dist/runtime/db.mjs +30 -0
  110. package/dist/runtime/drizzle-arktype.d.mts +1 -0
  111. package/dist/runtime/drizzle-arktype.mjs +2 -0
  112. package/dist/runtime/drizzle-valibot.d.mts +1 -0
  113. package/dist/runtime/drizzle-valibot.mjs +2 -0
  114. package/dist/runtime/drizzle-zod.d.mts +1 -0
  115. package/dist/runtime/drizzle-zod.mjs +2 -0
  116. package/dist/runtime/env-helpers.d.mts +2 -0
  117. package/dist/runtime/env-helpers.mjs +173 -0
  118. package/dist/runtime/env-public-client.d.mts +22 -0
  119. package/dist/runtime/env-public-client.mjs +54 -0
  120. package/dist/runtime/env-public.d.mts +143 -0
  121. package/dist/runtime/env-public.mjs +366 -0
  122. package/dist/runtime/env.d.mts +13 -0
  123. package/dist/runtime/env.mjs +51 -0
  124. package/dist/runtime/fetch-stream.d.mts +51 -0
  125. package/dist/runtime/fetch-stream.mjs +81 -0
  126. package/dist/runtime/fetch.d.mts +59 -0
  127. package/dist/runtime/fetch.mjs +18 -0
  128. package/dist/runtime/handler.d.mts +3 -0
  129. package/dist/runtime/handler.mjs +85 -0
  130. package/dist/runtime/isr.d.mts +26 -0
  131. package/dist/runtime/isr.mjs +43 -0
  132. package/dist/runtime/kv.d.mts +48 -0
  133. package/dist/runtime/kv.mjs +106 -0
  134. package/dist/runtime/log.d.mts +24 -0
  135. package/dist/runtime/log.mjs +31 -0
  136. package/dist/runtime/migration-handler-pg.d.mts +6 -0
  137. package/dist/runtime/migration-handler-pg.mjs +85 -0
  138. package/dist/runtime/migration-handler.d.mts +19 -0
  139. package/dist/runtime/migration-handler.mjs +92 -0
  140. package/dist/runtime/queues.d.mts +7 -0
  141. package/dist/runtime/queues.mjs +8 -0
  142. package/dist/runtime/remote/binding-handler.d.mts +15 -0
  143. package/dist/runtime/remote/binding-handler.mjs +208 -0
  144. package/dist/runtime/remote/index.d.mts +8 -0
  145. package/dist/runtime/remote/index.mjs +461 -0
  146. package/dist/runtime/response.d.mts +14 -0
  147. package/dist/runtime/response.mjs +30 -0
  148. package/dist/runtime/sandbox.d.mts +17 -0
  149. package/dist/runtime/sandbox.mjs +19 -0
  150. package/dist/runtime/schema-d1.d.mts +1 -0
  151. package/dist/runtime/schema-d1.mjs +2 -0
  152. package/dist/runtime/schema-pg.d.mts +1 -0
  153. package/dist/runtime/schema-pg.mjs +2 -0
  154. package/dist/runtime/seed.d.mts +30 -0
  155. package/dist/runtime/seed.mjs +6 -0
  156. package/dist/runtime/storage.d.mts +7 -0
  157. package/dist/runtime/storage.mjs +14 -0
  158. package/dist/runtime/validator.d.mts +2 -0
  159. package/dist/runtime/validator.mjs +72 -0
  160. package/dist/runtime/ws-server.d.mts +26 -0
  161. package/dist/runtime/ws-server.mjs +296 -0
  162. package/dist/runtime/ws.d.mts +123 -0
  163. package/dist/runtime/ws.mjs +103 -0
  164. package/dist/scan-Ba4hFwlH.mjs +324 -0
  165. package/dist/scan-C6HMEIdW.mjs +318 -0
  166. package/dist/secret-CeRSukgM.mjs +109 -0
  167. package/dist/skills-ipldjlKE.mjs +62 -0
  168. package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
  169. package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
  170. package/dist/sveltekit.d.mts +20 -0
  171. package/dist/sveltekit.mjs +61 -0
  172. package/dist/types-mHOEwpW4.d.mts +57 -0
  173. package/dist/validate-CaMavMxu.mjs +146 -0
  174. package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
  175. package/getting-started-prompt.txt +26 -0
  176. package/package.json +322 -30
  177. package/schema.json +364 -0
  178. package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
  179. package/skills/void/SKILL.md +75 -0
  180. package/skills/void/command/void.md +7 -0
  181. package/skills/void/docs/guide/ai.md +235 -0
  182. package/skills/void/docs/guide/app-types.md +103 -0
  183. package/skills/void/docs/guide/auth.md +257 -0
  184. package/skills/void/docs/guide/database/d1.md +106 -0
  185. package/skills/void/docs/guide/database/postgresql.md +106 -0
  186. package/skills/void/docs/guide/database.md +418 -0
  187. package/skills/void/docs/guide/deployment.md +98 -0
  188. package/skills/void/docs/guide/edge/headers.md +79 -0
  189. package/skills/void/docs/guide/edge/prerendering.md +83 -0
  190. package/skills/void/docs/guide/edge/redirects.md +116 -0
  191. package/skills/void/docs/guide/edge/revalidation.md +131 -0
  192. package/skills/void/docs/guide/edge/rewrites.md +354 -0
  193. package/skills/void/docs/guide/edge/static-assets.md +72 -0
  194. package/skills/void/docs/guide/env-vars.md +298 -0
  195. package/skills/void/docs/guide/index.md +80 -0
  196. package/skills/void/docs/guide/jobs.md +91 -0
  197. package/skills/void/docs/guide/kv.md +107 -0
  198. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
  199. package/skills/void/docs/guide/pages-routing/head.md +130 -0
  200. package/skills/void/docs/guide/pages-routing/islands.md +405 -0
  201. package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
  202. package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
  203. package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
  204. package/skills/void/docs/guide/pages-routing/overview.md +236 -0
  205. package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
  206. package/skills/void/docs/guide/queues.md +140 -0
  207. package/skills/void/docs/guide/quickstart.md +233 -0
  208. package/skills/void/docs/guide/remote-dev.md +67 -0
  209. package/skills/void/docs/guide/sandboxes.md +82 -0
  210. package/skills/void/docs/guide/server-routing.md +246 -0
  211. package/skills/void/docs/guide/ssg.md +74 -0
  212. package/skills/void/docs/guide/ssr.md +105 -0
  213. package/skills/void/docs/guide/storage.md +67 -0
  214. package/skills/void/docs/guide/type-safety.md +179 -0
  215. package/skills/void/docs/guide/typed-fetch.md +113 -0
  216. package/skills/void/docs/guide/websockets.md +190 -0
  217. package/skills/void/docs/index.md +48 -0
  218. package/skills/void/docs/integrations/agents.md +84 -0
  219. package/skills/void/docs/integrations/cloudflare.md +284 -0
  220. package/skills/void/docs/integrations/frameworks/analog.md +182 -0
  221. package/skills/void/docs/integrations/frameworks/astro.md +197 -0
  222. package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
  223. package/skills/void/docs/integrations/frameworks/overview.md +136 -0
  224. package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
  225. package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
  226. package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
  227. package/skills/void/docs/integrations/hono.md +97 -0
  228. package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
  229. package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
  230. package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
  231. package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
  232. package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
  233. package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
  234. package/skills/void/docs/node_modules/vitepress/README.md +28 -0
  235. package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
  236. package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
  237. package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
  238. package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
  239. package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
  240. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
  241. package/skills/void/docs/node_modules/void/README.md +89 -0
  242. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
  243. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
  244. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
  245. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
  246. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
  247. package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
  248. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
  249. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
  250. package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
  251. package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
  252. package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
  253. package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
  254. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
  255. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
  256. package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
  257. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
  258. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
  259. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
  260. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
  261. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
  262. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
  263. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
  264. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
  265. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
  266. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
  267. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
  268. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
  269. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
  270. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
  271. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
  272. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
  273. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
  274. package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
  275. package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
  276. package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
  277. package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
  278. package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
  279. package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
  280. package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
  281. package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
  282. package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
  283. package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
  284. package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
  285. package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
  286. package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
  287. package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
  288. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  289. package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
  290. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
  291. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
  292. package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
  293. package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
  294. package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
  295. package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
  296. package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
  297. package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
  298. package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
  299. package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
  300. package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
  301. package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
  302. package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
  303. package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
  304. package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
  305. package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
  306. package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
  307. package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
  308. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
  309. package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
  310. package/skills/void/docs/reference/api.md +917 -0
  311. package/skills/void/docs/reference/cli.md +561 -0
  312. package/skills/void/docs/reference/config.md +408 -0
  313. package/skills/void/docs/reference/resource-inference.md +149 -0
  314. package/skills/void/docs/reference/structure.md +176 -0
  315. package/.npmignore +0 -29
  316. package/.travis.yml +0 -9
  317. package/favicon.ico +0 -0
  318. package/index.js +0 -14
  319. package/lib/Job.js +0 -150
  320. package/lib/Void.js +0 -99
  321. package/lib/scan.js +0 -19
  322. package/test/credentials.js +0 -20
  323. package/test/job.js +0 -64
  324. package/test/static/dir1/test6.html +0 -0
  325. package/test/static/dir2/test7.html +0 -0
  326. package/test/static/dir2/test8.html +0 -0
  327. package/test/static/dir2/test9.html +0 -0
  328. package/test/static/test1.html +0 -0
  329. package/test/static/test2.html +0 -0
  330. package/test/static/test3.html +0 -0
  331. package/test/void.js +0 -31
  332. /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
  333. /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
@@ -0,0 +1,349 @@
1
+ import { s as import_picocolors } from "./output-BwlcIYSR.mjs";
2
+ import { a as F, b as z, d as _t, m as et, o as H, r as E, s as J, t as $ } from "./dist-Dayj3gCK.mjs";
3
+ //#region src/cli/subcommand-prompt.ts
4
+ function promptSubcommand(command, subcommands) {
5
+ return new Promise((resolve) => {
6
+ const { stdin, stdout } = process;
7
+ let phase = "select";
8
+ let cursor = 0;
9
+ let input = "";
10
+ let prevLineCount = 0;
11
+ let resolved = false;
12
+ let selectedSub = null;
13
+ let selectedArg;
14
+ const selectedFlags = {};
15
+ let flagStates = [];
16
+ let multiSelectStates = [];
17
+ let repeatEntries = [];
18
+ let repeatInput = "";
19
+ const wasRaw = stdin.isRaw;
20
+ stdin.setRawMode(true);
21
+ stdin.resume();
22
+ stdout.write("\x1B[?25l");
23
+ function clear() {
24
+ if (prevLineCount > 0) stdout.write(`\x1B[${prevLineCount}A\x1B[0J`);
25
+ }
26
+ function render() {
27
+ clear();
28
+ if (phase === "select") renderSelect();
29
+ else if (phase === "flags") renderFlags();
30
+ else if (phase === "multi-select") renderMultiSelect();
31
+ else renderRepeatInput();
32
+ }
33
+ const title = command ? `void ${command}` : "void";
34
+ function headerLine() {
35
+ const argPart = selectedArg ? ` ${selectedArg}` : "";
36
+ return `${import_picocolors.default.cyan(_t)} ${import_picocolors.default.cyan(title)} ${import_picocolors.default.dim("·")} ${import_picocolors.default.cyan(`${selectedSub.name}${argPart}`)}`;
37
+ }
38
+ function renderSelect() {
39
+ const lines = [];
40
+ const focused = subcommands[cursor];
41
+ lines.push(`${import_picocolors.default.cyan(_t)} ${import_picocolors.default.cyan(title)}`);
42
+ lines.push(import_picocolors.default.gray($));
43
+ const maxName = Math.max(...subcommands.map((s) => s.name.length));
44
+ for (let i = 0; i < subcommands.length; i++) {
45
+ const sub = subcommands[i];
46
+ const isFocused = i === cursor;
47
+ const radio = isFocused ? import_picocolors.default.green(z) : import_picocolors.default.dim(H);
48
+ const name = sub.name.padEnd(maxName);
49
+ let suffix = "";
50
+ if (sub.arg) if (isFocused && input.length > 0) suffix = ` ${import_picocolors.default.cyan(input)}`;
51
+ else suffix = ` ${import_picocolors.default.dim(sub.arg)}`;
52
+ else if (sub.hint) suffix = ` ${import_picocolors.default.dim(sub.hint)}`;
53
+ if (isFocused) lines.push(`${import_picocolors.default.gray($)} ${radio} ${import_picocolors.default.reset(name)}${suffix}`);
54
+ else lines.push(`${import_picocolors.default.gray($)} ${radio} ${import_picocolors.default.dim(name)}${suffix}`);
55
+ }
56
+ lines.push(import_picocolors.default.gray($));
57
+ lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(focused.description)}`);
58
+ if (focused.arg) if (focused.arg.startsWith("<")) lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(`Type ${focused.arg}, then press Enter`)}`);
59
+ else lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(`Type ${focused.arg}, then press Enter, or press Enter to skip`)}`);
60
+ lines.push(import_picocolors.default.gray(E));
61
+ stdout.write(lines.join("\n") + "\n");
62
+ prevLineCount = lines.length;
63
+ }
64
+ function renderFlags() {
65
+ const flags = selectedSub.flags;
66
+ const focused = flags[cursor];
67
+ const lines = [];
68
+ lines.push(headerLine());
69
+ lines.push(import_picocolors.default.gray($));
70
+ const maxFlag = Math.max(...flags.map((f) => f.name.length));
71
+ for (let i = 0; i < flags.length; i++) {
72
+ const flag = flags[i];
73
+ const state = flagStates[i];
74
+ const isFocused = i === cursor;
75
+ const checkbox = state.enabled ? import_picocolors.default.green(et) : isFocused ? J : import_picocolors.default.dim(J);
76
+ const name = flag.name.padEnd(maxFlag);
77
+ let valueText = "";
78
+ if (flag.arg) if (state.enabled && state.value.length > 0) valueText = ` ${isFocused ? import_picocolors.default.cyan(state.value) : import_picocolors.default.dim(state.value)}`;
79
+ else valueText = ` ${import_picocolors.default.dim(flag.arg)}`;
80
+ if (isFocused) lines.push(`${import_picocolors.default.gray($)} ${checkbox} ${import_picocolors.default.reset(name)}${valueText}`);
81
+ else lines.push(`${import_picocolors.default.gray($)} ${checkbox} ${import_picocolors.default.dim(name)}${valueText}`);
82
+ }
83
+ lines.push(import_picocolors.default.gray($));
84
+ lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(focused.description)}`);
85
+ lines.push(import_picocolors.default.gray(E));
86
+ stdout.write(lines.join("\n") + "\n");
87
+ prevLineCount = lines.length;
88
+ }
89
+ function renderMultiSelect() {
90
+ const options = selectedSub.followUp.options;
91
+ const lines = [];
92
+ lines.push(headerLine());
93
+ lines.push(import_picocolors.default.gray($));
94
+ const maxLabel = Math.max(...options.map((o) => o.label.length));
95
+ for (let i = 0; i < options.length; i++) {
96
+ const opt = options[i];
97
+ const selected = multiSelectStates[i];
98
+ const isFocused = i === cursor;
99
+ const checkbox = selected ? import_picocolors.default.green(et) : isFocused ? J : import_picocolors.default.dim(J);
100
+ const label = opt.label.padEnd(maxLabel);
101
+ if (isFocused) lines.push(`${import_picocolors.default.gray($)} ${checkbox} ${import_picocolors.default.reset(label)}`);
102
+ else lines.push(`${import_picocolors.default.gray($)} ${checkbox} ${import_picocolors.default.dim(label)}`);
103
+ }
104
+ lines.push(import_picocolors.default.gray($));
105
+ lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim("space to toggle, enter to confirm")}`);
106
+ lines.push(import_picocolors.default.gray(E));
107
+ stdout.write(lines.join("\n") + "\n");
108
+ prevLineCount = lines.length;
109
+ }
110
+ function renderRepeatInput() {
111
+ const followUp = selectedSub.followUp;
112
+ const lines = [];
113
+ lines.push(headerLine());
114
+ lines.push(import_picocolors.default.gray($));
115
+ for (const entry of repeatEntries) lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(entry)}`);
116
+ if (repeatInput.length > 0) lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.cyan(repeatInput)}`);
117
+ else lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim(followUp.placeholder)}`);
118
+ lines.push(import_picocolors.default.gray($));
119
+ lines.push(`${import_picocolors.default.gray($)} ${import_picocolors.default.dim("enter to add, empty to finish")}`);
120
+ lines.push(import_picocolors.default.gray(E));
121
+ stdout.write(lines.join("\n") + "\n");
122
+ prevLineCount = lines.length;
123
+ }
124
+ function cleanup() {
125
+ if (resolved) return;
126
+ resolved = true;
127
+ stdin.setRawMode(wasRaw);
128
+ stdin.pause();
129
+ stdin.removeListener("data", onData);
130
+ stdout.write("\x1B[?25h");
131
+ }
132
+ function submit(result) {
133
+ cleanup();
134
+ clear();
135
+ if (result) {
136
+ let summary = result.subcommand;
137
+ if (result.arg) summary += ` ${result.arg}`;
138
+ if (result.flags) for (const [flag, value] of Object.entries(result.flags)) {
139
+ summary += ` ${flag}`;
140
+ if (typeof value === "string") summary += ` ${value}`;
141
+ }
142
+ if (result.extraArgs && result.extraArgs.length > 0) summary += ` ${result.extraArgs.join(" ")}`;
143
+ stdout.write(`${import_picocolors.default.gray(F)} ${import_picocolors.default.dim(title)} ${import_picocolors.default.dim("·")} ${import_picocolors.default.dim(summary)}\n`);
144
+ }
145
+ resolve(result);
146
+ }
147
+ function finalize() {
148
+ const result = {
149
+ subcommand: selectedSub.name,
150
+ arg: selectedArg
151
+ };
152
+ if (Object.keys(selectedFlags).length > 0) result.flags = { ...selectedFlags };
153
+ if (repeatEntries.length > 0) result.extraArgs = repeatEntries;
154
+ submit(result);
155
+ }
156
+ function advancePhase() {
157
+ if (phase === "select" && selectedSub.flags && selectedSub.flags.length > 0) {
158
+ phase = "flags";
159
+ cursor = 0;
160
+ flagStates = selectedSub.flags.map(() => ({
161
+ enabled: false,
162
+ value: ""
163
+ }));
164
+ render();
165
+ return;
166
+ }
167
+ if ((phase === "select" || phase === "flags") && selectedSub.followUp) {
168
+ const followUp = selectedSub.followUp;
169
+ if (followUp.type === "multi-select") {
170
+ phase = "multi-select";
171
+ cursor = 0;
172
+ multiSelectStates = followUp.options.map((o) => !!o.selected);
173
+ render();
174
+ return;
175
+ }
176
+ if (followUp.type === "repeat-input") {
177
+ phase = "repeat-input";
178
+ repeatEntries = [];
179
+ repeatInput = "";
180
+ render();
181
+ return;
182
+ }
183
+ }
184
+ finalize();
185
+ }
186
+ function handleSelectKey(key) {
187
+ const focused = subcommands[cursor];
188
+ if (key === "\x1B[A" || key === "\x1BOA") {
189
+ cursor = cursor === 0 ? subcommands.length - 1 : cursor - 1;
190
+ input = "";
191
+ render();
192
+ return;
193
+ }
194
+ if (key === "\x1B[B" || key === "\x1BOB") {
195
+ cursor = (cursor + 1) % subcommands.length;
196
+ input = "";
197
+ render();
198
+ return;
199
+ }
200
+ if (key === "\r" || key === "\n") {
201
+ if (focused.arg && focused.arg.startsWith("<") && input.length === 0) return;
202
+ selectedSub = focused;
203
+ selectedArg = focused.arg ? input || void 0 : void 0;
204
+ clear();
205
+ advancePhase();
206
+ return;
207
+ }
208
+ if (key === "" || key === "\b") {
209
+ if (focused.arg && input.length > 0) {
210
+ input = input.slice(0, -1);
211
+ render();
212
+ }
213
+ return;
214
+ }
215
+ if (focused.arg && key.length === 1 && key >= " ") {
216
+ input += key;
217
+ render();
218
+ }
219
+ }
220
+ function handleFlagKey(key) {
221
+ const flags = selectedSub.flags;
222
+ const focused = flags[cursor];
223
+ const state = flagStates[cursor];
224
+ if (key === "\x1B[A" || key === "\x1BOA") {
225
+ cursor = cursor === 0 ? flags.length - 1 : cursor - 1;
226
+ render();
227
+ return;
228
+ }
229
+ if (key === "\x1B[B" || key === "\x1BOB") {
230
+ cursor = (cursor + 1) % flags.length;
231
+ render();
232
+ return;
233
+ }
234
+ if (key === " ") {
235
+ state.enabled = !state.enabled;
236
+ if (!state.enabled) state.value = "";
237
+ render();
238
+ return;
239
+ }
240
+ if (key === "\r" || key === "\n") {
241
+ for (let i = 0; i < flags.length; i++) if (flagStates[i].enabled && flags[i].arg && flagStates[i].value.length === 0) return;
242
+ for (let i = 0; i < flags.length; i++) if (flagStates[i].enabled) selectedFlags[flags[i].name] = flags[i].arg ? flagStates[i].value : true;
243
+ clear();
244
+ advancePhase();
245
+ return;
246
+ }
247
+ if (key === "" || key === "\b") {
248
+ if (focused.arg && state.enabled && state.value.length > 0) {
249
+ state.value = state.value.slice(0, -1);
250
+ render();
251
+ }
252
+ return;
253
+ }
254
+ if (focused.arg && key.length === 1 && key >= " ") {
255
+ if (!state.enabled) state.enabled = true;
256
+ state.value += key;
257
+ render();
258
+ }
259
+ }
260
+ function handleMultiSelectKey(key) {
261
+ const followUp = selectedSub.followUp;
262
+ const options = followUp.options;
263
+ if (key === "\x1B[A" || key === "\x1BOA") {
264
+ cursor = cursor === 0 ? options.length - 1 : cursor - 1;
265
+ render();
266
+ return;
267
+ }
268
+ if (key === "\x1B[B" || key === "\x1BOB") {
269
+ cursor = (cursor + 1) % options.length;
270
+ render();
271
+ return;
272
+ }
273
+ if (key === " ") {
274
+ multiSelectStates[cursor] = !multiSelectStates[cursor];
275
+ render();
276
+ return;
277
+ }
278
+ if (key === "\r" || key === "\n") {
279
+ const selected = options.filter((_, i) => multiSelectStates[i]);
280
+ if (selected.length === 0) return;
281
+ selectedFlags[followUp.flag] = selected.map((o) => o.value).join(",");
282
+ clear();
283
+ finalize();
284
+ return;
285
+ }
286
+ }
287
+ function handleRepeatInputKey(key) {
288
+ if (key === "\r" || key === "\n") {
289
+ if (repeatInput.length > 0) {
290
+ repeatEntries.push(repeatInput);
291
+ repeatInput = "";
292
+ render();
293
+ } else {
294
+ clear();
295
+ finalize();
296
+ }
297
+ return;
298
+ }
299
+ if (key === "" || key === "\b") {
300
+ if (repeatInput.length > 0) {
301
+ repeatInput = repeatInput.slice(0, -1);
302
+ render();
303
+ }
304
+ return;
305
+ }
306
+ if (key.length === 1 && key >= " ") {
307
+ repeatInput += key;
308
+ render();
309
+ }
310
+ }
311
+ function handleKey(key) {
312
+ if (resolved) return;
313
+ if (phase === "select") handleSelectKey(key);
314
+ else if (phase === "flags") handleFlagKey(key);
315
+ else if (phase === "multi-select") handleMultiSelectKey(key);
316
+ else handleRepeatInputKey(key);
317
+ }
318
+ function onData(data) {
319
+ if (resolved) return;
320
+ const key = data.toString();
321
+ if (key === "") {
322
+ submit(null);
323
+ return;
324
+ }
325
+ if (key === "\x1B" && data.length === 1) {
326
+ submit(null);
327
+ return;
328
+ }
329
+ if (key.startsWith("\x1B")) {
330
+ handleKey(key);
331
+ return;
332
+ }
333
+ for (const char of key) {
334
+ if (char === "") {
335
+ submit(null);
336
+ return;
337
+ }
338
+ handleKey(char);
339
+ }
340
+ }
341
+ stdin.on("data", onData);
342
+ process.on("exit", () => {
343
+ if (!resolved) stdout.write("\x1B[?25h");
344
+ });
345
+ render();
346
+ });
347
+ }
348
+ //#endregion
349
+ export { promptSubcommand };
@@ -0,0 +1,20 @@
1
+ //#region src/sveltekit.d.ts
2
+ type Tsconfig = Record<string, unknown>;
3
+ type TsconfigHook = (config: Tsconfig) => Tsconfig | void;
4
+ interface VoidSvelteKitTsconfigOptions {
5
+ /** Project root. Defaults to process.cwd(). */
6
+ root?: string;
7
+ /** SvelteKit output directory. Defaults to ".svelte-kit". */
8
+ outDir?: string;
9
+ }
10
+ /**
11
+ * Merge Void's generated tsconfig fragment into SvelteKit's generated
12
+ * tsconfig. Use from `kit.typescript.config` in `svelte.config.js`.
13
+ */
14
+ declare function mergeVoidSvelteKitTsconfig(config: Tsconfig, options?: VoidSvelteKitTsconfigOptions): Tsconfig;
15
+ /**
16
+ * Compose a user SvelteKit tsconfig hook with Void's generated type aliases.
17
+ */
18
+ declare function withVoidTSConfig(hook?: TsconfigHook, options?: VoidSvelteKitTsconfigOptions): TsconfigHook;
19
+ //#endregion
20
+ export { VoidSvelteKitTsconfigOptions, mergeVoidSvelteKitTsconfig, withVoidTSConfig };
@@ -0,0 +1,61 @@
1
+ import { a as join, i as isAbsolute, o as relative, s as resolve } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ //#region src/sveltekit.ts
4
+ /**
5
+ * Merge Void's generated tsconfig fragment into SvelteKit's generated
6
+ * tsconfig. Use from `kit.typescript.config` in `svelte.config.js`.
7
+ */
8
+ function mergeVoidSvelteKitTsconfig(config, options = {}) {
9
+ const root = options.root ?? process.cwd();
10
+ const voidDir = join(root, ".void");
11
+ const voidTsconfigPath = join(voidDir, "tsconfig.json");
12
+ if (!existsSync(voidTsconfigPath)) return config;
13
+ const voidConfig = JSON.parse(readFileSync(voidTsconfigPath, "utf-8"));
14
+ const outputDir = resolve(root, options.outDir ?? ".svelte-kit");
15
+ const voidFiles = Array.isArray(voidConfig.files) ? voidConfig.files.filter((entry) => typeof entry === "string") : [];
16
+ if (voidFiles.length > 0) config.files = uniqueStrings([...Array.isArray(config.files) ? config.files.filter((entry) => typeof entry === "string") : [], ...voidFiles.map((entry) => relativeFrom(outputDir, resolveTsconfigEntry(voidDir, entry)))]);
17
+ const voidPaths = readPathMap(readObject(readObject(voidConfig.compilerOptions)?.paths));
18
+ if (Object.keys(voidPaths).length > 0) {
19
+ const paths = ensureObject(ensureObject(config, "compilerOptions"), "paths");
20
+ for (const [key, values] of Object.entries(voidPaths)) paths[key] = values.map((entry) => relativeFrom(outputDir, resolveTsconfigEntry(voidDir, entry)));
21
+ }
22
+ return config;
23
+ }
24
+ /**
25
+ * Compose a user SvelteKit tsconfig hook with Void's generated type aliases.
26
+ */
27
+ function withVoidTSConfig(hook, options) {
28
+ return (config) => mergeVoidSvelteKitTsconfig(hook?.(config) ?? config, options);
29
+ }
30
+ function readObject(value) {
31
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
32
+ }
33
+ function ensureObject(target, key) {
34
+ const current = readObject(target[key]);
35
+ if (current) return current;
36
+ const next = {};
37
+ target[key] = next;
38
+ return next;
39
+ }
40
+ function readPathMap(value) {
41
+ const result = {};
42
+ if (!value) return result;
43
+ for (const [key, entries] of Object.entries(value)) {
44
+ if (!Array.isArray(entries)) continue;
45
+ const strings = entries.filter((entry) => typeof entry === "string");
46
+ if (strings.length > 0) result[key] = strings;
47
+ }
48
+ return result;
49
+ }
50
+ function resolveTsconfigEntry(baseDir, entry) {
51
+ return isAbsolute(entry) ? entry : resolve(baseDir, entry);
52
+ }
53
+ function relativeFrom(fromDir, target) {
54
+ const value = relative(fromDir, target).replace(/\\/g, "/");
55
+ return value.startsWith(".") ? value : `./${value}`;
56
+ }
57
+ function uniqueStrings(values) {
58
+ return Array.from(new Set(values));
59
+ }
60
+ //#endregion
61
+ export { mergeVoidSvelteKitTsconfig, withVoidTSConfig };
@@ -0,0 +1,57 @@
1
+ //#region src/pages/types.d.ts
2
+ interface PageDefinition {
3
+ /** URL pattern, e.g. "/users/:id" */
4
+ pattern: string;
5
+ /** Route params, e.g. ["id"] */
6
+ params: Array<string>;
7
+ /** Whether this is a catch-all route */
8
+ catchAll: boolean;
9
+ /** Component file relative path, e.g. "users/[id].vue" */
10
+ componentPath: string;
11
+ /** Server handler file relative path, e.g. "users/[id].server.ts" */
12
+ serverPath: string | null;
13
+ /** HTTP methods exported by server handler */
14
+ methods: Array<string>;
15
+ /** Component ID used in page object, e.g. "users/[id]" */
16
+ componentId: string;
17
+ /** Edge caching revalidate TTL in seconds, from .server.ts export */
18
+ revalidate?: number;
19
+ /** Whether `export const prerender = true` is set in server handler */
20
+ prerender?: boolean;
21
+ /** Whether `export function getPrerenderPaths` is defined in server handler */
22
+ hasGetPrerenderPaths?: boolean;
23
+ /** Whether this is an island page (.island.tsx/.island.vue) */
24
+ island?: boolean;
25
+ /** Frontmatter metadata extracted from .md files (title, description) */
26
+ metadata?: {
27
+ title?: string;
28
+ description?: string;
29
+ };
30
+ /** Named layout selection: "name", "!name", false, or relative path */
31
+ layout?: string | false;
32
+ }
33
+ interface LayoutDefinition {
34
+ /** Directory path relative to pages/, e.g. "" (root) or "users" */
35
+ directory: string;
36
+ /** Layout file relative path, e.g. "layout.vue" or "users/layout.vue" */
37
+ filePath: string;
38
+ /** Whether this is an island layout (layout.island.tsx/.island.vue) */
39
+ island?: boolean;
40
+ }
41
+ interface NamedLayoutDefinition {
42
+ /** Layout name, e.g. "home", "post" */
43
+ name: string;
44
+ /** Directory containing _layouts/, e.g. "" (root) or "guide" */
45
+ directory: string;
46
+ /** File path relative to pages/, e.g. "_layouts/home.vue" */
47
+ filePath: string;
48
+ /** Whether this is an island layout */
49
+ island?: boolean;
50
+ }
51
+ interface PageScanResult {
52
+ pages: Array<PageDefinition>;
53
+ layouts: Array<LayoutDefinition>;
54
+ namedLayouts: Array<NamedLayoutDefinition>;
55
+ }
56
+ //#endregion
57
+ export { PageScanResult as i, NamedLayoutDefinition as n, PageDefinition as r, LayoutDefinition as t };
@@ -0,0 +1,146 @@
1
+ import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
+ import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
3
+ import { i as stripSqlExt, r as readJournal } from "./collect-CjeZgz5D.mjs";
4
+ import { existsSync, readdirSync } from "node:fs";
5
+ //#region src/migrations/validate.ts
6
+ var validate_exports = /* @__PURE__ */ __exportAll({
7
+ assertJournalCoherence: () => assertJournalCoherence,
8
+ isDestructive: () => isDestructive,
9
+ listDrizzleArtifacts: () => listDrizzleArtifacts,
10
+ validateMigrations: () => validateMigrations
11
+ });
12
+ /**
13
+ * Destructive SQL patterns that are rejected unless the migration
14
+ * contains the `-- void:allow-destructive` pragma comment.
15
+ */
16
+ const DESTRUCTIVE_PATTERNS = [
17
+ /\bDROP\s+TABLE\b/i,
18
+ /\bDROP\s+COLUMN\b/i,
19
+ /\bALTER\s+TABLE\s+\S+\s+RENAME\b/i,
20
+ /\bTRUNCATE\b/i
21
+ ];
22
+ const PRAGMA_COMMENT = "-- void:allow-destructive";
23
+ /**
24
+ * Check if a SQL migration contains destructive operations.
25
+ */
26
+ function isDestructive(sql) {
27
+ return DESTRUCTIVE_PATTERNS.some((pattern) => pattern.test(sql));
28
+ }
29
+ /**
30
+ * Validate migration files. Returns the validated list with destructive flags.
31
+ * Throws if any destructive migration lacks the allow-destructive pragma.
32
+ */
33
+ function validateMigrations(files) {
34
+ const results = [];
35
+ const errors = [];
36
+ for (const file of files) {
37
+ const destructive = isDestructive(file.sql);
38
+ if (destructive && !file.sql.includes(PRAGMA_COMMENT)) errors.push(file.name);
39
+ results.push({
40
+ name: file.name,
41
+ sql: file.sql,
42
+ destructive
43
+ });
44
+ }
45
+ if (errors.length > 0) throw new Error(`Destructive migrations detected without pragma:\n` + errors.map((f) => ` - ${f}`).join("\n") + `\n\nAdd "${PRAGMA_COMMENT}" to each file to allow the migration locally and on deploy.`);
46
+ return results;
47
+ }
48
+ /**
49
+ * Enumerate drizzle-kit metadata artifacts in a migrations directory.
50
+ * Returns repo-relative paths like `db/migrations/meta/0000_snapshot.json`
51
+ * and `db/migrations/migrations.js`. Empty when none are present.
52
+ *
53
+ * Shared across `assertJournalCoherence`, `void gen migration`, and
54
+ * `void db rename-migrations` so all three agree on what counts as a
55
+ * "partial drizzle-kit state" (journal gone but other metadata lingering).
56
+ */
57
+ function listDrizzleArtifacts(migrationsDir) {
58
+ const metaDir = join(migrationsDir, "meta");
59
+ const snapshotFiles = existsSync(metaDir) ? readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json")) : [];
60
+ const bundledPath = join(migrationsDir, "migrations.js");
61
+ const out = [];
62
+ for (const f of snapshotFiles) out.push(`db/migrations/meta/${f}`);
63
+ if (existsSync(bundledPath)) out.push("db/migrations/migrations.js");
64
+ return out;
65
+ }
66
+ /**
67
+ * Assert that every `.sql` file under `migrationsDir` has a matching entry
68
+ * in `meta/_journal.json`, and vice versa.
69
+ *
70
+ * Drift is a silent footgun: the local/remote runners apply files directly
71
+ * from disk, but `drizzle-kit generate` only sees what's in the journal.
72
+ * An orphan file created by hand (or by a botched scaffold/merge) gets
73
+ * applied to D1 without Drizzle ever acknowledging it, and a failed
74
+ * deploy can leave the database in a state that is impossible to recover
75
+ * from without manual SQL edits (see void-sdk/void#6).
76
+ *
77
+ * A missing journal is NOT a drift error. The drift check is a diff
78
+ * between disk and `meta/_journal.json`; with no journal, there is nothing
79
+ * to diff against. Bare-legacy projects — hand-written `.sql` files with no
80
+ * `db/schema.ts`, no drizzle-kit, no `meta/` directory — worked long
81
+ * before this check existed, and the local/remote runners still track
82
+ * applied migrations by filename via `_void_migrations`. Gating those
83
+ * projects here would break `void deploy`, `void db migrate`, `void db
84
+ * reset`, and `void db status` for a valid path with no migration path
85
+ * forward (they cannot run `void db generate` because it requires
86
+ * `db/schema.ts`). We skip the check silently and let the filename-based
87
+ * runners take over.
88
+ *
89
+ * Throws a user-facing error when any mismatch is detected between the
90
+ * journal and disk. Returns silently otherwise.
91
+ */
92
+ function assertJournalCoherence(migrationsDir, collected) {
93
+ const journal = readJournal(migrationsDir);
94
+ const drizzleArtifacts = listDrizzleArtifacts(migrationsDir);
95
+ if (journal === void 0) {
96
+ if (drizzleArtifacts.length > 0) throw new Error([
97
+ "db/migrations/meta/_journal.json is missing, but other drizzle-kit metadata is still present:",
98
+ ...drizzleArtifacts.map((p) => ` - ${p}`),
99
+ "",
100
+ "This is a partial drizzle-kit state. Restore _journal.json from version control, or delete the orphaned metadata files above if you intended to revert to hand-written migrations."
101
+ ].join("\n"));
102
+ return;
103
+ }
104
+ if (journal === null || typeof journal !== "object" || Array.isArray(journal) || typeof journal.version !== "string" || typeof journal.dialect !== "string" || !Array.isArray(journal.entries)) throw new Error("db/migrations/meta/_journal.json is malformed: expected an object with string `version`, string `dialect`, and an `entries` array. Restore the file from version control, or delete it if you intended to revert to hand-written migrations.");
105
+ for (let i = 0; i < journal.entries.length; i++) {
106
+ const entry = journal.entries[i];
107
+ if (entry === null || typeof entry !== "object" || typeof entry.idx !== "number" || typeof entry.version !== "string" || typeof entry.tag !== "string" || typeof entry.breakpoints !== "boolean") throw new Error(`db/migrations/meta/_journal.json is malformed: entry at index ${i} is missing required fields (\`idx\`, \`version\`, \`tag\`, \`breakpoints\`). Restore the file from version control, or delete it if you intended to revert to hand-written migrations.`);
108
+ }
109
+ if (journal.entries.length === 0) {
110
+ if (drizzleArtifacts.length === 0) return;
111
+ throw new Error([
112
+ "db/migrations/meta/_journal.json has no entries, but drizzle-kit metadata is still present:",
113
+ ...drizzleArtifacts.map((p) => ` - ${p}`),
114
+ "",
115
+ "This is a partial drizzle-kit state. Restore _journal.json from version control (or run `void db generate`), or delete the orphaned metadata files above if you intended to revert to hand-written migrations."
116
+ ].join("\n"));
117
+ }
118
+ const tagCounts = /* @__PURE__ */ new Map();
119
+ for (const entry of journal.entries) tagCounts.set(entry.tag, (tagCounts.get(entry.tag) ?? 0) + 1);
120
+ const duplicateTags = [...tagCounts.entries()].filter(([, n]) => n > 1).map(([tag]) => tag);
121
+ if (duplicateTags.length > 0) throw new Error([
122
+ "db/migrations/meta/_journal.json has duplicate migration entries:",
123
+ ...duplicateTags.map((t) => ` - ${t} (appears ${tagCounts.get(t)} times)`),
124
+ "",
125
+ "Each migration must have a unique tag. Restore _journal.json from version control, or hand-edit to remove the duplicates."
126
+ ].join("\n"));
127
+ const journalTags = new Set(journal.entries.map((e) => e.tag));
128
+ const collectedTags = new Set(collected.map((m) => stripSqlExt(m.name)));
129
+ const orphans = collected.map((m) => m.name).filter((name) => !journalTags.has(stripSqlExt(name)));
130
+ const missing = journal.entries.map((e) => `${e.tag}.sql`).filter((file) => !collectedTags.has(stripSqlExt(file)));
131
+ if (orphans.length === 0 && missing.length === 0) return;
132
+ const lines = ["Migration drift detected between db/migrations/ and db/migrations/meta/_journal.json."];
133
+ if (orphans.length > 0) {
134
+ lines.push("", "These files exist on disk but are not tracked in _journal.json:");
135
+ for (const f of orphans) lines.push(` - db/migrations/${f}`);
136
+ lines.push("", "Delete the orphan file(s), or move their contents into `db/schema.ts` and re-run `void db generate`.");
137
+ }
138
+ if (missing.length > 0) {
139
+ lines.push("", "These entries are in _journal.json but the matching file is missing:");
140
+ for (const f of missing) lines.push(` - db/migrations/${f}`);
141
+ lines.push("", "Restore the missing file(s) from version control, or regenerate migrations.");
142
+ }
143
+ throw new Error(lines.join("\n"));
144
+ }
145
+ //#endregion
146
+ export { validate_exports as i, listDrizzleArtifacts as n, validateMigrations as r, assertJournalCoherence as t };