vercel 54.18.5 → 54.18.7
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/chunks/{add-DFHK2LCD.js → add-P6CBTAGK.js} +4 -4
- package/dist/chunks/{chunk-LQALVXRD.js → chunk-3S2QGKYZ.js} +1 -1
- package/dist/chunks/{chunk-22CQWS5E.js → chunk-5MVXR7B7.js} +1 -1
- package/dist/chunks/{chunk-VKGCONIM.js → chunk-6ISLGUMI.js} +3 -3
- package/dist/chunks/{chunk-BSSEGYXP.js → chunk-AXFSALI3.js} +2 -2
- package/dist/chunks/{chunk-QPBO2QDL.js → chunk-DXL7EPOQ.js} +4 -4
- package/dist/chunks/{chunk-GXAVQSHO.js → chunk-FVI6UYNL.js} +1 -1
- package/dist/chunks/{chunk-DHLDURNP.js → chunk-FZZWTDNQ.js} +2 -2
- package/dist/chunks/{chunk-CXGDCPH4.js → chunk-ITU4COOO.js} +12 -3
- package/dist/chunks/{chunk-3WENOEKR.js → chunk-JREEV2EL.js} +4 -4
- package/dist/chunks/{chunk-NN7E6Y4F.js → chunk-L6QLQSJE.js} +2 -2
- package/dist/chunks/{chunk-I43WUYKE.js → chunk-O2QNLUYX.js} +1 -1
- package/dist/chunks/{chunk-BI2IN6RX.js → chunk-P726GMBL.js} +1 -1
- package/dist/chunks/{chunk-7273TMGI.js → chunk-Q4A2Q46Z.js} +4 -4
- package/dist/chunks/{chunk-ODVBO56J.js → chunk-Q7GZMMHB.js} +2 -2
- package/dist/chunks/{chunk-F6YGVA2L.js → chunk-RB7WQKNC.js} +3 -2
- package/dist/chunks/{chunk-URFSONFS.js → chunk-RKLBPBRM.js} +1 -1
- package/dist/chunks/{chunk-ZAJ4OMXG.js → chunk-TV7GKFSY.js} +1 -1
- package/dist/chunks/{chunk-PPW2JATF.js → chunk-U3FBUYRS.js} +1 -1
- package/dist/chunks/{chunk-V7IBBQ2D.js → chunk-YWLVPKNT.js} +1 -1
- package/dist/chunks/{compile-vercel-config-WRCB2TG2.js → compile-vercel-config-XEZ2TPQ4.js} +1 -1
- package/dist/chunks/{delete-DIFVXSQA.js → delete-O3F4EP2W.js} +2 -2
- package/dist/chunks/{disable-623SZAWT.js → disable-SJWGUQKZ.js} +2 -2
- package/dist/chunks/{discard-R7YAQI6C.js → discard-EQD6ENC3.js} +2 -2
- package/dist/chunks/{edit-CY2RYSKD.js → edit-NAIWNSXE.js} +3 -3
- package/dist/chunks/{enable-HHOQLDPW.js → enable-LXO62HU5.js} +2 -2
- package/dist/chunks/{export-TNFZHJKM.js → export-EHVTYAAP.js} +2 -2
- package/dist/chunks/{inspect-7JLYYYAR.js → inspect-KYVZQL56.js} +3 -3
- package/dist/chunks/{list-5LKLQBXP.js → list-BYTNF7D7.js} +3 -3
- package/dist/chunks/{list-K4F7WGQR.js → list-MUFZTUZA.js} +2 -2
- package/dist/chunks/{ls-DUHNXBAL.js → ls-PDILBRUL.js} +4 -4
- package/dist/chunks/{publish-O5UJJQKF.js → publish-27V2MMFS.js} +2 -2
- package/dist/chunks/{query-FE6G54EI.js → query-75PT24SH.js} +2 -2
- package/dist/chunks/{reorder-YH47SCZC.js → reorder-DCSIJX72.js} +2 -2
- package/dist/chunks/{restore-TSR6PO3H.js → restore-NRUBGNSK.js} +2 -2
- package/dist/chunks/{rm-PQSDPXP2.js → rm-BJSTNUIJ.js} +4 -4
- package/dist/chunks/{rule-inspect-TNP2HULT.js → rule-inspect-WTU3MGMH.js} +4 -4
- package/dist/chunks/{rules-IO4KI6U7.js → rules-6PXGKHFH.js} +6 -6
- package/dist/chunks/{schema-QFN4XSPZ.js → schema-Z6L3EN6F.js} +2 -2
- package/dist/chunks/{update-PGYIRCOQ.js → update-TTPNV44H.js} +4 -4
- package/dist/commands/build/index.js +143 -49
- package/dist/commands/deploy/index.js +10 -10
- package/dist/commands/dev/index.js +8 -8
- package/dist/commands/dev/next-dev-websocket-shim-preload.cjs +20 -0
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +7 -7
- package/dist/commands/list/index.js +3 -3
- package/dist/commands-bulk.js +34 -34
- package/dist/index.js +8 -8
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-RKLBPBRM.js";
|
|
13
|
+
import "./chunk-L6QLQSJE.js";
|
|
14
14
|
import "./chunk-E2ENQE2W.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
23
|
} from "./chunk-QH7WYDEP.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-P726GMBL.js";
|
|
25
|
+
import "./chunk-RB7WQKNC.js";
|
|
26
26
|
import {
|
|
27
27
|
buildCommandWithGlobalFlags,
|
|
28
28
|
buildCommandWithYes,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-RKLBPBRM.js";
|
|
13
|
+
import "./chunk-L6QLQSJE.js";
|
|
14
14
|
import "./chunk-E2ENQE2W.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
23
|
} from "./chunk-QH7WYDEP.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-P726GMBL.js";
|
|
25
|
+
import "./chunk-RB7WQKNC.js";
|
|
26
26
|
import {
|
|
27
27
|
buildCommandWithGlobalFlags,
|
|
28
28
|
outputAgentError
|
|
@@ -32,7 +32,7 @@ var RULES_CONFIG = {
|
|
|
32
32
|
};
|
|
33
33
|
async function rules(client, argv) {
|
|
34
34
|
if (argv.length === 0) {
|
|
35
|
-
const lsFn = (await import("./ls-
|
|
35
|
+
const lsFn = (await import("./ls-PDILBRUL.js")).default;
|
|
36
36
|
return lsFn(client, []);
|
|
37
37
|
}
|
|
38
38
|
const { subcommand, args, subcommandOriginal } = getSubcommand(
|
|
@@ -65,15 +65,15 @@ async function rules(client, argv) {
|
|
|
65
65
|
}
|
|
66
66
|
switch (subcommand) {
|
|
67
67
|
case "ls":
|
|
68
|
-
return (await import("./ls-
|
|
68
|
+
return (await import("./ls-PDILBRUL.js")).default(client, args);
|
|
69
69
|
case "add":
|
|
70
|
-
return (await import("./add-
|
|
70
|
+
return (await import("./add-P6CBTAGK.js")).default(client, args);
|
|
71
71
|
case "inspect":
|
|
72
|
-
return (await import("./rule-inspect-
|
|
72
|
+
return (await import("./rule-inspect-WTU3MGMH.js")).default(client, args);
|
|
73
73
|
case "rm":
|
|
74
|
-
return (await import("./rm-
|
|
74
|
+
return (await import("./rm-BJSTNUIJ.js")).default(client, args);
|
|
75
75
|
case "update":
|
|
76
|
-
return (await import("./update-
|
|
76
|
+
return (await import("./update-TTPNV44H.js")).default(client, args);
|
|
77
77
|
default:
|
|
78
78
|
output_manager_default.error(`Unhandled rules subcommand: ${String(subcommandOriginal)}`);
|
|
79
79
|
return 1;
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
} from "./chunk-MAJWH2PD.js";
|
|
24
24
|
import {
|
|
25
25
|
getScope
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-P726GMBL.js";
|
|
27
27
|
import "./chunk-VKBYAWTL.js";
|
|
28
28
|
import {
|
|
29
29
|
require_pluralize
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RB7WQKNC.js";
|
|
31
31
|
import "./chunk-IZOHLD5D.js";
|
|
32
32
|
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import {
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-RKLBPBRM.js";
|
|
13
|
+
import "./chunk-L6QLQSJE.js";
|
|
14
14
|
import "./chunk-E2ENQE2W.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
23
|
} from "./chunk-QH7WYDEP.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-P726GMBL.js";
|
|
25
|
+
import "./chunk-RB7WQKNC.js";
|
|
26
26
|
import {
|
|
27
27
|
buildCommandWithGlobalFlags,
|
|
28
28
|
outputAgentError
|
|
@@ -11,36 +11,36 @@ import {
|
|
|
11
11
|
isLambda,
|
|
12
12
|
staticFiles,
|
|
13
13
|
writeBuildResult
|
|
14
|
-
} from "../../chunks/chunk-
|
|
14
|
+
} from "../../chunks/chunk-ITU4COOO.js";
|
|
15
15
|
import {
|
|
16
16
|
pullCommandLogic
|
|
17
|
-
} from "../../chunks/chunk-
|
|
17
|
+
} from "../../chunks/chunk-Q4A2Q46Z.js";
|
|
18
18
|
import {
|
|
19
19
|
require_semver
|
|
20
20
|
} from "../../chunks/chunk-IB5L4LKZ.js";
|
|
21
21
|
import {
|
|
22
22
|
pickOverrides,
|
|
23
23
|
readProjectSettings
|
|
24
|
-
} from "../../chunks/chunk-
|
|
24
|
+
} from "../../chunks/chunk-5MVXR7B7.js";
|
|
25
25
|
import "../../chunks/chunk-24FCBXI4.js";
|
|
26
26
|
import "../../chunks/chunk-NJUPUGOE.js";
|
|
27
27
|
import {
|
|
28
28
|
stamp_default
|
|
29
29
|
} from "../../chunks/chunk-64IF634X.js";
|
|
30
30
|
import "../../chunks/chunk-VXYGCOKL.js";
|
|
31
|
-
import "../../chunks/chunk-
|
|
31
|
+
import "../../chunks/chunk-Q7GZMMHB.js";
|
|
32
32
|
import {
|
|
33
33
|
printProjectNotFoundError
|
|
34
|
-
} from "../../chunks/chunk-
|
|
34
|
+
} from "../../chunks/chunk-6ISLGUMI.js";
|
|
35
35
|
import {
|
|
36
36
|
AGENT_REASON,
|
|
37
37
|
AGENT_STATUS
|
|
38
38
|
} from "../../chunks/chunk-QH7WYDEP.js";
|
|
39
|
-
import "../../chunks/chunk-
|
|
39
|
+
import "../../chunks/chunk-YWLVPKNT.js";
|
|
40
40
|
import {
|
|
41
41
|
buildCommand
|
|
42
|
-
} from "../../chunks/chunk-
|
|
43
|
-
import "../../chunks/chunk-
|
|
42
|
+
} from "../../chunks/chunk-O2QNLUYX.js";
|
|
43
|
+
import "../../chunks/chunk-P726GMBL.js";
|
|
44
44
|
import {
|
|
45
45
|
help
|
|
46
46
|
} from "../../chunks/chunk-YSIZGIDP.js";
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
VERCEL_DIR,
|
|
51
51
|
compileVercelConfig,
|
|
52
52
|
findSourceVercelConfigFile,
|
|
53
|
+
getGitRootDirectory,
|
|
53
54
|
getLinkedProject,
|
|
54
55
|
getProjectLink,
|
|
55
56
|
parseTarget,
|
|
@@ -66,7 +67,7 @@ import {
|
|
|
66
67
|
resolveProjectCwd,
|
|
67
68
|
ua_default,
|
|
68
69
|
validateConfig
|
|
69
|
-
} from "../../chunks/chunk-
|
|
70
|
+
} from "../../chunks/chunk-RB7WQKNC.js";
|
|
70
71
|
import {
|
|
71
72
|
outputAgentError
|
|
72
73
|
} from "../../chunks/chunk-IZOHLD5D.js";
|
|
@@ -115,7 +116,7 @@ var import_client = __toESM(require_dist(), 1);
|
|
|
115
116
|
var import_frameworks2 = __toESM(require_frameworks(), 1);
|
|
116
117
|
var import_fs_detectors2 = __toESM(require_dist3(), 1);
|
|
117
118
|
var import_routing_utils2 = __toESM(require_dist2(), 1);
|
|
118
|
-
import { dirname, join as
|
|
119
|
+
import { dirname as dirname2, join as join4, normalize, relative as relative3, resolve, sep } from "path";
|
|
119
120
|
import { readdirSync, statSync } from "fs";
|
|
120
121
|
import {
|
|
121
122
|
download,
|
|
@@ -458,8 +459,85 @@ async function shouldEmbedFlagsDefinitions(cwd) {
|
|
|
458
459
|
return false;
|
|
459
460
|
}
|
|
460
461
|
|
|
462
|
+
// src/util/build/repo-root.ts
|
|
463
|
+
import { existsSync, readFileSync } from "fs";
|
|
464
|
+
import { dirname, join as join2, parse, relative as relative2 } from "path";
|
|
465
|
+
function resolveRepoRoot({ cwd }) {
|
|
466
|
+
const workspaceRoot = findWorkspaceRoot(cwd);
|
|
467
|
+
if (workspaceRoot) {
|
|
468
|
+
return workspaceRoot;
|
|
469
|
+
}
|
|
470
|
+
const gitRoot = getGitRootDirectory({ cwd });
|
|
471
|
+
if (gitRoot) {
|
|
472
|
+
return gitRoot;
|
|
473
|
+
}
|
|
474
|
+
return cwd;
|
|
475
|
+
}
|
|
476
|
+
function findWorkspaceRoot(startDir) {
|
|
477
|
+
const { root } = parse(startDir);
|
|
478
|
+
let dir = startDir;
|
|
479
|
+
let highestMatch = null;
|
|
480
|
+
for (let i = 0; i < 64; i++) {
|
|
481
|
+
if (isWorkspaceRoot(dir)) {
|
|
482
|
+
highestMatch = dir;
|
|
483
|
+
}
|
|
484
|
+
if (dir === root)
|
|
485
|
+
break;
|
|
486
|
+
const parent = dirname(dir);
|
|
487
|
+
if (parent === dir)
|
|
488
|
+
break;
|
|
489
|
+
dir = parent;
|
|
490
|
+
}
|
|
491
|
+
return highestMatch;
|
|
492
|
+
}
|
|
493
|
+
function isWorkspaceRoot(dir) {
|
|
494
|
+
if (existsSync(join2(dir, "pnpm-workspace.yaml")) || existsSync(join2(dir, "lerna.json")) || existsSync(join2(dir, "rush.json"))) {
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
const pkgPath = join2(dir, "package.json");
|
|
498
|
+
if (existsSync(pkgPath)) {
|
|
499
|
+
try {
|
|
500
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
501
|
+
const { workspaces } = pkg;
|
|
502
|
+
if (Array.isArray(workspaces) && workspaces.length > 0 || workspaces && typeof workspaces === "object" && Array.isArray(workspaces.packages) && workspaces.packages.length > 0) {
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
} catch {
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
function resolvePerDirectoryLinkRoot(anchorDir, rootDirectorySetting) {
|
|
511
|
+
const repoRoot = resolveRepoRoot({ cwd: anchorDir });
|
|
512
|
+
const linkLocation = normalizeRelative(relative2(repoRoot, anchorDir));
|
|
513
|
+
if (linkLocation === "") {
|
|
514
|
+
return { repoRoot, resolvedRootDirectory: "" };
|
|
515
|
+
}
|
|
516
|
+
const setting = normalizeRelative(rootDirectorySetting ?? "");
|
|
517
|
+
if (setting === "") {
|
|
518
|
+
return { repoRoot, resolvedRootDirectory: linkLocation };
|
|
519
|
+
}
|
|
520
|
+
if (existsSync(join2(anchorDir, setting))) {
|
|
521
|
+
return {
|
|
522
|
+
repoRoot,
|
|
523
|
+
resolvedRootDirectory: normalizeRelative(
|
|
524
|
+
relative2(repoRoot, join2(anchorDir, setting))
|
|
525
|
+
)
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
return {
|
|
529
|
+
repoRoot,
|
|
530
|
+
resolvedRootDirectory: linkLocation,
|
|
531
|
+
advisory: `Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join2(anchorDir, setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
function normalizeRelative(p) {
|
|
535
|
+
const normalized = p.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
|
|
536
|
+
return normalized === "." ? "" : normalized;
|
|
537
|
+
}
|
|
538
|
+
|
|
461
539
|
// src/commands/build/manifest.ts
|
|
462
|
-
import { join as
|
|
540
|
+
import { join as join3 } from "path";
|
|
463
541
|
import {
|
|
464
542
|
FileBlob,
|
|
465
543
|
downloadFile,
|
|
@@ -502,7 +580,7 @@ async function writeManifests(packageManifests, diagnostics, ops, outputDir) {
|
|
|
502
580
|
ops.push(
|
|
503
581
|
downloadFile(
|
|
504
582
|
projectManifestBlob,
|
|
505
|
-
|
|
583
|
+
join3(outputDir, "diagnostics", "project-manifest.json")
|
|
506
584
|
).then(
|
|
507
585
|
() => void 0,
|
|
508
586
|
(err) => err
|
|
@@ -518,7 +596,7 @@ async function writeManifests(packageManifests, diagnostics, ops, outputDir) {
|
|
|
518
596
|
ops.push(
|
|
519
597
|
downloadFile(
|
|
520
598
|
deployManifestBlob,
|
|
521
|
-
|
|
599
|
+
join3(outputDir, "diagnostics", "deploy-manifest.json")
|
|
522
600
|
).then(
|
|
523
601
|
() => void 0,
|
|
524
602
|
(err) => err
|
|
@@ -637,11 +715,13 @@ async function main(client) {
|
|
|
637
715
|
return 1;
|
|
638
716
|
}
|
|
639
717
|
}
|
|
640
|
-
const
|
|
718
|
+
const invokedCwd = cwd;
|
|
719
|
+
const hasRepoLevelLink = Boolean(link?.repoRoot);
|
|
720
|
+
let projectRootDirectory = link?.projectRootDirectory ?? "";
|
|
641
721
|
if (link?.repoRoot) {
|
|
642
722
|
cwd = client.cwd = link.repoRoot;
|
|
643
723
|
}
|
|
644
|
-
const vercelDir =
|
|
724
|
+
const vercelDir = join4(cwd, projectRootDirectory, VERCEL_DIR);
|
|
645
725
|
let project = await rootSpan.child("vc.readProjectSettings").trace(() => readProjectSettings(vercelDir));
|
|
646
726
|
const isTTY = process.stdin.isTTY;
|
|
647
727
|
while (!project?.settings) {
|
|
@@ -697,7 +777,7 @@ async function main(client) {
|
|
|
697
777
|
return 0;
|
|
698
778
|
}
|
|
699
779
|
const { argv: originalArgv } = client;
|
|
700
|
-
client.cwd =
|
|
780
|
+
client.cwd = join4(cwd, projectRootDirectory);
|
|
701
781
|
client.setArgv([
|
|
702
782
|
...originalArgv.slice(0, 2),
|
|
703
783
|
"pull",
|
|
@@ -719,9 +799,23 @@ async function main(client) {
|
|
|
719
799
|
client.setArgv(originalArgv);
|
|
720
800
|
project = await readProjectSettings(vercelDir);
|
|
721
801
|
}
|
|
722
|
-
|
|
802
|
+
if (!hasRepoLevelLink && link && project?.settings && process.env.VERCEL_RESOLVE_ROOT_DIRECTORY === "1") {
|
|
803
|
+
const resolved = resolvePerDirectoryLinkRoot(
|
|
804
|
+
invokedCwd,
|
|
805
|
+
project.settings.rootDirectory
|
|
806
|
+
);
|
|
807
|
+
if (resolved.advisory) {
|
|
808
|
+
output_manager_default.warn(resolved.advisory);
|
|
809
|
+
}
|
|
810
|
+
if (resolved.resolvedRootDirectory !== "") {
|
|
811
|
+
projectRootDirectory = resolved.resolvedRootDirectory;
|
|
812
|
+
project.settings.rootDirectory = resolved.resolvedRootDirectory;
|
|
813
|
+
cwd = client.cwd = resolved.repoRoot;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
const defaultOutputDir = join4(cwd, projectRootDirectory, OUTPUT_DIR);
|
|
723
817
|
const outputDir = parsedArgs.flags["--output"] ? resolve(parsedArgs.flags["--output"]) : defaultOutputDir;
|
|
724
|
-
client.traceDiagnosticsPath =
|
|
818
|
+
client.traceDiagnosticsPath = join4(
|
|
725
819
|
outputDir,
|
|
726
820
|
"diagnostics",
|
|
727
821
|
"cli_traces.json"
|
|
@@ -766,7 +860,7 @@ async function main(client) {
|
|
|
766
860
|
`Loaded ${Object.keys(buildEnv).length} environment variables from deployment ${deploymentId}`
|
|
767
861
|
);
|
|
768
862
|
} else {
|
|
769
|
-
const envPath =
|
|
863
|
+
const envPath = join4(
|
|
770
864
|
cwd,
|
|
771
865
|
projectRootDirectory,
|
|
772
866
|
VERCEL_DIR,
|
|
@@ -804,7 +898,7 @@ async function main(client) {
|
|
|
804
898
|
await rootSpan.stop();
|
|
805
899
|
}
|
|
806
900
|
if (client.nonInteractive) {
|
|
807
|
-
const relOutputDir =
|
|
901
|
+
const relOutputDir = relative3(cwd, outputDir);
|
|
808
902
|
client.stdout.write(
|
|
809
903
|
`${JSON.stringify(
|
|
810
904
|
{
|
|
@@ -857,8 +951,8 @@ async function main(client) {
|
|
|
857
951
|
}
|
|
858
952
|
output_manager_default.prettyError(err);
|
|
859
953
|
buildsJson.error = toEnumerableError(err);
|
|
860
|
-
const buildsJsonPath =
|
|
861
|
-
const configJsonPath =
|
|
954
|
+
const buildsJsonPath = join4(outputDir, "builds.json");
|
|
955
|
+
const configJsonPath = join4(outputDir, "config.json");
|
|
862
956
|
await import_fs_extra2.default.outputJSON(buildsJsonPath, buildsJson, {
|
|
863
957
|
spaces: 2
|
|
864
958
|
});
|
|
@@ -875,11 +969,12 @@ async function main(client) {
|
|
|
875
969
|
async function doBuild(client, project, buildsJson, cwd, outputDir, span, standalone = false) {
|
|
876
970
|
const { localConfigPath } = client;
|
|
877
971
|
const VALID_DEPLOYMENT_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
878
|
-
const workPath =
|
|
972
|
+
const workPath = join4(cwd, project.settings.rootDirectory || ".");
|
|
973
|
+
const repoRootPath = cwd;
|
|
879
974
|
const sourceConfigFile = await findSourceVercelConfigFile(workPath);
|
|
880
975
|
let corepackShimDir;
|
|
881
976
|
if (sourceConfigFile) {
|
|
882
|
-
corepackShimDir = await initCorepack({ repoRootPath
|
|
977
|
+
corepackShimDir = await initCorepack({ repoRootPath });
|
|
883
978
|
const installDepsSpan = span.child("vc.installDeps");
|
|
884
979
|
try {
|
|
885
980
|
const installCommand = project.settings.installCommand;
|
|
@@ -911,9 +1006,9 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
911
1006
|
process.env.VERCEL_INSTALL_COMPLETED = "1";
|
|
912
1007
|
}
|
|
913
1008
|
const compileResult = await span.child("vc.compileVercelConfig").trace(() => compileVercelConfig(workPath));
|
|
914
|
-
const vercelConfigPath = localConfigPath || compileResult.configPath ||
|
|
1009
|
+
const vercelConfigPath = localConfigPath || compileResult.configPath || join4(workPath, "vercel.json");
|
|
915
1010
|
const [pkg, vercelConfig, hasInstrumentation] = await Promise.all([
|
|
916
|
-
readJSONFile(
|
|
1011
|
+
readJSONFile(join4(workPath, "package.json")),
|
|
917
1012
|
readJSONFile(vercelConfigPath),
|
|
918
1013
|
(0, import_fs_detectors2.detectInstrumentation)(new import_fs_detectors2.LocalFileSystemDetector(workPath))
|
|
919
1014
|
]);
|
|
@@ -958,7 +1053,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
958
1053
|
});
|
|
959
1054
|
}
|
|
960
1055
|
const files = (await staticFiles(workPath, {})).map(
|
|
961
|
-
(f) => normalizePath(
|
|
1056
|
+
(f) => normalizePath(relative3(workPath, f))
|
|
962
1057
|
);
|
|
963
1058
|
const routesResult = (0, import_routing_utils2.getTransformedRoutes)(localConfig);
|
|
964
1059
|
if (routesResult.error) {
|
|
@@ -1072,7 +1167,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1072
1167
|
let buildersWithPkgs = await span.child("vc.importBuilders").trace(() => importBuilders(builderSpecs, cwd, span));
|
|
1073
1168
|
const filesMap = {};
|
|
1074
1169
|
for (const path of files) {
|
|
1075
|
-
const fsPath =
|
|
1170
|
+
const fsPath = join4(workPath, path);
|
|
1076
1171
|
const { mode } = await import_fs_extra2.default.stat(fsPath);
|
|
1077
1172
|
filesMap[path] = new FileFsRef({ mode, fsPath });
|
|
1078
1173
|
}
|
|
@@ -1119,7 +1214,6 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1119
1214
|
const executedBuilds = [];
|
|
1120
1215
|
const buildResults = /* @__PURE__ */ new Map();
|
|
1121
1216
|
const overrides = [];
|
|
1122
|
-
const repoRootPath = cwd;
|
|
1123
1217
|
if (!corepackShimDir) {
|
|
1124
1218
|
corepackShimDir = await initCorepack({ repoRootPath });
|
|
1125
1219
|
}
|
|
@@ -1156,7 +1250,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1156
1250
|
let buildFiles = filesMap;
|
|
1157
1251
|
if (service && serviceWorkspace && serviceWorkspace !== ".") {
|
|
1158
1252
|
const wsPrefix = serviceWorkspace + "/";
|
|
1159
|
-
buildWorkPath =
|
|
1253
|
+
buildWorkPath = join4(workPath, serviceWorkspace);
|
|
1160
1254
|
buildEntrypoint = build.src.startsWith(wsPrefix) ? build.src.slice(wsPrefix.length) : build.src;
|
|
1161
1255
|
buildFiles = {};
|
|
1162
1256
|
for (const [filePath, file] of Object.entries(filesMap)) {
|
|
@@ -1389,7 +1483,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1389
1483
|
}
|
|
1390
1484
|
}
|
|
1391
1485
|
if ("output" in buildResult && buildResult.output && (isBackendBuilder(build) || build.use === "@vercel/python")) {
|
|
1392
|
-
const routesJsonPath =
|
|
1486
|
+
const routesJsonPath = join4(buildWorkPath, ".vercel", "routes.json");
|
|
1393
1487
|
if ((0, import_fs_extra2.existsSync)(routesJsonPath)) {
|
|
1394
1488
|
try {
|
|
1395
1489
|
const routesJson = await readJSONFile(routesJsonPath);
|
|
@@ -1469,7 +1563,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1469
1563
|
}
|
|
1470
1564
|
let mergedBuildResult = buildResult;
|
|
1471
1565
|
if ("buildOutputPath" in buildResult) {
|
|
1472
|
-
const buildOutputConfigPath =
|
|
1566
|
+
const buildOutputConfigPath = join4(
|
|
1473
1567
|
buildResult.buildOutputPath,
|
|
1474
1568
|
"config.json"
|
|
1475
1569
|
);
|
|
@@ -1481,7 +1575,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1481
1575
|
}
|
|
1482
1576
|
if (buildOutputConfig) {
|
|
1483
1577
|
if (!hasExperimentalServicesV1ConfiguredInVercelConfig && !hasExperimentalServicesV2ConfiguredInVercelConfig) {
|
|
1484
|
-
const outputConfigPath =
|
|
1578
|
+
const outputConfigPath = join4(outputDir, "config.json");
|
|
1485
1579
|
const outputConfig = await readJSONFile(outputConfigPath);
|
|
1486
1580
|
if (outputConfig instanceof CantParseJSONFile) {
|
|
1487
1581
|
throw outputConfig;
|
|
@@ -1558,7 +1652,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1558
1652
|
throw err;
|
|
1559
1653
|
} finally {
|
|
1560
1654
|
ops.push(
|
|
1561
|
-
download(diagnostics,
|
|
1655
|
+
download(diagnostics, join4(outputDir, "diagnostics")).then(
|
|
1562
1656
|
() => void 0,
|
|
1563
1657
|
(err) => err
|
|
1564
1658
|
)
|
|
@@ -1614,16 +1708,16 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1614
1708
|
await runBuilders(builds);
|
|
1615
1709
|
await flushOps();
|
|
1616
1710
|
if (!hasExperimentalServicesV1ConfiguredInVercelConfig && !hasExperimentalServicesV2ConfiguredInVercelConfig) {
|
|
1617
|
-
const generatedConfigPath =
|
|
1711
|
+
const generatedConfigPath = join4(outputDir, "config.json");
|
|
1618
1712
|
const generatedConfig = await readJSONFile(generatedConfigPath);
|
|
1619
1713
|
if (generatedConfig instanceof CantParseJSONFile) {
|
|
1620
1714
|
throw generatedConfig;
|
|
1621
1715
|
}
|
|
1622
|
-
const defaultGeneratedOutputDir =
|
|
1716
|
+
const defaultGeneratedOutputDir = join4(workPath, OUTPUT_DIR);
|
|
1623
1717
|
const generatedConfigs = [generatedConfig];
|
|
1624
1718
|
if (resolve(outputDir) !== resolve(defaultGeneratedOutputDir)) {
|
|
1625
1719
|
const defaultGeneratedConfig = await readJSONFile(
|
|
1626
|
-
|
|
1720
|
+
join4(defaultGeneratedOutputDir, "config.json")
|
|
1627
1721
|
);
|
|
1628
1722
|
if (defaultGeneratedConfig instanceof CantParseJSONFile) {
|
|
1629
1723
|
throw defaultGeneratedConfig;
|
|
@@ -1758,7 +1852,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1758
1852
|
if (needBuildsJsonOverride) {
|
|
1759
1853
|
await writeBuildJson(buildsJson, outputDir);
|
|
1760
1854
|
}
|
|
1761
|
-
const configPath =
|
|
1855
|
+
const configPath = join4(outputDir, "config.json");
|
|
1762
1856
|
const existingConfig = await readJSONFile(configPath);
|
|
1763
1857
|
if (existingConfig instanceof CantParseJSONFile) {
|
|
1764
1858
|
throw existingConfig;
|
|
@@ -1882,7 +1976,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1882
1976
|
},
|
|
1883
1977
|
...mergedDeploymentId && { deploymentId: mergedDeploymentId }
|
|
1884
1978
|
};
|
|
1885
|
-
await import_fs_extra2.default.writeJSON(
|
|
1979
|
+
await import_fs_extra2.default.writeJSON(join4(outputDir, "config.json"), config, { spaces: 2 });
|
|
1886
1980
|
if (nestExperimentalServicesV2Output) {
|
|
1887
1981
|
await writeServiceConfigs(
|
|
1888
1982
|
outputDir,
|
|
@@ -1894,7 +1988,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1894
1988
|
}
|
|
1895
1989
|
await writeFlagsJSON(buildResults.values(), outputDir);
|
|
1896
1990
|
collectSpan.stop();
|
|
1897
|
-
const relOutputDir =
|
|
1991
|
+
const relOutputDir = relative3(cwd, outputDir);
|
|
1898
1992
|
if (!client.nonInteractive) {
|
|
1899
1993
|
output_manager_default.print(
|
|
1900
1994
|
`${prependEmoji(
|
|
@@ -1911,7 +2005,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1911
2005
|
}
|
|
1912
2006
|
}
|
|
1913
2007
|
function getFunctionUrlPath(vcConfigPath, outputDir) {
|
|
1914
|
-
const funcPath = normalizePath(
|
|
2008
|
+
const funcPath = normalizePath(relative3(outputDir, vcConfigPath)).replace(/^functions\//, "").replace(/\/\.vc-config\.json$/, "").replace(/\.func$/, "");
|
|
1915
2009
|
return "/" + funcPath.split("/").filter((part) => part && part !== "index").join("/");
|
|
1916
2010
|
}
|
|
1917
2011
|
var LAMBDA_SIZE_LIMIT_MB = 250;
|
|
@@ -1940,7 +2034,7 @@ async function analyzeVcConfigFiles(cwd, outputDir) {
|
|
|
1940
2034
|
const filesObject = await glob("**/.vc-config.json", {
|
|
1941
2035
|
cwd: outputDir
|
|
1942
2036
|
});
|
|
1943
|
-
const vcConfigFiles = Object.keys(filesObject).filter((relativePath) => !relativePath.includes(".rsc.func")).map((relativePath) =>
|
|
2037
|
+
const vcConfigFiles = Object.keys(filesObject).filter((relativePath) => !relativePath.includes(".rsc.func")).map((relativePath) => join4(outputDir, relativePath));
|
|
1944
2038
|
if (vcConfigFiles.length === 0) {
|
|
1945
2039
|
output_manager_default.print("No functions to analyze.\n");
|
|
1946
2040
|
return;
|
|
@@ -2002,13 +2096,13 @@ async function analyzeSingleFunction(file, cwd, outputDir) {
|
|
|
2002
2096
|
try {
|
|
2003
2097
|
const content = await import_fs_extra2.default.readFile(file, "utf8");
|
|
2004
2098
|
const parsed = JSON.parse(content);
|
|
2005
|
-
const funcDir =
|
|
2099
|
+
const funcDir = dirname2(file);
|
|
2006
2100
|
const funcDirStats = getDirectorySizeInMB(funcDir);
|
|
2007
2101
|
const filePathMap = parsed.filePathMap && typeof parsed.filePathMap === "object" ? Object.entries(parsed.filePathMap).filter(
|
|
2008
2102
|
(entry) => typeof entry[1] === "string"
|
|
2009
2103
|
).map(([bundlePath, sourcePath]) => ({
|
|
2010
2104
|
bundlePath,
|
|
2011
|
-
sourcePath:
|
|
2105
|
+
sourcePath: join4(cwd, sourcePath)
|
|
2012
2106
|
})) : [];
|
|
2013
2107
|
const fsRefStats = getTotalFileSizeInMB(filePathMap);
|
|
2014
2108
|
const totalSize = funcDirStats.size + fsRefStats.size;
|
|
@@ -2047,7 +2141,7 @@ function getDirectorySizeInMB(dir) {
|
|
|
2047
2141
|
const entries = readdirSync(dir, { recursive: true });
|
|
2048
2142
|
for (const entry of entries) {
|
|
2049
2143
|
const entryPath = typeof entry === "string" ? entry : entry.toString();
|
|
2050
|
-
const fullPath =
|
|
2144
|
+
const fullPath = join4(dir, entryPath);
|
|
2051
2145
|
try {
|
|
2052
2146
|
const stats = statSync(fullPath);
|
|
2053
2147
|
if (stats.isFile()) {
|
|
@@ -2202,7 +2296,7 @@ async function writeServiceConfigs(outputDir, buildResults, serviceByBuilder, se
|
|
|
2202
2296
|
}
|
|
2203
2297
|
await Promise.all(
|
|
2204
2298
|
Array.from(serviceResults.entries()).map(async ([serviceName, results]) => {
|
|
2205
|
-
const configPath =
|
|
2299
|
+
const configPath = join4(
|
|
2206
2300
|
outputDir,
|
|
2207
2301
|
"services",
|
|
2208
2302
|
serviceName,
|
|
@@ -2293,7 +2387,7 @@ async function mergeDeploymentId(existingDeploymentId, buildResults, workPath) {
|
|
|
2293
2387
|
}
|
|
2294
2388
|
}
|
|
2295
2389
|
try {
|
|
2296
|
-
const routesManifestPath =
|
|
2390
|
+
const routesManifestPath = join4(workPath, ".next", "routes-manifest.json");
|
|
2297
2391
|
if (await import_fs_extra2.default.pathExists(routesManifestPath)) {
|
|
2298
2392
|
const routesManifest = await readJSONFile(
|
|
2299
2393
|
routesManifestPath
|
|
@@ -2309,7 +2403,7 @@ async function mergeDeploymentId(existingDeploymentId, buildResults, workPath) {
|
|
|
2309
2403
|
return void 0;
|
|
2310
2404
|
}
|
|
2311
2405
|
async function writeFlagsJSON(buildResults, outputDir) {
|
|
2312
|
-
const flagsFilePath =
|
|
2406
|
+
const flagsFilePath = join4(outputDir, "flags.json");
|
|
2313
2407
|
let hasFlags = true;
|
|
2314
2408
|
const flags = await import_fs_extra2.default.readJSON(flagsFilePath).catch((error) => {
|
|
2315
2409
|
if (error.code === "ENOENT") {
|
|
@@ -2337,7 +2431,7 @@ async function writeFlagsJSON(buildResults, outputDir) {
|
|
|
2337
2431
|
}
|
|
2338
2432
|
}
|
|
2339
2433
|
async function writeBuildJson(buildsJson, outputDir) {
|
|
2340
|
-
await import_fs_extra2.default.writeJSON(
|
|
2434
|
+
await import_fs_extra2.default.writeJSON(join4(outputDir, "builds.json"), buildsJson, { spaces: 2 });
|
|
2341
2435
|
}
|
|
2342
2436
|
async function getFrameworkRoutes(framework, dirPrefix) {
|
|
2343
2437
|
let routes = [];
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
purchaseDomainIfAvailable,
|
|
14
14
|
require_cjs,
|
|
15
15
|
setupDomain
|
|
16
|
-
} from "../../chunks/chunk-
|
|
16
|
+
} from "../../chunks/chunk-JREEV2EL.js";
|
|
17
17
|
import {
|
|
18
18
|
readLocalConfig
|
|
19
|
-
} from "../../chunks/chunk-
|
|
19
|
+
} from "../../chunks/chunk-FZZWTDNQ.js";
|
|
20
20
|
import {
|
|
21
21
|
highlight
|
|
22
22
|
} from "../../chunks/chunk-V5P25P7F.js";
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
deprecatedArchiveSplitTgz,
|
|
41
41
|
getCommandAliases,
|
|
42
42
|
initSubcommand
|
|
43
|
-
} from "../../chunks/chunk-
|
|
43
|
+
} from "../../chunks/chunk-AXFSALI3.js";
|
|
44
44
|
import "../../chunks/chunk-MAJWH2PD.js";
|
|
45
45
|
import "../../chunks/chunk-EFUR47FZ.js";
|
|
46
46
|
import "../../chunks/chunk-UJ5UEAMC.js";
|
|
@@ -50,7 +50,7 @@ import "../../chunks/chunk-DFEUWDGM.js";
|
|
|
50
50
|
import "../../chunks/chunk-FNRZFHFO.js";
|
|
51
51
|
import {
|
|
52
52
|
pickOverrides
|
|
53
|
-
} from "../../chunks/chunk-
|
|
53
|
+
} from "../../chunks/chunk-5MVXR7B7.js";
|
|
54
54
|
import "../../chunks/chunk-NJUPUGOE.js";
|
|
55
55
|
import {
|
|
56
56
|
stamp_default
|
|
@@ -58,17 +58,17 @@ import {
|
|
|
58
58
|
import "../../chunks/chunk-VXYGCOKL.js";
|
|
59
59
|
import {
|
|
60
60
|
ensureLink
|
|
61
|
-
} from "../../chunks/chunk-
|
|
61
|
+
} from "../../chunks/chunk-Q7GZMMHB.js";
|
|
62
62
|
import {
|
|
63
63
|
validatePaths,
|
|
64
64
|
validateRootDirectory
|
|
65
|
-
} from "../../chunks/chunk-
|
|
65
|
+
} from "../../chunks/chunk-6ISLGUMI.js";
|
|
66
66
|
import {
|
|
67
67
|
AGENT_STATUS
|
|
68
68
|
} from "../../chunks/chunk-QH7WYDEP.js";
|
|
69
|
-
import "../../chunks/chunk-
|
|
70
|
-
import "../../chunks/chunk-
|
|
71
|
-
import "../../chunks/chunk-
|
|
69
|
+
import "../../chunks/chunk-YWLVPKNT.js";
|
|
70
|
+
import "../../chunks/chunk-O2QNLUYX.js";
|
|
71
|
+
import "../../chunks/chunk-P726GMBL.js";
|
|
72
72
|
import {
|
|
73
73
|
help
|
|
74
74
|
} from "../../chunks/chunk-YSIZGIDP.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
require_dist as require_dist2,
|
|
86
86
|
require_frameworks,
|
|
87
87
|
require_lib
|
|
88
|
-
} from "../../chunks/chunk-
|
|
88
|
+
} from "../../chunks/chunk-RB7WQKNC.js";
|
|
89
89
|
import {
|
|
90
90
|
outputAgentError
|
|
91
91
|
} from "../../chunks/chunk-IZOHLD5D.js";
|