void 0.7.10 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-cmd-wVm1oBDB.mjs → auth-cmd-bS88H4Lb.mjs} +3 -3
- package/dist/{better-auth-shared-CjnJZFC0.mjs → better-auth-shared-D2JaoCs4.mjs} +1 -1
- package/dist/{cache-DQ0nyYqX.mjs → cache-DUDCNty6.mjs} +4 -4
- package/dist/{cancel-deploy-Ues45U-R.mjs → cancel-deploy-DOuSbPwX.mjs} +4 -4
- package/dist/cli/cli.mjs +26 -26
- package/dist/{client-BollDL7Y.mjs → client-C_DYiXeu.mjs} +80 -76
- package/dist/{config-DqkeX_Fa.mjs → config-CeRQg3Lz.mjs} +1 -1
- package/dist/{config-BzM9Dy7T.mjs → config-DyUSwbeX.mjs} +1 -1
- package/dist/{create-project-C6c0tsda.mjs → create-project-hvFe6rbI.mjs} +4 -4
- package/dist/{db-DotnZ8gC.mjs → db-j-XdTjQD.mjs} +27 -27
- package/dist/{delete-DGBvVhNi.mjs → delete-XyM_VD9o.mjs} +4 -4
- package/dist/{deploy-BoivjIGQ.mjs → deploy-CPAEgVQm.mjs} +23 -23
- package/dist/{domain-BvO6J5pb.mjs → domain-Dvj7u8tr.mjs} +4 -4
- package/dist/{drizzle-C-NRqGhx.mjs → drizzle-Cx7cVwrE.mjs} +1 -1
- package/dist/{env-D5rCrXsJ.mjs → env-Bjl0rzuf.mjs} +6 -6
- package/dist/{env-types-DknSA4SO.mjs → env-types-BSQghXbx.mjs} +1 -1
- package/dist/{env-validation-Bc_aiBUm.mjs → env-validation-Buy5pe3u.mjs} +3 -3
- package/dist/{gen-CpeKIqlM.mjs → gen-DU8NIdrH.mjs} +7 -7
- package/dist/{headers-C7Yf6_CN.mjs → headers-CuVHn6Kl.mjs} +2 -2
- package/dist/index.mjs +29 -29
- package/dist/{init-XYRQUhxJ.mjs → init-iIiQWzyB.mjs} +15 -15
- package/dist/{link-CTw4KItw.mjs → link-DdXqlUiJ.mjs} +5 -5
- package/dist/{list-DEUWWBKk.mjs → list-9Bxa5Odn.mjs} +4 -4
- package/dist/{login-wdS4k9e-.mjs → login-C_MfDjhu.mjs} +3 -3
- package/dist/{logs-BoZ4ZWnl.mjs → logs-DjqCpEER.mjs} +4 -4
- package/dist/{mcp-CVKEl-Sc.mjs → mcp-vA0880_K.mjs} +2 -2
- package/dist/{node-DHVCtkgt.mjs → node-DDxMsKPm.mjs} +3 -3
- package/dist/{output-BwlcIYSR.mjs → output-D3g5otMC.mjs} +1 -1
- package/dist/pages/index.mjs +3 -3
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/{plugin-inference-CXUuq0aC.mjs → plugin-inference-BexV6LL3.mjs} +1 -1
- package/dist/{prepare-CKzO06-Z.mjs → prepare-BEkH89oX.mjs} +10 -10
- package/dist/{preset-BhnZpb7t.mjs → preset-CYQh93UF.mjs} +1 -1
- package/dist/{project-cmd-i9Kvz4KZ.mjs → project-cmd-CeXO06hG.mjs} +10 -10
- package/dist/{rollback-CGsGd4ti.mjs → rollback-C8OSMxmq.mjs} +4 -4
- package/dist/{runner-BUPRnMFN.mjs → runner-BaWsik5f.mjs} +1 -1
- package/dist/{runner-pg-BI6f6Ncm.mjs → runner-pg-Bd_172vF.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/remote/index.mjs +1 -1
- package/dist/{scan-CWfLxtOe.mjs → scan-CKpylFj9.mjs} +1 -1
- package/dist/{scan-B8iEm8xn.mjs → scan-CkK1Hzpa.mjs} +3 -3
- package/dist/{secret-BeBmBxwf.mjs → secret-NDvlqAN2.mjs} +4 -4
- package/dist/{skills-CbuYOthf.mjs → skills-SAG0WyVn.mjs} +1 -1
- package/dist/{subcommand-prompt-BMS1TNG5.mjs → subcommand-prompt-q9T06dpg.mjs} +2 -2
- package/dist/{validate-CaMavMxu.mjs → validate-DW3ViKTA.mjs} +1 -1
- package/package.json +2 -2
- /package/dist/{cf-access-Dee5cXxL.mjs → cf-access-BW8K93Fm.mjs} +0 -0
- /package/dist/{collect-CjeZgz5D.mjs → collect-HqAuilH6.mjs} +0 -0
- /package/dist/{discover-B7FkXBLB.mjs → discover-CKGQpis8.mjs} +0 -0
- /package/dist/{dist-Dayj3gCK.mjs → dist-D2L3_KTK.mjs} +0 -0
- /package/dist/{dist-DUyXJLkq.mjs → dist-q8b2Mjgb.mjs} +0 -0
- /package/dist/{dotenv-zdFCCgFU.mjs → dotenv-HQNhRalS.mjs} +0 -0
- /package/dist/{log-DXdqnmhF.mjs → log-7ChR5Fbc.mjs} +0 -0
- /package/dist/{magic-string.es-D6g9UnIy.mjs → magic-string.es-DS_lmuBe.mjs} +0 -0
- /package/dist/{project-TqORyHn8.mjs → project-DhB4A8_g.mjs} +0 -0
- /package/dist/{project-tsconfig-DfkESbDL.mjs → project-tsconfig-Bfy55qvs.mjs} +0 -0
- /package/dist/{providers-B3aMxWzP.mjs → providers-BlFNPYen.mjs} +0 -0
- /package/dist/{route-types-Cnqj_8a7.mjs → route-types-qVL-v-CB.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { c as
|
|
3
|
-
import { n as runLoginCommand } from "./login-
|
|
1
|
+
import { c as getToken, d as removeToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
|
|
2
|
+
import { c as R } from "./dist-D2L3_KTK.mjs";
|
|
3
|
+
import { n as runLoginCommand } from "./login-C_MfDjhu.mjs";
|
|
4
4
|
import { execSync } from "node:child_process";
|
|
5
5
|
//#region src/cli/auth-cmd.ts
|
|
6
6
|
async function runAuthCommand(root, args) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-
|
|
1
|
+
import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-BlFNPYen.mjs";
|
|
2
2
|
import { authContext } from "./runtime/auth.mjs";
|
|
3
3
|
import { randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import { betterAuth } from "better-auth";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as dim, n as cliTitle, r as createSpinner } from "./output-
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i as dim, n as cliTitle, r as createSpinner } from "./output-D3g5otMC.mjs";
|
|
2
|
+
import { c as getToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
|
|
3
|
+
import { c as R, g as ge, y as ye } from "./dist-D2L3_KTK.mjs";
|
|
4
|
+
import { r as readProjectConfig } from "./project-DhB4A8_g.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
6
6
|
//#region src/cli/cache.ts
|
|
7
7
|
async function runPurgeCacheCommand(root, projectSlug) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as cliTitle } from "./output-
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as cliTitle } from "./output-D3g5otMC.mjs";
|
|
2
|
+
import { c as getToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
|
|
3
|
+
import { c as R, g as ge, v as ue, x as q, y as ye } from "./dist-D2L3_KTK.mjs";
|
|
4
|
+
import { r as readProjectConfig } from "./project-DhB4A8_g.mjs";
|
|
5
5
|
//#region src/cli/cancel-deploy.ts
|
|
6
6
|
const ACTIVE_STATUSES = new Set([
|
|
7
7
|
"pending",
|
package/dist/cli/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as join } from "../pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
3
|
-
import { c as sectionTitle, o as helpLine, s as import_picocolors, t as categoryTitle } from "../output-
|
|
4
|
-
import { c as R, u as Se, y as ye } from "../dist-
|
|
3
|
+
import { c as sectionTitle, o as helpLine, s as import_picocolors, t as categoryTitle } from "../output-D3g5otMC.mjs";
|
|
4
|
+
import { c as R, u as Se, y as ye } from "../dist-D2L3_KTK.mjs";
|
|
5
5
|
import { r as getPackageDir } from "../agents-DqkFfc2c.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
@@ -1474,7 +1474,7 @@ async function runSubcommandGroup(command, subcommands, parse, run) {
|
|
|
1474
1474
|
const sub = args[1];
|
|
1475
1475
|
try {
|
|
1476
1476
|
if ((!sub || sub.startsWith("-")) && process.stdin.isTTY) {
|
|
1477
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
1477
|
+
const { promptSubcommand } = await import("../subcommand-prompt-q9T06dpg.mjs");
|
|
1478
1478
|
const result = await promptSubcommand(command, subcommands);
|
|
1479
1479
|
if (!result) process.exit(0);
|
|
1480
1480
|
await run(root, parse(buildArgs(result, args.slice(1))));
|
|
@@ -1503,7 +1503,7 @@ else if (command === "deploy") {
|
|
|
1503
1503
|
R.error(err instanceof Error ? err.message : String(err));
|
|
1504
1504
|
process.exit(1);
|
|
1505
1505
|
}
|
|
1506
|
-
import("../deploy-
|
|
1506
|
+
import("../deploy-CPAEgVQm.mjs").then((n) => n.t).then(({ runDeploy }) => {
|
|
1507
1507
|
runDeploy(root, {
|
|
1508
1508
|
projectSlug: deployArgs.projectSlug,
|
|
1509
1509
|
dir: deployArgs.dir,
|
|
@@ -1515,13 +1515,13 @@ else if (command === "deploy") {
|
|
|
1515
1515
|
process.exit(1);
|
|
1516
1516
|
});
|
|
1517
1517
|
});
|
|
1518
|
-
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-
|
|
1519
|
-
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-
|
|
1520
|
-
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-
|
|
1521
|
-
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-
|
|
1522
|
-
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-
|
|
1523
|
-
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-
|
|
1524
|
-
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-
|
|
1518
|
+
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-bS88H4Lb.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
|
|
1519
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-CeXO06hG.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
1520
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-NDvlqAN2.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
1521
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-Dvj7u8tr.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
1522
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-j-XdTjQD.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
1523
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-Bjl0rzuf.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
1524
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-DU8NIdrH.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
1525
1525
|
else if (command === "prepare") {
|
|
1526
1526
|
const root = process.cwd();
|
|
1527
1527
|
let prepareArgs;
|
|
@@ -1531,7 +1531,7 @@ else if (command === "prepare") {
|
|
|
1531
1531
|
R.error(err instanceof Error ? err.message : String(err));
|
|
1532
1532
|
process.exit(1);
|
|
1533
1533
|
}
|
|
1534
|
-
import("../prepare-
|
|
1534
|
+
import("../prepare-BEkH89oX.mjs").then(({ runPrepareCommand }) => {
|
|
1535
1535
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
1536
1536
|
R.error(err.message ?? err);
|
|
1537
1537
|
process.exit(1);
|
|
@@ -1539,7 +1539,7 @@ else if (command === "prepare") {
|
|
|
1539
1539
|
});
|
|
1540
1540
|
} else if (command === "init") {
|
|
1541
1541
|
const root = process.cwd();
|
|
1542
|
-
import("../init-
|
|
1542
|
+
import("../init-iIiQWzyB.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
1543
1543
|
let initArgs;
|
|
1544
1544
|
try {
|
|
1545
1545
|
initArgs = parseInitArgs(args.slice(1));
|
|
@@ -1552,7 +1552,7 @@ else if (command === "prepare") {
|
|
|
1552
1552
|
process.exit(1);
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
|
-
} else if (command === "mcp") import("../mcp-
|
|
1555
|
+
} else if (command === "mcp") import("../mcp-vA0880_K.mjs").then(({ runMcp }) => {
|
|
1556
1556
|
runMcp();
|
|
1557
1557
|
});
|
|
1558
1558
|
else if (command === "-v" || command === "--version") {
|
|
@@ -1621,36 +1621,36 @@ else if (command === "-v" || command === "--version") {
|
|
|
1621
1621
|
];
|
|
1622
1622
|
(async () => {
|
|
1623
1623
|
printVoidHeader();
|
|
1624
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
1624
|
+
const { promptSubcommand } = await import("../subcommand-prompt-q9T06dpg.mjs");
|
|
1625
1625
|
const result = await promptSubcommand("", topLevelCommands);
|
|
1626
1626
|
if (!result) process.exit(0);
|
|
1627
1627
|
const cmd = result.subcommand;
|
|
1628
1628
|
const root = process.cwd();
|
|
1629
1629
|
switch (cmd) {
|
|
1630
1630
|
case "init": {
|
|
1631
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
1631
|
+
const { runInitCommand, parseInitArgs } = await import("../init-iIiQWzyB.mjs");
|
|
1632
1632
|
await runInitCommand(root, parseInitArgs([]));
|
|
1633
1633
|
return;
|
|
1634
1634
|
}
|
|
1635
1635
|
case "deploy": {
|
|
1636
|
-
const { runDeploy } = await import("../deploy-
|
|
1636
|
+
const { runDeploy } = await import("../deploy-CPAEgVQm.mjs").then((n) => n.t);
|
|
1637
1637
|
await runDeploy(root);
|
|
1638
1638
|
return;
|
|
1639
1639
|
}
|
|
1640
1640
|
case "mcp": {
|
|
1641
|
-
const { runMcp } = await import("../mcp-
|
|
1641
|
+
const { runMcp } = await import("../mcp-vA0880_K.mjs");
|
|
1642
1642
|
runMcp();
|
|
1643
1643
|
return;
|
|
1644
1644
|
}
|
|
1645
|
-
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-
|
|
1646
|
-
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-
|
|
1647
|
-
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-
|
|
1648
|
-
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-
|
|
1649
|
-
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-
|
|
1650
|
-
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-
|
|
1651
|
-
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-
|
|
1645
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-bS88H4Lb.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
|
|
1646
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-CeXO06hG.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
1647
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-NDvlqAN2.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
1648
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-Dvj7u8tr.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
1649
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-j-XdTjQD.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
1650
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-Bjl0rzuf.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
1651
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-DU8NIdrH.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
1652
1652
|
case "prepare": {
|
|
1653
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
1653
|
+
const { runPrepareCommand } = await import("../prepare-BEkH89oX.mjs");
|
|
1654
1654
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
@@ -1,14 +1,86 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
3
|
-
import { s as import_picocolors } from "./output-
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
3
|
+
import { s as import_picocolors } from "./output-D3g5otMC.mjs";
|
|
4
|
+
import { t as cfAccessHeaders } from "./cf-access-BW8K93Fm.mjs";
|
|
5
|
+
import { t as isVoidInternalStaging } from "./project-DhB4A8_g.mjs";
|
|
6
6
|
import { r as getPackageDir } from "./agents-DqkFfc2c.mjs";
|
|
7
7
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { createHash, randomBytes } from "node:crypto";
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { Entry } from "@napi-rs/keyring";
|
|
11
11
|
import { spawnSync } from "node:child_process";
|
|
12
|
+
//#region src/cli/cf-access.ts
|
|
13
|
+
const probedHosts = /* @__PURE__ */ new Set();
|
|
14
|
+
/**
|
|
15
|
+
* If the CLI is about to talk to a Cloudflare-Access-gated staging host,
|
|
16
|
+
* probe the locally-installed `cloudflared` binary for a cached user JWT
|
|
17
|
+
* and export it as `CF_ACCESS_TOKEN`. On interactive shells with no cached
|
|
18
|
+
* token, open a browser login flow to populate the cache, then re-read it.
|
|
19
|
+
*
|
|
20
|
+
* Cached per-host so that an early non-gated call (e.g. prod) does not
|
|
21
|
+
* permanently disable the probe for a later gated call (e.g. staging) in
|
|
22
|
+
* the same process. Noop when:
|
|
23
|
+
* - a service-token pair is already set (CI path)
|
|
24
|
+
* - `CF_ACCESS_TOKEN` is already set (manual override or prior probe)
|
|
25
|
+
* - the target host is not gated
|
|
26
|
+
* - `cloudflared` is not installed
|
|
27
|
+
*/
|
|
28
|
+
function ensureCloudflaredToken(apiUrl) {
|
|
29
|
+
if (process.env.CF_ACCESS_CLIENT_ID && process.env.CF_ACCESS_CLIENT_SECRET) return;
|
|
30
|
+
if (process.env.CF_ACCESS_TOKEN) return;
|
|
31
|
+
if (!isGatedHost(apiUrl)) return;
|
|
32
|
+
const host = new URL(apiUrl).hostname;
|
|
33
|
+
if (probedHosts.has(host)) return;
|
|
34
|
+
probedHosts.add(host);
|
|
35
|
+
let token = runCloudflared([
|
|
36
|
+
"access",
|
|
37
|
+
"token",
|
|
38
|
+
`-app=${apiUrl}`
|
|
39
|
+
]);
|
|
40
|
+
if (!token && process.stdin.isTTY && process.stdout.isTTY) {
|
|
41
|
+
runCloudflared([
|
|
42
|
+
"access",
|
|
43
|
+
"login",
|
|
44
|
+
apiUrl
|
|
45
|
+
], {
|
|
46
|
+
inherit: true,
|
|
47
|
+
timeoutMs: 12e4
|
|
48
|
+
});
|
|
49
|
+
token = runCloudflared([
|
|
50
|
+
"access",
|
|
51
|
+
"token",
|
|
52
|
+
`-app=${apiUrl}`
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
if (token) process.env.CF_ACCESS_TOKEN = token;
|
|
56
|
+
}
|
|
57
|
+
function runCloudflared(args, opts) {
|
|
58
|
+
try {
|
|
59
|
+
const result = spawnSync("cloudflared", args, {
|
|
60
|
+
encoding: "utf-8",
|
|
61
|
+
stdio: opts?.inherit ? "inherit" : [
|
|
62
|
+
"ignore",
|
|
63
|
+
"pipe",
|
|
64
|
+
"pipe"
|
|
65
|
+
],
|
|
66
|
+
timeout: opts?.timeoutMs ?? 5e3
|
|
67
|
+
});
|
|
68
|
+
if (result.error || result.status !== 0) return null;
|
|
69
|
+
const out = (result.stdout ?? "").trim();
|
|
70
|
+
return out.length > 0 ? out : null;
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function isGatedHost(apiUrl) {
|
|
76
|
+
try {
|
|
77
|
+
const host = new URL(apiUrl).hostname;
|
|
78
|
+
return host.endsWith(".staging.void.cloud") || host.endsWith(".staging.void.app");
|
|
79
|
+
} catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
12
84
|
//#region src/cli/auth.ts
|
|
13
85
|
const CONFIG_DIR = join(homedir(), ".void");
|
|
14
86
|
const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
@@ -114,9 +186,13 @@ function createCodeChallenge(verifier) {
|
|
|
114
186
|
}
|
|
115
187
|
async function exchangeLoginCode(apiUrl, code, state, codeVerifier) {
|
|
116
188
|
const base = apiUrl.endsWith("/") ? apiUrl : `${apiUrl}/`;
|
|
189
|
+
ensureCloudflaredToken(apiUrl);
|
|
117
190
|
const res = await fetch(new URL("auth/cli/token", base), {
|
|
118
191
|
method: "POST",
|
|
119
|
-
headers: {
|
|
192
|
+
headers: {
|
|
193
|
+
"Content-Type": "application/json",
|
|
194
|
+
...cfAccessHeaders(process.env)
|
|
195
|
+
},
|
|
120
196
|
body: JSON.stringify({
|
|
121
197
|
code,
|
|
122
198
|
state,
|
|
@@ -258,78 +334,6 @@ async function runLogin(root = process.cwd(), provider = "github", onUrl) {
|
|
|
258
334
|
});
|
|
259
335
|
}
|
|
260
336
|
//#endregion
|
|
261
|
-
//#region src/cli/cf-access.ts
|
|
262
|
-
const probedHosts = /* @__PURE__ */ new Set();
|
|
263
|
-
/**
|
|
264
|
-
* If the CLI is about to talk to a Cloudflare-Access-gated staging host,
|
|
265
|
-
* probe the locally-installed `cloudflared` binary for a cached user JWT
|
|
266
|
-
* and export it as `CF_ACCESS_TOKEN`. On interactive shells with no cached
|
|
267
|
-
* token, open a browser login flow to populate the cache, then re-read it.
|
|
268
|
-
*
|
|
269
|
-
* Cached per-host so that an early non-gated call (e.g. prod) does not
|
|
270
|
-
* permanently disable the probe for a later gated call (e.g. staging) in
|
|
271
|
-
* the same process. Noop when:
|
|
272
|
-
* - a service-token pair is already set (CI path)
|
|
273
|
-
* - `CF_ACCESS_TOKEN` is already set (manual override or prior probe)
|
|
274
|
-
* - the target host is not gated
|
|
275
|
-
* - `cloudflared` is not installed
|
|
276
|
-
*/
|
|
277
|
-
function ensureCloudflaredToken(apiUrl) {
|
|
278
|
-
if (process.env.CF_ACCESS_CLIENT_ID && process.env.CF_ACCESS_CLIENT_SECRET) return;
|
|
279
|
-
if (process.env.CF_ACCESS_TOKEN) return;
|
|
280
|
-
if (!isGatedHost(apiUrl)) return;
|
|
281
|
-
const host = new URL(apiUrl).hostname;
|
|
282
|
-
if (probedHosts.has(host)) return;
|
|
283
|
-
probedHosts.add(host);
|
|
284
|
-
let token = runCloudflared([
|
|
285
|
-
"access",
|
|
286
|
-
"token",
|
|
287
|
-
`-app=${apiUrl}`
|
|
288
|
-
]);
|
|
289
|
-
if (!token && process.stdin.isTTY && process.stdout.isTTY) {
|
|
290
|
-
runCloudflared([
|
|
291
|
-
"access",
|
|
292
|
-
"login",
|
|
293
|
-
apiUrl
|
|
294
|
-
], {
|
|
295
|
-
inherit: true,
|
|
296
|
-
timeoutMs: 12e4
|
|
297
|
-
});
|
|
298
|
-
token = runCloudflared([
|
|
299
|
-
"access",
|
|
300
|
-
"token",
|
|
301
|
-
`-app=${apiUrl}`
|
|
302
|
-
]);
|
|
303
|
-
}
|
|
304
|
-
if (token) process.env.CF_ACCESS_TOKEN = token;
|
|
305
|
-
}
|
|
306
|
-
function runCloudflared(args, opts) {
|
|
307
|
-
try {
|
|
308
|
-
const result = spawnSync("cloudflared", args, {
|
|
309
|
-
encoding: "utf-8",
|
|
310
|
-
stdio: opts?.inherit ? "inherit" : [
|
|
311
|
-
"ignore",
|
|
312
|
-
"pipe",
|
|
313
|
-
"pipe"
|
|
314
|
-
],
|
|
315
|
-
timeout: opts?.timeoutMs ?? 5e3
|
|
316
|
-
});
|
|
317
|
-
if (result.error || result.status !== 0) return null;
|
|
318
|
-
const out = (result.stdout ?? "").trim();
|
|
319
|
-
return out.length > 0 ? out : null;
|
|
320
|
-
} catch {
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
function isGatedHost(apiUrl) {
|
|
325
|
-
try {
|
|
326
|
-
const host = new URL(apiUrl).hostname;
|
|
327
|
-
return host.endsWith(".staging.void.cloud") || host.endsWith(".staging.void.app");
|
|
328
|
-
} catch {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
//#endregion
|
|
333
337
|
//#region src/cli/client.ts
|
|
334
338
|
var client_exports = /* @__PURE__ */ __exportAll({
|
|
335
339
|
PlatformApiError: () => PlatformApiError,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
3
|
-
import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-
|
|
3
|
+
import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-BlFNPYen.mjs";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
//#region src/config.ts
|
|
6
6
|
var config_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
3
|
-
import { r as schemaSpecifier, t as discoverSchema } from "./discover-
|
|
3
|
+
import { r as schemaSpecifier, t as discoverSchema } from "./discover-CKGQpis8.mjs";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
//#region src/drizzle/config.ts
|
|
6
6
|
var config_exports = /* @__PURE__ */ __exportAll({ writeDrizzleConfig: () => writeDrizzleConfig });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as import_picocolors } from "./output-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { s as import_picocolors } from "./output-D3g5otMC.mjs";
|
|
2
|
+
import { s as getSiteDomain, t as PlatformApiError } from "./client-C_DYiXeu.mjs";
|
|
3
|
+
import { _ as me, c as R, i as Ee, l as Re, x as q } from "./dist-D2L3_KTK.mjs";
|
|
4
|
+
import { a as writeProjectConfig } from "./project-DhB4A8_g.mjs";
|
|
5
5
|
import { n as validateProjectSlug } from "./project-slug-KRvHQEQI.mjs";
|
|
6
6
|
import { n as inferDefaultSlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
7
7
|
//#region src/cli/prompt.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { a as join, o as relative, r as extname, s as resolve } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
|
-
import { i as dim, n as cliTitle, s as import_picocolors } from "./output-
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as getDatabaseDialect, f as readConfig } from "./config-
|
|
7
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
8
|
-
import { a as writeJournal, i as stripSqlExt, r as readJournal, t as collectMigrations } from "./collect-
|
|
9
|
-
import { n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence } from "./validate-
|
|
10
|
-
import { formatTimestamp } from "./gen-
|
|
2
|
+
import { i as dim, n as cliTitle, s as import_picocolors } from "./output-D3g5otMC.mjs";
|
|
3
|
+
import { c as getToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
|
|
4
|
+
import { c as R, g as ge, y as ye } from "./dist-D2L3_KTK.mjs";
|
|
5
|
+
import { r as readProjectConfig } from "./project-DhB4A8_g.mjs";
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig } from "./config-CeRQg3Lz.mjs";
|
|
7
|
+
import { r as detectFramework } from "./plugin-inference-BexV6LL3.mjs";
|
|
8
|
+
import { a as writeJournal, i as stripSqlExt, r as readJournal, t as collectMigrations } from "./collect-HqAuilH6.mjs";
|
|
9
|
+
import { n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence } from "./validate-DW3ViKTA.mjs";
|
|
10
|
+
import { formatTimestamp } from "./gen-DU8NIdrH.mjs";
|
|
11
11
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
13
|
import { execFileSync } from "node:child_process";
|
|
@@ -94,13 +94,13 @@ async function runDbCommand(root, args) {
|
|
|
94
94
|
else await runExport(root, args, dialect);
|
|
95
95
|
}
|
|
96
96
|
async function runPush(root, dialect) {
|
|
97
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
97
|
+
const { writeDrizzleConfig } = await import("./config-DyUSwbeX.mjs").then((n) => n.t);
|
|
98
98
|
let configPath;
|
|
99
99
|
if (dialect === "postgresql") configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
|
|
100
100
|
else {
|
|
101
101
|
const { mkdirSync } = await import("node:fs");
|
|
102
102
|
const { dirname } = await import("node:path");
|
|
103
|
-
const { getMiniflareDatabasePath } = await import("./runner-
|
|
103
|
+
const { getMiniflareDatabasePath } = await import("./runner-BaWsik5f.mjs");
|
|
104
104
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
105
105
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
106
106
|
configPath = writeDrizzleConfig(root, dbPath);
|
|
@@ -117,7 +117,7 @@ async function runPush(root, dialect) {
|
|
|
117
117
|
ye("Done.");
|
|
118
118
|
}
|
|
119
119
|
async function runGenerate(root, dialect) {
|
|
120
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
120
|
+
const { writeDrizzleConfig } = await import("./config-DyUSwbeX.mjs").then((n) => n.t);
|
|
121
121
|
const configPath = dialect === "postgresql" ? writeDrizzleConfig(root, "postgresql://dummy", "postgresql") : writeDrizzleConfig(root, ":memory:");
|
|
122
122
|
try {
|
|
123
123
|
runDrizzleKit(root, [
|
|
@@ -157,7 +157,7 @@ async function runStatus(root, dialect) {
|
|
|
157
157
|
localApplied = [];
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
|
-
const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-
|
|
160
|
+
const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-BaWsik5f.mjs");
|
|
161
161
|
localApplied = await getAppliedMigrations(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
162
162
|
}
|
|
163
163
|
const localSet = new Set(localApplied.map((m) => m.name));
|
|
@@ -215,7 +215,7 @@ async function resetDatabase(root, dialect) {
|
|
|
215
215
|
});
|
|
216
216
|
return migrations.length;
|
|
217
217
|
}
|
|
218
|
-
const { getMiniflareDatabasePath, runMigrations } = await import("./runner-
|
|
218
|
+
const { getMiniflareDatabasePath, runMigrations } = await import("./runner-BaWsik5f.mjs");
|
|
219
219
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
220
220
|
rmSync(dbPath, { force: true });
|
|
221
221
|
rmSync(dbPath + "-wal", { force: true });
|
|
@@ -242,7 +242,7 @@ async function runSeed(root, file, dialect) {
|
|
|
242
242
|
ye("Done.");
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
245
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BaWsik5f.mjs");
|
|
246
246
|
const db = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
247
247
|
try {
|
|
248
248
|
db.exec(sql);
|
|
@@ -265,7 +265,7 @@ async function runExecute(root, command, file, dialect) {
|
|
|
265
265
|
ye("Done.");
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
268
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BaWsik5f.mjs");
|
|
269
269
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
270
270
|
if (!existsSync(dbPath)) {
|
|
271
271
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -362,7 +362,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
if (dialect === "postgresql") {
|
|
365
|
-
const { applyPgMigrations } = await import("./runner-pg-
|
|
365
|
+
const { applyPgMigrations } = await import("./runner-pg-Bd_172vF.mjs");
|
|
366
366
|
const applied = await withPgClient(root, async (client) => {
|
|
367
367
|
let existingRows = [];
|
|
368
368
|
try {
|
|
@@ -386,7 +386,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
386
386
|
ye("Done.");
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-
|
|
389
|
+
const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-BaWsik5f.mjs");
|
|
390
390
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
391
391
|
try {
|
|
392
392
|
const existingRows = await getAppliedMigrations(dbPath);
|
|
@@ -406,7 +406,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
406
406
|
}
|
|
407
407
|
async function runStudio(root, dialect) {
|
|
408
408
|
if (dialect === "postgresql") {
|
|
409
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
409
|
+
const { writeDrizzleConfig } = await import("./config-DyUSwbeX.mjs").then((n) => n.t);
|
|
410
410
|
const configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
|
|
411
411
|
R.info("Opening Drizzle Studio...");
|
|
412
412
|
try {
|
|
@@ -420,8 +420,8 @@ async function runStudio(root, dialect) {
|
|
|
420
420
|
}
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
424
|
-
const { getMiniflareDatabasePath } = await import("./runner-
|
|
423
|
+
const { writeDrizzleConfig } = await import("./config-DyUSwbeX.mjs").then((n) => n.t);
|
|
424
|
+
const { getMiniflareDatabasePath } = await import("./runner-BaWsik5f.mjs");
|
|
425
425
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
426
426
|
if (!existsSync(dbPath)) {
|
|
427
427
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -641,7 +641,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
641
641
|
process.exit(1);
|
|
642
642
|
}
|
|
643
643
|
else {
|
|
644
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
644
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BaWsik5f.mjs");
|
|
645
645
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
646
646
|
if (existsSync(dbPath)) try {
|
|
647
647
|
const db = await openSqliteDatabase(dbPath);
|
|
@@ -719,7 +719,7 @@ async function runExport(root, args, dialect) {
|
|
|
719
719
|
} else process.stdout.write(output);
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
722
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BaWsik5f.mjs");
|
|
723
723
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
724
724
|
if (!existsSync(dbPath)) {
|
|
725
725
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -767,7 +767,7 @@ async function runExport(root, args, dialect) {
|
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
async function runSetUrl(root) {
|
|
770
|
-
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-
|
|
770
|
+
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-CeRQg3Lz.mjs").then((n) => n.n);
|
|
771
771
|
if (getDialect(readVoidConfig(root)) !== "postgresql") {
|
|
772
772
|
R.error("db: This command is only for PostgreSQL projects. Set \"database\": \"pg\" in void.json.");
|
|
773
773
|
process.exit(1);
|
|
@@ -782,7 +782,7 @@ async function runSetUrl(root) {
|
|
|
782
782
|
R.error("No project linked. Run `void deploy` first or link a project.");
|
|
783
783
|
process.exit(1);
|
|
784
784
|
}
|
|
785
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-
|
|
785
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-D2L3_KTK.mjs").then((n) => n.p);
|
|
786
786
|
const connectionString = await promptText({
|
|
787
787
|
message: "Enter your PostgreSQL connection string:",
|
|
788
788
|
placeholder: "postgresql://user:pass@host:5432/dbname",
|
|
@@ -846,7 +846,7 @@ async function runSeedModule(root, seedPath, dialect) {
|
|
|
846
846
|
return;
|
|
847
847
|
}
|
|
848
848
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
849
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
849
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BaWsik5f.mjs");
|
|
850
850
|
const sqlite = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
851
851
|
try {
|
|
852
852
|
const options = getDrizzleSchemaOptions(schema);
|
|
@@ -866,7 +866,7 @@ async function loadSeedFunction(seedPath) {
|
|
|
866
866
|
return seed;
|
|
867
867
|
}
|
|
868
868
|
async function loadSeedSchema(root) {
|
|
869
|
-
const { discoverSchema } = await import("./discover-
|
|
869
|
+
const { discoverSchema } = await import("./discover-CKGQpis8.mjs").then((n) => n.n);
|
|
870
870
|
const location = discoverSchema(root);
|
|
871
871
|
if (!location) return {};
|
|
872
872
|
if (location.type === "file") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as cliTitle, r as createSpinner } from "./output-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as cliTitle, r as createSpinner } from "./output-D3g5otMC.mjs";
|
|
2
|
+
import { c as getToken, n as PlatformClient } from "./client-C_DYiXeu.mjs";
|
|
3
|
+
import { _ as me, c as R, g as ge, l as Re, u as Se, x as q, y as ye } from "./dist-D2L3_KTK.mjs";
|
|
4
|
+
import { i as removeProjectConfig, r as readProjectConfig } from "./project-DhB4A8_g.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
6
6
|
//#region src/cli/delete.ts
|
|
7
7
|
async function runDeleteCommand(root, slug, options) {
|