void 1.12.0 → 1.12.1

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 (123) hide show
  1. package/dist/{account-cmd-D_0qJ9fx.mjs → account-cmd-BU1Fy_Bf.mjs} +4 -4
  2. package/dist/{application-analysis-Cx2S63z5.mjs → application-analysis-DVeN8yoi.mjs} +1 -1
  3. package/dist/{application-routing-BAXpnawu.mjs → application-routing-KKw4Y84h.mjs} +1 -1
  4. package/dist/{auth-Boz0lrb3.mjs → auth-A7cZ8aXA.mjs} +1 -1
  5. package/dist/{auth-DlLDymuc.mjs → auth-CqwJwItO.mjs} +1 -1
  6. package/dist/{auth-link-C97r9p2N.mjs → auth-link-Duu2NvN5.mjs} +4 -4
  7. package/dist/{auth-router-BmzEgzYx.mjs → auth-router-vgtOdb9j.mjs} +1 -1
  8. package/dist/{build-cmd-BaFsyZrz.mjs → build-cmd-B7OJ0U5R.mjs} +2 -2
  9. package/dist/build-id-4IV4hC1-.mjs +13 -0
  10. package/dist/{cache-xO711ATQ.mjs → cache-wSpi3aeM.mjs} +2 -2
  11. package/dist/{cancel-deploy-Di11ynsr.mjs → cancel-deploy-DMWzkAlb.mjs} +2 -2
  12. package/dist/{cf-access-FaIm95jA.mjs → cf-access-DHklo7Rg.mjs} +33 -19
  13. package/dist/{cf-build-output-Ca201_n1.mjs → cf-build-output-Cso7Vh-t.mjs} +4 -2
  14. package/dist/cf-build-output-Wpk_e5CI.mjs +1 -0
  15. package/dist/cli/cli.mjs +1 -1
  16. package/dist/cli/cloudflare-operation-process.mjs +1 -1
  17. package/dist/cli/db-execute-process.d.mts +2 -0
  18. package/dist/cli/db-execute-process.mjs +57 -0
  19. package/dist/{cli-main-DlW6lB8s.mjs → cli-main-BrChcpE3.mjs} +37 -344
  20. package/dist/{client-ImIe7Mjq.mjs → client-DE2m2ldh.mjs} +4 -4
  21. package/dist/{client-DkYzDEC0.mjs → client-eLZwqkPH.mjs} +1 -1
  22. package/dist/{cloudflare-operations-BF0PSErW.mjs → cloudflare-operations-BIRQkYwL.mjs} +14 -8
  23. package/dist/cloudflare-operations-ByjFGats.mjs +1 -0
  24. package/dist/{connect-DDRQGfFE.mjs → connect-D0V0o40j.mjs} +4 -4
  25. package/dist/{create-project-CY7sP8sI.mjs → create-project-8FdN6D2i.mjs} +2 -2
  26. package/dist/{create-project-Dro3K-az.mjs → create-project-CbuDH5Hv.mjs} +1 -1
  27. package/dist/{db-DmlaWVBu.mjs → db-BNPIjLkK.mjs} +1348 -69
  28. package/dist/db-args-BvMwAber.mjs +1 -0
  29. package/dist/db-args-CiQVg8SJ.mjs +321 -0
  30. package/dist/{delete-Uuq9ch6o.mjs → delete-WtLEfap2.mjs} +2 -2
  31. package/dist/{deploy-B9E7_rHC.mjs → deploy-BgSbagIP.mjs} +14 -14
  32. package/dist/{deploy-BB3rsZbP.mjs → deploy-Do6FWqon.mjs} +1 -1
  33. package/dist/{deploy-managed-static-IKZyuc1W.mjs → deploy-managed-static-BWBsxOww.mjs} +5 -5
  34. package/dist/{deploy-security-notice-C3LalelR.mjs → deploy-security-notice-IRGy6Edf.mjs} +2 -2
  35. package/dist/deploy.mjs +4 -4
  36. package/dist/{domain-B_xY1yZ5.mjs → domain-mweyYXSw.mjs} +3 -3
  37. package/dist/{email-BIC15L7a.mjs → email-DcQNP40O.mjs} +5 -5
  38. package/dist/{email-cloudflare-C447nOqq.mjs → email-cloudflare-DeYH3Ke7.mjs} +2 -2
  39. package/dist/{env-DJPZYHT5.mjs → env-DaAoYR2-.mjs} +3 -3
  40. package/dist/{gen-DiTZlDx8.mjs → gen-aOtHhZLD.mjs} +1 -1
  41. package/dist/gen-vhBDHs3q.mjs +1 -0
  42. package/dist/{github-cmd-DPmby8x-.mjs → github-cmd-BR19Ffdz.mjs} +2 -2
  43. package/dist/{help-9wfMyXHb.mjs → help-DvClCzqL.mjs} +9 -1
  44. package/dist/help-fKPzcTJv.mjs +1 -0
  45. package/dist/index.mjs +16 -206
  46. package/dist/{info-BWEWaOBo.mjs → info-P6MBiVJi.mjs} +2 -2
  47. package/dist/{init-BuTPVLPO.mjs → init-C8YpkGIP.mjs} +63 -18
  48. package/dist/installed-packages-tfmYd-cC.mjs +198 -0
  49. package/dist/{link-BiesPyT4.mjs → link-Dyz9IGcM.mjs} +3 -3
  50. package/dist/{list-CkonftPQ.mjs → list-VGYBMjmx.mjs} +4 -4
  51. package/dist/{login-BSOSah1j.mjs → login-CWFr-G2I.mjs} +3 -3
  52. package/dist/login-DECm3e9b.mjs +1 -0
  53. package/dist/{logs-HOBUnroa.mjs → logs-kS1wuR4b.mjs} +3 -3
  54. package/dist/module-references-DWQmO6TW.mjs +27 -0
  55. package/dist/{mysql-sql-CB52k8tQ.mjs → mysql-lock-D8xtnI-D.mjs} +1 -118
  56. package/dist/mysql-sql-BIE7bc4Z.mjs +124 -0
  57. package/dist/{operator-ai-logging-ZDqqhnIq.mjs → operator-ai-logging-DD0n6zc2.mjs} +3 -3
  58. package/dist/{operator-args-DCkWbgT-.mjs → operator-args-nvetCWuz.mjs} +1 -1
  59. package/dist/{operator-auth-BjoPLgja.mjs → operator-auth-DMvn-y9X.mjs} +1 -1
  60. package/dist/{operator-client-DzebIntv.mjs → operator-client-dFNnXfyB.mjs} +4 -3
  61. package/dist/operator-cmd-CVfK5U0B.mjs +1 -0
  62. package/dist/{operator-cmd-AZoeI9Pl.mjs → operator-cmd-a7yOf2tH.mjs} +13 -9
  63. package/dist/{operator-security-Bo26FP01.mjs → operator-security-D5MToU0p.mjs} +1 -1
  64. package/dist/pages/client.mjs +77 -9
  65. package/dist/pages/index.d.mts +6 -0
  66. package/dist/pages/index.mjs +276 -6
  67. package/dist/pages/protocol.mjs +1 -1
  68. package/dist/platform-args-CMwMoiLp.mjs +1 -0
  69. package/dist/{platform-args-lwCyQ6Xy.mjs → platform-args-CvZSuhYS.mjs} +1 -1
  70. package/dist/{platform-auth-config-DLRMPw1G.mjs → platform-auth-config-CpszX-Ne.mjs} +7 -7
  71. package/dist/{platform-auth-protection-HSmLmD3d.mjs → platform-auth-protection-DA6Tw8Og.mjs} +5 -5
  72. package/dist/{platform-auth-recovery-BXPhTlKa.mjs → platform-auth-recovery-Cztrb1JC.mjs} +4 -4
  73. package/dist/{platform-cmd-DJ-fOYhL.mjs → platform-cmd-m6Asj6nO.mjs} +6 -6
  74. package/dist/{platform-cmd-CqRjxFEU.mjs → platform-cmd-u1j88ggF.mjs} +1 -1
  75. package/dist/{platform-domain-CRsRJOws.mjs → platform-domain-DJSznNTA.mjs} +2 -2
  76. package/dist/{platform-lifecycle-bx_kpqo7.mjs → platform-lifecycle-BC-9p58d.mjs} +1 -1
  77. package/dist/{platform-lifecycle-fau3VKv6.mjs → platform-lifecycle-GFeXv3NC.mjs} +58 -11
  78. package/dist/{platform-management-BRGhD-oF.mjs → platform-management-BwHkz46V.mjs} +1 -1
  79. package/dist/{platform-management-CnKBdDx5.mjs → platform-management-DX1zINou.mjs} +4 -4
  80. package/dist/{platform-plans-config-2C3_5EDs.mjs → platform-plans-config-DiydtNKY.mjs} +3 -3
  81. package/dist/{platform-recovery-poxgOOAY.mjs → platform-recovery-CnzBbudV.mjs} +2 -2
  82. package/dist/{platform-setup-DYylapHD.mjs → platform-setup-Lph9i-rh.mjs} +1 -1
  83. package/dist/{plugin-inference-7O11_E4H.mjs → plugin-inference-COlq96WJ.mjs} +2 -27
  84. package/dist/prepare-DcwigRUS.mjs +1 -0
  85. package/dist/{prepare-DWjn1Lzd.mjs → prepare-WvijE289.mjs} +1 -1
  86. package/dist/{prepare-BbvlKreR.mjs → prepare-co1o1FFd.mjs} +1 -1
  87. package/dist/{project-cmd-DyUEFi2b.mjs → project-cmd-BWJTplpc.mjs} +18 -18
  88. package/dist/{project-security-DZEQgnsS.mjs → project-security-BV1xfj1K.mjs} +1 -1
  89. package/dist/{project-security--tYGFPGo.mjs → project-security-CY_aahvW.mjs} +2 -2
  90. package/dist/{project-team-BszTHgzC.mjs → project-team-BlIFXlmT.mjs} +2 -2
  91. package/dist/{project-token-DBDy4NdV.mjs → project-token-CMsB7I1-.mjs} +2 -2
  92. package/dist/{project-zero-trust-D9sUouij.mjs → project-zero-trust-BI6pdpx4.mjs} +2 -2
  93. package/dist/{protocol-CE3wP-H1.mjs → protocol-4rEnumif.mjs} +10 -3
  94. package/dist/{redirect-DD825Stf.mjs → redirect-Dyvuil0Q.mjs} +5 -2
  95. package/dist/{requests-CBokjiOi.mjs → requests-CfmJxNYg.mjs} +2 -2
  96. package/dist/{rollback-CEeHNFUn.mjs → rollback-DL5HuAsM.mjs} +3 -3
  97. package/dist/{runner-mysql-3XDKrn-g.mjs → runner-mysql-D549vGGm.mjs} +2 -1
  98. package/dist/{runner-mysql-r688x6Y9.mjs → runner-mysql-DOjbj-N1.mjs} +1 -1
  99. package/dist/runtime/db/migrations/mysql-handler.mjs +2 -1
  100. package/dist/runtime/routing/index.mjs +2 -2
  101. package/dist/{secret-Deqo3n_N.mjs → secret-C-WBaUSS.mjs} +3 -3
  102. package/docs/guide/jobs.md +1 -1
  103. package/docs/guide/pages-routing/actions-and-forms.md +36 -15
  104. package/docs/guide/pages-routing/errors.md +3 -1
  105. package/docs/guide/pages-routing/overview.md +20 -0
  106. package/docs/guide/platform/administration/zero-trust.md +1 -1
  107. package/docs/guide/platform/installation/maintenance.md +3 -3
  108. package/docs/guide/queues.md +1 -1
  109. package/docs/integrations/frameworks/sveltekit.md +1 -1
  110. package/docs/reference/api/pages.md +4 -0
  111. package/docs/reference/cli/database.md +42 -6
  112. package/docs/reference/cli/platform-security.md +1 -1
  113. package/docs/reference/cli/platform-zero-trust.md +4 -3
  114. package/docs/reference/cli/setup.md +4 -0
  115. package/package.json +7 -7
  116. package/dist/cf-build-output-Dy7N0hQN.mjs +0 -1
  117. package/dist/cloudflare-operations-dpRD-2Px.mjs +0 -1
  118. package/dist/gen-CQDiPi8m.mjs +0 -1
  119. package/dist/help-Dy3w4rPq.mjs +0 -1
  120. package/dist/login-DWCZeCX9.mjs +0 -1
  121. package/dist/operator-cmd-DEnHFmJF.mjs +0 -1
  122. package/dist/platform-args-DNbNZ_RR.mjs +0 -1
  123. package/dist/prepare-BmG2E6TI.mjs +0 -1
@@ -1,14 +1,14 @@
1
1
  import { L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken, f as removeToken } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
4
- import { n as runLoginCommand } from "./login-BSOSah1j.mjs";
2
+ import { c as getToken, f as removeToken } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
+ import { n as runLoginCommand } from "./login-CWFr-G2I.mjs";
5
5
  import { y as printSuccess } from "./output-BZLnu0z8.mjs";
6
6
  import { execSync } from "node:child_process";
7
7
  // src/cli/account-cmd.ts
8
8
  async function runAccountCommand(root, args) {
9
9
  switch (args.subcommand) {
10
10
  case "login": return runLoginCommand(root);
11
- case "link": return import("./auth-link-C97r9p2N.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
11
+ case "link": return import("./auth-link-Duu2NvN5.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
12
12
  case "logout":
13
13
  if (removeToken(root)) printSuccess("Logged out.");
14
14
  else log.info("Not logged in.");
@@ -1,5 +1,5 @@
1
1
  import { a as join, i as isAbsolute, t as basename } from "./dist-DMYe8CZJ.mjs";
2
- import { c as scanWebSocketRoutesSync, d as readResourceDefinition, f as listConventionFiles, h as needsApplicationDatabase, i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, p as listRouteFiles, r as detectFramework, s as isWebSocketPatternFile } from "./plugin-inference-7O11_E4H.mjs";
2
+ import { c as scanWebSocketRoutesSync, d as listConventionFiles, f as listRouteFiles, i as inferProjectBindings, m as needsApplicationDatabase, n as FRAMEWORK_SCAN_DIRS, r as detectFramework, s as isWebSocketPatternFile, u as readResourceDefinition } from "./plugin-inference-COlq96WJ.mjs";
3
3
  import { r as findVoidAuthConfig } from "./config-BFX5ZB1J.mjs";
4
4
  import { n as findEnvFileForPaths } from "./env-types-D2hBodXP.mjs";
5
5
  import { l as getDatabaseDialect, m as resolveBindingNames } from "./config-Dv5jri1-.mjs";
@@ -1,4 +1,4 @@
1
- import { t as analyzeApplicationSync, u as scanRoutes } from "./application-analysis-Cx2S63z5.mjs";
1
+ import { t as analyzeApplicationSync, u as scanRoutes } from "./application-analysis-DVeN8yoi.mjs";
2
2
  // src/application-routing.ts
3
3
  /** Complete route/page analysis using the same resource and handler inventories. */
4
4
  async function completeApplicationAnalysis(analysis) {
@@ -1 +1 @@
1
- export { a as getApiUrl, s as getSiteDomain, p as runPlatformLogin } from "./auth-DlLDymuc.mjs";
1
+ export { a as getApiUrl, s as getSiteDomain, p as runPlatformLogin } from "./auth-CqwJwItO.mjs";
@@ -1,6 +1,6 @@
1
1
  import { a as join } from "./dist-DMYe8CZJ.mjs";
2
2
  import { t as cfAccessHeaders } from "./cf-access-DmkKPcAI.mjs";
3
- import { t as ensurePlatformAccessToken } from "./cf-access-FaIm95jA.mjs";
3
+ import { t as ensurePlatformAccessToken } from "./cf-access-DHklo7Rg.mjs";
4
4
  import { C as deleteKeyringPassword, T as writeKeyringPassword, c as normalizePlatformApiUrl, i as getActivePlatformConnection, s as listPlatformConnections, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-DHH6fivm.mjs";
5
5
  import { a as readProjectPlatformUrl, r as readProjectConfig } from "./project-dh9431bN.mjs";
6
6
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -1,9 +1,9 @@
1
1
  import { L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { a as getApiUrl, c as getToken, m as savePlatformToken, p as runPlatformLogin, u as openBrowser } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
4
- import { r as selectPlatformLoginMethod } from "./login-BSOSah1j.mjs";
2
+ import { a as getApiUrl, c as getToken, m as savePlatformToken, p as runPlatformLogin, u as openBrowser } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
+ import { r as selectPlatformLoginMethod } from "./login-CWFr-G2I.mjs";
5
5
  import { f as formatUrl } from "./output-BZLnu0z8.mjs";
6
- import { t as discoverPlatform } from "./platform-cmd-DJ-fOYhL.mjs";
6
+ import { t as discoverPlatform } from "./platform-cmd-m6Asj6nO.mjs";
7
7
  // src/cli/auth-link.ts
8
8
  async function runAuthLink(root, connectionId) {
9
9
  const token = getToken(root);
@@ -43,7 +43,7 @@ async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isT
43
43
  await runCloudflareCommand(root, { subcommand: args.subcommand });
44
44
  return;
45
45
  }
46
- const { runAccountCommand } = await import("./account-cmd-D_0qJ9fx.mjs");
46
+ const { runAccountCommand } = await import("./account-cmd-BU1Fy_Bf.mjs");
47
47
  const subcommand = args.subcommand === "status" ? "whoami" : args.subcommand;
48
48
  if (!destination.apiUrl) {
49
49
  await runAccountCommand(root, { subcommand });
@@ -1,6 +1,6 @@
1
1
  import { H as outro, L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken } from "./auth-DlLDymuc.mjs";
3
- import { n as PlatformApiError, r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { c as getToken } from "./auth-CqwJwItO.mjs";
3
+ import { n as PlatformApiError, r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { h as import_picocolors, o as dim, y as printSuccess } from "./output-BZLnu0z8.mjs";
5
5
  import { r as readProjectConfig } from "./project-dh9431bN.mjs";
6
6
  import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-8WZ3iVmr.mjs";
@@ -0,0 +1,13 @@
1
+ // src/pages/build-id.ts
2
+ /** The define the pages plugin fills in once per build. */
3
+ const PAGES_BUILD_ID_DEFINE = "import.meta.env.__VOID_PAGES_BUILD_ID";
4
+ /**
5
+ * The id of the build this code was bundled into. The pages plugin defines it
6
+ * per build; it is empty in the dev server and in tests, which turns every
7
+ * build check into a no-op.
8
+ */
9
+ function pagesBuildId() {
10
+ const value = import.meta.env.__VOID_PAGES_BUILD_ID;
11
+ return typeof value === "string" ? value : "";
12
+ }
13
+ export { pagesBuildId as n, PAGES_BUILD_ID_DEFINE as t };
@@ -1,6 +1,6 @@
1
1
  import { L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { c as getToken } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { a as createSpinner, c as formatCount, y as printSuccess } from "./output-BZLnu0z8.mjs";
5
5
  import { r as readProjectConfig } from "./project-dh9431bN.mjs";
6
6
  import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-8WZ3iVmr.mjs";
@@ -1,6 +1,6 @@
1
1
  import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { c as getToken } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { y as printSuccess } from "./output-BZLnu0z8.mjs";
5
5
  import { r as readProjectConfig } from "./project-dh9431bN.mjs";
6
6
  // src/cli/cancel-deploy.ts
@@ -71,16 +71,9 @@ function ensurePlatformAccessToken(apiUrl, challenged = false, required = false,
71
71
  if (challenged && rejectedTokens.size > 0) {
72
72
  forgetOriginToken(origin);
73
73
  keyringTokens.set(origin, null);
74
- if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error(`platform: Cloudflare Access rejected the cached credential for ${origin}. Re-run this command in an interactive terminal to renew it.`);
74
+ if (!canSignIn()) throw new Error(`platform: Cloudflare Access rejected the cached credential for ${origin}. Re-run this command in an interactive terminal to renew it.`);
75
75
  console.error(`Renew Cloudflare Access authentication for ${origin}.`);
76
- runCloudflared([
77
- "access",
78
- "login",
79
- origin
80
- ], {
81
- inherit: true,
82
- timeoutMs: 12e4
83
- });
76
+ runCloudflaredLogin(origin);
84
77
  }
85
78
  let token = runCloudflared([
86
79
  "access",
@@ -88,16 +81,9 @@ function ensurePlatformAccessToken(apiUrl, challenged = false, required = false,
88
81
  `-app=${origin}`
89
82
  ]);
90
83
  if (token && rejectedTokens.has(token)) token = null;
91
- if ((!token || !usableToken(token)) && process.stdin.isTTY && process.stdout.isTTY) {
84
+ if ((!token || !usableToken(token)) && canSignIn()) {
92
85
  console.error(`Authenticate to Cloudflare Access for ${origin}.`);
93
- runCloudflared([
94
- "access",
95
- "login",
96
- origin
97
- ], {
98
- inherit: true,
99
- timeoutMs: 12e4
100
- });
86
+ runCloudflaredLogin(origin);
101
87
  token = runCloudflared([
102
88
  "access",
103
89
  "token",
@@ -109,11 +95,39 @@ function ensurePlatformAccessToken(apiUrl, challenged = false, required = false,
109
95
  keyringTokens.set(origin, token);
110
96
  writeKeyringPassword(ACCESS_KEYRING_SERVICE, account, token);
111
97
  }
98
+ /**
99
+ * Browser sign-in needs stdin and an output terminal. For JSON database execution, the child
100
+ * process's stdout already goes to the caller's stderr.
101
+ */
102
+ function signInOutput() {
103
+ if (!process.stdin.isTTY) return;
104
+ if (process.stdout.isTTY) return 1;
105
+ return process.stderr.isTTY ? 2 : void 0;
106
+ }
107
+ function canSignIn() {
108
+ return signInOutput() !== void 0;
109
+ }
110
+ /** Sign in through the browser. `--quiet` keeps the JWT off the terminal. */
111
+ function runCloudflaredLogin(origin) {
112
+ runCloudflared([
113
+ "access",
114
+ "login",
115
+ "--quiet",
116
+ origin
117
+ ], {
118
+ output: signInOutput(),
119
+ timeoutMs: 12e4
120
+ });
121
+ }
112
122
  function runCloudflared(args, opts) {
113
123
  try {
114
124
  const result = spawnSync("cloudflared", args, {
115
125
  encoding: "utf8",
116
- stdio: opts?.inherit ? "inherit" : [
126
+ stdio: opts?.output ? [
127
+ "inherit",
128
+ opts.output,
129
+ "inherit"
130
+ ] : [
117
131
  "ignore",
118
132
  "pipe",
119
133
  "pipe"
@@ -390,7 +390,7 @@ async function prepareBundledBuildOutput(options) {
390
390
  const scratch = mkdtempSync(join(tmpdir(), options.scratchPrefix));
391
391
  try {
392
392
  const { build } = await import("vite");
393
- await build({
393
+ const result = await build({
394
394
  configFile: false,
395
395
  root: options.projectRoot,
396
396
  publicDir: false,
@@ -410,9 +410,11 @@ async function prepareBundledBuildOutput(options) {
410
410
  target: "es2022"
411
411
  }
412
412
  });
413
+ const entry = Array.isArray(result) && result[0]?.output.find((file) => file.type === "chunk" && file.isEntry);
414
+ if (!entry) throw new Error("Vite did not emit a Worker entry chunk.");
413
415
  writeFileSync(join(scratch, "wrangler.json"), JSON.stringify({
414
416
  ...options.config,
415
- main: "index.js",
417
+ main: entry.fileName,
416
418
  assets: options.assets
417
419
  }), { mode: 384 });
418
420
  return await prepareCfBuildOutput(scratch, options.accountId, void 0, options.projectRoot);
@@ -0,0 +1 @@
1
+ export { t as prepareCfBuildOutput } from "./cf-build-output-Cso7Vh-t.mjs";
package/dist/cli/cli.mjs CHANGED
@@ -84,5 +84,5 @@ const message = unsupportedRuntimeMessage(process.versions, process.execPath);
84
84
  if (message) {
85
85
  process.stderr.write(`${message}\n`);
86
86
  process.exitCode = 1;
87
- } else await import("../cli-main-DlW6lB8s.mjs");
87
+ } else await import("../cli-main-BrChcpE3.mjs");
88
88
  export {};
@@ -442,7 +442,7 @@ async function withBuildOutput(raw, sourceMain, action) {
442
442
  }), { mode: 384 });
443
443
  const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? raw.account_id;
444
444
  if (typeof accountId !== "string" || !accountId) throw new Error("Cloudflare account is not pinned for Worker deployment.");
445
- const { prepareCfBuildOutput } = await import("../cf-build-output-Dy7N0hQN.mjs");
445
+ const { prepareCfBuildOutput } = await import("../cf-build-output-Wpk_e5CI.mjs");
446
446
  const output = await prepareCfBuildOutput(scratch, accountId);
447
447
  if (!output) throw new Error("Could not prepare the Cloudflare Worker build output.");
448
448
  try {
@@ -0,0 +1,2 @@
1
+ /** Keep config output on stderr, including writes to fd 1 and output from its children. */
2
+ export declare function runDbExecuteProcess(root: string, args: ReadonlyArray<string>): Promise<void>;
@@ -0,0 +1,57 @@
1
+ import { L as log } from "../dist-Cr_xGE_K.mjs";
2
+ import { t as formatCloudflareUserMessage } from "../cloudflare-user-output-CCR99eQY.mjs";
3
+ import { t as Buffer } from "../node-buffer-D7kgjaDs.mjs";
4
+ import { writeFileSync } from "node:fs";
5
+ import { constants } from "node:os";
6
+ import { spawn } from "node:child_process";
7
+ // src/cli/db-execute-process.ts
8
+ const CHILD_COMMAND = "__void-db-execute-json__";
9
+ const RESULT_FD = 3;
10
+ /** Keep config output on stderr, including writes to fd 1 and output from its children. */
11
+ async function runDbExecuteProcess(root, args) {
12
+ const child = spawn(process.execPath, [
13
+ ...process.execArgv,
14
+ import.meta.filename,
15
+ CHILD_COMMAND,
16
+ process.argv[1],
17
+ ...args
18
+ ], {
19
+ cwd: root,
20
+ stdio: [
21
+ "inherit",
22
+ 2,
23
+ "inherit",
24
+ "pipe"
25
+ ]
26
+ });
27
+ const chunks = [];
28
+ child.stdio[RESULT_FD]?.on("data", (chunk) => chunks.push(chunk));
29
+ const interrupt = () => child.kill("SIGINT");
30
+ const terminate = () => child.kill("SIGTERM");
31
+ process.on("SIGINT", interrupt);
32
+ process.on("SIGTERM", terminate);
33
+ try {
34
+ const code = await new Promise((resolve, reject) => {
35
+ child.once("error", reject);
36
+ child.once("close", (status, signal) => {
37
+ resolve(signal ? 128 + constants.signals[signal] : status ?? 1);
38
+ });
39
+ });
40
+ if (code !== 0) process.exitCode = code;
41
+ else if (chunks.length > 0) process.stdout.write(Buffer.concat(chunks));
42
+ } finally {
43
+ process.off("SIGINT", interrupt);
44
+ process.off("SIGTERM", terminate);
45
+ }
46
+ }
47
+ if (process.argv[2] === CHILD_COMMAND) try {
48
+ process.argv.splice(1, 2);
49
+ const { parseDbArgs } = await import("../db-args-BvMwAber.mjs");
50
+ const args = parseDbArgs(process.argv.slice(3));
51
+ const { runDbCommand } = await import("../db-BNPIjLkK.mjs");
52
+ await runDbCommand(process.cwd(), args, (text) => writeFileSync(RESULT_FD, text));
53
+ } catch (error) {
54
+ log.error(formatCloudflareUserMessage(error instanceof Error ? error.message : String(error)), { output: process.stderr });
55
+ process.exitCode = 1;
56
+ }
57
+ export { runDbExecuteProcess };