void 0.21.1 → 0.21.3
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.
- package/README.md +3 -2
- package/dist/{auth-cmd-g_ymMkUe.mjs → account-cmd-DGt9cpRe.mjs} +10 -10
- package/dist/{agents-gni4eqBu.mjs → agents-B_pX_HmQ.mjs} +1 -1
- package/dist/ast-CPGPjb0V.mjs +18 -0
- package/dist/{auth-CAw7zHqj.mjs → auth-CZuiVsFh.mjs} +1 -1
- package/dist/{auth-B9_D6ygs.mjs → auth-DLNN0D3Z.mjs} +4 -4
- package/dist/{auth-link-DFvxIyZi.mjs → auth-link-Cl9vOuf7.mjs} +5 -5
- package/dist/auth-router-D4ZcMUSf.mjs +74 -0
- package/dist/{better-auth-shared-BoVwA5Vm.d.mts → better-auth-shared-BVkjZ3vM.d.mts} +1 -0
- package/dist/{better-auth-shared-syGYYmnY.mjs → better-auth-shared-rsBGBvWJ.mjs} +3 -6
- package/dist/{build-cmd-wJAv808h.mjs → build-cmd-Dpt0jd-x.mjs} +5 -5
- package/dist/{cache-Be0Fu5Ka.mjs → cache-7_UeZdTk.mjs} +5 -5
- package/dist/{cancel-deploy-BgmyOwhe.mjs → cancel-deploy-D23R1RXT.mjs} +4 -4
- package/dist/{cf-access-rAZxzMkL.mjs → cf-access-P0iZnu0q.mjs} +1 -1
- package/dist/{cf-build-output-CTdlo6Rt.mjs → cf-build-output-CGT03qCD.mjs} +2 -2
- package/dist/cli/cf-compat.mjs +2 -2
- package/dist/cli/cli.mjs +122 -66
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-4cDVv7BO.mjs +2 -0
- package/dist/{client-PdAJ-F0t.mjs → client-QTl6ko_D.mjs} +28 -5
- package/dist/{cloudflare-auth-BCmTc1X_.mjs → cloudflare-auth-B9jPCkV2.mjs} +1 -1
- package/dist/{cloudflare-cmd-D6PrKn7o.mjs → cloudflare-cmd-BjNxR1XF.mjs} +3 -3
- package/dist/{cloudflare-connect-DloREDlc.mjs → cloudflare-connect-CCUozPOe.mjs} +3 -3
- package/dist/{cloudflare-operations-BHNJVDbN.mjs → cloudflare-operations-BipGMJ5O.mjs} +1 -1
- package/dist/{cloudflare-operations-CPEdHYhM.mjs → cloudflare-operations-sMZXpk_S.mjs} +4 -4
- package/dist/collect-DLyFDiKW.mjs +2 -0
- package/dist/{collect-DXHNWHcT.mjs → collect-DiTn9yr6.mjs} +1 -1
- package/dist/config-0acf1oys.mjs +2 -0
- package/dist/{config-DywxBLQC.d.mts → config-CF69HgXc.d.mts} +7 -0
- package/dist/{config-Dxr6cTXn.mjs → config-CafTW6Cz.mjs} +12 -1
- package/dist/{config-BSe70f4T.mjs → config-D8MOgiQV.mjs} +3 -3
- package/dist/config-DPByhVck.mjs +32 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config--T87TD8T.mjs → config-s7Xj7tPb.mjs} +1 -1
- package/dist/{config-write-y3CBI_ux.mjs → config-write-BSduPMY8.mjs} +3 -3
- package/dist/{connect-LnvW4HKx.mjs → connect-4Ph5Y0QE.mjs} +8 -8
- package/dist/{create-project-JV9-6ICF.mjs → create-project-BniEV0OW.mjs} +1 -1
- package/dist/{create-project-BZBl_gQ0.mjs → create-project-DBfFSZKY.mjs} +4 -4
- package/dist/{db-Mzv88E1C.mjs → db-DzJRn-qz.mjs} +128 -60
- package/dist/{delete-Ri6JemSU.mjs → delete-D6dZ9B6B.mjs} +5 -5
- package/dist/deploy-BH0grP4y.mjs +2 -0
- package/dist/{deploy-DEsMVrCY.mjs → deploy-CsMJrPfM.mjs} +522 -262
- package/dist/discover-AMCBXivQ.mjs +2 -0
- package/dist/{discover-C4O6YxVS.mjs → discover-BcPPiF1o.mjs} +2 -2
- package/dist/{dist-4WkAWhWx.mjs → dist-BVqXeR_h.mjs} +9 -1
- package/dist/dist-_UUlL6bg.mjs +2 -0
- package/dist/{domain-BA37Ye7T.mjs → domain-Dmhvb2oU.mjs} +5 -5
- package/dist/{email-C5kaZXzJ.mjs → email--tEtMoj_.mjs} +1 -1
- package/dist/{email-C5NsxrQG.mjs → email-BRKOG2RG.mjs} +10 -10
- package/dist/{entry-DdRFGK0y.mjs → entry-CF5wvH4w.mjs} +4 -21
- package/dist/{env-U_ohASB0.mjs → env-Csi-tMbT.mjs} +8 -8
- package/dist/{env-Yz4HcvHs.mjs → env-D5liuQYR.mjs} +5 -2
- package/dist/{env-DX_v-Q-v.mjs → env-_v349JBd.mjs} +1 -1
- package/dist/{env-types-CWDtqHgw.mjs → env-types-C2_bIk_b.mjs} +2 -2
- package/dist/{env-validation-BsFEXps5.mjs → env-validation-BB4GkLxn.mjs} +4 -4
- package/dist/{env-validation-DIDGM7h4.mjs → env-validation-BXge7uyK.mjs} +1 -1
- package/dist/{gen-pg-Ojg8Y.mjs → gen-Dz3X1Qab.mjs} +8 -8
- package/dist/gen-Vnv2f65C.mjs +2 -0
- package/dist/{generate-C0VY6RVf.mjs → generate-GDbL7sUr.mjs} +2 -2
- package/dist/{github-cmd-DsrkweIl.mjs → github-cmd-BED3_9JD.mjs} +7 -7
- package/dist/{headers-B_HBMgi0.mjs → headers-BOg_velo.mjs} +2 -2
- package/dist/{help-sBhFH6pi.mjs → help-DC7gdz7L.mjs} +46 -11
- package/dist/help-DQMfeKMz.mjs +2 -0
- package/dist/index.mjs +134 -160
- package/dist/{init-C--Yyj1b.mjs → init-CRGDXzVC.mjs} +105 -289
- package/dist/{link-BC-mNG9-.mjs → link-CsHOinF7.mjs} +6 -6
- package/dist/{list-DHU1Wj6c.mjs → list-CDb-4bZ1.mjs} +6 -6
- package/dist/{local-d1-DzykTWY8.mjs → local-d1-CC8sKFGu.mjs} +3 -3
- package/dist/{login-jKe_0QZL.mjs → login-BQyISZuW.mjs} +4 -4
- package/dist/login-r2gL8l7B.mjs +2 -0
- package/dist/{logs-BG11f5PR.mjs → logs-BdfiOezj.mjs} +5 -5
- package/dist/{migrate-BV8qHiCb.mjs → migrate-B8KuoYsO.mjs} +69 -44
- package/dist/migrate-TsHGBnDA.mjs +2 -0
- package/dist/{node-Cupyf7-s.mjs → node-BM43oz4G.mjs} +5 -5
- package/dist/{operator-auth-BkVgJqv-.mjs → operator-auth-8KnOVXVd.mjs} +2 -2
- package/dist/{operator-client-A0iex2yi.mjs → operator-client-DUwumHpQ.mjs} +2 -2
- package/dist/{operator-cmd-BwAS2XZt.mjs → operator-cmd-Co-PeaeD.mjs} +6 -6
- package/dist/{package-json-iCbMg5XF.mjs → package-json-DXfiT1jV.mjs} +1 -1
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +11 -6
- package/dist/pages/islands-plugin.d.mts +271 -1
- package/dist/pages/islands-plugin.mjs +95 -18
- package/dist/parse-filename-DioPHiR9.mjs +77 -0
- package/dist/{platform-auth-config-C-hv-_Ok.mjs → platform-auth-config-TSw8edHw.mjs} +5 -5
- package/dist/{platform-auth-protection-DjTE5Hj-.mjs → platform-auth-protection-Ba1XqGhn.mjs} +6 -6
- package/dist/{platform-auth-recovery-Cr0r8TEb.mjs → platform-auth-recovery-BkT3EsF2.mjs} +5 -5
- package/dist/{platform-cmd-DE6dw45v.mjs → platform-cmd-C8OqhqPt.mjs} +1 -1
- package/dist/{platform-cmd-0tEh2ZtA.mjs → platform-cmd-CRSKfu8k.mjs} +5 -5
- package/dist/{platform-domain-B_7x6Iqx.mjs → platform-domain-j9YCXRm6.mjs} +3 -3
- package/dist/{platform-lifecycle-Di0LbhPM.mjs → platform-lifecycle-78H0XQUA.mjs} +278 -230
- package/dist/{platform-lifecycle-Dhx9Pnub.mjs → platform-lifecycle-DDc9zCeJ.mjs} +1 -1
- package/dist/{platform-management-eaiaU3uM.mjs → platform-management-6w8-DUjC.mjs} +2 -2
- package/dist/{platform-management-B9LUtMt9.mjs → platform-management-DzKNsMlt.mjs} +1 -1
- package/dist/{platform-recovery-BxfA8E5C.mjs → platform-recovery-Do8VOyDE.mjs} +3 -3
- package/dist/{platform-registry-BJbgZLS1.mjs → platform-registry-QBa4DK32.mjs} +1 -1
- package/dist/{plugin-inference-DsvtJLll.mjs → plugin-inference-BMfKRSqE.mjs} +188 -85
- package/dist/prepare-BZXkjdNe.mjs +2 -0
- package/dist/{prepare-pcWcxSCh.mjs → prepare-C3kt3Rst.mjs} +11 -11
- package/dist/{prepare-_T-Haxrr.mjs → prepare-DyZ-Yok5.mjs} +1 -1
- package/dist/{prerender-render-Cf_WDE9W.mjs → prerender-render-D9qbLs2f.mjs} +1 -1
- package/dist/prerender-render.mjs +1 -1
- package/dist/{preset-Dowh9tTt.mjs → preset-UHj9ARyP.mjs} +4 -4
- package/dist/{project-BEBFDFLz.mjs → project-BuUwfj6f.mjs} +1 -1
- package/dist/{project-CWNIPoXc.mjs → project-C0Fqu05O.mjs} +2 -2
- package/dist/{project-cmd-DrnRJdep.mjs → project-cmd-B44I8J_W.mjs} +16 -16
- package/dist/{project-paths-CKQ-Q5JS.mjs → project-paths-GgcMozYz.mjs} +1 -1
- package/dist/{project-team-CzRbO_kA.mjs → project-team-BkbYIsXN.mjs} +6 -6
- package/dist/{project-token-Bwxjf4y6.mjs → project-token-C8xEEQnB.mjs} +4 -4
- package/dist/{project-tsconfig-CwfqUnVp.mjs → project-tsconfig-B8GeM0RM.mjs} +2 -2
- package/dist/{provision-Cck2m3jJ.mjs → provision-BhreDAOS.mjs} +141 -78
- package/dist/provision-DNtrtaVD.mjs +3 -0
- package/dist/{requests-DwrqUQZ8.mjs → requests-DFyhBMaf.mjs} +4 -4
- package/dist/{resolve-project-Xvis70DG.mjs → resolve-project-BG5ORGID.mjs} +1 -1
- package/dist/resolve-project-DtbidV4y.mjs +2 -0
- package/dist/{rollback-B4tFWmkN.mjs → rollback-DHHxXZiS.mjs} +5 -5
- package/dist/{route-types-Id82-veQ.mjs → route-types-Clm4WD0B.mjs} +39 -16
- package/dist/{runner-CQs_cDSG.mjs → runner-B8wXwWlo.mjs} +1 -1
- package/dist/{runner-mysql-1o47achK.mjs → runner-mysql-CEG5JozK.mjs} +1 -1
- package/dist/{runner-mysql-BhwMk2Bm.mjs → runner-mysql-DmWchSWJ.mjs} +1 -1
- package/dist/{runner-BGVsGgkb.mjs → runner-p-dMs2UN.mjs} +3 -3
- package/dist/{runner-pg-D7z01mQS.mjs → runner-pg-Bh4AgZdj.mjs} +1 -1
- package/dist/{runner-pg-CJ_JeGF6.mjs → runner-pg-D4OPlil-.mjs} +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/db.mjs +8 -5
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.mjs +1 -1
- package/dist/runtime/env.d.mts +1 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-server.mjs +38 -23
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/{scan-DJbooZm2.mjs → scan-4tfN-PSn.mjs} +113 -99
- package/dist/{scan-DdDvRCU1.mjs → scan-ClYmX3sa.mjs} +35 -137
- package/dist/{secret-UtrRjhEO.mjs → secret-DN9sSNiV.mjs} +7 -7
- package/dist/{skills-B-690E7h.mjs → skills-O6FUaizK.mjs} +2 -2
- package/dist/sveltekit.mjs +1 -1
- package/dist/{validate-qNhV00PD.mjs → validate-CIUwFpjB.mjs} +2 -2
- package/dist/validate-EKmJWxmy.mjs +2 -0
- package/dist/{wrangler-D01qs6VB.mjs → wrangler-BymcxrRa.mjs} +3 -3
- package/dist/{yarn-pnp-CVEc3gE7.mjs → yarn-pnp-BV4AzNul.mjs} +1 -1
- package/package.json +7 -7
- package/schema.json +18 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +1 -1
- package/skills/void/SKILL.md +4 -2
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/auth.md +2 -2
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/durable-state.md +1 -1
- package/skills/void/docs/guide/edge/rewrites.md +2 -3
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/pages-routing/markdown.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -1
- package/skills/void/docs/guide/platform/development/local.md +1 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +2 -2
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/project-collaboration.md +1 -1
- package/skills/void/docs/guide/server-routing.md +2 -3
- package/skills/void/docs/guide/ssr.md +4 -10
- package/skills/void/docs/guide/websockets.md +1 -1
- package/skills/void/docs/integrations/cloudflare.md +2 -0
- package/skills/void/docs/reference/api.md +1 -1
- package/skills/void/docs/reference/cli.md +34 -13
- package/skills/void/docs/reference/config.md +12 -1
- package/skills/void/docs/reference/resource-inference.md +1 -1
- package/dist/client-DAAivdid.mjs +0 -2
- package/dist/collect-DAUItMDS.mjs +0 -2
- package/dist/config-DDIFxQYx.mjs +0 -2
- package/dist/config-uP7ZDtVZ.mjs +0 -21
- package/dist/deploy-DAH2-m_-.mjs +0 -2
- package/dist/discover-BBzDZe_o.mjs +0 -2
- package/dist/dist-D7-nEOXi.mjs +0 -2
- package/dist/gen-B87rlalt.mjs +0 -2
- package/dist/help-B403BLBB.mjs +0 -2
- package/dist/login-BwiopVdg.mjs +0 -2
- package/dist/migrate-BXY3B3m7.mjs +0 -2
- package/dist/prepare-D4CkM3_v.mjs +0 -2
- package/dist/provision-CNgEBkVA.mjs +0 -3
- package/dist/resolve-project-BTotl8Nn.mjs +0 -2
- package/dist/validate-DqJ33oHj.mjs +0 -2
package/dist/cli/cli.mjs
CHANGED
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as join } from "../dist-
|
|
2
|
+
import { a as join } from "../dist-BVqXeR_h.mjs";
|
|
3
3
|
import { j as log } from "../dist-Dn6nn2IU.mjs";
|
|
4
|
-
import { n as getPackageDir } from "../agents-
|
|
4
|
+
import { n as getPackageDir } from "../agents-B_pX_HmQ.mjs";
|
|
5
5
|
import { t as formatCloudflareUserMessage } from "../cloudflare-user-output-Q-k0QoNQ.mjs";
|
|
6
|
-
import { a as operatorGroups, i as printVoidHeader, n as printGlobalHelp, o as parseOperatorArgs, r as printHelpPage, t as getHelpPath } from "../help-
|
|
7
|
-
import { r as OperatorClientError } from "../operator-client-
|
|
6
|
+
import { a as operatorGroups, i as printVoidHeader, n as printGlobalHelp, o as parseOperatorArgs, r as printHelpPage, t as getHelpPath } from "../help-DC7gdz7L.mjs";
|
|
7
|
+
import { r as OperatorClientError } from "../operator-client-DUwumHpQ.mjs";
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { PLATFORM_LOGIN_KINDS, parsePlatformLoginId } from "@void/platform";
|
|
10
10
|
import { parseArgs } from "node:util";
|
|
11
|
+
//#region src/cli/account-args.ts
|
|
12
|
+
const accountSubcommands = [
|
|
13
|
+
{
|
|
14
|
+
name: "login",
|
|
15
|
+
description: "Log in with an enabled platform login method"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "link",
|
|
19
|
+
description: "Link another login method to your account"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "logout",
|
|
23
|
+
description: "Log out and remove credentials"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "whoami",
|
|
27
|
+
description: "Show the logged-in username"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "token",
|
|
31
|
+
description: "Copy auth token to clipboard"
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
function parseAccountArgs(args) {
|
|
35
|
+
const [subcommand, extra, trailing] = args;
|
|
36
|
+
if (subcommand === "link") {
|
|
37
|
+
if (trailing || extra !== void 0 && !/^[a-z][a-z0-9_-]{0,63}$/.test(extra)) throw new Error("account: Usage: void account link [connection-id].");
|
|
38
|
+
return {
|
|
39
|
+
subcommand,
|
|
40
|
+
...extra ? { connectionId: extra } : {}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (!subcommand || ![
|
|
44
|
+
"login",
|
|
45
|
+
"logout",
|
|
46
|
+
"whoami",
|
|
47
|
+
"token"
|
|
48
|
+
].includes(subcommand)) throw new Error("account: Usage: void account <login|link|logout|whoami|token>.");
|
|
49
|
+
if (extra) throw new Error(`account: Unexpected argument '${extra}'.`);
|
|
50
|
+
return { subcommand };
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
11
53
|
//#region src/cli/args.ts
|
|
12
54
|
function parseDeployArgs(args) {
|
|
13
55
|
let parsed;
|
|
@@ -23,7 +65,8 @@ function parseDeployArgs(args) {
|
|
|
23
65
|
platform: { type: "string" },
|
|
24
66
|
backend: { type: "string" },
|
|
25
67
|
provision: { type: "boolean" },
|
|
26
|
-
"require-email": { type: "boolean" }
|
|
68
|
+
"require-email": { type: "boolean" },
|
|
69
|
+
atomic: { type: "boolean" }
|
|
27
70
|
},
|
|
28
71
|
allowPositionals: true,
|
|
29
72
|
strict: true,
|
|
@@ -65,6 +108,7 @@ function parseDeployArgs(args) {
|
|
|
65
108
|
const provision = parsed.values.provision === true ? true : void 0;
|
|
66
109
|
if (provision && backend !== "cloudflare" && platform !== "cloudflare") throw new Error("deploy: --provision requires --platform cloudflare.");
|
|
67
110
|
const requireEmail = parsed.values["require-email"] === true ? true : void 0;
|
|
111
|
+
const atomic = parsed.values.atomic === true ? true : void 0;
|
|
68
112
|
if (requireEmail && backend !== "cloudflare" && platform !== "cloudflare") throw new Error("deploy: --require-email requires --platform cloudflare.");
|
|
69
113
|
if (backend === "cloudflare" || platform === "cloudflare") {
|
|
70
114
|
if (projectSlug !== void 0) throw new Error("deploy: --project is not supported with --platform cloudflare — this platform deploys to your own Cloudflare account and no Void project is involved.");
|
|
@@ -78,7 +122,8 @@ function parseDeployArgs(args) {
|
|
|
78
122
|
platform,
|
|
79
123
|
backend,
|
|
80
124
|
provision,
|
|
81
|
-
requireEmail
|
|
125
|
+
requireEmail,
|
|
126
|
+
atomic
|
|
82
127
|
};
|
|
83
128
|
}
|
|
84
129
|
//#endregion
|
|
@@ -86,42 +131,45 @@ function parseDeployArgs(args) {
|
|
|
86
131
|
const authSubcommands = [
|
|
87
132
|
{
|
|
88
133
|
name: "login",
|
|
89
|
-
description: "
|
|
134
|
+
description: "Sign in to the selected deployment destination"
|
|
90
135
|
},
|
|
91
136
|
{
|
|
92
|
-
name: "
|
|
93
|
-
description: "
|
|
137
|
+
name: "status",
|
|
138
|
+
description: "Show the selected destination’s signed-in identity"
|
|
94
139
|
},
|
|
95
140
|
{
|
|
96
141
|
name: "logout",
|
|
97
|
-
description: "
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "whoami",
|
|
101
|
-
description: "Show the logged-in username"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "token",
|
|
105
|
-
description: "Copy auth token to clipboard"
|
|
142
|
+
description: "Sign out of the selected deployment destination"
|
|
106
143
|
}
|
|
107
144
|
];
|
|
108
145
|
function parseAuthArgs(args) {
|
|
109
|
-
const [subcommand,
|
|
110
|
-
if (subcommand === "link") {
|
|
111
|
-
if (trailing || extra !== void 0 && !/^[a-z][a-z0-9_-]{0,63}$/.test(extra)) throw new Error("auth: Usage: void auth link [connection-id].");
|
|
112
|
-
return {
|
|
113
|
-
subcommand,
|
|
114
|
-
...extra ? { connectionId: extra } : {}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
146
|
+
const [subcommand, ...rest] = args;
|
|
117
147
|
if (!subcommand || ![
|
|
118
148
|
"login",
|
|
119
149
|
"logout",
|
|
150
|
+
"status",
|
|
120
151
|
"whoami",
|
|
152
|
+
"link",
|
|
121
153
|
"token"
|
|
122
|
-
].includes(subcommand)) throw new Error("auth: Usage: void auth <login|
|
|
123
|
-
|
|
124
|
-
|
|
154
|
+
].includes(subcommand)) throw new Error("auth: Usage: void auth <login|status|logout> [--platform cloudflare|void].");
|
|
155
|
+
let platform;
|
|
156
|
+
let connectionId;
|
|
157
|
+
for (let index = 0; index < rest.length; index++) {
|
|
158
|
+
const value = rest[index];
|
|
159
|
+
if (value === "--platform") {
|
|
160
|
+
const target = rest[++index];
|
|
161
|
+
if (target !== "cloudflare" && target !== "void") throw new Error("auth: --platform must be cloudflare or void.");
|
|
162
|
+
if (platform) throw new Error("auth: --platform may be supplied only once.");
|
|
163
|
+
platform = target;
|
|
164
|
+
} else if (subcommand === "link" && !connectionId && /^[a-z][a-z0-9_-]{0,63}$/.test(value)) connectionId = value;
|
|
165
|
+
else throw new Error(`auth: Unexpected argument '${value}'.`);
|
|
166
|
+
}
|
|
167
|
+
if ((subcommand === "link" || subcommand === "token") && platform === "cloudflare") throw new Error(`auth: ${subcommand} belongs to a Void account. Use \`void account ${subcommand}\`.`);
|
|
168
|
+
return {
|
|
169
|
+
subcommand,
|
|
170
|
+
...platform ? { platform } : {},
|
|
171
|
+
...connectionId ? { connectionId } : {}
|
|
172
|
+
};
|
|
125
173
|
}
|
|
126
174
|
//#endregion
|
|
127
175
|
//#region src/cli/build-args.ts
|
|
@@ -1972,7 +2020,7 @@ if (helpPath) {
|
|
|
1972
2020
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1973
2021
|
process.exit(1);
|
|
1974
2022
|
}
|
|
1975
|
-
import("../deploy-
|
|
2023
|
+
import("../deploy-BH0grP4y.mjs").then(({ runDeploy }) => {
|
|
1976
2024
|
runDeploy(root, {
|
|
1977
2025
|
projectSlug: deployArgs.projectSlug,
|
|
1978
2026
|
dir: deployArgs.dir,
|
|
@@ -1982,7 +2030,8 @@ if (helpPath) {
|
|
|
1982
2030
|
platform: deployArgs.platform,
|
|
1983
2031
|
backend: deployArgs.backend,
|
|
1984
2032
|
provision: deployArgs.provision,
|
|
1985
|
-
requireEmail: deployArgs.requireEmail
|
|
2033
|
+
requireEmail: deployArgs.requireEmail,
|
|
2034
|
+
atomic: deployArgs.atomic
|
|
1986
2035
|
}).catch((err) => {
|
|
1987
2036
|
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
1988
2037
|
process.exit(1);
|
|
@@ -1990,24 +2039,25 @@ if (helpPath) {
|
|
|
1990
2039
|
});
|
|
1991
2040
|
} else if (command === "connect") (async () => {
|
|
1992
2041
|
const parsed = parseConnectArgs(args.slice(1));
|
|
1993
|
-
const { runConnectCommand } = await import("../connect-
|
|
2042
|
+
const { runConnectCommand } = await import("../connect-4Ph5Y0QE.mjs");
|
|
1994
2043
|
await runConnectCommand(process.cwd(), parsed);
|
|
1995
2044
|
})().catch((err) => {
|
|
1996
2045
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1997
2046
|
process.exit(1);
|
|
1998
2047
|
});
|
|
1999
|
-
else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-
|
|
2000
|
-
else if (command === "
|
|
2001
|
-
else if (command === "
|
|
2002
|
-
else if (command === "
|
|
2003
|
-
else if (command === "
|
|
2004
|
-
else if (command === "
|
|
2005
|
-
else if (command === "
|
|
2006
|
-
else if (command === "
|
|
2007
|
-
else if (command === "
|
|
2008
|
-
else if (command === "
|
|
2009
|
-
else if (command === "
|
|
2010
|
-
else if (command === "
|
|
2048
|
+
else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-D4ZcMUSf.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed)));
|
|
2049
|
+
else if (command === "account") runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-DGt9cpRe.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed)));
|
|
2050
|
+
else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-C8OqhqPt.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed)));
|
|
2051
|
+
else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-BjNxR1XF.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed)));
|
|
2052
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-B44I8J_W.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
2053
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-DN9sSNiV.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
2054
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-Dmhvb2oU.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
2055
|
+
else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-BRKOG2RG.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed)));
|
|
2056
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DzJRn-qz.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
2057
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-Csi-tMbT.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
2058
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Vnv2f65C.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
2059
|
+
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-BED3_9JD.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
|
|
2060
|
+
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-Dpt0jd-x.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
|
|
2011
2061
|
else if (command === "prepare") {
|
|
2012
2062
|
const root = process.cwd();
|
|
2013
2063
|
let prepareArgs;
|
|
@@ -2017,7 +2067,7 @@ else if (command === "prepare") {
|
|
|
2017
2067
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2018
2068
|
process.exit(1);
|
|
2019
2069
|
}
|
|
2020
|
-
import("../prepare-
|
|
2070
|
+
import("../prepare-DyZ-Yok5.mjs").then(({ runPrepareCommand }) => {
|
|
2021
2071
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
2022
2072
|
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
2023
2073
|
process.exit(1);
|
|
@@ -2025,7 +2075,7 @@ else if (command === "prepare") {
|
|
|
2025
2075
|
});
|
|
2026
2076
|
} else if (command === "init") {
|
|
2027
2077
|
const root = process.cwd();
|
|
2028
|
-
import("../init-
|
|
2078
|
+
import("../init-CRGDXzVC.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
2029
2079
|
let initArgs;
|
|
2030
2080
|
try {
|
|
2031
2081
|
initArgs = parseInitArgs(args.slice(1));
|
|
@@ -2043,7 +2093,7 @@ else if (command === "prepare") {
|
|
|
2043
2093
|
log.error("migrate: This command takes no arguments.");
|
|
2044
2094
|
process.exit(1);
|
|
2045
2095
|
}
|
|
2046
|
-
import("../migrate-
|
|
2096
|
+
import("../migrate-TsHGBnDA.mjs").then(({ runMigrateCommand }) => {
|
|
2047
2097
|
runMigrateCommand(process.cwd()).catch((err) => {
|
|
2048
2098
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2049
2099
|
process.exit(1);
|
|
@@ -2076,8 +2126,13 @@ else if (command === "prepare") {
|
|
|
2076
2126
|
},
|
|
2077
2127
|
{
|
|
2078
2128
|
name: "auth",
|
|
2079
|
-
hint: "login |
|
|
2080
|
-
description: "
|
|
2129
|
+
hint: "login | status | logout",
|
|
2130
|
+
description: "Sign in to this project’s Cloudflare or Void destination"
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
name: "account",
|
|
2134
|
+
hint: "login | link | logout | whoami | token",
|
|
2135
|
+
description: "Manage your Void platform account"
|
|
2081
2136
|
},
|
|
2082
2137
|
{
|
|
2083
2138
|
name: "platform",
|
|
@@ -2152,39 +2207,40 @@ else if (command === "prepare") {
|
|
|
2152
2207
|
const root = process.cwd();
|
|
2153
2208
|
switch (cmd) {
|
|
2154
2209
|
case "connect": {
|
|
2155
|
-
const { runConnectCommand } = await import("../connect-
|
|
2210
|
+
const { runConnectCommand } = await import("../connect-4Ph5Y0QE.mjs");
|
|
2156
2211
|
await runConnectCommand(root, parseConnectArgs([]));
|
|
2157
2212
|
return;
|
|
2158
2213
|
}
|
|
2159
2214
|
case "init": {
|
|
2160
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
2215
|
+
const { runInitCommand, parseInitArgs } = await import("../init-CRGDXzVC.mjs");
|
|
2161
2216
|
await runInitCommand(root, parseInitArgs([]));
|
|
2162
2217
|
return;
|
|
2163
2218
|
}
|
|
2164
2219
|
case "migrate": {
|
|
2165
|
-
const { runMigrateCommand } = await import("../migrate-
|
|
2220
|
+
const { runMigrateCommand } = await import("../migrate-TsHGBnDA.mjs");
|
|
2166
2221
|
await runMigrateCommand(root);
|
|
2167
2222
|
return;
|
|
2168
2223
|
}
|
|
2169
2224
|
case "deploy": {
|
|
2170
|
-
const { runDeploy } = await import("../deploy-
|
|
2225
|
+
const { runDeploy } = await import("../deploy-BH0grP4y.mjs");
|
|
2171
2226
|
await runDeploy(root);
|
|
2172
2227
|
return;
|
|
2173
2228
|
}
|
|
2174
|
-
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-
|
|
2175
|
-
case "
|
|
2176
|
-
case "
|
|
2177
|
-
case "
|
|
2178
|
-
case "
|
|
2179
|
-
case "
|
|
2180
|
-
case "
|
|
2181
|
-
case "
|
|
2182
|
-
case "
|
|
2183
|
-
case "
|
|
2184
|
-
case "
|
|
2185
|
-
case "
|
|
2229
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-router-D4ZcMUSf.mjs").then(({ runAuthRouter }) => runAuthRouter(r, p)));
|
|
2230
|
+
case "account": return runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (r, p) => import("../account-cmd-DGt9cpRe.mjs").then(({ runAccountCommand }) => runAccountCommand(r, p)));
|
|
2231
|
+
case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-C8OqhqPt.mjs").then(({ runPlatformCommand }) => runPlatformCommand(r, p)));
|
|
2232
|
+
case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-BjNxR1XF.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(r, p)));
|
|
2233
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-B44I8J_W.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
2234
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-DN9sSNiV.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
2235
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-Dmhvb2oU.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
2236
|
+
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-BED3_9JD.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
|
|
2237
|
+
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-Dpt0jd-x.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
|
|
2238
|
+
case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-BRKOG2RG.mjs").then(({ runEmailCommand }) => runEmailCommand(r, p)));
|
|
2239
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-DzJRn-qz.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
2240
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-Csi-tMbT.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
2241
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Vnv2f65C.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
2186
2242
|
case "prepare": {
|
|
2187
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
2243
|
+
const { runPrepareCommand } = await import("../prepare-DyZ-Yok5.mjs");
|
|
2188
2244
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
2189
2245
|
return;
|
|
2190
2246
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as findEnvFile } from "../env-types-
|
|
1
|
+
import { t as findEnvFile } from "../env-types-C2_bIk_b.mjs";
|
|
2
2
|
import { writeSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
@@ -169,7 +169,7 @@ function emitResult(result) {
|
|
|
169
169
|
* facts. The import stays isolated because env.ts is arbitrary project code.
|
|
170
170
|
*/
|
|
171
171
|
async function runFactsChild(root) {
|
|
172
|
-
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-
|
|
172
|
+
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-BXge7uyK.mjs");
|
|
173
173
|
try {
|
|
174
174
|
emitResult({
|
|
175
175
|
kind: "ok",
|
|
@@ -194,7 +194,7 @@ async function runFactsChild(root) {
|
|
|
194
194
|
* fault → fail closed as a values-free schema error.
|
|
195
195
|
*/
|
|
196
196
|
async function runValidateEmittedChild(root) {
|
|
197
|
-
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-
|
|
197
|
+
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-BXge7uyK.mjs");
|
|
198
198
|
const emitted = readEmittedWorkerVars(root);
|
|
199
199
|
if (!emitted.ok) {
|
|
200
200
|
emitResult({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as join } from "./dist-
|
|
1
|
+
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
3
|
-
import { a as getApiUrl } from "./auth-
|
|
4
|
-
import { s as normalizePlatformApiUrl } from "./platform-registry-
|
|
5
|
-
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-
|
|
6
|
-
import { n as getPackageDir } from "./agents-
|
|
3
|
+
import { a as getApiUrl } from "./auth-DLNN0D3Z.mjs";
|
|
4
|
+
import { s as normalizePlatformApiUrl } from "./platform-registry-QBa4DK32.mjs";
|
|
5
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-P0iZnu0q.mjs";
|
|
6
|
+
import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
8
|
import { stripVTControlCharacters } from "node:util";
|
|
9
9
|
//#region src/cli/platform-errors.ts
|
|
@@ -237,6 +237,29 @@ var PlatformClient = class {
|
|
|
237
237
|
if (!res.ok) await throwPlatformApiError("Failed to list projects", res);
|
|
238
238
|
return res.json();
|
|
239
239
|
}
|
|
240
|
+
/** A lightweight project list for interactive linking; older platforms use the full list. */
|
|
241
|
+
async listProjectChoices() {
|
|
242
|
+
const res = await this.request(`${this.baseUrl}/projects/choices`, { headers: { ...this.authHeaders } });
|
|
243
|
+
if (res.status === 404) return this.listProjects();
|
|
244
|
+
if (!res.ok) await throwPlatformApiError("Failed to list project choices", res);
|
|
245
|
+
return res.json();
|
|
246
|
+
}
|
|
247
|
+
/** Resolve one known project without loading account-wide deployment and traffic summaries. */
|
|
248
|
+
async getProject(projectId) {
|
|
249
|
+
const res = await this.request(`${this.baseUrl}/projects/${encodeURIComponent(projectId)}`, { headers: { ...this.authHeaders } });
|
|
250
|
+
if (res.status === 404) return null;
|
|
251
|
+
if (!res.ok) await throwPlatformApiError("Failed to get project", res);
|
|
252
|
+
return res.json();
|
|
253
|
+
}
|
|
254
|
+
/** New platforms resolve a slug directly; older installations retain the list fallback. */
|
|
255
|
+
async findProjectBySlug(slug) {
|
|
256
|
+
const url = new URL(`${this.baseUrl}/projects/resolve`);
|
|
257
|
+
url.searchParams.set("slug", slug);
|
|
258
|
+
const res = await this.request(url.toString(), { headers: { ...this.authHeaders } });
|
|
259
|
+
if (res.status === 404) return (await this.listProjects()).find((project) => project.slug === slug) ?? null;
|
|
260
|
+
if (!res.ok) await throwPlatformApiError("Failed to resolve project", res);
|
|
261
|
+
return (await res.json()).project;
|
|
262
|
+
}
|
|
240
263
|
async listProjectTokens(projectId) {
|
|
241
264
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/tokens`, { headers: { ...this.authHeaders } });
|
|
242
265
|
if (!res.ok) await throwPlatformApiError("Failed to list project tokens", res, "owner");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as log } from "./dist-Dn6nn2IU.mjs";
|
|
2
|
-
import { o as resolveWranglerArgv } from "./preset-
|
|
2
|
+
import { o as resolveWranglerArgv } from "./preset-UHj9ARyP.mjs";
|
|
3
3
|
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
//#region src/cli/cloudflare-auth.ts
|
|
5
5
|
var CloudflareAuthenticationError = class extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as basename } from "./dist-
|
|
2
|
-
import { v as readRootWranglerConfig } from "./wrangler-
|
|
1
|
+
import { t as basename } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { v as readRootWranglerConfig } from "./wrangler-BymcxrRa.mjs";
|
|
3
3
|
import { j as log } from "./dist-Dn6nn2IU.mjs";
|
|
4
|
-
import { a as createBundledCloudflareAuthRunner, i as cloudflareCredentialOverrides, o as ensureCloudflareAuthentication, s as parseCloudflareAuthSession } from "./cloudflare-auth-
|
|
4
|
+
import { a as createBundledCloudflareAuthRunner, i as cloudflareCredentialOverrides, o as ensureCloudflareAuthentication, s as parseCloudflareAuthSession } from "./cloudflare-auth-B9jPCkV2.mjs";
|
|
5
5
|
//#region src/cli/cloudflare-cmd.ts
|
|
6
6
|
async function runCloudflareCommand(root, args) {
|
|
7
7
|
const runWrangler = createBundledCloudflareAuthRunner(root);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as join, t as basename } from "./dist-
|
|
2
|
-
import { i as LATEST_KNOWN_COMPAT_DATE, k as writeProvisionedWranglerConfig, v as readRootWranglerConfig } from "./wrangler-
|
|
1
|
+
import { a as join, t as basename } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { i as LATEST_KNOWN_COMPAT_DATE, k as writeProvisionedWranglerConfig, v as readRootWranglerConfig } from "./wrangler-BymcxrRa.mjs";
|
|
3
3
|
import { I as select, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
|
|
4
|
-
import { a as createBundledCloudflareAuthRunner, o as ensureCloudflareAuthentication } from "./cloudflare-auth-
|
|
4
|
+
import { a as createBundledCloudflareAuthRunner, o as ensureCloudflareAuthentication } from "./cloudflare-auth-B9jPCkV2.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,2 +1,2 @@
|
|
|
1
|
-
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-
|
|
1
|
+
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-sMZXpk_S.mjs";
|
|
2
2
|
export { activateCloudflareExistingVersion, applyCloudflareD1Migrations, changeCloudflareDomain, deleteCloudflareSecret, executeCloudflareD1Sql, listCloudflareDomains, listCloudflareSecrets, putCloudflareSecret, readCloudflareD1Migrations, readCloudflareWorkerStatus, resolveCloudflareD1Context, resolveCloudflareOperationContext, syncCloudflareSecrets, tailCloudflareWorker };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as join } from "./dist-
|
|
2
|
-
import { A as writeWranglerPublishedTrafficSnapshot, L as materializeCloudflareConfig, O as updateWranglerCustomDomain, R as persistCloudflareConfig, S as readWranglerPublishedTrafficSnapshot, b as readWranglerCustomDomains } from "./wrangler-
|
|
1
|
+
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { A as writeWranglerPublishedTrafficSnapshot, L as materializeCloudflareConfig, O as updateWranglerCustomDomain, R as persistCloudflareConfig, S as readWranglerPublishedTrafficSnapshot, b as readWranglerCustomDomains } from "./wrangler-BymcxrRa.mjs";
|
|
3
3
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
4
|
-
import { o as resolveWranglerArgv } from "./preset-
|
|
5
|
-
import {
|
|
4
|
+
import { o as resolveWranglerArgv } from "./preset-UHj9ARyP.mjs";
|
|
5
|
+
import { _ as resolvePinnedApiBaseUrl, g as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware } from "./provision-BhreDAOS.mjs";
|
|
6
6
|
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { spawnSync } from "node:child_process";
|
|
@@ -92,6 +92,12 @@ type AiConfig = {
|
|
|
92
92
|
type EmailConfig = {
|
|
93
93
|
from?: string;
|
|
94
94
|
};
|
|
95
|
+
/** Deployment choices owned by Void rather than passed to the Worker config. */
|
|
96
|
+
type DeployConfig = {
|
|
97
|
+
cloudflare?: {
|
|
98
|
+
mode?: "staged" | "atomic";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
95
101
|
/** Cloudflare Worker configuration passed through to the native deploy artifact. */
|
|
96
102
|
type CloudflareField<T> = T & Record<string, unknown>;
|
|
97
103
|
type CloudflareConfig = Record<string, unknown> & {
|
|
@@ -177,6 +183,7 @@ type VoidConfig = {
|
|
|
177
183
|
remote?: boolean;
|
|
178
184
|
worker?: WranglerConfig;
|
|
179
185
|
cloudflare?: CloudflareConfig;
|
|
186
|
+
deploy?: DeployConfig;
|
|
180
187
|
database?: "pg" | "mysql";
|
|
181
188
|
ai?: AiConfig;
|
|
182
189
|
email?: EmailConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as validateSourceDir, c as loadVoidConfig } from "./project-paths-
|
|
1
|
+
import { a as validateSourceDir, c as loadVoidConfig } from "./project-paths-GgcMozYz.mjs";
|
|
2
2
|
import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-CJlNS3kT.mjs";
|
|
3
3
|
import { a as parseAddress, n as MimeError } from "./mime-D5Nmdzf7.mjs";
|
|
4
4
|
//#region src/config.ts
|
|
@@ -437,6 +437,17 @@ function validateConfigObject(config) {
|
|
|
437
437
|
if (obj.cloudflare !== void 0) {
|
|
438
438
|
if (typeof obj.cloudflare !== "object" || obj.cloudflare === null || Array.isArray(obj.cloudflare)) throw new Error(`config: "cloudflare" in ${CONFIG_FILE} must be an object.`);
|
|
439
439
|
}
|
|
440
|
+
if (obj.deploy !== void 0) {
|
|
441
|
+
if (typeof obj.deploy !== "object" || obj.deploy === null || Array.isArray(obj.deploy)) throw new Error(`config: "deploy" in ${CONFIG_FILE} must be an object.`);
|
|
442
|
+
const deploy = obj.deploy;
|
|
443
|
+
for (const key of Object.keys(deploy)) if (key !== "cloudflare") throw new Error(`config: Unknown key 'deploy.${key}' in ${CONFIG_FILE}. Valid: cloudflare.`);
|
|
444
|
+
if (deploy.cloudflare !== void 0) {
|
|
445
|
+
if (typeof deploy.cloudflare !== "object" || deploy.cloudflare === null || Array.isArray(deploy.cloudflare)) throw new Error(`config: "deploy.cloudflare" in ${CONFIG_FILE} must be an object.`);
|
|
446
|
+
const cloudflareDeploy = deploy.cloudflare;
|
|
447
|
+
for (const key of Object.keys(cloudflareDeploy)) if (key !== "mode") throw new Error(`config: Unknown key 'deploy.cloudflare.${key}' in ${CONFIG_FILE}. Valid: mode.`);
|
|
448
|
+
if (cloudflareDeploy.mode !== void 0 && cloudflareDeploy.mode !== "staged" && cloudflareDeploy.mode !== "atomic") throw new Error(`config: "deploy.cloudflare.mode" in ${CONFIG_FILE} must be "staged" or "atomic".`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
440
451
|
if (obj.database !== void 0) {
|
|
441
452
|
if (typeof obj.database !== "string" || !VALID_DATABASE_VALUES.has(obj.database)) throw new Error(`config: "database" in ${CONFIG_FILE} must be "pg" or "mysql".`);
|
|
442
453
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as join, l as relative } from "./dist-
|
|
2
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
3
|
-
import { n as schemaSpecifier, t as discoverSchema } from "./discover-
|
|
1
|
+
import { a as join, l as relative } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
3
|
+
import { n as schemaSpecifier, t as discoverSchema } from "./discover-BcPPiF1o.mjs";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
//#region src/drizzle/config.ts
|
|
6
6
|
/**
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { parseSync } from "vite";
|
|
5
|
+
//#region src/auth/config.ts
|
|
6
|
+
function isVoidAuthConfigSource(code, filename) {
|
|
7
|
+
if (!code.includes("void/auth")) return false;
|
|
8
|
+
let program;
|
|
9
|
+
try {
|
|
10
|
+
program = parseSync(filename, code).program;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return (program.body ?? []).some((node) => {
|
|
15
|
+
if (node.type !== "ImportDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "ExportAllDeclaration") return false;
|
|
16
|
+
return node.source?.value === "void/auth";
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function findVoidAuthConfig(root, paths = readProjectPaths(root)) {
|
|
20
|
+
for (const absPath of paths.authConfigCandidates) {
|
|
21
|
+
if (!existsSync(absPath)) continue;
|
|
22
|
+
if (isVoidAuthConfigSource(readFileSync(absPath, "utf-8"), absPath)) return absPath;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
async function loadVoidAuthConfig(configPath) {
|
|
27
|
+
if (!configPath) return;
|
|
28
|
+
const mod = await import(pathToFileURL(configPath).href);
|
|
29
|
+
return mod.default ?? mod.auth ?? mod.config;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { loadVoidAuthConfig as n, findVoidAuthConfig as t };
|
package/dist/config-entry.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VoidConfig } from "./config-
|
|
1
|
+
import { t as VoidConfig } from "./config-CF69HgXc.mjs";
|
|
2
2
|
//#region src/config-entry.d.ts
|
|
3
3
|
/** Define a typed Void project configuration without loading the Vite plugin. */
|
|
4
4
|
export declare function defineConfig<const T extends VoidConfig>(config: T): T;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { m as readConfig, u as getDatabaseDialect } from "./config-
|
|
1
|
+
import { m as readConfig, u as getDatabaseDialect } from "./config-CafTW6Cz.mjs";
|
|
2
2
|
export { getDatabaseDialect, readConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as join } from "./dist-
|
|
2
|
-
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-
|
|
3
|
-
import { g as validateConfig } from "./config-
|
|
1
|
+
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-GgcMozYz.mjs";
|
|
3
|
+
import { g as validateConfig } from "./config-CafTW6Cz.mjs";
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { parse } from "acorn";
|
|
6
6
|
//#region src/config-write.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { f as readPlatformToken } from "./auth-
|
|
2
|
-
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-
|
|
3
|
-
import { i as readDeploymentPlatform, l as writeDeploymentPlatform, u as writePlatformSelection } from "./project-
|
|
1
|
+
import { f as readPlatformToken } from "./auth-DLNN0D3Z.mjs";
|
|
2
|
+
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-QBa4DK32.mjs";
|
|
3
|
+
import { i as readDeploymentPlatform, l as writeDeploymentPlatform, u as writePlatformSelection } from "./project-C0Fqu05O.mjs";
|
|
4
4
|
import { I as select, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
|
|
5
|
-
import { i as isExpiredTokenError, n as PlatformClient } from "./client-
|
|
6
|
-
import { t as promptForLoginToken } from "./login-
|
|
7
|
-
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-
|
|
8
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
5
|
+
import { i as isExpiredTokenError, n as PlatformClient } from "./client-QTl6ko_D.mjs";
|
|
6
|
+
import { t as promptForLoginToken } from "./login-BQyISZuW.mjs";
|
|
7
|
+
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
|
|
8
|
+
import { t as connectCloudflare } from "./cloudflare-connect-CCUozPOe.mjs";
|
|
9
9
|
//#region src/cli/connect.ts
|
|
10
10
|
async function selectVoidPlatform(interactive) {
|
|
11
11
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|
|
@@ -74,7 +74,7 @@ async function runConnectCommand(root, args, interactive = Boolean(process.stdin
|
|
|
74
74
|
const selected = Boolean(envUrl && normalizePlatformApiUrl(envUrl) !== discovery.apiUrl || process.env.VOID_TOKEN && !envUrl) ? false : writePlatformSelection(root, discovery);
|
|
75
75
|
log.success(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
76
76
|
if (!selected) log.info("Saved the connection. The current project link or environment still selects its existing destination.");
|
|
77
|
-
if (args.noLogin) log.info("Connection saved without login. Run `void
|
|
77
|
+
if (args.noLogin) log.info("Connection saved without login. Run `void account login` in a project using this platform when ready.");
|
|
78
78
|
else if (selected) log.info("Run `void project link` to select a project, then `void deploy`.");
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProjectWithSlugRetry } from "./create-project-
|
|
1
|
+
import { t as createProjectWithSlugRetry } from "./create-project-DBfFSZKY.mjs";
|
|
2
2
|
export { createProjectWithSlugRetry };
|