vercel 50.0.1 → 50.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +805 -310
- package/package.json +15 -14
package/dist/index.js
CHANGED
|
@@ -1338,8 +1338,8 @@ var require_copy_sync = __commonJS2({
|
|
|
1338
1338
|
return getStats(destStat, src, dest, opts);
|
|
1339
1339
|
}
|
|
1340
1340
|
function getStats(destStat, src, dest, opts) {
|
|
1341
|
-
const
|
|
1342
|
-
const srcStat =
|
|
1341
|
+
const statSync3 = opts.dereference ? fs15.statSync : fs15.lstatSync;
|
|
1342
|
+
const srcStat = statSync3(src);
|
|
1343
1343
|
if (srcStat.isDirectory())
|
|
1344
1344
|
return onDir(srcStat, destStat, src, dest, opts);
|
|
1345
1345
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
@@ -2430,7 +2430,7 @@ var require_jsonfile = __commonJS2({
|
|
|
2430
2430
|
return obj;
|
|
2431
2431
|
}
|
|
2432
2432
|
var readFile6 = universalify.fromPromise(_readFile);
|
|
2433
|
-
function
|
|
2433
|
+
function readFileSync4(file, options = {}) {
|
|
2434
2434
|
if (typeof options === "string") {
|
|
2435
2435
|
options = { encoding: options };
|
|
2436
2436
|
}
|
|
@@ -2462,7 +2462,7 @@ var require_jsonfile = __commonJS2({
|
|
|
2462
2462
|
}
|
|
2463
2463
|
var jsonfile = {
|
|
2464
2464
|
readFile: readFile6,
|
|
2465
|
-
readFileSync:
|
|
2465
|
+
readFileSync: readFileSync4,
|
|
2466
2466
|
writeFile: writeFile5,
|
|
2467
2467
|
writeFileSync
|
|
2468
2468
|
};
|
|
@@ -4071,14 +4071,14 @@ var require_templates = __commonJS2({
|
|
|
4071
4071
|
}
|
|
4072
4072
|
return results;
|
|
4073
4073
|
}
|
|
4074
|
-
function buildStyle(
|
|
4074
|
+
function buildStyle(chalk138, styles) {
|
|
4075
4075
|
const enabled = {};
|
|
4076
4076
|
for (const layer of styles) {
|
|
4077
4077
|
for (const style of layer.styles) {
|
|
4078
4078
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
4079
4079
|
}
|
|
4080
4080
|
}
|
|
4081
|
-
let current =
|
|
4081
|
+
let current = chalk138;
|
|
4082
4082
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
4083
4083
|
if (!Array.isArray(styles2)) {
|
|
4084
4084
|
continue;
|
|
@@ -4090,7 +4090,7 @@ var require_templates = __commonJS2({
|
|
|
4090
4090
|
}
|
|
4091
4091
|
return current;
|
|
4092
4092
|
}
|
|
4093
|
-
module2.exports = (
|
|
4093
|
+
module2.exports = (chalk138, temporary) => {
|
|
4094
4094
|
const styles = [];
|
|
4095
4095
|
const chunks = [];
|
|
4096
4096
|
let chunk = [];
|
|
@@ -4100,13 +4100,13 @@ var require_templates = __commonJS2({
|
|
|
4100
4100
|
} else if (style) {
|
|
4101
4101
|
const string = chunk.join("");
|
|
4102
4102
|
chunk = [];
|
|
4103
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
4103
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk138, styles)(string));
|
|
4104
4104
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
4105
4105
|
} else if (close2) {
|
|
4106
4106
|
if (styles.length === 0) {
|
|
4107
4107
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
4108
4108
|
}
|
|
4109
|
-
chunks.push(buildStyle(
|
|
4109
|
+
chunks.push(buildStyle(chalk138, styles)(chunk.join("")));
|
|
4110
4110
|
chunk = [];
|
|
4111
4111
|
styles.pop();
|
|
4112
4112
|
} else {
|
|
@@ -4154,16 +4154,16 @@ var require_source = __commonJS2({
|
|
|
4154
4154
|
}
|
|
4155
4155
|
};
|
|
4156
4156
|
var chalkFactory = (options) => {
|
|
4157
|
-
const
|
|
4158
|
-
applyOptions(
|
|
4159
|
-
|
|
4160
|
-
Object.setPrototypeOf(
|
|
4161
|
-
Object.setPrototypeOf(
|
|
4162
|
-
|
|
4157
|
+
const chalk139 = {};
|
|
4158
|
+
applyOptions(chalk139, options);
|
|
4159
|
+
chalk139.template = (...arguments_) => chalkTag(chalk139.template, ...arguments_);
|
|
4160
|
+
Object.setPrototypeOf(chalk139, Chalk.prototype);
|
|
4161
|
+
Object.setPrototypeOf(chalk139.template, chalk139);
|
|
4162
|
+
chalk139.template.constructor = () => {
|
|
4163
4163
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
4164
4164
|
};
|
|
4165
|
-
|
|
4166
|
-
return
|
|
4165
|
+
chalk139.template.Instance = ChalkClass;
|
|
4166
|
+
return chalk139.template;
|
|
4167
4167
|
};
|
|
4168
4168
|
function Chalk(options) {
|
|
4169
4169
|
return chalkFactory(options);
|
|
@@ -4274,7 +4274,7 @@ var require_source = __commonJS2({
|
|
|
4274
4274
|
return openAll + string + closeAll;
|
|
4275
4275
|
};
|
|
4276
4276
|
var template;
|
|
4277
|
-
var chalkTag = (
|
|
4277
|
+
var chalkTag = (chalk139, ...strings) => {
|
|
4278
4278
|
const [firstString] = strings;
|
|
4279
4279
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
4280
4280
|
return strings.join(" ");
|
|
@@ -4290,14 +4290,14 @@ var require_source = __commonJS2({
|
|
|
4290
4290
|
if (template === void 0) {
|
|
4291
4291
|
template = require_templates();
|
|
4292
4292
|
}
|
|
4293
|
-
return template(
|
|
4293
|
+
return template(chalk139, parts.join(""));
|
|
4294
4294
|
};
|
|
4295
4295
|
Object.defineProperties(Chalk.prototype, styles);
|
|
4296
|
-
var
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
module2.exports =
|
|
4296
|
+
var chalk138 = Chalk();
|
|
4297
|
+
chalk138.supportsColor = stdoutColor;
|
|
4298
|
+
chalk138.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
4299
|
+
chalk138.stderr.supportsColor = stderrColor;
|
|
4300
|
+
module2.exports = chalk138;
|
|
4301
4301
|
}
|
|
4302
4302
|
});
|
|
4303
4303
|
|
|
@@ -7208,14 +7208,14 @@ var require_templates2 = __commonJS2({
|
|
|
7208
7208
|
}
|
|
7209
7209
|
return results;
|
|
7210
7210
|
}
|
|
7211
|
-
function buildStyle(
|
|
7211
|
+
function buildStyle(chalk138, styles) {
|
|
7212
7212
|
const enabled = {};
|
|
7213
7213
|
for (const layer of styles) {
|
|
7214
7214
|
for (const style of layer.styles) {
|
|
7215
7215
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
7216
7216
|
}
|
|
7217
7217
|
}
|
|
7218
|
-
let current =
|
|
7218
|
+
let current = chalk138;
|
|
7219
7219
|
for (const styleName of Object.keys(enabled)) {
|
|
7220
7220
|
if (Array.isArray(enabled[styleName])) {
|
|
7221
7221
|
if (!(styleName in current)) {
|
|
@@ -7230,7 +7230,7 @@ var require_templates2 = __commonJS2({
|
|
|
7230
7230
|
}
|
|
7231
7231
|
return current;
|
|
7232
7232
|
}
|
|
7233
|
-
module2.exports = (
|
|
7233
|
+
module2.exports = (chalk138, tmp) => {
|
|
7234
7234
|
const styles = [];
|
|
7235
7235
|
const chunks = [];
|
|
7236
7236
|
let chunk = [];
|
|
@@ -7240,13 +7240,13 @@ var require_templates2 = __commonJS2({
|
|
|
7240
7240
|
} else if (style) {
|
|
7241
7241
|
const str = chunk.join("");
|
|
7242
7242
|
chunk = [];
|
|
7243
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
7243
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk138, styles)(str));
|
|
7244
7244
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
7245
7245
|
} else if (close2) {
|
|
7246
7246
|
if (styles.length === 0) {
|
|
7247
7247
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
7248
7248
|
}
|
|
7249
|
-
chunks.push(buildStyle(
|
|
7249
|
+
chunks.push(buildStyle(chalk138, styles)(chunk.join("")));
|
|
7250
7250
|
chunk = [];
|
|
7251
7251
|
styles.pop();
|
|
7252
7252
|
} else {
|
|
@@ -7283,16 +7283,16 @@ var require_chalk = __commonJS2({
|
|
|
7283
7283
|
}
|
|
7284
7284
|
function Chalk(options) {
|
|
7285
7285
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
7286
|
-
const
|
|
7287
|
-
applyOptions(
|
|
7288
|
-
|
|
7286
|
+
const chalk138 = {};
|
|
7287
|
+
applyOptions(chalk138, options);
|
|
7288
|
+
chalk138.template = function() {
|
|
7289
7289
|
const args2 = [].slice.call(arguments);
|
|
7290
|
-
return chalkTag.apply(null, [
|
|
7290
|
+
return chalkTag.apply(null, [chalk138.template].concat(args2));
|
|
7291
7291
|
};
|
|
7292
|
-
Object.setPrototypeOf(
|
|
7293
|
-
Object.setPrototypeOf(
|
|
7294
|
-
|
|
7295
|
-
return
|
|
7292
|
+
Object.setPrototypeOf(chalk138, Chalk.prototype);
|
|
7293
|
+
Object.setPrototypeOf(chalk138.template, chalk138);
|
|
7294
|
+
chalk138.template.constructor = Chalk;
|
|
7295
|
+
return chalk138.template;
|
|
7296
7296
|
}
|
|
7297
7297
|
applyOptions(this, options);
|
|
7298
7298
|
}
|
|
@@ -7411,7 +7411,7 @@ var require_chalk = __commonJS2({
|
|
|
7411
7411
|
ansiStyles.dim.open = originalDim;
|
|
7412
7412
|
return str;
|
|
7413
7413
|
}
|
|
7414
|
-
function chalkTag(
|
|
7414
|
+
function chalkTag(chalk138, strings) {
|
|
7415
7415
|
if (!Array.isArray(strings)) {
|
|
7416
7416
|
return [].slice.call(arguments, 1).join(" ");
|
|
7417
7417
|
}
|
|
@@ -7421,7 +7421,7 @@ var require_chalk = __commonJS2({
|
|
|
7421
7421
|
parts.push(String(args2[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
7422
7422
|
parts.push(String(strings.raw[i]));
|
|
7423
7423
|
}
|
|
7424
|
-
return template(
|
|
7424
|
+
return template(chalk138, parts.join(""));
|
|
7425
7425
|
}
|
|
7426
7426
|
Object.defineProperties(Chalk.prototype, styles);
|
|
7427
7427
|
module2.exports = Chalk();
|
|
@@ -9372,19 +9372,19 @@ var require_cli_spinners = __commonJS2({
|
|
|
9372
9372
|
var require_log_symbols = __commonJS2({
|
|
9373
9373
|
"../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports2, module2) {
|
|
9374
9374
|
"use strict";
|
|
9375
|
-
var
|
|
9375
|
+
var chalk138 = require_chalk();
|
|
9376
9376
|
var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
|
|
9377
9377
|
var main19 = {
|
|
9378
|
-
info:
|
|
9379
|
-
success:
|
|
9380
|
-
warning:
|
|
9381
|
-
error:
|
|
9378
|
+
info: chalk138.blue("\u2139"),
|
|
9379
|
+
success: chalk138.green("\u2714"),
|
|
9380
|
+
warning: chalk138.yellow("\u26A0"),
|
|
9381
|
+
error: chalk138.red("\u2716")
|
|
9382
9382
|
};
|
|
9383
9383
|
var fallbacks = {
|
|
9384
|
-
info:
|
|
9385
|
-
success:
|
|
9386
|
-
warning:
|
|
9387
|
-
error:
|
|
9384
|
+
info: chalk138.blue("i"),
|
|
9385
|
+
success: chalk138.green("\u221A"),
|
|
9386
|
+
warning: chalk138.yellow("\u203C"),
|
|
9387
|
+
error: chalk138.red("\xD7")
|
|
9388
9388
|
};
|
|
9389
9389
|
module2.exports = isSupported ? main19 : fallbacks;
|
|
9390
9390
|
}
|
|
@@ -9780,7 +9780,7 @@ var require_wcwidth = __commonJS2({
|
|
|
9780
9780
|
var require_ora = __commonJS2({
|
|
9781
9781
|
"../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports2, module2) {
|
|
9782
9782
|
"use strict";
|
|
9783
|
-
var
|
|
9783
|
+
var chalk138 = require_chalk();
|
|
9784
9784
|
var cliCursor = require_cli_cursor();
|
|
9785
9785
|
var cliSpinners = require_cli_spinners();
|
|
9786
9786
|
var logSymbols = require_log_symbols();
|
|
@@ -9869,7 +9869,7 @@ var require_ora = __commonJS2({
|
|
|
9869
9869
|
const { frames } = this.spinner;
|
|
9870
9870
|
let frame = frames[this.frameIndex];
|
|
9871
9871
|
if (this.color) {
|
|
9872
|
-
frame =
|
|
9872
|
+
frame = chalk138[this.color](frame);
|
|
9873
9873
|
}
|
|
9874
9874
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
9875
9875
|
const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
|
|
@@ -12438,14 +12438,14 @@ var require_path = __commonJS2({
|
|
|
12438
12438
|
}
|
|
12439
12439
|
return root + dir;
|
|
12440
12440
|
}
|
|
12441
|
-
function
|
|
12441
|
+
function basename11(path11, ext) {
|
|
12442
12442
|
let f = splitPath(path11)[2];
|
|
12443
12443
|
if (ext && f.slice(ext.length * -1) === ext) {
|
|
12444
12444
|
f = f.slice(0, f.length - ext.length);
|
|
12445
12445
|
}
|
|
12446
12446
|
return f;
|
|
12447
12447
|
}
|
|
12448
|
-
exports2.basename =
|
|
12448
|
+
exports2.basename = basename11;
|
|
12449
12449
|
exports2.dirname = dirname9;
|
|
12450
12450
|
exports2.isAbsolute = isAbsolute2;
|
|
12451
12451
|
exports2.join = join25;
|
|
@@ -31221,11 +31221,11 @@ var require_dist3 = __commonJS2({
|
|
|
31221
31221
|
getPackageJSON: () => getPackageJSON2
|
|
31222
31222
|
});
|
|
31223
31223
|
module2.exports = __toCommonJS4(src_exports2);
|
|
31224
|
-
var
|
|
31225
|
-
var
|
|
31224
|
+
var import_fs11 = __toESM4(require("fs"));
|
|
31225
|
+
var import_path43 = __toESM4(require("path"));
|
|
31226
31226
|
var cache = /* @__PURE__ */ new Map();
|
|
31227
31227
|
function getPackageJSONPath(dir) {
|
|
31228
|
-
return
|
|
31228
|
+
return import_path43.default.join(dir, "package.json");
|
|
31229
31229
|
}
|
|
31230
31230
|
function captureCallerCallSite() {
|
|
31231
31231
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
@@ -31242,15 +31242,15 @@ var require_dist3 = __commonJS2({
|
|
|
31242
31242
|
function getPackageJSON2() {
|
|
31243
31243
|
const callSite = captureCallerCallSite();
|
|
31244
31244
|
const filePath = callSite.getFileName() || callSite.getEvalOrigin();
|
|
31245
|
-
let rootDir =
|
|
31245
|
+
let rootDir = import_path43.default.dirname(filePath);
|
|
31246
31246
|
let packageJSONPath = getPackageJSONPath(rootDir);
|
|
31247
|
-
while (!
|
|
31248
|
-
rootDir =
|
|
31247
|
+
while (!import_fs11.default.existsSync(packageJSONPath)) {
|
|
31248
|
+
rootDir = import_path43.default.join(rootDir, "..");
|
|
31249
31249
|
packageJSONPath = getPackageJSONPath(rootDir);
|
|
31250
31250
|
}
|
|
31251
31251
|
let packageJSON = cache.get(packageJSONPath);
|
|
31252
31252
|
if (!packageJSON) {
|
|
31253
|
-
packageJSON = JSON.parse(
|
|
31253
|
+
packageJSON = JSON.parse(import_fs11.default.readFileSync(packageJSONPath, "utf-8"));
|
|
31254
31254
|
cache.set(packageJSONPath, packageJSON);
|
|
31255
31255
|
}
|
|
31256
31256
|
return packageJSON;
|
|
@@ -34137,7 +34137,7 @@ var init_command31 = __esm({
|
|
|
34137
34137
|
});
|
|
34138
34138
|
|
|
34139
34139
|
// src/commands/redirects/command.ts
|
|
34140
|
-
var listSubcommand8, listVersionsSubcommand, addSubcommand7, removeSubcommand9, promoteSubcommand, restoreSubcommand, redirectsCommand;
|
|
34140
|
+
var listSubcommand8, listVersionsSubcommand, addSubcommand7, uploadSubcommand, removeSubcommand9, promoteSubcommand, restoreSubcommand, redirectsCommand;
|
|
34141
34141
|
var init_command32 = __esm({
|
|
34142
34142
|
"src/commands/redirects/command.ts"() {
|
|
34143
34143
|
"use strict";
|
|
@@ -34290,6 +34290,48 @@ var init_command32 = __esm({
|
|
|
34290
34290
|
}
|
|
34291
34291
|
]
|
|
34292
34292
|
};
|
|
34293
|
+
uploadSubcommand = {
|
|
34294
|
+
name: "upload",
|
|
34295
|
+
aliases: ["import"],
|
|
34296
|
+
description: "Upload redirects from a CSV or JSON file",
|
|
34297
|
+
arguments: [
|
|
34298
|
+
{
|
|
34299
|
+
name: "file",
|
|
34300
|
+
required: true
|
|
34301
|
+
}
|
|
34302
|
+
],
|
|
34303
|
+
options: [
|
|
34304
|
+
{
|
|
34305
|
+
...yesOption,
|
|
34306
|
+
description: "Skip confirmation prompt"
|
|
34307
|
+
},
|
|
34308
|
+
{
|
|
34309
|
+
name: "overwrite",
|
|
34310
|
+
description: "Replace all existing redirects",
|
|
34311
|
+
shorthand: null,
|
|
34312
|
+
type: Boolean,
|
|
34313
|
+
deprecated: false
|
|
34314
|
+
}
|
|
34315
|
+
],
|
|
34316
|
+
examples: [
|
|
34317
|
+
{
|
|
34318
|
+
name: "Upload redirects from CSV file",
|
|
34319
|
+
value: `${packageName} redirects upload redirects.csv`
|
|
34320
|
+
},
|
|
34321
|
+
{
|
|
34322
|
+
name: "Upload redirects from JSON file",
|
|
34323
|
+
value: `${packageName} redirects upload redirects.json`
|
|
34324
|
+
},
|
|
34325
|
+
{
|
|
34326
|
+
name: "Upload and overwrite existing redirects",
|
|
34327
|
+
value: `${packageName} redirects upload redirects.csv --overwrite`
|
|
34328
|
+
},
|
|
34329
|
+
{
|
|
34330
|
+
name: "Upload without confirmation",
|
|
34331
|
+
value: `${packageName} redirects upload redirects.csv --yes`
|
|
34332
|
+
}
|
|
34333
|
+
]
|
|
34334
|
+
};
|
|
34293
34335
|
removeSubcommand9 = {
|
|
34294
34336
|
name: "remove",
|
|
34295
34337
|
aliases: ["rm"],
|
|
@@ -34368,6 +34410,7 @@ var init_command32 = __esm({
|
|
|
34368
34410
|
listSubcommand8,
|
|
34369
34411
|
listVersionsSubcommand,
|
|
34370
34412
|
addSubcommand7,
|
|
34413
|
+
uploadSubcommand,
|
|
34371
34414
|
removeSubcommand9,
|
|
34372
34415
|
promoteSubcommand,
|
|
34373
34416
|
restoreSubcommand
|
|
@@ -36520,14 +36563,14 @@ var require_templates3 = __commonJS2({
|
|
|
36520
36563
|
}
|
|
36521
36564
|
return results;
|
|
36522
36565
|
}
|
|
36523
|
-
function buildStyle(
|
|
36566
|
+
function buildStyle(chalk138, styles) {
|
|
36524
36567
|
const enabled = {};
|
|
36525
36568
|
for (const layer of styles) {
|
|
36526
36569
|
for (const style of layer.styles) {
|
|
36527
36570
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
36528
36571
|
}
|
|
36529
36572
|
}
|
|
36530
|
-
let current =
|
|
36573
|
+
let current = chalk138;
|
|
36531
36574
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
36532
36575
|
if (!Array.isArray(styles2)) {
|
|
36533
36576
|
continue;
|
|
@@ -36539,7 +36582,7 @@ var require_templates3 = __commonJS2({
|
|
|
36539
36582
|
}
|
|
36540
36583
|
return current;
|
|
36541
36584
|
}
|
|
36542
|
-
module2.exports = (
|
|
36585
|
+
module2.exports = (chalk138, temporary) => {
|
|
36543
36586
|
const styles = [];
|
|
36544
36587
|
const chunks = [];
|
|
36545
36588
|
let chunk = [];
|
|
@@ -36549,13 +36592,13 @@ var require_templates3 = __commonJS2({
|
|
|
36549
36592
|
} else if (style) {
|
|
36550
36593
|
const string = chunk.join("");
|
|
36551
36594
|
chunk = [];
|
|
36552
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
36595
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk138, styles)(string));
|
|
36553
36596
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
36554
36597
|
} else if (close2) {
|
|
36555
36598
|
if (styles.length === 0) {
|
|
36556
36599
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
36557
36600
|
}
|
|
36558
|
-
chunks.push(buildStyle(
|
|
36601
|
+
chunks.push(buildStyle(chalk138, styles)(chunk.join("")));
|
|
36559
36602
|
chunk = [];
|
|
36560
36603
|
styles.pop();
|
|
36561
36604
|
} else {
|
|
@@ -36603,16 +36646,16 @@ var require_source2 = __commonJS2({
|
|
|
36603
36646
|
}
|
|
36604
36647
|
};
|
|
36605
36648
|
var chalkFactory = (options) => {
|
|
36606
|
-
const
|
|
36607
|
-
applyOptions(
|
|
36608
|
-
|
|
36609
|
-
Object.setPrototypeOf(
|
|
36610
|
-
Object.setPrototypeOf(
|
|
36611
|
-
|
|
36649
|
+
const chalk139 = {};
|
|
36650
|
+
applyOptions(chalk139, options);
|
|
36651
|
+
chalk139.template = (...arguments_) => chalkTag(chalk139.template, ...arguments_);
|
|
36652
|
+
Object.setPrototypeOf(chalk139, Chalk.prototype);
|
|
36653
|
+
Object.setPrototypeOf(chalk139.template, chalk139);
|
|
36654
|
+
chalk139.template.constructor = () => {
|
|
36612
36655
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
36613
36656
|
};
|
|
36614
|
-
|
|
36615
|
-
return
|
|
36657
|
+
chalk139.template.Instance = ChalkClass;
|
|
36658
|
+
return chalk139.template;
|
|
36616
36659
|
};
|
|
36617
36660
|
function Chalk(options) {
|
|
36618
36661
|
return chalkFactory(options);
|
|
@@ -36723,7 +36766,7 @@ var require_source2 = __commonJS2({
|
|
|
36723
36766
|
return openAll + string + closeAll;
|
|
36724
36767
|
};
|
|
36725
36768
|
var template;
|
|
36726
|
-
var chalkTag = (
|
|
36769
|
+
var chalkTag = (chalk139, ...strings) => {
|
|
36727
36770
|
const [firstString] = strings;
|
|
36728
36771
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
36729
36772
|
return strings.join(" ");
|
|
@@ -36739,14 +36782,14 @@ var require_source2 = __commonJS2({
|
|
|
36739
36782
|
if (template === void 0) {
|
|
36740
36783
|
template = require_templates3();
|
|
36741
36784
|
}
|
|
36742
|
-
return template(
|
|
36785
|
+
return template(chalk139, parts.join(""));
|
|
36743
36786
|
};
|
|
36744
36787
|
Object.defineProperties(Chalk.prototype, styles);
|
|
36745
|
-
var
|
|
36746
|
-
|
|
36747
|
-
|
|
36748
|
-
|
|
36749
|
-
module2.exports =
|
|
36788
|
+
var chalk138 = Chalk();
|
|
36789
|
+
chalk138.supportsColor = stdoutColor;
|
|
36790
|
+
chalk138.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
36791
|
+
chalk138.stderr.supportsColor = stderrColor;
|
|
36792
|
+
module2.exports = chalk138;
|
|
36750
36793
|
}
|
|
36751
36794
|
});
|
|
36752
36795
|
|
|
@@ -47828,8 +47871,8 @@ var require_copy_sync3 = __commonJS2({
|
|
|
47828
47871
|
return getStats(destStat, src, dest, opts);
|
|
47829
47872
|
}
|
|
47830
47873
|
function getStats(destStat, src, dest, opts) {
|
|
47831
|
-
const
|
|
47832
|
-
const srcStat =
|
|
47874
|
+
const statSync3 = opts.dereference ? fs15.statSync : fs15.lstatSync;
|
|
47875
|
+
const srcStat = statSync3(src);
|
|
47833
47876
|
if (srcStat.isDirectory())
|
|
47834
47877
|
return onDir(srcStat, destStat, src, dest, opts);
|
|
47835
47878
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
@@ -48871,7 +48914,7 @@ var require_jsonfile3 = __commonJS2({
|
|
|
48871
48914
|
callback(null, obj);
|
|
48872
48915
|
});
|
|
48873
48916
|
}
|
|
48874
|
-
function
|
|
48917
|
+
function readFileSync4(file, options) {
|
|
48875
48918
|
options = options || {};
|
|
48876
48919
|
if (typeof options === "string") {
|
|
48877
48920
|
options = { encoding: options };
|
|
@@ -48939,7 +48982,7 @@ var require_jsonfile3 = __commonJS2({
|
|
|
48939
48982
|
}
|
|
48940
48983
|
var jsonfile = {
|
|
48941
48984
|
readFile: readFile6,
|
|
48942
|
-
readFileSync:
|
|
48985
|
+
readFileSync: readFileSync4,
|
|
48943
48986
|
writeFile: writeFile5,
|
|
48944
48987
|
writeFileSync
|
|
48945
48988
|
};
|
|
@@ -50057,7 +50100,7 @@ var require_package = __commonJS2({
|
|
|
50057
50100
|
"../client/package.json"(exports2, module2) {
|
|
50058
50101
|
module2.exports = {
|
|
50059
50102
|
name: "@vercel/client",
|
|
50060
|
-
version: "17.2.
|
|
50103
|
+
version: "17.2.17",
|
|
50061
50104
|
main: "dist/index.js",
|
|
50062
50105
|
typings: "dist/index.d.ts",
|
|
50063
50106
|
homepage: "https://vercel.com",
|
|
@@ -50944,8 +50987,8 @@ var require_readdir_recursive = __commonJS2({
|
|
|
50944
50987
|
default: () => readdir2
|
|
50945
50988
|
});
|
|
50946
50989
|
module2.exports = __toCommonJS4(readdir_recursive_exports);
|
|
50947
|
-
var
|
|
50948
|
-
var
|
|
50990
|
+
var import_fs11 = __toESM4(require("fs"));
|
|
50991
|
+
var import_path43 = __toESM4(require("path"));
|
|
50949
50992
|
var import_minimatch5 = __toESM4(require_minimatch());
|
|
50950
50993
|
function patternMatcher(pattern) {
|
|
50951
50994
|
return function(path11, stats) {
|
|
@@ -50964,7 +51007,7 @@ var require_readdir_recursive = __commonJS2({
|
|
|
50964
51007
|
ignores = ignores.map(toMatcherFunction);
|
|
50965
51008
|
let list10 = [];
|
|
50966
51009
|
return new Promise(function(resolve13, reject) {
|
|
50967
|
-
|
|
51010
|
+
import_fs11.default.readdir(path11, function(err, files) {
|
|
50968
51011
|
if (err) {
|
|
50969
51012
|
return reject(err);
|
|
50970
51013
|
}
|
|
@@ -50973,8 +51016,8 @@ var require_readdir_recursive = __commonJS2({
|
|
|
50973
51016
|
return resolve13(list10);
|
|
50974
51017
|
}
|
|
50975
51018
|
files.forEach(function(file) {
|
|
50976
|
-
const filePath =
|
|
50977
|
-
|
|
51019
|
+
const filePath = import_path43.default.join(path11, file);
|
|
51020
|
+
import_fs11.default.lstat(filePath, function(_err, stats) {
|
|
50978
51021
|
if (_err) {
|
|
50979
51022
|
return reject(_err);
|
|
50980
51023
|
}
|
|
@@ -55871,8 +55914,8 @@ var require_pattern = __commonJS2({
|
|
|
55871
55914
|
}
|
|
55872
55915
|
exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
55873
55916
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
55874
|
-
const
|
|
55875
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
55917
|
+
const basename11 = path11.basename(pattern);
|
|
55918
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename11);
|
|
55876
55919
|
}
|
|
55877
55920
|
exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
55878
55921
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -56346,11 +56389,11 @@ var require_out = __commonJS2({
|
|
|
56346
56389
|
async.read(path11, getSettings(optionsOrSettingsOrCallback), callback);
|
|
56347
56390
|
}
|
|
56348
56391
|
exports2.stat = stat2;
|
|
56349
|
-
function
|
|
56392
|
+
function statSync3(path11, optionsOrSettings) {
|
|
56350
56393
|
const settings = getSettings(optionsOrSettings);
|
|
56351
56394
|
return sync.read(path11, settings);
|
|
56352
56395
|
}
|
|
56353
|
-
exports2.statSync =
|
|
56396
|
+
exports2.statSync = statSync3;
|
|
56354
56397
|
function getSettings(settingsOrOptions = {}) {
|
|
56355
56398
|
if (settingsOrOptions instanceof settings_1.default) {
|
|
56356
56399
|
return settingsOrOptions;
|
|
@@ -58483,7 +58526,7 @@ var require_utils14 = __commonJS2({
|
|
|
58483
58526
|
});
|
|
58484
58527
|
module2.exports = __toCommonJS4(utils_exports);
|
|
58485
58528
|
var import_node_fetch7 = __toESM4(require_lib7());
|
|
58486
|
-
var
|
|
58529
|
+
var import_path43 = require("path");
|
|
58487
58530
|
var import_url20 = require("url");
|
|
58488
58531
|
var import_ignore = __toESM4(require_ignore());
|
|
58489
58532
|
var import_pkg5 = require_pkg();
|
|
@@ -58556,7 +58599,7 @@ var require_utils14 = __commonJS2({
|
|
|
58556
58599
|
debug2("Building file tree...");
|
|
58557
58600
|
if (isDirectory2 && !Array.isArray(path11)) {
|
|
58558
58601
|
const ignores2 = (absPath) => {
|
|
58559
|
-
const rel = (0,
|
|
58602
|
+
const rel = (0, import_path43.relative)(path11, absPath);
|
|
58560
58603
|
const ignored = ig.ignores(rel);
|
|
58561
58604
|
if (ignored) {
|
|
58562
58605
|
ignoreList.push(rel);
|
|
@@ -58567,7 +58610,7 @@ var require_utils14 = __commonJS2({
|
|
|
58567
58610
|
const refs = /* @__PURE__ */ new Set();
|
|
58568
58611
|
if (prebuilt) {
|
|
58569
58612
|
const vcConfigFilePaths = fileList.filter(
|
|
58570
|
-
(file) => (0,
|
|
58613
|
+
(file) => (0, import_path43.basename)(file) === ".vc-config.json"
|
|
58571
58614
|
);
|
|
58572
58615
|
await Promise.all(
|
|
58573
58616
|
vcConfigFilePaths.map(async (p) => {
|
|
@@ -58576,13 +58619,13 @@ var require_utils14 = __commonJS2({
|
|
|
58576
58619
|
if (!config2.filePathMap)
|
|
58577
58620
|
return;
|
|
58578
58621
|
for (const v of Object.values(config2.filePathMap)) {
|
|
58579
|
-
refs.add((0,
|
|
58622
|
+
refs.add((0, import_path43.join)(path11, v));
|
|
58580
58623
|
}
|
|
58581
58624
|
})
|
|
58582
58625
|
);
|
|
58583
58626
|
try {
|
|
58584
58627
|
let microfrontendConfigPath = (0, import_utils6.findConfig)({
|
|
58585
|
-
dir: (0,
|
|
58628
|
+
dir: (0, import_path43.join)(path11, rootDirectory || "")
|
|
58586
58629
|
});
|
|
58587
58630
|
if (!microfrontendConfigPath && !rootDirectory && projectName) {
|
|
58588
58631
|
microfrontendConfigPath = (0, import_utils6.findConfig)({
|
|
@@ -58600,7 +58643,7 @@ var require_utils14 = __commonJS2({
|
|
|
58600
58643
|
}
|
|
58601
58644
|
}
|
|
58602
58645
|
try {
|
|
58603
|
-
const routesJsonPath = (0,
|
|
58646
|
+
const routesJsonPath = (0, import_path43.join)(path11, ".vercel", "routes.json");
|
|
58604
58647
|
const routesJsonContent = await maybeRead(routesJsonPath, null);
|
|
58605
58648
|
if (routesJsonContent !== null) {
|
|
58606
58649
|
refs.add(routesJsonPath);
|
|
@@ -58634,9 +58677,9 @@ var require_utils14 = __commonJS2({
|
|
|
58634
58677
|
if (typeof cwd !== "string") {
|
|
58635
58678
|
throw new Error(`\`cwd\` must be a "string"`);
|
|
58636
58679
|
}
|
|
58637
|
-
const relOutputDir = (0,
|
|
58680
|
+
const relOutputDir = (0, import_path43.relative)(cwd, vercelOutputDir);
|
|
58638
58681
|
ignores = ["*"];
|
|
58639
|
-
const parts = relOutputDir.split(
|
|
58682
|
+
const parts = relOutputDir.split(import_path43.sep);
|
|
58640
58683
|
parts.forEach((_, i) => {
|
|
58641
58684
|
const level = parts.slice(0, i + 1).join("/");
|
|
58642
58685
|
ignores.push(`!${level}`);
|
|
@@ -58676,8 +58719,8 @@ var require_utils14 = __commonJS2({
|
|
|
58676
58719
|
const files = await Promise.all(
|
|
58677
58720
|
cwds.map(async (cwd2) => {
|
|
58678
58721
|
const [vercelignore, nowignore] = await Promise.all([
|
|
58679
|
-
maybeRead((0,
|
|
58680
|
-
maybeRead((0,
|
|
58722
|
+
maybeRead((0, import_path43.join)(cwd2, ".vercelignore"), ""),
|
|
58723
|
+
maybeRead((0, import_path43.join)(cwd2, ".nowignore"), "")
|
|
58681
58724
|
]);
|
|
58682
58725
|
if (vercelignore && nowignore) {
|
|
58683
58726
|
throw new import_build_utils19.NowBuildError({
|
|
@@ -58736,9 +58779,9 @@ ${clearRelative(ignoreFile)}`);
|
|
|
58736
58779
|
for (const name of file.names) {
|
|
58737
58780
|
let fileName;
|
|
58738
58781
|
if (clientOptions.isDirectory) {
|
|
58739
|
-
fileName = typeof clientOptions.path === "string" ? (0,
|
|
58782
|
+
fileName = typeof clientOptions.path === "string" ? (0, import_path43.relative)(clientOptions.path, name) : name;
|
|
58740
58783
|
} else {
|
|
58741
|
-
const segments = name.split(
|
|
58784
|
+
const segments = name.split(import_path43.sep);
|
|
58742
58785
|
fileName = segments[segments.length - 1];
|
|
58743
58786
|
}
|
|
58744
58787
|
preparedFiles.push({
|
|
@@ -59488,7 +59531,7 @@ var require_upload = __commonJS2({
|
|
|
59488
59531
|
var __toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
|
|
59489
59532
|
var upload_exports = {};
|
|
59490
59533
|
__export4(upload_exports, {
|
|
59491
|
-
upload: () =>
|
|
59534
|
+
upload: () => upload2
|
|
59492
59535
|
});
|
|
59493
59536
|
module2.exports = __toCommonJS4(upload_exports);
|
|
59494
59537
|
var import_http4 = __toESM4(require("http"));
|
|
@@ -59506,7 +59549,7 @@ var require_upload = __commonJS2({
|
|
|
59506
59549
|
}
|
|
59507
59550
|
return false;
|
|
59508
59551
|
};
|
|
59509
|
-
async function*
|
|
59552
|
+
async function* upload2(files, clientOptions, deploymentOptions) {
|
|
59510
59553
|
const { token, teamId, apiUrl: apiUrl2, userAgent: userAgent2 } = clientOptions;
|
|
59511
59554
|
const debug2 = (0, import_utils6.createDebug)(clientOptions.debug);
|
|
59512
59555
|
if (!files && !token && !teamId) {
|
|
@@ -63863,9 +63906,9 @@ var require_create_deployment = __commonJS2({
|
|
|
63863
63906
|
});
|
|
63864
63907
|
module2.exports = __toCommonJS4(create_deployment_exports);
|
|
63865
63908
|
var import_fs_extra25 = require_lib8();
|
|
63866
|
-
var
|
|
63909
|
+
var import_path43 = require("path");
|
|
63867
63910
|
var import_hashes = require_hashes();
|
|
63868
|
-
var
|
|
63911
|
+
var import_upload2 = require_upload();
|
|
63869
63912
|
var import_utils6 = require_utils14();
|
|
63870
63913
|
var import_errors4 = require_errors2();
|
|
63871
63914
|
var import_error_utils38 = require_dist2();
|
|
@@ -63898,14 +63941,14 @@ var require_create_deployment = __commonJS2({
|
|
|
63898
63941
|
clientOptions.isDirectory = !Array.isArray(path11) && (0, import_fs_extra25.lstatSync)(path11).isDirectory();
|
|
63899
63942
|
if (Array.isArray(path11)) {
|
|
63900
63943
|
for (const filePath of path11) {
|
|
63901
|
-
if (!(0,
|
|
63944
|
+
if (!(0, import_path43.isAbsolute)(filePath)) {
|
|
63902
63945
|
throw new import_errors4.DeploymentError({
|
|
63903
63946
|
code: "invalid_path",
|
|
63904
63947
|
message: `Provided path ${filePath} is not absolute`
|
|
63905
63948
|
});
|
|
63906
63949
|
}
|
|
63907
63950
|
}
|
|
63908
|
-
} else if (!(0,
|
|
63951
|
+
} else if (!(0, import_path43.isAbsolute)(path11)) {
|
|
63909
63952
|
throw new import_errors4.DeploymentError({
|
|
63910
63953
|
code: "invalid_path",
|
|
63911
63954
|
message: `Provided path ${path11} is not absolute`
|
|
@@ -63932,7 +63975,7 @@ var require_create_deployment = __commonJS2({
|
|
|
63932
63975
|
if (clientOptions.archive === "tgz") {
|
|
63933
63976
|
debug2("Packing tarball");
|
|
63934
63977
|
const tarStream = import_tar_fs2.default.pack(workPath, {
|
|
63935
|
-
entries: fileList.map((file) => (0,
|
|
63978
|
+
entries: fileList.map((file) => (0, import_path43.relative)(workPath, file))
|
|
63936
63979
|
}).pipe((0, import_zlib.createGzip)());
|
|
63937
63980
|
const chunkedTarBuffers = await (0, import_build_utils19.streamToBufferChunks)(tarStream);
|
|
63938
63981
|
debug2(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
@@ -63940,7 +63983,7 @@ var require_create_deployment = __commonJS2({
|
|
|
63940
63983
|
chunkedTarBuffers.map((chunk, index) => [
|
|
63941
63984
|
(0, import_hashes.hash)(chunk),
|
|
63942
63985
|
{
|
|
63943
|
-
names: [(0,
|
|
63986
|
+
names: [(0, import_path43.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
63944
63987
|
data: chunk,
|
|
63945
63988
|
mode: 438
|
|
63946
63989
|
}
|
|
@@ -63951,9 +63994,9 @@ var require_create_deployment = __commonJS2({
|
|
|
63951
63994
|
}
|
|
63952
63995
|
} catch (err) {
|
|
63953
63996
|
if (clientOptions.prebuilt && (0, import_error_utils38.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
|
|
63954
|
-
const errPath = (0,
|
|
63955
|
-
err.message = `File does not exist: "${(0,
|
|
63956
|
-
if (errPath.split(
|
|
63997
|
+
const errPath = (0, import_path43.relative)(workPath, err.path);
|
|
63998
|
+
err.message = `File does not exist: "${(0, import_path43.relative)(workPath, errPath)}"`;
|
|
63999
|
+
if (errPath.split(import_path43.sep).includes("node_modules")) {
|
|
63957
64000
|
err.message = `Please ensure project dependencies have been installed:
|
|
63958
64001
|
${err.message}`;
|
|
63959
64002
|
}
|
|
@@ -63971,7 +64014,7 @@ ${err.message}`;
|
|
|
63971
64014
|
debug2(`Setting platform version to harcoded value 2`);
|
|
63972
64015
|
deploymentOptions.version = 2;
|
|
63973
64016
|
debug2(`Creating the deployment and starting upload...`);
|
|
63974
|
-
for await (const event of (0,
|
|
64017
|
+
for await (const event of (0, import_upload2.upload)(files, clientOptions, deploymentOptions)) {
|
|
63975
64018
|
debug2(`Yielding a '${event.type}' event`);
|
|
63976
64019
|
yield event;
|
|
63977
64020
|
}
|
|
@@ -77373,9 +77416,9 @@ var require_read_config_file = __commonJS2({
|
|
|
77373
77416
|
module2.exports = __toCommonJS4(read_config_file_exports);
|
|
77374
77417
|
var import_js_yaml = __toESM4(require_js_yaml2());
|
|
77375
77418
|
var import_toml = __toESM4(require_toml());
|
|
77376
|
-
var
|
|
77419
|
+
var import_fs11 = require("fs");
|
|
77377
77420
|
var import_error_utils38 = require_dist2();
|
|
77378
|
-
var { readFile: readFile6 } =
|
|
77421
|
+
var { readFile: readFile6 } = import_fs11.promises;
|
|
77379
77422
|
async function readFileOrNull(file) {
|
|
77380
77423
|
try {
|
|
77381
77424
|
const data = await readFile6(file);
|
|
@@ -77461,11 +77504,11 @@ var require_frameworks = __commonJS2({
|
|
|
77461
77504
|
frameworks: () => frameworks
|
|
77462
77505
|
});
|
|
77463
77506
|
module2.exports = __toCommonJS4(frameworks_exports);
|
|
77464
|
-
var
|
|
77465
|
-
var
|
|
77507
|
+
var import_path43 = require("path");
|
|
77508
|
+
var import_fs11 = require("fs");
|
|
77466
77509
|
var import_read_config_file = require_read_config_file();
|
|
77467
77510
|
__reExport(frameworks_exports, require_types3(), module2.exports);
|
|
77468
|
-
var { readdir: readdir2, readFile: readFile6, unlink: unlink2 } =
|
|
77511
|
+
var { readdir: readdir2, readFile: readFile6, unlink: unlink2 } = import_fs11.promises;
|
|
77469
77512
|
var frameworks = [
|
|
77470
77513
|
{
|
|
77471
77514
|
name: "Blitz.js (Legacy)",
|
|
@@ -77588,7 +77631,7 @@ var require_frameworks = __commonJS2({
|
|
|
77588
77631
|
getOutputDirName: async () => "public",
|
|
77589
77632
|
defaultRoutes: async (dirPrefix) => {
|
|
77590
77633
|
try {
|
|
77591
|
-
const nowRoutesPath = (0,
|
|
77634
|
+
const nowRoutesPath = (0, import_path43.join)(
|
|
77592
77635
|
dirPrefix,
|
|
77593
77636
|
"public",
|
|
77594
77637
|
"__now_routes_g4t5bY.json"
|
|
@@ -77876,10 +77919,10 @@ var require_frameworks = __commonJS2({
|
|
|
77876
77919
|
getOutputDirName: async (dirPrefix) => {
|
|
77877
77920
|
const base = "build";
|
|
77878
77921
|
try {
|
|
77879
|
-
const location = (0,
|
|
77922
|
+
const location = (0, import_path43.join)(dirPrefix, base);
|
|
77880
77923
|
const content = await readdir2(location, { withFileTypes: true });
|
|
77881
77924
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
77882
|
-
return (0,
|
|
77925
|
+
return (0, import_path43.join)(base, content[0].name);
|
|
77883
77926
|
}
|
|
77884
77927
|
} catch (error3) {
|
|
77885
77928
|
console.error(`Error detecting output directory: `, error3);
|
|
@@ -77957,10 +78000,10 @@ var require_frameworks = __commonJS2({
|
|
|
77957
78000
|
getOutputDirName: async (dirPrefix) => {
|
|
77958
78001
|
const base = "build";
|
|
77959
78002
|
try {
|
|
77960
|
-
const location = (0,
|
|
78003
|
+
const location = (0, import_path43.join)(dirPrefix, base);
|
|
77961
78004
|
const content = await readdir2(location, { withFileTypes: true });
|
|
77962
78005
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
77963
|
-
return (0,
|
|
78006
|
+
return (0, import_path43.join)(base, content[0].name);
|
|
77964
78007
|
}
|
|
77965
78008
|
} catch (error3) {
|
|
77966
78009
|
console.error(`Error detecting output directory: `, error3);
|
|
@@ -78121,7 +78164,7 @@ var require_frameworks = __commonJS2({
|
|
|
78121
78164
|
}
|
|
78122
78165
|
},
|
|
78123
78166
|
dependency: "@dojo/cli",
|
|
78124
|
-
getOutputDirName: async () => (0,
|
|
78167
|
+
getOutputDirName: async () => (0, import_path43.join)("output", "dist"),
|
|
78125
78168
|
defaultRoutes: [
|
|
78126
78169
|
{
|
|
78127
78170
|
handle: "filesystem"
|
|
@@ -78356,12 +78399,12 @@ var require_frameworks = __commonJS2({
|
|
|
78356
78399
|
getOutputDirName: async (dirPrefix) => {
|
|
78357
78400
|
const base = "dist";
|
|
78358
78401
|
try {
|
|
78359
|
-
const location = (0,
|
|
78402
|
+
const location = (0, import_path43.join)(dirPrefix, base);
|
|
78360
78403
|
const content = await readdir2(location, { withFileTypes: true });
|
|
78361
78404
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
78362
|
-
const potentialOutDir = (0,
|
|
78363
|
-
const potentialOutDirWithBrowser = (0,
|
|
78364
|
-
return (0,
|
|
78405
|
+
const potentialOutDir = (0, import_path43.join)(base, content[0].name);
|
|
78406
|
+
const potentialOutDirWithBrowser = (0, import_path43.join)(potentialOutDir, "browser");
|
|
78407
|
+
return (0, import_fs11.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
|
|
78365
78408
|
}
|
|
78366
78409
|
} catch (error3) {
|
|
78367
78410
|
console.error(`Error detecting output directory: `, error3);
|
|
@@ -78413,10 +78456,10 @@ var require_frameworks = __commonJS2({
|
|
|
78413
78456
|
getOutputDirName: async (dirPrefix) => {
|
|
78414
78457
|
const base = "build";
|
|
78415
78458
|
try {
|
|
78416
|
-
const location = (0,
|
|
78459
|
+
const location = (0, import_path43.join)(dirPrefix, base);
|
|
78417
78460
|
const content = await readdir2(location);
|
|
78418
78461
|
const paths = content.filter((item) => !item.includes("."));
|
|
78419
|
-
return (0,
|
|
78462
|
+
return (0, import_path43.join)(base, paths[0]);
|
|
78420
78463
|
} catch (error3) {
|
|
78421
78464
|
console.error(`Error detecting output directory: `, error3);
|
|
78422
78465
|
}
|
|
@@ -79032,7 +79075,7 @@ var require_frameworks = __commonJS2({
|
|
|
79032
79075
|
getOutputDirName: async (dirPrefix) => {
|
|
79033
79076
|
const config2 = await (0, import_read_config_file.readConfigFile)(
|
|
79034
79077
|
["config.json", "config.yaml", "config.toml"].map((fileName) => {
|
|
79035
|
-
return (0,
|
|
79078
|
+
return (0, import_path43.join)(dirPrefix, fileName);
|
|
79036
79079
|
})
|
|
79037
79080
|
);
|
|
79038
79081
|
return config2 && config2.publishDir || "public";
|
|
@@ -79073,7 +79116,7 @@ var require_frameworks = __commonJS2({
|
|
|
79073
79116
|
},
|
|
79074
79117
|
getOutputDirName: async (dirPrefix) => {
|
|
79075
79118
|
const config2 = await (0, import_read_config_file.readConfigFile)(
|
|
79076
|
-
(0,
|
|
79119
|
+
(0, import_path43.join)(dirPrefix, "_config.yml")
|
|
79077
79120
|
);
|
|
79078
79121
|
return config2 && config2.destination || "_site";
|
|
79079
79122
|
},
|
|
@@ -82949,7 +82992,7 @@ var require_detect_builders = __commonJS2({
|
|
|
82949
82992
|
module2.exports = __toCommonJS4(detect_builders_exports);
|
|
82950
82993
|
var import_minimatch5 = __toESM4(require_minimatch2());
|
|
82951
82994
|
var import_semver4 = require_semver2();
|
|
82952
|
-
var
|
|
82995
|
+
var import_path43 = require("path");
|
|
82953
82996
|
var import_frameworks8 = __toESM4(require_frameworks());
|
|
82954
82997
|
var import_is_official_runtime = require_is_official_runtime();
|
|
82955
82998
|
var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
|
|
@@ -82965,7 +83008,7 @@ var require_detect_builders = __commonJS2({
|
|
|
82965
83008
|
return new Set(
|
|
82966
83009
|
builders.filter(
|
|
82967
83010
|
(b) => Boolean(b.config && b.config.zeroConfig && b.src?.startsWith("api/"))
|
|
82968
|
-
).map((b) => (0,
|
|
83011
|
+
).map((b) => (0, import_path43.extname)(b.src)).filter(Boolean)
|
|
82969
83012
|
);
|
|
82970
83013
|
}
|
|
82971
83014
|
function detectApiDirectory3(builders) {
|
|
@@ -83500,14 +83543,14 @@ var require_detect_builders = __commonJS2({
|
|
|
83500
83543
|
return null;
|
|
83501
83544
|
}
|
|
83502
83545
|
function getSegmentName(segment) {
|
|
83503
|
-
const { name } = (0,
|
|
83546
|
+
const { name } = (0, import_path43.parse)(segment);
|
|
83504
83547
|
if (name.startsWith("[") && name.endsWith("]")) {
|
|
83505
83548
|
return name.slice(1, -1);
|
|
83506
83549
|
}
|
|
83507
83550
|
return null;
|
|
83508
83551
|
}
|
|
83509
83552
|
function getAbsolutePath(unresolvedPath) {
|
|
83510
|
-
const { dir, name } = (0,
|
|
83553
|
+
const { dir, name } = (0, import_path43.parse)(unresolvedPath);
|
|
83511
83554
|
const parts = joinPath(dir, name).split("/");
|
|
83512
83555
|
return parts.map((part) => part.replace(/\[.*\]/, "1")).join("/");
|
|
83513
83556
|
}
|
|
@@ -83586,7 +83629,7 @@ var require_detect_builders = __commonJS2({
|
|
|
83586
83629
|
isDynamic = true;
|
|
83587
83630
|
return `([^/]+)`;
|
|
83588
83631
|
} else if (isLast) {
|
|
83589
|
-
const { name: fileName2, ext: ext2 } = (0,
|
|
83632
|
+
const { name: fileName2, ext: ext2 } = (0, import_path43.parse)(segment);
|
|
83590
83633
|
const isIndex22 = fileName2 === "index";
|
|
83591
83634
|
const prefix = isIndex22 ? "/" : "";
|
|
83592
83635
|
const names = [
|
|
@@ -83598,7 +83641,7 @@ var require_detect_builders = __commonJS2({
|
|
|
83598
83641
|
}
|
|
83599
83642
|
return segment;
|
|
83600
83643
|
});
|
|
83601
|
-
const { name: fileName, ext } = (0,
|
|
83644
|
+
const { name: fileName, ext } = (0, import_path43.parse)(filePath);
|
|
83602
83645
|
const isIndex2 = fileName === "index";
|
|
83603
83646
|
const queryString = `${query.length ? "?" : ""}${query.join("&")}`;
|
|
83604
83647
|
const src = isIndex2 ? `^/${srcParts.slice(0, -1).join("/")}${srcParts.slice(-1)[0]}$` : `^/${srcParts.join("/")}$`;
|
|
@@ -84237,7 +84280,7 @@ var require_filesystem = __commonJS2({
|
|
|
84237
84280
|
DetectorFilesystem: () => DetectorFilesystem2
|
|
84238
84281
|
});
|
|
84239
84282
|
module2.exports = __toCommonJS4(filesystem_exports);
|
|
84240
|
-
var
|
|
84283
|
+
var import_path43 = require("path");
|
|
84241
84284
|
var DetectorFilesystem2 = class {
|
|
84242
84285
|
constructor() {
|
|
84243
84286
|
this.hasPath = async (path11) => {
|
|
@@ -84281,13 +84324,13 @@ var require_filesystem = __commonJS2({
|
|
|
84281
84324
|
}
|
|
84282
84325
|
if (options?.potentialFiles) {
|
|
84283
84326
|
const filesInReaddirDir = options.potentialFiles.filter(
|
|
84284
|
-
(path11) => (0,
|
|
84327
|
+
(path11) => (0, import_path43.basename)(path11) === path11
|
|
84285
84328
|
);
|
|
84286
84329
|
const filesThatDoNotExist = filesInReaddirDir.filter(
|
|
84287
84330
|
(path11) => !directoryFiles.has(path11)
|
|
84288
84331
|
);
|
|
84289
84332
|
for (const filePath of filesThatDoNotExist) {
|
|
84290
|
-
const fullFilePath = dirPath === "/" ? filePath :
|
|
84333
|
+
const fullFilePath = dirPath === "/" ? filePath : import_path43.posix.join(dirPath, filePath);
|
|
84291
84334
|
this.fileCache.set(fullFilePath, Promise.resolve(false));
|
|
84292
84335
|
this.pathCache.set(fullFilePath, Promise.resolve(false));
|
|
84293
84336
|
}
|
|
@@ -84348,7 +84391,7 @@ var require_local_file_system_detector = __commonJS2({
|
|
|
84348
84391
|
});
|
|
84349
84392
|
module2.exports = __toCommonJS4(local_file_system_detector_exports);
|
|
84350
84393
|
var import_promises5 = __toESM4(require("fs/promises"));
|
|
84351
|
-
var
|
|
84394
|
+
var import_path43 = require("path");
|
|
84352
84395
|
var import_filesystem = require_filesystem();
|
|
84353
84396
|
var import_error_utils38 = require_dist2();
|
|
84354
84397
|
var LocalFileSystemDetector5 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
|
|
@@ -84389,7 +84432,7 @@ var require_local_file_system_detector = __commonJS2({
|
|
|
84389
84432
|
}
|
|
84390
84433
|
result.push({
|
|
84391
84434
|
name: entry.name,
|
|
84392
|
-
path: (0,
|
|
84435
|
+
path: (0, import_path43.join)(this.getRelativeFilePath(dir), entry.name),
|
|
84393
84436
|
type
|
|
84394
84437
|
});
|
|
84395
84438
|
}
|
|
@@ -84399,10 +84442,10 @@ var require_local_file_system_detector = __commonJS2({
|
|
|
84399
84442
|
return new _LocalFileSystemDetector(this.getFilePath(name));
|
|
84400
84443
|
}
|
|
84401
84444
|
getRelativeFilePath(name) {
|
|
84402
|
-
return name.startsWith(this.rootPath) ? (0,
|
|
84445
|
+
return name.startsWith(this.rootPath) ? (0, import_path43.relative)(this.rootPath, name) : name;
|
|
84403
84446
|
}
|
|
84404
84447
|
getFilePath(name) {
|
|
84405
|
-
return (0,
|
|
84448
|
+
return (0, import_path43.join)(this.rootPath, this.getRelativeFilePath(name));
|
|
84406
84449
|
}
|
|
84407
84450
|
};
|
|
84408
84451
|
}
|
|
@@ -84553,11 +84596,11 @@ var require_get_workspaces = __commonJS2({
|
|
|
84553
84596
|
getWorkspaces: () => getWorkspaces3
|
|
84554
84597
|
});
|
|
84555
84598
|
module2.exports = __toCommonJS4(get_workspaces_exports);
|
|
84556
|
-
var
|
|
84599
|
+
var import_path43 = __toESM4(require("path"));
|
|
84557
84600
|
var import_workspace_managers = require_workspace_managers();
|
|
84558
84601
|
var import_detect_framework = require_detect_framework();
|
|
84559
84602
|
var MAX_DEPTH_TRAVERSE = 3;
|
|
84560
|
-
var posixPath =
|
|
84603
|
+
var posixPath = import_path43.default.posix;
|
|
84561
84604
|
async function getWorkspaces3({
|
|
84562
84605
|
fs: fs15,
|
|
84563
84606
|
depth = MAX_DEPTH_TRAVERSE,
|
|
@@ -90028,7 +90071,7 @@ var require_get_glob_fs = __commonJS2({
|
|
|
90028
90071
|
getGlobFs: () => getGlobFs
|
|
90029
90072
|
});
|
|
90030
90073
|
module2.exports = __toCommonJS4(get_glob_fs_exports);
|
|
90031
|
-
var
|
|
90074
|
+
var import_fs11 = __toESM4(require("fs"));
|
|
90032
90075
|
function removeWindowsPrefix(path11) {
|
|
90033
90076
|
return path11.replace(/^[a-zA-Z]:/, "");
|
|
90034
90077
|
}
|
|
@@ -90072,7 +90115,7 @@ var require_get_glob_fs = __commonJS2({
|
|
|
90072
90115
|
});
|
|
90073
90116
|
}).catch((err) => callback(err, null));
|
|
90074
90117
|
};
|
|
90075
|
-
return new Proxy(
|
|
90118
|
+
return new Proxy(import_fs11.default, {
|
|
90076
90119
|
get(_target, prop) {
|
|
90077
90120
|
switch (prop) {
|
|
90078
90121
|
case "readdir":
|
|
@@ -90125,12 +90168,12 @@ var require_get_workspace_package_paths = __commonJS2({
|
|
|
90125
90168
|
getWorkspacePackagePaths: () => getWorkspacePackagePaths3
|
|
90126
90169
|
});
|
|
90127
90170
|
module2.exports = __toCommonJS4(get_workspace_package_paths_exports);
|
|
90128
|
-
var
|
|
90171
|
+
var import_path43 = __toESM4(require("path"));
|
|
90129
90172
|
var import_js_yaml = __toESM4(require_js_yaml3());
|
|
90130
90173
|
var import_glob = __toESM4(require_glob());
|
|
90131
90174
|
var import_json5 = __toESM4(require_lib11());
|
|
90132
90175
|
var import_get_glob_fs = require_get_glob_fs();
|
|
90133
|
-
var posixPath =
|
|
90176
|
+
var posixPath = import_path43.default.posix;
|
|
90134
90177
|
async function getWorkspacePackagePaths3({
|
|
90135
90178
|
fs: fs15,
|
|
90136
90179
|
workspace
|
|
@@ -90497,7 +90540,7 @@ var require_get_monorepo_default_settings = __commonJS2({
|
|
|
90497
90540
|
getMonorepoDefaultSettings: () => getMonorepoDefaultSettings2
|
|
90498
90541
|
});
|
|
90499
90542
|
module2.exports = __toCommonJS4(get_monorepo_default_settings_exports);
|
|
90500
|
-
var
|
|
90543
|
+
var import_path43 = require("path");
|
|
90501
90544
|
var import_monorepo_managers = require_monorepo_managers();
|
|
90502
90545
|
var import_package_managers = require_package_managers();
|
|
90503
90546
|
var import_detect_framework = require_detect_framework();
|
|
@@ -90590,8 +90633,8 @@ var require_get_monorepo_default_settings = __commonJS2({
|
|
|
90590
90633
|
const nxJSON = import_json5.default.parse(nxJSONBuf.toString("utf-8"));
|
|
90591
90634
|
if (!nxJSON?.targetDefaults?.build) {
|
|
90592
90635
|
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
|
|
90593
|
-
detectorFilesystem.readFile((0,
|
|
90594
|
-
detectorFilesystem.readFile((0,
|
|
90636
|
+
detectorFilesystem.readFile((0, import_path43.join)(projectPath, "project.json")).catch(() => null),
|
|
90637
|
+
detectorFilesystem.readFile((0, import_path43.join)(projectPath, "package.json")).catch(() => null)
|
|
90595
90638
|
]);
|
|
90596
90639
|
let hasBuildTarget = false;
|
|
90597
90640
|
if (projectJSONBuf) {
|
|
@@ -91664,31 +91707,6 @@ var init_diff_env_files = __esm({
|
|
|
91664
91707
|
}
|
|
91665
91708
|
});
|
|
91666
91709
|
|
|
91667
|
-
// src/util/env/format-env-value.ts
|
|
91668
|
-
function formatEnvValue(value) {
|
|
91669
|
-
if (value == null)
|
|
91670
|
-
return "";
|
|
91671
|
-
if (!/[\r\n]/.test(value)) {
|
|
91672
|
-
try {
|
|
91673
|
-
const parsed = JSON.parse(value);
|
|
91674
|
-
if (typeof parsed === "object" && parsed !== null) {
|
|
91675
|
-
return value;
|
|
91676
|
-
}
|
|
91677
|
-
} catch {
|
|
91678
|
-
}
|
|
91679
|
-
}
|
|
91680
|
-
const needsQuotes = /\s/.test(value) || value.startsWith("#") || value.startsWith('"');
|
|
91681
|
-
if (!needsQuotes)
|
|
91682
|
-
return value;
|
|
91683
|
-
const escaped = value.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/"/g, '\\"');
|
|
91684
|
-
return `"${escaped}"`;
|
|
91685
|
-
}
|
|
91686
|
-
var init_format_env_value = __esm({
|
|
91687
|
-
"src/util/env/format-env-value.ts"() {
|
|
91688
|
-
"use strict";
|
|
91689
|
-
}
|
|
91690
|
-
});
|
|
91691
|
-
|
|
91692
91710
|
// ../../node_modules/.pnpm/json-parse-better-errors@1.0.2/node_modules/json-parse-better-errors/index.js
|
|
91693
91711
|
var require_json_parse_better_errors = __commonJS2({
|
|
91694
91712
|
"../../node_modules/.pnpm/json-parse-better-errors@1.0.2/node_modules/json-parse-better-errors/index.js"(exports2, module2) {
|
|
@@ -91939,7 +91957,7 @@ async function envPullCommandLogic(client2, filename, skipConfirmation, environm
|
|
|
91939
91957
|
deltaString = buildDeltaString(oldEnv, newEnv);
|
|
91940
91958
|
}
|
|
91941
91959
|
}
|
|
91942
|
-
const contents = CONTENTS_PREFIX + Object.keys(records).sort().filter((key) => !VARIABLES_TO_IGNORE.includes(key)).map((key) => `${key}
|
|
91960
|
+
const contents = CONTENTS_PREFIX + Object.keys(records).sort().filter((key) => !VARIABLES_TO_IGNORE.includes(key)).map((key) => `${key}="${escapeValue(records[key])}"`).join("\n") + "\n";
|
|
91943
91961
|
await (0, import_fs_extra6.outputFile)(fullPath, contents, "utf8");
|
|
91944
91962
|
if (deltaString) {
|
|
91945
91963
|
output_manager_default.print("\n" + deltaString);
|
|
@@ -91959,6 +91977,9 @@ async function envPullCommandLogic(client2, filename, skipConfirmation, environm
|
|
|
91959
91977
|
`
|
|
91960
91978
|
);
|
|
91961
91979
|
}
|
|
91980
|
+
function escapeValue(value) {
|
|
91981
|
+
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
|
91982
|
+
}
|
|
91962
91983
|
var import_chalk25, import_fs_extra6, import_fs2, import_path8, import_error_utils4, import_json_parse_better_errors, CONTENTS_PREFIX, VARIABLES_TO_IGNORE;
|
|
91963
91984
|
var init_pull2 = __esm({
|
|
91964
91985
|
"src/commands/env/pull.ts"() {
|
|
@@ -91973,7 +91994,6 @@ var init_pull2 = __esm({
|
|
|
91973
91994
|
init_pkg_name();
|
|
91974
91995
|
init_get_env_records();
|
|
91975
91996
|
init_diff_env_files();
|
|
91976
|
-
init_format_env_value();
|
|
91977
91997
|
import_error_utils4 = __toESM3(require_dist2());
|
|
91978
91998
|
init_add_to_gitignore();
|
|
91979
91999
|
import_json_parse_better_errors = __toESM3(require_json_parse_better_errors());
|
|
@@ -148273,7 +148293,7 @@ function validateConfig(config2) {
|
|
|
148273
148293
|
}
|
|
148274
148294
|
return null;
|
|
148275
148295
|
}
|
|
148276
|
-
var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
|
|
148296
|
+
var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, customErrorPageSchema, vercelConfigSchema, ajv, validate;
|
|
148277
148297
|
var init_validate_config = __esm({
|
|
148278
148298
|
"src/util/validate-config.ts"() {
|
|
148279
148299
|
"use strict";
|
|
@@ -148418,6 +148438,26 @@ var init_validate_config = __esm({
|
|
|
148418
148438
|
}
|
|
148419
148439
|
}
|
|
148420
148440
|
};
|
|
148441
|
+
customErrorPageSchema = {
|
|
148442
|
+
oneOf: [
|
|
148443
|
+
{ type: "string", minLength: 1 },
|
|
148444
|
+
{
|
|
148445
|
+
type: "object",
|
|
148446
|
+
additionalProperties: false,
|
|
148447
|
+
minProperties: 1,
|
|
148448
|
+
properties: {
|
|
148449
|
+
default5xx: {
|
|
148450
|
+
type: "string",
|
|
148451
|
+
minLength: 1
|
|
148452
|
+
},
|
|
148453
|
+
default4xx: {
|
|
148454
|
+
type: "string",
|
|
148455
|
+
minLength: 1
|
|
148456
|
+
}
|
|
148457
|
+
}
|
|
148458
|
+
}
|
|
148459
|
+
]
|
|
148460
|
+
};
|
|
148421
148461
|
vercelConfigSchema = {
|
|
148422
148462
|
type: "object",
|
|
148423
148463
|
// These are not all possibilities because `vc dev`
|
|
@@ -148434,6 +148474,7 @@ var init_validate_config = __esm({
|
|
|
148434
148474
|
functions: import_build_utils13.functionsSchema,
|
|
148435
148475
|
images: imagesSchema,
|
|
148436
148476
|
crons: cronsSchema,
|
|
148477
|
+
customErrorPage: customErrorPageSchema,
|
|
148437
148478
|
bunVersion: { type: "string" }
|
|
148438
148479
|
}
|
|
148439
148480
|
};
|
|
@@ -149577,6 +149618,21 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
149577
149618
|
if (validateError) {
|
|
149578
149619
|
throw validateError;
|
|
149579
149620
|
}
|
|
149621
|
+
if (localConfig.customErrorPage) {
|
|
149622
|
+
const errorPages = typeof localConfig.customErrorPage === "string" ? [localConfig.customErrorPage] : Object.values(localConfig.customErrorPage);
|
|
149623
|
+
for (const page of errorPages) {
|
|
149624
|
+
if (page) {
|
|
149625
|
+
const src = (0, import_path28.join)(workPath, page);
|
|
149626
|
+
if (!(0, import_fs_extra18.existsSync)(src)) {
|
|
149627
|
+
throw new import_build_utils14.NowBuildError({
|
|
149628
|
+
code: "CUSTOM_ERROR_PAGE_NOT_FOUND",
|
|
149629
|
+
message: `The custom error page "${page}" was not found in "${workPath}".`,
|
|
149630
|
+
link: "https://vercel.com/docs/projects/project-configuration#custom-error-page"
|
|
149631
|
+
});
|
|
149632
|
+
}
|
|
149633
|
+
}
|
|
149634
|
+
}
|
|
149635
|
+
}
|
|
149580
149636
|
const projectSettings = {
|
|
149581
149637
|
...project.settings,
|
|
149582
149638
|
...pickOverrides(localConfig)
|
|
@@ -152896,6 +152952,16 @@ async function processDeployment({
|
|
|
152896
152952
|
}
|
|
152897
152953
|
if (event.type === "alias-assigned") {
|
|
152898
152954
|
stopSpinner();
|
|
152955
|
+
if (event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
|
|
152956
|
+
const primaryDomain = event.payload.alias[0];
|
|
152957
|
+
const prodUrl = `https://${primaryDomain}`;
|
|
152958
|
+
output_manager_default.print(
|
|
152959
|
+
prependEmoji(
|
|
152960
|
+
`Aliased: ${import_chalk66.default.bold(prodUrl)} ${deployStamp()}`,
|
|
152961
|
+
emoji("link")
|
|
152962
|
+
) + "\n"
|
|
152963
|
+
);
|
|
152964
|
+
}
|
|
152899
152965
|
event.payload.indications = indications;
|
|
152900
152966
|
return event.payload;
|
|
152901
152967
|
}
|
|
@@ -169641,7 +169707,7 @@ var require_content_disposition = __commonJS2({
|
|
|
169641
169707
|
"use strict";
|
|
169642
169708
|
module2.exports = contentDisposition;
|
|
169643
169709
|
module2.exports.parse = parse11;
|
|
169644
|
-
var
|
|
169710
|
+
var basename11 = require("path").basename;
|
|
169645
169711
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
169646
169712
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
169647
169713
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -169676,9 +169742,9 @@ var require_content_disposition = __commonJS2({
|
|
|
169676
169742
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
169677
169743
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
169678
169744
|
}
|
|
169679
|
-
var name =
|
|
169745
|
+
var name = basename11(filename);
|
|
169680
169746
|
var isQuotedString = TEXT_REGEXP.test(name);
|
|
169681
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) :
|
|
169747
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename11(fallback);
|
|
169682
169748
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name;
|
|
169683
169749
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
|
|
169684
169750
|
params2["filename*"] = name;
|
|
@@ -173133,6 +173199,16 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
173133
173199
|
this.readJsonFile(configPath)
|
|
173134
173200
|
]);
|
|
173135
173201
|
await this.validateVercelConfig(vercelConfig);
|
|
173202
|
+
if (vercelConfig.customErrorPage) {
|
|
173203
|
+
const errorPages = typeof vercelConfig.customErrorPage === "string" ? [vercelConfig.customErrorPage] : Object.values(vercelConfig.customErrorPage);
|
|
173204
|
+
for (const page of errorPages) {
|
|
173205
|
+
if (page && !import_fs_extra21.default.existsSync((0, import_path36.join)(this.cwd, page))) {
|
|
173206
|
+
output_manager_default.warn(
|
|
173207
|
+
`The custom error page "${page}" was not found in "${this.cwd}". This will cause deployment to fail on Vercel.`
|
|
173208
|
+
);
|
|
173209
|
+
}
|
|
173210
|
+
}
|
|
173211
|
+
}
|
|
173136
173212
|
this.projectSettings = {
|
|
173137
173213
|
...this.originalProjectSettings,
|
|
173138
173214
|
...pickOverrides(vercelConfig)
|
|
@@ -185942,6 +186018,16 @@ async function redeploy(client2) {
|
|
|
185942
186018
|
output_manager_default.spinner("Running Checks", 0);
|
|
185943
186019
|
} else if (event.type === "alias-assigned" || event.type === "checks-conclusion-failed") {
|
|
185944
186020
|
output_manager_default.stopSpinner();
|
|
186021
|
+
if (event.type === "alias-assigned" && !Array.isArray(event.payload) && event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
|
|
186022
|
+
const primaryDomain = event.payload.alias[0];
|
|
186023
|
+
const prodUrl = `https://${primaryDomain}`;
|
|
186024
|
+
output_manager_default.print(
|
|
186025
|
+
prependEmoji(
|
|
186026
|
+
`Aliased: ${import_chalk124.default.bold(prodUrl)} ${deployStamp()}`,
|
|
186027
|
+
emoji("link")
|
|
186028
|
+
) + "\n"
|
|
186029
|
+
);
|
|
186030
|
+
}
|
|
185945
186031
|
deployment = event.payload;
|
|
185946
186032
|
break;
|
|
185947
186033
|
} else if (event.type === "canceled") {
|
|
@@ -186081,7 +186167,7 @@ async function getRedirects(client2, projectId, options = {}) {
|
|
|
186081
186167
|
params2.set("versionId", versionId);
|
|
186082
186168
|
}
|
|
186083
186169
|
if (diff) {
|
|
186084
|
-
params2.set("diff", "true");
|
|
186170
|
+
params2.set("diff", diff === true ? "true" : diff);
|
|
186085
186171
|
} else {
|
|
186086
186172
|
params2.set("per_page", perPage.toString());
|
|
186087
186173
|
if (search) {
|
|
@@ -186667,6 +186753,399 @@ var init_add13 = __esm({
|
|
|
186667
186753
|
}
|
|
186668
186754
|
});
|
|
186669
186755
|
|
|
186756
|
+
// src/commands/redirects/validate-redirects.ts
|
|
186757
|
+
function validateUploadFile(filePath, options = {}) {
|
|
186758
|
+
const maxSize = options.maxFileSize ?? MAX_FILE_SIZE;
|
|
186759
|
+
const allowedExts = options.allowedExtensions ?? ALLOWED_EXTENSIONS;
|
|
186760
|
+
try {
|
|
186761
|
+
const stats = (0, import_fs8.statSync)(filePath);
|
|
186762
|
+
if (!stats.isFile()) {
|
|
186763
|
+
return { valid: false, error: `Path "${filePath}" is not a file` };
|
|
186764
|
+
}
|
|
186765
|
+
if (stats.size > maxSize) {
|
|
186766
|
+
const sizeMB = Math.round(maxSize / (1024 * 1024));
|
|
186767
|
+
return { valid: false, error: `File must be below ${sizeMB}MB` };
|
|
186768
|
+
}
|
|
186769
|
+
const hasValidExtension = allowedExts.some(
|
|
186770
|
+
(ext) => filePath.toLowerCase().endsWith(ext)
|
|
186771
|
+
);
|
|
186772
|
+
if (!hasValidExtension) {
|
|
186773
|
+
return {
|
|
186774
|
+
valid: false,
|
|
186775
|
+
error: `File must be a .csv or .json file`
|
|
186776
|
+
};
|
|
186777
|
+
}
|
|
186778
|
+
return { valid: true };
|
|
186779
|
+
} catch (err) {
|
|
186780
|
+
if (err.code === "ENOENT") {
|
|
186781
|
+
return { valid: false, error: `File "${filePath}" not found` };
|
|
186782
|
+
}
|
|
186783
|
+
return { valid: false, error: `Error accessing file: ${err.message}` };
|
|
186784
|
+
}
|
|
186785
|
+
}
|
|
186786
|
+
function validateRedirect(redirect2) {
|
|
186787
|
+
if (!redirect2.source) {
|
|
186788
|
+
return { valid: false, error: "Redirect source is required" };
|
|
186789
|
+
}
|
|
186790
|
+
if (redirect2.source.length > MAX_URL_LENGTH) {
|
|
186791
|
+
return { valid: false, error: "Source URL is too long" };
|
|
186792
|
+
}
|
|
186793
|
+
if (!redirect2.source.startsWith("/")) {
|
|
186794
|
+
return { valid: false, error: "Source must be a relative path" };
|
|
186795
|
+
}
|
|
186796
|
+
if (!redirect2.destination) {
|
|
186797
|
+
return { valid: false, error: "Redirect destination is required" };
|
|
186798
|
+
}
|
|
186799
|
+
if (redirect2.destination.length > MAX_URL_LENGTH) {
|
|
186800
|
+
return { valid: false, error: "Destination URL is too long" };
|
|
186801
|
+
}
|
|
186802
|
+
try {
|
|
186803
|
+
new URL(redirect2.destination, "https://vercel.com");
|
|
186804
|
+
} catch {
|
|
186805
|
+
return { valid: false, error: "Destination must be a valid URL" };
|
|
186806
|
+
}
|
|
186807
|
+
if (redirect2.statusCode) {
|
|
186808
|
+
if (!VALID_STATUS_CODES.includes(redirect2.statusCode)) {
|
|
186809
|
+
return {
|
|
186810
|
+
valid: false,
|
|
186811
|
+
error: `Invalid status code. Must be one of: ${VALID_STATUS_CODES.join(", ")}`
|
|
186812
|
+
};
|
|
186813
|
+
}
|
|
186814
|
+
}
|
|
186815
|
+
return { valid: true };
|
|
186816
|
+
}
|
|
186817
|
+
function validateRedirectsArray(redirects) {
|
|
186818
|
+
if (!Array.isArray(redirects)) {
|
|
186819
|
+
return {
|
|
186820
|
+
valid: false,
|
|
186821
|
+
error: "JSON file must contain an array of redirects"
|
|
186822
|
+
};
|
|
186823
|
+
}
|
|
186824
|
+
if (redirects.length === 0) {
|
|
186825
|
+
return { valid: false, error: "No redirects provided" };
|
|
186826
|
+
}
|
|
186827
|
+
if (redirects.length > MAX_REDIRECTS) {
|
|
186828
|
+
return {
|
|
186829
|
+
valid: false,
|
|
186830
|
+
error: `Too many redirects. Maximum allowed: ${MAX_REDIRECTS}`
|
|
186831
|
+
};
|
|
186832
|
+
}
|
|
186833
|
+
for (let i = 0; i < redirects.length; i++) {
|
|
186834
|
+
const result = validateRedirect(redirects[i]);
|
|
186835
|
+
if (!result.valid) {
|
|
186836
|
+
return {
|
|
186837
|
+
valid: false,
|
|
186838
|
+
error: `Redirect ${i + 1}: ${result.error}`
|
|
186839
|
+
};
|
|
186840
|
+
}
|
|
186841
|
+
}
|
|
186842
|
+
return { valid: true };
|
|
186843
|
+
}
|
|
186844
|
+
function validateCSVStructure(content) {
|
|
186845
|
+
const lines2 = content.trim().split("\n");
|
|
186846
|
+
if (lines2.length < 2) {
|
|
186847
|
+
return {
|
|
186848
|
+
valid: false,
|
|
186849
|
+
error: "CSV must have a header and at least one redirect"
|
|
186850
|
+
};
|
|
186851
|
+
}
|
|
186852
|
+
const header = lines2[0].toLowerCase();
|
|
186853
|
+
const hasSource = header.includes("source");
|
|
186854
|
+
const hasDestination = header.includes("destination");
|
|
186855
|
+
if (!hasSource || !hasDestination) {
|
|
186856
|
+
return {
|
|
186857
|
+
valid: false,
|
|
186858
|
+
error: 'CSV must have "source" and "destination" columns'
|
|
186859
|
+
};
|
|
186860
|
+
}
|
|
186861
|
+
return { valid: true };
|
|
186862
|
+
}
|
|
186863
|
+
function validateVersionName(name) {
|
|
186864
|
+
if (!name) {
|
|
186865
|
+
return { valid: false, error: "Name is required" };
|
|
186866
|
+
}
|
|
186867
|
+
if (name.length > 256) {
|
|
186868
|
+
return { valid: false, error: "Name must be 256 characters or less" };
|
|
186869
|
+
}
|
|
186870
|
+
return { valid: true };
|
|
186871
|
+
}
|
|
186872
|
+
var import_fs8, MAX_FILE_SIZE, ALLOWED_EXTENSIONS, MAX_REDIRECTS, MAX_URL_LENGTH, VALID_STATUS_CODES;
|
|
186873
|
+
var init_validate_redirects = __esm({
|
|
186874
|
+
"src/commands/redirects/validate-redirects.ts"() {
|
|
186875
|
+
"use strict";
|
|
186876
|
+
import_fs8 = require("fs");
|
|
186877
|
+
MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
186878
|
+
ALLOWED_EXTENSIONS = [".csv", ".json"];
|
|
186879
|
+
MAX_REDIRECTS = 1e6;
|
|
186880
|
+
MAX_URL_LENGTH = 2048;
|
|
186881
|
+
VALID_STATUS_CODES = [301, 302, 303, 307, 308];
|
|
186882
|
+
}
|
|
186883
|
+
});
|
|
186884
|
+
|
|
186885
|
+
// src/commands/redirects/upload.ts
|
|
186886
|
+
async function upload(client2, argv) {
|
|
186887
|
+
const parsed = await parseSubcommandArgs(argv, uploadSubcommand);
|
|
186888
|
+
if (typeof parsed === "number")
|
|
186889
|
+
return parsed;
|
|
186890
|
+
const link4 = await ensureProjectLink(client2);
|
|
186891
|
+
if (typeof link4 === "number")
|
|
186892
|
+
return link4;
|
|
186893
|
+
const { project, org } = link4;
|
|
186894
|
+
const teamId = org.type === "team" ? org.id : void 0;
|
|
186895
|
+
const { args: args2, flags } = parsed;
|
|
186896
|
+
const skipPrompts = flags["--yes"];
|
|
186897
|
+
const overwrite = flags["--overwrite"] || false;
|
|
186898
|
+
const filePath = args2[0];
|
|
186899
|
+
if (!filePath) {
|
|
186900
|
+
output_manager_default.error("File path is required. Use: vercel redirects upload <file>");
|
|
186901
|
+
return 1;
|
|
186902
|
+
}
|
|
186903
|
+
const fileValidation = validateUploadFile(filePath);
|
|
186904
|
+
if (!fileValidation.valid) {
|
|
186905
|
+
output_manager_default.error(fileValidation.error);
|
|
186906
|
+
return 1;
|
|
186907
|
+
}
|
|
186908
|
+
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186909
|
+
const existingStagingVersion = versions.find((v) => v.isStaging);
|
|
186910
|
+
if (!skipPrompts) {
|
|
186911
|
+
const fileName = (0, import_path41.basename)(filePath);
|
|
186912
|
+
const fileType = filePath.endsWith(".csv") ? "CSV" : "JSON";
|
|
186913
|
+
const message2 = overwrite ? `Upload ${fileType} file "${fileName}" and replace all existing redirects?` : `Upload ${fileType} file "${fileName}"?`;
|
|
186914
|
+
const confirmed = await client2.input.confirm(message2, true);
|
|
186915
|
+
if (!confirmed) {
|
|
186916
|
+
output_manager_default.log("Upload cancelled");
|
|
186917
|
+
return 0;
|
|
186918
|
+
}
|
|
186919
|
+
}
|
|
186920
|
+
let versionName;
|
|
186921
|
+
if (!skipPrompts) {
|
|
186922
|
+
const provideName = await client2.input.confirm(
|
|
186923
|
+
"Do you want to provide a name for this version?",
|
|
186924
|
+
false
|
|
186925
|
+
);
|
|
186926
|
+
if (provideName) {
|
|
186927
|
+
versionName = await client2.input.text({
|
|
186928
|
+
message: "Version name (max 256 characters):",
|
|
186929
|
+
validate: (val) => {
|
|
186930
|
+
if (val && val.length > 256) {
|
|
186931
|
+
return "Name must be 256 characters or less";
|
|
186932
|
+
}
|
|
186933
|
+
return true;
|
|
186934
|
+
}
|
|
186935
|
+
});
|
|
186936
|
+
const { valid, error: error3 } = validateVersionName(versionName);
|
|
186937
|
+
if (!valid) {
|
|
186938
|
+
output_manager_default.error(error3);
|
|
186939
|
+
return 1;
|
|
186940
|
+
}
|
|
186941
|
+
}
|
|
186942
|
+
}
|
|
186943
|
+
const uploadStamp = stamp_default();
|
|
186944
|
+
output_manager_default.spinner("Uploading redirects");
|
|
186945
|
+
try {
|
|
186946
|
+
let result;
|
|
186947
|
+
const url3 = "/v1/bulk-redirects";
|
|
186948
|
+
if (filePath.endsWith(".csv")) {
|
|
186949
|
+
const csvContent = (0, import_fs9.readFileSync)(filePath);
|
|
186950
|
+
const fileName = (0, import_path41.basename)(filePath);
|
|
186951
|
+
const csvValidation = validateCSVStructure(csvContent.toString());
|
|
186952
|
+
if (!csvValidation.valid) {
|
|
186953
|
+
output_manager_default.error(`Invalid CSV: ${csvValidation.error}`);
|
|
186954
|
+
return 1;
|
|
186955
|
+
}
|
|
186956
|
+
const form = new import_form_data.default();
|
|
186957
|
+
form.append("teamId", teamId || org.id);
|
|
186958
|
+
form.append("projectId", project.id);
|
|
186959
|
+
form.append("overwrite", String(overwrite));
|
|
186960
|
+
if (versionName) {
|
|
186961
|
+
form.append("name", versionName);
|
|
186962
|
+
}
|
|
186963
|
+
form.append("bulkRedirectsFile", csvContent, {
|
|
186964
|
+
filename: fileName,
|
|
186965
|
+
contentType: "text/csv"
|
|
186966
|
+
});
|
|
186967
|
+
result = await client2.fetch(url3, {
|
|
186968
|
+
method: "PUT",
|
|
186969
|
+
headers: form.getHeaders(),
|
|
186970
|
+
body: form
|
|
186971
|
+
});
|
|
186972
|
+
} else {
|
|
186973
|
+
const content = (0, import_fs9.readFileSync)(filePath, "utf8");
|
|
186974
|
+
let redirects2;
|
|
186975
|
+
try {
|
|
186976
|
+
redirects2 = JSON.parse(content);
|
|
186977
|
+
} catch (err) {
|
|
186978
|
+
output_manager_default.error("Invalid JSON file format");
|
|
186979
|
+
return 1;
|
|
186980
|
+
}
|
|
186981
|
+
const redirectsValidation = validateRedirectsArray(redirects2);
|
|
186982
|
+
if (!redirectsValidation.valid) {
|
|
186983
|
+
output_manager_default.error(redirectsValidation.error);
|
|
186984
|
+
return 1;
|
|
186985
|
+
}
|
|
186986
|
+
const body = {
|
|
186987
|
+
projectId: project.id,
|
|
186988
|
+
redirects: redirects2,
|
|
186989
|
+
overwrite
|
|
186990
|
+
};
|
|
186991
|
+
if (teamId) {
|
|
186992
|
+
body.teamId = teamId;
|
|
186993
|
+
}
|
|
186994
|
+
if (versionName) {
|
|
186995
|
+
body.versionName = versionName;
|
|
186996
|
+
}
|
|
186997
|
+
result = await client2.fetch(url3, {
|
|
186998
|
+
method: "PUT",
|
|
186999
|
+
body
|
|
187000
|
+
});
|
|
187001
|
+
}
|
|
187002
|
+
output_manager_default.log(
|
|
187003
|
+
`${import_chalk128.default.cyan("\u2713")} Redirects uploaded ${import_chalk128.default.gray(uploadStamp())}`
|
|
187004
|
+
);
|
|
187005
|
+
output_manager_default.spinner("Fetching diff");
|
|
187006
|
+
const { redirects } = await getRedirects(client2, project.id, {
|
|
187007
|
+
teamId,
|
|
187008
|
+
versionId: result.version.id,
|
|
187009
|
+
diff: "only"
|
|
187010
|
+
});
|
|
187011
|
+
const redirectCount = redirects.length;
|
|
187012
|
+
output_manager_default.print(`
|
|
187013
|
+
${import_chalk128.default.bold("Summary:")}
|
|
187014
|
+
`);
|
|
187015
|
+
output_manager_default.print(
|
|
187016
|
+
` Uploaded ${redirectCount} redirect${redirectCount === 1 ? "" : "s"}
|
|
187017
|
+
`
|
|
187018
|
+
);
|
|
187019
|
+
if (redirectCount > 0) {
|
|
187020
|
+
const added = redirects.filter((r) => r.action === "+");
|
|
187021
|
+
const deleted = redirects.filter((r) => r.action === "-");
|
|
187022
|
+
const edited = redirects.filter((r) => r.action === "~");
|
|
187023
|
+
output_manager_default.print(`
|
|
187024
|
+
${import_chalk128.default.bold("Changes:")}
|
|
187025
|
+
`);
|
|
187026
|
+
if (added.length > 0) {
|
|
187027
|
+
output_manager_default.print(` ${import_chalk128.default.green(`Added: ${added.length}`)}
|
|
187028
|
+
`);
|
|
187029
|
+
}
|
|
187030
|
+
if (deleted.length > 0) {
|
|
187031
|
+
output_manager_default.print(` ${import_chalk128.default.red(`Deleted: ${deleted.length}`)}
|
|
187032
|
+
`);
|
|
187033
|
+
}
|
|
187034
|
+
if (edited.length > 0) {
|
|
187035
|
+
output_manager_default.print(` ${import_chalk128.default.yellow(`Modified: ${edited.length}`)}
|
|
187036
|
+
`);
|
|
187037
|
+
}
|
|
187038
|
+
output_manager_default.print(`
|
|
187039
|
+
${import_chalk128.default.bold("Redirect changes:")}
|
|
187040
|
+
`);
|
|
187041
|
+
const displayRedirects = redirects.slice(0, 100);
|
|
187042
|
+
const rows = displayRedirects.map((redirect2) => {
|
|
187043
|
+
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
187044
|
+
const action = redirect2.action || "+";
|
|
187045
|
+
let colorFn;
|
|
187046
|
+
let actionSymbol;
|
|
187047
|
+
switch (action) {
|
|
187048
|
+
case "+":
|
|
187049
|
+
colorFn = import_chalk128.default.green;
|
|
187050
|
+
actionSymbol = "+";
|
|
187051
|
+
break;
|
|
187052
|
+
case "-":
|
|
187053
|
+
colorFn = import_chalk128.default.red;
|
|
187054
|
+
actionSymbol = "-";
|
|
187055
|
+
break;
|
|
187056
|
+
case "~":
|
|
187057
|
+
colorFn = import_chalk128.default.yellow;
|
|
187058
|
+
actionSymbol = "~";
|
|
187059
|
+
break;
|
|
187060
|
+
default:
|
|
187061
|
+
colorFn = (s) => s;
|
|
187062
|
+
actionSymbol = " ";
|
|
187063
|
+
}
|
|
187064
|
+
return [
|
|
187065
|
+
colorFn(`${actionSymbol} ${redirect2.source}`),
|
|
187066
|
+
colorFn(redirect2.destination),
|
|
187067
|
+
colorFn(status3.toString())
|
|
187068
|
+
];
|
|
187069
|
+
});
|
|
187070
|
+
output_manager_default.print(
|
|
187071
|
+
formatTable(
|
|
187072
|
+
["Source", "Destination", "Status"],
|
|
187073
|
+
["l", "l", "l"],
|
|
187074
|
+
[{ rows }]
|
|
187075
|
+
)
|
|
187076
|
+
);
|
|
187077
|
+
if (redirectCount > 100) {
|
|
187078
|
+
output_manager_default.print(
|
|
187079
|
+
`
|
|
187080
|
+
${import_chalk128.default.gray(`... and ${redirectCount - 100} more redirect${redirectCount - 100 === 1 ? "" : "s"}`)}
|
|
187081
|
+
`
|
|
187082
|
+
);
|
|
187083
|
+
}
|
|
187084
|
+
}
|
|
187085
|
+
if (result.alias) {
|
|
187086
|
+
const testUrl = `https://${result.alias}`;
|
|
187087
|
+
output_manager_default.print(
|
|
187088
|
+
`
|
|
187089
|
+
${import_chalk128.default.bold("Test your changes:")} ${import_chalk128.default.cyan(testUrl)}
|
|
187090
|
+
`
|
|
187091
|
+
);
|
|
187092
|
+
}
|
|
187093
|
+
const newVersionName = result.version.name || result.version.id;
|
|
187094
|
+
output_manager_default.print(
|
|
187095
|
+
` ${import_chalk128.default.bold("New staging version:")} ${newVersionName}
|
|
187096
|
+
|
|
187097
|
+
`
|
|
187098
|
+
);
|
|
187099
|
+
if (existingStagingVersion) {
|
|
187100
|
+
output_manager_default.warn(
|
|
187101
|
+
`There are other staged changes. Please review all changes with ${import_chalk128.default.cyan("vercel redirects list --staging")} before promoting to production.`
|
|
187102
|
+
);
|
|
187103
|
+
} else if (!skipPrompts) {
|
|
187104
|
+
const shouldPromote = await client2.input.confirm(
|
|
187105
|
+
"This is the only staged change. Do you want to promote it to production now?",
|
|
187106
|
+
false
|
|
187107
|
+
);
|
|
187108
|
+
if (shouldPromote) {
|
|
187109
|
+
const promoteStamp = stamp_default();
|
|
187110
|
+
output_manager_default.spinner("Promoting to production");
|
|
187111
|
+
await updateRedirectVersion(
|
|
187112
|
+
client2,
|
|
187113
|
+
project.id,
|
|
187114
|
+
result.version.id,
|
|
187115
|
+
"promote",
|
|
187116
|
+
teamId
|
|
187117
|
+
);
|
|
187118
|
+
output_manager_default.log(
|
|
187119
|
+
`${import_chalk128.default.cyan("\u2713")} Version promoted to production ${import_chalk128.default.gray(promoteStamp())}`
|
|
187120
|
+
);
|
|
187121
|
+
}
|
|
187122
|
+
}
|
|
187123
|
+
return 0;
|
|
187124
|
+
} catch (error3) {
|
|
187125
|
+
output_manager_default.error(`Failed to upload redirects: ${error3.message}`);
|
|
187126
|
+
return 1;
|
|
187127
|
+
}
|
|
187128
|
+
}
|
|
187129
|
+
var import_fs9, import_path41, import_chalk128, import_form_data;
|
|
187130
|
+
var init_upload = __esm({
|
|
187131
|
+
"src/commands/redirects/upload.ts"() {
|
|
187132
|
+
"use strict";
|
|
187133
|
+
import_fs9 = require("fs");
|
|
187134
|
+
import_path41 = require("path");
|
|
187135
|
+
import_chalk128 = __toESM3(require_source());
|
|
187136
|
+
import_form_data = __toESM3(require("form-data"));
|
|
187137
|
+
init_output_manager();
|
|
187138
|
+
init_command32();
|
|
187139
|
+
init_shared2();
|
|
187140
|
+
init_stamp();
|
|
187141
|
+
init_get_redirect_versions();
|
|
187142
|
+
init_update_redirect_version();
|
|
187143
|
+
init_get_redirects();
|
|
187144
|
+
init_format_table();
|
|
187145
|
+
init_validate_redirects();
|
|
187146
|
+
}
|
|
187147
|
+
});
|
|
187148
|
+
|
|
186670
187149
|
// src/util/redirects/delete-redirects.ts
|
|
186671
187150
|
async function deleteRedirects(client2, projectId, sources, teamId) {
|
|
186672
187151
|
const params2 = new URLSearchParams();
|
|
@@ -186714,17 +187193,17 @@ async function remove5(client2, argv) {
|
|
|
186714
187193
|
const redirectToRemove = redirects.find((r) => r.source === source);
|
|
186715
187194
|
if (!redirectToRemove) {
|
|
186716
187195
|
output_manager_default.error(
|
|
186717
|
-
`Redirect with source "${source}" not found. Run ${
|
|
187196
|
+
`Redirect with source "${source}" not found. Run ${import_chalk129.default.cyan(
|
|
186718
187197
|
"vercel redirects list"
|
|
186719
187198
|
)} to see available redirects.`
|
|
186720
187199
|
);
|
|
186721
187200
|
return 1;
|
|
186722
187201
|
}
|
|
186723
187202
|
output_manager_default.print(`
|
|
186724
|
-
${
|
|
187203
|
+
${import_chalk129.default.bold("Removing redirect:")}
|
|
186725
187204
|
`);
|
|
186726
187205
|
output_manager_default.print(
|
|
186727
|
-
` ${
|
|
187206
|
+
` ${import_chalk129.default.cyan(redirectToRemove.source)} \u2192 ${import_chalk129.default.cyan(redirectToRemove.destination)}
|
|
186728
187207
|
`
|
|
186729
187208
|
);
|
|
186730
187209
|
const status3 = redirectToRemove.statusCode || (redirectToRemove.permanent ? 308 : 307);
|
|
@@ -186742,7 +187221,7 @@ async function remove5(client2, argv) {
|
|
|
186742
187221
|
return 0;
|
|
186743
187222
|
}
|
|
186744
187223
|
const removeStamp = stamp_default();
|
|
186745
|
-
output_manager_default.spinner(`Removing redirect for ${
|
|
187224
|
+
output_manager_default.spinner(`Removing redirect for ${import_chalk129.default.bold(source)}`);
|
|
186746
187225
|
const { alias: alias2, version: version2 } = await deleteRedirects(
|
|
186747
187226
|
client2,
|
|
186748
187227
|
project.id,
|
|
@@ -186750,13 +187229,13 @@ async function remove5(client2, argv) {
|
|
|
186750
187229
|
teamId
|
|
186751
187230
|
);
|
|
186752
187231
|
output_manager_default.log(
|
|
186753
|
-
`${
|
|
187232
|
+
`${import_chalk129.default.cyan("\u2713")} Redirect removed ${import_chalk129.default.gray(removeStamp())}`
|
|
186754
187233
|
);
|
|
186755
187234
|
if (alias2) {
|
|
186756
187235
|
const testUrl = source.startsWith("/") ? `https://${alias2}${source}` : `https://${alias2}`;
|
|
186757
187236
|
output_manager_default.print(
|
|
186758
187237
|
`
|
|
186759
|
-
${
|
|
187238
|
+
${import_chalk129.default.bold("Test your changes:")} ${import_chalk129.default.cyan(testUrl)}
|
|
186760
187239
|
`
|
|
186761
187240
|
);
|
|
186762
187241
|
output_manager_default.print(
|
|
@@ -186765,7 +187244,7 @@ async function remove5(client2, argv) {
|
|
|
186765
187244
|
);
|
|
186766
187245
|
}
|
|
186767
187246
|
const versionName = version2.name || version2.id;
|
|
186768
|
-
output_manager_default.print(` ${
|
|
187247
|
+
output_manager_default.print(` ${import_chalk129.default.bold("New staging version:")} ${versionName}
|
|
186769
187248
|
|
|
186770
187249
|
`);
|
|
186771
187250
|
if (!existingStagingVersion) {
|
|
@@ -186784,21 +187263,21 @@ async function remove5(client2, argv) {
|
|
|
186784
187263
|
teamId
|
|
186785
187264
|
);
|
|
186786
187265
|
output_manager_default.log(
|
|
186787
|
-
`${
|
|
187266
|
+
`${import_chalk129.default.cyan("\u2713")} Version promoted to production ${import_chalk129.default.gray(promoteStamp())}`
|
|
186788
187267
|
);
|
|
186789
187268
|
}
|
|
186790
187269
|
} else {
|
|
186791
187270
|
output_manager_default.warn(
|
|
186792
|
-
`There are other staged changes. Review them with ${
|
|
187271
|
+
`There are other staged changes. Review them with ${import_chalk129.default.cyan("vercel redirects list --staging")} before promoting to production.`
|
|
186793
187272
|
);
|
|
186794
187273
|
}
|
|
186795
187274
|
return 0;
|
|
186796
187275
|
}
|
|
186797
|
-
var
|
|
187276
|
+
var import_chalk129;
|
|
186798
187277
|
var init_remove5 = __esm({
|
|
186799
187278
|
"src/commands/redirects/remove.ts"() {
|
|
186800
187279
|
"use strict";
|
|
186801
|
-
|
|
187280
|
+
import_chalk129 = __toESM3(require_source());
|
|
186802
187281
|
init_output_manager();
|
|
186803
187282
|
init_command32();
|
|
186804
187283
|
init_shared2();
|
|
@@ -186826,14 +187305,14 @@ async function promote(client2, argv) {
|
|
|
186826
187305
|
const { project, org } = link4;
|
|
186827
187306
|
const teamId = org.type === "team" ? org.id : void 0;
|
|
186828
187307
|
const [versionIdentifier] = parsed.args;
|
|
186829
|
-
output_manager_default.spinner(`Fetching redirect versions for ${
|
|
187308
|
+
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk130.default.bold(project.name)}`);
|
|
186830
187309
|
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186831
187310
|
const version2 = versions.find(
|
|
186832
187311
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
186833
187312
|
);
|
|
186834
187313
|
if (!version2) {
|
|
186835
187314
|
output_manager_default.error(
|
|
186836
|
-
`Version with ID or name "${versionIdentifier}" not found. Run ${
|
|
187315
|
+
`Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk130.default.cyan(
|
|
186837
187316
|
"vercel redirects list-versions"
|
|
186838
187317
|
)} to see available versions.`
|
|
186839
187318
|
);
|
|
@@ -186841,16 +187320,16 @@ async function promote(client2, argv) {
|
|
|
186841
187320
|
}
|
|
186842
187321
|
if (version2.isLive) {
|
|
186843
187322
|
output_manager_default.error(
|
|
186844
|
-
`Version ${
|
|
187323
|
+
`Version ${import_chalk130.default.bold(version2.name || version2.id)} is already live.`
|
|
186845
187324
|
);
|
|
186846
187325
|
return 1;
|
|
186847
187326
|
}
|
|
186848
187327
|
if (!version2.isStaging) {
|
|
186849
187328
|
output_manager_default.error(
|
|
186850
|
-
`Version ${
|
|
187329
|
+
`Version ${import_chalk130.default.bold(
|
|
186851
187330
|
version2.name || version2.id
|
|
186852
187331
|
)} is not staged. Only staging versions can be promoted to production.
|
|
186853
|
-
Run ${
|
|
187332
|
+
Run ${import_chalk130.default.cyan(
|
|
186854
187333
|
"vercel redirects list-versions"
|
|
186855
187334
|
)} to see which version is currently staged.`
|
|
186856
187335
|
);
|
|
@@ -186868,13 +187347,13 @@ Run ${import_chalk129.default.cyan(
|
|
|
186868
187347
|
);
|
|
186869
187348
|
if (changedRedirects.length > 0) {
|
|
186870
187349
|
output_manager_default.print(`
|
|
186871
|
-
${
|
|
187350
|
+
${import_chalk130.default.bold("Changes to be promoted:")}
|
|
186872
187351
|
|
|
186873
187352
|
`);
|
|
186874
187353
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
186875
187354
|
for (const redirect2 of displayRedirects) {
|
|
186876
187355
|
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
186877
|
-
const symbol = redirect2.action === "+" ?
|
|
187356
|
+
const symbol = redirect2.action === "+" ? import_chalk130.default.green("+") : import_chalk130.default.red("-");
|
|
186878
187357
|
output_manager_default.print(
|
|
186879
187358
|
` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
|
|
186880
187359
|
`
|
|
@@ -186882,7 +187361,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
|
|
|
186882
187361
|
}
|
|
186883
187362
|
if (changedRedirects.length > 20) {
|
|
186884
187363
|
output_manager_default.print(
|
|
186885
|
-
|
|
187364
|
+
import_chalk130.default.gray(`
|
|
186886
187365
|
... and ${changedRedirects.length - 20} more changes
|
|
186887
187366
|
`)
|
|
186888
187367
|
);
|
|
@@ -186891,7 +187370,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
|
|
|
186891
187370
|
} else {
|
|
186892
187371
|
output_manager_default.print(
|
|
186893
187372
|
`
|
|
186894
|
-
${
|
|
187373
|
+
${import_chalk130.default.gray("No changes detected from current production version.")}
|
|
186895
187374
|
|
|
186896
187375
|
`
|
|
186897
187376
|
);
|
|
@@ -186899,15 +187378,15 @@ ${import_chalk129.default.gray("No changes detected from current production vers
|
|
|
186899
187378
|
const confirmed = await confirmAction(
|
|
186900
187379
|
client2,
|
|
186901
187380
|
parsed.flags["--yes"],
|
|
186902
|
-
`Promote version ${
|
|
186903
|
-
`This will make it the live version for ${
|
|
187381
|
+
`Promote version ${import_chalk130.default.bold(versionName)} to production?`,
|
|
187382
|
+
`This will make it the live version for ${import_chalk130.default.bold(project.name)}.`
|
|
186904
187383
|
);
|
|
186905
187384
|
if (!confirmed) {
|
|
186906
187385
|
output_manager_default.log("Canceled");
|
|
186907
187386
|
return 0;
|
|
186908
187387
|
}
|
|
186909
187388
|
const updateStamp = stamp_default();
|
|
186910
|
-
output_manager_default.spinner(`Promoting version ${
|
|
187389
|
+
output_manager_default.spinner(`Promoting version ${import_chalk130.default.bold(versionName)} to production`);
|
|
186911
187390
|
const { version: newVersion } = await updateRedirectVersion(
|
|
186912
187391
|
client2,
|
|
186913
187392
|
project.id,
|
|
@@ -186916,17 +187395,17 @@ ${import_chalk129.default.gray("No changes detected from current production vers
|
|
|
186916
187395
|
teamId
|
|
186917
187396
|
);
|
|
186918
187397
|
output_manager_default.log(
|
|
186919
|
-
`${
|
|
187398
|
+
`${import_chalk130.default.cyan("\u2713")} Version ${import_chalk130.default.bold(
|
|
186920
187399
|
newVersion.name || newVersion.id
|
|
186921
|
-
)} promoted to production ${
|
|
187400
|
+
)} promoted to production ${import_chalk130.default.gray(updateStamp())}`
|
|
186922
187401
|
);
|
|
186923
187402
|
return 0;
|
|
186924
187403
|
}
|
|
186925
|
-
var
|
|
187404
|
+
var import_chalk130;
|
|
186926
187405
|
var init_promote3 = __esm({
|
|
186927
187406
|
"src/commands/redirects/promote.ts"() {
|
|
186928
187407
|
"use strict";
|
|
186929
|
-
|
|
187408
|
+
import_chalk130 = __toESM3(require_source());
|
|
186930
187409
|
init_output_manager();
|
|
186931
187410
|
init_command32();
|
|
186932
187411
|
init_shared2();
|
|
@@ -186953,14 +187432,14 @@ async function restore(client2, argv) {
|
|
|
186953
187432
|
const { project, org } = link4;
|
|
186954
187433
|
const teamId = org.type === "team" ? org.id : void 0;
|
|
186955
187434
|
const [versionIdentifier] = parsed.args;
|
|
186956
|
-
output_manager_default.spinner(`Fetching redirect versions for ${
|
|
187435
|
+
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk131.default.bold(project.name)}`);
|
|
186957
187436
|
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186958
187437
|
const version2 = versions.find(
|
|
186959
187438
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
186960
187439
|
);
|
|
186961
187440
|
if (!version2) {
|
|
186962
187441
|
output_manager_default.error(
|
|
186963
|
-
`Version with ID or name "${versionIdentifier}" not found. Run ${
|
|
187442
|
+
`Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk131.default.cyan(
|
|
186964
187443
|
"vercel redirects list-versions"
|
|
186965
187444
|
)} to see available versions.`
|
|
186966
187445
|
);
|
|
@@ -186968,10 +187447,10 @@ async function restore(client2, argv) {
|
|
|
186968
187447
|
}
|
|
186969
187448
|
if (version2.isLive) {
|
|
186970
187449
|
output_manager_default.error(
|
|
186971
|
-
`Version ${
|
|
187450
|
+
`Version ${import_chalk131.default.bold(
|
|
186972
187451
|
version2.name || version2.id
|
|
186973
187452
|
)} is currently live. You cannot restore the live version.
|
|
186974
|
-
Run ${
|
|
187453
|
+
Run ${import_chalk131.default.cyan(
|
|
186975
187454
|
"vercel redirects list-versions"
|
|
186976
187455
|
)} to see previous versions you can restore.`
|
|
186977
187456
|
);
|
|
@@ -186979,7 +187458,7 @@ Run ${import_chalk130.default.cyan(
|
|
|
186979
187458
|
}
|
|
186980
187459
|
if (version2.isStaging) {
|
|
186981
187460
|
output_manager_default.error(
|
|
186982
|
-
`Version ${
|
|
187461
|
+
`Version ${import_chalk131.default.bold(
|
|
186983
187462
|
version2.name || version2.id
|
|
186984
187463
|
)} is staged. You can only restore previous versions.`
|
|
186985
187464
|
);
|
|
@@ -186997,13 +187476,13 @@ Run ${import_chalk130.default.cyan(
|
|
|
186997
187476
|
);
|
|
186998
187477
|
if (changedRedirects.length > 0) {
|
|
186999
187478
|
output_manager_default.print(`
|
|
187000
|
-
${
|
|
187479
|
+
${import_chalk131.default.bold("Changes to be restored:")}
|
|
187001
187480
|
|
|
187002
187481
|
`);
|
|
187003
187482
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
187004
187483
|
for (const redirect2 of displayRedirects) {
|
|
187005
187484
|
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
187006
|
-
const symbol = redirect2.action === "+" ?
|
|
187485
|
+
const symbol = redirect2.action === "+" ? import_chalk131.default.green("+") : import_chalk131.default.red("-");
|
|
187007
187486
|
output_manager_default.print(
|
|
187008
187487
|
` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
|
|
187009
187488
|
`
|
|
@@ -187011,7 +187490,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
|
|
|
187011
187490
|
}
|
|
187012
187491
|
if (changedRedirects.length > 20) {
|
|
187013
187492
|
output_manager_default.print(
|
|
187014
|
-
|
|
187493
|
+
import_chalk131.default.gray(`
|
|
187015
187494
|
... and ${changedRedirects.length - 20} more changes
|
|
187016
187495
|
`)
|
|
187017
187496
|
);
|
|
@@ -187020,7 +187499,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
|
|
|
187020
187499
|
} else {
|
|
187021
187500
|
output_manager_default.print(
|
|
187022
187501
|
`
|
|
187023
|
-
${
|
|
187502
|
+
${import_chalk131.default.gray("No changes detected from current production version.")}
|
|
187024
187503
|
|
|
187025
187504
|
`
|
|
187026
187505
|
);
|
|
@@ -187028,15 +187507,15 @@ ${import_chalk130.default.gray("No changes detected from current production vers
|
|
|
187028
187507
|
const confirmed = await confirmAction(
|
|
187029
187508
|
client2,
|
|
187030
187509
|
parsed.flags["--yes"],
|
|
187031
|
-
`Restore version ${
|
|
187032
|
-
`This will make it the live version for ${
|
|
187510
|
+
`Restore version ${import_chalk131.default.bold(versionName)}?`,
|
|
187511
|
+
`This will make it the live version for ${import_chalk131.default.bold(project.name)}.`
|
|
187033
187512
|
);
|
|
187034
187513
|
if (!confirmed) {
|
|
187035
187514
|
output_manager_default.log("Canceled");
|
|
187036
187515
|
return 0;
|
|
187037
187516
|
}
|
|
187038
187517
|
const updateStamp = stamp_default();
|
|
187039
|
-
output_manager_default.spinner(`Restoring version ${
|
|
187518
|
+
output_manager_default.spinner(`Restoring version ${import_chalk131.default.bold(versionName)}`);
|
|
187040
187519
|
const { version: newVersion } = await updateRedirectVersion(
|
|
187041
187520
|
client2,
|
|
187042
187521
|
project.id,
|
|
@@ -187045,17 +187524,17 @@ ${import_chalk130.default.gray("No changes detected from current production vers
|
|
|
187045
187524
|
teamId
|
|
187046
187525
|
);
|
|
187047
187526
|
output_manager_default.log(
|
|
187048
|
-
`${
|
|
187527
|
+
`${import_chalk131.default.cyan("\u2713")} Version ${import_chalk131.default.bold(
|
|
187049
187528
|
newVersion.name || newVersion.id
|
|
187050
|
-
)} restored to production ${
|
|
187529
|
+
)} restored to production ${import_chalk131.default.gray(updateStamp())}`
|
|
187051
187530
|
);
|
|
187052
187531
|
return 0;
|
|
187053
187532
|
}
|
|
187054
|
-
var
|
|
187533
|
+
var import_chalk131;
|
|
187055
187534
|
var init_restore = __esm({
|
|
187056
187535
|
"src/commands/redirects/restore.ts"() {
|
|
187057
187536
|
"use strict";
|
|
187058
|
-
|
|
187537
|
+
import_chalk131 = __toESM3(require_source());
|
|
187059
187538
|
init_output_manager();
|
|
187060
187539
|
init_command32();
|
|
187061
187540
|
init_shared2();
|
|
@@ -187091,6 +187570,12 @@ var init_redirects = __esm({
|
|
|
187091
187570
|
value: actual
|
|
187092
187571
|
});
|
|
187093
187572
|
}
|
|
187573
|
+
trackCliSubcommandUpload(actual) {
|
|
187574
|
+
this.trackCliSubcommand({
|
|
187575
|
+
subcommand: "upload",
|
|
187576
|
+
value: actual
|
|
187577
|
+
});
|
|
187578
|
+
}
|
|
187094
187579
|
trackCliSubcommandRemove(actual) {
|
|
187095
187580
|
this.trackCliSubcommand({
|
|
187096
187581
|
subcommand: "remove",
|
|
@@ -187178,6 +187663,14 @@ async function main16(client2) {
|
|
|
187178
187663
|
}
|
|
187179
187664
|
telemetry2.trackCliSubcommandAdd(subcommandOriginal);
|
|
187180
187665
|
return add7(client2, args2);
|
|
187666
|
+
case "upload":
|
|
187667
|
+
if (needHelp) {
|
|
187668
|
+
telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
|
|
187669
|
+
printHelp(uploadSubcommand);
|
|
187670
|
+
return 2;
|
|
187671
|
+
}
|
|
187672
|
+
telemetry2.trackCliSubcommandUpload(subcommandOriginal);
|
|
187673
|
+
return upload(client2, args2);
|
|
187181
187674
|
case "remove":
|
|
187182
187675
|
if (needHelp) {
|
|
187183
187676
|
telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
|
|
@@ -187220,6 +187713,7 @@ var init_redirects2 = __esm({
|
|
|
187220
187713
|
init_list11();
|
|
187221
187714
|
init_list_versions();
|
|
187222
187715
|
init_add13();
|
|
187716
|
+
init_upload();
|
|
187223
187717
|
init_remove5();
|
|
187224
187718
|
init_promote3();
|
|
187225
187719
|
init_restore();
|
|
@@ -187232,6 +187726,7 @@ var init_redirects2 = __esm({
|
|
|
187232
187726
|
list: getCommandAliases(listSubcommand8),
|
|
187233
187727
|
"list-versions": getCommandAliases(listVersionsSubcommand),
|
|
187234
187728
|
add: getCommandAliases(addSubcommand7),
|
|
187729
|
+
upload: getCommandAliases(uploadSubcommand),
|
|
187235
187730
|
remove: getCommandAliases(removeSubcommand9),
|
|
187236
187731
|
promote: getCommandAliases(promoteSubcommand),
|
|
187237
187732
|
restore: getCommandAliases(restoreSubcommand)
|
|
@@ -187424,7 +187919,7 @@ async function remove6(client2) {
|
|
|
187424
187919
|
}
|
|
187425
187920
|
const { contextName } = await getScope(client2);
|
|
187426
187921
|
output_manager_default.spinner(
|
|
187427
|
-
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${
|
|
187922
|
+
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk132.default.bold(contextName)}`
|
|
187428
187923
|
);
|
|
187429
187924
|
let aliases;
|
|
187430
187925
|
let projects;
|
|
@@ -187490,7 +187985,7 @@ async function remove6(client2) {
|
|
|
187490
187985
|
});
|
|
187491
187986
|
if (deployments.length === 0 && projects.length === 0) {
|
|
187492
187987
|
const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
|
|
187493
|
-
const stylizedIds = ids.map((id) =>
|
|
187988
|
+
const stylizedIds = ids.map((id) => import_chalk132.default.bold(`"${id}"`)).join(", ");
|
|
187494
187989
|
const commandName = getCommandName("projects ls");
|
|
187495
187990
|
log2(
|
|
187496
187991
|
`Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
|
|
@@ -187498,7 +187993,7 @@ async function remove6(client2) {
|
|
|
187498
187993
|
return 1;
|
|
187499
187994
|
}
|
|
187500
187995
|
log2(
|
|
187501
|
-
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${
|
|
187996
|
+
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk132.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
|
|
187502
187997
|
);
|
|
187503
187998
|
if (deployments.length > 200) {
|
|
187504
187999
|
output_manager_default.warn(
|
|
@@ -187525,11 +188020,11 @@ async function remove6(client2) {
|
|
|
187525
188020
|
`Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
|
|
187526
188021
|
);
|
|
187527
188022
|
deployments.forEach((depl) => {
|
|
187528
|
-
output_manager_default.print(`${
|
|
188023
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(depl.url)}
|
|
187529
188024
|
`);
|
|
187530
188025
|
});
|
|
187531
188026
|
projects.forEach((project) => {
|
|
187532
|
-
output_manager_default.print(`${
|
|
188027
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
|
|
187533
188028
|
`);
|
|
187534
188029
|
});
|
|
187535
188030
|
return 0;
|
|
@@ -187546,8 +188041,8 @@ function readConfirmation4(deployments, projects) {
|
|
|
187546
188041
|
);
|
|
187547
188042
|
const deploymentTable = table(
|
|
187548
188043
|
deployments.map((depl) => {
|
|
187549
|
-
const time =
|
|
187550
|
-
const url3 = depl.url ?
|
|
188044
|
+
const time = import_chalk132.default.gray(`${(0, import_ms28.default)(Date.now() - depl.createdAt)} ago`);
|
|
188045
|
+
const url3 = depl.url ? import_chalk132.default.underline(`https://${depl.url}`) : "";
|
|
187551
188046
|
return [` ${depl.id}`, url3, time];
|
|
187552
188047
|
}),
|
|
187553
188048
|
{ align: ["l", "r", "l"], hsep: 6 }
|
|
@@ -187558,7 +188053,7 @@ function readConfirmation4(deployments, projects) {
|
|
|
187558
188053
|
for (const depl of deployments) {
|
|
187559
188054
|
for (const { alias: alias2 } of depl.aliases) {
|
|
187560
188055
|
output_manager_default.warn(
|
|
187561
|
-
`${
|
|
188056
|
+
`${import_chalk132.default.underline(`https://${alias2}`)} is an alias for ${import_chalk132.default.bold(depl.url)} and will be removed`
|
|
187562
188057
|
);
|
|
187563
188058
|
}
|
|
187564
188059
|
}
|
|
@@ -187572,12 +188067,12 @@ function readConfirmation4(deployments, projects) {
|
|
|
187572
188067
|
`
|
|
187573
188068
|
);
|
|
187574
188069
|
for (const project of projects) {
|
|
187575
|
-
output_manager_default.print(`${
|
|
188070
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
|
|
187576
188071
|
`);
|
|
187577
188072
|
}
|
|
187578
188073
|
}
|
|
187579
188074
|
output_manager_default.print(
|
|
187580
|
-
`${
|
|
188075
|
+
`${import_chalk132.default.bold.red("> Are you sure?")} ${import_chalk132.default.gray("(y/N) ")}`
|
|
187581
188076
|
);
|
|
187582
188077
|
process.stdin.on("data", (d) => {
|
|
187583
188078
|
process.stdin.pause();
|
|
@@ -187594,11 +188089,11 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
|
187594
188089
|
}
|
|
187595
188090
|
return `${(0, import_pluralize15.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize15.default)("project", projects.length, true)}`;
|
|
187596
188091
|
}
|
|
187597
|
-
var
|
|
188092
|
+
var import_chalk132, import_ms28, import_pluralize15;
|
|
187598
188093
|
var init_remove7 = __esm({
|
|
187599
188094
|
"src/commands/remove/index.ts"() {
|
|
187600
188095
|
"use strict";
|
|
187601
|
-
|
|
188096
|
+
import_chalk132 = __toESM3(require_source());
|
|
187602
188097
|
import_ms28 = __toESM3(require_ms());
|
|
187603
188098
|
import_pluralize15 = __toESM3(require_pluralize());
|
|
187604
188099
|
init_table();
|
|
@@ -187694,7 +188189,7 @@ async function rollbackStatus({
|
|
|
187694
188189
|
}
|
|
187695
188190
|
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
|
187696
188191
|
output_manager_default.log(
|
|
187697
|
-
`The rollback exceeded its deadline - rerun ${
|
|
188192
|
+
`The rollback exceeded its deadline - rerun ${import_chalk133.default.bold(
|
|
187698
188193
|
`${packageName} rollback ${toDeploymentId}`
|
|
187699
188194
|
)} to try again`
|
|
187700
188195
|
);
|
|
@@ -187758,26 +188253,26 @@ async function renderJobSucceeded2({
|
|
|
187758
188253
|
let deploymentInfo = "";
|
|
187759
188254
|
try {
|
|
187760
188255
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
|
187761
|
-
deploymentInfo = `${
|
|
188256
|
+
deploymentInfo = `${import_chalk133.default.bold(deployment.url)} (${toDeploymentId})`;
|
|
187762
188257
|
} catch (err) {
|
|
187763
188258
|
output_manager_default.debug(
|
|
187764
188259
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
|
187765
188260
|
);
|
|
187766
|
-
deploymentInfo =
|
|
188261
|
+
deploymentInfo = import_chalk133.default.bold(toDeploymentId);
|
|
187767
188262
|
}
|
|
187768
188263
|
const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
|
|
187769
188264
|
output_manager_default.log(
|
|
187770
|
-
`Success! ${
|
|
188265
|
+
`Success! ${import_chalk133.default.bold(
|
|
187771
188266
|
project.name
|
|
187772
188267
|
)} was rolled back to ${deploymentInfo} ${duration}`
|
|
187773
188268
|
);
|
|
187774
188269
|
return 0;
|
|
187775
188270
|
}
|
|
187776
|
-
var
|
|
188271
|
+
var import_chalk133, import_ms29;
|
|
187777
188272
|
var init_status3 = __esm({
|
|
187778
188273
|
"src/commands/rollback/status.ts"() {
|
|
187779
188274
|
"use strict";
|
|
187780
|
-
|
|
188275
|
+
import_chalk133 = __toESM3(require_source());
|
|
187781
188276
|
init_elapsed();
|
|
187782
188277
|
init_format_date();
|
|
187783
188278
|
init_get_deployment();
|
|
@@ -187809,7 +188304,7 @@ async function requestRollback({
|
|
|
187809
188304
|
});
|
|
187810
188305
|
if (timeout !== void 0 && (0, import_ms30.default)(timeout) === 0) {
|
|
187811
188306
|
output_manager_default.log(
|
|
187812
|
-
`Successfully requested rollback of ${
|
|
188307
|
+
`Successfully requested rollback of ${import_chalk134.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
|
187813
188308
|
);
|
|
187814
188309
|
output_manager_default.log(`To check rollback status, run ${getCommandName("rollback")}.`);
|
|
187815
188310
|
return 0;
|
|
@@ -187822,11 +188317,11 @@ async function requestRollback({
|
|
|
187822
188317
|
timeout
|
|
187823
188318
|
});
|
|
187824
188319
|
}
|
|
187825
|
-
var
|
|
188320
|
+
var import_chalk134, import_ms30;
|
|
187826
188321
|
var init_request_rollback = __esm({
|
|
187827
188322
|
"src/commands/rollback/request-rollback.ts"() {
|
|
187828
188323
|
"use strict";
|
|
187829
|
-
|
|
188324
|
+
import_chalk134 = __toESM3(require_source());
|
|
187830
188325
|
init_pkg_name();
|
|
187831
188326
|
init_get_project_by_deployment();
|
|
187832
188327
|
import_ms30 = __toESM3(require_ms());
|
|
@@ -188496,11 +188991,11 @@ function formatBranchMatcher(branchMatcher) {
|
|
|
188496
188991
|
if (branchMatcher?.type === "equals") {
|
|
188497
188992
|
return branchMatcher.pattern;
|
|
188498
188993
|
} else if (branchMatcher?.type === "startsWith") {
|
|
188499
|
-
return `${branchMatcher.pattern}${
|
|
188994
|
+
return `${branchMatcher.pattern}${import_chalk135.default.dim("*")}`;
|
|
188500
188995
|
} else if (branchMatcher?.type === "endsWith") {
|
|
188501
|
-
return `${
|
|
188996
|
+
return `${import_chalk135.default.dim("*")}${branchMatcher.pattern}`;
|
|
188502
188997
|
}
|
|
188503
|
-
return
|
|
188998
|
+
return import_chalk135.default.dim("No branch configuration");
|
|
188504
188999
|
}
|
|
188505
189000
|
async function list8(client2, argv) {
|
|
188506
189001
|
const { cwd } = client2;
|
|
@@ -188531,12 +189026,12 @@ async function list8(client2, argv) {
|
|
|
188531
189026
|
const elapsed2 = (0, import_ms32.default)(Date.now() - start);
|
|
188532
189027
|
result = withDefaultEnvironmentsIncluded(result);
|
|
188533
189028
|
output_manager_default.log(
|
|
188534
|
-
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${
|
|
189029
|
+
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk135.default.gray(`[${elapsed2}]`)}`
|
|
188535
189030
|
);
|
|
188536
189031
|
const tablePrint = table(
|
|
188537
189032
|
[
|
|
188538
189033
|
["Target Name", "Branch Tracking", "Type", "Updated"].map(
|
|
188539
|
-
(header) =>
|
|
189034
|
+
(header) => import_chalk135.default.bold(import_chalk135.default.cyan(header))
|
|
188540
189035
|
),
|
|
188541
189036
|
...result.flatMap((target) => {
|
|
188542
189037
|
return [
|
|
@@ -188544,7 +189039,7 @@ async function list8(client2, argv) {
|
|
|
188544
189039
|
formatEnvironment(link4.org.slug, link4.project.name, target),
|
|
188545
189040
|
BRANCH_TRACKING_MAP[target.type](link4.project, target),
|
|
188546
189041
|
TYPE_MAP[target.type],
|
|
188547
|
-
|
|
189042
|
+
import_chalk135.default.gray(
|
|
188548
189043
|
target.updatedAt > 0 ? (0, import_ms32.default)(Date.now() - target.updatedAt) : "-"
|
|
188549
189044
|
)
|
|
188550
189045
|
]
|
|
@@ -188591,12 +189086,12 @@ function withDefaultEnvironmentsIncluded(environments) {
|
|
|
188591
189086
|
...environments.slice().sort((a, b) => a.slug.localeCompare(b.slug))
|
|
188592
189087
|
];
|
|
188593
189088
|
}
|
|
188594
|
-
var import_ms32,
|
|
189089
|
+
var import_ms32, import_chalk135, TYPE_MAP, BRANCH_TRACKING_MAP;
|
|
188595
189090
|
var init_list12 = __esm({
|
|
188596
189091
|
"src/commands/target/list.ts"() {
|
|
188597
189092
|
"use strict";
|
|
188598
189093
|
import_ms32 = __toESM3(require_ms());
|
|
188599
|
-
|
|
189094
|
+
import_chalk135 = __toESM3(require_source());
|
|
188600
189095
|
init_table();
|
|
188601
189096
|
init_output_manager();
|
|
188602
189097
|
init_command36();
|
|
@@ -188611,8 +189106,8 @@ var init_list12 = __esm({
|
|
|
188611
189106
|
};
|
|
188612
189107
|
BRANCH_TRACKING_MAP = {
|
|
188613
189108
|
production: (project) => project.link?.productionBranch ?? "main",
|
|
188614
|
-
preview: (_, env) => env.slug === "preview" ?
|
|
188615
|
-
development: () =>
|
|
189109
|
+
preview: (_, env) => env.slug === "preview" ? import_chalk135.default.dim("All unassigned git branches") : formatBranchMatcher(env.branchMatcher),
|
|
189110
|
+
development: () => import_chalk135.default.dim("Accessible via CLI")
|
|
188616
189111
|
};
|
|
188617
189112
|
}
|
|
188618
189113
|
});
|
|
@@ -188816,7 +189311,7 @@ async function list9(client2, argv) {
|
|
|
188816
189311
|
client2.stdout.write("\n");
|
|
188817
189312
|
const teamTable = table(
|
|
188818
189313
|
[
|
|
188819
|
-
["id", "Team name"].map((str) => (0,
|
|
189314
|
+
["id", "Team name"].map((str) => (0, import_chalk136.gray)(str)),
|
|
188820
189315
|
...teamList.map((team) => [team.value, team.name])
|
|
188821
189316
|
],
|
|
188822
189317
|
{ hsep: 5 }
|
|
@@ -188833,13 +189328,13 @@ async function list9(client2, argv) {
|
|
|
188833
189328
|
}
|
|
188834
189329
|
return 0;
|
|
188835
189330
|
}
|
|
188836
|
-
var
|
|
189331
|
+
var import_chalk136;
|
|
188837
189332
|
var init_list14 = __esm({
|
|
188838
189333
|
"src/commands/teams/list.ts"() {
|
|
188839
189334
|
"use strict";
|
|
188840
189335
|
init_chars();
|
|
188841
189336
|
init_table();
|
|
188842
|
-
|
|
189337
|
+
import_chalk136 = __toESM3(require_source());
|
|
188843
189338
|
init_get_user();
|
|
188844
189339
|
init_get_teams();
|
|
188845
189340
|
init_pkg_name();
|
|
@@ -188935,7 +189430,7 @@ Please select a team scope using ${getCommandName(
|
|
|
188935
189430
|
return 1;
|
|
188936
189431
|
}
|
|
188937
189432
|
output_manager_default.log(
|
|
188938
|
-
introMsg || `Inviting team members to ${
|
|
189433
|
+
introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
|
|
188939
189434
|
);
|
|
188940
189435
|
telemetry2.trackCliArgumentEmail(emails);
|
|
188941
189436
|
if (emails.length > 0) {
|
|
@@ -188955,10 +189450,10 @@ Please select a team scope using ${getCommandName(
|
|
|
188955
189450
|
throw err;
|
|
188956
189451
|
}
|
|
188957
189452
|
output_manager_default.log(
|
|
188958
|
-
`${
|
|
189453
|
+
`${import_chalk137.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
|
|
188959
189454
|
);
|
|
188960
189455
|
} else {
|
|
188961
|
-
output_manager_default.log(`${
|
|
189456
|
+
output_manager_default.log(`${import_chalk137.default.red(`\u2716 ${email3}`)} ${import_chalk137.default.gray("[invalid]")}`);
|
|
188962
189457
|
}
|
|
188963
189458
|
}
|
|
188964
189459
|
return 0;
|
|
@@ -188991,15 +189486,15 @@ Please select a team scope using ${getCommandName(
|
|
|
188991
189486
|
);
|
|
188992
189487
|
email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
|
|
188993
189488
|
emails.push(email2);
|
|
188994
|
-
output_manager_default.log(`${
|
|
189489
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
|
|
188995
189490
|
if (hasError) {
|
|
188996
189491
|
hasError = false;
|
|
188997
189492
|
process.stderr.write(eraseLines(emails.length + 2));
|
|
188998
189493
|
output_manager_default.log(
|
|
188999
|
-
introMsg || `Inviting team members to ${
|
|
189494
|
+
introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
|
|
189000
189495
|
);
|
|
189001
189496
|
for (const email3 of emails) {
|
|
189002
|
-
output_manager_default.log(`${
|
|
189497
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
|
189003
189498
|
}
|
|
189004
189499
|
}
|
|
189005
189500
|
} catch (err) {
|
|
@@ -189008,7 +189503,7 @@ Please select a team scope using ${getCommandName(
|
|
|
189008
189503
|
output_manager_default.error((0, import_error_utils35.errorToString)(err));
|
|
189009
189504
|
hasError = true;
|
|
189010
189505
|
for (const email3 of emails) {
|
|
189011
|
-
output_manager_default.log(`${
|
|
189506
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
|
189012
189507
|
}
|
|
189013
189508
|
}
|
|
189014
189509
|
}
|
|
@@ -189021,16 +189516,16 @@ Please select a team scope using ${getCommandName(
|
|
|
189021
189516
|
} else {
|
|
189022
189517
|
output_manager_default.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
|
|
189023
189518
|
for (const email3 of emails) {
|
|
189024
|
-
output_manager_default.log(`${
|
|
189519
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
|
189025
189520
|
}
|
|
189026
189521
|
}
|
|
189027
189522
|
return 0;
|
|
189028
189523
|
}
|
|
189029
|
-
var
|
|
189524
|
+
var import_chalk137, import_error_utils35, validateEmail, domains;
|
|
189030
189525
|
var init_invite2 = __esm({
|
|
189031
189526
|
"src/commands/teams/invite.ts"() {
|
|
189032
189527
|
"use strict";
|
|
189033
|
-
|
|
189528
|
+
import_chalk137 = __toESM3(require_source());
|
|
189034
189529
|
init_cmd();
|
|
189035
189530
|
init_stamp();
|
|
189036
189531
|
init_param();
|
|
@@ -189106,7 +189601,7 @@ async function add8(client2) {
|
|
|
189106
189601
|
let team;
|
|
189107
189602
|
let elapsed2;
|
|
189108
189603
|
output_manager_default.log(
|
|
189109
|
-
`Pick a team identifier for its URL (e.g.: ${
|
|
189604
|
+
`Pick a team identifier for its URL (e.g.: ${import_chalk138.default.cyan(
|
|
189110
189605
|
"`vercel.com/acme`"
|
|
189111
189606
|
)})`
|
|
189112
189607
|
);
|
|
@@ -189137,7 +189632,7 @@ async function add8(client2) {
|
|
|
189137
189632
|
output_manager_default.stopSpinner();
|
|
189138
189633
|
process.stdout.write(eraseLines(2));
|
|
189139
189634
|
output_manager_default.success(`Team created ${elapsed2()}`);
|
|
189140
|
-
output_manager_default.log(`${
|
|
189635
|
+
output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
|
|
189141
189636
|
`);
|
|
189142
189637
|
output_manager_default.log("Pick a display name for your team");
|
|
189143
189638
|
let name;
|
|
@@ -189160,7 +189655,7 @@ async function add8(client2) {
|
|
|
189160
189655
|
process.stdout.write(eraseLines(2));
|
|
189161
189656
|
team = Object.assign(team, res);
|
|
189162
189657
|
output_manager_default.success(`Team name saved ${elapsed2()}`);
|
|
189163
|
-
output_manager_default.log(`${
|
|
189658
|
+
output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
|
|
189164
189659
|
`);
|
|
189165
189660
|
output_manager_default.spinner("Saving");
|
|
189166
189661
|
client2.config.currentTeam = team.id;
|
|
@@ -189174,11 +189669,11 @@ async function add8(client2) {
|
|
|
189174
189669
|
});
|
|
189175
189670
|
return 0;
|
|
189176
189671
|
}
|
|
189177
|
-
var
|
|
189672
|
+
var import_chalk138, import_error_utils36, validateSlug, validateName, teamUrlPrefix, teamNamePrefix;
|
|
189178
189673
|
var init_add14 = __esm({
|
|
189179
189674
|
"src/commands/teams/add.ts"() {
|
|
189180
189675
|
"use strict";
|
|
189181
|
-
|
|
189676
|
+
import_chalk138 = __toESM3(require_source());
|
|
189182
189677
|
init_stamp();
|
|
189183
189678
|
init_erase_lines();
|
|
189184
189679
|
init_chars();
|
|
@@ -189191,7 +189686,7 @@ var init_add14 = __esm({
|
|
|
189191
189686
|
init_output_manager();
|
|
189192
189687
|
validateSlug = (value) => /^[a-z]+[a-z0-9_-]*$/.test(value);
|
|
189193
189688
|
validateName = (value) => /^[ a-zA-Z0-9_-]+$/.test(value);
|
|
189194
|
-
teamUrlPrefix = "Team URL".padEnd(14) +
|
|
189689
|
+
teamUrlPrefix = "Team URL".padEnd(14) + import_chalk138.default.gray("vercel.com/");
|
|
189195
189690
|
teamNamePrefix = "Team Name".padEnd(14);
|
|
189196
189691
|
}
|
|
189197
189692
|
});
|
|
@@ -189250,7 +189745,7 @@ async function change(client2, argv) {
|
|
|
189250
189745
|
let title9 = `${team.name} (${team.slug})`;
|
|
189251
189746
|
const selected = team.id === currentTeam?.id;
|
|
189252
189747
|
if (selected) {
|
|
189253
|
-
title9 += ` ${
|
|
189748
|
+
title9 += ` ${import_chalk139.default.bold("(current)")}`;
|
|
189254
189749
|
}
|
|
189255
189750
|
if (team.limited) {
|
|
189256
189751
|
title9 += ` ${emoji("locked")}`;
|
|
@@ -189262,7 +189757,7 @@ async function change(client2, argv) {
|
|
|
189262
189757
|
selected
|
|
189263
189758
|
};
|
|
189264
189759
|
});
|
|
189265
|
-
let suffix = personalScopeSelected ? ` ${
|
|
189760
|
+
let suffix = personalScopeSelected ? ` ${import_chalk139.default.bold("(current)")}` : "";
|
|
189266
189761
|
if (user.limited) {
|
|
189267
189762
|
suffix += ` ${emoji("locked")}`;
|
|
189268
189763
|
}
|
|
@@ -189308,14 +189803,14 @@ async function change(client2, argv) {
|
|
|
189308
189803
|
}
|
|
189309
189804
|
updateCurrentTeam(config2);
|
|
189310
189805
|
output_manager_default.success(
|
|
189311
|
-
`Your account (${
|
|
189806
|
+
`Your account (${import_chalk139.default.bold(user.username)}) is now active!`
|
|
189312
189807
|
);
|
|
189313
189808
|
return 0;
|
|
189314
189809
|
}
|
|
189315
189810
|
const newTeam = teams2.find((team) => team.slug === desiredSlug);
|
|
189316
189811
|
if (!newTeam) {
|
|
189317
189812
|
output_manager_default.error(
|
|
189318
|
-
`You do not have permission to access scope ${
|
|
189813
|
+
`You do not have permission to access scope ${import_chalk139.default.bold(desiredSlug)}.`
|
|
189319
189814
|
);
|
|
189320
189815
|
return 1;
|
|
189321
189816
|
}
|
|
@@ -189333,15 +189828,15 @@ async function change(client2, argv) {
|
|
|
189333
189828
|
}
|
|
189334
189829
|
updateCurrentTeam(config2, newTeam);
|
|
189335
189830
|
output_manager_default.success(
|
|
189336
|
-
`The team ${
|
|
189831
|
+
`The team ${import_chalk139.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
|
|
189337
189832
|
);
|
|
189338
189833
|
return 0;
|
|
189339
189834
|
}
|
|
189340
|
-
var
|
|
189835
|
+
var import_chalk139, updateCurrentTeam;
|
|
189341
189836
|
var init_switch2 = __esm({
|
|
189342
189837
|
"src/commands/teams/switch.ts"() {
|
|
189343
189838
|
"use strict";
|
|
189344
|
-
|
|
189839
|
+
import_chalk139 = __toESM3(require_source());
|
|
189345
189840
|
init_emoji();
|
|
189346
189841
|
init_get_user();
|
|
189347
189842
|
init_get_teams();
|
|
@@ -189520,13 +190015,13 @@ var init_teams2 = __esm({
|
|
|
189520
190015
|
// src/commands/telemetry/status.ts
|
|
189521
190016
|
async function status2(client2) {
|
|
189522
190017
|
const enabled = client2.config.telemetry?.enabled !== false;
|
|
189523
|
-
const status3 = enabled ?
|
|
190018
|
+
const status3 = enabled ? import_chalk140.default.green("Enabled") : import_chalk140.default.red("Disabled");
|
|
189524
190019
|
output_manager_default.print("\n");
|
|
189525
|
-
output_manager_default.log(`${
|
|
190020
|
+
output_manager_default.log(`${import_chalk140.default.bold("Telemetry status")}: ${status3}
|
|
189526
190021
|
`);
|
|
189527
190022
|
const learnMoreMessage = `
|
|
189528
190023
|
|
|
189529
|
-
Learn more: ${
|
|
190024
|
+
Learn more: ${import_chalk140.default.cyan("https://vercel.com/docs/cli/about-telemetry")}`;
|
|
189530
190025
|
if (enabled) {
|
|
189531
190026
|
output_manager_default.log(`You have opted in to Vercel CLI telemetry${learnMoreMessage}`);
|
|
189532
190027
|
} else {
|
|
@@ -189537,11 +190032,11 @@ Learn more: ${import_chalk139.default.cyan("https://vercel.com/docs/cli/about-te
|
|
|
189537
190032
|
}
|
|
189538
190033
|
return 0;
|
|
189539
190034
|
}
|
|
189540
|
-
var
|
|
190035
|
+
var import_chalk140;
|
|
189541
190036
|
var init_status4 = __esm({
|
|
189542
190037
|
"src/commands/telemetry/status.ts"() {
|
|
189543
190038
|
"use strict";
|
|
189544
|
-
|
|
190039
|
+
import_chalk140 = __toESM3(require_source());
|
|
189545
190040
|
init_output_manager();
|
|
189546
190041
|
}
|
|
189547
190042
|
});
|
|
@@ -189722,7 +190217,7 @@ async function telemetry(client2) {
|
|
|
189722
190217
|
default: {
|
|
189723
190218
|
const errorMessage = parsedArguments.args.length !== 2 ? "Invalid number of arguments" : "Invalid subcommand";
|
|
189724
190219
|
output_manager_default.print(
|
|
189725
|
-
`${
|
|
190220
|
+
`${import_chalk141.default.red("Error")}: ${errorMessage}. See help instructions for usage:
|
|
189726
190221
|
`
|
|
189727
190222
|
);
|
|
189728
190223
|
output_manager_default.print(help(telemetryCommand, { columns: client2.stderr.columns }));
|
|
@@ -189730,7 +190225,7 @@ async function telemetry(client2) {
|
|
|
189730
190225
|
}
|
|
189731
190226
|
}
|
|
189732
190227
|
}
|
|
189733
|
-
var
|
|
190228
|
+
var import_chalk141, COMMAND_CONFIG21;
|
|
189734
190229
|
var init_telemetry3 = __esm({
|
|
189735
190230
|
"src/commands/telemetry/index.ts"() {
|
|
189736
190231
|
"use strict";
|
|
@@ -189745,7 +190240,7 @@ var init_telemetry3 = __esm({
|
|
|
189745
190240
|
init_command38();
|
|
189746
190241
|
init_get_flags_specification();
|
|
189747
190242
|
init_telemetry2();
|
|
189748
|
-
|
|
190243
|
+
import_chalk141 = __toESM3(require_source());
|
|
189749
190244
|
init_output_manager();
|
|
189750
190245
|
init_commands();
|
|
189751
190246
|
COMMAND_CONFIG21 = {
|
|
@@ -189817,10 +190312,10 @@ var init_whoami2 = __esm({
|
|
|
189817
190312
|
|
|
189818
190313
|
// src/index.ts
|
|
189819
190314
|
var import_error_utils37 = __toESM3(require_dist2());
|
|
189820
|
-
var
|
|
189821
|
-
var
|
|
190315
|
+
var import_path42 = require("path");
|
|
190316
|
+
var import_fs10 = require("fs");
|
|
189822
190317
|
var import_fs_extra24 = __toESM3(require_lib());
|
|
189823
|
-
var
|
|
190318
|
+
var import_chalk142 = __toESM3(require_source());
|
|
189824
190319
|
var import_epipebomb = __toESM3(require_epipebomb());
|
|
189825
190320
|
|
|
189826
190321
|
// src/util/get-latest-version/index.ts
|
|
@@ -190810,13 +191305,13 @@ var main18 = async () => {
|
|
|
190810
191305
|
const betaCommands = ["curl"];
|
|
190811
191306
|
if (betaCommands.includes(targetOrSubcommand)) {
|
|
190812
191307
|
output_manager_default.print(
|
|
190813
|
-
`${
|
|
191308
|
+
`${import_chalk142.default.grey(
|
|
190814
191309
|
`${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
|
|
190815
191310
|
)}
|
|
190816
191311
|
`
|
|
190817
191312
|
);
|
|
190818
191313
|
} else {
|
|
190819
|
-
output_manager_default.print(`${
|
|
191314
|
+
output_manager_default.print(`${import_chalk142.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
|
|
190820
191315
|
`);
|
|
190821
191316
|
}
|
|
190822
191317
|
if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
|
|
@@ -190954,8 +191449,8 @@ var main18 = async () => {
|
|
|
190954
191449
|
let subcommand = void 0;
|
|
190955
191450
|
let userSuppliedSubCommand = "";
|
|
190956
191451
|
if (targetOrSubcommand) {
|
|
190957
|
-
const targetPath = (0,
|
|
190958
|
-
const targetPathExists = (0,
|
|
191452
|
+
const targetPath = (0, import_path42.join)(cwd, targetOrSubcommand);
|
|
191453
|
+
const targetPathExists = (0, import_fs10.existsSync)(targetPath);
|
|
190959
191454
|
const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
|
|
190960
191455
|
if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
|
|
190961
191456
|
output_manager_default.warn(
|
|
@@ -191403,20 +191898,20 @@ main18().then(async (exitCode2) => {
|
|
|
191403
191898
|
});
|
|
191404
191899
|
if (latest) {
|
|
191405
191900
|
const changelog = "https://github.com/vercel/vercel/releases";
|
|
191406
|
-
const errorMsg = exitCode2 && exitCode2 !== 2 ?
|
|
191901
|
+
const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk142.default.magenta(
|
|
191407
191902
|
`
|
|
191408
191903
|
|
|
191409
|
-
The latest update ${
|
|
191904
|
+
The latest update ${import_chalk142.default.italic(
|
|
191410
191905
|
"may"
|
|
191411
191906
|
)} fix any errors that occurred.`
|
|
191412
191907
|
) : "";
|
|
191413
191908
|
output_manager_default.print(
|
|
191414
191909
|
box(
|
|
191415
|
-
`Update available! ${
|
|
191910
|
+
`Update available! ${import_chalk142.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk142.default.green(
|
|
191416
191911
|
`v${latest}`
|
|
191417
191912
|
)}
|
|
191418
191913
|
Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
|
|
191419
|
-
Run ${
|
|
191914
|
+
Run ${import_chalk142.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
|
|
191420
191915
|
)
|
|
191421
191916
|
);
|
|
191422
191917
|
output_manager_default.print("\n\n");
|