vercel 51.2.1 → 51.4.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-RNQLGEYS.js +180 -0
- package/dist/chunks/{chunk-XAVGWINL.js → chunk-3GDNTBCE.js} +44 -13
- package/dist/chunks/{chunk-SSOWPEZT.js → chunk-4DR2FV6O.js} +2 -2
- package/dist/chunks/{chunk-Q6BEDVOU.js → chunk-4PQA6H63.js} +1 -1
- package/dist/chunks/{chunk-IS2HEMF4.js → chunk-4RBF6ZDU.js} +4 -2
- package/dist/chunks/{chunk-7S7GE4BN.js → chunk-537JTK2U.js} +216 -523
- package/dist/chunks/{chunk-K5XJCQQO.js → chunk-5NTBJ33M.js} +1 -1
- package/dist/chunks/{chunk-5YQCJTZI.js → chunk-5VKKTHMP.js} +6 -6
- package/dist/chunks/{chunk-W6FW7CCT.js → chunk-6C33Y3DC.js} +13 -8
- package/dist/chunks/{chunk-5WHDQH2U.js → chunk-7MF47FW3.js} +1 -1
- package/dist/chunks/chunk-7ZDERWUW.js +167 -0
- package/dist/chunks/{chunk-RK4TKB3D.js → chunk-AUSDBXUD.js} +7 -5
- package/dist/chunks/{chunk-BUBUVE23.js → chunk-BJQTGP42.js} +4 -2
- package/dist/chunks/{chunk-57RLFBKC.js → chunk-BRQBLRFB.js} +1 -1
- package/dist/chunks/chunk-CGTXAXZ4.js +484 -0
- package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-CRZM5WM2.js} +4 -2
- package/dist/chunks/{chunk-VTQNSCUG.js → chunk-D2D4FJ6S.js} +8 -6
- package/dist/chunks/{chunk-G6MVEB4W.js → chunk-DKFFXOHJ.js} +3 -3
- package/dist/chunks/chunk-DVQ4SIWF.js +183 -0
- package/dist/chunks/{chunk-A4NVECX5.js → chunk-ECRBC4HL.js} +4 -581
- package/dist/chunks/{chunk-L2BKVTHL.js → chunk-G6RXZLQ2.js} +2 -2
- package/dist/chunks/{chunk-4YZKA4FN.js → chunk-GE6G37P4.js} +1 -1
- package/dist/chunks/{chunk-NELCIT4M.js → chunk-GLDQ23LD.js} +1 -1
- package/dist/chunks/{chunk-QQTF2FEY.js → chunk-HNU5CXW4.js} +9 -5
- package/dist/chunks/chunk-HQXVCOH6.js +139 -0
- package/dist/chunks/{chunk-3FMFPD7F.js → chunk-L2JUC7NX.js} +2 -2
- package/dist/chunks/{chunk-Y5YCSB6X.js → chunk-LDXYSGPZ.js} +2 -2
- package/dist/chunks/{chunk-U5J73OA3.js → chunk-N45K6NXC.js} +1 -1
- package/dist/chunks/{chunk-5DLMAFQU.js → chunk-NKJC5SI4.js} +6 -4
- package/dist/chunks/{chunk-FSOFFJDV.js → chunk-O7SQKNIT.js} +1 -1
- package/dist/chunks/{chunk-XRR5HDB3.js → chunk-P56KWLXY.js} +2 -2
- package/dist/chunks/{chunk-EHZKWVK2.js → chunk-PBGN54ZH.js} +5 -5
- package/dist/chunks/chunk-RFMC2QXQ.js +602 -0
- package/dist/chunks/{chunk-W5K4YCTI.js → chunk-RJD5NYGF.js} +5 -3
- package/dist/chunks/{chunk-WXNT7WJO.js → chunk-TAOVG4PS.js} +49 -4
- package/dist/chunks/{chunk-4EGCWWSR.js → chunk-UJ4JXXED.js} +143 -16
- package/dist/chunks/{chunk-2IAZZEVQ.js → chunk-UWKTUK3W.js} +4 -2
- package/dist/chunks/{chunk-VE7MY76H.js → chunk-VGWGLBUC.js} +4 -2
- package/dist/chunks/{compile-vercel-config-2GV46IDP.js → compile-vercel-config-ZVY7LBE3.js} +4 -2
- package/dist/chunks/{delete-PXMYSQGR.js → delete-SKTJMJNP.js} +7 -5
- package/dist/chunks/{disable-2ZQ4OG4A.js → disable-AG7I6DPV.js} +7 -5
- package/dist/chunks/{discard-FQZTZ5HK.js → discard-LUK6LBLT.js} +7 -5
- package/dist/chunks/{edit-F3J7Q5SZ.js → edit-3BR5HP3U.js} +8 -6
- package/dist/chunks/{enable-ZW4W33H5.js → enable-4JNLOKSM.js} +7 -5
- package/dist/chunks/{export-ZZV6ESIW.js → export-YLZ6QSHG.js} +7 -5
- package/dist/chunks/inspect-HUJLUQAV.js +353 -0
- package/dist/chunks/{list-SSIMVNNN.js → list-EPU4SB3E.js} +10 -7
- package/dist/chunks/{list-VFPV4TUW.js → list-RMA56KYZ.js} +115 -85
- package/dist/chunks/ls-7HHDYE6F.js +114 -0
- package/dist/chunks/{publish-3K76MNS3.js → publish-6YE4OUDI.js} +7 -5
- package/dist/chunks/{query-CY7JJSSX.js → query-VNBKOI65.js} +15 -12
- package/dist/chunks/{reorder-6L7MENN5.js → reorder-VFM23ESC.js} +7 -5
- package/dist/chunks/{restore-XUYXOJQ2.js → restore-VX34SXVF.js} +7 -5
- package/dist/chunks/rm-5KXF2PY3.js +164 -0
- package/dist/chunks/rule-inspect-JG7AE5TI.js +142 -0
- package/dist/chunks/rules-XRJBT22L.js +83 -0
- package/dist/chunks/{schema-G5FSLZVA.js → schema-FUOKCZTW.js} +9 -7
- package/dist/chunks/{types-A4EAQ6F6.js → types-QNN5CDCB.js} +6 -4
- package/dist/chunks/update-4FMWTIJK.js +196 -0
- package/dist/commands/build/index.js +36 -43
- package/dist/commands/deploy/index.js +171 -32
- package/dist/commands/dev/index.js +36 -31
- package/dist/commands/env/index.js +32 -27
- package/dist/commands/link/index.js +21 -17
- package/dist/commands/list/index.js +14 -11
- package/dist/commands-bulk.js +1640 -884
- package/dist/index.js +28 -24
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
emitRulesArgParseError,
|
|
9
|
+
handleRulesApiError,
|
|
10
|
+
parseRulesFlagsAndScope,
|
|
11
|
+
rulesCollectionPath
|
|
12
|
+
} from "./chunk-HQXVCOH6.js";
|
|
13
|
+
import "./chunk-7ZDERWUW.js";
|
|
14
|
+
import "./chunk-HTOH3MSD.js";
|
|
15
|
+
import "./chunk-L2JUC7NX.js";
|
|
16
|
+
import {
|
|
17
|
+
validateJsonOutput
|
|
18
|
+
} from "./chunk-XPKWKPWA.js";
|
|
19
|
+
import {
|
|
20
|
+
rulesAddSubcommand
|
|
21
|
+
} from "./chunk-DVQ4SIWF.js";
|
|
22
|
+
import {
|
|
23
|
+
AGENT_REASON
|
|
24
|
+
} from "./chunk-E3NE4SKN.js";
|
|
25
|
+
import "./chunk-537JTK2U.js";
|
|
26
|
+
import "./chunk-U3WLEFHU.js";
|
|
27
|
+
import {
|
|
28
|
+
buildCommandWithGlobalFlags,
|
|
29
|
+
outputAgentError
|
|
30
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
31
|
+
import "./chunk-CO5D46AG.js";
|
|
32
|
+
import {
|
|
33
|
+
getFlagsSpecification,
|
|
34
|
+
parseArguments,
|
|
35
|
+
printError
|
|
36
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
37
|
+
import {
|
|
38
|
+
isAPIError,
|
|
39
|
+
packageName
|
|
40
|
+
} from "./chunk-ECRBC4HL.js";
|
|
41
|
+
import {
|
|
42
|
+
output_manager_default
|
|
43
|
+
} from "./chunk-ZQKJVHXY.js";
|
|
44
|
+
import "./chunk-S7KYDPEM.js";
|
|
45
|
+
import "./chunk-TZ2YI2VH.js";
|
|
46
|
+
|
|
47
|
+
// src/commands/alerts/rules/add.ts
|
|
48
|
+
import { readFileSync } from "fs";
|
|
49
|
+
import { resolve } from "path";
|
|
50
|
+
async function add(client, argv) {
|
|
51
|
+
let parsedArgs;
|
|
52
|
+
try {
|
|
53
|
+
parsedArgs = parseArguments(
|
|
54
|
+
argv,
|
|
55
|
+
getFlagsSpecification(rulesAddSubcommand.options)
|
|
56
|
+
);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
emitRulesArgParseError(
|
|
59
|
+
client,
|
|
60
|
+
e,
|
|
61
|
+
"alerts rules add --project <name-or-id> --body <path>"
|
|
62
|
+
);
|
|
63
|
+
printError(e);
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
const fr = validateJsonOutput(parsedArgs.flags);
|
|
67
|
+
if (!fr.valid) {
|
|
68
|
+
outputAgentError(
|
|
69
|
+
client,
|
|
70
|
+
{
|
|
71
|
+
status: "error",
|
|
72
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
73
|
+
message: fr.error
|
|
74
|
+
},
|
|
75
|
+
1
|
|
76
|
+
);
|
|
77
|
+
output_manager_default.error(fr.error);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
const bodyPath = parsedArgs.flags["--body"];
|
|
81
|
+
if (!bodyPath) {
|
|
82
|
+
outputAgentError(
|
|
83
|
+
client,
|
|
84
|
+
{
|
|
85
|
+
status: "error",
|
|
86
|
+
reason: AGENT_REASON.MISSING_ARGUMENTS,
|
|
87
|
+
message: `Missing required flag --body. Example: ${packageName} alerts rules add --body <file>`,
|
|
88
|
+
hint: "Provide a JSON file describing the new rule (id and teamId are assigned by the API).",
|
|
89
|
+
next: [
|
|
90
|
+
{
|
|
91
|
+
command: buildCommandWithGlobalFlags(
|
|
92
|
+
client.argv,
|
|
93
|
+
"alerts rules add --body <file>"
|
|
94
|
+
),
|
|
95
|
+
when: "Replace <file> with a path to rule JSON"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
1
|
|
100
|
+
);
|
|
101
|
+
output_manager_default.error(
|
|
102
|
+
"Missing required flag: --body <PATH> (JSON file for the new rule)."
|
|
103
|
+
);
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
const scope = await parseRulesFlagsAndScope(
|
|
107
|
+
client,
|
|
108
|
+
{
|
|
109
|
+
"--project": parsedArgs.flags["--project"],
|
|
110
|
+
"--all": parsedArgs.flags["--all"]
|
|
111
|
+
},
|
|
112
|
+
fr.jsonOutput
|
|
113
|
+
);
|
|
114
|
+
if (typeof scope === "number") {
|
|
115
|
+
return scope;
|
|
116
|
+
}
|
|
117
|
+
let raw;
|
|
118
|
+
try {
|
|
119
|
+
raw = readFileSync(resolve(client.cwd, bodyPath), "utf8");
|
|
120
|
+
} catch {
|
|
121
|
+
outputAgentError(
|
|
122
|
+
client,
|
|
123
|
+
{
|
|
124
|
+
status: "error",
|
|
125
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
126
|
+
message: `Could not read --body file: ${bodyPath}`
|
|
127
|
+
},
|
|
128
|
+
1
|
|
129
|
+
);
|
|
130
|
+
output_manager_default.error(`Could not read --body file: ${bodyPath}`);
|
|
131
|
+
return 1;
|
|
132
|
+
}
|
|
133
|
+
let body;
|
|
134
|
+
try {
|
|
135
|
+
body = JSON.parse(raw);
|
|
136
|
+
} catch {
|
|
137
|
+
outputAgentError(
|
|
138
|
+
client,
|
|
139
|
+
{
|
|
140
|
+
status: "error",
|
|
141
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
142
|
+
message: "Invalid JSON in --body file."
|
|
143
|
+
},
|
|
144
|
+
1
|
|
145
|
+
);
|
|
146
|
+
output_manager_default.error("Invalid JSON in --body file.");
|
|
147
|
+
return 1;
|
|
148
|
+
}
|
|
149
|
+
delete body.id;
|
|
150
|
+
delete body.teamId;
|
|
151
|
+
if (scope.projectId !== void 0 && body.projectId === void 0) {
|
|
152
|
+
body.projectId = scope.projectId;
|
|
153
|
+
}
|
|
154
|
+
const path = rulesCollectionPath(scope);
|
|
155
|
+
output_manager_default.spinner("Creating alert rule...");
|
|
156
|
+
try {
|
|
157
|
+
const created = await client.fetch(path, {
|
|
158
|
+
method: "POST",
|
|
159
|
+
body
|
|
160
|
+
});
|
|
161
|
+
if (fr.jsonOutput) {
|
|
162
|
+
client.stdout.write(`${JSON.stringify({ rule: created }, null, 2)}
|
|
163
|
+
`);
|
|
164
|
+
} else {
|
|
165
|
+
const id = created?.id;
|
|
166
|
+
output_manager_default.success(`Created alert rule ${typeof id === "string" ? id : ""}`);
|
|
167
|
+
}
|
|
168
|
+
return 0;
|
|
169
|
+
} catch (err) {
|
|
170
|
+
if (isAPIError(err)) {
|
|
171
|
+
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
172
|
+
}
|
|
173
|
+
throw err;
|
|
174
|
+
} finally {
|
|
175
|
+
output_manager_default.stopSpinner();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
export {
|
|
179
|
+
add as default
|
|
180
|
+
};
|
|
@@ -9,37 +9,41 @@ import {
|
|
|
9
9
|
printIndications,
|
|
10
10
|
require_dist as require_dist2,
|
|
11
11
|
sleep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6C33Y3DC.js";
|
|
13
13
|
import {
|
|
14
14
|
suggestNextCommands
|
|
15
15
|
} from "./chunk-LOS7HHU3.js";
|
|
16
16
|
import {
|
|
17
17
|
getDeployment,
|
|
18
18
|
mapCertError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-N45K6NXC.js";
|
|
20
20
|
import {
|
|
21
21
|
getScope
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-L2JUC7NX.js";
|
|
23
23
|
import {
|
|
24
24
|
showPluginTipIfNeeded
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-O7SQKNIT.js";
|
|
26
26
|
import {
|
|
27
27
|
CommandTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-UJ4JXXED.js";
|
|
29
29
|
import {
|
|
30
30
|
ua_default
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4PQA6H63.js";
|
|
32
32
|
import {
|
|
33
33
|
getProjectByNameOrId,
|
|
34
34
|
param,
|
|
35
35
|
require_dist as require_dist3,
|
|
36
36
|
require_lib3 as require_lib,
|
|
37
37
|
require_pluralize
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-537JTK2U.js";
|
|
39
39
|
import {
|
|
40
40
|
require_ms,
|
|
41
41
|
stamp_default
|
|
42
42
|
} from "./chunk-CO5D46AG.js";
|
|
43
|
+
import {
|
|
44
|
+
require_strip_ansi,
|
|
45
|
+
responseError
|
|
46
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
43
47
|
import {
|
|
44
48
|
APIError,
|
|
45
49
|
BuildError,
|
|
@@ -56,10 +60,8 @@ import {
|
|
|
56
60
|
UserAborted,
|
|
57
61
|
getCommandName,
|
|
58
62
|
isAPIError,
|
|
59
|
-
require_bytes
|
|
60
|
-
|
|
61
|
-
responseError
|
|
62
|
-
} from "./chunk-A4NVECX5.js";
|
|
63
|
+
require_bytes
|
|
64
|
+
} from "./chunk-ECRBC4HL.js";
|
|
63
65
|
import {
|
|
64
66
|
emoji,
|
|
65
67
|
eraseLines,
|
|
@@ -4270,6 +4272,7 @@ async function processDeployment({
|
|
|
4270
4272
|
agent,
|
|
4271
4273
|
manual,
|
|
4272
4274
|
jsonOutput,
|
|
4275
|
+
functionsBeta,
|
|
4273
4276
|
...args
|
|
4274
4277
|
}) {
|
|
4275
4278
|
const {
|
|
@@ -4479,6 +4482,14 @@ async function processDeployment({
|
|
|
4479
4482
|
}
|
|
4480
4483
|
if (event.type === "error") {
|
|
4481
4484
|
stopSpinner();
|
|
4485
|
+
if (!functionsBeta) {
|
|
4486
|
+
const maybeSizeError = handleErrorSolvableWithFunctionsBeta(
|
|
4487
|
+
event.payload
|
|
4488
|
+
);
|
|
4489
|
+
if (maybeSizeError) {
|
|
4490
|
+
throw maybeSizeError;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4482
4493
|
if (!archive) {
|
|
4483
4494
|
const maybeError = handleErrorSolvableWithArchive(event.payload);
|
|
4484
4495
|
if (maybeError) {
|
|
@@ -4517,6 +4528,23 @@ async function processDeployment({
|
|
|
4517
4528
|
throw err;
|
|
4518
4529
|
}
|
|
4519
4530
|
}
|
|
4531
|
+
var FunctionsSizeLimitError = class extends Error {
|
|
4532
|
+
constructor() {
|
|
4533
|
+
super(...arguments);
|
|
4534
|
+
this.link = "https://vercel.com/docs/errors/FUNCTIONS_BETA";
|
|
4535
|
+
}
|
|
4536
|
+
};
|
|
4537
|
+
function handleErrorSolvableWithFunctionsBeta(error) {
|
|
4538
|
+
if ((0, import_error_utils.isErrorLike)(error)) {
|
|
4539
|
+
const isLambdaSizeExceeded = "errorCode" in error && error.errorCode === "LAMBDA_SIZE_EXCEEDED";
|
|
4540
|
+
const isMessageMatch = !isLambdaSizeExceeded && "errorMessage" in error && typeof error.errorMessage === "string" && error.errorMessage.includes("exceeds") && (error.errorMessage.includes("Lambda size limit") || error.errorMessage.includes("Lambda ephemeral storage") || error.errorMessage.includes("exceeds Lambda limit"));
|
|
4541
|
+
if (isLambdaSizeExceeded || isMessageMatch) {
|
|
4542
|
+
return new FunctionsSizeLimitError(
|
|
4543
|
+
error.errorMessage || error.message || "Function build exceeded the maximum size limit."
|
|
4544
|
+
);
|
|
4545
|
+
}
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4520
4548
|
var archiveSuggestionText = "Try using `--archive=tgz` to limit the amount of files you upload.";
|
|
4521
4549
|
var UploadErrorMissingArchive = class extends Error {
|
|
4522
4550
|
constructor() {
|
|
@@ -4593,7 +4621,8 @@ var Now = class {
|
|
|
4593
4621
|
autoAssignCustomDomains,
|
|
4594
4622
|
agentName,
|
|
4595
4623
|
manual,
|
|
4596
|
-
jsonOutput = false
|
|
4624
|
+
jsonOutput = false,
|
|
4625
|
+
functionsBeta
|
|
4597
4626
|
}, org, isSettingUpProject, archive) {
|
|
4598
4627
|
const hashes = {};
|
|
4599
4628
|
const uploadStamp = stamp_default();
|
|
@@ -4637,7 +4666,8 @@ var Now = class {
|
|
|
4637
4666
|
withFullLogs,
|
|
4638
4667
|
bulkRedirectsPath: nowConfig.bulkRedirectsPath,
|
|
4639
4668
|
manual,
|
|
4640
|
-
jsonOutput
|
|
4669
|
+
jsonOutput,
|
|
4670
|
+
functionsBeta
|
|
4641
4671
|
});
|
|
4642
4672
|
if (deployment && deployment.warnings) {
|
|
4643
4673
|
let sizeExceeded = 0;
|
|
@@ -5371,6 +5401,7 @@ export {
|
|
|
5371
5401
|
displayBuildLogs,
|
|
5372
5402
|
displayBuildLogsUntilFinalError,
|
|
5373
5403
|
displayRuntimeLogs,
|
|
5404
|
+
FunctionsSizeLimitError,
|
|
5374
5405
|
UploadErrorMissingArchive,
|
|
5375
5406
|
Now,
|
|
5376
5407
|
require_cjs,
|
|
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
require_lib
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-537JTK2U.js";
|
|
10
10
|
import {
|
|
11
11
|
packageName
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ECRBC4HL.js";
|
|
13
13
|
import {
|
|
14
14
|
__toESM
|
|
15
15
|
} from "./chunk-TZ2YI2VH.js";
|
|
@@ -5,9 +5,11 @@ const require = __createRequire(import.meta.url);
|
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
|
-
formatOption
|
|
8
|
+
formatOption
|
|
9
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
10
|
+
import {
|
|
9
11
|
packageName
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ECRBC4HL.js";
|
|
11
13
|
|
|
12
14
|
// src/commands/metrics/command.ts
|
|
13
15
|
var schemaSubcommand = {
|