void 1.1.0 → 1.1.11

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 (194) hide show
  1. package/dist/{account-cmd-BTcUzv9L.mjs → account-cmd-R35a4Oa8.mjs} +3 -3
  2. package/dist/{application-analysis-AB_YYWgH.mjs → application-analysis-D7nNmNJb.mjs} +6 -6
  3. package/dist/{application-routing-L7V-TFhZ.mjs → application-routing-CZH66gXn.mjs} +1 -1
  4. package/dist/{auth-link-DUJuvRx5.mjs → auth-link-VHmiKZmP.mjs} +3 -3
  5. package/dist/{auth-migrations-Cgs0k6lS.mjs → auth-migrations-BO27GDNr.mjs} +38 -2
  6. package/dist/{auth-router-CIxiMG7i.mjs → auth-router-O_Wrs5kg.mjs} +5 -4
  7. package/dist/{better-auth-shared-B74NJIus.d.mts → better-auth-shared-Bv18bB-l.d.mts} +2 -0
  8. package/dist/{better-auth-shared-CMXlZG7W.mjs → better-auth-shared-D-6z0q0f.mjs} +28 -1
  9. package/dist/{build-cmd-BkIv25PA.mjs → build-cmd-CMZiMn46.mjs} +1 -1
  10. package/dist/{cache-Ctzfig-W.mjs → cache-TZ5Ab3d7.mjs} +1 -1
  11. package/dist/{cancel-deploy-CD9o-SsC.mjs → cancel-deploy-DXoR6oC3.mjs} +1 -1
  12. package/dist/cli/cli.mjs +69 -50
  13. package/dist/cli/env-schema-probe.mjs +3 -3
  14. package/dist/client-DrdeJgHR.mjs +1 -0
  15. package/dist/{client-DM9Kcf4e.mjs → client-GuSO3v_x.mjs} +1 -1
  16. package/dist/{cloudflare-auth-CqFBDo52.mjs → cloudflare-auth-DSvBc1Gu.mjs} +1 -1
  17. package/dist/{cloudflare-cmd-BIAF_BIY.mjs → cloudflare-cmd-ZSErUl6Y.mjs} +3 -3
  18. package/dist/{cloudflare-config-DV60XFFK.mjs → cloudflare-config-rdFOys4X.mjs} +2 -2
  19. package/dist/{cloudflare-connect-WjwnVOJA.mjs → cloudflare-connect-BN-k2kD-.mjs} +2 -2
  20. package/dist/{cloudflare-operations-CrSUFRzJ.mjs → cloudflare-operations-Cm8lVx7W.mjs} +1 -1
  21. package/dist/{cloudflare-operations-B42EZeJy.mjs → cloudflare-operations-DH3GedbV.mjs} +6 -6
  22. package/dist/{cloudflare-process-CeDWJRhj.mjs → cloudflare-process-CZJ4viYl.mjs} +2 -2
  23. package/dist/collect-BWhkgtAn.mjs +1 -0
  24. package/dist/{collect-xjffdCdk.mjs → collect-Dew86qce.mjs} +4 -3
  25. package/dist/{config-D0GY5ItR.mjs → config-CyUJzi3q.mjs} +1 -1
  26. package/dist/{config-Bx_1SpnO.mjs → config-D26zcdKy.mjs} +2 -2
  27. package/dist/{config-BEm9vRvS.mjs → config-DC5llZaI.mjs} +2 -2
  28. package/dist/{config-QrJWu0IX.mjs → config-DYJV8aEH.mjs} +1 -1
  29. package/dist/{connect-CKtk-EZe.mjs → connect-yQuLbuiJ.mjs} +4 -4
  30. package/dist/{create-project-B-ewF_Af.mjs → create-project-CGOo_OL_.mjs} +1 -1
  31. package/dist/{create-project-yInGo72M.mjs → create-project-DEEWJX_M.mjs} +1 -1
  32. package/dist/database-provider.d.mts +6 -0
  33. package/dist/{db-7I_gfdVq.mjs → db-COI-yTJE.mjs} +255 -110
  34. package/dist/{db-types-Bb4WBWIs.mjs → db-types-NGxPwnlt.mjs} +1 -1
  35. package/dist/{delete-Cy-M1u-r.mjs → delete-PgN6L_9N.mjs} +1 -1
  36. package/dist/deploy-CxNgEYr4.mjs +2 -0
  37. package/dist/{deploy-BYYlnsiy.mjs → deploy-DsW-PrRQ.mjs} +38 -36
  38. package/dist/{deploy-managed-static-Ca4TFdmx.mjs → deploy-managed-static-Dqz06S2u.mjs} +20 -20
  39. package/dist/{deploy-transport-DWlWBe6M.mjs → deploy-transport-nY3vLXPL.mjs} +2 -2
  40. package/dist/deploy.mjs +5 -5
  41. package/dist/discover-D4TPKo57.mjs +1 -0
  42. package/dist/{discover-D2PGT63u.mjs → discover-LaV0tbIu.mjs} +1 -1
  43. package/dist/{dispatch-DrTTk8Xg.mjs → dispatch-BAbbn3jg.mjs} +6 -6
  44. package/dist/{domain-CZGxPv9u.mjs → domain-DKlNI0SR.mjs} +2 -2
  45. package/dist/{drizzle-CF84FOVM.mjs → drizzle-BQfyvQKX.mjs} +13 -2
  46. package/dist/{email-DzyNVuoU.mjs → email-C0s3OvJk.mjs} +10 -11
  47. package/dist/{email-cloudflare-DfG6UEMm.mjs → email-cloudflare-etpKiITL.mjs} +7 -10
  48. package/dist/{entry-ehmBvs5w.mjs → entry-B_0IhV64.mjs} +1 -1
  49. package/dist/{env-Nx3yf50r.mjs → env-BX2JFsgF.mjs} +4 -4
  50. package/dist/{env-types-DS2_y4X8.mjs → env-types-GRchm5dw.mjs} +1 -1
  51. package/dist/{env-validation-BT7z-qpQ.mjs → env-validation-CuGfWRJd.mjs} +1 -1
  52. package/dist/{env-validation-DYxjz_Wo.mjs → env-validation-D_KyMdab.mjs} +2 -2
  53. package/dist/{fetch-BPCYVi3H.d.mts → fetch-DHLOuPyk.d.mts} +2 -2
  54. package/dist/{fetch-stream-obvZ7fvO.d.mts → fetch-stream-CNxOrBdP.d.mts} +1 -1
  55. package/dist/{gen-CufHEf42.mjs → gen-Bj6ZkOcI.mjs} +25 -19
  56. package/dist/gen-DsCukhuw.mjs +1 -0
  57. package/dist/{generate-Dat0UTry.mjs → generate-B1m4Cm4n.mjs} +1 -1
  58. package/dist/{generate-ClI89brV.mjs → generate-DkEb9rL-.mjs} +1 -1
  59. package/dist/{github-cmd-FU8EjFyU.mjs → github-cmd-DQDryS-5.mjs} +1 -1
  60. package/dist/{headers-Di1FsD3e.mjs → headers-Bi4bOAwp.mjs} +1 -1
  61. package/dist/{help-BT2hovNI.mjs → help-D49SL_lN.mjs} +16 -12
  62. package/dist/help-DOFygYi4.mjs +1 -0
  63. package/dist/{inbound-brj2-TM5.d.mts → inbound-Da7XsjH3.d.mts} +6 -12
  64. package/dist/index.mjs +103 -57
  65. package/dist/{info-l249eUdH.mjs → info-Bxunp14X.mjs} +4 -4
  66. package/dist/{init-D0A6M64Q.mjs → init-DyTEY04s.mjs} +50 -27
  67. package/dist/{link-WMoJFf4i.mjs → link-CgOVn9EC.mjs} +2 -2
  68. package/dist/{list-CQ2EQEHL.mjs → list-CUfD9RSb.mjs} +2 -2
  69. package/dist/{local-d1-BxvQYEFi.mjs → local-d1-CpaPbd_L.mjs} +5 -5
  70. package/dist/{login-C2T1oVG-.mjs → login-BJvGW5Eu.mjs} +2 -2
  71. package/dist/login-alAlxw4S.mjs +1 -0
  72. package/dist/{logs-DnC1d7xB.mjs → logs-DeizBI4j.mjs} +2 -2
  73. package/dist/{migrate-BDIprOYd.mjs → migrate-8rk56vV8.mjs} +4 -4
  74. package/dist/migrate-D2odrAmh.mjs +1 -0
  75. package/dist/{neon-n74ta1Pr.mjs → neon-DTZr7Bu7.mjs} +0 -1
  76. package/dist/nitro.mjs +3 -3
  77. package/dist/{node-cPadMgUO.mjs → node-uN8_zxJr.mjs} +15 -9
  78. package/dist/{operator-cmd-DHieWtFp.mjs → operator-cmd-CA5QQyvE.mjs} +3 -3
  79. package/dist/operator-cmd-D7toMPJ9.mjs +1 -0
  80. package/dist/pages/client.d.mts +1 -1
  81. package/dist/pages/index.d.mts +1 -1
  82. package/dist/pages/index.mjs +4 -4
  83. package/dist/pages/islands-plugin.d.mts +1 -1
  84. package/dist/pages/islands-plugin.mjs +1 -1
  85. package/dist/pages/protocol.d.mts +1 -1
  86. package/dist/{platform-args-CaCL_1Ch.mjs → platform-args-B7ke06up.mjs} +1 -4
  87. package/dist/platform-args-B_LrqEZB.mjs +1 -0
  88. package/dist/{platform-auth-config-Z16-I8nT.mjs → platform-auth-config-CZaY812e.mjs} +3 -3
  89. package/dist/{platform-auth-protection-BXwZiJSF.mjs → platform-auth-protection-U9HCqoXv.mjs} +2 -2
  90. package/dist/{platform-auth-recovery-CXjfqyOv.mjs → platform-auth-recovery-B0BV2hfV.mjs} +2 -2
  91. package/dist/{platform-cmd-DaAOiWTl.mjs → platform-cmd-CXrjk4fb.mjs} +4 -4
  92. package/dist/{platform-cmd-PT4YwMLM.mjs → platform-cmd-D9lwFpcl.mjs} +1 -1
  93. package/dist/{platform-domain-CxpvUeo0.mjs → platform-domain-CXyq-68_.mjs} +2 -2
  94. package/dist/{platform-lifecycle-DBiS0cJd.mjs → platform-lifecycle-D0TdyXbN.mjs} +20 -11
  95. package/dist/{platform-lifecycle-u9pMOvxC.mjs → platform-lifecycle-Dz2cJsLX.mjs} +1 -1
  96. package/dist/{platform-management-DvBS83rC.mjs → platform-management-BvgbusqL.mjs} +1 -1
  97. package/dist/{platform-management-DhEFdQAf.mjs → platform-management-CnXhgxTM.mjs} +1 -3
  98. package/dist/{platform-recovery-BUGOB4RC.mjs → platform-recovery-CH_fThW6.mjs} +2 -2
  99. package/dist/{plugin-inference-DsARdQKE.mjs → plugin-inference-Bekzjuqw.mjs} +2 -2
  100. package/dist/{prepare-PQCgsny0.mjs → prepare-2XD6kh77.mjs} +1 -1
  101. package/dist/{prepare-DEB5SeVJ.mjs → prepare-DepAGBcV.mjs} +9 -9
  102. package/dist/prepare-EVEbQ9n2.mjs +1 -0
  103. package/dist/{project-cmd-DVatD8Ev.mjs → project-cmd-CpLYflCH.mjs} +16 -16
  104. package/dist/{project-paths-DMvEeSau.mjs → project-paths-DGu_QZ_Q.mjs} +1 -1
  105. package/dist/{project-team-DJrWEAG1.mjs → project-team-CTSY7W7Q.mjs} +1 -1
  106. package/dist/{project-token-CBgLBuL6.mjs → project-token-Cybtlfbl.mjs} +1 -1
  107. package/dist/{project-tsconfig-bveqhlYA.mjs → project-tsconfig-Itv1f4WC.mjs} +1 -1
  108. package/dist/{project-zero-trust-92gLtZ25.mjs → project-zero-trust-DKOtqyvu.mjs} +1 -1
  109. package/dist/{protocol-4H7V_3Os.d.mts → protocol-B8sI8dRD.d.mts} +1 -1
  110. package/dist/{providers-BXuhmuub.mjs → providers-BUHwJlmM.mjs} +10 -1
  111. package/dist/{provision-BnSSkiED.mjs → provision-BuifYvLc.mjs} +63 -64
  112. package/dist/provision-UcYjpTRh.mjs +1 -0
  113. package/dist/r2-conditions-B8xUgJRc.mjs +61 -0
  114. package/dist/{requests-7W1Pygt2.mjs → requests-Ryiazz9i.mjs} +1 -1
  115. package/dist/{rollback-BcASVnwP.mjs → rollback-Or0EV3rP.mjs} +2 -2
  116. package/dist/{runner-CabsQ-iM.mjs → runner-3uGC-oLF.mjs} +9 -7
  117. package/dist/{runner-So9mYfcm.mjs → runner-WCdfeI0q.mjs} +1 -1
  118. package/dist/{runner-mysql-BhRaONkO.mjs → runner-mysql-BWmbk5IE.mjs} +1 -1
  119. package/dist/{runner-mysql-DWwE8jKi.mjs → runner-mysql-BcHnLUuM.mjs} +1 -1
  120. package/dist/{runner-pg-_Xncr3H5.mjs → runner-pg-Cgp-cr_p.mjs} +1 -1
  121. package/dist/{runner-pg-BRemq_GX.mjs → runner-pg-Cr3qrqi4.mjs} +1 -1
  122. package/dist/runtime/ai.d.mts +4 -0
  123. package/dist/runtime/ai.mjs +2 -37
  124. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  125. package/dist/runtime/better-auth-mysql.mjs +2 -2
  126. package/dist/runtime/better-auth-pg.d.mts +1 -1
  127. package/dist/runtime/better-auth-pg.mjs +2 -2
  128. package/dist/runtime/better-auth.d.mts +1 -1
  129. package/dist/runtime/better-auth.mjs +2 -2
  130. package/dist/runtime/client-react.d.mts +2 -2
  131. package/dist/runtime/client-solid.d.mts +2 -2
  132. package/dist/runtime/client-svelte.d.mts +2 -2
  133. package/dist/runtime/client-vue.d.mts +2 -2
  134. package/dist/runtime/client.d.mts +2 -2
  135. package/dist/runtime/email/testing.d.mts +1 -1
  136. package/dist/runtime/email.d.mts +2 -3
  137. package/dist/runtime/email.mjs +2 -3
  138. package/dist/runtime/fetch-stream.d.mts +2 -2
  139. package/dist/runtime/fetch.d.mts +1 -1
  140. package/dist/runtime/migration-handler-mysql.mjs +4 -4
  141. package/dist/runtime/migration-handler-pg.mjs +9 -1
  142. package/dist/runtime/remote/binding-handler.mjs +25 -25
  143. package/dist/runtime/remote/index.d.mts +3 -0
  144. package/dist/runtime/remote/index.mjs +86 -23
  145. package/dist/runtime/routing.d.mts +2 -2
  146. package/dist/runtime/sse-client.d.mts +4 -0
  147. package/dist/runtime/ws-server.d.mts +2 -2
  148. package/dist/runtime/ws.d.mts +1 -1
  149. package/dist/{scan-C0BMdmEd.mjs → scan-D2-FcLHs.mjs} +13 -5
  150. package/dist/{secret-bg73f1Ge.mjs → secret-CClHaFxm.mjs} +3 -3
  151. package/dist/{types-BAp5AEBU.d.mts → types-7AIz0OZu.d.mts} +1 -1
  152. package/dist/{validate-CheZGRE7.mjs → validate-CnZPMq4q.mjs} +22 -17
  153. package/dist/validate-D7Wn8PUX.mjs +1 -0
  154. package/dist/{version-metadata-DIrqEHQo.mjs → version-metadata-B1Bm2wSq.mjs} +1 -1
  155. package/dist/{wrangler-BYs07Rxy.mjs → wrangler-C9XSzrju.mjs} +3 -3
  156. package/dist/wrangler-DAdxHEzh.mjs +1 -0
  157. package/dist/{wrapper-CwhpNWtH.mjs → wrapper-BOigE1xJ.mjs} +4 -4
  158. package/dist/{ws-aKVYB-fA.d.mts → ws-CsBNxv86.d.mts} +5 -0
  159. package/docs/guide/auth.md +1 -1
  160. package/docs/guide/database/d1.md +2 -2
  161. package/docs/guide/database/mysql.md +1 -1
  162. package/docs/guide/edge/headers.md +10 -2
  163. package/docs/guide/edge/revalidation.md +2 -0
  164. package/docs/guide/email/receiving.md +1 -1
  165. package/docs/guide/email/sending.md +1 -1
  166. package/docs/guide/pages-routing/islands.md +2 -2
  167. package/docs/guide/platform/administration/connected-apps.md +18 -2
  168. package/docs/guide/remote-dev.md +2 -0
  169. package/docs/guide/websockets.md +2 -2
  170. package/docs/index.md +78 -22
  171. package/docs/reference/api/pages.md +7 -5
  172. package/docs/reference/api.md +2 -0
  173. package/docs/reference/cli/database.md +7 -5
  174. package/docs/reference/cli/deploy.md +12 -10
  175. package/docs/reference/cli/email.md +1 -1
  176. package/docs/reference/cli/generate.md +1 -1
  177. package/docs/reference/cli/platform-installation.md +2 -2
  178. package/docs/reference/cli/project.md +4 -2
  179. package/docs/reference/cli.md +1 -1
  180. package/docs/reference/config.md +11 -1
  181. package/package.json +7 -7
  182. package/dist/client-B60PwCC4.mjs +0 -1
  183. package/dist/collect-Cae8A7Zr.mjs +0 -1
  184. package/dist/deploy-9lgfhrXS.mjs +0 -2
  185. package/dist/discover-ClzFSwns.mjs +0 -1
  186. package/dist/gen-sXyp5DFO.mjs +0 -1
  187. package/dist/help-i2YGGnTH.mjs +0 -1
  188. package/dist/login-XD844Xs-.mjs +0 -1
  189. package/dist/migrate-BRwU-blY.mjs +0 -1
  190. package/dist/operator-cmd-D6gnZsnK.mjs +0 -1
  191. package/dist/platform-args-B0HeTh0C.mjs +0 -1
  192. package/dist/prepare-CYT6tAzD.mjs +0 -1
  193. package/dist/r2-conditions-D1Wk8i7b.mjs +0 -30
  194. package/dist/validate-BQFdf0Pi.mjs +0 -1
@@ -1,14 +1,13 @@
1
1
  import { a as join, n as dirname, s as relative } from "./dist-ipQi0Q8y.mjs";
2
- import { n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
3
- import { d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
4
- import { n as readJournal, t as collectMigrations } from "./collect-xjffdCdk.mjs";
2
+ import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
3
+ import { d as readConfig, s as getDatabaseDialect } from "./config-D26zcdKy.mjs";
4
+ import { n as readJournal, t as collectMigrations } from "./collect-Dew86qce.mjs";
5
5
  import { K as select, L as log, O as cancel, tt as isCancel } from "./dist-BVdsO7Py.mjs";
6
6
  import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
7
- import { n as ensureProjectTsconfig } from "./project-tsconfig-bveqhlYA.mjs";
8
- import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BEm9vRvS.mjs";
9
- import { t as assertJournalCoherence } from "./validate-CheZGRE7.mjs";
7
+ import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-DC5llZaI.mjs";
8
+ import { t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
10
9
  import { n as drizzleKitBin, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DLbEFMT0.mjs";
11
- import { n as snapshotDrizzleOutputs } from "./generate-Dat0UTry.mjs";
10
+ import { n as snapshotDrizzleOutputs } from "./generate-B1m4Cm4n.mjs";
12
11
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
13
12
  import { spawnSync } from "node:child_process";
14
13
  //#region src/cli/gen.ts
@@ -330,7 +329,8 @@ async function runModel(root, name, columns) {
330
329
  const existing = readFileSync(barrelPath, "utf-8");
331
330
  if (!existing.includes(exportLine)) writeFileSync(barrelPath, existing.trimEnd() + "\n" + exportLine + "\n");
332
331
  } else writeFileSync(barrelPath, exportLine + "\n");
333
- ensureProjectTsconfig(root, void 0, true, true, { paths });
332
+ const { prepareProject } = await import("./prepare-EVEbQ9n2.mjs");
333
+ await prepareProject(root);
334
334
  log.step(`Created ${relative(root, modelPath)}`);
335
335
  log.step(`Updated ${relative(root, barrelPath)}`);
336
336
  writeIfNotExists(join(paths.routesDir, "api", name, "index.ts"), generateIndexRoute(name, columns, validator));
@@ -338,28 +338,34 @@ async function runModel(root, name, columns) {
338
338
  printSuccess("Model scaffolding complete. Run `void db push` to apply.");
339
339
  }
340
340
  function runMigration(root, name) {
341
- const migrationsDir = readProjectPaths(root).migrationsDir;
341
+ const paths = readProjectPaths(root);
342
+ const migrationsDir = paths.migrationsDir;
343
+ const dir = paths.sourceRelative("db/migrations");
342
344
  mkdirSync(migrationsDir, { recursive: true });
343
345
  const currentMigrations = collectMigrations(migrationsDir);
344
346
  try {
345
- assertJournalCoherence(migrationsDir, currentMigrations);
347
+ assertJournalCoherence(migrationsDir, currentMigrations, paths.sourceRelative);
346
348
  } catch (err) {
347
349
  log.error(err instanceof Error ? err.message : String(err));
348
350
  process.exit(1);
349
351
  }
350
352
  const bundlePath = join(migrationsDir, "migrations.js");
351
353
  if (existsSync(bundlePath)) {
352
- log.error("Your project uses Drizzle's bundled migration format (db/migrations/migrations.js).\n`void gen migration` cannot add custom hand-written migrations to a bundled project\nbecause the bundle must be regenerated by drizzle-kit.\n\nEither run `drizzle-kit generate` to regenerate the bundle, or migrate away from\nbundled mode by deleting db/migrations/migrations.js and re-running `void db generate`.");
354
+ log.error(`Your project uses Drizzle's bundled migration format (${dir}/migrations.js).\n\`void gen migration\` cannot add custom hand-written migrations to a bundled project
355
+ because the bundle must be regenerated by drizzle-kit.
356
+
357
+ Either run \`drizzle-kit generate\` to regenerate the bundle, or migrate away from
358
+ bundled mode by deleting ${dir}/migrations.js and re-running \`void db generate\`.`);
353
359
  process.exit(1);
354
360
  }
355
- const existingJournal = readJournal(migrationsDir);
361
+ const existingJournal = readJournal(migrationsDir, paths.sourceRelative);
356
362
  if (existingJournal !== void 0 && existingJournal.entries.length > 0) {
357
363
  const lastEntry = existingJournal.entries[existingJournal.entries.length - 1];
358
364
  const metaDir = join(migrationsDir, "meta");
359
365
  const lastSnapshotPrefix = lastEntry.tag.split("_")[0];
360
366
  const prevSnapshotPath = join(metaDir, `${lastSnapshotPrefix}_snapshot.json`);
361
367
  if (!existsSync(prevSnapshotPath)) {
362
- log.error(`db/migrations/meta/_journal.json's last entry is \`${lastEntry.tag}\` but the matching snapshot \`${lastSnapshotPrefix}_snapshot.json\` is missing under meta/.`);
368
+ log.error(`${dir}/meta/_journal.json's last entry is \`${lastEntry.tag}\` but the matching snapshot \`${lastSnapshotPrefix}_snapshot.json\` is missing under meta/.`);
363
369
  log.error("Restore the snapshot from version control, or regenerate migrations with `void db generate` before running `void gen migration`.");
364
370
  process.exit(1);
365
371
  }
@@ -370,14 +376,14 @@ function runMigration(root, name) {
370
376
  else if (existingJournal.dialect === "postgresql") journalDialect = "postgresql";
371
377
  else if (existingJournal.dialect === "mysql") journalDialect = "mysql";
372
378
  else {
373
- log.error(`db/migrations/meta/_journal.json has an unsupported dialect: \`${existingJournal.dialect}\`.`);
374
- log.error("void supports `sqlite`, `postgresql`, and `mysql` only. Restore the journal from version control, or drop db/migrations/ and regenerate from scratch.");
379
+ log.error(`${dir}/meta/_journal.json has an unsupported dialect: \`${existingJournal.dialect}\`.`);
380
+ log.error(`void supports \`sqlite\`, \`postgresql\`, and \`mysql\` only. Restore the journal from version control, or drop ${dir}/ and regenerate from scratch.`);
375
381
  process.exit(1);
376
382
  }
377
383
  const configDialect = getDatabaseDialect(readConfig(root));
378
384
  if (configDialect !== journalDialect) {
379
- log.error(`db/migrations/meta/_journal.json was generated for ${journalDialect}, but void.config.ts is configured for ${configDialect}.`);
380
- log.error(`Generating a new custom migration now would append a snapshot in the wrong dialect. Revert void.config.ts's \`database\` field to ${journalDialect}, or drop db/migrations/ and regenerate from scratch.`);
385
+ log.error(`${dir}/meta/_journal.json was generated for ${journalDialect}, but void.config.ts is configured for ${configDialect}.`);
386
+ log.error(`Generating a new custom migration now would append a snapshot in the wrong dialect. Revert void.config.ts's \`database\` field to ${journalDialect}, or drop ${dir}/ and regenerate from scratch.`);
381
387
  process.exit(1);
382
388
  }
383
389
  const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
@@ -404,12 +410,12 @@ function runMigration(root, name) {
404
410
  `Failed to run \`drizzle-kit generate --custom --name ${name}\`.`,
405
411
  ...detail ? [detail] : [],
406
412
  "",
407
- "This is usually a schema-compilation error. Fix any TypeScript errors in db/schema.ts and try again."
413
+ `This is usually a schema-compilation error. Fix any TypeScript errors in ${paths.sourceRelative("db/schema.ts")} and try again.`
408
414
  ].join("\n"));
409
415
  process.exit(1);
410
416
  }
411
417
  const newSqlFile = readdirSync(migrationsDir).filter((f) => f.endsWith(".sql")).find((f) => !sqlFilesBefore.has(f));
412
- if (newSqlFile) log.step(`Created db/migrations/${newSqlFile}`);
418
+ if (newSqlFile) log.step(`Created ${dir}/${newSqlFile}`);
413
419
  printSuccess("Migration created and journal updated.");
414
420
  return;
415
421
  }
@@ -0,0 +1 @@
1
+ export { r as runGenCommand } from "./gen-Bj6ZkOcI.mjs";
@@ -1,5 +1,5 @@
1
1
  import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
2
- import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
2
+ import { t as collectMigrations } from "./collect-Dew86qce.mjs";
3
3
  import { n as openMigrationValidationDatabase } from "./sqlite-validation-BzKMWnO4.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
5
5
  //#region src/drizzle/generate.ts
@@ -1 +1 @@
1
- export { t as generateValidatedSqliteMigrations } from "./generate-Dat0UTry.mjs";
1
+ export { t as generateValidatedSqliteMigrations } from "./generate-B1m4Cm4n.mjs";
@@ -2,7 +2,7 @@ import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken, n as createCodeChallenge, r as createCodeVerifier, t as awaitBrowserCallback, u as openBrowser } from "./auth-B6iOCjKI.mjs";
3
3
  import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
4
4
  import { f as import_picocolors, l as formatUrl, m as printSuccess } from "./output-Ba6ZbrzY.mjs";
5
- import { c as platformErrorMessage, n as PlatformApiError, r as PlatformClient, s as parsePlatformErrorBody } from "./client-DM9Kcf4e.mjs";
5
+ import { c as platformErrorMessage, n as PlatformApiError, r as PlatformClient, s as parsePlatformErrorBody } from "./client-GuSO3v_x.mjs";
6
6
  import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
7
7
  import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
8
8
  import { randomBytes } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import { a as join } from "./dist-ipQi0Q8y.mjs";
2
- import { a as convertRewritesConfig, i as convertRedirectsConfig, l as isProtocolRelative, n as convertFallbacksConfig, o as countSplats, r as convertHeadersConfig, t as VALID_REDIRECT_STATUSES, u as parseHostPrefixedSource } from "./config-Bx_1SpnO.mjs";
2
+ import { a as convertRewritesConfig, i as convertRedirectsConfig, l as isProtocolRelative, n as convertFallbacksConfig, o as countSplats, r as convertHeadersConfig, t as VALID_REDIRECT_STATUSES, u as parseHostPrefixedSource } from "./config-D26zcdKy.mjs";
3
3
  import { i as voidWarn } from "./log-vqY3pqwI.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  //#region src/cli/headers.ts
@@ -178,6 +178,10 @@ const HELP_TREE = {
178
178
  command: "--require-email",
179
179
  description: "Fail instead of deploying without email when the mail domain is not set up (with --platform cloudflare)"
180
180
  },
181
+ {
182
+ command: "--provision",
183
+ description: "Run resource provisioning again, for example to enable D1 read replication (with --platform cloudflare)"
184
+ },
181
185
  {
182
186
  command: "--atomic",
183
187
  description: "Publish a Durable Object Worker without pre-traffic staging (Cloudflare only)"
@@ -712,7 +716,7 @@ const HELP_TREE = {
712
716
  },
713
717
  {
714
718
  command: "--keep-zone",
715
- description: "Explicitly retain an installer-created zone"
719
+ description: "Deprecated. Has no effect: uninstall always keeps zones"
716
720
  }
717
721
  ]
718
722
  }
@@ -768,7 +772,7 @@ const HELP_TREE = {
768
772
  },
769
773
  {
770
774
  command: "purge-cache",
771
- description: "Purge all cached pages"
775
+ description: "Purge all cached pages (Void platform)"
772
776
  }
773
777
  ],
774
778
  children: {
@@ -973,7 +977,7 @@ const HELP_TREE = {
973
977
  }]
974
978
  },
975
979
  "purge-cache": {
976
- summary: "Purge all cached pages for a project.",
980
+ summary: "Purge all cached pages for a Void platform project.",
977
981
  usage: ["void project purge-cache [options]"],
978
982
  options: [{
979
983
  command: "--project <name>",
@@ -1155,7 +1159,7 @@ const HELP_TREE = {
1155
1159
  usage: ["void email status --platform cloudflare"],
1156
1160
  options: [{
1157
1161
  command: "--platform cloudflare",
1158
- description: "Your own Cloudflare account (the only platform with a status today)"
1162
+ description: "Your own Cloudflare account (required; on the Void platform use `void email usage`)"
1159
1163
  }]
1160
1164
  },
1161
1165
  setup: {
@@ -1364,7 +1368,7 @@ const HELP_TREE = {
1364
1368
  commands: [
1365
1369
  {
1366
1370
  command: "push",
1367
- description: "Push schema to local D1 without migration files"
1371
+ description: "Push schema to the development database without migration files"
1368
1372
  },
1369
1373
  {
1370
1374
  command: "generate",
@@ -1392,7 +1396,7 @@ const HELP_TREE = {
1392
1396
  },
1393
1397
  {
1394
1398
  command: "studio",
1395
- description: "Open Drizzle Studio (--remote for deployed PG)"
1399
+ description: "Open Drizzle Studio (--remote for deployed PostgreSQL/MySQL)"
1396
1400
  },
1397
1401
  {
1398
1402
  command: "export",
@@ -1412,7 +1416,7 @@ const HELP_TREE = {
1412
1416
  }
1413
1417
  ],
1414
1418
  children: {
1415
- push: basicSubcommand("Push schema to local D1 without migration files.", "void db push"),
1419
+ push: basicSubcommand("Push schema to the development database without migration files.", "void db push"),
1416
1420
  generate: basicSubcommand("Generate SQL migrations from schema changes.", "void db generate"),
1417
1421
  status: basicSubcommand("Show migration status for local and remote DBs.", "void db status"),
1418
1422
  reset: {
@@ -1468,18 +1472,18 @@ const HELP_TREE = {
1468
1472
  }]
1469
1473
  },
1470
1474
  studio: {
1471
- summary: "Open Drizzle Studio against the database (local by default; use --remote for the deployed PostgreSQL database; D1 remote not yet supported).",
1475
+ summary: "Open Drizzle Studio against the database (local by default; use --remote for the deployed PostgreSQL or MySQL database).",
1472
1476
  usage: ["void db studio [options]"],
1473
1477
  options: [{
1474
1478
  command: "--remote",
1475
- description: "Open Studio against the deployed PostgreSQL database (D1 remote not yet supported)"
1479
+ description: "Open Studio against the deployed PostgreSQL or MySQL database (not D1)"
1476
1480
  }],
1477
1481
  examples: [{
1478
1482
  command: "void db studio",
1479
1483
  description: "Open Studio for the local database"
1480
1484
  }, {
1481
1485
  command: "void db studio --remote",
1482
- description: "Open Studio against the deployed PostgreSQL database"
1486
+ description: "Open Studio against the deployed PostgreSQL or MySQL database"
1483
1487
  }]
1484
1488
  },
1485
1489
  export: {
@@ -1565,7 +1569,7 @@ const HELP_TREE = {
1565
1569
  commands: [
1566
1570
  {
1567
1571
  command: "model <name> [cols...]",
1568
- description: "Generate migration, CRUD routes, and DB types"
1572
+ description: "Scaffold a Drizzle table, API routes, and DB types"
1569
1573
  },
1570
1574
  {
1571
1575
  command: "migration <name>",
@@ -1594,7 +1598,7 @@ const HELP_TREE = {
1594
1598
  ],
1595
1599
  children: {
1596
1600
  model: {
1597
- summary: "Generate a migration, CRUD routes, and database types.",
1601
+ summary: "Scaffold a Drizzle table, list/create/get API routes, and database types.",
1598
1602
  usage: ["void gen model <name> [columns...]"],
1599
1603
  examples: [{
1600
1604
  command: "void gen model post title:string body:text",
@@ -0,0 +1 @@
1
+ export { r as printHelpPage } from "./help-D49SL_lN.mjs";
@@ -43,18 +43,12 @@ interface SendEmailOptions {
43
43
  */
44
44
  idempotencyKey?: string;
45
45
  /**
46
- * Per-call escape hatch for local development. When true, bypasses the
47
- * `void dev` in-memory inbox for this one send.
48
- *
49
- * It does not deliver. `void dev` binds no send transport at all: the
50
- * platform's `__VOID_PROXY` service binding is added only on a deployed
51
- * worker, and the own-account `SEND_EMAIL` binding is stripped under
52
- * `serve`. With the inbox skipped there is nothing to fall through to,
53
- * so the call returns `BINDING_MISSING`. To verify real delivery, deploy
54
- * and send from the deployed worker.
55
- *
56
- * Has no effect outside `void dev` (production always sends; the dev
57
- * inbox is registered only when `void dev` is running).
46
+ * @deprecated During `void dev` it skips the local inbox, and the send
47
+ * returns `BINDING_MISSING`, so it never delivers there. While a
48
+ * `createEmailTestHarness` sink is active, it skips the sink, and the send
49
+ * uses the `SEND_EMAIL` binding or the platform proxy of the current
50
+ * environment. A deployed app ignores it. Remove it, and deploy the app to
51
+ * test real delivery. Removed in the next major version.
58
52
  */
59
53
  sendInDev?: boolean;
60
54
  }
package/dist/index.mjs CHANGED
@@ -1,43 +1,43 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
2
2
  import { a as join, c as resolve, n as dirname, o as normalize, s as relative } from "./dist-ipQi0Q8y.mjs";
3
3
  import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
4
- import { d as walk, l as inferBindingsFromSource, m as applyBindingOverrides, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS, u as staticModuleReferences } from "./plugin-inference-DsARdQKE.mjs";
5
- import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DMvEeSau.mjs";
6
- import { n as loadVoidAuthConfig } from "./config-D0GY5ItR.mjs";
7
- import { c as isNodeTarget, d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
4
+ import { d as walk, l as inferBindingsFromSource, m as applyBindingOverrides, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS, u as staticModuleReferences } from "./plugin-inference-Bekzjuqw.mjs";
5
+ import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DGu_QZ_Q.mjs";
6
+ import { n as loadVoidAuthConfig } from "./config-CyUJzi3q.mjs";
7
+ import { c as isNodeTarget, d as readConfig, s as getDatabaseDialect } from "./config-D26zcdKy.mjs";
8
8
  import { i as isMemberExpression, n as isIdentifier, r as isLiteral } from "./ast-CPGPjb0V.mjs";
9
9
  import { t as isRouteEnabledForEnvironment } from "./parse-filename-CUbj-1MP.mjs";
10
- import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-AB_YYWgH.mjs";
11
- import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-ehmBvs5w.mjs";
10
+ import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-D7nNmNJb.mjs";
11
+ import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-B_0IhV64.mjs";
12
12
  import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
13
+ import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-vqY3pqwI.mjs";
13
14
  import { t as MagicString } from "./dist-Cegxq8gs.mjs";
14
- import { i as resolveLayoutIds } from "./scan-C0BMdmEd.mjs";
15
+ import { i as resolveLayoutIds } from "./scan-D2-FcLHs.mjs";
15
16
  import { a as resolveDistDir, c as hasDocumentRoutes, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, s as hasApiRoutes, t as collectPages, u as resolveAssetRoutingPolicy } from "./isr-config-fZaJJ8t7.mjs";
16
- import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-vqY3pqwI.mjs";
17
- import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Di1FsD3e.mjs";
17
+ import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-Bi4bOAwp.mjs";
18
18
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
19
- import { a as restoreCloudflarePreviewPointer, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-DV60XFFK.mjs";
20
- import { D as syncWranglerBindings, E as resolveLiveBindingConfig, O as syncWranglerDurableObjects, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerWebSockets, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-BYs07Rxy.mjs";
21
- import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-BxvQYEFi.mjs";
19
+ import { a as restoreCloudflarePreviewPointer, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-rdFOys4X.mjs";
20
+ import { D as syncWranglerBindings, E as resolveLiveBindingConfig, O as syncWranglerDurableObjects, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, b as readRootWranglerConfig, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerWebSockets, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-C9XSzrju.mjs";
21
+ import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-CpaPbd_L.mjs";
22
22
  import { n as scopedAccessCredentials } from "./cf-access-BM9G0lhO.mjs";
23
23
  import { n as ensurePlatformProxyAccess } from "./cf-access-CWP4avfP.mjs";
24
24
  import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
25
25
  import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
26
- import { r as writeFileIfChanged } from "./project-tsconfig-bveqhlYA.mjs";
27
- import { n as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-DrTTk8Xg.mjs";
26
+ import { r as writeFileIfChanged } from "./project-tsconfig-Itv1f4WC.mjs";
27
+ import { n as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-BAbbn3jg.mjs";
28
28
  import { _ as parseCapturedMessage, a as DEV_INBOX_ENV_VAR, c as DEV_INBOX_TOKEN_ENV_VAR, f as clearDevBuffer, g as listDevMessages, l as DEV_INBOX_TOKEN_HEADER, m as findDevMessage, n as DEV_INBOX_ACK_VALUE, o as DEV_INBOX_MAX_CAPTURE_BYTES, s as DEV_INBOX_PREFIX, t as DEV_INBOX_ACK_HEADER, u as DEV_INBOX_TOKEN_QUERY, v as pushToDevBuffer } from "./dev-inbox-Rd6j_8vM.mjs";
29
29
  import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
30
30
  import { a as isClientEnvKey, c as resolveRemoteMode, i as findReservedEnvKeys, n as LOCAL_ENV_FILE, o as loadLocalEnv, r as findLegacyEnvFiles, s as reservedEnvKeysMessage } from "./env-BJjULvL0.mjs";
31
- import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-DS2_y4X8.mjs";
31
+ import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-GRchm5dw.mjs";
32
32
  import { t as loadUserEnvFile } from "./load-user-env-DD5qveNU.mjs";
33
33
  import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-D74P4ebM.mjs";
34
34
  import { t as ASSET_EXTENSIONS } from "./routing-assets-VkrKIbxE.mjs";
35
- import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DIrqEHQo.mjs";
36
- import { f as prerenderPages, n as SEND_EMAIL_BINDING, p as prerenderPagesNode } from "./email-cloudflare-DfG6UEMm.mjs";
35
+ import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-B1Bm2wSq.mjs";
36
+ import { f as prerenderPages, n as SEND_EMAIL_BINDING, p as prerenderPagesNode } from "./email-cloudflare-etpKiITL.mjs";
37
37
  import { r as defer } from "./validation-error-Dg9Recn1.mjs";
38
38
  import { i as safeJsonStringify } from "./protocol-RNP0u7UY.mjs";
39
- import { n as completeApplicationAnalysis } from "./application-routing-L7V-TFhZ.mjs";
40
- import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-CF84FOVM.mjs";
39
+ import { n as completeApplicationAnalysis } from "./application-routing-CZH66gXn.mjs";
40
+ import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-BQfyvQKX.mjs";
41
41
  import { n as generateQueueTypes, t as generateRouteTypes } from "./route-types-BZi26DVS.mjs";
42
42
  import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-BZ1t7-Rv.mjs";
43
43
  import module, { builtinModules, createRequire } from "node:module";
@@ -490,7 +490,7 @@ function readVoidDevCredentials(root) {
490
490
  */
491
491
  async function runAiSetupPrompt(root, token, apiUrl, server) {
492
492
  const { select, text, isCancel, log } = await import("./dist-CfgIkieS.mjs");
493
- const { PlatformClient } = await import("./client-B60PwCC4.mjs");
493
+ const { PlatformClient } = await import("./client-DrdeJgHR.mjs");
494
494
  const { attachSelectedPlatform, writeProjectConfig } = await import("./project-zdB3fs9G.mjs");
495
495
  const { inferDefaultSlug } = await import("./resolve-project-PnhzMtY6.mjs");
496
496
  const client = new PlatformClient(token, { apiUrl });
@@ -519,7 +519,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
519
519
  let slug;
520
520
  if (result === "__create__") {
521
521
  const { validateProjectSlug } = await import("./project-slug-6cyz8E7k.mjs");
522
- const { createProjectWithSlugRetry } = await import("./create-project-B-ewF_Af.mjs");
522
+ const { createProjectWithSlugRetry } = await import("./create-project-CGOo_OL_.mjs");
523
523
  let created;
524
524
  try {
525
525
  created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
@@ -1645,9 +1645,9 @@ function writeFrameworkTriggersDispatch(root, devTriggerToken) {
1645
1645
  /**
1646
1646
  * Writes a real file at `<root>/.void/dev-triggers.ts` exporting
1647
1647
  * `handleDevTrigger(request, env, ctx)`. We use a real file (not a Vite
1648
- * virtual module) because Nitro and Astro have their own server bundlers
1649
- * that don't go through Vite's plugin pipeline. The framework injection
1650
- * code imports this path at runtime to dispatch cron and queue handlers
1648
+ * virtual module) because Nitro has its own server bundler that doesn't go
1649
+ * through Vite's plugin pipeline. The framework injection code imports
1650
+ * this path at runtime to dispatch cron and queue handlers
1651
1651
  * with the framework adapter's real bindings.
1652
1652
  */
1653
1653
  function frameworkTriggersPlugin(root, options) {
@@ -2041,13 +2041,34 @@ function astroMiddlewareClaims() {
2041
2041
  return store[ASTRO_MIDDLEWARE_CLAIMS] ??= /* @__PURE__ */ new Map();
2042
2042
  }
2043
2043
  /**
2044
+ * Whether the Astro app has middleware that Void did not write. Void cannot add its dev trigger
2045
+ * middleware then, so the wrapper around Astro's Cloudflare server entry answers the triggers.
2046
+ */
2047
+ function hasOwnAstroMiddleware(root) {
2048
+ const middlewarePath = join(root, ASTRO_MIDDLEWARE_RELATIVE);
2049
+ if (existsSync(middlewarePath)) return !astroMiddlewareClaims().has(middlewarePath);
2050
+ return existsSync(join(root, "src", "middleware", "index.ts"));
2051
+ }
2052
+ /** The Worker entry from the app's Cloudflare config, unless it is Astro's server entry. */
2053
+ function customAstroWorkerEntry(root) {
2054
+ let main;
2055
+ try {
2056
+ main = readRootWranglerConfig(root)?.config.main;
2057
+ } catch {
2058
+ return;
2059
+ }
2060
+ return typeof main === "string" && !/^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)?$/.test(main) ? main : void 0;
2061
+ }
2062
+ /**
2044
2063
  * Writes a tiny Astro middleware to the user's project so
2045
2064
  * `/__void/scheduled` and `/__void/queue` are intercepted inside Astro's
2046
- * request pipeline, with bindings from `cloudflare:workers`.
2065
+ * request pipeline, with bindings from `cloudflare:workers`. Astro runs
2066
+ * middleware for a custom Worker entry too.
2047
2067
  *
2048
2068
  * Astro middleware lives at a single discoverable entry, so if the user
2049
- * already has `src/middleware.ts` we don't overwrite it — instead we log a
2050
- * one-shot snippet they can paste into their existing middleware.
2069
+ * already has `src/middleware.ts` we don't overwrite it. The wrapper around
2070
+ * Astro's Cloudflare server entry answers the triggers then. A custom Worker
2071
+ * entry can skip that server entry, so we warn when the app sets one.
2051
2072
  *
2052
2073
  * If we wrote the file we remove it when the last dev server using it closes,
2053
2074
  * so the user's source tree stays clean. `src/middleware.ts` belongs to the
@@ -2056,19 +2077,21 @@ function astroMiddlewareClaims() {
2056
2077
  */
2057
2078
  function astroDevTriggerInjectPlugin(root) {
2058
2079
  const middlewarePath = join(root, ASTRO_MIDDLEWARE_RELATIVE);
2059
- const middlewareDirIndexPath = join(root, "src", "middleware", "index.ts");
2060
2080
  const claims = astroMiddlewareClaims();
2061
2081
  /** Whether the dev server being set up now holds the middleware Void wrote. */
2062
2082
  const ensureFile = () => {
2083
+ if (hasOwnAstroMiddleware(root)) {
2084
+ const entry = customAstroWorkerEntry(root);
2085
+ if (entry) voidWarn(`Your Astro app has its own middleware and its own Worker entry (${entry}).\n In dev, /__void/scheduled and /__void/queue do not work if this entry calls
2086
+ handle() from @astrojs/cloudflare/handler. To use them, call fetch() on the
2087
+ default export of @astrojs/cloudflare/entrypoints/server instead.`);
2088
+ return false;
2089
+ }
2063
2090
  const claim = claims.get(middlewarePath);
2064
2091
  if (claim && existsSync(middlewarePath)) {
2065
2092
  claim.servers++;
2066
2093
  return true;
2067
2094
  }
2068
- if (existsSync(middlewarePath) || existsSync(middlewareDirIndexPath)) {
2069
- voidWarn("Astro middleware already exists. To enable /__void/scheduled and /__void/queue,\n add the Void dev-trigger middleware to your existing onRequest sequence.\n See https://void.cloud/guide/jobs#local-development.");
2070
- return false;
2071
- }
2072
2095
  mkdirSync(dirname(middlewarePath), { recursive: true });
2073
2096
  writeFileSync(middlewarePath, astroMiddlewareSource(frameworkTriggersDispatchPath(root)));
2074
2097
  if (claim) claim.servers++;
@@ -3262,9 +3285,12 @@ function findDependencyClosure(name, fromDir) {
3262
3285
  function readDatabaseUrl(root) {
3263
3286
  return loadLocalEnv(root).DATABASE_URL;
3264
3287
  }
3265
- /** DATABASE_URL as Better Auth's local migrations read it: the shell before `.env`. */
3288
+ /**
3289
+ * DATABASE_URL as Better Auth's local migrations read it: the shell before `.env`. An empty
3290
+ * shell value counts as unset.
3291
+ */
3266
3292
  function readAuthDatabaseUrl(root) {
3267
- return (process.env.DATABASE_URL ?? readDatabaseUrl(root)) || void 0;
3293
+ return process.env.DATABASE_URL || readDatabaseUrl(root) || void 0;
3268
3294
  }
3269
3295
  /**
3270
3296
  * Vite plugin that runs local migrations on dev server startup.
@@ -3276,25 +3302,32 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3276
3302
  name: "void:migrations",
3277
3303
  apply: "serve",
3278
3304
  async configureServer(server) {
3279
- const migrationsDir = readProjectPaths(root).migrationsDir;
3305
+ const paths = readProjectPaths(root);
3306
+ const migrationsDir = paths.migrationsDir;
3280
3307
  const hasSqlMigrations = existsSync(migrationsDir);
3281
3308
  if (!hasSqlMigrations && !auth?.enabled) return;
3282
3309
  const migrateAuth = async (databaseUrl) => {
3283
- const { runLocalVoidAuthMigrations } = await import("./node-cPadMgUO.mjs");
3310
+ const { runLocalVoidAuthMigrations } = await import("./node-uN8_zxJr.mjs");
3284
3311
  await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth?.configPath, databaseUrl);
3285
3312
  };
3286
3313
  const mysqlAuth = dialect === "mysql" && auth?.enabled === true;
3287
3314
  const logApplied = (applied) => {
3288
3315
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
3289
3316
  };
3317
+ const refuse = (err) => {
3318
+ afterServerReady(server, () => {
3319
+ console.log();
3320
+ voidError(`${err instanceof Error ? err.message : String(err)}\nNo migrations were applied. Fix the files, then restart the dev server.`);
3321
+ });
3322
+ };
3290
3323
  try {
3291
3324
  if (dialect !== "sqlite") {
3292
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
3325
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
3293
3326
  const allMigrations = collectMigrations(migrationsDir);
3294
3327
  const runFiles = dialect === "mysql" ? allMigrations.length > 0 : hasSqlMigrations;
3295
3328
  const url = runFiles ? readDatabaseUrl(root) : void 0;
3296
3329
  const authUrl = mysqlAuth ? readAuthDatabaseUrl(root) : void 0;
3297
- if (runFiles && !url || mysqlAuth && !authUrl) {
3330
+ if (runFiles && !url || auth?.enabled && !readAuthDatabaseUrl(root)) {
3298
3331
  afterServerReady(server, () => {
3299
3332
  console.log();
3300
3333
  voidError(`DATABASE_URL not found in .env — skipping ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} migrations.`);
@@ -3303,29 +3336,30 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3303
3336
  }
3304
3337
  const authWithFiles = authUrl !== void 0 && authUrl === url;
3305
3338
  if (url) {
3306
- const { validateMigrations } = await import("./validate-BQFdf0Pi.mjs");
3307
- const appliedNames = dialect === "mysql" ? await import("./runner-mysql-DWwE8jKi.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-_Xncr3H5.mjs").then((runner) => runner.getPgAppliedMigrations(url));
3339
+ const { validateMigrations } = await import("./validate-D7Wn8PUX.mjs");
3340
+ const appliedNames = dialect === "mysql" ? await import("./runner-mysql-BcHnLUuM.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-Cgp-cr_p.mjs").then((runner) => runner.getPgAppliedMigrations(url));
3308
3341
  const appliedSet = new Set(appliedNames);
3309
3342
  const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
3310
3343
  if (pending.length > 0) try {
3311
3344
  validateMigrations(pending);
3312
3345
  } catch (err) {
3313
- voidWarn(err instanceof Error ? err.message : String(err));
3346
+ refuse(err);
3347
+ return;
3314
3348
  }
3315
- const applied = dialect === "mysql" ? await import("./runner-mysql-DWwE8jKi.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
3349
+ const applied = dialect === "mysql" ? await import("./runner-mysql-BcHnLUuM.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
3316
3350
  logApplied(names);
3317
3351
  await migrateAuth(url);
3318
- } : void 0)) : await import("./runner-pg-_Xncr3H5.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
3352
+ } : void 0)) : await import("./runner-pg-Cgp-cr_p.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
3319
3353
  if (!authWithFiles) logApplied(applied);
3320
3354
  }
3321
3355
  if (authUrl && !authWithFiles) {
3322
- const { withMySqlMigrationLockAt } = await import("./runner-mysql-DWwE8jKi.mjs");
3356
+ const { withMySqlMigrationLockAt } = await import("./runner-mysql-BcHnLUuM.mjs");
3323
3357
  await withMySqlMigrationLockAt(authUrl, () => migrateAuth(authUrl));
3324
3358
  }
3325
3359
  } else if (hasSqlMigrations) {
3326
- const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-So9mYfcm.mjs");
3327
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
3328
- const { validateMigrations } = await import("./validate-BQFdf0Pi.mjs");
3360
+ const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-WCdfeI0q.mjs");
3361
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
3362
+ const { validateMigrations } = await import("./validate-D7Wn8PUX.mjs");
3329
3363
  const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
3330
3364
  const allMigrations = collectMigrations(migrationsDir);
3331
3365
  const appliedRows = await getAppliedMigrations(dbPath);
@@ -3334,9 +3368,10 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
3334
3368
  if (pending.length > 0) try {
3335
3369
  validateMigrations(pending);
3336
3370
  } catch (err) {
3337
- voidWarn(err instanceof Error ? err.message : String(err));
3371
+ refuse(err);
3372
+ return;
3338
3373
  }
3339
- const applied = await runMigrations(migrationsDir, dbPath);
3374
+ const applied = await runMigrations(migrationsDir, dbPath, paths.sourceRelative);
3340
3375
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
3341
3376
  }
3342
3377
  if (auth?.enabled) {
@@ -3631,27 +3666,38 @@ function createFrameworkPlugins(input) {
3631
3666
  return injectSvelteKitHooks(code, id, frameworkTriggersDispatchPath(root));
3632
3667
  }
3633
3668
  };
3634
- const astroRequestScopePlugin = detected.name === "astro" && dialect !== "sqlite" ? {
3635
- name: "void:astro-request-scope",
3669
+ const scopeAstroRequests = dialect !== "sqlite";
3670
+ let astroDevTriggers = false;
3671
+ const astroServerEntryPlugin = detected.name === "astro" ? {
3672
+ name: "void:astro-server-entry",
3636
3673
  enforce: "pre",
3674
+ configResolved(resolvedConfig) {
3675
+ astroDevTriggers = resolvedConfig.command === "serve" && hasOwnAstroMiddleware(root);
3676
+ },
3637
3677
  resolveId: {
3638
3678
  filter: { id: /^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)?$/ },
3639
3679
  handler(_id, importer) {
3640
- if (importer === ASTRO_SCOPED_SERVER_ENTRY || this.environment?.name === "client") return;
3680
+ if (!scopeAstroRequests && !astroDevTriggers || importer === ASTRO_SCOPED_SERVER_ENTRY || this.environment?.name === "client") return;
3641
3681
  return ASTRO_SCOPED_SERVER_ENTRY;
3642
3682
  }
3643
3683
  },
3644
3684
  load: {
3645
3685
  filter: { id: /^\0void:astro-server-entry$/ },
3646
3686
  handler() {
3647
- return `import original from ${JSON.stringify(ASTRO_SERVER_ENTRY)};
3648
- import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};
3687
+ const imports = [
3688
+ `import original from ${JSON.stringify(ASTRO_SERVER_ENTRY)};`,
3689
+ ...scopeAstroRequests ? [`import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};`] : [],
3690
+ ...astroDevTriggers ? [`import { handleDevTrigger } from ${JSON.stringify(frameworkTriggersDispatchPath(root))};`] : []
3691
+ ];
3692
+ const handle = astroDevTriggers ? "async () => (await handleDevTrigger(request, env, ctx)) ?? original.fetch(request, env, ctx)" : "() => original.fetch(request, env, ctx)";
3693
+ return `${imports.join("\n")}
3649
3694
  export * from ${JSON.stringify(ASTRO_SERVER_ENTRY)};
3650
3695
 
3651
3696
  export default {
3652
3697
  ...original,
3653
3698
  fetch(request, env, ctx) {
3654
- return withRuntimeEnv(env, () => original.fetch(request, env, ctx));
3699
+ const handle = ${handle};
3700
+ return ${scopeAstroRequests ? "withRuntimeEnv(env, handle)" : "handle()"};
3655
3701
  },
3656
3702
  };
3657
3703
  `;
@@ -3694,7 +3740,7 @@ export default {
3694
3740
  wranglerCompatPlugin,
3695
3741
  wranglerSyncPlugin,
3696
3742
  ...nuxtVite8WebSocketCompatPlugin ? [nuxtVite8WebSocketCompatPlugin] : [],
3697
- ...astroRequestScopePlugin ? [astroRequestScopePlugin] : [],
3743
+ ...astroServerEntryPlugin ? [astroServerEntryPlugin] : [],
3698
3744
  svelteKitHooksInjectPlugin,
3699
3745
  ...svelteKitWorkerBuildPlugin ? [svelteKitWorkerBuildPlugin] : [],
3700
3746
  clientStubsPlugin,
@@ -4456,7 +4502,7 @@ function routingPlugin(root, options) {
4456
4502
  if (!options.target) {
4457
4503
  const migrationsDir = paths.migrationsDir;
4458
4504
  if (existsSync(migrationsDir) || compileOptions.auth) {
4459
- const { collectMigrations } = await import("./collect-Cae8A7Zr.mjs");
4505
+ const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
4460
4506
  const { buildMigrationPlanBundle } = await import("./plan-CKX_jWnD.mjs");
4461
4507
  const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
4462
4508
  const dialect = getDatabaseDialect(readConfig(root));
@@ -1,8 +1,8 @@
1
1
  import { a as join, s as relative } from "./dist-ipQi0Q8y.mjs";
2
- import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-DsARdQKE.mjs";
3
- import { d as readConfig } from "./config-Bx_1SpnO.mjs";
4
- import { d as deriveDurableResourceIdentity, f as inferDurableResourceName, t as analyzeApplicationSync } from "./application-analysis-AB_YYWgH.mjs";
5
- import { n as VOID_LOCK_FILE } from "./cloudflare-config-DV60XFFK.mjs";
2
+ import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-Bekzjuqw.mjs";
3
+ import { d as readConfig } from "./config-D26zcdKy.mjs";
4
+ import { d as deriveDurableResourceIdentity, f as inferDurableResourceName, t as analyzeApplicationSync } from "./application-analysis-D7nNmNJb.mjs";
5
+ import { n as VOID_LOCK_FILE } from "./cloudflare-config-rdFOys4X.mjs";
6
6
  import { existsSync, readFileSync } from "node:fs";
7
7
  import { isRecord } from "@void/deploy-core";
8
8
  //#region src/cli/info.ts