void 1.3.0 → 1.4.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 (152) hide show
  1. package/dist/{account-cmd-B4i71m7k.mjs → account-cmd-HP8bixYo.mjs} +3 -3
  2. package/dist/{application-analysis-DYdVoMAY.mjs → application-analysis-DDOQwiXk.mjs} +11 -7
  3. package/dist/{application-routing-C8EqRDfv.mjs → application-routing-4719u_kf.mjs} +1 -1
  4. package/dist/auth-g2TQbDLD.d.mts +70 -0
  5. package/dist/{auth-link-BKwHPbdv.mjs → auth-link-CedYpDCy.mjs} +3 -3
  6. package/dist/{auth-router-DqLx8E0F.mjs → auth-router-vafo7x8w.mjs} +11 -6
  7. package/dist/{better-auth-shared-DVk2DkTW.d.mts → better-auth-shared-BHB8kiTE.d.mts} +1 -1
  8. package/dist/{build-cmd-Dy4psnt1.mjs → build-cmd-9vUAQ1_V.mjs} +1 -1
  9. package/dist/{cache-DV37S6dl.mjs → cache-jvwLNb0h.mjs} +1 -1
  10. package/dist/{cancel-deploy-DMPyu1Vt.mjs → cancel-deploy-Dw0UmWKO.mjs} +1 -1
  11. package/dist/{cf-build-output-Bapzc_8Z.mjs → cf-build-output-XpNR9zoh.mjs} +20 -4
  12. package/dist/cf-build-output-bd8Uwv1P.mjs +1 -0
  13. package/dist/{cf-worker-settings-BECvvTVd.mjs → cf-worker-settings-Dg27RzyT.mjs} +11 -5
  14. package/dist/cli/cli.mjs +25 -25
  15. package/dist/cli/cloudflare-operation-process.mjs +9 -3
  16. package/dist/cli/env-schema-probe.mjs +2 -2
  17. package/dist/{client-BEMtySaV.mjs → client-B3LnB_bE.mjs} +1 -1
  18. package/dist/client-BZb9j66F.mjs +1 -0
  19. package/dist/{cloudflare-auth-Byo_0_N9.mjs → cloudflare-auth-DyD_kVFr.mjs} +1 -1
  20. package/dist/{cloudflare-cmd-BaqIigwI.mjs → cloudflare-cmd-D-b_u3T4.mjs} +2 -2
  21. package/dist/{cloudflare-config-DchHxPTo.mjs → cloudflare-config-CH1AylZT.mjs} +14 -3
  22. package/dist/{cloudflare-connect-pNLQmr_e.mjs → cloudflare-connect-zTJh8UnN.mjs} +2 -2
  23. package/dist/{cloudflare-operations-vP3b5CQf.mjs → cloudflare-operations-Bc-7fN44.mjs} +4 -4
  24. package/dist/{cloudflare-operations-PCM4wucv.mjs → cloudflare-operations-BtulCNOg.mjs} +1 -1
  25. package/dist/{config-BU6hMu1W.mjs → config-BV2ASlpn.mjs} +1 -1
  26. package/dist/{config-Du88-7Y8.d.mts → config-CAdZVTLN.d.mts} +2 -0
  27. package/dist/config-D-6q7EBH.mjs +87 -0
  28. package/dist/{config-DHgSEWT7.mjs → config-OFOAimzt.mjs} +5 -3
  29. package/dist/config-entry.d.mts +1 -1
  30. package/dist/{config-BIaXIkkv.mjs → config-tqMM6DwY.mjs} +1 -1
  31. package/dist/{connect-DwVsBvVh.mjs → connect-BOM6zvFX.mjs} +4 -4
  32. package/dist/{create-project-CjzbBlTv.mjs → create-project-Bxd02EHN.mjs} +1 -1
  33. package/dist/{create-project-CgrnvzyA.mjs → create-project-C2K0DN2O.mjs} +1 -1
  34. package/dist/{db-rvo64snS.mjs → db-Cdvr3zwG.mjs} +16 -16
  35. package/dist/{db-types-NGxPwnlt.mjs → db-types-0eCiqYb1.mjs} +1 -1
  36. package/dist/{delete-DWX6dP4M.mjs → delete-lETE6Tpt.mjs} +1 -1
  37. package/dist/deploy-CX94CmKa.mjs +2 -0
  38. package/dist/{deploy-hRPvw8ci.mjs → deploy-CdM-LAxX.mjs} +260 -95
  39. package/dist/{deploy-managed-static-CDYA2p3L.mjs → deploy-managed-static-DjeBFG2c.mjs} +24 -17
  40. package/dist/{deploy-transport-JCxw7QDi.mjs → deploy-transport-DIq_gFTP.mjs} +13 -12
  41. package/dist/deploy.d.mts +2 -0
  42. package/dist/deploy.mjs +7 -5
  43. package/dist/{dispatch-OVLeWW8K.mjs → dispatch-CLa2LThw.mjs} +5 -5
  44. package/dist/{domain-CH5iBD9Y.mjs → domain-DyhNtdYf.mjs} +2 -2
  45. package/dist/{email-CbTO1l78.mjs → email-DM2wDcBN.mjs} +6 -6
  46. package/dist/{email-cloudflare-B8-pq_-W.mjs → email-cloudflare-PMbAev9Q.mjs} +20 -7
  47. package/dist/{env-BBdw236G.mjs → env-78hbN-oI.mjs} +3 -3
  48. package/dist/{env-validation-XcukUlFM.mjs → env-validation-B3VobvXm.mjs} +1 -0
  49. package/dist/{env-validation-BfBVvBNe.mjs → env-validation-BUfFZ6bt.mjs} +1 -1
  50. package/dist/error-pages-CLIJ7aYq.mjs +37 -0
  51. package/dist/gen-BhWBT4iu.mjs +1 -0
  52. package/dist/{gen-CCx3t2Ju.mjs → gen-CFmsUsW1.mjs} +3 -3
  53. package/dist/{github-cmd-BzkRLkbg.mjs → github-cmd-De-_IWbM.mjs} +1 -1
  54. package/dist/{handler-CQv5YDS0.d.mts → handler-BHktmuTL.d.mts} +3 -1
  55. package/dist/{headers-D522zd0A.mjs → headers--vaK_chu.mjs} +1 -1
  56. package/dist/index.d.mts +2 -2
  57. package/dist/index.mjs +68 -33
  58. package/dist/{info-oBm8yK8J.mjs → info-Yg0-V5Rs.mjs} +3 -3
  59. package/dist/{init-CBp_uMve.mjs → init-CDiJQycf.mjs} +31 -16
  60. package/dist/{link-Dt_QXmM4.mjs → link-Dllip08S.mjs} +2 -2
  61. package/dist/{list-DF6asTdt.mjs → list-BYRP6am0.mjs} +2 -2
  62. package/dist/{live-CXJ9yC98.d.mts → live-BllfDuzA.d.mts} +2 -2
  63. package/dist/{local-d1-CUhH3qtj.mjs → local-d1-CAwAs9GH.mjs} +1 -1
  64. package/dist/login-BAPmYnb7.mjs +1 -0
  65. package/dist/{login-BjSyhXlT.mjs → login-PcFy5mlC.mjs} +2 -2
  66. package/dist/{logs-DmvBl6xA.mjs → logs-DmJTBhed.mjs} +2 -2
  67. package/dist/{migrate-BXRHpYwR.mjs → migrate-B8S2xTcb.mjs} +5 -66
  68. package/dist/migrate-BIYTPQE6.mjs +1 -0
  69. package/dist/nitro.mjs +4 -4
  70. package/dist/{node-DtD7ZiPf.mjs → node-CDOPrGSl.mjs} +3 -3
  71. package/dist/operator-cmd-CjazwOyb.mjs +1 -0
  72. package/dist/{operator-cmd-DjZKGGgN.mjs → operator-cmd-DmkmS2wL.mjs} +2 -2
  73. package/dist/pages/client.d.mts +17 -2
  74. package/dist/pages/client.mjs +26 -1
  75. package/dist/pages/index.d.mts +17 -1
  76. package/dist/pages/index.mjs +95 -4
  77. package/dist/pages/protocol.d.mts +2 -2
  78. package/dist/{platform-auth-config-BgnuMbml.mjs → platform-auth-config-CImnfohz.mjs} +3 -3
  79. package/dist/{platform-auth-protection-NjRejttU.mjs → platform-auth-protection-BogLhtHi.mjs} +2 -2
  80. package/dist/{platform-auth-recovery-Ug12d9W5.mjs → platform-auth-recovery-B-mEaWEi.mjs} +2 -2
  81. package/dist/{platform-cmd-BYKLMPCn.mjs → platform-cmd-CV8NxIIn.mjs} +1 -1
  82. package/dist/{platform-cmd-HByuZAO7.mjs → platform-cmd-DZK2ixMl.mjs} +3 -3
  83. package/dist/{platform-domain-DLSQ8GF8.mjs → platform-domain-CRvelPGE.mjs} +2 -2
  84. package/dist/{platform-lifecycle-3dwFJmnq.mjs → platform-lifecycle-CPYY7E9B.mjs} +8 -8
  85. package/dist/{platform-lifecycle-BRqcxerG.mjs → platform-lifecycle-DwXq7kZt.mjs} +1 -1
  86. package/dist/{platform-management-ZZ6bQM5j.mjs → platform-management-BOnGbMSM.mjs} +1 -1
  87. package/dist/{platform-management-ZK6XcbCo.mjs → platform-management-lXdgGgAM.mjs} +1 -1
  88. package/dist/{platform-recovery-8vNE5dNN.mjs → platform-recovery-noaALXnE.mjs} +2 -2
  89. package/dist/{prepare-5BR7Splm.mjs → prepare-BuOS18AM.mjs} +1 -1
  90. package/dist/{prepare-Dseww74N.mjs → prepare-D604Yiyr.mjs} +11 -7
  91. package/dist/prepare-DU-tOpS5.mjs +1 -0
  92. package/dist/{project-cmd-CjLNNxwe.mjs → project-cmd-DBYqAIbe.mjs} +13 -13
  93. package/dist/{project-team-DE5drjcl.mjs → project-team-BjCLgTRC.mjs} +1 -1
  94. package/dist/{project-token-XEYEXfiJ.mjs → project-token-BB6PwaA9.mjs} +1 -1
  95. package/dist/{project-tsconfig-Itv1f4WC.mjs → project-tsconfig-CVvk6Z_e.mjs} +24 -2
  96. package/dist/{project-zero-trust-6VPU8zmV.mjs → project-zero-trust-CWDh1P_t.mjs} +1 -1
  97. package/dist/{protocol-BekmFxCI.d.mts → protocol-D5XDySYu.d.mts} +1 -1
  98. package/dist/{provision-Chq0NRAV.mjs → provision-DfxLCg-d.mjs} +1 -1
  99. package/dist/{provision-B7UFrBH7.mjs → provision-DztLJ97X.mjs} +24 -8
  100. package/dist/{requests-CG-Pj8ze.mjs → requests-D_pbzDyz.mjs} +1 -1
  101. package/dist/{rollback-CIrm2txZ.mjs → rollback-CjfIYsJx.mjs} +2 -2
  102. package/dist/{route-types--PAOzHlH.mjs → route-types-DvEGmPif.mjs} +61 -3
  103. package/dist/runtime/auth.d.mts +2 -2
  104. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  105. package/dist/runtime/better-auth-pg.d.mts +1 -1
  106. package/dist/runtime/better-auth.d.mts +1 -1
  107. package/dist/runtime/client-react.d.mts +1 -1
  108. package/dist/runtime/client-solid.d.mts +1 -1
  109. package/dist/runtime/client-svelte.d.mts +1 -1
  110. package/dist/runtime/client-vue.d.mts +1 -1
  111. package/dist/runtime/client.d.mts +1 -1
  112. package/dist/runtime/handler.d.mts +1 -1
  113. package/dist/runtime/live-client.d.mts +1 -1
  114. package/dist/runtime/live.d.mts +1 -1
  115. package/dist/runtime/routing.d.mts +5 -4
  116. package/dist/runtime/routing.mjs +10 -70
  117. package/dist/runtime/validator.d.mts +1 -1
  118. package/dist/runtime/ws-server.d.mts +3 -3
  119. package/dist/runtime/ws.d.mts +1 -1
  120. package/dist/runtime/ws.mjs +4 -2
  121. package/dist/{secret-BL6g7mF5.mjs → secret-3X0PxmuX.mjs} +9 -12
  122. package/dist/{version-metadata-DmaZNTYW.mjs → version-metadata-D2vfMQzv.mjs} +2 -1
  123. package/dist/{wrangler-CDiEBCdS.mjs → wrangler-I-scB_1t.mjs} +80 -12
  124. package/dist/wrangler-UnwdISay.mjs +1 -0
  125. package/dist/{wrapper-CEiDeCqD.mjs → wrapper-BBl1rC32.mjs} +3 -3
  126. package/dist/{ws-D1zWiB_P.d.mts → ws-B3ClMVDh.d.mts} +3 -2
  127. package/docs/guide/auth.md +1 -1
  128. package/docs/guide/edge/redirects.md +22 -0
  129. package/docs/guide/pages-routing/actions-and-forms.md +24 -0
  130. package/docs/guide/platform/installation/maintenance.md +3 -1
  131. package/docs/guide/server-routing.md +2 -0
  132. package/docs/guide/ssg.md +8 -0
  133. package/docs/integrations/cloudflare.md +16 -7
  134. package/docs/reference/api/auth.md +6 -2
  135. package/docs/reference/api/deploy.md +9 -5
  136. package/docs/reference/api/pages.md +2 -0
  137. package/docs/reference/cli/deploy.md +10 -9
  138. package/docs/reference/config.md +11 -1
  139. package/package.json +8 -7
  140. package/schema.json +4 -0
  141. package/skills/void/SKILL.md +1 -1
  142. package/dist/auth-DkcFflXV.d.mts +0 -42
  143. package/dist/cf-build-output-DlBkWdNU.mjs +0 -1
  144. package/dist/client-DyxPQnF_.mjs +0 -1
  145. package/dist/config-BTu1o3Dc.mjs +0 -49
  146. package/dist/deploy-CtHE2A3R.mjs +0 -2
  147. package/dist/gen-TgXy93Rr.mjs +0 -1
  148. package/dist/login-Cdo8Aco1.mjs +0 -1
  149. package/dist/migrate-COPncCGx.mjs +0 -1
  150. package/dist/operator-cmd-DDiX7Y3f.mjs +0 -1
  151. package/dist/prepare-B3VrSF1Z.mjs +0 -1
  152. package/dist/wrangler-DOPr4jyI.mjs +0 -1
@@ -1,14 +1,14 @@
1
1
  import { c as getToken, f as removeToken } from "./auth-B6iOCjKI.mjs";
2
2
  import { L as log } from "./dist-Cor9XGoz.mjs";
3
- import { r as PlatformClient } from "./client-BEMtySaV.mjs";
3
+ import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
4
4
  import { m as printSuccess } from "./output-BpgYODYx.mjs";
5
- import { n as runLoginCommand } from "./login-BjSyhXlT.mjs";
5
+ import { n as runLoginCommand } from "./login-PcFy5mlC.mjs";
6
6
  import { execSync } from "node:child_process";
7
7
  //#region 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-BKwHPbdv.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
11
+ case "link": return import("./auth-link-CedYpDCy.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,8 +1,8 @@
1
1
  import { a as join, i as isAbsolute, t as basename } from "./dist-ipQi0Q8y.mjs";
2
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-CeiB6BG5.mjs";
3
3
  import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
4
- import { r as findVoidAuthConfig } from "./config-BTu1o3Dc.mjs";
5
- import { l as getDatabaseDialect, m as resolveBindingNames } from "./config-DHgSEWT7.mjs";
4
+ import { r as findVoidAuthConfig } from "./config-D-6q7EBH.mjs";
5
+ import { l as getDatabaseDialect, m as resolveBindingNames } from "./config-OFOAimzt.mjs";
6
6
  import { n as globSync } from "./dist-D15hFhP0.mjs";
7
7
  import { m as parseRouteFilename, n as scanPages, p as isRouteEnabledForEnvironment } from "./scan-N9WzdcAl.mjs";
8
8
  import { n as isIdentifier, o as moduleExportName } from "./ast-CsZ_q_gc.mjs";
@@ -11,8 +11,8 @@ import { n as resourceNameWords } from "./resource-name-C7LVpcRm.mjs";
11
11
  import { t as collectMigrations } from "./collect-Dew86qce.mjs";
12
12
  import { i as scanEmailHandlersSync } from "./email-B9ayYQEG.mjs";
13
13
  import { existsSync, readFileSync, readdirSync } from "node:fs";
14
- import { fileURLToPath } from "node:url";
15
14
  import { parseSync } from "vite";
15
+ import { fileURLToPath } from "node:url";
16
16
  import { isSandboxRegistryImage } from "@void/deploy-core";
17
17
  //#region src/crons/scan.ts
18
18
  function extractJobName(filePath) {
@@ -206,10 +206,14 @@ async function scanRoutes(root, options) {
206
206
  checkRoutes: options.checkPageRoutes,
207
207
  environment: options.environment
208
208
  });
209
- const routes = inventory.routes.map((route) => ({
210
- ...route,
211
- methods: detectHttpExports(join(paths.routesDir, route.filePath))
212
- })).sort(compareRouteSpecificity);
209
+ const routes = inventory.routes.map((route) => {
210
+ const methods = detectHttpExports(join(paths.routesDir, route.filePath));
211
+ if (methods.includes("HEAD")) throw new Error(`routes: '${route.filePath}' exports HEAD. HEAD requests are answered by the GET handler; remove the HEAD export.`);
212
+ return {
213
+ ...route,
214
+ methods
215
+ };
216
+ }).sort(compareRouteSpecificity);
213
217
  return {
214
218
  ...inventory,
215
219
  routes,
@@ -1,4 +1,4 @@
1
- import { l as scanRoutes, t as analyzeApplicationSync } from "./application-analysis-DYdVoMAY.mjs";
1
+ import { l as scanRoutes, t as analyzeApplicationSync } from "./application-analysis-DDOQwiXk.mjs";
2
2
  //#region src/application-routing.ts
3
3
  /** Complete route/page analysis using the same resource and handler inventories. */
4
4
  async function completeApplicationAnalysis(analysis) {
@@ -0,0 +1,70 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { Auth, BetterAuthOptions, Session, User } from "better-auth";
3
+ import { Context, Env } from "hono";
4
+ //#region src/runtime/auth.d.ts
5
+ /**
6
+ * Filled in by the generated `.void/auth.d.ts` with the user and session types
7
+ * Better Auth infers from the app's `auth.ts`. Empty when the app has no
8
+ * `auth.ts`, so `AuthUser`/`AuthSession` fall back to Better Auth's base shapes.
9
+ *
10
+ * `AuthUser`/`AuthSession` stay type aliases (not merged interfaces) so they
11
+ * remain assignable to `Record<string, unknown>`, and a union config (a function
12
+ * form that returns different shapes per branch) stays a valid union type.
13
+ */
14
+ interface VoidAuthTypes {}
15
+ /**
16
+ * Better Auth's inferred `{ user, session }` for an `auth.ts` default export.
17
+ * Used by the generated `.void/auth.d.ts`; it lives here so `better-auth`
18
+ * resolves from Void's own dependencies, not the app's.
19
+ *
20
+ * An `any` default export (an `auth.js` without `allowJs`, or an import that
21
+ * does not resolve) keeps Better Auth's base shapes instead of a user type that
22
+ * accepts any key. The tuple check also catches the error `any` of an untyped
23
+ * import.
24
+ */
25
+ type InferAuthSession<T> = [unknown] extends [T] ? {
26
+ user: User;
27
+ session: Session;
28
+ } : Auth<Extract<T extends ((...args: Array<never>) => infer R) ? R : T, BetterAuthOptions>>["$Infer"]["Session"];
29
+ type AuthUser = VoidAuthTypes extends {
30
+ user: infer U;
31
+ } ? U : User;
32
+ type AuthSession = VoidAuthTypes extends {
33
+ session: infer S;
34
+ } ? S : Session;
35
+ type AuthState = {
36
+ session: AuthSession;
37
+ user: AuthUser;
38
+ };
39
+ type VoidAuthConfigContext = {
40
+ defaults: BetterAuthOptions;
41
+ env: Record<string, unknown>;
42
+ dialect: "sqlite" | "postgresql" | "mysql";
43
+ request: Request;
44
+ };
45
+ type VoidAuthConfig = BetterAuthOptions | ((ctx: VoidAuthConfigContext) => BetterAuthOptions);
46
+ /**
47
+ * Shared AsyncLocalStorage that holds the authenticated Better Auth state for the
48
+ * current request.
49
+ *
50
+ * Stored on `globalThis` under a `Symbol.for` key so duplicate module loads
51
+ * (e.g. once by void's bundled runtime and once by Vite's SSR module runner
52
+ * when user code imports from `void/auth`) share a single ALS instance. Without
53
+ * this, the middleware writes to one instance and `getUser()` reads another,
54
+ * always returning null.
55
+ */
56
+ type AuthContextStore = {
57
+ user: AuthUser | null;
58
+ state: AuthState | null;
59
+ };
60
+ declare const authContext: AsyncLocalStorage<AuthContextStore>;
61
+ declare function defineAuth<T extends VoidAuthConfig>(config: T): T;
62
+ declare function getUser(): AuthUser | null;
63
+ declare function getSession(): AuthState | null;
64
+ declare function requireAuth<E extends Env & {
65
+ Variables: {
66
+ user: AuthUser | null;
67
+ };
68
+ }>(c: Context<E>): AuthUser;
69
+ //#endregion
70
+ export { VoidAuthConfig as a, authContext as c, getUser as d, requireAuth as f, InferAuthSession as i, defineAuth as l, AuthState as n, VoidAuthConfigContext as o, AuthUser as r, VoidAuthTypes as s, AuthSession as t, getSession as u };
@@ -1,9 +1,9 @@
1
1
  import { a as getApiUrl, c as getToken, m as savePlatformToken, p as runPlatformLogin, u as openBrowser } from "./auth-B6iOCjKI.mjs";
2
2
  import { L as log } from "./dist-Cor9XGoz.mjs";
3
- import { r as PlatformClient } from "./client-BEMtySaV.mjs";
3
+ import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
4
4
  import { l as formatUrl } from "./output-BpgYODYx.mjs";
5
- import { r as selectPlatformLoginMethod } from "./login-BjSyhXlT.mjs";
6
- import { t as discoverPlatform } from "./platform-cmd-HByuZAO7.mjs";
5
+ import { r as selectPlatformLoginMethod } from "./login-PcFy5mlC.mjs";
6
+ import { t as discoverPlatform } from "./platform-cmd-DZK2ixMl.mjs";
7
7
  //#region src/cli/auth-link.ts
8
8
  async function runAuthLink(root, connectionId) {
9
9
  const token = getToken(root);
@@ -1,4 +1,4 @@
1
- import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
1
+ import { c as normalizePlatformApiUrl, s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
2
2
  import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
3
3
  import { K as select, tt as isCancel } from "./dist-Cor9XGoz.mjs";
4
4
  //#region src/cli/auth-router.ts
@@ -39,23 +39,28 @@ async function chooseDestination(root, args, interactive) {
39
39
  async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isTTY)) {
40
40
  const destination = await chooseDestination(root, args, interactive);
41
41
  if (destination.platform === "cloudflare") {
42
- const { runCloudflareCommand } = await import("./cloudflare-cmd-BaqIigwI.mjs");
42
+ const { runCloudflareCommand } = await import("./cloudflare-cmd-D-b_u3T4.mjs");
43
43
  await runCloudflareCommand(root, { subcommand: args.subcommand });
44
44
  return;
45
45
  }
46
- const { runAccountCommand } = await import("./account-cmd-B4i71m7k.mjs");
46
+ const { runAccountCommand } = await import("./account-cmd-HP8bixYo.mjs");
47
47
  const subcommand = args.subcommand === "status" ? "whoami" : args.subcommand;
48
48
  if (!destination.apiUrl) {
49
49
  await runAccountCommand(root, { subcommand });
50
50
  return;
51
51
  }
52
- const previous = process.env.VOID_API_URL;
52
+ const previous = {
53
+ VOID_API_URL: process.env.VOID_API_URL,
54
+ VOID_TOKEN: process.env.VOID_TOKEN
55
+ };
56
+ const tokenBound = Boolean(previous.VOID_TOKEN && previous.VOID_API_URL && normalizePlatformApiUrl(previous.VOID_API_URL) === destination.apiUrl);
53
57
  process.env.VOID_API_URL = destination.apiUrl;
58
+ if (previous.VOID_TOKEN && !tokenBound) delete process.env.VOID_TOKEN;
54
59
  try {
55
60
  await runAccountCommand(root, { subcommand });
56
61
  } finally {
57
- if (previous === void 0) delete process.env.VOID_API_URL;
58
- else process.env.VOID_API_URL = previous;
62
+ for (const [name, value] of Object.entries(previous)) if (value === void 0) delete process.env[name];
63
+ else process.env[name] = value;
59
64
  }
60
65
  }
61
66
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { t as VoidAuthProvider } from "./providers-BNKRacMr.mjs";
2
- import { i as VoidAuthConfig, n as AuthState } from "./auth-DkcFflXV.mjs";
2
+ import { a as VoidAuthConfig, n as AuthState } from "./auth-g2TQbDLD.mjs";
3
3
  import { BetterAuthOptions, betterAuth } from "better-auth";
4
4
  import { Context } from "hono";
5
5
  import { DBFieldAttribute } from "better-auth/db";
@@ -1,7 +1,7 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
3
  import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
4
- import { n as PlatformApiError, r as PlatformClient } from "./client-BEMtySaV.mjs";
4
+ import { n as PlatformApiError, r as PlatformClient } from "./client-B3LnB_bE.mjs";
5
5
  import { f as import_picocolors, i as dim, m as printSuccess } from "./output-BpgYODYx.mjs";
6
6
  import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
7
7
  import { appendFileSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
3
  import { L as log } from "./dist-Cor9XGoz.mjs";
4
- import { r as PlatformClient } from "./client-BEMtySaV.mjs";
4
+ import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
5
5
  import { m as printSuccess, o as formatCount, r as createSpinner } from "./output-BpgYODYx.mjs";
6
6
  import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
7
7
  //#region src/cli/cache.ts
@@ -1,7 +1,7 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
3
  import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
4
- import { r as PlatformClient } from "./client-BEMtySaV.mjs";
4
+ import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
5
5
  import { m as printSuccess } from "./output-BpgYODYx.mjs";
6
6
  //#region src/cli/cancel-deploy.ts
7
7
  const ACTIVE_STATUSES = /* @__PURE__ */ new Set([
@@ -394,10 +394,24 @@ function copyBundle(source, destination) {
394
394
  }
395
395
  return modules;
396
396
  }
397
+ function stagePackageContext(directory, projectRoot) {
398
+ const root = resolve(projectRoot);
399
+ const manifest = join(root, "package.json");
400
+ if (!existsSync(manifest)) return;
401
+ copyFileSync(manifest, join(directory, "package.json"));
402
+ for (let parent = root;; parent = dirname(parent)) {
403
+ const modules = join(parent, "node_modules");
404
+ if (existsSync(modules)) {
405
+ symlinkSync(modules, join(directory, "node_modules"), process.platform === "win32" ? "junction" : "dir");
406
+ break;
407
+ }
408
+ if (parent === dirname(parent)) break;
409
+ }
410
+ }
397
411
  /** Create a disposable cf Build Output tree from an existing Cloudflare Worker build. */
398
- async function prepareCfBuildOutput(workerDirectory, accountId, mode) {
412
+ async function prepareCfBuildOutput(workerDirectory, accountId, mode, projectRoot = workerDirectory) {
399
413
  const source = resolve(workerDirectory);
400
- if (existsSync(getRootConfigPath(source))) return prepareNativeBuildOutput(source, accountId, mode);
414
+ if (existsSync(getRootConfigPath(source))) return prepareNativeBuildOutput(source, accountId, mode, projectRoot);
401
415
  if (!existsSync(join(source, "wrangler.json"))) throw new Error(`No Cloudflare Worker build found in ${source}. Pass the project root that contains .cloudflare/output/v0, or the Worker output directory that contains wrangler.json.`);
402
416
  const raw = record(JSON.parse(readFileSync(join(source, "wrangler.json"), "utf8")));
403
417
  if (!raw) return null;
@@ -421,6 +435,7 @@ async function prepareCfBuildOutput(workerDirectory, accountId, mode) {
421
435
  await Promise.all(images.map((image) => image.dispose()));
422
436
  };
423
437
  try {
438
+ stagePackageContext(directory, projectRoot);
424
439
  const bundle = getWorkerBundleDir(directory);
425
440
  mkdirSync(bundle, { recursive: true });
426
441
  const modules = copyBundle(source, bundle);
@@ -479,7 +494,7 @@ async function prepareCfBuildOutput(workerDirectory, accountId, mode) {
479
494
  }
480
495
  }
481
496
  /** Copy and complete the native artifact without changing the Vite build's inputs or metadata. */
482
- async function prepareNativeBuildOutput(source, accountId, mode) {
497
+ async function prepareNativeBuildOutput(source, accountId, mode, projectRoot = source) {
483
498
  const built = await readBuildOutput(source);
484
499
  if (accountId !== void 0 && built.rootConfig.accountId !== void 0 && accountId !== built.rootConfig.accountId || mode !== void 0 && mode !== built.rootConfig.buildContext.mode) return null;
485
500
  const directory = mkdtempSync(join(tmpdir(), "void-cf-native-"));
@@ -490,6 +505,7 @@ async function prepareNativeBuildOutput(source, accountId, mode) {
490
505
  });
491
506
  };
492
507
  try {
508
+ stagePackageContext(directory, projectRoot);
493
509
  await writeRootConfig(directory, {
494
510
  accountId: accountId ?? built.rootConfig.accountId,
495
511
  complianceRegion: built.rootConfig.complianceRegion
@@ -657,7 +673,7 @@ async function prepareBundledBuildOutput(options) {
657
673
  main: "index.js",
658
674
  assets: options.assets
659
675
  }), { mode: 384 });
660
- return await prepareCfBuildOutput(scratch, options.accountId);
676
+ return await prepareCfBuildOutput(scratch, options.accountId, void 0, options.projectRoot);
661
677
  } finally {
662
678
  rmSync(scratch, {
663
679
  recursive: true,
@@ -0,0 +1 @@
1
+ export { t as prepareCfBuildOutput } from "./cf-build-output-XpNR9zoh.mjs";
@@ -16,8 +16,14 @@ function getCfCliVersion(attribution) {
16
16
  //#endregion
17
17
  //#region src/cli/cf-worker-settings.ts
18
18
  /** Version uploads leave Worker-wide settings untouched; publish only explicit configuration. */
19
- async function publishCloudflareObservability(options) {
20
- if (!isRecord(options.observability)) throw new Error("The Cloudflare Worker observability settings were not readable.");
19
+ async function publishCloudflareWorkerSettings(options) {
20
+ if (options.observability !== void 0 && !isRecord(options.observability)) throw new Error("The Cloudflare Worker observability settings were not readable.");
21
+ if (options.logpush !== void 0 && typeof options.logpush !== "boolean") throw new Error("The Cloudflare Worker Logpush setting was not readable.");
22
+ const settings = {
23
+ ...options.observability === void 0 ? {} : { observability: options.observability },
24
+ ...options.logpush === void 0 ? {} : { logpush: options.logpush }
25
+ };
26
+ if (Object.keys(settings).length === 0) return;
21
27
  const endpoint = `${options.apiBaseUrl.replace(/\/$/, "")}/accounts/${encodeURIComponent(options.accountId)}/workers/scripts/${encodeURIComponent(options.workerName)}/script-settings`;
22
28
  const response = await fetch(endpoint, {
23
29
  method: "PATCH",
@@ -26,12 +32,12 @@ async function publishCloudflareObservability(options) {
26
32
  ...options.headers,
27
33
  "Content-Type": "application/json"
28
34
  },
29
- body: JSON.stringify({ observability: options.observability }),
35
+ body: JSON.stringify(settings),
30
36
  redirect: "error",
31
37
  signal: AbortSignal.timeout(3e4)
32
38
  });
33
39
  const body = await response.json();
34
- if (!response.ok || !isRecord(body) || body.success !== true) throw new Error(`Cloudflare did not update Worker observability (HTTP ${response.status}).`);
40
+ if (!response.ok || !isRecord(body) || body.success !== true) throw new Error(`Cloudflare did not update Worker settings (HTTP ${response.status}).`);
35
41
  }
36
42
  //#endregion
37
- export { getCfCliVersion as n, getVoidUserAgent as r, publishCloudflareObservability as t };
43
+ export { getCfCliVersion as n, getVoidUserAgent as r, publishCloudflareWorkerSettings as t };
package/dist/cli/cli.mjs CHANGED
@@ -1641,19 +1641,19 @@ const args = process.argv.slice(2);
1641
1641
  const command = args[0];
1642
1642
  const helpPath = getHelpPath(args);
1643
1643
  const subcommandGroups = {
1644
- auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-DqLx8E0F.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1645
- account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-B4i71m7k.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1646
- platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-BYKLMPCn.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1647
- cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-BaqIigwI.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
1648
- project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-CjLNNxwe.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1649
- secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-BL6g7mF5.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1650
- domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-CH5iBD9Y.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1651
- email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-CbTO1l78.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1652
- db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-rvo64snS.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
1653
- env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-BBdw236G.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1654
- gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-TgXy93Rr.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1655
- github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-BzkRLkbg.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1656
- build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-Dy4psnt1.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1644
+ auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-vafo7x8w.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1645
+ account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-HP8bixYo.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1646
+ platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-CV8NxIIn.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1647
+ cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-D-b_u3T4.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
1648
+ project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DBYqAIbe.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1649
+ secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-3X0PxmuX.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1650
+ domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-DyhNtdYf.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1651
+ email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-DM2wDcBN.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1652
+ db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-Cdvr3zwG.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
1653
+ env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-78hbN-oI.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1654
+ gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-BhWBT4iu.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1655
+ github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-De-_IWbM.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1656
+ build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-9vUAQ1_V.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1657
1657
  };
1658
1658
  if (helpPath) {
1659
1659
  if (helpPath.length === 0) printGlobalHelp();
@@ -1672,7 +1672,7 @@ if (helpPath) {
1672
1672
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1673
1673
  process.exit(1);
1674
1674
  }
1675
- import("../deploy-CtHE2A3R.mjs").then(({ runDeploy }) => {
1675
+ import("../deploy-CX94CmKa.mjs").then(({ runDeploy }) => {
1676
1676
  runDeploy(root, deployArgs).catch((err) => {
1677
1677
  log.error(formatCloudflareUserMessage(err.message ?? String(err)));
1678
1678
  process.exit(1);
@@ -1680,14 +1680,14 @@ if (helpPath) {
1680
1680
  });
1681
1681
  } else if (command === "connect") (async () => {
1682
1682
  const parsed = parseConnectArgs(args.slice(1));
1683
- const { runConnectCommand } = await import("../connect-DwVsBvVh.mjs");
1683
+ const { runConnectCommand } = await import("../connect-BOM6zvFX.mjs");
1684
1684
  await runConnectCommand(process.cwd(), parsed);
1685
1685
  })().catch((err) => {
1686
1686
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1687
1687
  process.exit(1);
1688
1688
  });
1689
1689
  else if (command && Object.hasOwn(subcommandGroups, command)) subcommandGroups[command]();
1690
- else if (command === "info") import("../info-oBm8yK8J.mjs").then(async ({ runInfoCommand }) => {
1690
+ else if (command === "info") import("../info-Yg0-V5Rs.mjs").then(async ({ runInfoCommand }) => {
1691
1691
  try {
1692
1692
  await runInfoCommand(process.cwd(), parseInfoArgs(args.slice(1)));
1693
1693
  } catch (err) {
@@ -1708,7 +1708,7 @@ else if (command === "prepare") {
1708
1708
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1709
1709
  process.exit(1);
1710
1710
  }
1711
- import("../prepare-5BR7Splm.mjs").then(({ runPrepareCommand }) => {
1711
+ import("../prepare-BuOS18AM.mjs").then(({ runPrepareCommand }) => {
1712
1712
  runPrepareCommand(root).catch((err) => {
1713
1713
  log.error(formatCloudflareUserMessage(err.message ?? String(err)));
1714
1714
  process.exit(1);
@@ -1716,7 +1716,7 @@ else if (command === "prepare") {
1716
1716
  });
1717
1717
  } else if (command === "init") {
1718
1718
  const root = process.cwd();
1719
- import("../init-CBp_uMve.mjs").then(({ runInitCommand, parseInitArgs }) => {
1719
+ import("../init-CDiJQycf.mjs").then(({ runInitCommand, parseInitArgs }) => {
1720
1720
  let initArgs;
1721
1721
  try {
1722
1722
  initArgs = parseInitArgs(args.slice(1));
@@ -1734,7 +1734,7 @@ else if (command === "prepare") {
1734
1734
  log.error("migrate: This command takes no arguments.");
1735
1735
  process.exit(1);
1736
1736
  }
1737
- import("../migrate-COPncCGx.mjs").then(({ runMigrateCommand }) => {
1737
+ import("../migrate-BIYTPQE6.mjs").then(({ runMigrateCommand }) => {
1738
1738
  runMigrateCommand(process.cwd()).catch((err) => {
1739
1739
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1740
1740
  process.exit(1);
@@ -1856,32 +1856,32 @@ else if (command) {
1856
1856
  if (Object.hasOwn(subcommandGroups, cmd)) return subcommandGroups[cmd]();
1857
1857
  switch (cmd) {
1858
1858
  case "connect": {
1859
- const { runConnectCommand } = await import("../connect-DwVsBvVh.mjs");
1859
+ const { runConnectCommand } = await import("../connect-BOM6zvFX.mjs");
1860
1860
  await runConnectCommand(root, parseConnectArgs([]));
1861
1861
  return;
1862
1862
  }
1863
1863
  case "init": {
1864
- const { runInitCommand, parseInitArgs } = await import("../init-CBp_uMve.mjs");
1864
+ const { runInitCommand, parseInitArgs } = await import("../init-CDiJQycf.mjs");
1865
1865
  await runInitCommand(root, parseInitArgs([]));
1866
1866
  return;
1867
1867
  }
1868
1868
  case "migrate": {
1869
- const { runMigrateCommand } = await import("../migrate-COPncCGx.mjs");
1869
+ const { runMigrateCommand } = await import("../migrate-BIYTPQE6.mjs");
1870
1870
  await runMigrateCommand(root);
1871
1871
  return;
1872
1872
  }
1873
1873
  case "deploy": {
1874
- const { runDeploy } = await import("../deploy-CtHE2A3R.mjs");
1874
+ const { runDeploy } = await import("../deploy-CX94CmKa.mjs");
1875
1875
  await runDeploy(root);
1876
1876
  return;
1877
1877
  }
1878
1878
  case "info": {
1879
- const { runInfoCommand } = await import("../info-oBm8yK8J.mjs");
1879
+ const { runInfoCommand } = await import("../info-Yg0-V5Rs.mjs");
1880
1880
  await runInfoCommand(root, parseInfoArgs([]));
1881
1881
  return;
1882
1882
  }
1883
1883
  case "prepare": {
1884
- const { runPrepareCommand } = await import("../prepare-5BR7Splm.mjs");
1884
+ const { runPrepareCommand } = await import("../prepare-BuOS18AM.mjs");
1885
1885
  await runPrepareCommand(root);
1886
1886
  return;
1887
1887
  }
@@ -4,7 +4,7 @@ import { a as join, c as resolve, n as dirname } from "../dist-ipQi0Q8y.mjs";
4
4
  import { t as require_picocolors } from "../picocolors-BsDfhxIw.mjs";
5
5
  import { l as formatUrl } from "../output-BpgYODYx.mjs";
6
6
  import { i as safePositional, n as isD1Bookmark, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "../cf-command-values-ByHk0xg4.mjs";
7
- import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareObservability } from "../cf-worker-settings-BECvvTVd.mjs";
7
+ import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareWorkerSettings } from "../cf-worker-settings-Dg27RzyT.mjs";
8
8
  import { t as sanitizeTerminalLogText } from "../terminal-log-text-D9ACPOuG.mjs";
9
9
  import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { fileURLToPath } from "node:url";
@@ -254,7 +254,7 @@ async function withBuildOutput(raw, sourceMain, action) {
254
254
  }), { mode: 384 });
255
255
  const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? raw.account_id;
256
256
  if (typeof accountId !== "string" || !accountId) throw new Error("Cloudflare account is not pinned for Worker deployment.");
257
- const { prepareCfBuildOutput } = await import("../cf-build-output-DlBkWdNU.mjs");
257
+ const { prepareCfBuildOutput } = await import("../cf-build-output-bd8Uwv1P.mjs");
258
258
  const output = await prepareCfBuildOutput(scratch, accountId);
259
259
  if (!output) throw new Error("Could not prepare the Cloudflare Worker build output.");
260
260
  try {
@@ -569,6 +569,11 @@ async function readAllQueues() {
569
569
  }
570
570
  async function resources() {
571
571
  switch (operation.type) {
572
+ case "workers.subdomain.get": {
573
+ const { subdomain } = object((await cloudflareApiGet(`/accounts/${encodeURIComponent(accountId())}/workers/subdomain`, "Cloudflare did not return the account workers.dev subdomain.")).result);
574
+ if (typeof subdomain !== "string" || !subdomain.trim()) throw new Error("Cloudflare returned an invalid account workers.dev subdomain.");
575
+ return result(0, "", "", { subdomain });
576
+ }
572
577
  case "d1.execute": return runCf([
573
578
  "d1",
574
579
  "query",
@@ -1023,11 +1028,12 @@ async function workerChanges() {
1023
1028
  "deploy",
1024
1029
  "--prebuilt"
1025
1030
  ], directory));
1026
- if (deployed.status === 0 && raw.observability !== void 0) await publishCloudflareObservability({
1031
+ if (deployed.status === 0 && (raw.observability !== void 0 || raw.logpush !== void 0)) await publishCloudflareWorkerSettings({
1027
1032
  apiBaseUrl: apiBaseUrl(),
1028
1033
  accountId: accountId(),
1029
1034
  workerName: name,
1030
1035
  observability: raw.observability,
1036
+ logpush: raw.logpush,
1031
1037
  headers: await apiHeaders()
1032
1038
  });
1033
1039
  return deployed;
@@ -109,7 +109,7 @@ function emitResult(result) {
109
109
  writeSync(RESULT_FD, JSON.stringify(result));
110
110
  }
111
111
  async function runFactsChild(root) {
112
- const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-BfBVvBNe.mjs");
112
+ const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-BUfFZ6bt.mjs");
113
113
  try {
114
114
  emitResult({
115
115
  kind: "ok",
@@ -128,7 +128,7 @@ async function runFactsChild(root) {
128
128
  }
129
129
  /** The parent already found the emitted config, so a read failure here fails closed. */
130
130
  async function runValidateEmittedChild(root) {
131
- const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-BfBVvBNe.mjs");
131
+ const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-BUfFZ6bt.mjs");
132
132
  const emitted = readEmittedWorkerVars(root);
133
133
  if (!emitted.ok) {
134
134
  emitResult({
@@ -95,7 +95,7 @@ function readCliVersion() {
95
95
  }
96
96
  const VOID_CLI_VERSION = readCliVersion();
97
97
  /** The oldest Void platform release this CLI supports. */
98
- const MIN_PLATFORM_VERSION = "1.3.0";
98
+ const MIN_PLATFORM_VERSION = "1.4.0";
99
99
  const RELEASE_VERSION = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
100
100
  /**
101
101
  * Discovery probes keyed by platform base URL. Every outcome (pass,
@@ -0,0 +1 @@
1
+ export { r as PlatformClient } from "./client-B3LnB_bE.mjs";
@@ -145,7 +145,7 @@ function cloudflareAuthEnvironment(source = process.env) {
145
145
  "WRANGLER_LOG_SANITIZE",
146
146
  "CLOUDFLARE_AUTH_USE_KEYRING"
147
147
  ]);
148
- for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedKeys.has(key.toUpperCase())) delete env[key];
148
+ for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|CF_ACCESS_READINESS_ORIGIN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedKeys.has(key.toUpperCase())) delete env[key];
149
149
  env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
150
150
  return env;
151
151
  }
@@ -1,9 +1,9 @@
1
1
  import { t as basename } from "./dist-ipQi0Q8y.mjs";
2
- import { b as readRootWranglerConfig } from "./wrangler-CDiEBCdS.mjs";
2
+ import { b as readRootWranglerConfig } from "./wrangler-I-scB_1t.mjs";
3
3
  import { L as log } from "./dist-Cor9XGoz.mjs";
4
4
  import { m as printSuccess } from "./output-BpgYODYx.mjs";
5
5
  import { i as isCleanCloudflareExit } from "./cloudflare-process-8jEYIeim.mjs";
6
- import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-Byo_0_N9.mjs";
6
+ import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-DyD_kVFr.mjs";
7
7
  //#region src/cli/cloudflare-cmd.ts
8
8
  async function runCloudflareCommand(root, args) {
9
9
  const runWrangler = createBundledCloudflareAuthRunner(root);
@@ -1,15 +1,26 @@
1
1
  import { a as join } from "./dist-ipQi0Q8y.mjs";
2
2
  import "./project-paths-DGu_QZ_Q.mjs";
3
- import { p as readConfig } from "./config-DHgSEWT7.mjs";
3
+ import { p as readConfig } from "./config-OFOAimzt.mjs";
4
4
  import { t as writeFileAtomic } from "./atomic-write-Dq6R0BPN.mjs";
5
5
  import { t as parseJsoncObject } from "./generated-wrangler-config-DeWj5F9Y.mjs";
6
- import { existsSync, mkdirSync, readFileSync, rmSync } from "node:fs";
6
+ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
7
7
  import { isRecord } from "@void/deploy-core";
8
8
  import { isDeepStrictEqual } from "node:util";
9
9
  //#region src/cloudflare-config.ts
10
10
  const MATERIALIZED_CLOUDFLARE_FILE = ".void-wrangler.jsonc";
11
11
  const VOID_LOCK_FILE = "void.lock.json";
12
12
  const PREVIEW_POINTER_FILE = "preview-deploy-config.json";
13
+ /** Add the generated Cloudflare config to `.gitignore` unless a line already ignores it. */
14
+ function ignoreMaterializedCloudflareConfig(root) {
15
+ const path = join(root, ".gitignore");
16
+ const source = existsSync(path) ? readFileSync(path, "utf8") : "";
17
+ if (source.split("\n").some((line) => {
18
+ const entry = line.trim();
19
+ return entry === ".void-wrangler.jsonc" || entry === `/.void-wrangler.jsonc`;
20
+ })) return;
21
+ const separator = source && !source.endsWith("\n") ? "\n" : "";
22
+ writeFileSync(path, `${source}${separator}${MATERIALIZED_CLOUDFLARE_FILE}\n`);
23
+ }
13
24
  function arrayIdentity(value) {
14
25
  if (isRecord(value)) {
15
26
  for (const key of [
@@ -167,4 +178,4 @@ function seedCloudflareConfig(root, source, text) {
167
178
  });
168
179
  }
169
180
  //#endregion
170
- export { restoreCloudflarePreviewPointer as a, persistCloudflareConfig as i, VOID_LOCK_FILE as n, seedCloudflareConfig as o, materializeCloudflareConfig as r, stashCloudflareDeployPointer as s, MATERIALIZED_CLOUDFLARE_FILE as t };
181
+ export { persistCloudflareConfig as a, stashCloudflareDeployPointer as c, materializeCloudflareConfig as i, VOID_LOCK_FILE as n, restoreCloudflarePreviewPointer as o, ignoreMaterializedCloudflareConfig as r, seedCloudflareConfig as s, MATERIALIZED_CLOUDFLARE_FILE as t };
@@ -1,7 +1,7 @@
1
1
  import { a as join, t as basename } from "./dist-ipQi0Q8y.mjs";
2
- import { M as writeProvisionedWranglerConfig, b as readRootWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-CDiEBCdS.mjs";
2
+ import { M as writeProvisionedWranglerConfig, b as readRootWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-I-scB_1t.mjs";
3
3
  import { K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
4
- import { i as ensureCloudflareAuthentication, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-Byo_0_N9.mjs";
4
+ import { i as ensureCloudflareAuthentication, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-DyD_kVFr.mjs";
5
5
  import { existsSync } from "node:fs";
6
6
  //#region src/cli/cloudflare-connect.ts
7
7
  async function connectCloudflare(root, interactive = Boolean(process.stdin.isTTY)) {
@@ -1,10 +1,10 @@
1
1
  import { a as join } from "./dist-ipQi0Q8y.mjs";
2
- import { i as persistCloudflareConfig, r as materializeCloudflareConfig } from "./cloudflare-config-DchHxPTo.mjs";
3
- import { N as writeWranglerPublishedTrafficSnapshot, S as readWranglerCustomDomains, j as updateWranglerCustomDomain, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-CDiEBCdS.mjs";
2
+ import { a as persistCloudflareConfig, i as materializeCloudflareConfig } from "./cloudflare-config-CH1AylZT.mjs";
3
+ import { N as writeWranglerPublishedTrafficSnapshot, S as readWranglerCustomDomains, j as updateWranglerCustomDomain, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-I-scB_1t.mjs";
4
4
  import { u as getErrorMessage } from "./output-BpgYODYx.mjs";
5
5
  import { t as createCloudflareProcessRunner } from "./cloudflare-process-8jEYIeim.mjs";
6
- import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-B7UFrBH7.mjs";
7
- import { a as findWranglerCiOverrideDotenvFile, i as findAmbientConfigOverride } from "./deploy-transport-JCxw7QDi.mjs";
6
+ import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-DztLJ97X.mjs";
7
+ import { a as findWranglerCiOverrideDotenvFile, i as findAmbientConfigOverride } from "./deploy-transport-DIq_gFTP.mjs";
8
8
  import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { tmpdir } from "node:os";
10
10
  import { deployCloudflareVersionTraffic, encodeCloudflareVersionMessage, parseCloudflareVersionMessage, parseRootWranglerConfig, readBindingFieldPresence, readCloudflareTriggerConfig, readWranglerTopLevelString, resolveD1MigrateTarget, stabilizeCloudflareVersionTriggers } from "@void/deploy-cloudflare";