void 0.9.3 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-cmd-CPkWrQR9.mjs → auth-cmd-DBnbrX9Y.mjs} +2 -2
- package/dist/{better-auth-shared-CmEQZs1T.d.mts → better-auth-shared-a7H3wk9J.d.mts} +2 -2
- package/dist/{cache-1SVxZ7BK.mjs → cache-DNX0hLsO.mjs} +1 -1
- package/dist/{cancel-deploy-JaFClLr7.mjs → cancel-deploy-CDzkVaYZ.mjs} +1 -1
- package/dist/cli/cli.mjs +205 -36
- package/dist/{client-DIfOFf1W.mjs → client-D4awzTnj.mjs} +149 -45
- package/dist/{create-project-DCUrFJxa.mjs → create-project-CGodxfzH.mjs} +1 -1
- package/dist/{db-UW4IYQFw.mjs → db-ERzz4oly.mjs} +14 -14
- package/dist/{delete-CYknzwXU.mjs → delete-CJZGDLBR.mjs} +1 -1
- package/dist/{deploy-RQXpVBL-.mjs → deploy-Cwa5sooV.mjs} +74 -102
- package/dist/{domain-B7RntQ1r.mjs → domain-WvoAHE6w.mjs} +1 -1
- package/dist/{env-C_ZcxxED.mjs → env-Cx4czPsR.mjs} +1 -1
- package/dist/{env-helpers-Bd2wVdxz.d.mts → env-helpers-ZatKyjen.d.mts} +1 -1
- package/dist/{gen-O5mXZ76K.mjs → gen-Dgi4D7GC.mjs} +1 -1
- package/dist/git-metadata-Ce0AtSZL.mjs +82 -0
- package/dist/github-cmd-CUB041gj.mjs +308 -0
- package/dist/{handler-hm9KldPP.d.mts → handler-DczZlaXR.d.mts} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +18 -18
- package/dist/{init-DGrLx2ls.mjs → init-DvaRDMIc.mjs} +122 -77
- package/dist/{link-7MoXUMaI.mjs → link-CpbWJY3P.mjs} +2 -2
- package/dist/{list-N2mCHv8q.mjs → list-BkwE5vH4.mjs} +1 -1
- package/dist/{login-tt1OmNVg.mjs → login-Ca6mhQVI.mjs} +1 -1
- package/dist/{logs-Cl7q2CjZ.mjs → logs-ArQzZquo.mjs} +1 -1
- package/dist/{mcp-BXD35N2J.mjs → mcp-Cc2MMXdQ.mjs} +1 -1
- package/dist/{node-Df8UjQ2H.mjs → node-B07cZs0d.mjs} +3 -3
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +1 -0
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/{plugin-inference--7geW5Z2.mjs → plugin-inference-C3fLzFvP.mjs} +2 -0
- package/dist/{prepare-DT-7QII_.mjs → prepare-DH2WnEpD.mjs} +3 -3
- package/dist/{preset-2aBxMfY1.mjs → preset-B7ZQZn0u.mjs} +2 -2
- package/dist/{project-cmd-CLrqSbqj.mjs → project-cmd-CWZeawuN.mjs} +8 -8
- package/dist/{protocol-B9GZA4Bn.d.mts → protocol-63PHtCHS.d.mts} +3 -3
- package/dist/{rollback-CEbAwbHK.mjs → rollback-BJ60ktsW.mjs} +1 -1
- package/dist/{runner-DLZ9E_cX.mjs → runner-BQyKUqAL.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +3 -3
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +2 -2
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.d.mts +2 -2
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.d.mts +2 -2
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.d.mts +2 -2
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-public-client.d.mts +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +1 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws.d.mts +3 -3
- package/dist/{scan-B2H1Vo2C.mjs → scan-DGEp1-1Q.mjs} +17 -9
- package/dist/{secret-C_uTY7xx.mjs → secret-BRbXyu7E.mjs} +1 -1
- package/package.json +2 -2
- package/schema.json +3 -3
- package/skills/void/docs/guide/deployment.md +37 -11
- package/skills/void/docs/guide/edge/headers.md +10 -3
- package/skills/void/docs/guide/edge/rewrites.md +5 -5
- package/skills/void/docs/reference/cli.md +65 -2
- /package/dist/{auth-migrations-CuQkjjWE.mjs → auth-migrations-BP-hMzYl.mjs} +0 -0
- /package/dist/{auth-CDeb2XAl.d.mts → auth-nEUVHuFI.d.mts} +0 -0
- /package/dist/{better-auth-shared-QAfk8CAS.mjs → better-auth-shared-D0Mbmx5V.mjs} +0 -0
- /package/dist/{defer-CouVukrf.mjs → defer-C-bdSM_b.mjs} +0 -0
- /package/dist/{drizzle-DYstYz0j.mjs → drizzle-DqstQTGq.mjs} +0 -0
- /package/dist/{env-raw-RDkMnSTC.mjs → env-raw-Dtj1UAoK.mjs} +0 -0
- /package/dist/{fetch-error-CimrygMq.d.mts → fetch-error-BQMdPvge.d.mts} +0 -0
- /package/dist/{fetch-error-BFIoojjf.mjs → fetch-error-C6qffTl2.mjs} +0 -0
- /package/dist/{head-BsSTGnIe.d.mts → head-JAH2l3fg.d.mts} +0 -0
- /package/dist/{headers-VkAnACKX.mjs → headers-BNWymgnH.mjs} +0 -0
- /package/dist/{package-json-B2TD0JLu.mjs → package-json-Bg_GJdJB.mjs} +0 -0
- /package/dist/{pg-CMZ_5wsC.mjs → pg-CempqvEJ.mjs} +0 -0
- /package/dist/{providers-3Kkv63Ha.d.mts → providers-BkiAlEad.d.mts} +0 -0
- /package/dist/{runner-pg-Cv9V7ydr.mjs → runner-pg-BAheiT6v.mjs} +0 -0
- /package/dist/{skills-BRKc--As.mjs → skills--OMgLmXW.mjs} +0 -0
- /package/dist/{standard-schema-Dnsh2vnl.d.mts → standard-schema-BCBv-QaP.d.mts} +0 -0
- /package/dist/{subcommand-prompt-OD-x_Tsm.mjs → subcommand-prompt-ClwpLlKD.mjs} +0 -0
- /package/dist/{types-DEWCqHtl.d.mts → types-BnHMXezo.d.mts} +0 -0
- /package/dist/{yarn-pnp-0SwYgQxx.mjs → yarn-pnp-DhCHHLAz.mjs} +0 -0
|
@@ -3,12 +3,12 @@ import { a as join, c as resolve, i as isAbsolute, n as dirname, r as extname, s
|
|
|
3
3
|
import { n as cliTitle, r as createSpinner, s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
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
|
-
import { a as isExpiredTokenError,
|
|
6
|
+
import { a as isExpiredTokenError, d as getToken, f as getTokenSource, i as isCliOutdatedError, n as PlatformClient, o as parsePlatformErrorBody, p as isStagingMode, t as PlatformApiError } from "./client-D4awzTnj.mjs";
|
|
7
7
|
import { c as R, g as ge, u as Se, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
8
8
|
import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
9
9
|
import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
|
|
10
|
-
import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan-
|
|
11
|
-
import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference
|
|
10
|
+
import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan-DGEp1-1Q.mjs";
|
|
11
|
+
import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-C3fLzFvP.mjs";
|
|
12
12
|
import { i as voidWarn, r as voidLog } from "./log-BdD_Fpms.mjs";
|
|
13
13
|
import { t as discoverSchema } from "./discover-C8N1I4tK.mjs";
|
|
14
14
|
import { t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
|
|
@@ -19,18 +19,19 @@ import { n as buildMigrationPlanBundle } from "./plan-aD3wRDqF.mjs";
|
|
|
19
19
|
import { r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
|
|
20
20
|
import { t as scanPages } from "./scan-VCAM1oh3.mjs";
|
|
21
21
|
import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
|
|
22
|
-
import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-
|
|
22
|
+
import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-CGodxfzH.mjs";
|
|
23
23
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
24
|
-
import {
|
|
25
|
-
import { t as
|
|
26
|
-
import {
|
|
24
|
+
import { t as collectGitDeployMetadata } from "./git-metadata-Ce0AtSZL.mjs";
|
|
25
|
+
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BNWymgnH.mjs";
|
|
26
|
+
import { t as promptForLoginToken } from "./login-Ca6mhQVI.mjs";
|
|
27
|
+
import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-B7ZQZn0u.mjs";
|
|
27
28
|
import { createRequire } from "node:module";
|
|
28
29
|
import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
29
30
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
30
31
|
import { build, loadEnv } from "vite";
|
|
31
32
|
import { createHash } from "node:crypto";
|
|
32
33
|
import { homedir } from "node:os";
|
|
33
|
-
import { execFile,
|
|
34
|
+
import { execFile, execSync, spawnSync } from "node:child_process";
|
|
34
35
|
import { parse } from "jsonc-parser";
|
|
35
36
|
import { hash } from "blake3-jit";
|
|
36
37
|
import ignore from "ignore";
|
|
@@ -1167,86 +1168,6 @@ function sleep(ms) {
|
|
|
1167
1168
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1168
1169
|
}
|
|
1169
1170
|
//#endregion
|
|
1170
|
-
//#region src/cli/git-metadata.ts
|
|
1171
|
-
function git(root, args) {
|
|
1172
|
-
try {
|
|
1173
|
-
return execFileSync("git", args, {
|
|
1174
|
-
cwd: root,
|
|
1175
|
-
encoding: "utf-8",
|
|
1176
|
-
stdio: [
|
|
1177
|
-
"ignore",
|
|
1178
|
-
"pipe",
|
|
1179
|
-
"ignore"
|
|
1180
|
-
]
|
|
1181
|
-
}).trim();
|
|
1182
|
-
} catch {
|
|
1183
|
-
return null;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
function stripGitSuffix(pathname) {
|
|
1187
|
-
return pathname.endsWith(".git") ? pathname.slice(0, -4) : pathname;
|
|
1188
|
-
}
|
|
1189
|
-
function normalizeGitRemoteUrl(remote) {
|
|
1190
|
-
if (!remote) return null;
|
|
1191
|
-
const trimmed = remote.trim();
|
|
1192
|
-
if (!trimmed) return null;
|
|
1193
|
-
const scpLike = /^(?:[^@]+@)?([^:]+):(.+)$/.exec(trimmed);
|
|
1194
|
-
if (scpLike && !trimmed.includes("://")) {
|
|
1195
|
-
const host = scpLike[1]?.toLowerCase();
|
|
1196
|
-
const path = stripGitSuffix(scpLike[2] ?? "").replace(/^\/+/, "");
|
|
1197
|
-
return host && path ? `https://${host}/${path}` : null;
|
|
1198
|
-
}
|
|
1199
|
-
try {
|
|
1200
|
-
const url = new URL(trimmed);
|
|
1201
|
-
if (url.protocol !== "https:" && url.protocol !== "http:" && url.protocol !== "ssh:") return null;
|
|
1202
|
-
const host = url.hostname.toLowerCase();
|
|
1203
|
-
const path = stripGitSuffix(url.pathname).replace(/^\/+/, "");
|
|
1204
|
-
return host && path ? `https://${host}/${path}` : null;
|
|
1205
|
-
} catch {
|
|
1206
|
-
return null;
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
function buildCommitUrl(repositoryUrl, commit) {
|
|
1210
|
-
if (!repositoryUrl || !commit) return null;
|
|
1211
|
-
try {
|
|
1212
|
-
const url = new URL(repositoryUrl);
|
|
1213
|
-
if (url.hostname === "github.com") return `${repositoryUrl}/commit/${commit}`;
|
|
1214
|
-
if (url.hostname === "gitlab.com") return `${repositoryUrl}/-/commit/${commit}`;
|
|
1215
|
-
if (url.hostname === "bitbucket.org") return `${repositoryUrl}/commits/${commit}`;
|
|
1216
|
-
} catch {
|
|
1217
|
-
return null;
|
|
1218
|
-
}
|
|
1219
|
-
return null;
|
|
1220
|
-
}
|
|
1221
|
-
function getGitRefFromEnv(env) {
|
|
1222
|
-
if (env.GITHUB_HEAD_REF) return env.GITHUB_HEAD_REF;
|
|
1223
|
-
if (env.GITHUB_REF_NAME) return env.GITHUB_REF_NAME;
|
|
1224
|
-
if (env.GITHUB_REF) return env.GITHUB_REF.replace(/^refs\/(?:heads|tags|pull)\//, "");
|
|
1225
|
-
return null;
|
|
1226
|
-
}
|
|
1227
|
-
function getGitHubRepositoryUrl(env) {
|
|
1228
|
-
if (!env.GITHUB_REPOSITORY) return null;
|
|
1229
|
-
return normalizeGitRemoteUrl(`${env.GITHUB_SERVER_URL ?? "https://github.com"}/${env.GITHUB_REPOSITORY}`);
|
|
1230
|
-
}
|
|
1231
|
-
function collectGitDeployMetadata(root, commit, env = process.env) {
|
|
1232
|
-
const repositoryUrl = getGitHubRepositoryUrl(env) ?? normalizeGitRemoteUrl(git(root, [
|
|
1233
|
-
"remote",
|
|
1234
|
-
"get-url",
|
|
1235
|
-
"origin"
|
|
1236
|
-
]));
|
|
1237
|
-
const gitRef = getGitRefFromEnv(env) ?? git(root, [
|
|
1238
|
-
"rev-parse",
|
|
1239
|
-
"--abbrev-ref",
|
|
1240
|
-
"HEAD"
|
|
1241
|
-
]);
|
|
1242
|
-
return {
|
|
1243
|
-
commit,
|
|
1244
|
-
commitUrl: buildCommitUrl(repositoryUrl, commit),
|
|
1245
|
-
gitRef: gitRef && gitRef !== "HEAD" ? gitRef : null,
|
|
1246
|
-
repositoryUrl
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
//#endregion
|
|
1250
1171
|
//#region src/cli/log-file.ts
|
|
1251
1172
|
/**
|
|
1252
1173
|
* Walk `err.cause` up to 6 levels and return a plain JSON-friendly chain.
|
|
@@ -2292,6 +2213,7 @@ function generateHandlersSource(root, features) {
|
|
|
2292
2213
|
//#region src/cli/deploy.ts
|
|
2293
2214
|
var deploy_exports = /* @__PURE__ */ __exportAll({
|
|
2294
2215
|
applyDeployEvent: () => applyDeployEvent,
|
|
2216
|
+
buildEnv: () => buildEnv,
|
|
2295
2217
|
ensurePreviouslyDeployedLiveBindingConfig: () => ensurePreviouslyDeployedLiveBindingConfig,
|
|
2296
2218
|
generateDeployWrapperIfNeeded: () => generateDeployWrapperIfNeeded,
|
|
2297
2219
|
hasDeploySchemaDrift: () => hasDeploySchemaDrift,
|
|
@@ -2305,7 +2227,9 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
|
|
|
2305
2227
|
resolveWorkerDirName: () => resolveWorkerDirName,
|
|
2306
2228
|
runDeploy: () => runDeploy,
|
|
2307
2229
|
runStaticDeploy: () => runStaticDeploy,
|
|
2308
|
-
|
|
2230
|
+
streamDeployEvents: () => streamDeployEvents,
|
|
2231
|
+
warnRedundantForceOn3xx: () => warnRedundantForceOn3xx,
|
|
2232
|
+
warnUnpublishedRouting: () => warnUnpublishedRouting
|
|
2309
2233
|
});
|
|
2310
2234
|
const drizzleKitBin = join(fileURLToPath(import.meta.resolve("drizzle-kit")), "..", "bin.cjs");
|
|
2311
2235
|
const deployDriftCheckDir = join(".void", "deploy-drift-check");
|
|
@@ -2423,6 +2347,33 @@ async function runDeploy(root, options) {
|
|
|
2423
2347
|
await cliLog.close().catch(() => {});
|
|
2424
2348
|
}
|
|
2425
2349
|
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Build a child-process environment with the CF Access service-token PAIR
|
|
2352
|
+
* removed.
|
|
2353
|
+
*
|
|
2354
|
+
* The deploy flow spawns UNTRUSTED user build code (`vite build`, framework
|
|
2355
|
+
* preset builds, drizzle-kit loading the user schema) which inherits the
|
|
2356
|
+
* spawn env. A shared, long-lived CF Access service token is needed only by
|
|
2357
|
+
* this CLI's own API client (which captures the Access headers once at
|
|
2358
|
+
* construction and reuses them for every request) — never by the build — so it
|
|
2359
|
+
* must not survive into those children, or it would leak to arbitrary repo
|
|
2360
|
+
* build scripts/plugins.
|
|
2361
|
+
*
|
|
2362
|
+
* We scrub it on the CHILD env rather than mutating `process.env`: deleting it
|
|
2363
|
+
* from the parent also breaks interactive expired-token re-auth, which reads
|
|
2364
|
+
* `cfAccessHeaders(process.env)` / the cloudflared pair-guard AFTER the build
|
|
2365
|
+
* step. Only the service-token pair is scrubbed; the cloudflared
|
|
2366
|
+
* `CF_ACCESS_TOKEN` JWT (dev path) is left untouched.
|
|
2367
|
+
*/
|
|
2368
|
+
function buildEnv(extra) {
|
|
2369
|
+
const env = {
|
|
2370
|
+
...process.env,
|
|
2371
|
+
...extra
|
|
2372
|
+
};
|
|
2373
|
+
delete env.CF_ACCESS_CLIENT_ID;
|
|
2374
|
+
delete env.CF_ACCESS_CLIENT_SECRET;
|
|
2375
|
+
return env;
|
|
2376
|
+
}
|
|
2426
2377
|
async function runDeployInner(root, options, cliLog) {
|
|
2427
2378
|
let reauthenticated = false;
|
|
2428
2379
|
while (true) try {
|
|
@@ -2598,7 +2549,8 @@ function applyDeployEvent(event, s) {
|
|
|
2598
2549
|
s.message(`Prerendering ${event.pages} pages...`);
|
|
2599
2550
|
return { kind: "continue" };
|
|
2600
2551
|
case "done":
|
|
2601
|
-
s.stop("Deployed
|
|
2552
|
+
if (event.published === false) s.stop("Deployed, but routing was not published — the project may be unreachable or still serving the previous deploy. Re-run `void deploy` to publish routing.");
|
|
2553
|
+
else s.stop("Deployed!");
|
|
2602
2554
|
return {
|
|
2603
2555
|
kind: "done",
|
|
2604
2556
|
event
|
|
@@ -2639,12 +2591,14 @@ async function streamDeployEvents(projectId, events, s, cliLog) {
|
|
|
2639
2591
|
deploymentId = result.deploymentId;
|
|
2640
2592
|
cliLog?.info("stream_deployment_id", { deploymentId });
|
|
2641
2593
|
} else if (result.kind === "done") {
|
|
2642
|
-
|
|
2594
|
+
const degraded = result.event.published === false;
|
|
2595
|
+
cliLog?.info(degraded ? "deploy_degraded" : "deploy_success", {
|
|
2643
2596
|
deploymentId,
|
|
2644
2597
|
url: result.event.url,
|
|
2645
2598
|
assets: result.event.assets,
|
|
2646
2599
|
workers: result.event.workers,
|
|
2647
|
-
durationMs: Date.now() - startedAt
|
|
2600
|
+
durationMs: Date.now() - startedAt,
|
|
2601
|
+
degraded
|
|
2648
2602
|
});
|
|
2649
2603
|
return result.event;
|
|
2650
2604
|
} else if (result.kind === "error") {
|
|
@@ -2784,7 +2738,8 @@ async function runStaticDeploy(root, config, client, preset, skipBuild, gitMetad
|
|
|
2784
2738
|
const buildStartedAt = Date.now();
|
|
2785
2739
|
execSync(preset.buildCommand, {
|
|
2786
2740
|
cwd: root,
|
|
2787
|
-
stdio: "inherit"
|
|
2741
|
+
stdio: "inherit",
|
|
2742
|
+
env: buildEnv()
|
|
2788
2743
|
});
|
|
2789
2744
|
cliLog?.info("build_end", { durationMs: Date.now() - buildStartedAt });
|
|
2790
2745
|
} else if (skipBuild) cliLog?.info("build_skipped", { reason: "skipBuild" });
|
|
@@ -2836,9 +2791,21 @@ async function runStaticDeploy(root, config, client, preset, skipBuild, gitMetad
|
|
|
2836
2791
|
});
|
|
2837
2792
|
const result = await streamDirectR2Deploy(client, config.projectId, manifest, assetManifest, assetFiles, needed, gitMetadata, neededSet !== null, void 0, s, cliLog);
|
|
2838
2793
|
Se([`${typeLabel} — ${formatKnownAssetSummary(result, skipped)}`].join("\n"), result.url);
|
|
2794
|
+
warnUnpublishedRouting(result);
|
|
2839
2795
|
ye("Done!");
|
|
2840
2796
|
}
|
|
2841
2797
|
/**
|
|
2798
|
+
* Surface a persistent warning when a deploy committed live but its routing
|
|
2799
|
+
* KV was not published. Uses `log.warn` (not the spinner) so the warning
|
|
2800
|
+
* survives the following `note`/`outro` calls and the user sees it after the
|
|
2801
|
+
* deploy summary. The deploy is still committed — this is a warning, not a
|
|
2802
|
+
* failure, so the process exit code is unaffected.
|
|
2803
|
+
*/
|
|
2804
|
+
function warnUnpublishedRouting(result) {
|
|
2805
|
+
if (result.published !== false) return;
|
|
2806
|
+
R.warn("Routing was not published for this deploy. The project may be unreachable (first deploy) or still serving the previous deploy. Re-run `void deploy` to publish routing.");
|
|
2807
|
+
}
|
|
2808
|
+
/**
|
|
2842
2809
|
* Emit a single aggregated lint warning when a `_redirects` file contains
|
|
2843
2810
|
* one or more `!` force suffixes on 3xx entries (e.g. `301!`, `302!`).
|
|
2844
2811
|
* The `!` is a no-op on redirects — we parse them as if the `!` weren't
|
|
@@ -2866,7 +2833,8 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
2866
2833
|
const buildStartedAt = Date.now();
|
|
2867
2834
|
execSync(voidConfig.inference?.build ?? resolveProjectCommand(root, fwPreset.buildCommand), {
|
|
2868
2835
|
cwd: root,
|
|
2869
|
-
stdio: "inherit"
|
|
2836
|
+
stdio: "inherit",
|
|
2837
|
+
env: buildEnv()
|
|
2870
2838
|
});
|
|
2871
2839
|
cliLog?.info("build_end", { durationMs: Date.now() - buildStartedAt });
|
|
2872
2840
|
} else cliLog?.info("build_skipped", { reason: "skipBuild" });
|
|
@@ -3043,6 +3011,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
3043
3011
|
summary.push(`Framework: ${detected.name}`);
|
|
3044
3012
|
Se(summary.join("\n"), result.url);
|
|
3045
3013
|
cleanupWrapper(root);
|
|
3014
|
+
warnUnpublishedRouting(result);
|
|
3046
3015
|
ye("Done!");
|
|
3047
3016
|
}
|
|
3048
3017
|
async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetadata, detected, cliLog) {
|
|
@@ -3059,10 +3028,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
|
|
|
3059
3028
|
execSync(resolveProjectCommand(root, "vite build"), {
|
|
3060
3029
|
cwd: root,
|
|
3061
3030
|
stdio: "inherit",
|
|
3062
|
-
env: {
|
|
3063
|
-
...process.env,
|
|
3064
|
-
VOID_DEPLOY_PROJECT_ID: config.projectId
|
|
3065
|
-
}
|
|
3031
|
+
env: buildEnv({ VOID_DEPLOY_PROJECT_ID: config.projectId })
|
|
3066
3032
|
});
|
|
3067
3033
|
cliLog?.info("build_end", { durationMs: Date.now() - buildStartedAt });
|
|
3068
3034
|
} catch (err) {
|
|
@@ -3343,6 +3309,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
|
|
|
3343
3309
|
else summary.push(`ISR revalidate: ${Object.keys(revalidate).length} path rule(s)`);
|
|
3344
3310
|
if (isFrameworkMode) summary.push("Framework mode");
|
|
3345
3311
|
Se(summary.join("\n"), result.url);
|
|
3312
|
+
warnUnpublishedRouting(result);
|
|
3346
3313
|
ye("Done!");
|
|
3347
3314
|
}
|
|
3348
3315
|
async function createProjectFromSlug(root, client, slug, cliLog) {
|
|
@@ -3365,17 +3332,21 @@ function getGitCommit(root) {
|
|
|
3365
3332
|
try {
|
|
3366
3333
|
const githubSha = process.env.GITHUB_SHA?.trim();
|
|
3367
3334
|
if (githubSha && /^[0-9a-f]{7,64}$/i.test(githubSha)) return githubSha;
|
|
3335
|
+
const gitEnv = buildEnv();
|
|
3368
3336
|
execSync("git rev-parse --is-inside-work-tree", {
|
|
3369
3337
|
cwd: root,
|
|
3370
|
-
stdio: "ignore"
|
|
3338
|
+
stdio: "ignore",
|
|
3339
|
+
env: gitEnv
|
|
3371
3340
|
});
|
|
3372
3341
|
if (execSync("git status --porcelain", {
|
|
3373
3342
|
cwd: root,
|
|
3374
|
-
encoding: "utf-8"
|
|
3343
|
+
encoding: "utf-8",
|
|
3344
|
+
env: gitEnv
|
|
3375
3345
|
}).trim() !== "") return null;
|
|
3376
3346
|
return execSync("git rev-parse HEAD", {
|
|
3377
3347
|
cwd: root,
|
|
3378
|
-
encoding: "utf-8"
|
|
3348
|
+
encoding: "utf-8",
|
|
3349
|
+
env: gitEnv
|
|
3379
3350
|
}).trim();
|
|
3380
3351
|
} catch {
|
|
3381
3352
|
return null;
|
|
@@ -3421,7 +3392,8 @@ function runDrizzleKitGenerate(root, configPath) {
|
|
|
3421
3392
|
configPath
|
|
3422
3393
|
], {
|
|
3423
3394
|
cwd: root,
|
|
3424
|
-
encoding: "utf-8"
|
|
3395
|
+
encoding: "utf-8",
|
|
3396
|
+
env: buildEnv()
|
|
3425
3397
|
});
|
|
3426
3398
|
const stderr = bufferToString(result.stderr);
|
|
3427
3399
|
const output = [stderr, bufferToString(result.stdout)].filter(Boolean).join("\n").trim();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { d as getToken, n as PlatformClient } from "./client-D4awzTnj.mjs";
|
|
3
3
|
import { c as R, u as Se } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
5
|
//#region src/cli/domain.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
2
|
import { n as cliTitle } from "./output-DeiS4oEX.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { d as getToken, n as PlatformClient } from "./client-D4awzTnj.mjs";
|
|
4
4
|
import { c as R, g as ge, u as Se, y as ye } from "./dist-abzUneor.mjs";
|
|
5
5
|
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
6
6
|
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
|
|
@@ -7,7 +7,7 @@ import { c as getDatabaseDialect, f as readConfig } from "./config-8dLIngKW.mjs"
|
|
|
7
7
|
import { n as writeDrizzleConfig } from "./config--wXmVOoe.mjs";
|
|
8
8
|
import { r as readJournal, t as collectMigrations } from "./collect-9rO3JFNM.mjs";
|
|
9
9
|
import { n as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
|
|
10
|
-
import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-
|
|
10
|
+
import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DhCHHLAz.mjs";
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { spawnSync } from "node:child_process";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
//#region src/cli/git-metadata.ts
|
|
3
|
+
function git(root, args) {
|
|
4
|
+
try {
|
|
5
|
+
return execFileSync("git", args, {
|
|
6
|
+
cwd: root,
|
|
7
|
+
encoding: "utf-8",
|
|
8
|
+
stdio: [
|
|
9
|
+
"ignore",
|
|
10
|
+
"pipe",
|
|
11
|
+
"ignore"
|
|
12
|
+
]
|
|
13
|
+
}).trim();
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function stripGitSuffix(pathname) {
|
|
19
|
+
return pathname.endsWith(".git") ? pathname.slice(0, -4) : pathname;
|
|
20
|
+
}
|
|
21
|
+
function normalizeGitRemoteUrl(remote) {
|
|
22
|
+
if (!remote) return null;
|
|
23
|
+
const trimmed = remote.trim();
|
|
24
|
+
if (!trimmed) return null;
|
|
25
|
+
const scpLike = /^(?:[^@]+@)?([^:]+):(.+)$/.exec(trimmed);
|
|
26
|
+
if (scpLike && !trimmed.includes("://")) {
|
|
27
|
+
const host = scpLike[1]?.toLowerCase();
|
|
28
|
+
const path = stripGitSuffix(scpLike[2] ?? "").replace(/^\/+/, "");
|
|
29
|
+
return host && path ? `https://${host}/${path}` : null;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const url = new URL(trimmed);
|
|
33
|
+
if (url.protocol !== "https:" && url.protocol !== "http:" && url.protocol !== "ssh:") return null;
|
|
34
|
+
const host = url.hostname.toLowerCase();
|
|
35
|
+
const path = stripGitSuffix(url.pathname).replace(/^\/+/, "");
|
|
36
|
+
return host && path ? `https://${host}/${path}` : null;
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function buildCommitUrl(repositoryUrl, commit) {
|
|
42
|
+
if (!repositoryUrl || !commit) return null;
|
|
43
|
+
try {
|
|
44
|
+
const url = new URL(repositoryUrl);
|
|
45
|
+
if (url.hostname === "github.com") return `${repositoryUrl}/commit/${commit}`;
|
|
46
|
+
if (url.hostname === "gitlab.com") return `${repositoryUrl}/-/commit/${commit}`;
|
|
47
|
+
if (url.hostname === "bitbucket.org") return `${repositoryUrl}/commits/${commit}`;
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function getGitRefFromEnv(env) {
|
|
54
|
+
if (env.GITHUB_HEAD_REF) return env.GITHUB_HEAD_REF;
|
|
55
|
+
if (env.GITHUB_REF_NAME) return env.GITHUB_REF_NAME;
|
|
56
|
+
if (env.GITHUB_REF) return env.GITHUB_REF.replace(/^refs\/(?:heads|tags|pull)\//, "");
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function getGitHubRepositoryUrl(env) {
|
|
60
|
+
if (!env.GITHUB_REPOSITORY) return null;
|
|
61
|
+
return normalizeGitRemoteUrl(`${env.GITHUB_SERVER_URL ?? "https://github.com"}/${env.GITHUB_REPOSITORY}`);
|
|
62
|
+
}
|
|
63
|
+
function collectGitDeployMetadata(root, commit, env = process.env) {
|
|
64
|
+
const repositoryUrl = getGitHubRepositoryUrl(env) ?? normalizeGitRemoteUrl(git(root, [
|
|
65
|
+
"remote",
|
|
66
|
+
"get-url",
|
|
67
|
+
"origin"
|
|
68
|
+
]));
|
|
69
|
+
const gitRef = getGitRefFromEnv(env) ?? git(root, [
|
|
70
|
+
"rev-parse",
|
|
71
|
+
"--abbrev-ref",
|
|
72
|
+
"HEAD"
|
|
73
|
+
]);
|
|
74
|
+
return {
|
|
75
|
+
commit,
|
|
76
|
+
commitUrl: buildCommitUrl(repositoryUrl, commit),
|
|
77
|
+
gitRef: gitRef && gitRef !== "HEAD" ? gitRef : null,
|
|
78
|
+
repositoryUrl
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { collectGitDeployMetadata as t };
|