vercel 50.0.0 → 50.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +886 -292
- package/package.json +13 -12
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) {
|
|
@@ -91668,14 +91711,12 @@ var init_diff_env_files = __esm({
|
|
|
91668
91711
|
function formatEnvValue(value) {
|
|
91669
91712
|
if (value == null)
|
|
91670
91713
|
return "";
|
|
91671
|
-
|
|
91672
|
-
|
|
91673
|
-
|
|
91674
|
-
|
|
91675
|
-
return value;
|
|
91676
|
-
}
|
|
91677
|
-
} catch {
|
|
91714
|
+
try {
|
|
91715
|
+
const parsed = JSON.parse(value);
|
|
91716
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
91717
|
+
return value.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
|
91678
91718
|
}
|
|
91719
|
+
} catch {
|
|
91679
91720
|
}
|
|
91680
91721
|
const needsQuotes = /\s/.test(value) || value.startsWith("#") || value.startsWith('"');
|
|
91681
91722
|
if (!needsQuotes)
|
|
@@ -92912,6 +92953,29 @@ async function findVercelConfigFile(workPath) {
|
|
|
92912
92953
|
}
|
|
92913
92954
|
return foundFiles[0] || null;
|
|
92914
92955
|
}
|
|
92956
|
+
function parseConfigLoaderError(stderr) {
|
|
92957
|
+
if (!stderr.trim()) {
|
|
92958
|
+
return "";
|
|
92959
|
+
}
|
|
92960
|
+
const moduleNotFoundMatch = stderr.match(
|
|
92961
|
+
/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/
|
|
92962
|
+
);
|
|
92963
|
+
if (moduleNotFoundMatch) {
|
|
92964
|
+
const packageName2 = moduleNotFoundMatch[1];
|
|
92965
|
+
return `Cannot find package '${packageName2}'. Make sure it's installed in your project dependencies.`;
|
|
92966
|
+
}
|
|
92967
|
+
const syntaxErrorMatch = stderr.match(/SyntaxError: (.+?)(?:\n|$)/);
|
|
92968
|
+
if (syntaxErrorMatch) {
|
|
92969
|
+
return `Syntax error: ${syntaxErrorMatch[1]}`;
|
|
92970
|
+
}
|
|
92971
|
+
const errorMatch = stderr.match(
|
|
92972
|
+
/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m
|
|
92973
|
+
);
|
|
92974
|
+
if (errorMatch) {
|
|
92975
|
+
return errorMatch[1];
|
|
92976
|
+
}
|
|
92977
|
+
return stderr.trim();
|
|
92978
|
+
}
|
|
92915
92979
|
async function compileVercelConfig(workPath) {
|
|
92916
92980
|
const vercelJsonPath = (0, import_path12.join)(workPath, "vercel.json");
|
|
92917
92981
|
const nowJsonPath = (0, import_path12.join)(workPath, "now.json");
|
|
@@ -92996,6 +93060,18 @@ async function compileVercelConfig(workPath) {
|
|
|
92996
93060
|
const child = (0, import_child_process3.fork)(loaderPath, [tempOutPath], {
|
|
92997
93061
|
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
92998
93062
|
});
|
|
93063
|
+
let stderrOutput = "";
|
|
93064
|
+
let stdoutOutput = "";
|
|
93065
|
+
if (child.stderr) {
|
|
93066
|
+
child.stderr.on("data", (data) => {
|
|
93067
|
+
stderrOutput += data.toString();
|
|
93068
|
+
});
|
|
93069
|
+
}
|
|
93070
|
+
if (child.stdout) {
|
|
93071
|
+
child.stdout.on("data", (data) => {
|
|
93072
|
+
stdoutOutput += data.toString();
|
|
93073
|
+
});
|
|
93074
|
+
}
|
|
92999
93075
|
const timeout = setTimeout(() => {
|
|
93000
93076
|
child.kill();
|
|
93001
93077
|
reject(new Error("Config loader timed out after 10 seconds"));
|
|
@@ -93012,7 +93088,20 @@ async function compileVercelConfig(workPath) {
|
|
|
93012
93088
|
child.on("exit", (code2) => {
|
|
93013
93089
|
clearTimeout(timeout);
|
|
93014
93090
|
if (code2 !== 0) {
|
|
93015
|
-
|
|
93091
|
+
if (stderrOutput.trim()) {
|
|
93092
|
+
output_manager_default.log(stderrOutput);
|
|
93093
|
+
}
|
|
93094
|
+
if (stdoutOutput.trim()) {
|
|
93095
|
+
output_manager_default.log(stdoutOutput);
|
|
93096
|
+
}
|
|
93097
|
+
const parsedError = parseConfigLoaderError(stderrOutput);
|
|
93098
|
+
if (parsedError) {
|
|
93099
|
+
reject(new Error(parsedError));
|
|
93100
|
+
} else if (stdoutOutput.trim()) {
|
|
93101
|
+
reject(new Error(stdoutOutput.trim()));
|
|
93102
|
+
} else {
|
|
93103
|
+
reject(new Error(`Config loader exited with code ${code2}`));
|
|
93104
|
+
}
|
|
93016
93105
|
}
|
|
93017
93106
|
});
|
|
93018
93107
|
});
|
|
@@ -148225,7 +148314,7 @@ function validateConfig(config2) {
|
|
|
148225
148314
|
}
|
|
148226
148315
|
return null;
|
|
148227
148316
|
}
|
|
148228
|
-
var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
|
|
148317
|
+
var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, customErrorPageSchema, vercelConfigSchema, ajv, validate;
|
|
148229
148318
|
var init_validate_config = __esm({
|
|
148230
148319
|
"src/util/validate-config.ts"() {
|
|
148231
148320
|
"use strict";
|
|
@@ -148370,6 +148459,26 @@ var init_validate_config = __esm({
|
|
|
148370
148459
|
}
|
|
148371
148460
|
}
|
|
148372
148461
|
};
|
|
148462
|
+
customErrorPageSchema = {
|
|
148463
|
+
oneOf: [
|
|
148464
|
+
{ type: "string", minLength: 1 },
|
|
148465
|
+
{
|
|
148466
|
+
type: "object",
|
|
148467
|
+
additionalProperties: false,
|
|
148468
|
+
minProperties: 1,
|
|
148469
|
+
properties: {
|
|
148470
|
+
default5xx: {
|
|
148471
|
+
type: "string",
|
|
148472
|
+
minLength: 1
|
|
148473
|
+
},
|
|
148474
|
+
default4xx: {
|
|
148475
|
+
type: "string",
|
|
148476
|
+
minLength: 1
|
|
148477
|
+
}
|
|
148478
|
+
}
|
|
148479
|
+
}
|
|
148480
|
+
]
|
|
148481
|
+
};
|
|
148373
148482
|
vercelConfigSchema = {
|
|
148374
148483
|
type: "object",
|
|
148375
148484
|
// These are not all possibilities because `vc dev`
|
|
@@ -148386,6 +148495,7 @@ var init_validate_config = __esm({
|
|
|
148386
148495
|
functions: import_build_utils13.functionsSchema,
|
|
148387
148496
|
images: imagesSchema,
|
|
148388
148497
|
crons: cronsSchema,
|
|
148498
|
+
customErrorPage: customErrorPageSchema,
|
|
148389
148499
|
bunVersion: { type: "string" }
|
|
148390
148500
|
}
|
|
148391
148501
|
};
|
|
@@ -149471,6 +149581,34 @@ async function main3(client2) {
|
|
|
149471
149581
|
async function doBuild(client2, project, buildsJson, cwd, outputDir, span, standalone = false) {
|
|
149472
149582
|
const { localConfigPath } = client2;
|
|
149473
149583
|
const workPath = (0, import_path28.join)(cwd, project.settings.rootDirectory || ".");
|
|
149584
|
+
const sourceConfigFile = await findSourceVercelConfigFile(workPath);
|
|
149585
|
+
let corepackShimDir;
|
|
149586
|
+
if (sourceConfigFile && process.env.VERCEL_TS_CONFIG_ENABLED) {
|
|
149587
|
+
corepackShimDir = await initCorepack({ repoRootPath: cwd });
|
|
149588
|
+
const installCommand2 = project.settings.installCommand;
|
|
149589
|
+
if (typeof installCommand2 === "string") {
|
|
149590
|
+
if (installCommand2.trim()) {
|
|
149591
|
+
output_manager_default.log(`Running install command before config compilation...`);
|
|
149592
|
+
await (0, import_build_utils14.runCustomInstallCommand)({
|
|
149593
|
+
destPath: workPath,
|
|
149594
|
+
installCommand: installCommand2,
|
|
149595
|
+
spawnOpts: { env: process.env },
|
|
149596
|
+
projectCreatedAt: project.settings.createdAt
|
|
149597
|
+
});
|
|
149598
|
+
} else {
|
|
149599
|
+
output_manager_default.debug("Skipping empty install command");
|
|
149600
|
+
}
|
|
149601
|
+
} else {
|
|
149602
|
+
output_manager_default.log(`Installing dependencies before config compilation...`);
|
|
149603
|
+
await (0, import_build_utils14.runNpmInstall)(
|
|
149604
|
+
workPath,
|
|
149605
|
+
[],
|
|
149606
|
+
{ env: process.env },
|
|
149607
|
+
void 0,
|
|
149608
|
+
project.settings.createdAt
|
|
149609
|
+
);
|
|
149610
|
+
}
|
|
149611
|
+
}
|
|
149474
149612
|
const compileResult = await compileVercelConfig(workPath);
|
|
149475
149613
|
const vercelConfigPath = localConfigPath || compileResult.configPath || (0, import_path28.join)(workPath, "vercel.json");
|
|
149476
149614
|
const [pkg, vercelConfig, nowConfig, hasInstrumentation] = await Promise.all([
|
|
@@ -149501,6 +149639,21 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
149501
149639
|
if (validateError) {
|
|
149502
149640
|
throw validateError;
|
|
149503
149641
|
}
|
|
149642
|
+
if (localConfig.customErrorPage) {
|
|
149643
|
+
const errorPages = typeof localConfig.customErrorPage === "string" ? [localConfig.customErrorPage] : Object.values(localConfig.customErrorPage);
|
|
149644
|
+
for (const page of errorPages) {
|
|
149645
|
+
if (page) {
|
|
149646
|
+
const src = (0, import_path28.join)(workPath, page);
|
|
149647
|
+
if (!(0, import_fs_extra18.existsSync)(src)) {
|
|
149648
|
+
throw new import_build_utils14.NowBuildError({
|
|
149649
|
+
code: "CUSTOM_ERROR_PAGE_NOT_FOUND",
|
|
149650
|
+
message: `The custom error page "${page}" was not found in "${workPath}".`,
|
|
149651
|
+
link: "https://vercel.com/docs/projects/project-configuration#custom-error-page"
|
|
149652
|
+
});
|
|
149653
|
+
}
|
|
149654
|
+
}
|
|
149655
|
+
}
|
|
149656
|
+
}
|
|
149504
149657
|
const projectSettings = {
|
|
149505
149658
|
...project.settings,
|
|
149506
149659
|
...pickOverrides(localConfig)
|
|
@@ -149603,7 +149756,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
149603
149756
|
const buildResults = /* @__PURE__ */ new Map();
|
|
149604
149757
|
const overrides = [];
|
|
149605
149758
|
const repoRootPath = cwd;
|
|
149606
|
-
|
|
149759
|
+
if (!corepackShimDir) {
|
|
149760
|
+
corepackShimDir = await initCorepack({ repoRootPath });
|
|
149761
|
+
}
|
|
149607
149762
|
const diagnostics = {};
|
|
149608
149763
|
for (const build2 of sortedBuilders) {
|
|
149609
149764
|
if (typeof build2.src !== "string")
|
|
@@ -152818,6 +152973,16 @@ async function processDeployment({
|
|
|
152818
152973
|
}
|
|
152819
152974
|
if (event.type === "alias-assigned") {
|
|
152820
152975
|
stopSpinner();
|
|
152976
|
+
if (event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
|
|
152977
|
+
const primaryDomain = event.payload.alias[0];
|
|
152978
|
+
const prodUrl = `https://${primaryDomain}`;
|
|
152979
|
+
output_manager_default.print(
|
|
152980
|
+
prependEmoji(
|
|
152981
|
+
`Aliased: ${import_chalk66.default.bold(prodUrl)} ${deployStamp()}`,
|
|
152982
|
+
emoji("link")
|
|
152983
|
+
) + "\n"
|
|
152984
|
+
);
|
|
152985
|
+
}
|
|
152821
152986
|
event.payload.indications = indications;
|
|
152822
152987
|
return event.payload;
|
|
152823
152988
|
}
|
|
@@ -169563,7 +169728,7 @@ var require_content_disposition = __commonJS2({
|
|
|
169563
169728
|
"use strict";
|
|
169564
169729
|
module2.exports = contentDisposition;
|
|
169565
169730
|
module2.exports.parse = parse11;
|
|
169566
|
-
var
|
|
169731
|
+
var basename11 = require("path").basename;
|
|
169567
169732
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
169568
169733
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
169569
169734
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -169598,9 +169763,9 @@ var require_content_disposition = __commonJS2({
|
|
|
169598
169763
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
169599
169764
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
169600
169765
|
}
|
|
169601
|
-
var name =
|
|
169766
|
+
var name = basename11(filename);
|
|
169602
169767
|
var isQuotedString = TEXT_REGEXP.test(name);
|
|
169603
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) :
|
|
169768
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename11(fallback);
|
|
169604
169769
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name;
|
|
169605
169770
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
|
|
169606
169771
|
params2["filename*"] = name;
|
|
@@ -173055,6 +173220,16 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
173055
173220
|
this.readJsonFile(configPath)
|
|
173056
173221
|
]);
|
|
173057
173222
|
await this.validateVercelConfig(vercelConfig);
|
|
173223
|
+
if (vercelConfig.customErrorPage) {
|
|
173224
|
+
const errorPages = typeof vercelConfig.customErrorPage === "string" ? [vercelConfig.customErrorPage] : Object.values(vercelConfig.customErrorPage);
|
|
173225
|
+
for (const page of errorPages) {
|
|
173226
|
+
if (page && !import_fs_extra21.default.existsSync((0, import_path36.join)(this.cwd, page))) {
|
|
173227
|
+
output_manager_default.warn(
|
|
173228
|
+
`The custom error page "${page}" was not found in "${this.cwd}". This will cause deployment to fail on Vercel.`
|
|
173229
|
+
);
|
|
173230
|
+
}
|
|
173231
|
+
}
|
|
173232
|
+
}
|
|
173058
173233
|
this.projectSettings = {
|
|
173059
173234
|
...this.originalProjectSettings,
|
|
173060
173235
|
...pickOverrides(vercelConfig)
|
|
@@ -185864,6 +186039,16 @@ async function redeploy(client2) {
|
|
|
185864
186039
|
output_manager_default.spinner("Running Checks", 0);
|
|
185865
186040
|
} else if (event.type === "alias-assigned" || event.type === "checks-conclusion-failed") {
|
|
185866
186041
|
output_manager_default.stopSpinner();
|
|
186042
|
+
if (event.type === "alias-assigned" && !Array.isArray(event.payload) && event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
|
|
186043
|
+
const primaryDomain = event.payload.alias[0];
|
|
186044
|
+
const prodUrl = `https://${primaryDomain}`;
|
|
186045
|
+
output_manager_default.print(
|
|
186046
|
+
prependEmoji(
|
|
186047
|
+
`Aliased: ${import_chalk124.default.bold(prodUrl)} ${deployStamp()}`,
|
|
186048
|
+
emoji("link")
|
|
186049
|
+
) + "\n"
|
|
186050
|
+
);
|
|
186051
|
+
}
|
|
185867
186052
|
deployment = event.payload;
|
|
185868
186053
|
break;
|
|
185869
186054
|
} else if (event.type === "canceled") {
|
|
@@ -186003,7 +186188,7 @@ async function getRedirects(client2, projectId, options = {}) {
|
|
|
186003
186188
|
params2.set("versionId", versionId);
|
|
186004
186189
|
}
|
|
186005
186190
|
if (diff) {
|
|
186006
|
-
params2.set("diff", "true");
|
|
186191
|
+
params2.set("diff", diff === true ? "true" : diff);
|
|
186007
186192
|
} else {
|
|
186008
186193
|
params2.set("per_page", perPage.toString());
|
|
186009
186194
|
if (search) {
|
|
@@ -186589,6 +186774,399 @@ var init_add13 = __esm({
|
|
|
186589
186774
|
}
|
|
186590
186775
|
});
|
|
186591
186776
|
|
|
186777
|
+
// src/commands/redirects/validate-redirects.ts
|
|
186778
|
+
function validateUploadFile(filePath, options = {}) {
|
|
186779
|
+
const maxSize = options.maxFileSize ?? MAX_FILE_SIZE;
|
|
186780
|
+
const allowedExts = options.allowedExtensions ?? ALLOWED_EXTENSIONS;
|
|
186781
|
+
try {
|
|
186782
|
+
const stats = (0, import_fs8.statSync)(filePath);
|
|
186783
|
+
if (!stats.isFile()) {
|
|
186784
|
+
return { valid: false, error: `Path "${filePath}" is not a file` };
|
|
186785
|
+
}
|
|
186786
|
+
if (stats.size > maxSize) {
|
|
186787
|
+
const sizeMB = Math.round(maxSize / (1024 * 1024));
|
|
186788
|
+
return { valid: false, error: `File must be below ${sizeMB}MB` };
|
|
186789
|
+
}
|
|
186790
|
+
const hasValidExtension = allowedExts.some(
|
|
186791
|
+
(ext) => filePath.toLowerCase().endsWith(ext)
|
|
186792
|
+
);
|
|
186793
|
+
if (!hasValidExtension) {
|
|
186794
|
+
return {
|
|
186795
|
+
valid: false,
|
|
186796
|
+
error: `File must be a .csv or .json file`
|
|
186797
|
+
};
|
|
186798
|
+
}
|
|
186799
|
+
return { valid: true };
|
|
186800
|
+
} catch (err) {
|
|
186801
|
+
if (err.code === "ENOENT") {
|
|
186802
|
+
return { valid: false, error: `File "${filePath}" not found` };
|
|
186803
|
+
}
|
|
186804
|
+
return { valid: false, error: `Error accessing file: ${err.message}` };
|
|
186805
|
+
}
|
|
186806
|
+
}
|
|
186807
|
+
function validateRedirect(redirect2) {
|
|
186808
|
+
if (!redirect2.source) {
|
|
186809
|
+
return { valid: false, error: "Redirect source is required" };
|
|
186810
|
+
}
|
|
186811
|
+
if (redirect2.source.length > MAX_URL_LENGTH) {
|
|
186812
|
+
return { valid: false, error: "Source URL is too long" };
|
|
186813
|
+
}
|
|
186814
|
+
if (!redirect2.source.startsWith("/")) {
|
|
186815
|
+
return { valid: false, error: "Source must be a relative path" };
|
|
186816
|
+
}
|
|
186817
|
+
if (!redirect2.destination) {
|
|
186818
|
+
return { valid: false, error: "Redirect destination is required" };
|
|
186819
|
+
}
|
|
186820
|
+
if (redirect2.destination.length > MAX_URL_LENGTH) {
|
|
186821
|
+
return { valid: false, error: "Destination URL is too long" };
|
|
186822
|
+
}
|
|
186823
|
+
try {
|
|
186824
|
+
new URL(redirect2.destination, "https://vercel.com");
|
|
186825
|
+
} catch {
|
|
186826
|
+
return { valid: false, error: "Destination must be a valid URL" };
|
|
186827
|
+
}
|
|
186828
|
+
if (redirect2.statusCode) {
|
|
186829
|
+
if (!VALID_STATUS_CODES.includes(redirect2.statusCode)) {
|
|
186830
|
+
return {
|
|
186831
|
+
valid: false,
|
|
186832
|
+
error: `Invalid status code. Must be one of: ${VALID_STATUS_CODES.join(", ")}`
|
|
186833
|
+
};
|
|
186834
|
+
}
|
|
186835
|
+
}
|
|
186836
|
+
return { valid: true };
|
|
186837
|
+
}
|
|
186838
|
+
function validateRedirectsArray(redirects) {
|
|
186839
|
+
if (!Array.isArray(redirects)) {
|
|
186840
|
+
return {
|
|
186841
|
+
valid: false,
|
|
186842
|
+
error: "JSON file must contain an array of redirects"
|
|
186843
|
+
};
|
|
186844
|
+
}
|
|
186845
|
+
if (redirects.length === 0) {
|
|
186846
|
+
return { valid: false, error: "No redirects provided" };
|
|
186847
|
+
}
|
|
186848
|
+
if (redirects.length > MAX_REDIRECTS) {
|
|
186849
|
+
return {
|
|
186850
|
+
valid: false,
|
|
186851
|
+
error: `Too many redirects. Maximum allowed: ${MAX_REDIRECTS}`
|
|
186852
|
+
};
|
|
186853
|
+
}
|
|
186854
|
+
for (let i = 0; i < redirects.length; i++) {
|
|
186855
|
+
const result = validateRedirect(redirects[i]);
|
|
186856
|
+
if (!result.valid) {
|
|
186857
|
+
return {
|
|
186858
|
+
valid: false,
|
|
186859
|
+
error: `Redirect ${i + 1}: ${result.error}`
|
|
186860
|
+
};
|
|
186861
|
+
}
|
|
186862
|
+
}
|
|
186863
|
+
return { valid: true };
|
|
186864
|
+
}
|
|
186865
|
+
function validateCSVStructure(content) {
|
|
186866
|
+
const lines2 = content.trim().split("\n");
|
|
186867
|
+
if (lines2.length < 2) {
|
|
186868
|
+
return {
|
|
186869
|
+
valid: false,
|
|
186870
|
+
error: "CSV must have a header and at least one redirect"
|
|
186871
|
+
};
|
|
186872
|
+
}
|
|
186873
|
+
const header = lines2[0].toLowerCase();
|
|
186874
|
+
const hasSource = header.includes("source");
|
|
186875
|
+
const hasDestination = header.includes("destination");
|
|
186876
|
+
if (!hasSource || !hasDestination) {
|
|
186877
|
+
return {
|
|
186878
|
+
valid: false,
|
|
186879
|
+
error: 'CSV must have "source" and "destination" columns'
|
|
186880
|
+
};
|
|
186881
|
+
}
|
|
186882
|
+
return { valid: true };
|
|
186883
|
+
}
|
|
186884
|
+
function validateVersionName(name) {
|
|
186885
|
+
if (!name) {
|
|
186886
|
+
return { valid: false, error: "Name is required" };
|
|
186887
|
+
}
|
|
186888
|
+
if (name.length > 256) {
|
|
186889
|
+
return { valid: false, error: "Name must be 256 characters or less" };
|
|
186890
|
+
}
|
|
186891
|
+
return { valid: true };
|
|
186892
|
+
}
|
|
186893
|
+
var import_fs8, MAX_FILE_SIZE, ALLOWED_EXTENSIONS, MAX_REDIRECTS, MAX_URL_LENGTH, VALID_STATUS_CODES;
|
|
186894
|
+
var init_validate_redirects = __esm({
|
|
186895
|
+
"src/commands/redirects/validate-redirects.ts"() {
|
|
186896
|
+
"use strict";
|
|
186897
|
+
import_fs8 = require("fs");
|
|
186898
|
+
MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
186899
|
+
ALLOWED_EXTENSIONS = [".csv", ".json"];
|
|
186900
|
+
MAX_REDIRECTS = 1e6;
|
|
186901
|
+
MAX_URL_LENGTH = 2048;
|
|
186902
|
+
VALID_STATUS_CODES = [301, 302, 303, 307, 308];
|
|
186903
|
+
}
|
|
186904
|
+
});
|
|
186905
|
+
|
|
186906
|
+
// src/commands/redirects/upload.ts
|
|
186907
|
+
async function upload(client2, argv) {
|
|
186908
|
+
const parsed = await parseSubcommandArgs(argv, uploadSubcommand);
|
|
186909
|
+
if (typeof parsed === "number")
|
|
186910
|
+
return parsed;
|
|
186911
|
+
const link4 = await ensureProjectLink(client2);
|
|
186912
|
+
if (typeof link4 === "number")
|
|
186913
|
+
return link4;
|
|
186914
|
+
const { project, org } = link4;
|
|
186915
|
+
const teamId = org.type === "team" ? org.id : void 0;
|
|
186916
|
+
const { args: args2, flags } = parsed;
|
|
186917
|
+
const skipPrompts = flags["--yes"];
|
|
186918
|
+
const overwrite = flags["--overwrite"] || false;
|
|
186919
|
+
const filePath = args2[0];
|
|
186920
|
+
if (!filePath) {
|
|
186921
|
+
output_manager_default.error("File path is required. Use: vercel redirects upload <file>");
|
|
186922
|
+
return 1;
|
|
186923
|
+
}
|
|
186924
|
+
const fileValidation = validateUploadFile(filePath);
|
|
186925
|
+
if (!fileValidation.valid) {
|
|
186926
|
+
output_manager_default.error(fileValidation.error);
|
|
186927
|
+
return 1;
|
|
186928
|
+
}
|
|
186929
|
+
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186930
|
+
const existingStagingVersion = versions.find((v) => v.isStaging);
|
|
186931
|
+
if (!skipPrompts) {
|
|
186932
|
+
const fileName = (0, import_path41.basename)(filePath);
|
|
186933
|
+
const fileType = filePath.endsWith(".csv") ? "CSV" : "JSON";
|
|
186934
|
+
const message2 = overwrite ? `Upload ${fileType} file "${fileName}" and replace all existing redirects?` : `Upload ${fileType} file "${fileName}"?`;
|
|
186935
|
+
const confirmed = await client2.input.confirm(message2, true);
|
|
186936
|
+
if (!confirmed) {
|
|
186937
|
+
output_manager_default.log("Upload cancelled");
|
|
186938
|
+
return 0;
|
|
186939
|
+
}
|
|
186940
|
+
}
|
|
186941
|
+
let versionName;
|
|
186942
|
+
if (!skipPrompts) {
|
|
186943
|
+
const provideName = await client2.input.confirm(
|
|
186944
|
+
"Do you want to provide a name for this version?",
|
|
186945
|
+
false
|
|
186946
|
+
);
|
|
186947
|
+
if (provideName) {
|
|
186948
|
+
versionName = await client2.input.text({
|
|
186949
|
+
message: "Version name (max 256 characters):",
|
|
186950
|
+
validate: (val) => {
|
|
186951
|
+
if (val && val.length > 256) {
|
|
186952
|
+
return "Name must be 256 characters or less";
|
|
186953
|
+
}
|
|
186954
|
+
return true;
|
|
186955
|
+
}
|
|
186956
|
+
});
|
|
186957
|
+
const { valid, error: error3 } = validateVersionName(versionName);
|
|
186958
|
+
if (!valid) {
|
|
186959
|
+
output_manager_default.error(error3);
|
|
186960
|
+
return 1;
|
|
186961
|
+
}
|
|
186962
|
+
}
|
|
186963
|
+
}
|
|
186964
|
+
const uploadStamp = stamp_default();
|
|
186965
|
+
output_manager_default.spinner("Uploading redirects");
|
|
186966
|
+
try {
|
|
186967
|
+
let result;
|
|
186968
|
+
const url3 = "/v1/bulk-redirects";
|
|
186969
|
+
if (filePath.endsWith(".csv")) {
|
|
186970
|
+
const csvContent = (0, import_fs9.readFileSync)(filePath);
|
|
186971
|
+
const fileName = (0, import_path41.basename)(filePath);
|
|
186972
|
+
const csvValidation = validateCSVStructure(csvContent.toString());
|
|
186973
|
+
if (!csvValidation.valid) {
|
|
186974
|
+
output_manager_default.error(`Invalid CSV: ${csvValidation.error}`);
|
|
186975
|
+
return 1;
|
|
186976
|
+
}
|
|
186977
|
+
const form = new import_form_data.default();
|
|
186978
|
+
form.append("teamId", teamId || org.id);
|
|
186979
|
+
form.append("projectId", project.id);
|
|
186980
|
+
form.append("overwrite", String(overwrite));
|
|
186981
|
+
if (versionName) {
|
|
186982
|
+
form.append("name", versionName);
|
|
186983
|
+
}
|
|
186984
|
+
form.append("bulkRedirectsFile", csvContent, {
|
|
186985
|
+
filename: fileName,
|
|
186986
|
+
contentType: "text/csv"
|
|
186987
|
+
});
|
|
186988
|
+
result = await client2.fetch(url3, {
|
|
186989
|
+
method: "PUT",
|
|
186990
|
+
headers: form.getHeaders(),
|
|
186991
|
+
body: form
|
|
186992
|
+
});
|
|
186993
|
+
} else {
|
|
186994
|
+
const content = (0, import_fs9.readFileSync)(filePath, "utf8");
|
|
186995
|
+
let redirects2;
|
|
186996
|
+
try {
|
|
186997
|
+
redirects2 = JSON.parse(content);
|
|
186998
|
+
} catch (err) {
|
|
186999
|
+
output_manager_default.error("Invalid JSON file format");
|
|
187000
|
+
return 1;
|
|
187001
|
+
}
|
|
187002
|
+
const redirectsValidation = validateRedirectsArray(redirects2);
|
|
187003
|
+
if (!redirectsValidation.valid) {
|
|
187004
|
+
output_manager_default.error(redirectsValidation.error);
|
|
187005
|
+
return 1;
|
|
187006
|
+
}
|
|
187007
|
+
const body = {
|
|
187008
|
+
projectId: project.id,
|
|
187009
|
+
redirects: redirects2,
|
|
187010
|
+
overwrite
|
|
187011
|
+
};
|
|
187012
|
+
if (teamId) {
|
|
187013
|
+
body.teamId = teamId;
|
|
187014
|
+
}
|
|
187015
|
+
if (versionName) {
|
|
187016
|
+
body.versionName = versionName;
|
|
187017
|
+
}
|
|
187018
|
+
result = await client2.fetch(url3, {
|
|
187019
|
+
method: "PUT",
|
|
187020
|
+
body
|
|
187021
|
+
});
|
|
187022
|
+
}
|
|
187023
|
+
output_manager_default.log(
|
|
187024
|
+
`${import_chalk128.default.cyan("\u2713")} Redirects uploaded ${import_chalk128.default.gray(uploadStamp())}`
|
|
187025
|
+
);
|
|
187026
|
+
output_manager_default.spinner("Fetching diff");
|
|
187027
|
+
const { redirects } = await getRedirects(client2, project.id, {
|
|
187028
|
+
teamId,
|
|
187029
|
+
versionId: result.version.id,
|
|
187030
|
+
diff: "only"
|
|
187031
|
+
});
|
|
187032
|
+
const redirectCount = redirects.length;
|
|
187033
|
+
output_manager_default.print(`
|
|
187034
|
+
${import_chalk128.default.bold("Summary:")}
|
|
187035
|
+
`);
|
|
187036
|
+
output_manager_default.print(
|
|
187037
|
+
` Uploaded ${redirectCount} redirect${redirectCount === 1 ? "" : "s"}
|
|
187038
|
+
`
|
|
187039
|
+
);
|
|
187040
|
+
if (redirectCount > 0) {
|
|
187041
|
+
const added = redirects.filter((r) => r.action === "+");
|
|
187042
|
+
const deleted = redirects.filter((r) => r.action === "-");
|
|
187043
|
+
const edited = redirects.filter((r) => r.action === "~");
|
|
187044
|
+
output_manager_default.print(`
|
|
187045
|
+
${import_chalk128.default.bold("Changes:")}
|
|
187046
|
+
`);
|
|
187047
|
+
if (added.length > 0) {
|
|
187048
|
+
output_manager_default.print(` ${import_chalk128.default.green(`Added: ${added.length}`)}
|
|
187049
|
+
`);
|
|
187050
|
+
}
|
|
187051
|
+
if (deleted.length > 0) {
|
|
187052
|
+
output_manager_default.print(` ${import_chalk128.default.red(`Deleted: ${deleted.length}`)}
|
|
187053
|
+
`);
|
|
187054
|
+
}
|
|
187055
|
+
if (edited.length > 0) {
|
|
187056
|
+
output_manager_default.print(` ${import_chalk128.default.yellow(`Modified: ${edited.length}`)}
|
|
187057
|
+
`);
|
|
187058
|
+
}
|
|
187059
|
+
output_manager_default.print(`
|
|
187060
|
+
${import_chalk128.default.bold("Redirect changes:")}
|
|
187061
|
+
`);
|
|
187062
|
+
const displayRedirects = redirects.slice(0, 100);
|
|
187063
|
+
const rows = displayRedirects.map((redirect2) => {
|
|
187064
|
+
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
187065
|
+
const action = redirect2.action || "+";
|
|
187066
|
+
let colorFn;
|
|
187067
|
+
let actionSymbol;
|
|
187068
|
+
switch (action) {
|
|
187069
|
+
case "+":
|
|
187070
|
+
colorFn = import_chalk128.default.green;
|
|
187071
|
+
actionSymbol = "+";
|
|
187072
|
+
break;
|
|
187073
|
+
case "-":
|
|
187074
|
+
colorFn = import_chalk128.default.red;
|
|
187075
|
+
actionSymbol = "-";
|
|
187076
|
+
break;
|
|
187077
|
+
case "~":
|
|
187078
|
+
colorFn = import_chalk128.default.yellow;
|
|
187079
|
+
actionSymbol = "~";
|
|
187080
|
+
break;
|
|
187081
|
+
default:
|
|
187082
|
+
colorFn = (s) => s;
|
|
187083
|
+
actionSymbol = " ";
|
|
187084
|
+
}
|
|
187085
|
+
return [
|
|
187086
|
+
colorFn(`${actionSymbol} ${redirect2.source}`),
|
|
187087
|
+
colorFn(redirect2.destination),
|
|
187088
|
+
colorFn(status3.toString())
|
|
187089
|
+
];
|
|
187090
|
+
});
|
|
187091
|
+
output_manager_default.print(
|
|
187092
|
+
formatTable(
|
|
187093
|
+
["Source", "Destination", "Status"],
|
|
187094
|
+
["l", "l", "l"],
|
|
187095
|
+
[{ rows }]
|
|
187096
|
+
)
|
|
187097
|
+
);
|
|
187098
|
+
if (redirectCount > 100) {
|
|
187099
|
+
output_manager_default.print(
|
|
187100
|
+
`
|
|
187101
|
+
${import_chalk128.default.gray(`... and ${redirectCount - 100} more redirect${redirectCount - 100 === 1 ? "" : "s"}`)}
|
|
187102
|
+
`
|
|
187103
|
+
);
|
|
187104
|
+
}
|
|
187105
|
+
}
|
|
187106
|
+
if (result.alias) {
|
|
187107
|
+
const testUrl = `https://${result.alias}`;
|
|
187108
|
+
output_manager_default.print(
|
|
187109
|
+
`
|
|
187110
|
+
${import_chalk128.default.bold("Test your changes:")} ${import_chalk128.default.cyan(testUrl)}
|
|
187111
|
+
`
|
|
187112
|
+
);
|
|
187113
|
+
}
|
|
187114
|
+
const newVersionName = result.version.name || result.version.id;
|
|
187115
|
+
output_manager_default.print(
|
|
187116
|
+
` ${import_chalk128.default.bold("New staging version:")} ${newVersionName}
|
|
187117
|
+
|
|
187118
|
+
`
|
|
187119
|
+
);
|
|
187120
|
+
if (existingStagingVersion) {
|
|
187121
|
+
output_manager_default.warn(
|
|
187122
|
+
`There are other staged changes. Please review all changes with ${import_chalk128.default.cyan("vercel redirects list --staging")} before promoting to production.`
|
|
187123
|
+
);
|
|
187124
|
+
} else if (!skipPrompts) {
|
|
187125
|
+
const shouldPromote = await client2.input.confirm(
|
|
187126
|
+
"This is the only staged change. Do you want to promote it to production now?",
|
|
187127
|
+
false
|
|
187128
|
+
);
|
|
187129
|
+
if (shouldPromote) {
|
|
187130
|
+
const promoteStamp = stamp_default();
|
|
187131
|
+
output_manager_default.spinner("Promoting to production");
|
|
187132
|
+
await updateRedirectVersion(
|
|
187133
|
+
client2,
|
|
187134
|
+
project.id,
|
|
187135
|
+
result.version.id,
|
|
187136
|
+
"promote",
|
|
187137
|
+
teamId
|
|
187138
|
+
);
|
|
187139
|
+
output_manager_default.log(
|
|
187140
|
+
`${import_chalk128.default.cyan("\u2713")} Version promoted to production ${import_chalk128.default.gray(promoteStamp())}`
|
|
187141
|
+
);
|
|
187142
|
+
}
|
|
187143
|
+
}
|
|
187144
|
+
return 0;
|
|
187145
|
+
} catch (error3) {
|
|
187146
|
+
output_manager_default.error(`Failed to upload redirects: ${error3.message}`);
|
|
187147
|
+
return 1;
|
|
187148
|
+
}
|
|
187149
|
+
}
|
|
187150
|
+
var import_fs9, import_path41, import_chalk128, import_form_data;
|
|
187151
|
+
var init_upload = __esm({
|
|
187152
|
+
"src/commands/redirects/upload.ts"() {
|
|
187153
|
+
"use strict";
|
|
187154
|
+
import_fs9 = require("fs");
|
|
187155
|
+
import_path41 = require("path");
|
|
187156
|
+
import_chalk128 = __toESM3(require_source());
|
|
187157
|
+
import_form_data = __toESM3(require("form-data"));
|
|
187158
|
+
init_output_manager();
|
|
187159
|
+
init_command32();
|
|
187160
|
+
init_shared2();
|
|
187161
|
+
init_stamp();
|
|
187162
|
+
init_get_redirect_versions();
|
|
187163
|
+
init_update_redirect_version();
|
|
187164
|
+
init_get_redirects();
|
|
187165
|
+
init_format_table();
|
|
187166
|
+
init_validate_redirects();
|
|
187167
|
+
}
|
|
187168
|
+
});
|
|
187169
|
+
|
|
186592
187170
|
// src/util/redirects/delete-redirects.ts
|
|
186593
187171
|
async function deleteRedirects(client2, projectId, sources, teamId) {
|
|
186594
187172
|
const params2 = new URLSearchParams();
|
|
@@ -186636,17 +187214,17 @@ async function remove5(client2, argv) {
|
|
|
186636
187214
|
const redirectToRemove = redirects.find((r) => r.source === source);
|
|
186637
187215
|
if (!redirectToRemove) {
|
|
186638
187216
|
output_manager_default.error(
|
|
186639
|
-
`Redirect with source "${source}" not found. Run ${
|
|
187217
|
+
`Redirect with source "${source}" not found. Run ${import_chalk129.default.cyan(
|
|
186640
187218
|
"vercel redirects list"
|
|
186641
187219
|
)} to see available redirects.`
|
|
186642
187220
|
);
|
|
186643
187221
|
return 1;
|
|
186644
187222
|
}
|
|
186645
187223
|
output_manager_default.print(`
|
|
186646
|
-
${
|
|
187224
|
+
${import_chalk129.default.bold("Removing redirect:")}
|
|
186647
187225
|
`);
|
|
186648
187226
|
output_manager_default.print(
|
|
186649
|
-
` ${
|
|
187227
|
+
` ${import_chalk129.default.cyan(redirectToRemove.source)} \u2192 ${import_chalk129.default.cyan(redirectToRemove.destination)}
|
|
186650
187228
|
`
|
|
186651
187229
|
);
|
|
186652
187230
|
const status3 = redirectToRemove.statusCode || (redirectToRemove.permanent ? 308 : 307);
|
|
@@ -186664,7 +187242,7 @@ async function remove5(client2, argv) {
|
|
|
186664
187242
|
return 0;
|
|
186665
187243
|
}
|
|
186666
187244
|
const removeStamp = stamp_default();
|
|
186667
|
-
output_manager_default.spinner(`Removing redirect for ${
|
|
187245
|
+
output_manager_default.spinner(`Removing redirect for ${import_chalk129.default.bold(source)}`);
|
|
186668
187246
|
const { alias: alias2, version: version2 } = await deleteRedirects(
|
|
186669
187247
|
client2,
|
|
186670
187248
|
project.id,
|
|
@@ -186672,13 +187250,13 @@ async function remove5(client2, argv) {
|
|
|
186672
187250
|
teamId
|
|
186673
187251
|
);
|
|
186674
187252
|
output_manager_default.log(
|
|
186675
|
-
`${
|
|
187253
|
+
`${import_chalk129.default.cyan("\u2713")} Redirect removed ${import_chalk129.default.gray(removeStamp())}`
|
|
186676
187254
|
);
|
|
186677
187255
|
if (alias2) {
|
|
186678
187256
|
const testUrl = source.startsWith("/") ? `https://${alias2}${source}` : `https://${alias2}`;
|
|
186679
187257
|
output_manager_default.print(
|
|
186680
187258
|
`
|
|
186681
|
-
${
|
|
187259
|
+
${import_chalk129.default.bold("Test your changes:")} ${import_chalk129.default.cyan(testUrl)}
|
|
186682
187260
|
`
|
|
186683
187261
|
);
|
|
186684
187262
|
output_manager_default.print(
|
|
@@ -186687,7 +187265,7 @@ async function remove5(client2, argv) {
|
|
|
186687
187265
|
);
|
|
186688
187266
|
}
|
|
186689
187267
|
const versionName = version2.name || version2.id;
|
|
186690
|
-
output_manager_default.print(` ${
|
|
187268
|
+
output_manager_default.print(` ${import_chalk129.default.bold("New staging version:")} ${versionName}
|
|
186691
187269
|
|
|
186692
187270
|
`);
|
|
186693
187271
|
if (!existingStagingVersion) {
|
|
@@ -186706,21 +187284,21 @@ async function remove5(client2, argv) {
|
|
|
186706
187284
|
teamId
|
|
186707
187285
|
);
|
|
186708
187286
|
output_manager_default.log(
|
|
186709
|
-
`${
|
|
187287
|
+
`${import_chalk129.default.cyan("\u2713")} Version promoted to production ${import_chalk129.default.gray(promoteStamp())}`
|
|
186710
187288
|
);
|
|
186711
187289
|
}
|
|
186712
187290
|
} else {
|
|
186713
187291
|
output_manager_default.warn(
|
|
186714
|
-
`There are other staged changes. Review them with ${
|
|
187292
|
+
`There are other staged changes. Review them with ${import_chalk129.default.cyan("vercel redirects list --staging")} before promoting to production.`
|
|
186715
187293
|
);
|
|
186716
187294
|
}
|
|
186717
187295
|
return 0;
|
|
186718
187296
|
}
|
|
186719
|
-
var
|
|
187297
|
+
var import_chalk129;
|
|
186720
187298
|
var init_remove5 = __esm({
|
|
186721
187299
|
"src/commands/redirects/remove.ts"() {
|
|
186722
187300
|
"use strict";
|
|
186723
|
-
|
|
187301
|
+
import_chalk129 = __toESM3(require_source());
|
|
186724
187302
|
init_output_manager();
|
|
186725
187303
|
init_command32();
|
|
186726
187304
|
init_shared2();
|
|
@@ -186748,14 +187326,14 @@ async function promote(client2, argv) {
|
|
|
186748
187326
|
const { project, org } = link4;
|
|
186749
187327
|
const teamId = org.type === "team" ? org.id : void 0;
|
|
186750
187328
|
const [versionIdentifier] = parsed.args;
|
|
186751
|
-
output_manager_default.spinner(`Fetching redirect versions for ${
|
|
187329
|
+
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk130.default.bold(project.name)}`);
|
|
186752
187330
|
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186753
187331
|
const version2 = versions.find(
|
|
186754
187332
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
186755
187333
|
);
|
|
186756
187334
|
if (!version2) {
|
|
186757
187335
|
output_manager_default.error(
|
|
186758
|
-
`Version with ID or name "${versionIdentifier}" not found. Run ${
|
|
187336
|
+
`Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk130.default.cyan(
|
|
186759
187337
|
"vercel redirects list-versions"
|
|
186760
187338
|
)} to see available versions.`
|
|
186761
187339
|
);
|
|
@@ -186763,16 +187341,16 @@ async function promote(client2, argv) {
|
|
|
186763
187341
|
}
|
|
186764
187342
|
if (version2.isLive) {
|
|
186765
187343
|
output_manager_default.error(
|
|
186766
|
-
`Version ${
|
|
187344
|
+
`Version ${import_chalk130.default.bold(version2.name || version2.id)} is already live.`
|
|
186767
187345
|
);
|
|
186768
187346
|
return 1;
|
|
186769
187347
|
}
|
|
186770
187348
|
if (!version2.isStaging) {
|
|
186771
187349
|
output_manager_default.error(
|
|
186772
|
-
`Version ${
|
|
187350
|
+
`Version ${import_chalk130.default.bold(
|
|
186773
187351
|
version2.name || version2.id
|
|
186774
187352
|
)} is not staged. Only staging versions can be promoted to production.
|
|
186775
|
-
Run ${
|
|
187353
|
+
Run ${import_chalk130.default.cyan(
|
|
186776
187354
|
"vercel redirects list-versions"
|
|
186777
187355
|
)} to see which version is currently staged.`
|
|
186778
187356
|
);
|
|
@@ -186790,13 +187368,13 @@ Run ${import_chalk129.default.cyan(
|
|
|
186790
187368
|
);
|
|
186791
187369
|
if (changedRedirects.length > 0) {
|
|
186792
187370
|
output_manager_default.print(`
|
|
186793
|
-
${
|
|
187371
|
+
${import_chalk130.default.bold("Changes to be promoted:")}
|
|
186794
187372
|
|
|
186795
187373
|
`);
|
|
186796
187374
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
186797
187375
|
for (const redirect2 of displayRedirects) {
|
|
186798
187376
|
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
186799
|
-
const symbol = redirect2.action === "+" ?
|
|
187377
|
+
const symbol = redirect2.action === "+" ? import_chalk130.default.green("+") : import_chalk130.default.red("-");
|
|
186800
187378
|
output_manager_default.print(
|
|
186801
187379
|
` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
|
|
186802
187380
|
`
|
|
@@ -186804,7 +187382,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
|
|
|
186804
187382
|
}
|
|
186805
187383
|
if (changedRedirects.length > 20) {
|
|
186806
187384
|
output_manager_default.print(
|
|
186807
|
-
|
|
187385
|
+
import_chalk130.default.gray(`
|
|
186808
187386
|
... and ${changedRedirects.length - 20} more changes
|
|
186809
187387
|
`)
|
|
186810
187388
|
);
|
|
@@ -186813,7 +187391,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
|
|
|
186813
187391
|
} else {
|
|
186814
187392
|
output_manager_default.print(
|
|
186815
187393
|
`
|
|
186816
|
-
${
|
|
187394
|
+
${import_chalk130.default.gray("No changes detected from current production version.")}
|
|
186817
187395
|
|
|
186818
187396
|
`
|
|
186819
187397
|
);
|
|
@@ -186821,15 +187399,15 @@ ${import_chalk129.default.gray("No changes detected from current production vers
|
|
|
186821
187399
|
const confirmed = await confirmAction(
|
|
186822
187400
|
client2,
|
|
186823
187401
|
parsed.flags["--yes"],
|
|
186824
|
-
`Promote version ${
|
|
186825
|
-
`This will make it the live version for ${
|
|
187402
|
+
`Promote version ${import_chalk130.default.bold(versionName)} to production?`,
|
|
187403
|
+
`This will make it the live version for ${import_chalk130.default.bold(project.name)}.`
|
|
186826
187404
|
);
|
|
186827
187405
|
if (!confirmed) {
|
|
186828
187406
|
output_manager_default.log("Canceled");
|
|
186829
187407
|
return 0;
|
|
186830
187408
|
}
|
|
186831
187409
|
const updateStamp = stamp_default();
|
|
186832
|
-
output_manager_default.spinner(`Promoting version ${
|
|
187410
|
+
output_manager_default.spinner(`Promoting version ${import_chalk130.default.bold(versionName)} to production`);
|
|
186833
187411
|
const { version: newVersion } = await updateRedirectVersion(
|
|
186834
187412
|
client2,
|
|
186835
187413
|
project.id,
|
|
@@ -186838,17 +187416,17 @@ ${import_chalk129.default.gray("No changes detected from current production vers
|
|
|
186838
187416
|
teamId
|
|
186839
187417
|
);
|
|
186840
187418
|
output_manager_default.log(
|
|
186841
|
-
`${
|
|
187419
|
+
`${import_chalk130.default.cyan("\u2713")} Version ${import_chalk130.default.bold(
|
|
186842
187420
|
newVersion.name || newVersion.id
|
|
186843
|
-
)} promoted to production ${
|
|
187421
|
+
)} promoted to production ${import_chalk130.default.gray(updateStamp())}`
|
|
186844
187422
|
);
|
|
186845
187423
|
return 0;
|
|
186846
187424
|
}
|
|
186847
|
-
var
|
|
187425
|
+
var import_chalk130;
|
|
186848
187426
|
var init_promote3 = __esm({
|
|
186849
187427
|
"src/commands/redirects/promote.ts"() {
|
|
186850
187428
|
"use strict";
|
|
186851
|
-
|
|
187429
|
+
import_chalk130 = __toESM3(require_source());
|
|
186852
187430
|
init_output_manager();
|
|
186853
187431
|
init_command32();
|
|
186854
187432
|
init_shared2();
|
|
@@ -186875,14 +187453,14 @@ async function restore(client2, argv) {
|
|
|
186875
187453
|
const { project, org } = link4;
|
|
186876
187454
|
const teamId = org.type === "team" ? org.id : void 0;
|
|
186877
187455
|
const [versionIdentifier] = parsed.args;
|
|
186878
|
-
output_manager_default.spinner(`Fetching redirect versions for ${
|
|
187456
|
+
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk131.default.bold(project.name)}`);
|
|
186879
187457
|
const { versions } = await getRedirectVersions(client2, project.id, teamId);
|
|
186880
187458
|
const version2 = versions.find(
|
|
186881
187459
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
186882
187460
|
);
|
|
186883
187461
|
if (!version2) {
|
|
186884
187462
|
output_manager_default.error(
|
|
186885
|
-
`Version with ID or name "${versionIdentifier}" not found. Run ${
|
|
187463
|
+
`Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk131.default.cyan(
|
|
186886
187464
|
"vercel redirects list-versions"
|
|
186887
187465
|
)} to see available versions.`
|
|
186888
187466
|
);
|
|
@@ -186890,10 +187468,10 @@ async function restore(client2, argv) {
|
|
|
186890
187468
|
}
|
|
186891
187469
|
if (version2.isLive) {
|
|
186892
187470
|
output_manager_default.error(
|
|
186893
|
-
`Version ${
|
|
187471
|
+
`Version ${import_chalk131.default.bold(
|
|
186894
187472
|
version2.name || version2.id
|
|
186895
187473
|
)} is currently live. You cannot restore the live version.
|
|
186896
|
-
Run ${
|
|
187474
|
+
Run ${import_chalk131.default.cyan(
|
|
186897
187475
|
"vercel redirects list-versions"
|
|
186898
187476
|
)} to see previous versions you can restore.`
|
|
186899
187477
|
);
|
|
@@ -186901,7 +187479,7 @@ Run ${import_chalk130.default.cyan(
|
|
|
186901
187479
|
}
|
|
186902
187480
|
if (version2.isStaging) {
|
|
186903
187481
|
output_manager_default.error(
|
|
186904
|
-
`Version ${
|
|
187482
|
+
`Version ${import_chalk131.default.bold(
|
|
186905
187483
|
version2.name || version2.id
|
|
186906
187484
|
)} is staged. You can only restore previous versions.`
|
|
186907
187485
|
);
|
|
@@ -186919,13 +187497,13 @@ Run ${import_chalk130.default.cyan(
|
|
|
186919
187497
|
);
|
|
186920
187498
|
if (changedRedirects.length > 0) {
|
|
186921
187499
|
output_manager_default.print(`
|
|
186922
|
-
${
|
|
187500
|
+
${import_chalk131.default.bold("Changes to be restored:")}
|
|
186923
187501
|
|
|
186924
187502
|
`);
|
|
186925
187503
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
186926
187504
|
for (const redirect2 of displayRedirects) {
|
|
186927
187505
|
const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
|
|
186928
|
-
const symbol = redirect2.action === "+" ?
|
|
187506
|
+
const symbol = redirect2.action === "+" ? import_chalk131.default.green("+") : import_chalk131.default.red("-");
|
|
186929
187507
|
output_manager_default.print(
|
|
186930
187508
|
` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
|
|
186931
187509
|
`
|
|
@@ -186933,7 +187511,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
|
|
|
186933
187511
|
}
|
|
186934
187512
|
if (changedRedirects.length > 20) {
|
|
186935
187513
|
output_manager_default.print(
|
|
186936
|
-
|
|
187514
|
+
import_chalk131.default.gray(`
|
|
186937
187515
|
... and ${changedRedirects.length - 20} more changes
|
|
186938
187516
|
`)
|
|
186939
187517
|
);
|
|
@@ -186942,7 +187520,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
|
|
|
186942
187520
|
} else {
|
|
186943
187521
|
output_manager_default.print(
|
|
186944
187522
|
`
|
|
186945
|
-
${
|
|
187523
|
+
${import_chalk131.default.gray("No changes detected from current production version.")}
|
|
186946
187524
|
|
|
186947
187525
|
`
|
|
186948
187526
|
);
|
|
@@ -186950,15 +187528,15 @@ ${import_chalk130.default.gray("No changes detected from current production vers
|
|
|
186950
187528
|
const confirmed = await confirmAction(
|
|
186951
187529
|
client2,
|
|
186952
187530
|
parsed.flags["--yes"],
|
|
186953
|
-
`Restore version ${
|
|
186954
|
-
`This will make it the live version for ${
|
|
187531
|
+
`Restore version ${import_chalk131.default.bold(versionName)}?`,
|
|
187532
|
+
`This will make it the live version for ${import_chalk131.default.bold(project.name)}.`
|
|
186955
187533
|
);
|
|
186956
187534
|
if (!confirmed) {
|
|
186957
187535
|
output_manager_default.log("Canceled");
|
|
186958
187536
|
return 0;
|
|
186959
187537
|
}
|
|
186960
187538
|
const updateStamp = stamp_default();
|
|
186961
|
-
output_manager_default.spinner(`Restoring version ${
|
|
187539
|
+
output_manager_default.spinner(`Restoring version ${import_chalk131.default.bold(versionName)}`);
|
|
186962
187540
|
const { version: newVersion } = await updateRedirectVersion(
|
|
186963
187541
|
client2,
|
|
186964
187542
|
project.id,
|
|
@@ -186967,17 +187545,17 @@ ${import_chalk130.default.gray("No changes detected from current production vers
|
|
|
186967
187545
|
teamId
|
|
186968
187546
|
);
|
|
186969
187547
|
output_manager_default.log(
|
|
186970
|
-
`${
|
|
187548
|
+
`${import_chalk131.default.cyan("\u2713")} Version ${import_chalk131.default.bold(
|
|
186971
187549
|
newVersion.name || newVersion.id
|
|
186972
|
-
)} restored to production ${
|
|
187550
|
+
)} restored to production ${import_chalk131.default.gray(updateStamp())}`
|
|
186973
187551
|
);
|
|
186974
187552
|
return 0;
|
|
186975
187553
|
}
|
|
186976
|
-
var
|
|
187554
|
+
var import_chalk131;
|
|
186977
187555
|
var init_restore = __esm({
|
|
186978
187556
|
"src/commands/redirects/restore.ts"() {
|
|
186979
187557
|
"use strict";
|
|
186980
|
-
|
|
187558
|
+
import_chalk131 = __toESM3(require_source());
|
|
186981
187559
|
init_output_manager();
|
|
186982
187560
|
init_command32();
|
|
186983
187561
|
init_shared2();
|
|
@@ -187013,6 +187591,12 @@ var init_redirects = __esm({
|
|
|
187013
187591
|
value: actual
|
|
187014
187592
|
});
|
|
187015
187593
|
}
|
|
187594
|
+
trackCliSubcommandUpload(actual) {
|
|
187595
|
+
this.trackCliSubcommand({
|
|
187596
|
+
subcommand: "upload",
|
|
187597
|
+
value: actual
|
|
187598
|
+
});
|
|
187599
|
+
}
|
|
187016
187600
|
trackCliSubcommandRemove(actual) {
|
|
187017
187601
|
this.trackCliSubcommand({
|
|
187018
187602
|
subcommand: "remove",
|
|
@@ -187100,6 +187684,14 @@ async function main16(client2) {
|
|
|
187100
187684
|
}
|
|
187101
187685
|
telemetry2.trackCliSubcommandAdd(subcommandOriginal);
|
|
187102
187686
|
return add7(client2, args2);
|
|
187687
|
+
case "upload":
|
|
187688
|
+
if (needHelp) {
|
|
187689
|
+
telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
|
|
187690
|
+
printHelp(uploadSubcommand);
|
|
187691
|
+
return 2;
|
|
187692
|
+
}
|
|
187693
|
+
telemetry2.trackCliSubcommandUpload(subcommandOriginal);
|
|
187694
|
+
return upload(client2, args2);
|
|
187103
187695
|
case "remove":
|
|
187104
187696
|
if (needHelp) {
|
|
187105
187697
|
telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
|
|
@@ -187142,6 +187734,7 @@ var init_redirects2 = __esm({
|
|
|
187142
187734
|
init_list11();
|
|
187143
187735
|
init_list_versions();
|
|
187144
187736
|
init_add13();
|
|
187737
|
+
init_upload();
|
|
187145
187738
|
init_remove5();
|
|
187146
187739
|
init_promote3();
|
|
187147
187740
|
init_restore();
|
|
@@ -187154,6 +187747,7 @@ var init_redirects2 = __esm({
|
|
|
187154
187747
|
list: getCommandAliases(listSubcommand8),
|
|
187155
187748
|
"list-versions": getCommandAliases(listVersionsSubcommand),
|
|
187156
187749
|
add: getCommandAliases(addSubcommand7),
|
|
187750
|
+
upload: getCommandAliases(uploadSubcommand),
|
|
187157
187751
|
remove: getCommandAliases(removeSubcommand9),
|
|
187158
187752
|
promote: getCommandAliases(promoteSubcommand),
|
|
187159
187753
|
restore: getCommandAliases(restoreSubcommand)
|
|
@@ -187346,7 +187940,7 @@ async function remove6(client2) {
|
|
|
187346
187940
|
}
|
|
187347
187941
|
const { contextName } = await getScope(client2);
|
|
187348
187942
|
output_manager_default.spinner(
|
|
187349
|
-
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${
|
|
187943
|
+
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk132.default.bold(contextName)}`
|
|
187350
187944
|
);
|
|
187351
187945
|
let aliases;
|
|
187352
187946
|
let projects;
|
|
@@ -187412,7 +188006,7 @@ async function remove6(client2) {
|
|
|
187412
188006
|
});
|
|
187413
188007
|
if (deployments.length === 0 && projects.length === 0) {
|
|
187414
188008
|
const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
|
|
187415
|
-
const stylizedIds = ids.map((id) =>
|
|
188009
|
+
const stylizedIds = ids.map((id) => import_chalk132.default.bold(`"${id}"`)).join(", ");
|
|
187416
188010
|
const commandName = getCommandName("projects ls");
|
|
187417
188011
|
log2(
|
|
187418
188012
|
`Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
|
|
@@ -187420,7 +188014,7 @@ async function remove6(client2) {
|
|
|
187420
188014
|
return 1;
|
|
187421
188015
|
}
|
|
187422
188016
|
log2(
|
|
187423
|
-
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${
|
|
188017
|
+
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk132.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
|
|
187424
188018
|
);
|
|
187425
188019
|
if (deployments.length > 200) {
|
|
187426
188020
|
output_manager_default.warn(
|
|
@@ -187447,11 +188041,11 @@ async function remove6(client2) {
|
|
|
187447
188041
|
`Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
|
|
187448
188042
|
);
|
|
187449
188043
|
deployments.forEach((depl) => {
|
|
187450
|
-
output_manager_default.print(`${
|
|
188044
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(depl.url)}
|
|
187451
188045
|
`);
|
|
187452
188046
|
});
|
|
187453
188047
|
projects.forEach((project) => {
|
|
187454
|
-
output_manager_default.print(`${
|
|
188048
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
|
|
187455
188049
|
`);
|
|
187456
188050
|
});
|
|
187457
188051
|
return 0;
|
|
@@ -187468,8 +188062,8 @@ function readConfirmation4(deployments, projects) {
|
|
|
187468
188062
|
);
|
|
187469
188063
|
const deploymentTable = table(
|
|
187470
188064
|
deployments.map((depl) => {
|
|
187471
|
-
const time =
|
|
187472
|
-
const url3 = depl.url ?
|
|
188065
|
+
const time = import_chalk132.default.gray(`${(0, import_ms28.default)(Date.now() - depl.createdAt)} ago`);
|
|
188066
|
+
const url3 = depl.url ? import_chalk132.default.underline(`https://${depl.url}`) : "";
|
|
187473
188067
|
return [` ${depl.id}`, url3, time];
|
|
187474
188068
|
}),
|
|
187475
188069
|
{ align: ["l", "r", "l"], hsep: 6 }
|
|
@@ -187480,7 +188074,7 @@ function readConfirmation4(deployments, projects) {
|
|
|
187480
188074
|
for (const depl of deployments) {
|
|
187481
188075
|
for (const { alias: alias2 } of depl.aliases) {
|
|
187482
188076
|
output_manager_default.warn(
|
|
187483
|
-
`${
|
|
188077
|
+
`${import_chalk132.default.underline(`https://${alias2}`)} is an alias for ${import_chalk132.default.bold(depl.url)} and will be removed`
|
|
187484
188078
|
);
|
|
187485
188079
|
}
|
|
187486
188080
|
}
|
|
@@ -187494,12 +188088,12 @@ function readConfirmation4(deployments, projects) {
|
|
|
187494
188088
|
`
|
|
187495
188089
|
);
|
|
187496
188090
|
for (const project of projects) {
|
|
187497
|
-
output_manager_default.print(`${
|
|
188091
|
+
output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
|
|
187498
188092
|
`);
|
|
187499
188093
|
}
|
|
187500
188094
|
}
|
|
187501
188095
|
output_manager_default.print(
|
|
187502
|
-
`${
|
|
188096
|
+
`${import_chalk132.default.bold.red("> Are you sure?")} ${import_chalk132.default.gray("(y/N) ")}`
|
|
187503
188097
|
);
|
|
187504
188098
|
process.stdin.on("data", (d) => {
|
|
187505
188099
|
process.stdin.pause();
|
|
@@ -187516,11 +188110,11 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
|
187516
188110
|
}
|
|
187517
188111
|
return `${(0, import_pluralize15.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize15.default)("project", projects.length, true)}`;
|
|
187518
188112
|
}
|
|
187519
|
-
var
|
|
188113
|
+
var import_chalk132, import_ms28, import_pluralize15;
|
|
187520
188114
|
var init_remove7 = __esm({
|
|
187521
188115
|
"src/commands/remove/index.ts"() {
|
|
187522
188116
|
"use strict";
|
|
187523
|
-
|
|
188117
|
+
import_chalk132 = __toESM3(require_source());
|
|
187524
188118
|
import_ms28 = __toESM3(require_ms());
|
|
187525
188119
|
import_pluralize15 = __toESM3(require_pluralize());
|
|
187526
188120
|
init_table();
|
|
@@ -187616,7 +188210,7 @@ async function rollbackStatus({
|
|
|
187616
188210
|
}
|
|
187617
188211
|
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
|
187618
188212
|
output_manager_default.log(
|
|
187619
|
-
`The rollback exceeded its deadline - rerun ${
|
|
188213
|
+
`The rollback exceeded its deadline - rerun ${import_chalk133.default.bold(
|
|
187620
188214
|
`${packageName} rollback ${toDeploymentId}`
|
|
187621
188215
|
)} to try again`
|
|
187622
188216
|
);
|
|
@@ -187680,26 +188274,26 @@ async function renderJobSucceeded2({
|
|
|
187680
188274
|
let deploymentInfo = "";
|
|
187681
188275
|
try {
|
|
187682
188276
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
|
187683
|
-
deploymentInfo = `${
|
|
188277
|
+
deploymentInfo = `${import_chalk133.default.bold(deployment.url)} (${toDeploymentId})`;
|
|
187684
188278
|
} catch (err) {
|
|
187685
188279
|
output_manager_default.debug(
|
|
187686
188280
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
|
187687
188281
|
);
|
|
187688
|
-
deploymentInfo =
|
|
188282
|
+
deploymentInfo = import_chalk133.default.bold(toDeploymentId);
|
|
187689
188283
|
}
|
|
187690
188284
|
const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
|
|
187691
188285
|
output_manager_default.log(
|
|
187692
|
-
`Success! ${
|
|
188286
|
+
`Success! ${import_chalk133.default.bold(
|
|
187693
188287
|
project.name
|
|
187694
188288
|
)} was rolled back to ${deploymentInfo} ${duration}`
|
|
187695
188289
|
);
|
|
187696
188290
|
return 0;
|
|
187697
188291
|
}
|
|
187698
|
-
var
|
|
188292
|
+
var import_chalk133, import_ms29;
|
|
187699
188293
|
var init_status3 = __esm({
|
|
187700
188294
|
"src/commands/rollback/status.ts"() {
|
|
187701
188295
|
"use strict";
|
|
187702
|
-
|
|
188296
|
+
import_chalk133 = __toESM3(require_source());
|
|
187703
188297
|
init_elapsed();
|
|
187704
188298
|
init_format_date();
|
|
187705
188299
|
init_get_deployment();
|
|
@@ -187731,7 +188325,7 @@ async function requestRollback({
|
|
|
187731
188325
|
});
|
|
187732
188326
|
if (timeout !== void 0 && (0, import_ms30.default)(timeout) === 0) {
|
|
187733
188327
|
output_manager_default.log(
|
|
187734
|
-
`Successfully requested rollback of ${
|
|
188328
|
+
`Successfully requested rollback of ${import_chalk134.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
|
187735
188329
|
);
|
|
187736
188330
|
output_manager_default.log(`To check rollback status, run ${getCommandName("rollback")}.`);
|
|
187737
188331
|
return 0;
|
|
@@ -187744,11 +188338,11 @@ async function requestRollback({
|
|
|
187744
188338
|
timeout
|
|
187745
188339
|
});
|
|
187746
188340
|
}
|
|
187747
|
-
var
|
|
188341
|
+
var import_chalk134, import_ms30;
|
|
187748
188342
|
var init_request_rollback = __esm({
|
|
187749
188343
|
"src/commands/rollback/request-rollback.ts"() {
|
|
187750
188344
|
"use strict";
|
|
187751
|
-
|
|
188345
|
+
import_chalk134 = __toESM3(require_source());
|
|
187752
188346
|
init_pkg_name();
|
|
187753
188347
|
init_get_project_by_deployment();
|
|
187754
188348
|
import_ms30 = __toESM3(require_ms());
|
|
@@ -188418,11 +189012,11 @@ function formatBranchMatcher(branchMatcher) {
|
|
|
188418
189012
|
if (branchMatcher?.type === "equals") {
|
|
188419
189013
|
return branchMatcher.pattern;
|
|
188420
189014
|
} else if (branchMatcher?.type === "startsWith") {
|
|
188421
|
-
return `${branchMatcher.pattern}${
|
|
189015
|
+
return `${branchMatcher.pattern}${import_chalk135.default.dim("*")}`;
|
|
188422
189016
|
} else if (branchMatcher?.type === "endsWith") {
|
|
188423
|
-
return `${
|
|
189017
|
+
return `${import_chalk135.default.dim("*")}${branchMatcher.pattern}`;
|
|
188424
189018
|
}
|
|
188425
|
-
return
|
|
189019
|
+
return import_chalk135.default.dim("No branch configuration");
|
|
188426
189020
|
}
|
|
188427
189021
|
async function list8(client2, argv) {
|
|
188428
189022
|
const { cwd } = client2;
|
|
@@ -188453,12 +189047,12 @@ async function list8(client2, argv) {
|
|
|
188453
189047
|
const elapsed2 = (0, import_ms32.default)(Date.now() - start);
|
|
188454
189048
|
result = withDefaultEnvironmentsIncluded(result);
|
|
188455
189049
|
output_manager_default.log(
|
|
188456
|
-
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${
|
|
189050
|
+
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk135.default.gray(`[${elapsed2}]`)}`
|
|
188457
189051
|
);
|
|
188458
189052
|
const tablePrint = table(
|
|
188459
189053
|
[
|
|
188460
189054
|
["Target Name", "Branch Tracking", "Type", "Updated"].map(
|
|
188461
|
-
(header) =>
|
|
189055
|
+
(header) => import_chalk135.default.bold(import_chalk135.default.cyan(header))
|
|
188462
189056
|
),
|
|
188463
189057
|
...result.flatMap((target) => {
|
|
188464
189058
|
return [
|
|
@@ -188466,7 +189060,7 @@ async function list8(client2, argv) {
|
|
|
188466
189060
|
formatEnvironment(link4.org.slug, link4.project.name, target),
|
|
188467
189061
|
BRANCH_TRACKING_MAP[target.type](link4.project, target),
|
|
188468
189062
|
TYPE_MAP[target.type],
|
|
188469
|
-
|
|
189063
|
+
import_chalk135.default.gray(
|
|
188470
189064
|
target.updatedAt > 0 ? (0, import_ms32.default)(Date.now() - target.updatedAt) : "-"
|
|
188471
189065
|
)
|
|
188472
189066
|
]
|
|
@@ -188513,12 +189107,12 @@ function withDefaultEnvironmentsIncluded(environments) {
|
|
|
188513
189107
|
...environments.slice().sort((a, b) => a.slug.localeCompare(b.slug))
|
|
188514
189108
|
];
|
|
188515
189109
|
}
|
|
188516
|
-
var import_ms32,
|
|
189110
|
+
var import_ms32, import_chalk135, TYPE_MAP, BRANCH_TRACKING_MAP;
|
|
188517
189111
|
var init_list12 = __esm({
|
|
188518
189112
|
"src/commands/target/list.ts"() {
|
|
188519
189113
|
"use strict";
|
|
188520
189114
|
import_ms32 = __toESM3(require_ms());
|
|
188521
|
-
|
|
189115
|
+
import_chalk135 = __toESM3(require_source());
|
|
188522
189116
|
init_table();
|
|
188523
189117
|
init_output_manager();
|
|
188524
189118
|
init_command36();
|
|
@@ -188533,8 +189127,8 @@ var init_list12 = __esm({
|
|
|
188533
189127
|
};
|
|
188534
189128
|
BRANCH_TRACKING_MAP = {
|
|
188535
189129
|
production: (project) => project.link?.productionBranch ?? "main",
|
|
188536
|
-
preview: (_, env) => env.slug === "preview" ?
|
|
188537
|
-
development: () =>
|
|
189130
|
+
preview: (_, env) => env.slug === "preview" ? import_chalk135.default.dim("All unassigned git branches") : formatBranchMatcher(env.branchMatcher),
|
|
189131
|
+
development: () => import_chalk135.default.dim("Accessible via CLI")
|
|
188538
189132
|
};
|
|
188539
189133
|
}
|
|
188540
189134
|
});
|
|
@@ -188738,7 +189332,7 @@ async function list9(client2, argv) {
|
|
|
188738
189332
|
client2.stdout.write("\n");
|
|
188739
189333
|
const teamTable = table(
|
|
188740
189334
|
[
|
|
188741
|
-
["id", "Team name"].map((str) => (0,
|
|
189335
|
+
["id", "Team name"].map((str) => (0, import_chalk136.gray)(str)),
|
|
188742
189336
|
...teamList.map((team) => [team.value, team.name])
|
|
188743
189337
|
],
|
|
188744
189338
|
{ hsep: 5 }
|
|
@@ -188755,13 +189349,13 @@ async function list9(client2, argv) {
|
|
|
188755
189349
|
}
|
|
188756
189350
|
return 0;
|
|
188757
189351
|
}
|
|
188758
|
-
var
|
|
189352
|
+
var import_chalk136;
|
|
188759
189353
|
var init_list14 = __esm({
|
|
188760
189354
|
"src/commands/teams/list.ts"() {
|
|
188761
189355
|
"use strict";
|
|
188762
189356
|
init_chars();
|
|
188763
189357
|
init_table();
|
|
188764
|
-
|
|
189358
|
+
import_chalk136 = __toESM3(require_source());
|
|
188765
189359
|
init_get_user();
|
|
188766
189360
|
init_get_teams();
|
|
188767
189361
|
init_pkg_name();
|
|
@@ -188857,7 +189451,7 @@ Please select a team scope using ${getCommandName(
|
|
|
188857
189451
|
return 1;
|
|
188858
189452
|
}
|
|
188859
189453
|
output_manager_default.log(
|
|
188860
|
-
introMsg || `Inviting team members to ${
|
|
189454
|
+
introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
|
|
188861
189455
|
);
|
|
188862
189456
|
telemetry2.trackCliArgumentEmail(emails);
|
|
188863
189457
|
if (emails.length > 0) {
|
|
@@ -188877,10 +189471,10 @@ Please select a team scope using ${getCommandName(
|
|
|
188877
189471
|
throw err;
|
|
188878
189472
|
}
|
|
188879
189473
|
output_manager_default.log(
|
|
188880
|
-
`${
|
|
189474
|
+
`${import_chalk137.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
|
|
188881
189475
|
);
|
|
188882
189476
|
} else {
|
|
188883
|
-
output_manager_default.log(`${
|
|
189477
|
+
output_manager_default.log(`${import_chalk137.default.red(`\u2716 ${email3}`)} ${import_chalk137.default.gray("[invalid]")}`);
|
|
188884
189478
|
}
|
|
188885
189479
|
}
|
|
188886
189480
|
return 0;
|
|
@@ -188913,15 +189507,15 @@ Please select a team scope using ${getCommandName(
|
|
|
188913
189507
|
);
|
|
188914
189508
|
email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
|
|
188915
189509
|
emails.push(email2);
|
|
188916
|
-
output_manager_default.log(`${
|
|
189510
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
|
|
188917
189511
|
if (hasError) {
|
|
188918
189512
|
hasError = false;
|
|
188919
189513
|
process.stderr.write(eraseLines(emails.length + 2));
|
|
188920
189514
|
output_manager_default.log(
|
|
188921
|
-
introMsg || `Inviting team members to ${
|
|
189515
|
+
introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
|
|
188922
189516
|
);
|
|
188923
189517
|
for (const email3 of emails) {
|
|
188924
|
-
output_manager_default.log(`${
|
|
189518
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
|
188925
189519
|
}
|
|
188926
189520
|
}
|
|
188927
189521
|
} catch (err) {
|
|
@@ -188930,7 +189524,7 @@ Please select a team scope using ${getCommandName(
|
|
|
188930
189524
|
output_manager_default.error((0, import_error_utils35.errorToString)(err));
|
|
188931
189525
|
hasError = true;
|
|
188932
189526
|
for (const email3 of emails) {
|
|
188933
|
-
output_manager_default.log(`${
|
|
189527
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
|
188934
189528
|
}
|
|
188935
189529
|
}
|
|
188936
189530
|
}
|
|
@@ -188943,16 +189537,16 @@ Please select a team scope using ${getCommandName(
|
|
|
188943
189537
|
} else {
|
|
188944
189538
|
output_manager_default.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
|
|
188945
189539
|
for (const email3 of emails) {
|
|
188946
|
-
output_manager_default.log(`${
|
|
189540
|
+
output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
|
188947
189541
|
}
|
|
188948
189542
|
}
|
|
188949
189543
|
return 0;
|
|
188950
189544
|
}
|
|
188951
|
-
var
|
|
189545
|
+
var import_chalk137, import_error_utils35, validateEmail, domains;
|
|
188952
189546
|
var init_invite2 = __esm({
|
|
188953
189547
|
"src/commands/teams/invite.ts"() {
|
|
188954
189548
|
"use strict";
|
|
188955
|
-
|
|
189549
|
+
import_chalk137 = __toESM3(require_source());
|
|
188956
189550
|
init_cmd();
|
|
188957
189551
|
init_stamp();
|
|
188958
189552
|
init_param();
|
|
@@ -189028,7 +189622,7 @@ async function add8(client2) {
|
|
|
189028
189622
|
let team;
|
|
189029
189623
|
let elapsed2;
|
|
189030
189624
|
output_manager_default.log(
|
|
189031
|
-
`Pick a team identifier for its URL (e.g.: ${
|
|
189625
|
+
`Pick a team identifier for its URL (e.g.: ${import_chalk138.default.cyan(
|
|
189032
189626
|
"`vercel.com/acme`"
|
|
189033
189627
|
)})`
|
|
189034
189628
|
);
|
|
@@ -189059,7 +189653,7 @@ async function add8(client2) {
|
|
|
189059
189653
|
output_manager_default.stopSpinner();
|
|
189060
189654
|
process.stdout.write(eraseLines(2));
|
|
189061
189655
|
output_manager_default.success(`Team created ${elapsed2()}`);
|
|
189062
|
-
output_manager_default.log(`${
|
|
189656
|
+
output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
|
|
189063
189657
|
`);
|
|
189064
189658
|
output_manager_default.log("Pick a display name for your team");
|
|
189065
189659
|
let name;
|
|
@@ -189082,7 +189676,7 @@ async function add8(client2) {
|
|
|
189082
189676
|
process.stdout.write(eraseLines(2));
|
|
189083
189677
|
team = Object.assign(team, res);
|
|
189084
189678
|
output_manager_default.success(`Team name saved ${elapsed2()}`);
|
|
189085
|
-
output_manager_default.log(`${
|
|
189679
|
+
output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
|
|
189086
189680
|
`);
|
|
189087
189681
|
output_manager_default.spinner("Saving");
|
|
189088
189682
|
client2.config.currentTeam = team.id;
|
|
@@ -189096,11 +189690,11 @@ async function add8(client2) {
|
|
|
189096
189690
|
});
|
|
189097
189691
|
return 0;
|
|
189098
189692
|
}
|
|
189099
|
-
var
|
|
189693
|
+
var import_chalk138, import_error_utils36, validateSlug, validateName, teamUrlPrefix, teamNamePrefix;
|
|
189100
189694
|
var init_add14 = __esm({
|
|
189101
189695
|
"src/commands/teams/add.ts"() {
|
|
189102
189696
|
"use strict";
|
|
189103
|
-
|
|
189697
|
+
import_chalk138 = __toESM3(require_source());
|
|
189104
189698
|
init_stamp();
|
|
189105
189699
|
init_erase_lines();
|
|
189106
189700
|
init_chars();
|
|
@@ -189113,7 +189707,7 @@ var init_add14 = __esm({
|
|
|
189113
189707
|
init_output_manager();
|
|
189114
189708
|
validateSlug = (value) => /^[a-z]+[a-z0-9_-]*$/.test(value);
|
|
189115
189709
|
validateName = (value) => /^[ a-zA-Z0-9_-]+$/.test(value);
|
|
189116
|
-
teamUrlPrefix = "Team URL".padEnd(14) +
|
|
189710
|
+
teamUrlPrefix = "Team URL".padEnd(14) + import_chalk138.default.gray("vercel.com/");
|
|
189117
189711
|
teamNamePrefix = "Team Name".padEnd(14);
|
|
189118
189712
|
}
|
|
189119
189713
|
});
|
|
@@ -189172,7 +189766,7 @@ async function change(client2, argv) {
|
|
|
189172
189766
|
let title9 = `${team.name} (${team.slug})`;
|
|
189173
189767
|
const selected = team.id === currentTeam?.id;
|
|
189174
189768
|
if (selected) {
|
|
189175
|
-
title9 += ` ${
|
|
189769
|
+
title9 += ` ${import_chalk139.default.bold("(current)")}`;
|
|
189176
189770
|
}
|
|
189177
189771
|
if (team.limited) {
|
|
189178
189772
|
title9 += ` ${emoji("locked")}`;
|
|
@@ -189184,7 +189778,7 @@ async function change(client2, argv) {
|
|
|
189184
189778
|
selected
|
|
189185
189779
|
};
|
|
189186
189780
|
});
|
|
189187
|
-
let suffix = personalScopeSelected ? ` ${
|
|
189781
|
+
let suffix = personalScopeSelected ? ` ${import_chalk139.default.bold("(current)")}` : "";
|
|
189188
189782
|
if (user.limited) {
|
|
189189
189783
|
suffix += ` ${emoji("locked")}`;
|
|
189190
189784
|
}
|
|
@@ -189230,14 +189824,14 @@ async function change(client2, argv) {
|
|
|
189230
189824
|
}
|
|
189231
189825
|
updateCurrentTeam(config2);
|
|
189232
189826
|
output_manager_default.success(
|
|
189233
|
-
`Your account (${
|
|
189827
|
+
`Your account (${import_chalk139.default.bold(user.username)}) is now active!`
|
|
189234
189828
|
);
|
|
189235
189829
|
return 0;
|
|
189236
189830
|
}
|
|
189237
189831
|
const newTeam = teams2.find((team) => team.slug === desiredSlug);
|
|
189238
189832
|
if (!newTeam) {
|
|
189239
189833
|
output_manager_default.error(
|
|
189240
|
-
`You do not have permission to access scope ${
|
|
189834
|
+
`You do not have permission to access scope ${import_chalk139.default.bold(desiredSlug)}.`
|
|
189241
189835
|
);
|
|
189242
189836
|
return 1;
|
|
189243
189837
|
}
|
|
@@ -189255,15 +189849,15 @@ async function change(client2, argv) {
|
|
|
189255
189849
|
}
|
|
189256
189850
|
updateCurrentTeam(config2, newTeam);
|
|
189257
189851
|
output_manager_default.success(
|
|
189258
|
-
`The team ${
|
|
189852
|
+
`The team ${import_chalk139.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
|
|
189259
189853
|
);
|
|
189260
189854
|
return 0;
|
|
189261
189855
|
}
|
|
189262
|
-
var
|
|
189856
|
+
var import_chalk139, updateCurrentTeam;
|
|
189263
189857
|
var init_switch2 = __esm({
|
|
189264
189858
|
"src/commands/teams/switch.ts"() {
|
|
189265
189859
|
"use strict";
|
|
189266
|
-
|
|
189860
|
+
import_chalk139 = __toESM3(require_source());
|
|
189267
189861
|
init_emoji();
|
|
189268
189862
|
init_get_user();
|
|
189269
189863
|
init_get_teams();
|
|
@@ -189442,13 +190036,13 @@ var init_teams2 = __esm({
|
|
|
189442
190036
|
// src/commands/telemetry/status.ts
|
|
189443
190037
|
async function status2(client2) {
|
|
189444
190038
|
const enabled = client2.config.telemetry?.enabled !== false;
|
|
189445
|
-
const status3 = enabled ?
|
|
190039
|
+
const status3 = enabled ? import_chalk140.default.green("Enabled") : import_chalk140.default.red("Disabled");
|
|
189446
190040
|
output_manager_default.print("\n");
|
|
189447
|
-
output_manager_default.log(`${
|
|
190041
|
+
output_manager_default.log(`${import_chalk140.default.bold("Telemetry status")}: ${status3}
|
|
189448
190042
|
`);
|
|
189449
190043
|
const learnMoreMessage = `
|
|
189450
190044
|
|
|
189451
|
-
Learn more: ${
|
|
190045
|
+
Learn more: ${import_chalk140.default.cyan("https://vercel.com/docs/cli/about-telemetry")}`;
|
|
189452
190046
|
if (enabled) {
|
|
189453
190047
|
output_manager_default.log(`You have opted in to Vercel CLI telemetry${learnMoreMessage}`);
|
|
189454
190048
|
} else {
|
|
@@ -189459,11 +190053,11 @@ Learn more: ${import_chalk139.default.cyan("https://vercel.com/docs/cli/about-te
|
|
|
189459
190053
|
}
|
|
189460
190054
|
return 0;
|
|
189461
190055
|
}
|
|
189462
|
-
var
|
|
190056
|
+
var import_chalk140;
|
|
189463
190057
|
var init_status4 = __esm({
|
|
189464
190058
|
"src/commands/telemetry/status.ts"() {
|
|
189465
190059
|
"use strict";
|
|
189466
|
-
|
|
190060
|
+
import_chalk140 = __toESM3(require_source());
|
|
189467
190061
|
init_output_manager();
|
|
189468
190062
|
}
|
|
189469
190063
|
});
|
|
@@ -189644,7 +190238,7 @@ async function telemetry(client2) {
|
|
|
189644
190238
|
default: {
|
|
189645
190239
|
const errorMessage = parsedArguments.args.length !== 2 ? "Invalid number of arguments" : "Invalid subcommand";
|
|
189646
190240
|
output_manager_default.print(
|
|
189647
|
-
`${
|
|
190241
|
+
`${import_chalk141.default.red("Error")}: ${errorMessage}. See help instructions for usage:
|
|
189648
190242
|
`
|
|
189649
190243
|
);
|
|
189650
190244
|
output_manager_default.print(help(telemetryCommand, { columns: client2.stderr.columns }));
|
|
@@ -189652,7 +190246,7 @@ async function telemetry(client2) {
|
|
|
189652
190246
|
}
|
|
189653
190247
|
}
|
|
189654
190248
|
}
|
|
189655
|
-
var
|
|
190249
|
+
var import_chalk141, COMMAND_CONFIG21;
|
|
189656
190250
|
var init_telemetry3 = __esm({
|
|
189657
190251
|
"src/commands/telemetry/index.ts"() {
|
|
189658
190252
|
"use strict";
|
|
@@ -189667,7 +190261,7 @@ var init_telemetry3 = __esm({
|
|
|
189667
190261
|
init_command38();
|
|
189668
190262
|
init_get_flags_specification();
|
|
189669
190263
|
init_telemetry2();
|
|
189670
|
-
|
|
190264
|
+
import_chalk141 = __toESM3(require_source());
|
|
189671
190265
|
init_output_manager();
|
|
189672
190266
|
init_commands();
|
|
189673
190267
|
COMMAND_CONFIG21 = {
|
|
@@ -189739,10 +190333,10 @@ var init_whoami2 = __esm({
|
|
|
189739
190333
|
|
|
189740
190334
|
// src/index.ts
|
|
189741
190335
|
var import_error_utils37 = __toESM3(require_dist2());
|
|
189742
|
-
var
|
|
189743
|
-
var
|
|
190336
|
+
var import_path42 = require("path");
|
|
190337
|
+
var import_fs10 = require("fs");
|
|
189744
190338
|
var import_fs_extra24 = __toESM3(require_lib());
|
|
189745
|
-
var
|
|
190339
|
+
var import_chalk142 = __toESM3(require_source());
|
|
189746
190340
|
var import_epipebomb = __toESM3(require_epipebomb());
|
|
189747
190341
|
|
|
189748
190342
|
// src/util/get-latest-version/index.ts
|
|
@@ -190732,13 +191326,13 @@ var main18 = async () => {
|
|
|
190732
191326
|
const betaCommands = ["curl"];
|
|
190733
191327
|
if (betaCommands.includes(targetOrSubcommand)) {
|
|
190734
191328
|
output_manager_default.print(
|
|
190735
|
-
`${
|
|
191329
|
+
`${import_chalk142.default.grey(
|
|
190736
191330
|
`${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
|
|
190737
191331
|
)}
|
|
190738
191332
|
`
|
|
190739
191333
|
);
|
|
190740
191334
|
} else {
|
|
190741
|
-
output_manager_default.print(`${
|
|
191335
|
+
output_manager_default.print(`${import_chalk142.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
|
|
190742
191336
|
`);
|
|
190743
191337
|
}
|
|
190744
191338
|
if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
|
|
@@ -190876,8 +191470,8 @@ var main18 = async () => {
|
|
|
190876
191470
|
let subcommand = void 0;
|
|
190877
191471
|
let userSuppliedSubCommand = "";
|
|
190878
191472
|
if (targetOrSubcommand) {
|
|
190879
|
-
const targetPath = (0,
|
|
190880
|
-
const targetPathExists = (0,
|
|
191473
|
+
const targetPath = (0, import_path42.join)(cwd, targetOrSubcommand);
|
|
191474
|
+
const targetPathExists = (0, import_fs10.existsSync)(targetPath);
|
|
190881
191475
|
const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
|
|
190882
191476
|
if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
|
|
190883
191477
|
output_manager_default.warn(
|
|
@@ -191325,20 +191919,20 @@ main18().then(async (exitCode2) => {
|
|
|
191325
191919
|
});
|
|
191326
191920
|
if (latest) {
|
|
191327
191921
|
const changelog = "https://github.com/vercel/vercel/releases";
|
|
191328
|
-
const errorMsg = exitCode2 && exitCode2 !== 2 ?
|
|
191922
|
+
const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk142.default.magenta(
|
|
191329
191923
|
`
|
|
191330
191924
|
|
|
191331
|
-
The latest update ${
|
|
191925
|
+
The latest update ${import_chalk142.default.italic(
|
|
191332
191926
|
"may"
|
|
191333
191927
|
)} fix any errors that occurred.`
|
|
191334
191928
|
) : "";
|
|
191335
191929
|
output_manager_default.print(
|
|
191336
191930
|
box(
|
|
191337
|
-
`Update available! ${
|
|
191931
|
+
`Update available! ${import_chalk142.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk142.default.green(
|
|
191338
191932
|
`v${latest}`
|
|
191339
191933
|
)}
|
|
191340
191934
|
Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
|
|
191341
|
-
Run ${
|
|
191935
|
+
Run ${import_chalk142.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
|
|
191342
191936
|
)
|
|
191343
191937
|
);
|
|
191344
191938
|
output_manager_default.print("\n\n");
|