vercel 54.14.5 → 54.15.0
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-5Z2AAQMM.js → add-6XHROCMP.js} +5 -5
- package/dist/chunks/{chunk-EBIX223X.js → chunk-3RIVJWW5.js} +1 -1
- package/dist/chunks/{chunk-X23JL3ZL.js → chunk-574PHXNT.js} +9 -4
- package/dist/chunks/{chunk-PXJA4KXE.js → chunk-6A62YUBE.js} +3 -3
- package/dist/chunks/{chunk-25XEQWUS.js → chunk-6SL223IW.js} +1 -1
- package/dist/chunks/{chunk-MOVGWTDQ.js → chunk-6TPH3ZBU.js} +6 -5
- package/dist/chunks/{chunk-6ABEFMPX.js → chunk-AG6TBL6C.js} +1 -1
- package/dist/chunks/{chunk-6R3YPU76.js → chunk-CENOYXK3.js} +382 -7
- package/dist/chunks/{chunk-R5MIXAJF.js → chunk-DCN3SOR6.js} +2 -2
- package/dist/chunks/{chunk-ZR4XADWC.js → chunk-EAEEBPMD.js} +2 -2
- package/dist/chunks/{chunk-ETVOM3IR.js → chunk-HSXUEJ4T.js} +1 -1
- package/dist/chunks/{chunk-PSG6ZBGQ.js → chunk-LABX5FSJ.js} +1 -1
- package/dist/chunks/{chunk-2GOVUIMY.js → chunk-LOPPFUV3.js} +2 -2
- package/dist/chunks/{chunk-KSSRTKN4.js → chunk-OEYKL4IY.js} +4 -4
- package/dist/chunks/{chunk-IXTKPQYW.js → chunk-OQD4G5FW.js} +4 -4
- package/dist/chunks/{chunk-LJ5WXXG6.js → chunk-QH7WYDEP.js} +11 -0
- package/dist/chunks/{chunk-2N7NBUQX.js → chunk-RHXSECUF.js} +206 -31
- package/dist/chunks/{chunk-YIAUEFUY.js → chunk-SFPJ3VR7.js} +210 -12
- package/dist/chunks/{chunk-JLLN34XF.js → chunk-TLVKY7WL.js} +4 -4
- package/dist/chunks/{chunk-6H2YVMJJ.js → chunk-UZD3DM6V.js} +1 -1
- package/dist/chunks/{chunk-45S2Y3TD.js → chunk-WGH26RJV.js} +1 -1
- package/dist/chunks/{compile-vercel-config-UMUHH55E.js → compile-vercel-config-ATU3UBFK.js} +1 -1
- package/dist/chunks/{delete-NO2U3UGV.js → delete-WIN4UHQY.js} +3 -3
- package/dist/chunks/{disable-AGDDHVKZ.js → disable-24KUO3TS.js} +3 -3
- package/dist/chunks/{discard-Q5HML52L.js → discard-B6ATZCPD.js} +3 -3
- package/dist/chunks/{edit-HSHJAKHM.js → edit-DIYIVLFQ.js} +7 -7
- package/dist/chunks/{enable-YMJAXOGA.js → enable-BF7NKTV7.js} +3 -3
- package/dist/chunks/{export-RCACOTPE.js → export-HHONDN7V.js} +3 -3
- package/dist/chunks/{inspect-OJHOQHD2.js → inspect-GSYKUMK5.js} +4 -4
- package/dist/chunks/{list-LLUDMAWA.js → list-OSJGB5AE.js} +4 -4
- package/dist/chunks/{list-R7V2P6TM.js → list-PZ4DRWLO.js} +2 -2
- package/dist/chunks/{ls-KAI6V7SU.js → ls-QBCHGSIC.js} +5 -5
- package/dist/chunks/{publish-KCYVRDAT.js → publish-QYPZQ66O.js} +3 -3
- package/dist/chunks/{query-MBJLAQRX.js → query-BDMX4CF6.js} +2 -2
- package/dist/chunks/{reorder-C5BJWFJM.js → reorder-YDTGTTJB.js} +3 -3
- package/dist/chunks/{restore-F63NO7XP.js → restore-LXO2ZBAF.js} +3 -3
- package/dist/chunks/{rm-HT7YO3JX.js → rm-3L7FVCDA.js} +5 -5
- package/dist/chunks/{rule-inspect-IHEUI5JT.js → rule-inspect-T57QBYJR.js} +5 -5
- package/dist/chunks/{rules-ZUBTVSNC.js → rules-E5DTNMFG.js} +7 -7
- package/dist/chunks/{schema-VAQSZY2H.js → schema-VYVJ4GYP.js} +2 -2
- package/dist/chunks/{update-BS5FBLIP.js → update-LT3LZVEZ.js} +5 -5
- package/dist/commands/build/index.js +115 -83
- package/dist/commands/deploy/index.js +11 -11
- package/dist/commands/dev/index.js +9 -9
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +8 -8
- package/dist/commands/list/index.js +3 -3
- package/dist/commands-bulk.js +4824 -1591
- package/dist/index.js +8 -8
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
} from "./chunk-YE3C5CUX.js";
|
|
28
28
|
import {
|
|
29
29
|
getScope
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6SL223IW.js";
|
|
31
31
|
import {
|
|
32
32
|
getLinkedProject,
|
|
33
33
|
getProjectByNameOrId
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SFPJ3VR7.js";
|
|
35
35
|
import "./chunk-HIYWSGI7.js";
|
|
36
36
|
import "./chunk-NHGCQRK5.js";
|
|
37
37
|
import "./chunk-N2T234LO.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveRoute,
|
|
17
17
|
shellQuoteRouteIdentifierForSuggestion,
|
|
18
18
|
withGlobalFlags
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-574PHXNT.js";
|
|
20
20
|
import {
|
|
21
21
|
reorderSubcommand
|
|
22
22
|
} from "./chunk-IB56QKCM.js";
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
stamp_default
|
|
25
25
|
} from "./chunk-64IF634X.js";
|
|
26
26
|
import "./chunk-VXYGCOKL.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-QH7WYDEP.js";
|
|
28
|
+
import "./chunk-SFPJ3VR7.js";
|
|
29
29
|
import "./chunk-HIYWSGI7.js";
|
|
30
30
|
import {
|
|
31
31
|
outputAgentError
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
printDiffSummary,
|
|
20
20
|
validateRequiredArgs,
|
|
21
21
|
withGlobalFlags
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-574PHXNT.js";
|
|
23
23
|
import {
|
|
24
24
|
restoreSubcommand
|
|
25
25
|
} from "./chunk-IB56QKCM.js";
|
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
stamp_default
|
|
28
28
|
} from "./chunk-64IF634X.js";
|
|
29
29
|
import "./chunk-VXYGCOKL.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-QH7WYDEP.js";
|
|
31
|
+
import "./chunk-SFPJ3VR7.js";
|
|
32
32
|
import "./chunk-HIYWSGI7.js";
|
|
33
33
|
import {
|
|
34
34
|
outputAgentError
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-LOPPFUV3.js";
|
|
13
|
+
import "./chunk-6A62YUBE.js";
|
|
14
14
|
import "./chunk-D7MGZH35.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
} from "./chunk-SGPBULVT.js";
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-QH7WYDEP.js";
|
|
24
|
+
import "./chunk-6SL223IW.js";
|
|
25
|
+
import "./chunk-SFPJ3VR7.js";
|
|
26
26
|
import "./chunk-HIYWSGI7.js";
|
|
27
27
|
import {
|
|
28
28
|
buildCommandWithGlobalFlags,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-LOPPFUV3.js";
|
|
13
|
+
import "./chunk-6A62YUBE.js";
|
|
14
14
|
import "./chunk-D7MGZH35.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
} from "./chunk-SGPBULVT.js";
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-QH7WYDEP.js";
|
|
24
|
+
import "./chunk-6SL223IW.js";
|
|
25
|
+
import "./chunk-SFPJ3VR7.js";
|
|
26
26
|
import "./chunk-HIYWSGI7.js";
|
|
27
27
|
import {
|
|
28
28
|
buildCommandWithGlobalFlags,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-YPQSDAEW.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT_REASON
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QH7WYDEP.js";
|
|
13
13
|
import {
|
|
14
14
|
buildCommandWithGlobalFlags,
|
|
15
15
|
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-QBCHGSIC.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-QBCHGSIC.js")).default(client, args);
|
|
69
69
|
case "add":
|
|
70
|
-
return (await import("./add-
|
|
70
|
+
return (await import("./add-6XHROCMP.js")).default(client, args);
|
|
71
71
|
case "inspect":
|
|
72
|
-
return (await import("./rule-inspect-
|
|
72
|
+
return (await import("./rule-inspect-T57QBYJR.js")).default(client, args);
|
|
73
73
|
case "rm":
|
|
74
|
-
return (await import("./rm-
|
|
74
|
+
return (await import("./rm-3L7FVCDA.js")).default(client, args);
|
|
75
75
|
case "update":
|
|
76
|
-
return (await import("./update-
|
|
76
|
+
return (await import("./update-LT3LZVEZ.js")).default(client, args);
|
|
77
77
|
default:
|
|
78
78
|
output_manager_default.error(`Unhandled rules subcommand: ${String(subcommandOriginal)}`);
|
|
79
79
|
return 1;
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
} from "./chunk-YE3C5CUX.js";
|
|
24
24
|
import {
|
|
25
25
|
getScope
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6SL223IW.js";
|
|
27
27
|
import {
|
|
28
28
|
require_pluralize
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SFPJ3VR7.js";
|
|
30
30
|
import "./chunk-HIYWSGI7.js";
|
|
31
31
|
import "./chunk-NHGCQRK5.js";
|
|
32
32
|
import "./chunk-N2T234LO.js";
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-LOPPFUV3.js";
|
|
13
|
+
import "./chunk-6A62YUBE.js";
|
|
14
14
|
import "./chunk-D7MGZH35.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
} from "./chunk-SGPBULVT.js";
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-QH7WYDEP.js";
|
|
24
|
+
import "./chunk-6SL223IW.js";
|
|
25
|
+
import "./chunk-SFPJ3VR7.js";
|
|
26
26
|
import "./chunk-HIYWSGI7.js";
|
|
27
27
|
import {
|
|
28
28
|
buildCommandWithGlobalFlags,
|
|
@@ -11,36 +11,36 @@ import {
|
|
|
11
11
|
isLambda,
|
|
12
12
|
staticFiles,
|
|
13
13
|
writeBuildResult
|
|
14
|
-
} from "../../chunks/chunk-
|
|
14
|
+
} from "../../chunks/chunk-3RIVJWW5.js";
|
|
15
15
|
import {
|
|
16
16
|
pullCommandLogic
|
|
17
|
-
} from "../../chunks/chunk-
|
|
17
|
+
} from "../../chunks/chunk-OEYKL4IY.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-AG6TBL6C.js";
|
|
25
25
|
import "../../chunks/chunk-YI3JV6GM.js";
|
|
26
26
|
import "../../chunks/chunk-BRQ6PX3U.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-DCN3SOR6.js";
|
|
32
32
|
import {
|
|
33
33
|
printProjectNotFoundError
|
|
34
|
-
} from "../../chunks/chunk-
|
|
34
|
+
} from "../../chunks/chunk-OQD4G5FW.js";
|
|
35
35
|
import {
|
|
36
36
|
AGENT_REASON,
|
|
37
37
|
AGENT_STATUS
|
|
38
|
-
} from "../../chunks/chunk-
|
|
39
|
-
import "../../chunks/chunk-
|
|
38
|
+
} from "../../chunks/chunk-QH7WYDEP.js";
|
|
39
|
+
import "../../chunks/chunk-UZD3DM6V.js";
|
|
40
40
|
import {
|
|
41
41
|
buildCommand
|
|
42
|
-
} from "../../chunks/chunk-
|
|
43
|
-
import "../../chunks/chunk-
|
|
42
|
+
} from "../../chunks/chunk-LABX5FSJ.js";
|
|
43
|
+
import "../../chunks/chunk-6SL223IW.js";
|
|
44
44
|
import {
|
|
45
45
|
help
|
|
46
46
|
} from "../../chunks/chunk-AWD3IGXU.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
resolveProjectCwd,
|
|
66
66
|
ua_default,
|
|
67
67
|
validateConfig
|
|
68
|
-
} from "../../chunks/chunk-
|
|
68
|
+
} from "../../chunks/chunk-SFPJ3VR7.js";
|
|
69
69
|
import {
|
|
70
70
|
TelemetryClient
|
|
71
71
|
} from "../../chunks/chunk-HIYWSGI7.js";
|
|
@@ -115,11 +115,10 @@ var import_client = __toESM(require_dist(), 1);
|
|
|
115
115
|
var import_frameworks2 = __toESM(require_frameworks(), 1);
|
|
116
116
|
var import_fs_detectors2 = __toESM(require_dist3(), 1);
|
|
117
117
|
var import_routing_utils2 = __toESM(require_dist2(), 1);
|
|
118
|
-
import { dirname, join as
|
|
118
|
+
import { dirname, join as join3, normalize, relative as relative2, resolve, sep } from "path";
|
|
119
119
|
import { readdirSync, statSync } from "fs";
|
|
120
120
|
import {
|
|
121
121
|
download,
|
|
122
|
-
FileBlob,
|
|
123
122
|
FileFsRef,
|
|
124
123
|
getDiscontinuedNodeVersions,
|
|
125
124
|
getInstalledPackageVersion,
|
|
@@ -133,15 +132,14 @@ import {
|
|
|
133
132
|
Span,
|
|
134
133
|
validateNpmrc,
|
|
135
134
|
glob,
|
|
136
|
-
isExperimentalService,
|
|
135
|
+
isExperimentalService as isExperimentalService2,
|
|
137
136
|
getInternalServiceCronPath,
|
|
138
137
|
getInternalServiceFunctionPath,
|
|
139
138
|
getServiceQueueTopicConfigs,
|
|
140
139
|
isBackendBuilder,
|
|
141
140
|
isQueueBackedService,
|
|
142
141
|
isScheduleTriggeredService,
|
|
143
|
-
sanitizeConsumerName
|
|
144
|
-
downloadFile
|
|
142
|
+
sanitizeConsumerName
|
|
145
143
|
} from "@vercel/build-utils";
|
|
146
144
|
|
|
147
145
|
// src/util/build/corepack.ts
|
|
@@ -459,6 +457,74 @@ async function shouldEmbedFlagsDefinitions(cwd) {
|
|
|
459
457
|
return false;
|
|
460
458
|
}
|
|
461
459
|
|
|
460
|
+
// src/commands/build/manifest.ts
|
|
461
|
+
import { join as join2 } from "path";
|
|
462
|
+
import {
|
|
463
|
+
FileBlob,
|
|
464
|
+
downloadFile,
|
|
465
|
+
isExperimentalService
|
|
466
|
+
} from "@vercel/build-utils";
|
|
467
|
+
async function writeManifests(packageManifests, diagnostics, ops, outputDir) {
|
|
468
|
+
if (packageManifests.length === 0)
|
|
469
|
+
return;
|
|
470
|
+
const projectManifest = {};
|
|
471
|
+
const deployManifestBuilds = {};
|
|
472
|
+
for (const {
|
|
473
|
+
workspace,
|
|
474
|
+
buildConfig,
|
|
475
|
+
manifest,
|
|
476
|
+
service,
|
|
477
|
+
builderUse
|
|
478
|
+
} of packageManifests) {
|
|
479
|
+
const key = `${builderUse}:${workspace}`;
|
|
480
|
+
projectManifest[key] = {
|
|
481
|
+
...manifest,
|
|
482
|
+
workspace,
|
|
483
|
+
builder: builderUse,
|
|
484
|
+
framework: service?.framework ?? buildConfig.framework,
|
|
485
|
+
serviceName: service?.name,
|
|
486
|
+
serviceType: service && isExperimentalService(service) ? service.type : void 0,
|
|
487
|
+
routePrefix: service && isExperimentalService(service) ? service.routePrefix : void 0
|
|
488
|
+
};
|
|
489
|
+
deployManifestBuilds[key] = {
|
|
490
|
+
...manifest,
|
|
491
|
+
root: workspace,
|
|
492
|
+
builder: builderUse
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
if (Object.keys(projectManifest).length === 0)
|
|
496
|
+
return;
|
|
497
|
+
const projectManifestBlob = new FileBlob({
|
|
498
|
+
data: JSON.stringify(projectManifest)
|
|
499
|
+
});
|
|
500
|
+
diagnostics["project-manifest.json"] = projectManifestBlob;
|
|
501
|
+
ops.push(
|
|
502
|
+
downloadFile(
|
|
503
|
+
projectManifestBlob,
|
|
504
|
+
join2(outputDir, "diagnostics", "project-manifest.json")
|
|
505
|
+
).then(
|
|
506
|
+
() => void 0,
|
|
507
|
+
(err) => err
|
|
508
|
+
)
|
|
509
|
+
);
|
|
510
|
+
const deployManifestBlob = new FileBlob({
|
|
511
|
+
data: JSON.stringify({
|
|
512
|
+
manifestVersion: "2.0",
|
|
513
|
+
builds: deployManifestBuilds
|
|
514
|
+
})
|
|
515
|
+
});
|
|
516
|
+
diagnostics["deploy-manifest.json"] = deployManifestBlob;
|
|
517
|
+
ops.push(
|
|
518
|
+
downloadFile(
|
|
519
|
+
deployManifestBlob,
|
|
520
|
+
join2(outputDir, "diagnostics", "deploy-manifest.json")
|
|
521
|
+
).then(
|
|
522
|
+
() => void 0,
|
|
523
|
+
(err) => err
|
|
524
|
+
)
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
462
528
|
// src/commands/build/index.ts
|
|
463
529
|
function buildCommandWithGlobalFlags(baseSubcommand, argv) {
|
|
464
530
|
const globalFlags = getGlobalFlagsOnlyFromArgs(argv.slice(2));
|
|
@@ -574,7 +640,7 @@ async function main(client) {
|
|
|
574
640
|
if (link?.repoRoot) {
|
|
575
641
|
cwd = client.cwd = link.repoRoot;
|
|
576
642
|
}
|
|
577
|
-
const vercelDir =
|
|
643
|
+
const vercelDir = join3(cwd, projectRootDirectory, VERCEL_DIR);
|
|
578
644
|
let project = await rootSpan.child("vc.readProjectSettings").trace(() => readProjectSettings(vercelDir));
|
|
579
645
|
const isTTY = process.stdin.isTTY;
|
|
580
646
|
while (!project?.settings) {
|
|
@@ -630,7 +696,7 @@ async function main(client) {
|
|
|
630
696
|
return 0;
|
|
631
697
|
}
|
|
632
698
|
const { argv: originalArgv } = client;
|
|
633
|
-
client.cwd =
|
|
699
|
+
client.cwd = join3(cwd, projectRootDirectory);
|
|
634
700
|
client.setArgv([
|
|
635
701
|
...originalArgv.slice(0, 2),
|
|
636
702
|
"pull",
|
|
@@ -652,9 +718,9 @@ async function main(client) {
|
|
|
652
718
|
client.setArgv(originalArgv);
|
|
653
719
|
project = await readProjectSettings(vercelDir);
|
|
654
720
|
}
|
|
655
|
-
const defaultOutputDir =
|
|
721
|
+
const defaultOutputDir = join3(cwd, projectRootDirectory, OUTPUT_DIR);
|
|
656
722
|
const outputDir = parsedArgs.flags["--output"] ? resolve(parsedArgs.flags["--output"]) : defaultOutputDir;
|
|
657
|
-
client.traceDiagnosticsPath =
|
|
723
|
+
client.traceDiagnosticsPath = join3(
|
|
658
724
|
outputDir,
|
|
659
725
|
"diagnostics",
|
|
660
726
|
"cli_traces.json"
|
|
@@ -699,7 +765,7 @@ async function main(client) {
|
|
|
699
765
|
`Loaded ${Object.keys(buildEnv).length} environment variables from deployment ${deploymentId}`
|
|
700
766
|
);
|
|
701
767
|
} else {
|
|
702
|
-
const envPath =
|
|
768
|
+
const envPath = join3(
|
|
703
769
|
cwd,
|
|
704
770
|
projectRootDirectory,
|
|
705
771
|
VERCEL_DIR,
|
|
@@ -790,8 +856,8 @@ async function main(client) {
|
|
|
790
856
|
}
|
|
791
857
|
output_manager_default.prettyError(err);
|
|
792
858
|
buildsJson.error = toEnumerableError(err);
|
|
793
|
-
const buildsJsonPath =
|
|
794
|
-
const configJsonPath =
|
|
859
|
+
const buildsJsonPath = join3(outputDir, "builds.json");
|
|
860
|
+
const configJsonPath = join3(outputDir, "config.json");
|
|
795
861
|
await import_fs_extra2.default.outputJSON(buildsJsonPath, buildsJson, {
|
|
796
862
|
spaces: 2
|
|
797
863
|
});
|
|
@@ -808,7 +874,7 @@ async function main(client) {
|
|
|
808
874
|
async function doBuild(client, project, buildsJson, cwd, outputDir, span, standalone = false) {
|
|
809
875
|
const { localConfigPath } = client;
|
|
810
876
|
const VALID_DEPLOYMENT_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
811
|
-
const workPath =
|
|
877
|
+
const workPath = join3(cwd, project.settings.rootDirectory || ".");
|
|
812
878
|
const sourceConfigFile = await findSourceVercelConfigFile(workPath);
|
|
813
879
|
let corepackShimDir;
|
|
814
880
|
if (sourceConfigFile) {
|
|
@@ -844,9 +910,9 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
844
910
|
process.env.VERCEL_INSTALL_COMPLETED = "1";
|
|
845
911
|
}
|
|
846
912
|
const compileResult = await span.child("vc.compileVercelConfig").trace(() => compileVercelConfig(workPath));
|
|
847
|
-
const vercelConfigPath = localConfigPath || compileResult.configPath ||
|
|
913
|
+
const vercelConfigPath = localConfigPath || compileResult.configPath || join3(workPath, "vercel.json");
|
|
848
914
|
const [pkg, vercelConfig, hasInstrumentation] = await Promise.all([
|
|
849
|
-
readJSONFile(
|
|
915
|
+
readJSONFile(join3(workPath, "package.json")),
|
|
850
916
|
readJSONFile(vercelConfigPath),
|
|
851
917
|
(0, import_fs_detectors2.detectInstrumentation)(new import_fs_detectors2.LocalFileSystemDetector(workPath))
|
|
852
918
|
]);
|
|
@@ -953,7 +1019,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
953
1019
|
builds = [{ src: "**", use: "@vercel/static" }];
|
|
954
1020
|
}
|
|
955
1021
|
detectedResolvedServices = detectedBuilders.services;
|
|
956
|
-
detectedServices = detectedBuilders.services?.filter(
|
|
1022
|
+
detectedServices = detectedBuilders.services?.filter(isExperimentalService2);
|
|
957
1023
|
if (detectedBuilders.useImplicitEnvInjection && detectedServices && detectedServices.length > 0) {
|
|
958
1024
|
const serviceUrlEnvVars = getExperimentalServiceUrlEnvVars({
|
|
959
1025
|
services: detectedServices,
|
|
@@ -995,7 +1061,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
995
1061
|
let buildersWithPkgs = await span.child("vc.importBuilders").trace(() => importBuilders(builderSpecs, cwd, span));
|
|
996
1062
|
const filesMap = {};
|
|
997
1063
|
for (const path of files) {
|
|
998
|
-
const fsPath =
|
|
1064
|
+
const fsPath = join3(workPath, path);
|
|
999
1065
|
const { mode } = await import_fs_extra2.default.stat(fsPath);
|
|
1000
1066
|
filesMap[path] = new FileFsRef({ mode, fsPath });
|
|
1001
1067
|
}
|
|
@@ -1071,15 +1137,15 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1071
1137
|
try {
|
|
1072
1138
|
const { builder, pkg: builderPkg } = builderWithPkg;
|
|
1073
1139
|
const service = getHasDetectedServices() ? serviceByBuilder.get(build) : void 0;
|
|
1074
|
-
const legacyExperimentalService = service &&
|
|
1075
|
-
const serviceWorkspace = service ?
|
|
1140
|
+
const legacyExperimentalService = service && isExperimentalService2(service) ? service : void 0;
|
|
1141
|
+
const serviceWorkspace = service ? isExperimentalService2(service) ? service.workspace : service.root : void 0;
|
|
1076
1142
|
const stripServiceRoutePrefix = !!legacyExperimentalService?.routePrefix && legacyExperimentalService.routePrefix !== "/";
|
|
1077
1143
|
let buildWorkPath = workPath;
|
|
1078
1144
|
let buildEntrypoint = build.src;
|
|
1079
1145
|
let buildFiles = filesMap;
|
|
1080
1146
|
if (service && serviceWorkspace && serviceWorkspace !== ".") {
|
|
1081
1147
|
const wsPrefix = serviceWorkspace + "/";
|
|
1082
|
-
buildWorkPath =
|
|
1148
|
+
buildWorkPath = join3(workPath, serviceWorkspace);
|
|
1083
1149
|
buildEntrypoint = build.src.startsWith(wsPrefix) ? build.src.slice(wsPrefix.length) : build.src;
|
|
1084
1150
|
buildFiles = {};
|
|
1085
1151
|
for (const [filePath, file] of Object.entries(filesMap)) {
|
|
@@ -1308,7 +1374,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1308
1374
|
}
|
|
1309
1375
|
}
|
|
1310
1376
|
if ("output" in buildResult && buildResult.output && (isBackendBuilder(build) || build.use === "@vercel/python")) {
|
|
1311
|
-
const routesJsonPath =
|
|
1377
|
+
const routesJsonPath = join3(buildWorkPath, ".vercel", "routes.json");
|
|
1312
1378
|
if ((0, import_fs_extra2.existsSync)(routesJsonPath)) {
|
|
1313
1379
|
try {
|
|
1314
1380
|
const routesJson = await readJSONFile(routesJsonPath);
|
|
@@ -1388,7 +1454,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1388
1454
|
}
|
|
1389
1455
|
let mergedBuildResult = buildResult;
|
|
1390
1456
|
if ("buildOutputPath" in buildResult) {
|
|
1391
|
-
const buildOutputConfigPath =
|
|
1457
|
+
const buildOutputConfigPath = join3(
|
|
1392
1458
|
buildResult.buildOutputPath,
|
|
1393
1459
|
"config.json"
|
|
1394
1460
|
);
|
|
@@ -1400,7 +1466,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1400
1466
|
}
|
|
1401
1467
|
if (buildOutputConfig) {
|
|
1402
1468
|
if (!hasExperimentalServicesV1ConfiguredInVercelConfig && !hasExperimentalServicesV2ConfiguredInVercelConfig) {
|
|
1403
|
-
const outputConfigPath =
|
|
1469
|
+
const outputConfigPath = join3(outputDir, "config.json");
|
|
1404
1470
|
const outputConfig = await readJSONFile(outputConfigPath);
|
|
1405
1471
|
if (outputConfig instanceof CantParseJSONFile) {
|
|
1406
1472
|
throw outputConfig;
|
|
@@ -1474,7 +1540,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1474
1540
|
throw err;
|
|
1475
1541
|
} finally {
|
|
1476
1542
|
ops.push(
|
|
1477
|
-
download(diagnostics,
|
|
1543
|
+
download(diagnostics, join3(outputDir, "diagnostics")).then(
|
|
1478
1544
|
() => void 0,
|
|
1479
1545
|
(err) => err
|
|
1480
1546
|
)
|
|
@@ -1530,16 +1596,16 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1530
1596
|
await runBuilders(builds);
|
|
1531
1597
|
await flushOps();
|
|
1532
1598
|
if (!hasExperimentalServicesV1ConfiguredInVercelConfig && !hasExperimentalServicesV2ConfiguredInVercelConfig) {
|
|
1533
|
-
const generatedConfigPath =
|
|
1599
|
+
const generatedConfigPath = join3(outputDir, "config.json");
|
|
1534
1600
|
const generatedConfig = await readJSONFile(generatedConfigPath);
|
|
1535
1601
|
if (generatedConfig instanceof CantParseJSONFile) {
|
|
1536
1602
|
throw generatedConfig;
|
|
1537
1603
|
}
|
|
1538
|
-
const defaultGeneratedOutputDir =
|
|
1604
|
+
const defaultGeneratedOutputDir = join3(workPath, OUTPUT_DIR);
|
|
1539
1605
|
const generatedConfigs = [generatedConfig];
|
|
1540
1606
|
if (resolve(outputDir) !== resolve(defaultGeneratedOutputDir)) {
|
|
1541
1607
|
const defaultGeneratedConfig = await readJSONFile(
|
|
1542
|
-
|
|
1608
|
+
join3(defaultGeneratedOutputDir, "config.json")
|
|
1543
1609
|
);
|
|
1544
1610
|
if (defaultGeneratedConfig instanceof CantParseJSONFile) {
|
|
1545
1611
|
throw defaultGeneratedConfig;
|
|
@@ -1589,7 +1655,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1589
1655
|
detectedServices = void 0;
|
|
1590
1656
|
} else {
|
|
1591
1657
|
detectedServices = detectedResolvedServices.filter(
|
|
1592
|
-
|
|
1658
|
+
isExperimentalService2
|
|
1593
1659
|
);
|
|
1594
1660
|
if (detectedServices.length > 0) {
|
|
1595
1661
|
appendExperimentalServicesV1Routes(detectedServices);
|
|
@@ -1640,41 +1706,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1640
1706
|
);
|
|
1641
1707
|
}
|
|
1642
1708
|
}
|
|
1643
|
-
|
|
1644
|
-
const projectManifest = {};
|
|
1645
|
-
for (const {
|
|
1646
|
-
workspace,
|
|
1647
|
-
buildConfig,
|
|
1648
|
-
manifest,
|
|
1649
|
-
service,
|
|
1650
|
-
builderUse
|
|
1651
|
-
} of packageManifests) {
|
|
1652
|
-
projectManifest[`${builderUse}:${workspace}`] = {
|
|
1653
|
-
...manifest,
|
|
1654
|
-
workspace,
|
|
1655
|
-
builder: builderUse,
|
|
1656
|
-
framework: service?.framework ?? buildConfig.framework,
|
|
1657
|
-
serviceName: service?.name,
|
|
1658
|
-
serviceType: service && isExperimentalService(service) ? service.type : void 0,
|
|
1659
|
-
routePrefix: service && isExperimentalService(service) ? service.routePrefix : void 0
|
|
1660
|
-
};
|
|
1661
|
-
}
|
|
1662
|
-
if (Object.keys(projectManifest).length > 0) {
|
|
1663
|
-
const projectManifestBlob = new FileBlob({
|
|
1664
|
-
data: JSON.stringify(projectManifest)
|
|
1665
|
-
});
|
|
1666
|
-
diagnostics["project-manifest.json"] = projectManifestBlob;
|
|
1667
|
-
ops.push(
|
|
1668
|
-
downloadFile(
|
|
1669
|
-
projectManifestBlob,
|
|
1670
|
-
join2(outputDir, "diagnostics", "project-manifest.json")
|
|
1671
|
-
).then(
|
|
1672
|
-
() => void 0,
|
|
1673
|
-
(err) => err
|
|
1674
|
-
)
|
|
1675
|
-
);
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1709
|
+
await writeManifests(packageManifests, diagnostics, ops, outputDir);
|
|
1678
1710
|
if (corepackShimDir) {
|
|
1679
1711
|
cleanupCorepack(corepackShimDir);
|
|
1680
1712
|
}
|
|
@@ -1702,7 +1734,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1702
1734
|
if (needBuildsJsonOverride) {
|
|
1703
1735
|
await writeBuildJson(buildsJson, outputDir);
|
|
1704
1736
|
}
|
|
1705
|
-
const configPath =
|
|
1737
|
+
const configPath = join3(outputDir, "config.json");
|
|
1706
1738
|
const existingConfig = await readJSONFile(configPath);
|
|
1707
1739
|
if (existingConfig instanceof CantParseJSONFile) {
|
|
1708
1740
|
throw existingConfig;
|
|
@@ -1742,7 +1774,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1742
1774
|
let entrypoint = build.src;
|
|
1743
1775
|
if (getHasDetectedServices() && typeof build.src === "string") {
|
|
1744
1776
|
const service = serviceByBuilder.get(build);
|
|
1745
|
-
if (service &&
|
|
1777
|
+
if (service && isExperimentalService2(service) && service.type === "web" && typeof service.routePrefix === "string") {
|
|
1746
1778
|
entrypoint = getServicesMergeEntrypoint(service, build.src);
|
|
1747
1779
|
}
|
|
1748
1780
|
}
|
|
@@ -1824,7 +1856,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1824
1856
|
...!detectedExperimentalServicesV1Config && detectedServices && detectedServices.length > 0 && { services: detectedServices },
|
|
1825
1857
|
...mergedDeploymentId && { deploymentId: mergedDeploymentId }
|
|
1826
1858
|
};
|
|
1827
|
-
await import_fs_extra2.default.writeJSON(
|
|
1859
|
+
await import_fs_extra2.default.writeJSON(join3(outputDir, "config.json"), config, { spaces: 2 });
|
|
1828
1860
|
if (nestExperimentalServicesV2Output) {
|
|
1829
1861
|
await writeServiceConfigs(
|
|
1830
1862
|
outputDir,
|
|
@@ -1882,7 +1914,7 @@ async function analyzeVcConfigFiles(cwd, outputDir) {
|
|
|
1882
1914
|
const filesObject = await glob("**/.vc-config.json", {
|
|
1883
1915
|
cwd: outputDir
|
|
1884
1916
|
});
|
|
1885
|
-
const vcConfigFiles = Object.keys(filesObject).filter((relativePath) => !relativePath.includes(".rsc.func")).map((relativePath) =>
|
|
1917
|
+
const vcConfigFiles = Object.keys(filesObject).filter((relativePath) => !relativePath.includes(".rsc.func")).map((relativePath) => join3(outputDir, relativePath));
|
|
1886
1918
|
if (vcConfigFiles.length === 0) {
|
|
1887
1919
|
output_manager_default.print("No functions to analyze.\n");
|
|
1888
1920
|
return;
|
|
@@ -1950,7 +1982,7 @@ async function analyzeSingleFunction(file, cwd, outputDir) {
|
|
|
1950
1982
|
(entry) => typeof entry[1] === "string"
|
|
1951
1983
|
).map(([bundlePath, sourcePath]) => ({
|
|
1952
1984
|
bundlePath,
|
|
1953
|
-
sourcePath:
|
|
1985
|
+
sourcePath: join3(cwd, sourcePath)
|
|
1954
1986
|
})) : [];
|
|
1955
1987
|
const fsRefStats = getTotalFileSizeInMB(filePathMap);
|
|
1956
1988
|
const totalSize = funcDirStats.size + fsRefStats.size;
|
|
@@ -1989,7 +2021,7 @@ function getDirectorySizeInMB(dir) {
|
|
|
1989
2021
|
const entries = readdirSync(dir, { recursive: true });
|
|
1990
2022
|
for (const entry of entries) {
|
|
1991
2023
|
const entryPath = typeof entry === "string" ? entry : entry.toString();
|
|
1992
|
-
const fullPath =
|
|
2024
|
+
const fullPath = join3(dir, entryPath);
|
|
1993
2025
|
try {
|
|
1994
2026
|
const stats = statSync(fullPath);
|
|
1995
2027
|
if (stats.isFile()) {
|
|
@@ -2144,7 +2176,7 @@ async function writeServiceConfigs(outputDir, buildResults, serviceByBuilder, se
|
|
|
2144
2176
|
}
|
|
2145
2177
|
await Promise.all(
|
|
2146
2178
|
Array.from(serviceResults.entries()).map(async ([serviceName, results]) => {
|
|
2147
|
-
const configPath =
|
|
2179
|
+
const configPath = join3(
|
|
2148
2180
|
outputDir,
|
|
2149
2181
|
"services",
|
|
2150
2182
|
serviceName,
|
|
@@ -2229,7 +2261,7 @@ async function mergeDeploymentId(existingDeploymentId, buildResults, workPath) {
|
|
|
2229
2261
|
}
|
|
2230
2262
|
}
|
|
2231
2263
|
try {
|
|
2232
|
-
const routesManifestPath =
|
|
2264
|
+
const routesManifestPath = join3(workPath, ".next", "routes-manifest.json");
|
|
2233
2265
|
if (await import_fs_extra2.default.pathExists(routesManifestPath)) {
|
|
2234
2266
|
const routesManifest = await readJSONFile(
|
|
2235
2267
|
routesManifestPath
|
|
@@ -2245,7 +2277,7 @@ async function mergeDeploymentId(existingDeploymentId, buildResults, workPath) {
|
|
|
2245
2277
|
return void 0;
|
|
2246
2278
|
}
|
|
2247
2279
|
async function writeFlagsJSON(buildResults, outputDir) {
|
|
2248
|
-
const flagsFilePath =
|
|
2280
|
+
const flagsFilePath = join3(outputDir, "flags.json");
|
|
2249
2281
|
let hasFlags = true;
|
|
2250
2282
|
const flags = await import_fs_extra2.default.readJSON(flagsFilePath).catch((error) => {
|
|
2251
2283
|
if (error.code === "ENOENT") {
|
|
@@ -2273,7 +2305,7 @@ async function writeFlagsJSON(buildResults, outputDir) {
|
|
|
2273
2305
|
}
|
|
2274
2306
|
}
|
|
2275
2307
|
async function writeBuildJson(buildsJson, outputDir) {
|
|
2276
|
-
await import_fs_extra2.default.writeJSON(
|
|
2308
|
+
await import_fs_extra2.default.writeJSON(join3(outputDir, "builds.json"), buildsJson, { spaces: 2 });
|
|
2277
2309
|
}
|
|
2278
2310
|
async function getFrameworkRoutes(framework, dirPrefix) {
|
|
2279
2311
|
let routes = [];
|