vercel 33.7.1 → 34.0.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/index.js +87 -52
- package/package.json +4 -3
package/dist/index.js
CHANGED
@@ -52648,8 +52648,8 @@ var GA_TRACKING_ID, SENTRY_DSN;
|
|
52648
52648
|
var init_constants = __esm({
|
52649
52649
|
"src/util/constants.ts"() {
|
52650
52650
|
"use strict";
|
52651
|
-
GA_TRACKING_ID =
|
52652
|
-
SENTRY_DSN =
|
52651
|
+
GA_TRACKING_ID = "UA-117491914-3";
|
52652
|
+
SENTRY_DSN = "https://26a24e59ba954011919a524b341b6ab5@sentry.io/1323225";
|
52653
52653
|
}
|
52654
52654
|
});
|
52655
52655
|
|
@@ -62540,7 +62540,7 @@ var require_package = __commonJS2({
|
|
62540
62540
|
"../client/package.json"(exports2, module2) {
|
62541
62541
|
module2.exports = {
|
62542
62542
|
name: "@vercel/client",
|
62543
|
-
version: "13.
|
62543
|
+
version: "13.2.0",
|
62544
62544
|
main: "dist/index.js",
|
62545
62545
|
typings: "dist/index.d.ts",
|
62546
62546
|
homepage: "https://vercel.com",
|
@@ -63574,10 +63574,7 @@ var require_utils8 = __commonJS2({
|
|
63574
63574
|
"checks-conclusion-canceled"
|
63575
63575
|
];
|
63576
63576
|
var EVENTS = new Set(EVENTS_ARRAY);
|
63577
|
-
function getApiDeploymentsUrl(
|
63578
|
-
if (metadata && metadata.builds && !metadata.functions) {
|
63579
|
-
return "/v10/deployments";
|
63580
|
-
}
|
63577
|
+
function getApiDeploymentsUrl() {
|
63581
63578
|
return "/v13/deployments";
|
63582
63579
|
}
|
63583
63580
|
async function parseVercelConfig(filePath) {
|
@@ -64047,10 +64044,7 @@ var require_check_deployment_status = __commonJS2({
|
|
64047
64044
|
const { token, teamId, apiUrl: apiUrl2, userAgent } = clientOptions;
|
64048
64045
|
const debug3 = (0, import_utils22.createDebug)(clientOptions.debug);
|
64049
64046
|
let deploymentState = deployment;
|
64050
|
-
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)(
|
64051
|
-
builds: deployment.builds,
|
64052
|
-
functions: deployment.functions
|
64053
|
-
});
|
64047
|
+
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)();
|
64054
64048
|
if ((0, import_ready_state.isDone)(deploymentState) && (0, import_ready_state.isAliasAssigned)(deploymentState)) {
|
64055
64049
|
debug3(
|
64056
64050
|
`Deployment is already READY and aliases are assigned. Not running status checks`
|
@@ -64174,7 +64168,10 @@ var require_deploy = __commonJS2({
|
|
64174
64168
|
async function* postDeployment(files, clientOptions, deploymentOptions) {
|
64175
64169
|
const debug3 = (0, import_utils4.createDebug)(clientOptions.debug);
|
64176
64170
|
const preparedFiles = (0, import_utils4.prepareFiles)(files, clientOptions);
|
64177
|
-
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)(
|
64171
|
+
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)();
|
64172
|
+
if (deploymentOptions?.builds && !deploymentOptions.functions) {
|
64173
|
+
clientOptions.skipAutoDetectionConfirmation = true;
|
64174
|
+
}
|
64178
64175
|
debug3("Sending deployment creation API request");
|
64179
64176
|
try {
|
64180
64177
|
const response = await (0, import_utils4.fetch)(
|
@@ -138859,7 +138856,7 @@ async function getEnvRecords(output2, client2, projectId, source, {
|
|
138859
138856
|
if (source) {
|
138860
138857
|
query.set("source", source);
|
138861
138858
|
}
|
138862
|
-
const url3 = `/
|
138859
|
+
const url3 = `/v10/projects/${projectId}/env?${query}`;
|
138863
138860
|
return client2.fetch(url3);
|
138864
138861
|
}
|
138865
138862
|
async function pullEnvRecords(output2, client2, projectId, source, { target, gitBranch } = {}) {
|
@@ -146994,22 +146991,6 @@ var init_deploy = __esm({
|
|
146994
146991
|
"`name` not found on project or provided by existing project"
|
146995
146992
|
);
|
146996
146993
|
}
|
146997
|
-
const { packageJson } = await (0, import_build_utils14.scanParentDirs)(
|
146998
|
-
(0, import_path32.join)(cwd2, project?.rootDirectory ?? ""),
|
146999
|
-
true,
|
147000
|
-
cwd2
|
147001
|
-
);
|
147002
|
-
let nodeVersion;
|
147003
|
-
if (packageJson?.engines?.node) {
|
147004
|
-
try {
|
147005
|
-
const { range } = await (0, import_build_utils14.getSupportedNodeVersion)(packageJson.engines.node);
|
147006
|
-
nodeVersion = range;
|
147007
|
-
} catch (error5) {
|
147008
|
-
if (error5 instanceof Error) {
|
147009
|
-
output2.warn(error5.message);
|
147010
|
-
}
|
147011
|
-
}
|
147012
|
-
}
|
147013
146994
|
try {
|
147014
146995
|
const autoAssignCustomDomains = argv2["--skip-domain"] ? false : void 0;
|
147015
146996
|
const createArgs = {
|
@@ -147041,8 +147022,7 @@ var init_deploy = __esm({
|
|
147041
147022
|
if (!localConfig.builds || localConfig.builds.length === 0) {
|
147042
147023
|
createArgs.projectSettings = {
|
147043
147024
|
sourceFilesOutsideRootDirectory,
|
147044
|
-
rootDirectory
|
147045
|
-
nodeVersion
|
147025
|
+
rootDirectory
|
147046
147026
|
};
|
147047
147027
|
if (status === "linked") {
|
147048
147028
|
createArgs.projectSettings = {
|
@@ -147051,6 +147031,27 @@ var init_deploy = __esm({
|
|
147051
147031
|
};
|
147052
147032
|
}
|
147053
147033
|
}
|
147034
|
+
const { packageJson } = await (0, import_build_utils14.scanParentDirs)(
|
147035
|
+
(0, import_path32.join)(cwd2, project?.rootDirectory ?? ""),
|
147036
|
+
true,
|
147037
|
+
cwd2
|
147038
|
+
);
|
147039
|
+
let nodeVersion;
|
147040
|
+
if (packageJson?.engines?.node) {
|
147041
|
+
try {
|
147042
|
+
const { range } = await (0, import_build_utils14.getSupportedNodeVersion)(
|
147043
|
+
packageJson.engines.node
|
147044
|
+
);
|
147045
|
+
nodeVersion = range;
|
147046
|
+
} catch (error5) {
|
147047
|
+
if (error5 instanceof Error) {
|
147048
|
+
output2.warn(error5.message);
|
147049
|
+
}
|
147050
|
+
}
|
147051
|
+
}
|
147052
|
+
if (!createArgs.projectSettings)
|
147053
|
+
createArgs.projectSettings = {};
|
147054
|
+
createArgs.projectSettings.nodeVersion = nodeVersion;
|
147054
147055
|
deployment = await createDeploy(
|
147055
147056
|
client2,
|
147056
147057
|
now,
|
@@ -169186,9 +169187,10 @@ var init_get_invalid_subcommand = __esm({
|
|
169186
169187
|
});
|
169187
169188
|
|
169188
169189
|
// src/util/env/add-env-record.ts
|
169189
|
-
async function addEnvRecord(output2, client2, projectId, type, key, value, targets, gitBranch) {
|
169190
|
+
async function addEnvRecord(output2, client2, projectId, upsert, type, key, value, targets, gitBranch) {
|
169191
|
+
const actionWord = upsert ? "Overriding" : "Adding";
|
169190
169192
|
output2.debug(
|
169191
|
-
|
169193
|
+
`${actionWord} ${type} Environment Variable ${key} to ${targets.length} targets`
|
169192
169194
|
);
|
169193
169195
|
const body = {
|
169194
169196
|
type,
|
@@ -169197,7 +169199,8 @@ async function addEnvRecord(output2, client2, projectId, type, key, value, targe
|
|
169197
169199
|
target: targets,
|
169198
169200
|
gitBranch: gitBranch || void 0
|
169199
169201
|
};
|
169200
|
-
const
|
169202
|
+
const args2 = upsert ? `?upsert=${upsert}` : "";
|
169203
|
+
const url3 = `/v10/projects/${projectId}/env${args2}`;
|
169201
169204
|
await client2.fetch(url3, {
|
169202
169205
|
method: "POST",
|
169203
169206
|
body
|
@@ -169240,12 +169243,34 @@ var init_known_error = __esm({
|
|
169240
169243
|
"use strict";
|
169241
169244
|
import_error_utils22 = __toESM3(require_dist2());
|
169242
169245
|
knownErrorsCodes = /* @__PURE__ */ new Set([
|
169243
|
-
"PAYMENT_REQUIRED",
|
169244
169246
|
"BAD_REQUEST",
|
169245
|
-
"SYSTEM_ENV_WITH_VALUE",
|
169246
|
-
"RESERVED_ENV_VARIABLE",
|
169247
169247
|
"ENV_ALREADY_EXISTS",
|
169248
|
-
"
|
169248
|
+
"ENV_CONFLICT",
|
169249
|
+
"ENV_SHOULD_BE_A_SECRET",
|
169250
|
+
"EXISTING_KEY_AND_TARGET",
|
169251
|
+
"FORBIDDEN",
|
169252
|
+
"ID_NOT_FOUND",
|
169253
|
+
"INVALID_KEY",
|
169254
|
+
"INVALID_VALUE",
|
169255
|
+
"KEY_INVALID_CHARACTERS",
|
169256
|
+
"KEY_INVALID_LENGTH",
|
169257
|
+
"KEY_RESERVED",
|
169258
|
+
"RESERVED_ENV_VARIABLE",
|
169259
|
+
"MAX_ENVS_EXCEEDED",
|
169260
|
+
"MISSING_ID",
|
169261
|
+
"MISSING_KEY",
|
169262
|
+
"MISSING_TARGET",
|
169263
|
+
"MISSING_VALUE",
|
169264
|
+
"NOT_AUTHORIZED",
|
169265
|
+
"NOT_DECRYPTABLE",
|
169266
|
+
"SECRET_MISSING",
|
169267
|
+
"SYSTEM_ENV_WITH_VALUE",
|
169268
|
+
"TEAM_NOT_FOUND",
|
169269
|
+
"TOO_MANY_IDS",
|
169270
|
+
"TOO_MANY_KEYS",
|
169271
|
+
"UNKNOWN_ERROR",
|
169272
|
+
"VALUE_INVALID_LENGTH",
|
169273
|
+
"VALUE_INVALID_TYPE"
|
169249
169274
|
]);
|
169250
169275
|
}
|
169251
169276
|
});
|
@@ -169298,7 +169323,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169298
169323
|
envs.filter((r) => r.key === envName).map((r) => r.target)
|
169299
169324
|
);
|
169300
169325
|
const choices = envTargetChoices.filter((c) => !existing.has(c.value));
|
169301
|
-
if (choices.length === 0) {
|
169326
|
+
if (choices.length === 0 && !opts["--force"]) {
|
169302
169327
|
output2.error(
|
169303
169328
|
`The variable ${param(
|
169304
169329
|
envName
|
@@ -169331,6 +169356,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169331
169356
|
});
|
169332
169357
|
}
|
169333
169358
|
const type = opts["--sensitive"] ? "sensitive" : "encrypted";
|
169359
|
+
const upsert = opts["--force"] ? "true" : "";
|
169334
169360
|
const addStamp = stamp_default();
|
169335
169361
|
try {
|
169336
169362
|
output2.spinner("Saving");
|
@@ -169338,6 +169364,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169338
169364
|
output2,
|
169339
169365
|
client2,
|
169340
169366
|
project.id,
|
169367
|
+
upsert,
|
169341
169368
|
type,
|
169342
169369
|
envName,
|
169343
169370
|
envValue,
|
@@ -169353,9 +169380,9 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169353
169380
|
}
|
169354
169381
|
output2.print(
|
169355
169382
|
`${prependEmoji(
|
169356
|
-
|
169357
|
-
|
169358
|
-
)}
|
169383
|
+
`${opts["--force"] ? "Overrode" : "Added"} Environment Variable ${import_chalk79.default.bold(envName)} to Project ${import_chalk79.default.bold(
|
169384
|
+
project.name
|
169385
|
+
)} ${import_chalk79.default.gray(addStamp())}`,
|
169359
169386
|
emoji("success")
|
169360
169387
|
)}
|
169361
169388
|
`
|
@@ -169500,8 +169527,8 @@ var init_ls5 = __esm({
|
|
169500
169527
|
// src/util/env/remove-env-record.ts
|
169501
169528
|
async function removeEnvRecord(output2, client2, projectId, env) {
|
169502
169529
|
output2.debug(`Removing Environment Variable ${env.key}`);
|
169503
|
-
const
|
169504
|
-
await client2.fetch(
|
169530
|
+
const url3 = `/v10/projects/${projectId}/env/${env.id}`;
|
169531
|
+
await client2.fetch(url3, {
|
169505
169532
|
method: "DELETE"
|
169506
169533
|
});
|
169507
169534
|
}
|
@@ -169659,6 +169686,14 @@ var init_command10 = __esm({
|
|
169659
169686
|
type: "string",
|
169660
169687
|
deprecated: false,
|
169661
169688
|
multi: false
|
169689
|
+
},
|
169690
|
+
{
|
169691
|
+
name: "force",
|
169692
|
+
description: "Force overwrites when a command would normally fail",
|
169693
|
+
shorthand: null,
|
169694
|
+
type: "boolean",
|
169695
|
+
deprecated: false,
|
169696
|
+
multi: false
|
169662
169697
|
}
|
169663
169698
|
],
|
169664
169699
|
examples: []
|
@@ -169740,6 +169775,10 @@ var init_command10 = __esm({
|
|
169740
169775
|
`${packageName} env add DB_PASS production`
|
169741
169776
|
]
|
169742
169777
|
},
|
169778
|
+
{
|
169779
|
+
name: "Override an existing Environment Variable of same target (production, preview, deployment)",
|
169780
|
+
value: `${packageName} env add API_TOKEN --force`
|
169781
|
+
},
|
169743
169782
|
{
|
169744
169783
|
name: "Add a sensitive Environment Variable",
|
169745
169784
|
value: `${packageName} env add API_TOKEN --sensitive`
|
@@ -169798,7 +169837,8 @@ async function main6(client2) {
|
|
169798
169837
|
"-y": "--yes",
|
169799
169838
|
"--environment": String,
|
169800
169839
|
"--git-branch": String,
|
169801
|
-
"--sensitive": Boolean
|
169840
|
+
"--sensitive": Boolean,
|
169841
|
+
"--force": Boolean
|
169802
169842
|
});
|
169803
169843
|
} catch (error4) {
|
169804
169844
|
handleError(error4);
|
@@ -173331,20 +173371,15 @@ async function requestPromote({
|
|
173331
173371
|
deployId,
|
173332
173372
|
output: client2.output
|
173333
173373
|
});
|
173334
|
-
if (deployment.target !== "production") {
|
173335
|
-
output2.warn(
|
173336
|
-
"Promoting a preview deployment to production is deprecated and will be removed in the next major release. This behavior will be removed entirely on 2024-05-03."
|
173337
|
-
);
|
173338
|
-
}
|
173339
173374
|
if (deployment.target !== "production" && !yes) {
|
173340
|
-
const question = "This deployment
|
173375
|
+
const question = "This deployment is not a production deployment and cannot be directly promoted. A new deployment will be built using your production environment. Are you sure you want to continue?";
|
173341
173376
|
const answer = await confirm(client2, question, false);
|
173342
173377
|
if (!answer) {
|
173343
173378
|
output2.error("Canceled");
|
173344
173379
|
return 0;
|
173345
173380
|
}
|
173346
173381
|
}
|
173347
|
-
await client2.fetch(`/
|
173382
|
+
await client2.fetch(`/v10/projects/${project.id}/promote/${deployment.id}`, {
|
173348
173383
|
body: {},
|
173349
173384
|
// required
|
173350
173385
|
json: false,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "
|
3
|
+
"version": "34.0.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -82,7 +82,7 @@
|
|
82
82
|
"@vercel-internals/constants": "1.0.4",
|
83
83
|
"@vercel-internals/get-package-json": "1.0.0",
|
84
84
|
"@vercel-internals/types": "1.0.29",
|
85
|
-
"@vercel/client": "13.
|
85
|
+
"@vercel/client": "13.2.0",
|
86
86
|
"@vercel/error-utils": "2.0.2",
|
87
87
|
"@vercel/frameworks": "3.0.1",
|
88
88
|
"@vercel/fs-detectors": "5.2.2",
|
@@ -166,7 +166,8 @@
|
|
166
166
|
},
|
167
167
|
"scripts": {
|
168
168
|
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",
|
169
|
-
"
|
169
|
+
"vitest-unit-run": "pnpm vitest",
|
170
|
+
"vitest-unit": "pnpm jest test/unit/ --listTests",
|
170
171
|
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
|
171
172
|
"test-dev": "pnpm test test/dev/",
|
172
173
|
"coverage": "codecov",
|