void 0.10.3 → 0.10.5
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-CblKzAdD.mjs → auth-cmd-UoCwfDQv.mjs} +2 -2
- package/dist/{build-cmd-CJQSRupz.mjs → build-cmd-CVyuBHjP.mjs} +1 -1
- package/dist/{cache-CMzjhxHh.mjs → cache-ACORQCIq.mjs} +1 -1
- package/dist/{cancel-deploy-S2N8NSv6.mjs → cancel-deploy-Gi8zmoZC.mjs} +1 -1
- package/dist/cli/cli.mjs +102 -39
- package/dist/{client-YIzxv2ZO.mjs → client-BlbnA92X.mjs} +44 -0
- package/dist/{config--wXmVOoe.mjs → config-CbJS4Krx.mjs} +3 -3
- package/dist/{create-project-pLQdzEPe.mjs → create-project-LjvkYziS.mjs} +1 -1
- package/dist/{db-hAmBumot.mjs → db-C00yjN01.mjs} +17 -14
- package/dist/{delete-CfSe3EJO.mjs → delete-CplfvTgU.mjs} +1 -1
- package/dist/{deploy-DpOdwtla.mjs → deploy-CISNL5uK.mjs} +28 -30
- package/dist/{discover-C8N1I4tK.mjs → discover-ZWuBvt22.mjs} +1 -1
- package/dist/{domain-CkowysQx.mjs → domain-B4HpcgNG.mjs} +1 -1
- package/dist/{env-CIwG2y7G.mjs → env-DNMJpeVF.mjs} +3 -3
- package/dist/{env-types-CaJaIRXU.mjs → env-types-BS8cZead.mjs} +1 -1
- package/dist/{env-validation-LH6eoyW-.mjs → env-validation-BxbtBbjh.mjs} +1 -1
- package/dist/{gen-q6McxXgE.mjs → gen-C0pV2gRQ.mjs} +2 -2
- package/dist/{github-cmd-D3L0f93X.mjs → github-cmd-CwtLD1yI.mjs} +273 -15
- package/dist/index.mjs +11 -11
- package/dist/{init-CZP69LJu.mjs → init-D58GxCtt.mjs} +7 -7
- package/dist/{link-BKLElphS.mjs → link-ZFmboqY3.mjs} +2 -2
- package/dist/{list-B7qXBBjo.mjs → list-CbNNjXTm.mjs} +1 -1
- package/dist/{login-B3l_sDwT.mjs → login-CvxxF_9z.mjs} +1 -1
- package/dist/{logs-AXm660MB.mjs → logs-BDZ9AuhM.mjs} +1 -1
- package/dist/{mcp-D2plINxM.mjs → mcp-C8BjRt_z.mjs} +1 -1
- package/dist/{plugin-inference-C3fLzFvP.mjs → plugin-inference-D04iL1mW.mjs} +1 -1
- package/dist/{prepare-DRRboRqH.mjs → prepare-DUo9q8cM.mjs} +6 -6
- package/dist/{preset-B7ZQZn0u.mjs → preset-D0My64KQ.mjs} +1 -1
- package/dist/{project-cmd-InegJruy.mjs → project-cmd-Dd1gNRdd.mjs} +8 -8
- package/dist/{project-tsconfig-BTNuNoJ0.mjs → project-tsconfig-DMBV55K2.mjs} +2 -2
- package/dist/{rollback-CHVE-DeT.mjs → rollback-DzmCCrFg.mjs} +1 -1
- package/dist/{route-types-D03ryMXz.mjs → route-types-BpSJEW20.mjs} +1 -1
- package/dist/{scan-DGEp1-1Q.mjs → scan---8wfN58.mjs} +1 -1
- package/dist/{secret-CVKwIOm3.mjs → secret-CMLYWkE-.mjs} +1 -1
- package/dist/sveltekit.mjs +1 -1
- package/package.json +2 -2
- package/skills/void/docs/reference/cli.md +37 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as getToken, g as removeToken, n as PlatformClient } from "./client-
|
|
1
|
+
import { f as getToken, g as removeToken, n as PlatformClient } from "./client-BlbnA92X.mjs";
|
|
2
2
|
import { c as R } from "./dist-abzUneor.mjs";
|
|
3
|
-
import { n as runLoginCommand } from "./login-
|
|
3
|
+
import { n as runLoginCommand } from "./login-CvxxF_9z.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,5 +1,5 @@
|
|
|
1
1
|
import { i as dim, n as cliTitle, s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
2
|
-
import { f as getToken, n as PlatformClient, t as PlatformApiError } from "./client-
|
|
2
|
+
import { f as getToken, n as PlatformClient, t as PlatformApiError } from "./client-BlbnA92X.mjs";
|
|
3
3
|
import { c as R, g as ge, y as ye } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as dim, n as cliTitle, r as createSpinner } from "./output-DeiS4oEX.mjs";
|
|
2
|
-
import { f as getToken, n as PlatformClient } from "./client-
|
|
2
|
+
import { f as getToken, n as PlatformClient } from "./client-BlbnA92X.mjs";
|
|
3
3
|
import { c as R, g as ge, y as ye } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as cliTitle } from "./output-DeiS4oEX.mjs";
|
|
2
|
-
import { f as getToken, n as PlatformClient } from "./client-
|
|
2
|
+
import { f as getToken, n as PlatformClient } from "./client-BlbnA92X.mjs";
|
|
3
3
|
import { c as R, g as ge, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
5
|
//#region src/cli/cancel-deploy.ts
|
package/dist/cli/cli.mjs
CHANGED
|
@@ -635,9 +635,18 @@ const githubSubcommands = [
|
|
|
635
635
|
arg: "[project]",
|
|
636
636
|
description: "Update an existing connection's branch, build executor, or deploy workflow"
|
|
637
637
|
},
|
|
638
|
+
{
|
|
639
|
+
name: "status",
|
|
640
|
+
arg: "[project]",
|
|
641
|
+
description: "Show a project's GitHub connection (repo, branch, executor, workflow)"
|
|
642
|
+
},
|
|
638
643
|
{
|
|
639
644
|
name: "link",
|
|
640
645
|
description: "Link your GitHub account to Void"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: "join",
|
|
649
|
+
description: "Join your organization's shared GitHub App installations"
|
|
641
650
|
}
|
|
642
651
|
];
|
|
643
652
|
function parseGithubArgs(args) {
|
|
@@ -654,6 +663,10 @@ function parseGithubArgs(args) {
|
|
|
654
663
|
if (rest.length > 0) throw new Error(`github: Unexpected argument '${rest[0]}'.`);
|
|
655
664
|
return { subcommand };
|
|
656
665
|
}
|
|
666
|
+
if (subcommand === "join") {
|
|
667
|
+
if (rest.length > 0) throw new Error(`github: Unexpected argument '${rest[0]}'.`);
|
|
668
|
+
return { subcommand };
|
|
669
|
+
}
|
|
657
670
|
if (subcommand === "connect") {
|
|
658
671
|
let projectName = "";
|
|
659
672
|
let installationId;
|
|
@@ -750,7 +763,26 @@ function parseGithubArgs(args) {
|
|
|
750
763
|
workflowPath
|
|
751
764
|
};
|
|
752
765
|
}
|
|
753
|
-
|
|
766
|
+
if (subcommand === "status") {
|
|
767
|
+
let projectName = "";
|
|
768
|
+
for (let i = 0; i < rest.length; i++) {
|
|
769
|
+
const arg = rest[i];
|
|
770
|
+
if (arg === "--project") {
|
|
771
|
+
if (i + 1 >= rest.length) throw new Error("github: --project requires a value.");
|
|
772
|
+
const value = rest[++i];
|
|
773
|
+
if (value.trim() === "") throw new Error("github: --project requires a value.");
|
|
774
|
+
if (projectName) throw new Error(`github: Unexpected argument '${value}'.`);
|
|
775
|
+
projectName = value;
|
|
776
|
+
} else if (arg.startsWith("-")) throw new Error(`github: Unexpected argument '${arg}'.`);
|
|
777
|
+
else if (projectName) throw new Error(`github: Unexpected argument '${arg}'.`);
|
|
778
|
+
else projectName = arg;
|
|
779
|
+
}
|
|
780
|
+
return {
|
|
781
|
+
subcommand,
|
|
782
|
+
projectName
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
throw new Error("github: Usage: void github <install|installations|connect|update|status|link|join>.");
|
|
754
786
|
}
|
|
755
787
|
//#endregion
|
|
756
788
|
//#region src/cli/ascii.ts
|
|
@@ -1064,15 +1096,24 @@ const HELP_TREE = {
|
|
|
1064
1096
|
command: "update [project]",
|
|
1065
1097
|
description: "Update an existing connection's branch, build executor, or deploy workflow"
|
|
1066
1098
|
},
|
|
1099
|
+
{
|
|
1100
|
+
command: "status [project]",
|
|
1101
|
+
description: "Show a project's GitHub connection (repo, branch, executor, workflow)"
|
|
1102
|
+
},
|
|
1067
1103
|
{
|
|
1068
1104
|
command: "link",
|
|
1069
1105
|
description: "Link your GitHub account to Void"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
command: "join",
|
|
1109
|
+
description: "Join your organization's shared GitHub App installations"
|
|
1070
1110
|
}
|
|
1071
1111
|
],
|
|
1072
1112
|
children: {
|
|
1073
1113
|
install: basicSubcommand("Open the GitHub App install page in your browser.", "void github install"),
|
|
1074
1114
|
installations: basicSubcommand("List your GitHub App installations.", "void github installations"),
|
|
1075
1115
|
link: basicSubcommand("Link your GitHub account to Void.", "void github link"),
|
|
1116
|
+
join: basicSubcommand("Join your organization's shared GitHub App installations.", "void github join"),
|
|
1076
1117
|
connect: {
|
|
1077
1118
|
summary: "Connect a repository to a project for automatic deploys.",
|
|
1078
1119
|
usage: ["void github connect [project] [options]"],
|
|
@@ -1095,20 +1136,27 @@ const HELP_TREE = {
|
|
|
1095
1136
|
},
|
|
1096
1137
|
{
|
|
1097
1138
|
command: "--executor <type>",
|
|
1098
|
-
description: "Build executor: container (default) | github_actions"
|
|
1139
|
+
description: "Build executor: container (default) | github_actions; prompted interactively when omitted"
|
|
1099
1140
|
},
|
|
1100
1141
|
{
|
|
1101
1142
|
command: "--workflow <path>",
|
|
1102
|
-
description: "Authorized deploy workflow file (default .github/workflows/void-deploy.yml)"
|
|
1143
|
+
description: "Authorized deploy workflow file (default .github/workflows/void-deploy.yml); prompted interactively when using github_actions"
|
|
1103
1144
|
}
|
|
1104
1145
|
],
|
|
1105
|
-
examples: [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1146
|
+
examples: [
|
|
1147
|
+
{
|
|
1148
|
+
command: "void github connect [project]",
|
|
1149
|
+
description: "Connect a repository to a project"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
command: "void github connect my-app --installation 42 --repo owner/repo --branch main",
|
|
1153
|
+
description: "Non-interactive connect (all flags explicit)"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
command: "void github connect my-app --repo owner/repo --branch main --executor github_actions",
|
|
1157
|
+
description: "Non-interactive connect using the GitHub Actions executor"
|
|
1158
|
+
}
|
|
1159
|
+
]
|
|
1112
1160
|
},
|
|
1113
1161
|
update: {
|
|
1114
1162
|
summary: "Update an existing connection's branch, build executor, or deploy workflow.",
|
|
@@ -1124,11 +1172,11 @@ const HELP_TREE = {
|
|
|
1124
1172
|
},
|
|
1125
1173
|
{
|
|
1126
1174
|
command: "--executor <type>",
|
|
1127
|
-
description: "New build executor: container | github_actions"
|
|
1175
|
+
description: "New build executor: container | github_actions; prompted interactively when omitted"
|
|
1128
1176
|
},
|
|
1129
1177
|
{
|
|
1130
1178
|
command: "--workflow <path>",
|
|
1131
|
-
description: "New authorized deploy workflow file
|
|
1179
|
+
description: "New authorized deploy workflow file under .github/workflows/; prompted interactively when using github_actions"
|
|
1132
1180
|
}
|
|
1133
1181
|
],
|
|
1134
1182
|
examples: [{
|
|
@@ -1138,6 +1186,21 @@ const HELP_TREE = {
|
|
|
1138
1186
|
command: "void github update my-app --branch release",
|
|
1139
1187
|
description: "Change the deploy branch"
|
|
1140
1188
|
}]
|
|
1189
|
+
},
|
|
1190
|
+
status: {
|
|
1191
|
+
summary: "Show a project's GitHub connection settings.",
|
|
1192
|
+
usage: ["void github status [project] [options]"],
|
|
1193
|
+
options: [{
|
|
1194
|
+
command: "--project <name>",
|
|
1195
|
+
description: "Project name (alias for positional)"
|
|
1196
|
+
}],
|
|
1197
|
+
examples: [{
|
|
1198
|
+
command: "void github status",
|
|
1199
|
+
description: "Show the linked project's connection"
|
|
1200
|
+
}, {
|
|
1201
|
+
command: "void github status my-app",
|
|
1202
|
+
description: "Show a specific project connection"
|
|
1203
|
+
}]
|
|
1141
1204
|
}
|
|
1142
1205
|
}
|
|
1143
1206
|
},
|
|
@@ -1887,7 +1950,7 @@ else if (command === "deploy") {
|
|
|
1887
1950
|
R.error(err instanceof Error ? err.message : String(err));
|
|
1888
1951
|
process.exit(1);
|
|
1889
1952
|
}
|
|
1890
|
-
import("../deploy-
|
|
1953
|
+
import("../deploy-CISNL5uK.mjs").then((n) => n.t).then(({ runDeploy }) => {
|
|
1891
1954
|
runDeploy(root, {
|
|
1892
1955
|
projectSlug: deployArgs.projectSlug,
|
|
1893
1956
|
dir: deployArgs.dir,
|
|
@@ -1899,15 +1962,15 @@ else if (command === "deploy") {
|
|
|
1899
1962
|
process.exit(1);
|
|
1900
1963
|
});
|
|
1901
1964
|
});
|
|
1902
|
-
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-
|
|
1903
|
-
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-
|
|
1904
|
-
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-
|
|
1905
|
-
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-
|
|
1906
|
-
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-
|
|
1907
|
-
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-
|
|
1908
|
-
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-
|
|
1909
|
-
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-
|
|
1910
|
-
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-
|
|
1965
|
+
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-UoCwfDQv.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
|
|
1966
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-Dd1gNRdd.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
1967
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-CMLYWkE-.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
1968
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-B4HpcgNG.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
1969
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-C00yjN01.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
1970
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-DNMJpeVF.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
1971
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-C0pV2gRQ.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
1972
|
+
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-CwtLD1yI.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
|
|
1973
|
+
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-CVyuBHjP.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
|
|
1911
1974
|
else if (command === "prepare") {
|
|
1912
1975
|
const root = process.cwd();
|
|
1913
1976
|
let prepareArgs;
|
|
@@ -1917,7 +1980,7 @@ else if (command === "prepare") {
|
|
|
1917
1980
|
R.error(err instanceof Error ? err.message : String(err));
|
|
1918
1981
|
process.exit(1);
|
|
1919
1982
|
}
|
|
1920
|
-
import("../prepare-
|
|
1983
|
+
import("../prepare-DUo9q8cM.mjs").then(({ runPrepareCommand }) => {
|
|
1921
1984
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
1922
1985
|
R.error(err.message ?? err);
|
|
1923
1986
|
process.exit(1);
|
|
@@ -1925,7 +1988,7 @@ else if (command === "prepare") {
|
|
|
1925
1988
|
});
|
|
1926
1989
|
} else if (command === "init") {
|
|
1927
1990
|
const root = process.cwd();
|
|
1928
|
-
import("../init-
|
|
1991
|
+
import("../init-D58GxCtt.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
1929
1992
|
let initArgs;
|
|
1930
1993
|
try {
|
|
1931
1994
|
initArgs = parseInitArgs(args.slice(1));
|
|
@@ -1938,7 +2001,7 @@ else if (command === "prepare") {
|
|
|
1938
2001
|
process.exit(1);
|
|
1939
2002
|
});
|
|
1940
2003
|
});
|
|
1941
|
-
} else if (command === "mcp") import("../mcp-
|
|
2004
|
+
} else if (command === "mcp") import("../mcp-C8BjRt_z.mjs").then(({ runMcp }) => {
|
|
1942
2005
|
runMcp();
|
|
1943
2006
|
});
|
|
1944
2007
|
else if (command === "-v" || command === "--version") {
|
|
@@ -1979,7 +2042,7 @@ else if (command === "-v" || command === "--version") {
|
|
|
1979
2042
|
},
|
|
1980
2043
|
{
|
|
1981
2044
|
name: "github",
|
|
1982
|
-
hint: "install | installations | connect | update | link",
|
|
2045
|
+
hint: "install | installations | connect | update | status | link | join",
|
|
1983
2046
|
description: "Connect a GitHub repository for automatic deploys"
|
|
1984
2047
|
},
|
|
1985
2048
|
{
|
|
@@ -2024,31 +2087,31 @@ else if (command === "-v" || command === "--version") {
|
|
|
2024
2087
|
const root = process.cwd();
|
|
2025
2088
|
switch (cmd) {
|
|
2026
2089
|
case "init": {
|
|
2027
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
2090
|
+
const { runInitCommand, parseInitArgs } = await import("../init-D58GxCtt.mjs");
|
|
2028
2091
|
await runInitCommand(root, parseInitArgs([]));
|
|
2029
2092
|
return;
|
|
2030
2093
|
}
|
|
2031
2094
|
case "deploy": {
|
|
2032
|
-
const { runDeploy } = await import("../deploy-
|
|
2095
|
+
const { runDeploy } = await import("../deploy-CISNL5uK.mjs").then((n) => n.t);
|
|
2033
2096
|
await runDeploy(root);
|
|
2034
2097
|
return;
|
|
2035
2098
|
}
|
|
2036
2099
|
case "mcp": {
|
|
2037
|
-
const { runMcp } = await import("../mcp-
|
|
2100
|
+
const { runMcp } = await import("../mcp-C8BjRt_z.mjs");
|
|
2038
2101
|
runMcp();
|
|
2039
2102
|
return;
|
|
2040
2103
|
}
|
|
2041
|
-
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-
|
|
2042
|
-
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-
|
|
2043
|
-
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-
|
|
2044
|
-
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-
|
|
2045
|
-
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-
|
|
2046
|
-
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-
|
|
2047
|
-
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-
|
|
2048
|
-
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-
|
|
2049
|
-
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-
|
|
2104
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-UoCwfDQv.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
|
|
2105
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-Dd1gNRdd.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
2106
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-CMLYWkE-.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
2107
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-B4HpcgNG.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
2108
|
+
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-CwtLD1yI.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
|
|
2109
|
+
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-CVyuBHjP.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
|
|
2110
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-C00yjN01.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
2111
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-DNMJpeVF.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
2112
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-C0pV2gRQ.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
2050
2113
|
case "prepare": {
|
|
2051
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
2114
|
+
const { runPrepareCommand } = await import("../prepare-DUo9q8cM.mjs");
|
|
2052
2115
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
2053
2116
|
return;
|
|
2054
2117
|
}
|
|
@@ -873,6 +873,25 @@ var PlatformClient = class {
|
|
|
873
873
|
if (!res.ok) await throwPlatformApiError("Failed to connect GitHub repository", res);
|
|
874
874
|
return res.json();
|
|
875
875
|
}
|
|
876
|
+
/**
|
|
877
|
+
* Start the per-repo connect-authorization round-trip used by a non-owner org
|
|
878
|
+
* member (Task 7 platform contract). The callback redirects back to `redirect`
|
|
879
|
+
* with either `?connect_grant=<signed>` (proof of per-repo access) or
|
|
880
|
+
* `?error=repo_not_accessible`. Mirrors {@link getGithubLinkUrl} but carries
|
|
881
|
+
* the installation + repo the grant is scoped to.
|
|
882
|
+
*/
|
|
883
|
+
async getGithubConnectAuthorizeUrl(redirect, codeChallenge, installationId, repoFullName) {
|
|
884
|
+
const params = new URLSearchParams({
|
|
885
|
+
redirect,
|
|
886
|
+
code_challenge: codeChallenge,
|
|
887
|
+
code_challenge_method: "S256",
|
|
888
|
+
installationId,
|
|
889
|
+
repoFullName
|
|
890
|
+
});
|
|
891
|
+
const res = await fetch(`${this.baseUrl}/github/connect-authorize-url?${params}`, { headers: { ...this.authHeaders } });
|
|
892
|
+
if (!res.ok) await throwPlatformApiError("Failed to start GitHub connect authorization", res);
|
|
893
|
+
return res.json();
|
|
894
|
+
}
|
|
876
895
|
async getGithubConnection(projectId) {
|
|
877
896
|
const res = await fetch(`${this.baseUrl}/projects/${projectId}/github`, { headers: { ...this.authHeaders } });
|
|
878
897
|
if (!res.ok) await throwPlatformApiError("Failed to get GitHub connection", res);
|
|
@@ -915,6 +934,31 @@ var PlatformClient = class {
|
|
|
915
934
|
if (!res.ok) await throwPlatformApiError("Failed to complete GitHub link", res);
|
|
916
935
|
return res.json();
|
|
917
936
|
}
|
|
937
|
+
async getGithubJoinUrl(redirect, codeChallenge) {
|
|
938
|
+
const params = new URLSearchParams({
|
|
939
|
+
redirect,
|
|
940
|
+
code_challenge: codeChallenge,
|
|
941
|
+
code_challenge_method: "S256"
|
|
942
|
+
});
|
|
943
|
+
const res = await fetch(`${this.baseUrl}/github/join-url?${params}`, { headers: { ...this.authHeaders } });
|
|
944
|
+
if (!res.ok) await throwPlatformApiError("Failed to start GitHub join", res);
|
|
945
|
+
return res.json();
|
|
946
|
+
}
|
|
947
|
+
async completeGithubJoin(joinCode, codeVerifier) {
|
|
948
|
+
const res = await fetch(`${this.baseUrl}/github/join/complete`, {
|
|
949
|
+
method: "POST",
|
|
950
|
+
headers: {
|
|
951
|
+
"Content-Type": "application/json",
|
|
952
|
+
...this.authHeaders
|
|
953
|
+
},
|
|
954
|
+
body: JSON.stringify({
|
|
955
|
+
join_code: joinCode,
|
|
956
|
+
code_verifier: codeVerifier
|
|
957
|
+
})
|
|
958
|
+
});
|
|
959
|
+
if (!res.ok) await throwPlatformApiError("Failed to complete GitHub join", res);
|
|
960
|
+
return res.json();
|
|
961
|
+
}
|
|
918
962
|
};
|
|
919
963
|
//#endregion
|
|
920
964
|
export { runLogin as _, isExpiredTokenError as a, createCodeChallenge as c, getSiteDomain as d, getToken as f, removeToken as g, openBrowser as h, isCliOutdatedError as i, createCodeVerifier as l, isStagingMode as m, PlatformClient as n, parsePlatformErrorBody as o, getTokenSource as p, client_exports as r, awaitBrowserCallback as s, PlatformApiError as t, getApiUrl as u, saveToken as v, ensureCloudflaredToken as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { a as join, s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
|
|
4
|
-
import { r as schemaSpecifier, t as discoverSchema } from "./discover-
|
|
4
|
+
import { r as schemaSpecifier, t as discoverSchema } from "./discover-ZWuBvt22.mjs";
|
|
5
5
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
//#region src/drizzle/config.ts
|
|
7
7
|
var config_exports = /* @__PURE__ */ __exportAll({ writeDrizzleConfig: () => writeDrizzleConfig });
|
|
@@ -21,13 +21,13 @@ function writeDrizzleConfig(root, dbPath, dialect = "sqlite") {
|
|
|
21
21
|
const config = dialect === "postgresql" ? {
|
|
22
22
|
dialect: "postgresql",
|
|
23
23
|
schema: schemaSpecifier(schema, root),
|
|
24
|
-
out: `./${relative(root, paths.migrationsDir)
|
|
24
|
+
out: `./${relative(root, paths.migrationsDir)}`,
|
|
25
25
|
migrations: { prefix: "timestamp" },
|
|
26
26
|
dbCredentials: { url: dbPath }
|
|
27
27
|
} : {
|
|
28
28
|
dialect: "sqlite",
|
|
29
29
|
schema: schemaSpecifier(schema, root),
|
|
30
|
-
out: `./${relative(root, paths.migrationsDir)
|
|
30
|
+
out: `./${relative(root, paths.migrationsDir)}`,
|
|
31
31
|
migrations: { prefix: "timestamp" },
|
|
32
32
|
dbCredentials: { url: dbPath }
|
|
33
33
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
3
|
-
import { d as getSiteDomain, t as PlatformApiError } from "./client-
|
|
3
|
+
import { d as getSiteDomain, t as PlatformApiError } from "./client-BlbnA92X.mjs";
|
|
4
4
|
import { _ as me, c as R, i as Ee, l as Re, v as ue, x as q } from "./dist-abzUneor.mjs";
|
|
5
5
|
import { a as writeProjectConfig } from "./project-CH9pdo16.mjs";
|
|
6
6
|
import { n as validateProjectSlug } from "./project-slug-rX3kTOfY.mjs";
|
|
@@ -2,15 +2,15 @@ import { a as join, c as resolve, r as extname, s as relative } from "./pathe.M-
|
|
|
2
2
|
import { i as dim, n as cliTitle, s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
|
|
4
4
|
import { t as cfAccessHeaders } from "./cf-access-DKDsgwOU.mjs";
|
|
5
|
-
import { f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-
|
|
5
|
+
import { f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-BlbnA92X.mjs";
|
|
6
6
|
import { c as R, g as ge, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
7
7
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
8
8
|
import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
|
|
9
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
9
|
+
import { r as detectFramework } from "./plugin-inference-D04iL1mW.mjs";
|
|
10
10
|
import { a as writeJournal, i as stripSqlExt, r as readJournal, t as collectMigrations } from "./collect-9rO3JFNM.mjs";
|
|
11
11
|
import { n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
|
|
12
12
|
import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
|
|
13
|
-
import { formatTimestamp } from "./gen-
|
|
13
|
+
import { formatTimestamp } from "./gen-C0pV2gRQ.mjs";
|
|
14
14
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
15
15
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
16
|
import { execFileSync } from "node:child_process";
|
|
@@ -81,8 +81,10 @@ function validatePendingMigrations(migrations, appliedNames) {
|
|
|
81
81
|
validateMigrations(pending);
|
|
82
82
|
}
|
|
83
83
|
async function runDbCommand(root, args) {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
const exportToStdout = args.action === "export" && !args.output;
|
|
85
|
+
if (exportToStdout) process.stderr.write("\n");
|
|
86
|
+
else console.log();
|
|
87
|
+
ge(cliTitle("db"), exportToStdout ? { output: process.stderr } : void 0);
|
|
86
88
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
87
89
|
if (args.action === "push") await runPush(root, dialect);
|
|
88
90
|
else if (args.action === "generate") await runGenerate(root, dialect);
|
|
@@ -97,7 +99,7 @@ async function runDbCommand(root, args) {
|
|
|
97
99
|
else await runExport(root, args, dialect);
|
|
98
100
|
}
|
|
99
101
|
async function runPush(root, dialect) {
|
|
100
|
-
const { writeDrizzleConfig } = await import("./config
|
|
102
|
+
const { writeDrizzleConfig } = await import("./config-CbJS4Krx.mjs").then((n) => n.t);
|
|
101
103
|
let configPath;
|
|
102
104
|
if (dialect === "postgresql") configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
|
|
103
105
|
else {
|
|
@@ -120,7 +122,7 @@ async function runPush(root, dialect) {
|
|
|
120
122
|
ye("Done.");
|
|
121
123
|
}
|
|
122
124
|
async function runGenerate(root, dialect) {
|
|
123
|
-
const { writeDrizzleConfig } = await import("./config
|
|
125
|
+
const { writeDrizzleConfig } = await import("./config-CbJS4Krx.mjs").then((n) => n.t);
|
|
124
126
|
const configPath = dialect === "postgresql" ? writeDrizzleConfig(root, "postgresql://dummy", "postgresql") : writeDrizzleConfig(root, ":memory:");
|
|
125
127
|
try {
|
|
126
128
|
runDrizzleKit(root, [
|
|
@@ -571,7 +573,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
571
573
|
process.exit(1);
|
|
572
574
|
}
|
|
573
575
|
const dbUrl = await fetchRemoteDatabaseUrl(new PlatformClient(token, { root }), projectConfig.projectId);
|
|
574
|
-
const { writeDrizzleConfig } = await import("./config
|
|
576
|
+
const { writeDrizzleConfig } = await import("./config-CbJS4Krx.mjs").then((n) => n.t);
|
|
575
577
|
const configPath = writeDrizzleConfig(root, dbUrl, "postgresql");
|
|
576
578
|
R.info("Opening Drizzle Studio (remote)...");
|
|
577
579
|
try {
|
|
@@ -586,7 +588,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
586
588
|
return;
|
|
587
589
|
}
|
|
588
590
|
if (dialect === "postgresql") {
|
|
589
|
-
const { writeDrizzleConfig } = await import("./config
|
|
591
|
+
const { writeDrizzleConfig } = await import("./config-CbJS4Krx.mjs").then((n) => n.t);
|
|
590
592
|
const configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
|
|
591
593
|
R.info("Opening Drizzle Studio...");
|
|
592
594
|
try {
|
|
@@ -600,7 +602,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
600
602
|
}
|
|
601
603
|
return;
|
|
602
604
|
}
|
|
603
|
-
const { writeDrizzleConfig } = await import("./config
|
|
605
|
+
const { writeDrizzleConfig } = await import("./config-CbJS4Krx.mjs").then((n) => n.t);
|
|
604
606
|
const { getMiniflareDatabasePath } = await import("./runner-BQyKUqAL.mjs");
|
|
605
607
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
606
608
|
if (!existsSync(dbPath)) {
|
|
@@ -854,13 +856,14 @@ async function runRenameMigrations(root, dialect) {
|
|
|
854
856
|
ye("Done.");
|
|
855
857
|
}
|
|
856
858
|
async function runExport(root, args, dialect) {
|
|
859
|
+
const errOut = { output: process.stderr };
|
|
857
860
|
if (dialect === "postgresql") {
|
|
858
861
|
const parts = [];
|
|
859
862
|
await withPgClient(root, async (client) => {
|
|
860
863
|
let tables;
|
|
861
864
|
if (args.table) {
|
|
862
865
|
if ((await client.query("SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename = $1", [args.table])).rows.length === 0) {
|
|
863
|
-
R.error(`db: Table '${args.table}' not found
|
|
866
|
+
R.error(`db: Table '${args.table}' not found.`, errOut);
|
|
864
867
|
process.exit(1);
|
|
865
868
|
}
|
|
866
869
|
tables = [args.table];
|
|
@@ -902,7 +905,7 @@ async function runExport(root, args, dialect) {
|
|
|
902
905
|
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BQyKUqAL.mjs");
|
|
903
906
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
904
907
|
if (!existsSync(dbPath)) {
|
|
905
|
-
R.error("No local database found. Run `void dev` first.");
|
|
908
|
+
R.error("No local database found. Run `void dev` first.", errOut);
|
|
906
909
|
process.exit(1);
|
|
907
910
|
}
|
|
908
911
|
const db = await openSqliteDatabase(dbPath, { readonly: true });
|
|
@@ -910,7 +913,7 @@ async function runExport(root, args, dialect) {
|
|
|
910
913
|
let tables;
|
|
911
914
|
if (args.table) {
|
|
912
915
|
if (!db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(args.table)) {
|
|
913
|
-
R.error(`db: Table '${args.table}' not found
|
|
916
|
+
R.error(`db: Table '${args.table}' not found.`, errOut);
|
|
914
917
|
process.exit(1);
|
|
915
918
|
}
|
|
916
919
|
tables = [args.table];
|
|
@@ -1047,7 +1050,7 @@ async function loadSeedFunction(seedPath) {
|
|
|
1047
1050
|
return seed;
|
|
1048
1051
|
}
|
|
1049
1052
|
async function loadSeedSchema(root) {
|
|
1050
|
-
const { discoverSchema } = await import("./discover-
|
|
1053
|
+
const { discoverSchema } = await import("./discover-ZWuBvt22.mjs").then((n) => n.n);
|
|
1051
1054
|
const location = discoverSchema(root, readProjectPaths(root));
|
|
1052
1055
|
if (!location) return {};
|
|
1053
1056
|
if (location.type === "file") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as cliTitle, r as createSpinner } from "./output-DeiS4oEX.mjs";
|
|
2
|
-
import { f as getToken, n as PlatformClient } from "./client-
|
|
2
|
+
import { f as getToken, n as PlatformClient } from "./client-BlbnA92X.mjs";
|
|
3
3
|
import { _ as me, c as R, g as ge, l as Re, u as Se, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { i as removeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
@@ -4,28 +4,29 @@ import { n as cliTitle, r as createSpinner, s as import_picocolors } from "./out
|
|
|
4
4
|
import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
|
|
5
5
|
import { t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
|
|
6
6
|
import { t as cfAccessHeaders } from "./cf-access-DKDsgwOU.mjs";
|
|
7
|
-
import { a as isExpiredTokenError, f as getToken, i as isCliOutdatedError, m as isStagingMode, n as PlatformClient, o as parsePlatformErrorBody, p as getTokenSource, t as PlatformApiError, u as getApiUrl, y as ensureCloudflaredToken } from "./client-
|
|
7
|
+
import { a as isExpiredTokenError, f as getToken, i as isCliOutdatedError, m as isStagingMode, n as PlatformClient, o as parsePlatformErrorBody, p as getTokenSource, t as PlatformApiError, u as getApiUrl, y as ensureCloudflaredToken } from "./client-BlbnA92X.mjs";
|
|
8
8
|
import { c as R, g as ge, u as Se, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
9
9
|
import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
10
10
|
import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
|
|
11
|
-
import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan
|
|
12
|
-
import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-
|
|
11
|
+
import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan---8wfN58.mjs";
|
|
12
|
+
import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-D04iL1mW.mjs";
|
|
13
13
|
import { i as voidWarn, r as voidLog } from "./log-BdD_Fpms.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import { t as
|
|
16
|
-
import {
|
|
17
|
-
import { n as
|
|
14
|
+
import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-lS94ymhM.mjs";
|
|
15
|
+
import { t as discoverSchema } from "./discover-ZWuBvt22.mjs";
|
|
16
|
+
import { t as findEnvFile } from "./env-types-BS8cZead.mjs";
|
|
17
|
+
import { i as validateProdEnv, n as formatEnvReport, r as getDeployEnvDefaults, t as fetchRemoteSecretNames } from "./env-validation-BxbtBbjh.mjs";
|
|
18
|
+
import { n as writeDrizzleConfig } from "./config-CbJS4Krx.mjs";
|
|
18
19
|
import { t as collectMigrations } from "./collect-9rO3JFNM.mjs";
|
|
19
20
|
import { n as buildMigrationPlanBundle } from "./plan-aD3wRDqF.mjs";
|
|
20
21
|
import { r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
|
|
21
22
|
import { t as scanPages } from "./scan-VCAM1oh3.mjs";
|
|
22
23
|
import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
|
|
23
|
-
import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-
|
|
24
|
+
import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-LjvkYziS.mjs";
|
|
24
25
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
25
26
|
import { t as collectGitDeployMetadata } from "./git-metadata-Ce0AtSZL.mjs";
|
|
26
27
|
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BNWymgnH.mjs";
|
|
27
|
-
import { t as promptForLoginToken } from "./login-
|
|
28
|
-
import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-
|
|
28
|
+
import { t as promptForLoginToken } from "./login-CvxxF_9z.mjs";
|
|
29
|
+
import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-D0My64KQ.mjs";
|
|
29
30
|
import { createRequire } from "node:module";
|
|
30
31
|
import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
31
32
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -56,6 +57,7 @@ function workerOwnsHtmlRouting(inputs) {
|
|
|
56
57
|
function resolveAssetConfig(inputs) {
|
|
57
58
|
return resolveAssetRoutingPolicy(inputs).assetConfig;
|
|
58
59
|
}
|
|
60
|
+
const VOID_INTERNAL_WORKER_FIRST = ["/__void", "/__void/*"];
|
|
59
61
|
function resolveAssetRoutingPolicy(inputs) {
|
|
60
62
|
const workerFirst = workerOwnsHtmlRouting(inputs);
|
|
61
63
|
const apiWorkerFirst = !workerFirst && (inputs.hasApiRoutes === true || inputs.authEnabled === true);
|
|
@@ -65,8 +67,15 @@ function resolveAssetRoutingPolicy(inputs) {
|
|
|
65
67
|
run_worker_first: ["/**"]
|
|
66
68
|
} : apiWorkerFirst ? {
|
|
67
69
|
not_found_handling: "single-page-application",
|
|
68
|
-
run_worker_first: [
|
|
69
|
-
|
|
70
|
+
run_worker_first: [
|
|
71
|
+
"/api",
|
|
72
|
+
"/api/*",
|
|
73
|
+
...VOID_INTERNAL_WORKER_FIRST
|
|
74
|
+
]
|
|
75
|
+
} : {
|
|
76
|
+
not_found_handling: "single-page-application",
|
|
77
|
+
run_worker_first: [...VOID_INTERNAL_WORKER_FIRST]
|
|
78
|
+
},
|
|
70
79
|
apiWorkerFirst,
|
|
71
80
|
workerFirst,
|
|
72
81
|
workerSpaFallback: workerFirst && !inputs.isSsr && !inputs.hasPages
|
|
@@ -1565,6 +1574,11 @@ const ASSET_MIME_TYPES = {
|
|
|
1565
1574
|
svg: "image/svg+xml; charset=utf-8",
|
|
1566
1575
|
txt: "text/plain; charset=utf-8",
|
|
1567
1576
|
csv: "text/csv; charset=utf-8",
|
|
1577
|
+
md: "text/markdown; charset=utf-8",
|
|
1578
|
+
markdown: "text/markdown; charset=utf-8",
|
|
1579
|
+
yaml: "text/yaml; charset=utf-8",
|
|
1580
|
+
yml: "text/yaml; charset=utf-8",
|
|
1581
|
+
toml: "application/toml",
|
|
1568
1582
|
png: "image/png",
|
|
1569
1583
|
jpg: "image/jpeg",
|
|
1570
1584
|
jpeg: "image/jpeg",
|
|
@@ -2341,6 +2355,7 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
|
|
|
2341
2355
|
ensurePreviouslyDeployedLiveBindingConfig: () => ensurePreviouslyDeployedLiveBindingConfig,
|
|
2342
2356
|
generateDeployWrapperIfNeeded: () => generateDeployWrapperIfNeeded,
|
|
2343
2357
|
hasDeploySchemaDrift: () => hasDeploySchemaDrift,
|
|
2358
|
+
loadDeployEnv: () => loadDeployEnv,
|
|
2344
2359
|
promptDeployProjectConfig: () => promptDeployProjectConfig,
|
|
2345
2360
|
resolveDeployLiveBindingConfig: () => resolveDeployLiveBindingConfig,
|
|
2346
2361
|
resolveDeployWorkerMain: () => resolveDeployWorkerMain,
|
|
@@ -3646,24 +3661,7 @@ async function assertEnvSchemaValid(root, client, projectId) {
|
|
|
3646
3661
|
* Later files win on conflict.
|
|
3647
3662
|
*/
|
|
3648
3663
|
function loadDeployEnv(root) {
|
|
3649
|
-
const
|
|
3650
|
-
const env = {};
|
|
3651
|
-
for (const file of files) {
|
|
3652
|
-
const filePath = join(root, file);
|
|
3653
|
-
if (!existsSync(filePath)) continue;
|
|
3654
|
-
const content = readFileSync(filePath, "utf-8");
|
|
3655
|
-
for (const line of content.split("\n")) {
|
|
3656
|
-
const trimmed = line.trim();
|
|
3657
|
-
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
3658
|
-
const eqIndex = trimmed.indexOf("=");
|
|
3659
|
-
if (eqIndex === -1) continue;
|
|
3660
|
-
const key = trimmed.slice(0, eqIndex).trim();
|
|
3661
|
-
let value = trimmed.slice(eqIndex + 1).trim();
|
|
3662
|
-
if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
|
|
3663
|
-
env[key] = value;
|
|
3664
|
-
}
|
|
3665
|
-
}
|
|
3666
|
-
const { sanitized, stripped } = stripInternalEnvKeys(env);
|
|
3664
|
+
const { sanitized, stripped } = stripInternalEnvKeys(mergeAndExpand([".env", ".env.production"].map((file) => parseDotenvFile(join(root, file), { expand: false })), { onWarn: (msg) => voidWarn(msg) }));
|
|
3667
3665
|
if (stripped.length > 0) voidWarn(`Ignoring internal env keys from .env files: ${stripped.join(", ")}. These are reserved for Void runtime use and will not be shipped in the deploy manifest.`);
|
|
3668
3666
|
return sanitized;
|
|
3669
3667
|
}
|