void 0.10.5 → 0.10.6

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 (217) hide show
  1. package/dist/agents-Bmr5tFFb.mjs +1454 -0
  2. package/dist/{auth-cmd-UoCwfDQv.mjs → auth-cmd-DlgNwByu.mjs} +10 -10
  3. package/dist/{better-auth-shared-D0Mbmx5V.mjs → better-auth-shared-BQooDxbw.mjs} +1 -1
  4. package/dist/{better-auth-shared-jkksALri.d.mts → better-auth-shared-BvnM9px6.d.mts} +2 -2
  5. package/dist/{build-cmd-CVyuBHjP.mjs → build-cmd-Br8qL0rA.mjs} +15 -17
  6. package/dist/{cache-ACORQCIq.mjs → cache-wH-mP8UE.mjs} +10 -12
  7. package/dist/{cancel-deploy-Gi8zmoZC.mjs → cancel-deploy-BEBOEgtu.mjs} +16 -18
  8. package/dist/cli/cli.mjs +47 -49
  9. package/dist/{client-BlbnA92X.mjs → client-Cj96iiBH.mjs} +74 -8
  10. package/dist/{config-8dLIngKW.mjs → config-1twldYCW.mjs} +10 -10
  11. package/dist/{config-CbJS4Krx.mjs → config-BdUctCZD.mjs} +4 -4
  12. package/dist/{create-project-LjvkYziS.mjs → create-project-DD9n8Ho-.mjs} +28 -23
  13. package/dist/{db-C00yjN01.mjs → db-DjKE2-A-.mjs} +147 -149
  14. package/dist/{delete-CplfvTgU.mjs → delete-D2kr3Kmk.mjs} +13 -15
  15. package/dist/{deploy-CISNL5uK.mjs → deploy-C4PbkFyE.mjs} +97 -100
  16. package/dist/{discover-ZWuBvt22.mjs → discover-BuVVSAum.mjs} +3 -3
  17. package/dist/{dist-5cGIJHQQ.mjs → dist-BuiRJkTd.mjs} +59 -27
  18. package/dist/{domain-B4HpcgNG.mjs → domain-_luIsM_B.mjs} +14 -16
  19. package/dist/{env-DNMJpeVF.mjs → env-CO5XAS9t.mjs} +23 -25
  20. package/dist/{env-helpers-B_ks681T.d.mts → env-helpers-z4stu8uc.d.mts} +1 -1
  21. package/dist/{env-types-BS8cZead.mjs → env-types-D51bnR-c.mjs} +3 -3
  22. package/dist/{env-validation-BxbtBbjh.mjs → env-validation-CeC2FL66.mjs} +4 -4
  23. package/dist/{fetch-error-C6qffTl2.mjs → fetch-error-Dj3crt0e.mjs} +3 -3
  24. package/dist/{gen-C0pV2gRQ.mjs → gen-Cf79J4aw.mjs} +42 -44
  25. package/dist/{github-cmd-CwtLD1yI.mjs → github-cmd-DnqxyOsb.mjs} +88 -90
  26. package/dist/{handler-B7rCOy21.d.mts → handler-imD0UVDT.d.mts} +4 -5
  27. package/dist/{headers-BNWymgnH.mjs → headers-BwvFGhkx.mjs} +3 -3
  28. package/dist/index.d.mts +3 -3
  29. package/dist/index.mjs +102 -83
  30. package/dist/{init-D58GxCtt.mjs → init-KirOzVDs.mjs} +132 -134
  31. package/dist/link-CUmiosyb.mjs +45 -0
  32. package/dist/{list-CbNNjXTm.mjs → list-3GEw7b6m.mjs} +10 -12
  33. package/dist/{login-CvxxF_9z.mjs → login-DJReaT_Q.mjs} +14 -15
  34. package/dist/{logs-BDZ9AuhM.mjs → logs-D-rQ56Lq.mjs} +9 -11
  35. package/dist/{magic-string.es-C1Fb0uxq.mjs → magic-string.es-ZQjdJFFn.mjs} +3 -3
  36. package/dist/{mcp-C8BjRt_z.mjs → mcp-D7yc0dXY.mjs} +2 -3
  37. package/dist/{node-B07cZs0d.mjs → node-yFFk626c.mjs} +6 -6
  38. package/dist/{package-json-Bg_GJdJB.mjs → package-json-B0NuUWGd.mjs} +1 -1
  39. package/dist/pages/client.d.mts +1 -1
  40. package/dist/pages/client.mjs +2 -1
  41. package/dist/pages/head-client.d.mts +1 -1
  42. package/dist/pages/head.d.mts +1 -1
  43. package/dist/pages/index.d.mts +2 -2
  44. package/dist/pages/index.mjs +5 -5
  45. package/dist/pages/islands-plugin.d.mts +1 -1
  46. package/dist/pages/islands-plugin.mjs +3 -3
  47. package/dist/pages/protocol.d.mts +2 -2
  48. package/dist/pages/protocol.mjs +5 -2
  49. package/dist/{plugin-inference-D04iL1mW.mjs → plugin-inference-CJxi_fWI.mjs} +3 -3
  50. package/dist/{prepare-DUo9q8cM.mjs → prepare-C_cVurhP.mjs} +15 -18
  51. package/dist/{preset-D0My64KQ.mjs → preset-CVvwCeIy.mjs} +4 -4
  52. package/dist/{project-cmd-Dd1gNRdd.mjs → project-cmd-DnU7u9QF.mjs} +13 -14
  53. package/dist/{project-paths-CCMrHYQm.mjs → project-paths-tpdR1mJR.mjs} +2 -2
  54. package/dist/{project-tsconfig-DMBV55K2.mjs → project-tsconfig-D9uSVVpA.mjs} +2 -2
  55. package/dist/{protocol-6UZCowS1.d.mts → protocol-6hTJ04T1.d.mts} +3 -3
  56. package/dist/{resolve-project-D4O1_fZz.mjs → resolve-project-D2HI3TrG.mjs} +2 -2
  57. package/dist/{rollback-DzmCCrFg.mjs → rollback-Yh7bCKob.mjs} +21 -23
  58. package/dist/{route-types-BpSJEW20.mjs → route-types-CfKfhbIg.mjs} +234 -3
  59. package/dist/{runner-BQyKUqAL.mjs → runner-h272wcPj.mjs} +4 -5
  60. package/dist/{runner-pg-EuhrFW3D.mjs → runner-pg-waxJOnBb.mjs} +1 -1
  61. package/dist/runtime/ai.mjs +2 -2
  62. package/dist/runtime/auth.d.mts +1 -1
  63. package/dist/runtime/better-auth-pg.d.mts +1 -1
  64. package/dist/runtime/better-auth-pg.mjs +3 -3
  65. package/dist/runtime/better-auth.d.mts +1 -1
  66. package/dist/runtime/better-auth.mjs +2 -2
  67. package/dist/runtime/client-react.d.mts +2 -2
  68. package/dist/runtime/client-react.mjs +1 -1
  69. package/dist/runtime/client-solid.d.mts +2 -2
  70. package/dist/runtime/client-solid.mjs +1 -1
  71. package/dist/runtime/client-svelte.d.mts +2 -2
  72. package/dist/runtime/client-svelte.mjs +1 -1
  73. package/dist/runtime/client-vue.d.mts +2 -2
  74. package/dist/runtime/client-vue.mjs +1 -1
  75. package/dist/runtime/client.d.mts +2 -2
  76. package/dist/runtime/client.mjs +1 -1
  77. package/dist/runtime/db-pg.d.mts +1 -1
  78. package/dist/runtime/env-helpers.d.mts +1 -1
  79. package/dist/runtime/env-public-client.d.mts +1 -1
  80. package/dist/runtime/env-public-client.mjs +2 -0
  81. package/dist/runtime/env-public.d.mts +3 -4
  82. package/dist/runtime/env-public.mjs +3 -1
  83. package/dist/runtime/env.mjs +1 -1
  84. package/dist/runtime/fetch-stream.d.mts +1 -1
  85. package/dist/runtime/fetch-stream.mjs +1 -1
  86. package/dist/runtime/fetch.d.mts +1 -1
  87. package/dist/runtime/fetch.mjs +1 -1
  88. package/dist/runtime/handler.d.mts +2 -2
  89. package/dist/runtime/handler.mjs +1 -1
  90. package/dist/runtime/isr.mjs +1 -1
  91. package/dist/runtime/live-server.mjs +2 -0
  92. package/dist/runtime/live.d.mts +2 -2
  93. package/dist/runtime/live.mjs +3 -1
  94. package/dist/runtime/migration-handler-pg.mjs +1 -1
  95. package/dist/runtime/migration-handler.mjs +1 -1
  96. package/dist/runtime/remote/index.mjs +11 -1
  97. package/dist/runtime/sandbox.d.mts +1 -4
  98. package/dist/runtime/sandbox.mjs +1 -1
  99. package/dist/runtime/validator.d.mts +1 -1
  100. package/dist/runtime/ws-server.d.mts +2 -2
  101. package/dist/runtime/ws-server.mjs +2 -0
  102. package/dist/runtime/ws.d.mts +3 -3
  103. package/dist/runtime/ws.mjs +2 -0
  104. package/dist/{scan-VCAM1oh3.mjs → scan-Dp_Gyzs3.mjs} +3 -3
  105. package/dist/{scan---8wfN58.mjs → scan-i7Yz54fv.mjs} +26 -8
  106. package/dist/{secret-CMLYWkE-.mjs → secret-u7FRvg8d.mjs} +22 -24
  107. package/dist/{skills-Dl3u05da.mjs → skills-DsdNDtX3.mjs} +6 -7
  108. package/dist/{subcommand-prompt-B8ng0FTS.mjs → subcommand-prompt-DtES-oP6.mjs} +34 -35
  109. package/dist/sveltekit.mjs +1 -1
  110. package/dist/validate-DT7nFMlf.mjs +504 -0
  111. package/dist/{yarn-pnp-WLW2IHUY.mjs → yarn-pnp-CW8LB6g_.mjs} +1 -1
  112. package/package.json +19 -19
  113. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +94 -0
  114. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +32 -11
  115. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +45 -0
  116. package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +5 -5
  117. package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +1 -1
  118. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +1 -1
  119. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +4 -1
  120. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +29 -12
  121. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +1 -1
  122. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +1 -0
  123. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +18 -6
  124. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +1 -1
  125. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +35 -0
  126. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +70 -0
  127. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +3 -1
  128. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +11 -7
  129. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +3 -1
  130. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +1 -1
  131. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +141 -26
  132. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +1 -1
  133. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +1 -1
  134. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
  135. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +16 -28
  136. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +16 -0
  137. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +15 -17
  138. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
  139. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +255 -2
  140. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +175 -0
  141. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +70 -5
  142. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
  143. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
  144. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +9 -3
  145. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +63 -11
  146. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
  147. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +27 -3
  148. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
  149. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +8 -0
  150. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +36 -4
  151. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
  152. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
  153. package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +403 -390
  154. package/skills/void/docs/node_modules/void/node_modules/pg/README.md +2 -1
  155. package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +1 -1
  156. package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +1 -0
  157. package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +18 -6
  158. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +1 -1
  159. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +35 -0
  160. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +70 -0
  161. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +3 -1
  162. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +11 -7
  163. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +3 -1
  164. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +1 -1
  165. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +141 -26
  166. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +1 -1
  167. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +1 -1
  168. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
  169. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +16 -28
  170. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +16 -0
  171. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +15 -17
  172. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
  173. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +255 -2
  174. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +175 -0
  175. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +70 -5
  176. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
  177. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
  178. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +9 -3
  179. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +63 -11
  180. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
  181. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +27 -3
  182. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
  183. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +8 -0
  184. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +36 -4
  185. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
  186. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
  187. package/skills/void/docs/reference/cli.md +5 -1
  188. package/dist/agents-MhSzNMiC.mjs +0 -151
  189. package/dist/collect-9rO3JFNM.mjs +0 -55
  190. package/dist/config-hhMYPVRT.mjs +0 -21
  191. package/dist/dist-abzUneor.mjs +0 -1287
  192. package/dist/drizzle-DqstQTGq.mjs +0 -232
  193. package/dist/link-ZFmboqY3.mjs +0 -47
  194. package/dist/output-DeiS4oEX.mjs +0 -139
  195. package/dist/plan-aD3wRDqF.mjs +0 -271
  196. package/dist/project-CH9pdo16.mjs +0 -72
  197. package/dist/project-slug-rX3kTOfY.mjs +0 -10
  198. package/dist/validate-CNWm-PsL.mjs +0 -186
  199. /package/dist/{auth-migrations-BP-hMzYl.mjs → auth-migrations-BTZ-ATvQ.mjs} +0 -0
  200. /package/dist/{auth-Dz2CCn4T.d.mts → auth-qgMlYp7Z.d.mts} +0 -0
  201. /package/dist/{canonical-json-CEyQaVDa.mjs → canonical-json-DuDiiUsQ.mjs} +0 -0
  202. /package/dist/{cf-access-DKDsgwOU.mjs → cf-access-Bqw81xAf.mjs} +0 -0
  203. /package/dist/{defer-C-bdSM_b.mjs → defer-YsYDUoii.mjs} +0 -0
  204. /package/dist/{dotenv-lS94ymhM.mjs → dotenv-D_UbC_vc.mjs} +0 -0
  205. /package/dist/{env-raw-Dtj1UAoK.mjs → env-raw-CoS20LHP.mjs} +0 -0
  206. /package/dist/{fetch-error-B6RaJ-eZ.d.mts → fetch-error-Sp1R4mZv.d.mts} +0 -0
  207. /package/dist/{git-metadata-Ce0AtSZL.mjs → git-metadata-CBKaL0v5.mjs} +0 -0
  208. /package/dist/{head-eOUCWUNy.d.mts → head-nmvOgFjd.d.mts} +0 -0
  209. /package/dist/{log-BdD_Fpms.mjs → log-ChfPKsVd.mjs} +0 -0
  210. /package/dist/{pathe.M-eThtNZ-BrPhGF_K.mjs → pathe.M-eThtNZ-CQzLbt4c.mjs} +0 -0
  211. /package/dist/{pg-CempqvEJ.mjs → pg-J2HbZIkX.mjs} +0 -0
  212. /package/dist/{providers-BJIoduK9.d.mts → providers-BNKRacMr.d.mts} +0 -0
  213. /package/dist/{providers-BwPbdHdi.mjs → providers-CJlNS3kT.mjs} +0 -0
  214. /package/dist/{proxy-M3pxItg2.mjs → proxy-D-3_D-Gl.mjs} +0 -0
  215. /package/dist/{chunk-DJd-R1mw.mjs → rolldown-runtime-DJK8HYOj.mjs} +0 -0
  216. /package/dist/{standard-schema-Cy0lfeWv.d.mts → standard-schema-DJ0HW7QP.d.mts} +0 -0
  217. /package/dist/{types-BodZGegX.d.mts → types-lLjNE9Qp.d.mts} +0 -0
@@ -1,72 +0,0 @@
1
- import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
- import { a as join, n as dirname } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
- import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
4
- //#region src/cli/project.ts
5
- var project_exports = /* @__PURE__ */ __exportAll({
6
- isVoidInternalStaging: () => isVoidInternalStaging,
7
- readProjectConfig: () => readProjectConfig,
8
- removeProjectConfig: () => removeProjectConfig,
9
- writeProjectConfig: () => writeProjectConfig
10
- });
11
- const PROJECT_FILE = ".void/project.json";
12
- function readProjectConfigFile(root) {
13
- const filePath = join(root, PROJECT_FILE);
14
- try {
15
- const raw = readFileSync(filePath, "utf-8");
16
- const config = JSON.parse(raw);
17
- if (typeof config !== "object" || config === null || Array.isArray(config)) return null;
18
- return config;
19
- } catch {
20
- return null;
21
- }
22
- }
23
- /**
24
- * Read the project config from the project root.
25
- * Returns null if no project.json exists.
26
- * A file containing only internal metadata is not treated as a linked project.
27
- */
28
- function readProjectConfig(root) {
29
- const config = readProjectConfigFile(root);
30
- if (!config || typeof config.projectId !== "string" || typeof config.slug !== "string") return null;
31
- const result = {
32
- projectId: config.projectId,
33
- slug: config.slug
34
- };
35
- if (config.voidInternalStaging === true) result.voidInternalStaging = true;
36
- return result;
37
- }
38
- /**
39
- * Internal-only platform developers' staging switch.
40
- * This intentionally lives with the project link state, not public void.json.
41
- */
42
- function isVoidInternalStaging(root) {
43
- return readProjectConfigFile(root)?.voidInternalStaging === true;
44
- }
45
- /**
46
- * Write the project config to the project root.
47
- */
48
- function writeProjectConfig(root, config) {
49
- const filePath = join(root, PROJECT_FILE);
50
- const existing = readProjectConfigFile(root);
51
- const next = {
52
- projectId: config.projectId,
53
- slug: config.slug
54
- };
55
- if (config.voidInternalStaging === true || existing?.voidInternalStaging === true) next.voidInternalStaging = true;
56
- mkdirSync(dirname(filePath), { recursive: true });
57
- writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
58
- }
59
- /**
60
- * Remove the project config file. Returns true if removed, false if it didn't exist.
61
- */
62
- function removeProjectConfig(root) {
63
- const filePath = join(root, PROJECT_FILE);
64
- try {
65
- rmSync(filePath);
66
- return true;
67
- } catch {
68
- return false;
69
- }
70
- }
71
- //#endregion
72
- export { writeProjectConfig as a, removeProjectConfig as i, project_exports as n, readProjectConfig as r, isVoidInternalStaging as t };
@@ -1,10 +0,0 @@
1
- import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
- //#region src/cli/project-slug.ts
3
- var project_slug_exports = /* @__PURE__ */ __exportAll({ validateProjectSlug: () => validateProjectSlug });
4
- function validateProjectSlug(value) {
5
- const slug = (value ?? "").trim();
6
- if (slug.length === 0) return "Project slug is required.";
7
- if (!(slug.length === 1 ? /^[a-z0-9]$/.test(slug) : /^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(slug))) return "Slug must be lowercase alphanumeric with dashes.";
8
- }
9
- //#endregion
10
- export { validateProjectSlug as n, project_slug_exports as t };
@@ -1,186 +0,0 @@
1
- import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
- import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
- import { i as stripSqlExt, r as readJournal } from "./collect-9rO3JFNM.mjs";
4
- import { a as tokenizeSql, t as DESTRUCTIVE_PRAGMA } from "./plan-aD3wRDqF.mjs";
5
- import { existsSync, readdirSync } from "node:fs";
6
- //#region src/migrations/validate.ts
7
- var validate_exports = /* @__PURE__ */ __exportAll({
8
- assertJournalCoherence: () => assertJournalCoherence,
9
- isDestructive: () => isDestructive,
10
- listDrizzleArtifacts: () => listDrizzleArtifacts,
11
- validateMigrations: () => validateMigrations
12
- });
13
- /**
14
- * Destructive SQL patterns that are rejected unless the migration
15
- * contains the `-- void:allow-destructive` pragma comment.
16
- */
17
- const DESTRUCTIVE_PATTERNS = [
18
- /\bDROP\s+TABLE\b/i,
19
- /\bDROP\s+VIEW\b/i,
20
- /\bDROP\s+INDEX\b/i,
21
- /\bDROP\s+TRIGGER\b/i,
22
- /\bALTER\s+TABLE\b[\s\S]*\bDROP\s+COLUMN\b/i,
23
- /\bALTER\s+TABLE\b[\s\S]*\bRENAME\s+TO\b/i,
24
- /\bALTER\s+TABLE\b[\s\S]*\bRENAME\s+COLUMN\b/i,
25
- /\bALTER\s+TABLE\b[\s\S]*\bRENAME\b[\s\S]*\bTO\b/i,
26
- /\bTRUNCATE\b/i,
27
- /\bINSERT\s+OR\s+REPLACE\b/i
28
- ];
29
- function splitExecutableStatements(sql) {
30
- return sql.split(";").map((statement) => statement.trim()).filter(Boolean);
31
- }
32
- function hasTopLevelKeyword(statement, keyword) {
33
- let depth = 0;
34
- for (let index = 0; index < statement.length; index++) {
35
- const character = statement[index];
36
- if (character === "(") {
37
- depth++;
38
- continue;
39
- }
40
- if (character === ")") {
41
- depth = Math.max(0, depth - 1);
42
- continue;
43
- }
44
- if (depth !== 0) continue;
45
- if (statement.slice(index, index + keyword.length).toUpperCase() === keyword && !/[A-Z0-9_]/i.test(statement[index - 1] ?? "") && !/[A-Z0-9_]/i.test(statement[index + keyword.length] ?? "")) return true;
46
- }
47
- return false;
48
- }
49
- function hasUnboundedWrite(statement) {
50
- if (/\bDELETE\s+FROM\b/i.test(statement)) return !hasTopLevelKeyword(statement, "WHERE");
51
- if (/\bUPDATE\b[\s\S]*\bSET\b/i.test(statement)) return !hasTopLevelKeyword(statement, "WHERE");
52
- return false;
53
- }
54
- /**
55
- * Check if a SQL migration contains destructive operations.
56
- */
57
- function isDestructive(sql) {
58
- const normalized = sql.replace(/\r\n?/g, "\n");
59
- let executable = "";
60
- for (const segment of tokenizeSql(normalized)) if (segment.kind === "sql") executable += normalized.slice(segment.start, segment.end);
61
- else executable += " ".repeat(segment.end - segment.start);
62
- return splitExecutableStatements(executable).some((statement) => {
63
- return DESTRUCTIVE_PATTERNS.some((pattern) => pattern.test(statement)) || hasUnboundedWrite(statement);
64
- });
65
- }
66
- function hasDestructivePragma(sql) {
67
- return sql.replace(/\r\n?/g, "\n").split("\n").some((line) => line.trim() === DESTRUCTIVE_PRAGMA);
68
- }
69
- /**
70
- * Validate migration files. Returns the validated list with destructive flags.
71
- * Throws if any destructive migration lacks the allow-destructive pragma.
72
- */
73
- function validateMigrations(files) {
74
- const results = [];
75
- const errors = [];
76
- for (const file of files) {
77
- const destructive = isDestructive(file.sql);
78
- if (destructive && !hasDestructivePragma(file.sql)) errors.push(file.name);
79
- results.push({
80
- name: file.name,
81
- sql: file.sql,
82
- destructive
83
- });
84
- }
85
- if (errors.length > 0) throw new Error(`Destructive migrations detected without pragma:\n` + errors.map((f) => ` - ${f}`).join("\n") + `\n\nAdd "${DESTRUCTIVE_PRAGMA}" to each file to allow the migration locally and on deploy.`);
86
- return results;
87
- }
88
- /**
89
- * Enumerate drizzle-kit metadata artifacts in a migrations directory.
90
- * Returns repo-relative paths like `db/migrations/meta/0000_snapshot.json`
91
- * and `db/migrations/migrations.js`. Empty when none are present.
92
- *
93
- * Shared across `assertJournalCoherence`, `void gen migration`, and
94
- * `void db rename-migrations` so all three agree on what counts as a
95
- * "partial drizzle-kit state" (journal gone but other metadata lingering).
96
- */
97
- function listDrizzleArtifacts(migrationsDir) {
98
- const metaDir = join(migrationsDir, "meta");
99
- const snapshotFiles = existsSync(metaDir) ? readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json")) : [];
100
- const bundledPath = join(migrationsDir, "migrations.js");
101
- const out = [];
102
- for (const f of snapshotFiles) out.push(`db/migrations/meta/${f}`);
103
- if (existsSync(bundledPath)) out.push("db/migrations/migrations.js");
104
- return out;
105
- }
106
- /**
107
- * Assert that every `.sql` file under `migrationsDir` has a matching entry
108
- * in `meta/_journal.json`, and vice versa.
109
- *
110
- * Drift is a silent footgun: the local/remote runners apply files directly
111
- * from disk, but `drizzle-kit generate` only sees what's in the journal.
112
- * An orphan file created by hand (or by a botched scaffold/merge) gets
113
- * applied to D1 without Drizzle ever acknowledging it, and a failed
114
- * deploy can leave the database in a state that is impossible to recover
115
- * from without manual SQL edits (see void-sdk/void#6).
116
- *
117
- * A missing journal is NOT a drift error. The drift check is a diff
118
- * between disk and `meta/_journal.json`; with no journal, there is nothing
119
- * to diff against. Bare-legacy projects — hand-written `.sql` files with no
120
- * `db/schema.ts`, no drizzle-kit, no `meta/` directory — worked long
121
- * before this check existed, and the local/remote runners still track
122
- * applied migrations by filename via `_void_migrations`. Gating those
123
- * projects here would break `void deploy`, `void db migrate`, `void db
124
- * reset`, and `void db status` for a valid path with no migration path
125
- * forward (they cannot run `void db generate` because it requires
126
- * `db/schema.ts`). We skip the check silently and let the filename-based
127
- * runners take over.
128
- *
129
- * Throws a user-facing error when any mismatch is detected between the
130
- * journal and disk. Returns silently otherwise.
131
- */
132
- function assertJournalCoherence(migrationsDir, collected) {
133
- const journal = readJournal(migrationsDir);
134
- const drizzleArtifacts = listDrizzleArtifacts(migrationsDir);
135
- if (journal === void 0) {
136
- if (drizzleArtifacts.length > 0) throw new Error([
137
- "db/migrations/meta/_journal.json is missing, but other drizzle-kit metadata is still present:",
138
- ...drizzleArtifacts.map((p) => ` - ${p}`),
139
- "",
140
- "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."
141
- ].join("\n"));
142
- return;
143
- }
144
- 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.");
145
- for (let i = 0; i < journal.entries.length; i++) {
146
- const entry = journal.entries[i];
147
- 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.`);
148
- }
149
- if (journal.entries.length === 0) {
150
- if (drizzleArtifacts.length === 0) return;
151
- throw new Error([
152
- "db/migrations/meta/_journal.json has no entries, but drizzle-kit metadata is still present:",
153
- ...drizzleArtifacts.map((p) => ` - ${p}`),
154
- "",
155
- "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."
156
- ].join("\n"));
157
- }
158
- const tagCounts = /* @__PURE__ */ new Map();
159
- for (const entry of journal.entries) tagCounts.set(entry.tag, (tagCounts.get(entry.tag) ?? 0) + 1);
160
- const duplicateTags = [...tagCounts.entries()].filter(([, n]) => n > 1).map(([tag]) => tag);
161
- if (duplicateTags.length > 0) throw new Error([
162
- "db/migrations/meta/_journal.json has duplicate migration entries:",
163
- ...duplicateTags.map((t) => ` - ${t} (appears ${tagCounts.get(t)} times)`),
164
- "",
165
- "Each migration must have a unique tag. Restore _journal.json from version control, or hand-edit to remove the duplicates."
166
- ].join("\n"));
167
- const journalTags = new Set(journal.entries.map((e) => e.tag));
168
- const collectedTags = new Set(collected.map((m) => stripSqlExt(m.name)));
169
- const orphans = collected.map((m) => m.name).filter((name) => !journalTags.has(stripSqlExt(name)));
170
- const missing = journal.entries.map((e) => `${e.tag}.sql`).filter((file) => !collectedTags.has(stripSqlExt(file)));
171
- if (orphans.length === 0 && missing.length === 0) return;
172
- const lines = ["Migration drift detected between db/migrations/ and db/migrations/meta/_journal.json."];
173
- if (orphans.length > 0) {
174
- lines.push("", "These files exist on disk but are not tracked in _journal.json:");
175
- for (const f of orphans) lines.push(` - db/migrations/${f}`);
176
- lines.push("", "Delete the orphan file(s), or move their contents into `db/schema.ts` and re-run `void db generate`.");
177
- }
178
- if (missing.length > 0) {
179
- lines.push("", "These entries are in _journal.json but the matching file is missing:");
180
- for (const f of missing) lines.push(` - db/migrations/${f}`);
181
- lines.push("", "Restore the missing file(s) from version control, or regenerate migrations.");
182
- }
183
- throw new Error(lines.join("\n"));
184
- }
185
- //#endregion
186
- export { validate_exports as i, listDrizzleArtifacts as n, validateMigrations as r, assertJournalCoherence as t };
File without changes
File without changes
File without changes
File without changes