void 0.7.13 → 0.8.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 (133) hide show
  1. package/dist/{agents-DqkFfc2c.mjs → agents-Dkgafwfr.mjs} +1 -1
  2. package/dist/{auth-cmd-bS88H4Lb.mjs → auth-cmd-B1-7r6ng.mjs} +3 -3
  3. package/dist/{better-auth-shared-D2JaoCs4.mjs → better-auth-shared-CbAF6sOM.mjs} +1 -1
  4. package/dist/{better-auth-shared-HXlHRw02.d.mts → better-auth-shared-Fzyk5yS1.d.mts} +2 -7
  5. package/dist/{cache-DUDCNty6.mjs → cache-CGYC-2LW.mjs} +5 -5
  6. package/dist/{cancel-deploy-DOuSbPwX.mjs → cancel-deploy-B4j31z7d.mjs} +4 -4
  7. package/dist/canonical-json-CEyQaVDa.mjs +13 -0
  8. package/dist/cli/cli.mjs +44 -31
  9. package/dist/{client-C_DYiXeu.mjs → client-C-nH6yz3.mjs} +5 -5
  10. package/dist/{collect-HqAuilH6.mjs → collect-9rO3JFNM.mjs} +1 -1
  11. package/dist/{config-DyUSwbeX.mjs → config--wXmVOoe.mjs} +10 -8
  12. package/dist/{config-CeRQg3Lz.mjs → config-BVEC0lti.mjs} +11 -2
  13. package/dist/{config-CvHtTM0q.mjs → config-hhMYPVRT.mjs} +3 -12
  14. package/dist/{create-project-hvFe6rbI.mjs → create-project-BGnQMy5N.mjs} +44 -18
  15. package/dist/{db-YEYSTfGw.mjs → db-CT5Xg6ds.mjs} +42 -37
  16. package/dist/{delete-XyM_VD9o.mjs → delete-eMGTHHB9.mjs} +5 -5
  17. package/dist/{deploy-CPAEgVQm.mjs → deploy-7EA_lKq9.mjs} +169 -99
  18. package/dist/{discover-CKGQpis8.mjs → discover-C8N1I4tK.mjs} +9 -6
  19. package/dist/{domain-Dvj7u8tr.mjs → domain-UfLrp2vc.mjs} +64 -22
  20. package/dist/{drizzle-Cx7cVwrE.mjs → drizzle-DmaANP4-.mjs} +1 -1
  21. package/dist/{env-Bjl0rzuf.mjs → env-Cvdbbm_N.mjs} +7 -7
  22. package/dist/{env-helpers-Dw95CU8e.d.mts → env-helpers-Bt9yYg5I.d.mts} +1 -1
  23. package/dist/{env-types-BSQghXbx.mjs → env-types-D6qI1ThV.mjs} +8 -19
  24. package/dist/{env-validation-Buy5pe3u.mjs → env-validation-DBJsxZLz.mjs} +4 -4
  25. package/dist/{gen-DU8NIdrH.mjs → gen-Cn2hZ8RR.mjs} +37 -31
  26. package/dist/{handler-DJTuxB10.d.mts → handler-BPhL8AmU.d.mts} +3 -3
  27. package/dist/{headers-CuVHn6Kl.mjs → headers-wAPJigtE.mjs} +3 -3
  28. package/dist/index.d.mts +3 -3
  29. package/dist/index.mjs +273 -104
  30. package/dist/{init-Br5DTaG7.mjs → init-DL6syXuF.mjs} +43 -31
  31. package/dist/{link-DdXqlUiJ.mjs → link-C5x1E-XZ.mjs} +5 -5
  32. package/dist/{list-9Bxa5Odn.mjs → list-ezL7hqDV.mjs} +5 -5
  33. package/dist/{login-C_MfDjhu.mjs → login-CkLr-AaI.mjs} +3 -3
  34. package/dist/{logs-DjqCpEER.mjs → logs-MnGILmLz.mjs} +4 -4
  35. package/dist/{mcp-vA0880_K.mjs → mcp-B84MmVAW.mjs} +3 -3
  36. package/dist/{node-gxRQXIRT.mjs → node-fpywdcbN.mjs} +6 -6
  37. package/dist/{output-D3g5otMC.mjs → output-DeiS4oEX.mjs} +1 -1
  38. package/dist/pages/client.d.mts +1 -1
  39. package/dist/pages/head-client.d.mts +1 -1
  40. package/dist/pages/head.d.mts +1 -1
  41. package/dist/pages/index.d.mts +28 -3
  42. package/dist/pages/index.mjs +6 -5
  43. package/dist/pages/islands-plugin.d.mts +1 -1
  44. package/dist/pages/islands-plugin.mjs +7 -5
  45. package/dist/pages/protocol.d.mts +2 -2
  46. package/dist/pages/protocol.mjs +1 -1
  47. package/dist/{pathe.M-eThtNZ-D-kmWkCS.mjs → pathe.M-eThtNZ-BrPhGF_K.mjs} +1 -1
  48. package/dist/plan-aD3wRDqF.mjs +271 -0
  49. package/dist/{plugin-inference-BexV6LL3.mjs → plugin-inference-Ba1uGdIy.mjs} +26 -20
  50. package/dist/{prepare-BEkH89oX.mjs → prepare-BrAISonG.mjs} +29 -19
  51. package/dist/{preset-CYQh93UF.mjs → preset-BRsCi8ZB.mjs} +10 -8
  52. package/dist/{project-DhB4A8_g.mjs → project-CH9pdo16.mjs} +1 -1
  53. package/dist/{project-cmd-CeXO06hG.mjs → project-cmd-JQUzv3qF.mjs} +10 -10
  54. package/dist/project-paths-CCMrHYQm.mjs +100 -0
  55. package/dist/{project-slug-KRvHQEQI.mjs → project-slug-De4UjtD9.mjs} +0 -1
  56. package/dist/{project-tsconfig-Bfy55qvs.mjs → project-tsconfig-HAGjfY6w.mjs} +10 -5
  57. package/dist/{protocol-D7r_deVZ.d.mts → protocol-mcSsdMij.d.mts} +3 -3
  58. package/dist/providers--_pvxpNN.d.mts +7 -0
  59. package/dist/{resolve-project-DdjLQ2tB.mjs → resolve-project-CNpUbUHd.mjs} +1 -1
  60. package/dist/{rollback-C8OSMxmq.mjs → rollback-CoAAvC18.mjs} +4 -4
  61. package/dist/{route-types-qVL-v-CB.mjs → route-types-jxRfWuCb.mjs} +1 -1
  62. package/dist/{runner-C0d3lJo1.mjs → runner-BkGBfr4e.mjs} +4 -2
  63. package/dist/{runner-pg-Bd_172vF.mjs → runner-pg-BXP0JpHW.mjs} +1 -1
  64. package/dist/runtime/ai.mjs +2 -2
  65. package/dist/runtime/auth.d.mts +1 -1
  66. package/dist/runtime/better-auth-pg.d.mts +1 -1
  67. package/dist/runtime/better-auth-pg.mjs +2 -2
  68. package/dist/runtime/better-auth.d.mts +1 -1
  69. package/dist/runtime/better-auth.mjs +2 -2
  70. package/dist/runtime/client.d.mts +2 -2
  71. package/dist/runtime/client.mjs +1 -1
  72. package/dist/runtime/env-helpers.d.mts +1 -1
  73. package/dist/runtime/env-public-client.d.mts +1 -1
  74. package/dist/runtime/env-public.d.mts +2 -2
  75. package/dist/runtime/env-public.mjs +1 -1
  76. package/dist/runtime/env.mjs +1 -1
  77. package/dist/runtime/fetch-stream.d.mts +1 -1
  78. package/dist/runtime/fetch-stream.mjs +1 -1
  79. package/dist/runtime/fetch.d.mts +1 -1
  80. package/dist/runtime/fetch.mjs +1 -1
  81. package/dist/runtime/handler.d.mts +1 -1
  82. package/dist/runtime/handler.mjs +1 -1
  83. package/dist/runtime/isr.mjs +1 -1
  84. package/dist/runtime/live.d.mts +2 -2
  85. package/dist/runtime/live.mjs +1 -1
  86. package/dist/runtime/migration-handler.d.mts +33 -1
  87. package/dist/runtime/migration-handler.mjs +332 -24
  88. package/dist/runtime/remote/index.mjs +1 -1
  89. package/dist/runtime/sandbox.d.mts +73 -3
  90. package/dist/runtime/sandbox.mjs +239 -3
  91. package/dist/runtime/validator.d.mts +1 -1
  92. package/dist/runtime/ws-server.d.mts +2 -2
  93. package/dist/runtime/ws.d.mts +3 -3
  94. package/dist/{scan-CKpylFj9.mjs → scan-2YmJkYAf.mjs} +4 -3
  95. package/dist/{scan-CkK1Hzpa.mjs → scan-DzzHqtiT.mjs} +82 -43
  96. package/dist/{secret-NDvlqAN2.mjs → secret-mz8t_CML.mjs} +5 -5
  97. package/dist/{skills-SAG0WyVn.mjs → skills-B_ynF4lA.mjs} +3 -3
  98. package/dist/{subcommand-prompt-q9T06dpg.mjs → subcommand-prompt-CPuV7tPW.mjs} +2 -2
  99. package/dist/sveltekit.mjs +1 -1
  100. package/dist/{validate-DW3ViKTA.mjs → validate-CNWm-PsL.mjs} +49 -9
  101. package/dist/{yarn-pnp-6LD6_3Ej.mjs → yarn-pnp-QgEYVC3V.mjs} +1 -1
  102. package/package.json +3 -2
  103. package/schema.json +5 -0
  104. package/skills/void/docs/guide/ai.md +1 -1
  105. package/skills/void/docs/guide/app-types.md +1 -1
  106. package/skills/void/docs/guide/database/postgresql.md +1 -1
  107. package/skills/void/docs/guide/edge/headers.md +1 -1
  108. package/skills/void/docs/guide/edge/static-assets.md +34 -0
  109. package/skills/void/docs/guide/sandboxes.md +3 -2
  110. package/skills/void/docs/guide/ssr.md +25 -2
  111. package/skills/void/docs/integrations/cloudflare.md +5 -3
  112. package/skills/void/docs/integrations/frameworks/overview.md +1 -1
  113. package/skills/void/docs/integrations/nodejs-bun-deno.md +10 -9
  114. package/skills/void/docs/reference/api.md +204 -13
  115. package/skills/void/docs/reference/cli.md +52 -6
  116. package/skills/void/docs/reference/config.md +27 -4
  117. package/skills/void/docs/reference/resource-inference.md +1 -1
  118. /package/dist/{auth-DmuALf16.d.mts → auth-SfRBhXan.d.mts} +0 -0
  119. /package/dist/{auth-migrations-BwLPwRgH.mjs → auth-migrations-BqJoGqGQ.mjs} +0 -0
  120. /package/dist/{cf-access-BW8K93Fm.mjs → cf-access-DKDsgwOU.mjs} +0 -0
  121. /package/dist/{defer-2ARBu8Et.mjs → defer-DkoEwda-.mjs} +0 -0
  122. /package/dist/{dist-q8b2Mjgb.mjs → dist-DR9sIMbM.mjs} +0 -0
  123. /package/dist/{dist-D2L3_KTK.mjs → dist-abzUneor.mjs} +0 -0
  124. /package/dist/{dotenv-HQNhRalS.mjs → dotenv-Bkoqyq9r.mjs} +0 -0
  125. /package/dist/{env-raw-DtfQ9E31.mjs → env-raw-zk5JQKZe.mjs} +0 -0
  126. /package/dist/{fetch-error-DZ868Xq4.d.mts → fetch-error-BbixZ9vW.d.mts} +0 -0
  127. /package/dist/{fetch-error-CEr0ACTl.mjs → fetch-error-rXermVU3.mjs} +0 -0
  128. /package/dist/{head-C7QW7UY1.d.mts → head-CZs8dMxG.d.mts} +0 -0
  129. /package/dist/{log-7ChR5Fbc.mjs → log-CWWZV4V1.mjs} +0 -0
  130. /package/dist/{magic-string.es-DS_lmuBe.mjs → magic-string.es-C1Fb0uxq.mjs} +0 -0
  131. /package/dist/{providers-BlFNPYen.mjs → providers-uC0PJg1c.mjs} +0 -0
  132. /package/dist/{standard-schema-D2qvCEYV.d.mts → standard-schema-WhHcCaqJ.d.mts} +0 -0
  133. /package/dist/{types-DG_Ynnyd.d.mts → types-C8wsi1hv.d.mts} +0 -0
@@ -1,26 +1,28 @@
1
1
  import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
- import { a as join, i as isAbsolute, n as dirname, o as relative, r as extname, s as resolve } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
3
- import { n as cliTitle, r as createSpinner, s as import_picocolors } from "./output-D3g5otMC.mjs";
4
- import { t as findVoidAuthConfig } from "./config-CvHtTM0q.mjs";
5
- import { a as isExpiredTokenError, c as getToken, i as isCliOutdatedError, l as getTokenSource, n as PlatformClient, o as parsePlatformErrorBody, t as PlatformApiError, u as isStagingMode } from "./client-C_DYiXeu.mjs";
6
- import { c as R, g as ge, u as Se, v as ue, x as q, y as ye } from "./dist-D2L3_KTK.mjs";
7
- import { a as writeProjectConfig, r as readProjectConfig } from "./project-DhB4A8_g.mjs";
8
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-CeRQg3Lz.mjs";
9
- import { i as scanJobsSync, n as scanWebSocketRoutesSync, r as scanQueuesSync, t as scanRoutes } from "./scan-CkK1Hzpa.mjs";
10
- import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-BexV6LL3.mjs";
11
- import { i as voidWarn, r as voidLog } from "./log-7ChR5Fbc.mjs";
12
- import { t as discoverSchema } from "./discover-CKGQpis8.mjs";
13
- import { t as findEnvFile } from "./env-types-BSQghXbx.mjs";
14
- import { i as validateProdEnv, n as formatEnvReport, r as getDeployEnvDefaults, t as fetchRemoteSecretNames } from "./env-validation-Buy5pe3u.mjs";
15
- import { n as writeDrizzleConfig } from "./config-DyUSwbeX.mjs";
16
- import { t as collectMigrations } from "./collect-HqAuilH6.mjs";
17
- import { r as validateMigrations, t as assertJournalCoherence } from "./validate-DW3ViKTA.mjs";
18
- import { t as scanPages } from "./scan-CKpylFj9.mjs";
19
- import { n as promptProjectSelection, r as promptProjectSetupAction, t as promptAndCreateProject } from "./create-project-hvFe6rbI.mjs";
20
- import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-DdjLQ2tB.mjs";
21
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-CuVHn6Kl.mjs";
22
- import { t as promptForLoginToken } from "./login-C_MfDjhu.mjs";
23
- import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-CYQh93UF.mjs";
2
+ import { a as join, c as resolve, i as isAbsolute, n as dirname, r as extname, s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
+ import { n as cliTitle, r as createSpinner, s as import_picocolors } from "./output-DeiS4oEX.mjs";
4
+ import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
5
+ import { t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
6
+ import { a as isExpiredTokenError, c as getToken, i as isCliOutdatedError, l as getTokenSource, n as PlatformClient, o as parsePlatformErrorBody, t as PlatformApiError, u as isStagingMode } from "./client-C-nH6yz3.mjs";
7
+ import { c as R, g as ge, u as Se, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
8
+ import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
9
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-BVEC0lti.mjs";
10
+ import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan-DzzHqtiT.mjs";
11
+ import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-Ba1uGdIy.mjs";
12
+ import { i as voidWarn, r as voidLog } from "./log-CWWZV4V1.mjs";
13
+ import { t as discoverSchema } from "./discover-C8N1I4tK.mjs";
14
+ import { t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
15
+ import { i as validateProdEnv, n as formatEnvReport, r as getDeployEnvDefaults, t as fetchRemoteSecretNames } from "./env-validation-DBJsxZLz.mjs";
16
+ import { n as writeDrizzleConfig } from "./config--wXmVOoe.mjs";
17
+ import { t as collectMigrations } from "./collect-9rO3JFNM.mjs";
18
+ import { n as buildMigrationPlanBundle } from "./plan-aD3wRDqF.mjs";
19
+ import { r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
20
+ import { t as scanPages } from "./scan-2YmJkYAf.mjs";
21
+ import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-BGnQMy5N.mjs";
22
+ import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-CNpUbUHd.mjs";
23
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-wAPJigtE.mjs";
24
+ import { t as promptForLoginToken } from "./login-CkLr-AaI.mjs";
25
+ import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-BRsCi8ZB.mjs";
24
26
  import { createRequire } from "node:module";
25
27
  import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
26
28
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -31,6 +33,34 @@ import { execFile, execFileSync, execSync, spawnSync } from "node:child_process"
31
33
  import { parse } from "jsonc-parser";
32
34
  import { hash } from "blake3-jit";
33
35
  import ignore from "ignore";
36
+ //#region src/asset-routing.ts
37
+ function isApiRoutePattern(pattern) {
38
+ return pattern === "/api" || pattern.startsWith("/api/");
39
+ }
40
+ function hasDocumentRoutes(routes) {
41
+ return routes.some((route) => !isApiRoutePattern(route.pattern));
42
+ }
43
+ /**
44
+ * Returns true when browser document navigations must reach the worker before
45
+ * a static asset fallback can serve HTML.
46
+ */
47
+ function workerOwnsHtmlRouting(inputs) {
48
+ return inputs.isSsr || inputs.hasPages || inputs.hasDocumentRoutes || inputs.hasMiddleware || inputs.hasWebSockets === true || inputs.authEnabled === true || inputs.liveEnabled === true;
49
+ }
50
+ function resolveAssetConfig(inputs) {
51
+ return resolveAssetRoutingPolicy(inputs).assetConfig;
52
+ }
53
+ function resolveAssetRoutingPolicy(inputs) {
54
+ const workerFirst = workerOwnsHtmlRouting(inputs);
55
+ return {
56
+ assetConfig: workerFirst ? {
57
+ not_found_handling: "none",
58
+ run_worker_first: ["/**"]
59
+ } : { not_found_handling: "single-page-application" },
60
+ workerFirst,
61
+ workerSpaFallback: workerFirst && !inputs.isSsr && !inputs.hasPages
62
+ };
63
+ }
34
64
  const SANDBOX_MIGRATION_TAG = "void-sandbox-v1";
35
65
  const require = createRequire(import.meta.url);
36
66
  function isSandboxEnabled(config) {
@@ -1706,10 +1736,19 @@ function buildVoidManifest(opts) {
1706
1736
  });
1707
1737
  }
1708
1738
  if (bindings.needsLive) manifest.live = toLiveManifest(options?.live);
1709
- if (migrations && migrations.length > 0) manifest.migrations = {
1710
- dialect: dialect ?? "sqlite",
1711
- pending: migrations.length
1712
- };
1739
+ if (migrations && migrations.length > 0) {
1740
+ const planBundle = dialect === "postgresql" ? void 0 : buildMigrationPlanBundle(migrations);
1741
+ manifest.migrations = {
1742
+ dialect: dialect ?? "sqlite",
1743
+ ...planBundle ? {
1744
+ classifierVersion: planBundle.classifierVersion,
1745
+ migrationListHash: planBundle.migrationListHash,
1746
+ protocolVersion: planBundle.protocolVersion,
1747
+ stability: planBundle.plans.some((plan) => plan.stability === "legacy") ? "legacy" : "stable"
1748
+ } : {},
1749
+ pending: migrations.length
1750
+ };
1751
+ }
1713
1752
  if (schedules && schedules.length > 0) manifest.schedules = schedules;
1714
1753
  if (queues && queues.length > 0) manifest.queues = queues;
1715
1754
  if (ssr) manifest.ssr = true;
@@ -1800,10 +1839,19 @@ function buildFrameworkManifest(opts) {
1800
1839
  if (opts.bindings.needsR2) manifest.bindings.r2 = [po?.bindingNames?.r2 ?? "STORAGE"];
1801
1840
  if (opts.bindings.needsAI) manifest.bindings.ai = true;
1802
1841
  if (opts.bindings.needsLive) throw new Error(FRAMEWORK_LIVE_UNSUPPORTED_MESSAGE);
1803
- if (opts.migrations && opts.migrations.length > 0) manifest.migrations = {
1804
- dialect: opts.dialect ?? "sqlite",
1805
- pending: opts.migrations.length
1806
- };
1842
+ if (opts.migrations && opts.migrations.length > 0) {
1843
+ const planBundle = opts.dialect === "postgresql" ? void 0 : buildMigrationPlanBundle(opts.migrations);
1844
+ manifest.migrations = {
1845
+ dialect: opts.dialect ?? "sqlite",
1846
+ ...planBundle ? {
1847
+ classifierVersion: planBundle.classifierVersion,
1848
+ migrationListHash: planBundle.migrationListHash,
1849
+ protocolVersion: planBundle.protocolVersion,
1850
+ stability: planBundle.plans.some((plan) => plan.stability === "legacy") ? "legacy" : "stable"
1851
+ } : {},
1852
+ pending: opts.migrations.length
1853
+ };
1854
+ }
1807
1855
  if (opts.schedules && opts.schedules.length > 0) manifest.schedules = opts.schedules;
1808
1856
  if (opts.queues && opts.queues.length > 0) manifest.queues = opts.queues;
1809
1857
  if (opts.revalidate != null && opts.revalidate !== 0) manifest.revalidate = opts.revalidate;
@@ -1920,9 +1968,13 @@ async function generateWrapper(workerDir, workerMain, root, features) {
1920
1968
  copyFileSync(join(outDir, handlerFilename), join(workerDir, handlerFilename));
1921
1969
  }
1922
1970
  let migrations;
1971
+ let migrationPlanBundle;
1923
1972
  if (features.hasMigrations) {
1924
- const { collectMigrations } = await import("./collect-HqAuilH6.mjs").then((n) => n.n);
1925
- migrations = collectMigrations(join(root, "db", "migrations"));
1973
+ const { collectMigrations } = await import("./collect-9rO3JFNM.mjs").then((n) => n.n);
1974
+ const { buildMigrationPlanBundle } = await import("./plan-aD3wRDqF.mjs").then((n) => n.i);
1975
+ const migrationsDir = readProjectPaths(root).migrationsDir;
1976
+ migrations = collectMigrations(migrationsDir);
1977
+ migrationPlanBundle = features.migrationDialect === "sqlite" ? buildMigrationPlanBundle(migrations) : void 0;
1926
1978
  const handlerFilename_ = features.migrationDialect === "postgresql" ? "migration-handler-pg.mjs" : "migration-handler.mjs";
1927
1979
  let handlerPath = join(import.meta.dirname, "runtime", handlerFilename_);
1928
1980
  if (!existsSync(handlerPath)) handlerPath = join(import.meta.dirname, "..", "runtime", handlerFilename_);
@@ -1930,7 +1982,7 @@ async function generateWrapper(workerDir, workerMain, root, features) {
1930
1982
  if (!existsSync(handlerPath)) throw new Error(`Migration handler not found: ${handlerFilename_}. Run "pnpm -C packages/void build" first.`);
1931
1983
  copyFileSync(handlerPath, join(workerDir, "__void_migration_handler.mjs"));
1932
1984
  }
1933
- const wrapperSource = generateWrapperSource(renamedName, handlerFilename, features, migrations);
1985
+ const wrapperSource = generateWrapperSource(renamedName, handlerFilename, features, migrations, migrationPlanBundle);
1934
1986
  writeFileSync(join(workerDir, workerMain), wrapperSource);
1935
1987
  }
1936
1988
  /**
@@ -1996,7 +2048,7 @@ function cleanupWrapper(root) {
1996
2048
  writeFileSync(tokenPath, preservedToken);
1997
2049
  }
1998
2050
  }
1999
- function generateWrapperSource(renamedEntry, handlersModule, features, migrations) {
2051
+ function generateWrapperSource(renamedEntry, handlersModule, features, migrations, migrationPlanBundle) {
2000
2052
  const lines = [];
2001
2053
  lines.push(`import original from "./${renamedEntry}";`);
2002
2054
  if (features.crons.length > 0) lines.push(`import { handleScheduled } from "./${handlersModule}";`);
@@ -2004,6 +2056,7 @@ function generateWrapperSource(renamedEntry, handlersModule, features, migration
2004
2056
  if (migrations && migrations.length > 0) {
2005
2057
  lines.push(`import { createMigrationHandler } from "./__void_migration_handler.mjs";`);
2006
2058
  lines.push(`const __migrations = ${JSON.stringify(migrations)};`);
2059
+ lines.push(`const __migrationPlanBundle = ${JSON.stringify(migrationPlanBundle)};`);
2007
2060
  lines.push(`const __migrationDialect = ${JSON.stringify(features.migrationDialect ?? "sqlite")};`);
2008
2061
  }
2009
2062
  lines.push("");
@@ -2019,6 +2072,18 @@ function generateWrapperSource(renamedEntry, handlersModule, features, migration
2019
2072
  lines.push(" const handler = createMigrationHandler(env, __migrations, __migrationDialect);");
2020
2073
  lines.push(" return handler(request);");
2021
2074
  lines.push(" }");
2075
+ lines.push(" if (request.method === \"GET\" && url.pathname === \"/__void/migrate/capabilities\") {");
2076
+ lines.push(" const handler = createMigrationHandler(env, __migrations, __migrationDialect, undefined, __migrationPlanBundle);");
2077
+ lines.push(" return handler(request);");
2078
+ lines.push(" }");
2079
+ lines.push(" if (request.method === \"POST\" && url.pathname === \"/__void/migrate/app\") {");
2080
+ lines.push(" const handler = createMigrationHandler(env, __migrations, __migrationDialect, undefined, __migrationPlanBundle);");
2081
+ lines.push(" return handler(request);");
2082
+ lines.push(" }");
2083
+ lines.push(" if (request.method === \"GET\" && url.pathname.startsWith(\"/__void/migrate/app/attempt/\")) {");
2084
+ lines.push(" const handler = createMigrationHandler(env, __migrations, __migrationDialect, undefined, __migrationPlanBundle);");
2085
+ lines.push(" return handler(request);");
2086
+ lines.push(" }");
2022
2087
  }
2023
2088
  if (features.crons.length > 0) {
2024
2089
  lines.push(" if (request.method === \"POST\" && url.pathname === \"/__void/scheduled\") {");
@@ -2059,9 +2124,10 @@ function generateWrapperSource(renamedEntry, handlersModule, features, migration
2059
2124
  }
2060
2125
  function generateHandlersSource(root, features) {
2061
2126
  const lines = [];
2127
+ const paths = readProjectPaths(root);
2062
2128
  if (features.crons.length > 0) {
2063
2129
  for (let i = 0; i < features.crons.length; i++) {
2064
- const absPath = join(root, "crons", features.crons[i].filePath);
2130
+ const absPath = join(paths.cronsDir, features.crons[i].filePath);
2065
2131
  lines.push(`import cronHandler${i} from "${absPath}";`);
2066
2132
  }
2067
2133
  lines.push("");
@@ -2082,7 +2148,7 @@ function generateHandlersSource(root, features) {
2082
2148
  if (features.queues.length > 0) {
2083
2149
  lines.push("");
2084
2150
  for (let i = 0; i < features.queues.length; i++) {
2085
- const absPath = join(root, "queues", features.queues[i].filePath);
2151
+ const absPath = join(paths.queuesDir, features.queues[i].filePath);
2086
2152
  lines.push(`import queueHandler${i} from "${absPath}";`);
2087
2153
  }
2088
2154
  lines.push("");
@@ -2118,11 +2184,11 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
2118
2184
  ensurePreviouslyDeployedLiveBindingConfig: () => ensurePreviouslyDeployedLiveBindingConfig,
2119
2185
  hasDeploySchemaDrift: () => hasDeploySchemaDrift,
2120
2186
  promptDeployProjectConfig: () => promptDeployProjectConfig,
2121
- resolveAssetConfig: () => resolveAssetConfig,
2122
2187
  resolveDeployLiveBindingConfig: () => resolveDeployLiveBindingConfig,
2123
2188
  resolveDeployWranglerCompat: () => resolveDeployWranglerCompat,
2124
2189
  resolveDistDir: () => resolveDistDir,
2125
2190
  resolveStaticBuildCommand: () => resolveStaticBuildCommand,
2191
+ resolveStaticDeployPreset: () => resolveStaticDeployPreset,
2126
2192
  resolveWorkerDirName: () => resolveWorkerDirName,
2127
2193
  runDeploy: () => runDeploy,
2128
2194
  runStaticDeploy: () => runStaticDeploy,
@@ -2180,24 +2246,6 @@ async function resolveDeployLiveBindingConfig(root, client, projectId, opts) {
2180
2246
  reservedClasses: [...opts.webSockets.map((route) => route.className), opts.sandboxClassName]
2181
2247
  });
2182
2248
  }
2183
- /**
2184
- * Resolve the Cloudflare Workers Static Assets `not_found_handling` config.
2185
- *
2186
- * Any worker capable of producing HTML (SSR, pages, file-based routes, or
2187
- * middleware) must use `'none'` so the asset binding returns 404 for
2188
- * unmatched paths and the worker — gated by `run_worker_first` — owns the
2189
- * response. With `'single-page-application'`, CF short-circuits any
2190
- * `Sec-Fetch-Mode: navigate` request straight to the SPA shell *before*
2191
- * `run_worker_first` is consulted, silently bypassing auth middleware and
2192
- * breaking OAuth callbacks (which arrive as navigations from the provider's
2193
- * 302 redirect).
2194
- *
2195
- * Pure-frontend SPAs without any backend code keep the SPA-fallback config
2196
- * because the worker has no responsibility for HTML routing.
2197
- */
2198
- function resolveAssetConfig(opts) {
2199
- return opts.isSsr || opts.hasPages || opts.hasRoutes || opts.hasMiddleware || opts.hasWebSockets === true || opts.authEnabled === true ? { not_found_handling: "none" } : { not_found_handling: "single-page-application" };
2200
- }
2201
2249
  function getExitCode(error) {
2202
2250
  if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
2203
2251
  return 1;
@@ -2285,8 +2333,12 @@ async function runDeployInner(root, options, cliLog) {
2285
2333
  appType: voidConfig.inference?.appType,
2286
2334
  output: voidConfig.output
2287
2335
  });
2336
+ let preset = resolveStaticDeployPreset(root, voidConfig, {
2337
+ dir: options?.dir,
2338
+ spa: options?.spa
2339
+ });
2288
2340
  const detected = detectFramework(root);
2289
- if (detected) {
2341
+ if (!preset && detected) {
2290
2342
  cliLog.info("framework_detected", {
2291
2343
  name: detected.name,
2292
2344
  class: detected.class
@@ -2302,27 +2354,7 @@ async function runDeployInner(root, options, cliLog) {
2302
2354
  } else await runFullDeploy(root, config, client, fwPreset, options?.skipBuild, gitMetadata, detected, cliLog);
2303
2355
  return;
2304
2356
  }
2305
- let preset = null;
2306
- const appType = voidConfig.inference?.appType;
2307
- if (appType && appType !== "void" && appType !== "framework") {
2308
- const outputDir = voidConfig.inference?.outputDir;
2309
- preset = {
2310
- buildCommand: null,
2311
- outputDir: outputDir ? resolve(root, outputDir) : join(root, "dist"),
2312
- appType
2313
- };
2314
- const detectedPreset = detectPreset(root, {
2315
- dir: options?.dir,
2316
- spa: options?.spa
2317
- });
2318
- if (detectedPreset) {
2319
- preset.buildCommand = detectedPreset.buildCommand;
2320
- if (!outputDir) preset.outputDir = detectedPreset.outputDir;
2321
- }
2322
- } else if (!appType) preset = detectPreset(root, {
2323
- dir: options?.dir,
2324
- spa: options?.spa
2325
- });
2357
+ if (!preset && !voidConfig.inference?.appType) preset = detectPreset(root, { spa: options?.spa });
2326
2358
  const gitMetadata = collectGitDeployMetadata(root, options?.skipBuild ? null : getGitCommit(root));
2327
2359
  if (preset) {
2328
2360
  preset = {
@@ -2366,6 +2398,28 @@ function resolveStaticBuildCommand(preset, buildOverride, hasExplicitDir = false
2366
2398
  if (hasExplicitDir) return null;
2367
2399
  return buildOverride ?? preset.buildCommand;
2368
2400
  }
2401
+ function resolveStaticDeployPreset(root, voidConfig, options) {
2402
+ if (options?.dir) return detectPreset(root, {
2403
+ dir: options.dir,
2404
+ spa: options.spa
2405
+ });
2406
+ const appType = voidConfig.inference?.appType;
2407
+ if (appType === "static" || appType === "spa") {
2408
+ const outputDir = voidConfig.inference?.outputDir;
2409
+ const preset = {
2410
+ buildCommand: null,
2411
+ outputDir: outputDir ? resolve(root, outputDir) : join(root, "dist"),
2412
+ appType
2413
+ };
2414
+ const detectedPreset = detectPreset(root, { spa: options?.spa });
2415
+ if (detectedPreset) {
2416
+ preset.buildCommand = detectedPreset.buildCommand;
2417
+ if (!outputDir) preset.outputDir = detectedPreset.outputDir;
2418
+ }
2419
+ return preset;
2420
+ }
2421
+ return null;
2422
+ }
2369
2423
  /**
2370
2424
  * Apply the visible side effects of a streamed deploy event (spinner
2371
2425
  * message or log warning). Returns a discriminated result so the caller
@@ -2695,8 +2749,14 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
2695
2749
  R.error(`deploy: Worker output '${fwPreset.workerDir}' not found. Run '${buildCmd}' first.`);
2696
2750
  process.exit(1);
2697
2751
  }
2698
- const bindings = inferProjectBindings(root, voidConfig.inference?.bindings ? { bindings: voidConfig.inference.bindings } : void 0, voidConfig.inference?.scanDirs ?? FRAMEWORK_SCAN_DIRS);
2699
- if (bindings.needsAuth || findVoidAuthConfig(root) !== null || voidConfig.auth !== void 0) {
2752
+ const inferenceOptions = voidConfig.inference?.bindings ? { bindings: voidConfig.inference.bindings } : void 0;
2753
+ const paths = resolveProjectPaths(root, voidConfig);
2754
+ const scanDirs = voidConfig.inference?.scanDirs ?? FRAMEWORK_SCAN_DIRS;
2755
+ const bindings = inferProjectBindings(root, {
2756
+ ...inferenceOptions,
2757
+ paths
2758
+ }, scanDirs);
2759
+ if (bindings.needsAuth || findVoidAuthConfig(root, paths) !== null || voidConfig.auth !== void 0) {
2700
2760
  R.error("deploy: Void-managed Better Auth is only supported in Void apps. Use Better Auth's official integration for this framework instead.");
2701
2761
  process.exit(1);
2702
2762
  }
@@ -2704,7 +2764,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
2704
2764
  R.error("deploy: void/live is currently supported in Void apps only.");
2705
2765
  process.exit(1);
2706
2766
  }
2707
- const migrationsDir = join(root, "db", "migrations");
2767
+ const migrationsDir = paths.migrationsDir;
2708
2768
  assertDeploySchemaDriftFree(root, dialect);
2709
2769
  const rawMigrations = collectMigrations(migrationsDir);
2710
2770
  let validatedMigrations;
@@ -2723,7 +2783,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
2723
2783
  }
2724
2784
  if (dialect === "postgresql" && (bindings.needsD1 || rawMigrations.length > 0)) try {
2725
2785
  if (!(await client.getResources(config.projectId)).some((resource) => resource.type === "hyperdrive")) {
2726
- const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-D2L3_KTK.mjs").then((n) => n.p);
2786
+ const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-abzUneor.mjs").then((n) => n.p);
2727
2787
  const connectionString = await promptText({
2728
2788
  message: "Your project uses PostgreSQL. Enter your connection string:",
2729
2789
  placeholder: "postgresql://user:pass@host:5432/dbname",
@@ -2739,8 +2799,8 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
2739
2799
  R.success("Hyperdrive provisioned.");
2740
2800
  }
2741
2801
  } catch {}
2742
- const rawJobs = scanJobsSync(root);
2743
- const rawQueues = scanQueuesSync(root);
2802
+ const rawJobs = scanJobsSync(root, paths.cronsDir);
2803
+ const rawQueues = scanQueuesSync(root, paths.queuesDir);
2744
2804
  const originalEntry = join(workerDir, fwPreset.workerMain);
2745
2805
  const wrapperFeatures = {
2746
2806
  auth: null,
@@ -2881,10 +2941,12 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
2881
2941
  }
2882
2942
  const isFrameworkMode = detected != null;
2883
2943
  const deployConfig = readConfig(root);
2944
+ const paths = resolveProjectPaths(root, deployConfig);
2884
2945
  const dialect = getDatabaseDialect(deployConfig);
2885
- const bindings = inferProjectBindings(root, void 0, deployConfig.inference?.scanDirs ?? (isFrameworkMode ? FRAMEWORK_SCAN_DIRS : void 0));
2946
+ const deployScanDirs = deployConfig.inference?.scanDirs ?? (isFrameworkMode ? FRAMEWORK_SCAN_DIRS : void 0);
2947
+ const bindings = inferProjectBindings(root, { paths }, deployScanDirs);
2886
2948
  if (isSandboxEnabled(deployConfig)) bindings.needsSandbox = true;
2887
- const authEnabled = bindings.needsAuth || findVoidAuthConfig(root) !== null || deployConfig.auth !== void 0;
2949
+ const authEnabled = bindings.needsAuth || findVoidAuthConfig(root, paths) !== null || deployConfig.auth !== void 0;
2888
2950
  const effectiveBindings = authEnabled ? {
2889
2951
  ...bindings,
2890
2952
  needsAuth: true,
@@ -2917,7 +2979,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
2917
2979
  lintDuplicateSources(fallbackRules, "fallbacks (post-asset)");
2918
2980
  lintDestinationSplats(redirectRules, "redirects/rewrites (pre-asset)");
2919
2981
  lintDestinationSplats(fallbackRules, "fallbacks (post-asset)");
2920
- const migrationsDir = join(root, "db", "migrations");
2982
+ const migrationsDir = paths.migrationsDir;
2921
2983
  assertDeploySchemaDriftFree(root, dialect);
2922
2984
  const rawMigrations = collectMigrations(migrationsDir);
2923
2985
  let validatedMigrations;
@@ -2936,7 +2998,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
2936
2998
  }
2937
2999
  if (dialect === "postgresql" && (effectiveBindings.needsD1 || rawMigrations.length > 0)) try {
2938
3000
  if (!(await client.getResources(config.projectId)).some((resource) => resource.type === "hyperdrive")) {
2939
- const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-D2L3_KTK.mjs").then((n) => n.p);
3001
+ const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-abzUneor.mjs").then((n) => n.p);
2940
3002
  const connectionString = await promptText({
2941
3003
  message: "Your project uses PostgreSQL. Enter your connection string:",
2942
3004
  placeholder: "postgresql://user:pass@host:5432/dbname",
@@ -2953,12 +3015,15 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
2953
3015
  }
2954
3016
  } catch {}
2955
3017
  const workerDirName = resolveWorkerDirName(distDir, fwPreset, frameworkBuildCmd);
2956
- const schedules = scanJobsSync(root).flatMap((job) => job.crons.map((cron) => ({
3018
+ const schedules = scanJobsSync(root, paths.cronsDir).flatMap((job) => job.crons.map((cron) => ({
2957
3019
  name: job.name,
2958
3020
  cron
2959
3021
  })));
2960
- const routeScan = await scanRoutes(root, { output: deployConfig.output });
2961
- const webSockets = routeScan.websockets ?? scanWebSocketRoutesSync(root);
3022
+ const routeScan = await scanRoutes(root, {
3023
+ output: deployConfig.output,
3024
+ paths
3025
+ });
3026
+ const webSockets = routeScan.websockets ?? scanWebSocketRoutesSync(root, paths);
2962
3027
  const liveConfig = await resolveDeployLiveBindingConfig(root, client, config.projectId, {
2963
3028
  isFrameworkMode,
2964
3029
  needsLive: effectiveBindings.needsLive,
@@ -2966,21 +3031,25 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
2966
3031
  sandboxClassName: sandboxConfig?.className,
2967
3032
  cliLog
2968
3033
  });
2969
- const queues = scanQueuesSync(root).map((q) => ({
3034
+ const queues = scanQueuesSync(root, paths.queuesDir).map((q) => ({
2970
3035
  name: q.name,
2971
3036
  bindingName: q.bindingName,
2972
3037
  ...q.maxBatchSize != null && { maxBatchSize: q.maxBatchSize },
2973
3038
  ...q.maxBatchTimeout != null && { maxBatchTimeout: q.maxBatchTimeout }
2974
3039
  }));
2975
- const hasPages = existsSync(join(root, "pages"));
3040
+ const hasPages = existsSync(paths.pagesDir);
2976
3041
  const hasRoutes = routeScan.routes.length > 0;
3042
+ const hasDocumentRoutes$1 = hasDocumentRoutes(routeScan.routes);
2977
3043
  const hasMiddleware = routeScan.middleware.length > 0;
2978
3044
  const hasWebSockets = webSockets.length > 0;
2979
- const isSsr = isFrameworkMode ? true : Boolean(validateSsrEntry(root)) || hasPages && deployConfig.output !== "static";
3045
+ const isSsr = isFrameworkMode ? true : Boolean(validateSsrEntry(root, paths)) || hasPages && deployConfig.output !== "static";
2980
3046
  const vcRevalidate = readConfig(root).routing?.revalidate;
2981
3047
  let revalidate;
2982
3048
  if (vcRevalidate != null) revalidate = vcRevalidate;
2983
- const pageScan = existsSync(join(root, "pages")) ? routeScan.pages.pages.length > 0 ? routeScan.pages : await scanPages(root, { output: deployConfig.output }) : null;
3049
+ const pageScan = existsSync(paths.pagesDir) ? routeScan.pages.pages.length > 0 ? routeScan.pages : await scanPages(root, {
3050
+ output: deployConfig.output,
3051
+ paths
3052
+ }) : null;
2984
3053
  if (pageScan) {
2985
3054
  const perPageRules = {};
2986
3055
  for (const page of pageScan.pages) if (page.revalidate != null) perPageRules[page.pattern] = page.revalidate;
@@ -3024,10 +3093,11 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3024
3093
  const assetConfig = resolveAssetConfig({
3025
3094
  isSsr,
3026
3095
  hasPages,
3027
- hasRoutes,
3096
+ hasDocumentRoutes: hasDocumentRoutes$1,
3028
3097
  hasMiddleware,
3029
3098
  hasWebSockets,
3030
- authEnabled
3099
+ authEnabled,
3100
+ liveEnabled: liveConfig !== void 0
3031
3101
  });
3032
3102
  s.start("Checking for changes...");
3033
3103
  cliLog?.info("preflight_start", { dir: clientDir });
@@ -3151,12 +3221,12 @@ function assertDeploySchemaDriftFree(root, dialect) {
3151
3221
  process.exit(1);
3152
3222
  }
3153
3223
  function hasDeploySchemaDrift(root, dialect) {
3154
- if (!discoverSchema(root)) return false;
3224
+ if (!discoverSchema(root, readProjectPaths(root))) return false;
3155
3225
  const driftRoot = mkDeployDriftCheckRoot(root);
3156
3226
  const driftProjectRoot = join(driftRoot, "project");
3157
3227
  createDeployDriftProject(root, driftProjectRoot);
3158
3228
  try {
3159
- const migrationsDir = join(driftProjectRoot, "db", "migrations");
3229
+ const migrationsDir = readProjectPaths(driftProjectRoot).migrationsDir;
3160
3230
  const before = snapshotDir(migrationsDir);
3161
3231
  const output = runDrizzleKitGenerate(driftProjectRoot, writeDrizzleConfig(driftProjectRoot, dialect === "postgresql" ? "postgresql://dummy" : ":memory:", dialect));
3162
3232
  const snapshotsEqual = migrationSnapshotsEqual(before, snapshotDir(migrationsDir));
@@ -3360,4 +3430,4 @@ function resolveWorkerDirName(distDir, fwPreset, buildCommand) {
3360
3430
  throw new Error("deploy: Worker output not found. Expected dist/ssr/ or dist/rsc/.");
3361
3431
  }
3362
3432
  //#endregion
3363
- export { isSandboxEnabled as C, SANDBOX_MIGRATION_TAG as S, normalizeWranglerCompatibilityFlags as _, prerenderPagesNode as a, resolveLiveBindingConfig as b, filterLoadedEnv as c, LIVE_MIGRATION_TAG as d, ensureWranglerCompat as f, nextDurableObjectMigrationTag as g, hasDurableObjectSqliteMigration as h, prerenderPages as i, resolveRemoteMode as l, ensureWranglerNodejsAlsFlag as m, resolveDistDir as n, DEFAULT_PROXY_URL as o, ensureWranglerCompatibilityDate as p, resolveWorkerDirName as r, STAGING_PROXY_URL as s, deploy_exports as t, stripInternalEnvKeys as u, readExistingLiveBindingConfig as v, resolveSandboxConfig as w, syncWranglerBindings as x, readWranglerCompat as y };
3433
+ export { isSandboxEnabled as C, resolveAssetRoutingPolicy as E, SANDBOX_MIGRATION_TAG as S, hasDocumentRoutes as T, normalizeWranglerCompatibilityFlags as _, prerenderPagesNode as a, resolveLiveBindingConfig as b, filterLoadedEnv as c, LIVE_MIGRATION_TAG as d, ensureWranglerCompat as f, nextDurableObjectMigrationTag as g, hasDurableObjectSqliteMigration as h, prerenderPages as i, resolveRemoteMode as l, ensureWranglerNodejsAlsFlag as m, resolveDistDir as n, DEFAULT_PROXY_URL as o, ensureWranglerCompatibilityDate as p, resolveWorkerDirName as r, STAGING_PROXY_URL as s, deploy_exports as t, stripInternalEnvKeys as u, readExistingLiveBindingConfig as v, resolveSandboxConfig as w, syncWranglerBindings as x, readWranglerCompat as y };
@@ -1,5 +1,6 @@
1
1
  import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
- import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
+ import { s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
3
4
  import { existsSync, statSync } from "node:fs";
4
5
  //#region src/drizzle/discover.ts
5
6
  var discover_exports = /* @__PURE__ */ __exportAll({
@@ -15,13 +16,13 @@ var discover_exports = /* @__PURE__ */ __exportAll({
15
16
  *
16
17
  * Returns null if no schema is found.
17
18
  */
18
- function discoverSchema(root) {
19
- const filePath = join(root, "db", "schema.ts");
19
+ function discoverSchema(root, paths = readProjectPaths(root)) {
20
+ const filePath = paths.schemaFile;
20
21
  if (existsSync(filePath) && statSync(filePath).isFile()) return {
21
22
  type: "file",
22
23
  path: filePath
23
24
  };
24
- const dirPath = join(root, "db", "schema");
25
+ const dirPath = paths.schemaDir;
25
26
  if (existsSync(dirPath) && statSync(dirPath).isDirectory()) return {
26
27
  type: "directory",
27
28
  path: dirPath
@@ -33,8 +34,10 @@ function discoverSchema(root) {
33
34
  * - File: `"./db/schema.ts"`
34
35
  * - Directory: `"./db/schema/*.ts"`
35
36
  */
36
- function schemaSpecifier(location) {
37
- return location.type === "file" ? "./db/schema.ts" : "./db/schema/*.ts";
37
+ function schemaSpecifier(location, root) {
38
+ if (!root) return location.type === "file" ? "./db/schema.ts" : "./db/schema/*.ts";
39
+ const rel = relative(root, location.path).replace(/\\/g, "/");
40
+ return location.type === "file" ? `./${rel}` : `./${rel}/*.ts`;
38
41
  }
39
42
  //#endregion
40
43
  export { discover_exports as n, schemaSpecifier as r, discoverSchema as t };
@@ -1,7 +1,7 @@
1
- import { s as import_picocolors } from "./output-D3g5otMC.mjs";
2
- import { c as getToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
3
- import { c as R, u as Se } from "./dist-D2L3_KTK.mjs";
4
- import { r as readProjectConfig } from "./project-DhB4A8_g.mjs";
1
+ import { s as import_picocolors } from "./output-DeiS4oEX.mjs";
2
+ import { c as getToken, n as PlatformClient } from "./client-C-nH6yz3.mjs";
3
+ import { c as R, u as Se } from "./dist-abzUneor.mjs";
4
+ import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
5
5
  //#region src/cli/domain.ts
6
6
  async function runDomainCommand(root, args) {
7
7
  const token = getToken(root);
@@ -31,22 +31,28 @@ async function runDomainCommand(root, args) {
31
31
  case "add": return domainAdd(client, projectId, args.hostname);
32
32
  case "delete": return domainRemove(client, projectId, args.hostname);
33
33
  case "list": return domainList(client, projectId);
34
- case "status": return domainStatus(client, projectId, args.hostname);
34
+ case "status": return domainStatus(client, projectId, args.hostname, args.verbose === true);
35
35
  }
36
36
  }
37
37
  async function domainAdd(client, projectId, hostname) {
38
38
  const domain = await client.addDomain(projectId, hostname);
39
39
  R.success(`Domain ${hostname} added (status: ${domain.status})`);
40
- const sections = [];
41
- if (domain.cname_target) sections.push(`CNAME (traffic)\n ${hostname} → ${domain.cname_target}`);
42
- if (domain.ownership_verification) sections.push(`TXT (ownership verification)\n ${domain.ownership_verification.name} → ${domain.ownership_verification.value}`);
40
+ let cnameSection;
41
+ let ownershipSection;
42
+ let sslSection;
43
+ if (domain.cname_target) cnameSection = `CNAME (traffic)\n ${hostname} → ${domain.cname_target}`;
44
+ if (domain.ownership_verification) ownershipSection = `TXT (ownership verification)\n ${domain.ownership_verification.name} → ${domain.ownership_verification.value}`;
43
45
  const sslRecords = (domain.ssl_validation_records ?? []).filter((r) => Boolean(r.txt_name) && Boolean(r.txt_value));
44
- if (sslRecords.length > 0) {
45
- const lines = sslRecords.map((r) => ` ${r.txt_name} → ${r.txt_value}`).join("\n");
46
- sections.push(`TXT (SSL validation)\n${lines}`);
47
- }
46
+ if (sslRecords.length > 0) sslSection = `TXT (SSL validation)\n${sslRecords.map((r) => ` ${r.txt_name} → ${r.txt_value}`).join("\n")}`;
47
+ else sslSection = `SSL validation records will appear in \`void domain status\` shortly.`;
48
+ const summary = `Add the records above to your DNS, then run \`void domain status ${hostname}\` to check progress.`;
49
+ const sections = [
50
+ cnameSection,
51
+ ownershipSection,
52
+ sslSection,
53
+ summary
54
+ ].filter((s) => s !== void 0);
48
55
  if (sections.length > 0) Se(sections.join("\n\n"), "DNS Setup");
49
- R.info("Run `void domain status " + hostname + "` to check verification progress.");
50
56
  }
51
57
  async function domainRemove(client, projectId, hostname) {
52
58
  const domain = (await client.listDomains(projectId)).find((d) => d.hostname === hostname);
@@ -68,21 +74,57 @@ async function domainList(client, projectId) {
68
74
  return ` ${d.hostname} ${status}`;
69
75
  }).join("\n"), "Custom Domains");
70
76
  }
71
- async function domainStatus(client, projectId, hostname) {
77
+ function computeRollup(status) {
78
+ if (status.verification_errors && status.verification_errors.length > 0) return {
79
+ state: "error",
80
+ diagnostic: `Verification failed: ${status.verification_errors[0]}`
81
+ };
82
+ if (status.awaiting_deployment === true) return {
83
+ state: "awaiting_deployment",
84
+ diagnostic: "Your project has no live deployment yet. Run `void deploy` to bring the domain online."
85
+ };
86
+ if (status.cf_status === "pending" && status.ownership_verification) return {
87
+ state: "awaiting_dns",
88
+ diagnostic: "Cloudflare has not yet observed your _cf-custom-hostname TXT record. Confirm it is published at the host shown below."
89
+ };
90
+ if (status.cf_status === "pending_validation") return {
91
+ state: "verifying_dns",
92
+ diagnostic: "DNS records found, Cloudflare is validating ownership."
93
+ };
94
+ if (status.cf_status === "pending_issuance" || status.cf_status === "active" && status.ssl_status !== "active") return {
95
+ state: "issuing_cert",
96
+ diagnostic: "Cloudflare is issuing the SSL certificate (typically <5 minutes)."
97
+ };
98
+ if (status.cf_status === "pending_deployment") return {
99
+ state: "deploying_cert",
100
+ diagnostic: "SSL certificate issued; Cloudflare is propagating it to its edge."
101
+ };
102
+ if (status.status === "active" && status.ssl_status === "active") return {
103
+ state: "active",
104
+ diagnostic: "Live."
105
+ };
106
+ return {
107
+ state: "pending",
108
+ diagnostic: "Verification pending. Cloudflare is processing."
109
+ };
110
+ }
111
+ async function domainStatus(client, projectId, hostname, verbose) {
72
112
  const domain = (await client.listDomains(projectId)).find((d) => d.hostname === hostname);
73
113
  if (!domain) {
74
114
  R.error(`domain: Domain '${hostname}' not found on this project.`);
75
115
  process.exit(1);
76
116
  }
77
117
  const status = await client.getDomainStatus(projectId, domain.id);
78
- const lines = [
79
- `Hostname: ${status.hostname}`,
80
- `Status: ${status.status}`,
81
- `SSL Status: ${status.ssl_status}`
82
- ];
83
- if (status.ownership_verification) lines.push(`Ownership: pending`);
84
- if (status.verification_errors && status.verification_errors.length > 0) lines.push(`Errors: ${status.verification_errors.join(", ")}`);
85
- Se(lines.join("\n"), "Domain Status");
118
+ const rollup = computeRollup(status);
119
+ const rollupLines = [`Hostname: ${status.hostname}`, `Status: ${rollup.state} — ${rollup.diagnostic}`];
120
+ if (verbose) {
121
+ rollupLines.push("", "Details:");
122
+ rollupLines.push(` Status: ${status.status}`);
123
+ rollupLines.push(` SSL Status: ${status.ssl_status}`);
124
+ if (status.ownership_verification) rollupLines.push(` Ownership: pending`);
125
+ if (status.verification_errors && status.verification_errors.length > 0) rollupLines.push(` Errors: ${status.verification_errors.join(", ")}`);
126
+ }
127
+ Se(rollupLines.join("\n"), "Domain Status");
86
128
  const ownershipPending = Boolean(status.ownership_verification);
87
129
  const sslPending = status.ssl_status !== "active";
88
130
  if (ownershipPending || sslPending) {