vercel 37.2.1 → 37.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +775 -803
- package/package.json +10 -10
package/dist/index.js
CHANGED
@@ -96,7 +96,7 @@ var require_dist2 = __commonJS2({
|
|
96
96
|
__export4(src_exports2, {
|
97
97
|
errorToString: () => errorToString13,
|
98
98
|
isErrnoException: () => isErrnoException20,
|
99
|
-
isError: () =>
|
99
|
+
isError: () => isError14,
|
100
100
|
isErrorLike: () => isErrorLike,
|
101
101
|
isObject: () => isObject2,
|
102
102
|
isSpawnError: () => isSpawnError2,
|
@@ -105,22 +105,22 @@ var require_dist2 = __commonJS2({
|
|
105
105
|
module2.exports = __toCommonJS4(src_exports2);
|
106
106
|
var import_node_util = __toESM4(require("util"));
|
107
107
|
var isObject2 = (obj) => typeof obj === "object" && obj !== null;
|
108
|
-
var
|
108
|
+
var isError14 = (error3) => {
|
109
109
|
return import_node_util.default.types.isNativeError(error3);
|
110
110
|
};
|
111
111
|
var isErrnoException20 = (error3) => {
|
112
|
-
return
|
112
|
+
return isError14(error3) && "code" in error3;
|
113
113
|
};
|
114
114
|
var isErrorLike = (error3) => isObject2(error3) && "message" in error3;
|
115
115
|
var errorToString13 = (error3, fallback) => {
|
116
|
-
if (
|
116
|
+
if (isError14(error3) || isErrorLike(error3))
|
117
117
|
return error3.message;
|
118
118
|
if (typeof error3 === "string")
|
119
119
|
return error3;
|
120
120
|
return fallback ?? "An unknown error has ocurred.";
|
121
121
|
};
|
122
122
|
var normalizeError3 = (error3) => {
|
123
|
-
if (
|
123
|
+
if (isError14(error3))
|
124
124
|
return error3;
|
125
125
|
const errorMessage = errorToString13(error3);
|
126
126
|
return isErrorLike(error3) ? Object.assign(new Error(errorMessage), error3) : new Error(errorMessage);
|
@@ -4073,14 +4073,14 @@ var require_templates = __commonJS2({
|
|
4073
4073
|
}
|
4074
4074
|
return results;
|
4075
4075
|
}
|
4076
|
-
function buildStyle(
|
4076
|
+
function buildStyle(chalk108, styles) {
|
4077
4077
|
const enabled = {};
|
4078
4078
|
for (const layer of styles) {
|
4079
4079
|
for (const style of layer.styles) {
|
4080
4080
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
4081
4081
|
}
|
4082
4082
|
}
|
4083
|
-
let current =
|
4083
|
+
let current = chalk108;
|
4084
4084
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
4085
4085
|
if (!Array.isArray(styles2)) {
|
4086
4086
|
continue;
|
@@ -4092,7 +4092,7 @@ var require_templates = __commonJS2({
|
|
4092
4092
|
}
|
4093
4093
|
return current;
|
4094
4094
|
}
|
4095
|
-
module2.exports = (
|
4095
|
+
module2.exports = (chalk108, temporary) => {
|
4096
4096
|
const styles = [];
|
4097
4097
|
const chunks = [];
|
4098
4098
|
let chunk = [];
|
@@ -4102,13 +4102,13 @@ var require_templates = __commonJS2({
|
|
4102
4102
|
} else if (style) {
|
4103
4103
|
const string = chunk.join("");
|
4104
4104
|
chunk = [];
|
4105
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
4105
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk108, styles)(string));
|
4106
4106
|
styles.push({ inverse, styles: parseStyle(style) });
|
4107
4107
|
} else if (close2) {
|
4108
4108
|
if (styles.length === 0) {
|
4109
4109
|
throw new Error("Found extraneous } in Chalk template literal");
|
4110
4110
|
}
|
4111
|
-
chunks.push(buildStyle(
|
4111
|
+
chunks.push(buildStyle(chalk108, styles)(chunk.join("")));
|
4112
4112
|
chunk = [];
|
4113
4113
|
styles.pop();
|
4114
4114
|
} else {
|
@@ -4156,16 +4156,16 @@ var require_source = __commonJS2({
|
|
4156
4156
|
}
|
4157
4157
|
};
|
4158
4158
|
var chalkFactory = (options) => {
|
4159
|
-
const
|
4160
|
-
applyOptions(
|
4161
|
-
|
4162
|
-
Object.setPrototypeOf(
|
4163
|
-
Object.setPrototypeOf(
|
4164
|
-
|
4159
|
+
const chalk109 = {};
|
4160
|
+
applyOptions(chalk109, options);
|
4161
|
+
chalk109.template = (...arguments_) => chalkTag(chalk109.template, ...arguments_);
|
4162
|
+
Object.setPrototypeOf(chalk109, Chalk3.prototype);
|
4163
|
+
Object.setPrototypeOf(chalk109.template, chalk109);
|
4164
|
+
chalk109.template.constructor = () => {
|
4165
4165
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
4166
4166
|
};
|
4167
|
-
|
4168
|
-
return
|
4167
|
+
chalk109.template.Instance = ChalkClass;
|
4168
|
+
return chalk109.template;
|
4169
4169
|
};
|
4170
4170
|
function Chalk3(options) {
|
4171
4171
|
return chalkFactory(options);
|
@@ -4276,7 +4276,7 @@ var require_source = __commonJS2({
|
|
4276
4276
|
return openAll + string + closeAll;
|
4277
4277
|
};
|
4278
4278
|
var template;
|
4279
|
-
var chalkTag = (
|
4279
|
+
var chalkTag = (chalk109, ...strings) => {
|
4280
4280
|
const [firstString] = strings;
|
4281
4281
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
4282
4282
|
return strings.join(" ");
|
@@ -4292,14 +4292,14 @@ var require_source = __commonJS2({
|
|
4292
4292
|
if (template === void 0) {
|
4293
4293
|
template = require_templates();
|
4294
4294
|
}
|
4295
|
-
return template(
|
4295
|
+
return template(chalk109, parts.join(""));
|
4296
4296
|
};
|
4297
4297
|
Object.defineProperties(Chalk3.prototype, styles);
|
4298
|
-
var
|
4299
|
-
|
4300
|
-
|
4301
|
-
|
4302
|
-
module2.exports =
|
4298
|
+
var chalk108 = Chalk3();
|
4299
|
+
chalk108.supportsColor = stdoutColor;
|
4300
|
+
chalk108.stderr = Chalk3({ level: stderrColor ? stderrColor.level : 0 });
|
4301
|
+
chalk108.stderr.supportsColor = stderrColor;
|
4302
|
+
module2.exports = chalk108;
|
4303
4303
|
}
|
4304
4304
|
});
|
4305
4305
|
|
@@ -6204,7 +6204,7 @@ var require_error = __commonJS2({
|
|
6204
6204
|
var require_is = __commonJS2({
|
6205
6205
|
"../../node_modules/.pnpm/@sentry+utils@5.5.0/node_modules/@sentry/utils/dist/is.js"(exports2) {
|
6206
6206
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
6207
|
-
function
|
6207
|
+
function isError14(wat) {
|
6208
6208
|
switch (Object.prototype.toString.call(wat)) {
|
6209
6209
|
case "[object Error]":
|
6210
6210
|
return true;
|
@@ -6216,7 +6216,7 @@ var require_is = __commonJS2({
|
|
6216
6216
|
return wat instanceof Error;
|
6217
6217
|
}
|
6218
6218
|
}
|
6219
|
-
exports2.isError =
|
6219
|
+
exports2.isError = isError14;
|
6220
6220
|
function isErrorEvent(wat) {
|
6221
6221
|
return Object.prototype.toString.call(wat) === "[object ErrorEvent]";
|
6222
6222
|
}
|
@@ -9904,7 +9904,7 @@ var require_agent_base = __commonJS2({
|
|
9904
9904
|
require_patch_core();
|
9905
9905
|
var inherits = require("util").inherits;
|
9906
9906
|
var promisify3 = require_promisify();
|
9907
|
-
var
|
9907
|
+
var EventEmitter2 = require("events").EventEmitter;
|
9908
9908
|
module2.exports = Agent;
|
9909
9909
|
function isAgent(v) {
|
9910
9910
|
return v && typeof v.addRequest === "function";
|
@@ -9913,7 +9913,7 @@ var require_agent_base = __commonJS2({
|
|
9913
9913
|
if (!(this instanceof Agent)) {
|
9914
9914
|
return new Agent(callback, _opts);
|
9915
9915
|
}
|
9916
|
-
|
9916
|
+
EventEmitter2.call(this);
|
9917
9917
|
this._promisifiedCallback = false;
|
9918
9918
|
let opts = _opts;
|
9919
9919
|
if ("function" === typeof callback) {
|
@@ -9924,7 +9924,7 @@ var require_agent_base = __commonJS2({
|
|
9924
9924
|
this.timeout = opts && opts.timeout || null;
|
9925
9925
|
this.options = opts;
|
9926
9926
|
}
|
9927
|
-
inherits(Agent,
|
9927
|
+
inherits(Agent, EventEmitter2);
|
9928
9928
|
Agent.prototype.callback = function callback(req, opts) {
|
9929
9929
|
throw new Error(
|
9930
9930
|
'"agent-base" has no default implementation, you must subclass and override `callback()`'
|
@@ -13478,14 +13478,14 @@ var require_templates2 = __commonJS2({
|
|
13478
13478
|
}
|
13479
13479
|
return results;
|
13480
13480
|
}
|
13481
|
-
function buildStyle(
|
13481
|
+
function buildStyle(chalk108, styles) {
|
13482
13482
|
const enabled = {};
|
13483
13483
|
for (const layer of styles) {
|
13484
13484
|
for (const style of layer.styles) {
|
13485
13485
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
13486
13486
|
}
|
13487
13487
|
}
|
13488
|
-
let current =
|
13488
|
+
let current = chalk108;
|
13489
13489
|
for (const styleName of Object.keys(enabled)) {
|
13490
13490
|
if (Array.isArray(enabled[styleName])) {
|
13491
13491
|
if (!(styleName in current)) {
|
@@ -13500,7 +13500,7 @@ var require_templates2 = __commonJS2({
|
|
13500
13500
|
}
|
13501
13501
|
return current;
|
13502
13502
|
}
|
13503
|
-
module2.exports = (
|
13503
|
+
module2.exports = (chalk108, tmp) => {
|
13504
13504
|
const styles = [];
|
13505
13505
|
const chunks = [];
|
13506
13506
|
let chunk = [];
|
@@ -13510,13 +13510,13 @@ var require_templates2 = __commonJS2({
|
|
13510
13510
|
} else if (style) {
|
13511
13511
|
const str = chunk.join("");
|
13512
13512
|
chunk = [];
|
13513
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
13513
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk108, styles)(str));
|
13514
13514
|
styles.push({ inverse, styles: parseStyle(style) });
|
13515
13515
|
} else if (close2) {
|
13516
13516
|
if (styles.length === 0) {
|
13517
13517
|
throw new Error("Found extraneous } in Chalk template literal");
|
13518
13518
|
}
|
13519
|
-
chunks.push(buildStyle(
|
13519
|
+
chunks.push(buildStyle(chalk108, styles)(chunk.join("")));
|
13520
13520
|
chunk = [];
|
13521
13521
|
styles.pop();
|
13522
13522
|
} else {
|
@@ -13553,16 +13553,16 @@ var require_chalk = __commonJS2({
|
|
13553
13553
|
}
|
13554
13554
|
function Chalk3(options) {
|
13555
13555
|
if (!this || !(this instanceof Chalk3) || this.template) {
|
13556
|
-
const
|
13557
|
-
applyOptions(
|
13558
|
-
|
13556
|
+
const chalk108 = {};
|
13557
|
+
applyOptions(chalk108, options);
|
13558
|
+
chalk108.template = function() {
|
13559
13559
|
const args2 = [].slice.call(arguments);
|
13560
|
-
return chalkTag.apply(null, [
|
13560
|
+
return chalkTag.apply(null, [chalk108.template].concat(args2));
|
13561
13561
|
};
|
13562
|
-
Object.setPrototypeOf(
|
13563
|
-
Object.setPrototypeOf(
|
13564
|
-
|
13565
|
-
return
|
13562
|
+
Object.setPrototypeOf(chalk108, Chalk3.prototype);
|
13563
|
+
Object.setPrototypeOf(chalk108.template, chalk108);
|
13564
|
+
chalk108.template.constructor = Chalk3;
|
13565
|
+
return chalk108.template;
|
13566
13566
|
}
|
13567
13567
|
applyOptions(this, options);
|
13568
13568
|
}
|
@@ -13681,7 +13681,7 @@ var require_chalk = __commonJS2({
|
|
13681
13681
|
ansiStyles.dim.open = originalDim;
|
13682
13682
|
return str;
|
13683
13683
|
}
|
13684
|
-
function chalkTag(
|
13684
|
+
function chalkTag(chalk108, strings) {
|
13685
13685
|
if (!Array.isArray(strings)) {
|
13686
13686
|
return [].slice.call(arguments, 1).join(" ");
|
13687
13687
|
}
|
@@ -13691,7 +13691,7 @@ var require_chalk = __commonJS2({
|
|
13691
13691
|
parts.push(String(args2[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
13692
13692
|
parts.push(String(strings.raw[i]));
|
13693
13693
|
}
|
13694
|
-
return template(
|
13694
|
+
return template(chalk108, parts.join(""));
|
13695
13695
|
}
|
13696
13696
|
Object.defineProperties(Chalk3.prototype, styles);
|
13697
13697
|
module2.exports = Chalk3();
|
@@ -15488,19 +15488,19 @@ var require_cli_spinners = __commonJS2({
|
|
15488
15488
|
var require_log_symbols = __commonJS2({
|
15489
15489
|
"../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports2, module2) {
|
15490
15490
|
"use strict";
|
15491
|
-
var
|
15491
|
+
var chalk108 = require_chalk();
|
15492
15492
|
var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
|
15493
15493
|
var main15 = {
|
15494
|
-
info:
|
15495
|
-
success:
|
15496
|
-
warning:
|
15497
|
-
error:
|
15494
|
+
info: chalk108.blue("\u2139"),
|
15495
|
+
success: chalk108.green("\u2714"),
|
15496
|
+
warning: chalk108.yellow("\u26A0"),
|
15497
|
+
error: chalk108.red("\u2716")
|
15498
15498
|
};
|
15499
15499
|
var fallbacks = {
|
15500
|
-
info:
|
15501
|
-
success:
|
15502
|
-
warning:
|
15503
|
-
error:
|
15500
|
+
info: chalk108.blue("i"),
|
15501
|
+
success: chalk108.green("\u221A"),
|
15502
|
+
warning: chalk108.yellow("\u203C"),
|
15503
|
+
error: chalk108.red("\xD7")
|
15504
15504
|
};
|
15505
15505
|
module2.exports = isSupported ? main15 : fallbacks;
|
15506
15506
|
}
|
@@ -15896,7 +15896,7 @@ var require_wcwidth = __commonJS2({
|
|
15896
15896
|
var require_ora = __commonJS2({
|
15897
15897
|
"../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports2, module2) {
|
15898
15898
|
"use strict";
|
15899
|
-
var
|
15899
|
+
var chalk108 = require_chalk();
|
15900
15900
|
var cliCursor = require_cli_cursor();
|
15901
15901
|
var cliSpinners = require_cli_spinners();
|
15902
15902
|
var logSymbols = require_log_symbols();
|
@@ -15985,7 +15985,7 @@ var require_ora = __commonJS2({
|
|
15985
15985
|
const { frames } = this.spinner;
|
15986
15986
|
let frame = frames[this.frameIndex];
|
15987
15987
|
if (this.color) {
|
15988
|
-
frame =
|
15988
|
+
frame = chalk108[this.color](frame);
|
15989
15989
|
}
|
15990
15990
|
this.frameIndex = ++this.frameIndex % frames.length;
|
15991
15991
|
const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
|
@@ -17765,14 +17765,14 @@ var require_templates3 = __commonJS2({
|
|
17765
17765
|
}
|
17766
17766
|
return results;
|
17767
17767
|
}
|
17768
|
-
function buildStyle(
|
17768
|
+
function buildStyle(chalk108, styles) {
|
17769
17769
|
const enabled = {};
|
17770
17770
|
for (const layer of styles) {
|
17771
17771
|
for (const style of layer.styles) {
|
17772
17772
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
17773
17773
|
}
|
17774
17774
|
}
|
17775
|
-
let current =
|
17775
|
+
let current = chalk108;
|
17776
17776
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
17777
17777
|
if (!Array.isArray(styles2)) {
|
17778
17778
|
continue;
|
@@ -17784,7 +17784,7 @@ var require_templates3 = __commonJS2({
|
|
17784
17784
|
}
|
17785
17785
|
return current;
|
17786
17786
|
}
|
17787
|
-
module2.exports = (
|
17787
|
+
module2.exports = (chalk108, temporary) => {
|
17788
17788
|
const styles = [];
|
17789
17789
|
const chunks = [];
|
17790
17790
|
let chunk = [];
|
@@ -17794,13 +17794,13 @@ var require_templates3 = __commonJS2({
|
|
17794
17794
|
} else if (style) {
|
17795
17795
|
const string = chunk.join("");
|
17796
17796
|
chunk = [];
|
17797
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
17797
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk108, styles)(string));
|
17798
17798
|
styles.push({ inverse, styles: parseStyle(style) });
|
17799
17799
|
} else if (close2) {
|
17800
17800
|
if (styles.length === 0) {
|
17801
17801
|
throw new Error("Found extraneous } in Chalk template literal");
|
17802
17802
|
}
|
17803
|
-
chunks.push(buildStyle(
|
17803
|
+
chunks.push(buildStyle(chalk108, styles)(chunk.join("")));
|
17804
17804
|
chunk = [];
|
17805
17805
|
styles.pop();
|
17806
17806
|
} else {
|
@@ -17848,16 +17848,16 @@ var require_source2 = __commonJS2({
|
|
17848
17848
|
}
|
17849
17849
|
};
|
17850
17850
|
var chalkFactory = (options) => {
|
17851
|
-
const
|
17852
|
-
applyOptions(
|
17853
|
-
|
17854
|
-
Object.setPrototypeOf(
|
17855
|
-
Object.setPrototypeOf(
|
17856
|
-
|
17851
|
+
const chalk109 = {};
|
17852
|
+
applyOptions(chalk109, options);
|
17853
|
+
chalk109.template = (...arguments_) => chalkTag(chalk109.template, ...arguments_);
|
17854
|
+
Object.setPrototypeOf(chalk109, Chalk3.prototype);
|
17855
|
+
Object.setPrototypeOf(chalk109.template, chalk109);
|
17856
|
+
chalk109.template.constructor = () => {
|
17857
17857
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
17858
17858
|
};
|
17859
|
-
|
17860
|
-
return
|
17859
|
+
chalk109.template.Instance = ChalkClass;
|
17860
|
+
return chalk109.template;
|
17861
17861
|
};
|
17862
17862
|
function Chalk3(options) {
|
17863
17863
|
return chalkFactory(options);
|
@@ -17968,7 +17968,7 @@ var require_source2 = __commonJS2({
|
|
17968
17968
|
return openAll + string + closeAll;
|
17969
17969
|
};
|
17970
17970
|
var template;
|
17971
|
-
var chalkTag = (
|
17971
|
+
var chalkTag = (chalk109, ...strings) => {
|
17972
17972
|
const [firstString] = strings;
|
17973
17973
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
17974
17974
|
return strings.join(" ");
|
@@ -17984,14 +17984,14 @@ var require_source2 = __commonJS2({
|
|
17984
17984
|
if (template === void 0) {
|
17985
17985
|
template = require_templates3();
|
17986
17986
|
}
|
17987
|
-
return template(
|
17987
|
+
return template(chalk109, parts.join(""));
|
17988
17988
|
};
|
17989
17989
|
Object.defineProperties(Chalk3.prototype, styles);
|
17990
|
-
var
|
17991
|
-
|
17992
|
-
|
17993
|
-
|
17994
|
-
module2.exports =
|
17990
|
+
var chalk108 = Chalk3();
|
17991
|
+
chalk108.supportsColor = stdoutColor;
|
17992
|
+
chalk108.stderr = Chalk3({ level: stderrColor ? stderrColor.level : 0 });
|
17993
|
+
chalk108.stderr.supportsColor = stderrColor;
|
17994
|
+
module2.exports = chalk108;
|
17995
17995
|
}
|
17996
17996
|
});
|
17997
17997
|
|
@@ -30567,12 +30567,12 @@ var require_http_agent = __commonJS2({
|
|
30567
30567
|
"use strict";
|
30568
30568
|
var net = require("net");
|
30569
30569
|
var util = require("util");
|
30570
|
-
var
|
30570
|
+
var EventEmitter2 = require("events");
|
30571
30571
|
var debug3 = util.debuglog("http");
|
30572
30572
|
function Agent(options) {
|
30573
30573
|
if (!(this instanceof Agent))
|
30574
30574
|
return new Agent(options);
|
30575
|
-
|
30575
|
+
EventEmitter2.call(this);
|
30576
30576
|
var self2 = this;
|
30577
30577
|
self2.defaultPort = 80;
|
30578
30578
|
self2.protocol = "http:";
|
@@ -30628,7 +30628,7 @@ var require_http_agent = __commonJS2({
|
|
30628
30628
|
}
|
30629
30629
|
});
|
30630
30630
|
}
|
30631
|
-
util.inherits(Agent,
|
30631
|
+
util.inherits(Agent, EventEmitter2);
|
30632
30632
|
exports2.Agent = Agent;
|
30633
30633
|
function freeSocketErrorListener(err) {
|
30634
30634
|
var socket = this;
|
@@ -32536,7 +32536,7 @@ var require_package = __commonJS2({
|
|
32536
32536
|
"../client/package.json"(exports2, module2) {
|
32537
32537
|
module2.exports = {
|
32538
32538
|
name: "@vercel/client",
|
32539
|
-
version: "13.4.
|
32539
|
+
version: "13.4.4",
|
32540
32540
|
main: "dist/index.js",
|
32541
32541
|
typings: "dist/index.d.ts",
|
32542
32542
|
homepage: "https://vercel.com",
|
@@ -32573,7 +32573,7 @@ var require_package = __commonJS2({
|
|
32573
32573
|
typescript: "4.9.5"
|
32574
32574
|
},
|
32575
32575
|
dependencies: {
|
32576
|
-
"@vercel/build-utils": "8.
|
32576
|
+
"@vercel/build-utils": "8.4.0",
|
32577
32577
|
"@vercel/error-utils": "2.0.2",
|
32578
32578
|
"@vercel/routing-utils": "3.1.0",
|
32579
32579
|
"@zeit/fetch": "5.2.0",
|
@@ -34340,7 +34340,7 @@ var require_upload = __commonJS2({
|
|
34340
34340
|
var import_http4 = __toESM4(require("http"));
|
34341
34341
|
var import_https = __toESM4(require("https"));
|
34342
34342
|
var import_stream = require("stream");
|
34343
|
-
var
|
34343
|
+
var import_events3 = require("events");
|
34344
34344
|
var import_async_retry6 = __toESM4(require_lib10());
|
34345
34345
|
var import_async_sema = require_lib9();
|
34346
34346
|
var import_utils4 = require_utils4();
|
@@ -34513,7 +34513,7 @@ ${e2}`);
|
|
34513
34513
|
yield { type: "error", payload: e2 };
|
34514
34514
|
}
|
34515
34515
|
}
|
34516
|
-
var UploadProgress = class extends
|
34516
|
+
var UploadProgress = class extends import_events3.EventEmitter {
|
34517
34517
|
constructor(sha, file) {
|
34518
34518
|
super();
|
34519
34519
|
this.sha = sha;
|
@@ -34824,10 +34824,10 @@ var require_util3 = __commonJS2({
|
|
34824
34824
|
return objectToString(d) === "[object Date]";
|
34825
34825
|
}
|
34826
34826
|
exports2.isDate = isDate;
|
34827
|
-
function
|
34827
|
+
function isError14(e2) {
|
34828
34828
|
return objectToString(e2) === "[object Error]" || e2 instanceof Error;
|
34829
34829
|
}
|
34830
|
-
exports2.isError =
|
34830
|
+
exports2.isError = isError14;
|
34831
34831
|
function isFunction(arg2) {
|
34832
34832
|
return typeof arg2 === "function";
|
34833
34833
|
}
|
@@ -84388,7 +84388,8 @@ var require_frameworks = __commonJS2({
|
|
84388
84388
|
detectors: {
|
84389
84389
|
every: [
|
84390
84390
|
{
|
84391
|
-
path: "
|
84391
|
+
path: "requirements.txt",
|
84392
|
+
matchContent: "python-fasthtml"
|
84392
84393
|
}
|
84393
84394
|
]
|
84394
84395
|
},
|
@@ -104550,11 +104551,12 @@ var init_project_settings = __esm({
|
|
104550
104551
|
});
|
104551
104552
|
|
104552
104553
|
// src/util/env/get-env-records.ts
|
104553
|
-
async function getEnvRecords(
|
104554
|
+
async function getEnvRecords(client2, projectId, source, {
|
104554
104555
|
target,
|
104555
104556
|
gitBranch,
|
104556
104557
|
decrypt
|
104557
104558
|
} = {}) {
|
104559
|
+
const { output: output2 } = client2;
|
104558
104560
|
output2.debug(
|
104559
104561
|
`Fetching Environment Variables of project ${projectId} and target ${target}`
|
104560
104562
|
);
|
@@ -104630,9 +104632,7 @@ var init_parse_env = __esm({
|
|
104630
104632
|
key = e2.slice(0, equalsSign);
|
104631
104633
|
value = e2.slice(equalsSign + 1);
|
104632
104634
|
}
|
104633
|
-
|
104634
|
-
o[key] = value;
|
104635
|
-
}
|
104635
|
+
o[key] = value;
|
104636
104636
|
return o;
|
104637
104637
|
}, startingDict);
|
104638
104638
|
}
|
@@ -104692,6 +104692,29 @@ var init_diff_env_files = __esm({
|
|
104692
104692
|
}
|
104693
104693
|
});
|
104694
104694
|
|
104695
|
+
// src/util/projects/format-project.ts
|
104696
|
+
function formatProject(client2, orgSlug, projectSlug, options) {
|
104697
|
+
const orgProjectSlug = `${orgSlug}/${projectSlug}`;
|
104698
|
+
const projectUrl = `https://vercel.com/${orgProjectSlug}`;
|
104699
|
+
const projectSlugLink = client2.output.link(
|
104700
|
+
import_chalk39.default.bold(orgProjectSlug),
|
104701
|
+
projectUrl,
|
104702
|
+
{
|
104703
|
+
fallback: () => import_chalk39.default.bold(orgProjectSlug),
|
104704
|
+
color: false,
|
104705
|
+
...options
|
104706
|
+
}
|
104707
|
+
);
|
104708
|
+
return projectSlugLink;
|
104709
|
+
}
|
104710
|
+
var import_chalk39;
|
104711
|
+
var init_format_project = __esm({
|
104712
|
+
"src/util/projects/format-project.ts"() {
|
104713
|
+
"use strict";
|
104714
|
+
import_chalk39 = __toESM3(require_source());
|
104715
|
+
}
|
104716
|
+
});
|
104717
|
+
|
104695
104718
|
// src/commands/env/pull.ts
|
104696
104719
|
function readHeadSync(path11, length) {
|
104697
104720
|
const buffer = Buffer.alloc(length);
|
@@ -104712,7 +104735,8 @@ function tryReadHeadSync(path11, length) {
|
|
104712
104735
|
}
|
104713
104736
|
}
|
104714
104737
|
}
|
104715
|
-
async function pull(client2, link4,
|
104738
|
+
async function pull(client2, link4, environment, opts, args2, cwd, source) {
|
104739
|
+
const { output: output2 } = client2;
|
104716
104740
|
if (args2.length > 1) {
|
104717
104741
|
output2.error(
|
104718
104742
|
`Invalid number of arguments. Usage: ${getCommandName(`env pull <file>`)}`
|
@@ -104726,7 +104750,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
104726
104750
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
104727
104751
|
const exists = typeof head !== "undefined";
|
104728
104752
|
if (head === CONTENTS_PREFIX) {
|
104729
|
-
output2.log(`Overwriting existing ${
|
104753
|
+
output2.log(`Overwriting existing ${import_chalk40.default.bold(filename)} file`);
|
104730
104754
|
} else if (exists && !skipConfirmation && !await confirm(
|
104731
104755
|
client2,
|
104732
104756
|
`Found existing file ${param(filename)}. Do you want to overwrite?`,
|
@@ -104735,14 +104759,19 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
104735
104759
|
output2.log("Canceled");
|
104736
104760
|
return 0;
|
104737
104761
|
}
|
104762
|
+
const projectSlugLink = formatProject(
|
104763
|
+
client2,
|
104764
|
+
link4.org.slug,
|
104765
|
+
link4.project.name
|
104766
|
+
);
|
104738
104767
|
output2.log(
|
104739
|
-
`Downloading \`${
|
104768
|
+
`Downloading \`${import_chalk40.default.cyan(
|
104740
104769
|
environment
|
104741
|
-
)}\` Environment Variables for
|
104770
|
+
)}\` Environment Variables for ${projectSlugLink}`
|
104742
104771
|
);
|
104743
104772
|
const pullStamp = stamp_default();
|
104744
104773
|
output2.spinner("Downloading");
|
104745
|
-
const records = (await pullEnvRecords(output2, client2, project.id, source, {
|
104774
|
+
const records = (await pullEnvRecords(output2, client2, link4.project.id, source, {
|
104746
104775
|
target: environment || "development",
|
104747
104776
|
gitBranch
|
104748
104777
|
})).env;
|
@@ -104769,7 +104798,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
104769
104798
|
}
|
104770
104799
|
output2.print(
|
104771
104800
|
`${prependEmoji(
|
104772
|
-
`${exists ? "Updated" : "Created"} ${
|
104801
|
+
`${exists ? "Updated" : "Created"} ${import_chalk40.default.bold(filename)} file ${isGitIgnoreUpdated ? "and added it to .gitignore" : ""} ${import_chalk40.default.gray(pullStamp())}`,
|
104773
104802
|
emoji("success")
|
104774
104803
|
)}
|
104775
104804
|
`
|
@@ -104779,11 +104808,11 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
104779
104808
|
function escapeValue(value) {
|
104780
104809
|
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
104781
104810
|
}
|
104782
|
-
var
|
104811
|
+
var import_chalk40, import_fs_extra10, import_fs5, import_path17, import_error_utils14, import_json_parse_better_errors2, CONTENTS_PREFIX, VARIABLES_TO_IGNORE;
|
104783
104812
|
var init_pull = __esm({
|
104784
104813
|
"src/commands/env/pull.ts"() {
|
104785
104814
|
"use strict";
|
104786
|
-
|
104815
|
+
import_chalk40 = __toESM3(require_source());
|
104787
104816
|
import_fs_extra10 = __toESM3(require_lib());
|
104788
104817
|
import_fs5 = require("fs");
|
104789
104818
|
import_path17 = require("path");
|
@@ -104797,6 +104826,7 @@ var init_pull = __esm({
|
|
104797
104826
|
import_error_utils14 = __toESM3(require_dist2());
|
104798
104827
|
init_add_to_gitignore();
|
104799
104828
|
import_json_parse_better_errors2 = __toESM3(require_json_parse_better_errors());
|
104829
|
+
init_format_project();
|
104800
104830
|
CONTENTS_PREFIX = "# Created by Vercel CLI\n";
|
104801
104831
|
VARIABLES_TO_IGNORE = [
|
104802
104832
|
"VERCEL_ANALYTICS_ID",
|
@@ -104854,7 +104884,7 @@ async function inputProject(client2, org, detectedProjectName, autoConfirm = fal
|
|
104854
104884
|
} else {
|
104855
104885
|
if (await confirm(
|
104856
104886
|
client2,
|
104857
|
-
`Found project ${
|
104887
|
+
`Found project ${import_chalk41.default.cyan(
|
104858
104888
|
`\u201C${org.slug}/${detectedProject.name}\u201D`
|
104859
104889
|
)}. Link to it?`,
|
104860
104890
|
true
|
@@ -104900,13 +104930,13 @@ async function inputProject(client2, org, detectedProjectName, autoConfirm = fal
|
|
104900
104930
|
}
|
104901
104931
|
});
|
104902
104932
|
}
|
104903
|
-
var
|
104933
|
+
var import_chalk41, import_slugify2;
|
104904
104934
|
var init_input_project = __esm({
|
104905
104935
|
"src/util/input/input-project.ts"() {
|
104906
104936
|
"use strict";
|
104907
104937
|
init_confirm();
|
104908
104938
|
init_get_project_by_id_or_name();
|
104909
|
-
|
104939
|
+
import_chalk41 = __toESM3(require_source());
|
104910
104940
|
init_errors_ts();
|
104911
104941
|
import_slugify2 = __toESM3(require_slugify());
|
104912
104942
|
}
|
@@ -104918,7 +104948,7 @@ async function validateRootDirectory(output2, cwd, path11, errorSuffix) {
|
|
104918
104948
|
const suffix = errorSuffix ? ` ${errorSuffix}` : "";
|
104919
104949
|
if (!pathStat) {
|
104920
104950
|
output2.error(
|
104921
|
-
`The provided path ${
|
104951
|
+
`The provided path ${import_chalk42.default.cyan(
|
104922
104952
|
`\u201C${humanizePath(path11)}\u201D`
|
104923
104953
|
)} does not exist.${suffix}`
|
104924
104954
|
);
|
@@ -104926,7 +104956,7 @@ async function validateRootDirectory(output2, cwd, path11, errorSuffix) {
|
|
104926
104956
|
}
|
104927
104957
|
if (!pathStat.isDirectory()) {
|
104928
104958
|
output2.error(
|
104929
|
-
`The provided path ${
|
104959
|
+
`The provided path ${import_chalk42.default.cyan(
|
104930
104960
|
`\u201C${humanizePath(path11)}\u201D`
|
104931
104961
|
)} is a file, but expected a directory.${suffix}`
|
104932
104962
|
);
|
@@ -104934,7 +104964,7 @@ async function validateRootDirectory(output2, cwd, path11, errorSuffix) {
|
|
104934
104964
|
}
|
104935
104965
|
if (!path11.startsWith(cwd)) {
|
104936
104966
|
output2.error(
|
104937
|
-
`The provided path ${
|
104967
|
+
`The provided path ${import_chalk42.default.cyan(
|
104938
104968
|
`\u201C${humanizePath(path11)}\u201D`
|
104939
104969
|
)} is outside of the project.${suffix}`
|
104940
104970
|
);
|
@@ -104951,7 +104981,7 @@ async function validatePaths(client2, paths) {
|
|
104951
104981
|
const path11 = paths[0];
|
104952
104982
|
const pathStat = await (0, import_fs_extra11.lstat)(path11).catch(() => null);
|
104953
104983
|
if (!pathStat) {
|
104954
|
-
output2.error(`Could not find ${
|
104984
|
+
output2.error(`Could not find ${import_chalk42.default.cyan(`\u201C${humanizePath(path11)}\u201D`)}`);
|
104955
104985
|
return { valid: false, exitCode: 1 };
|
104956
104986
|
}
|
104957
104987
|
if (!pathStat.isDirectory()) {
|
@@ -104975,12 +105005,12 @@ async function validatePaths(client2, paths) {
|
|
104975
105005
|
}
|
104976
105006
|
return { valid: true, path: path11 };
|
104977
105007
|
}
|
104978
|
-
var import_fs_extra11,
|
105008
|
+
var import_fs_extra11, import_chalk42, import_os7;
|
104979
105009
|
var init_validate_paths = __esm({
|
104980
105010
|
"src/util/validate-paths.ts"() {
|
104981
105011
|
"use strict";
|
104982
105012
|
import_fs_extra11 = __toESM3(require_lib());
|
104983
|
-
|
105013
|
+
import_chalk42 = __toESM3(require_source());
|
104984
105014
|
import_os7 = require("os");
|
104985
105015
|
init_confirm();
|
104986
105016
|
init_humanize_path();
|
@@ -104996,7 +105026,7 @@ async function inputRootDirectory(client2, cwd, autoConfirm = false) {
|
|
104996
105026
|
const rootDirectory = await client2.input.text({
|
104997
105027
|
message: `In which directory is your code located?`,
|
104998
105028
|
transformer: (input) => {
|
104999
|
-
return `${
|
105029
|
+
return `${import_chalk43.default.dim(`./`)}${input}`;
|
105000
105030
|
}
|
105001
105031
|
});
|
105002
105032
|
if (!rootDirectory) {
|
@@ -105018,12 +105048,12 @@ async function inputRootDirectory(client2, cwd, autoConfirm = false) {
|
|
105018
105048
|
return normal;
|
105019
105049
|
}
|
105020
105050
|
}
|
105021
|
-
var import_path18,
|
105051
|
+
var import_path18, import_chalk43;
|
105022
105052
|
var init_input_root_directory = __esm({
|
105023
105053
|
"src/util/input/input-root-directory.ts"() {
|
105024
105054
|
"use strict";
|
105025
105055
|
import_path18 = __toESM3(require("path"));
|
105026
|
-
|
105056
|
+
import_chalk43 = __toESM3(require_source());
|
105027
105057
|
init_validate_paths();
|
105028
105058
|
}
|
105029
105059
|
});
|
@@ -105063,8 +105093,8 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
105063
105093
|
const override = localConfigurationOverrides[setting];
|
105064
105094
|
if (override) {
|
105065
105095
|
output2.print(
|
105066
|
-
`${
|
105067
|
-
`- ${
|
105096
|
+
`${import_chalk44.default.dim(
|
105097
|
+
`- ${import_chalk44.default.bold(`${settingMap[setting]}:`)} ${override}`
|
105068
105098
|
)}
|
105069
105099
|
`
|
105070
105100
|
);
|
@@ -105089,7 +105119,7 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
105089
105119
|
}
|
105090
105120
|
output2.print(
|
105091
105121
|
!framework.slug ? `No framework detected. Default Project Settings:
|
105092
|
-
` : `Auto-detected Project Settings (${
|
105122
|
+
` : `Auto-detected Project Settings (${import_chalk44.default.bold(framework.name)}):
|
105093
105123
|
`
|
105094
105124
|
);
|
105095
105125
|
settings.framework = framework.slug;
|
@@ -105101,8 +105131,8 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
105101
105131
|
const override = localConfigurationOverrides?.[setting];
|
105102
105132
|
if (!override && defaultSetting) {
|
105103
105133
|
output2.print(
|
105104
|
-
`${
|
105105
|
-
`- ${
|
105134
|
+
`${import_chalk44.default.dim(
|
105135
|
+
`- ${import_chalk44.default.bold(`${settingMap[setting]}:`)} ${isSettingValue(defaultSetting) ? defaultSetting.value : import_chalk44.default.italic(`${defaultSetting.placeholder}`)}`
|
105106
105136
|
)}
|
105107
105137
|
`
|
105108
105138
|
);
|
@@ -105127,17 +105157,17 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
105127
105157
|
for (let setting of settingFields) {
|
105128
105158
|
const field = settingMap[setting];
|
105129
105159
|
settings[setting] = await client2.input.text({
|
105130
|
-
message: `What's your ${
|
105160
|
+
message: `What's your ${import_chalk44.default.bold(field)}?`
|
105131
105161
|
});
|
105132
105162
|
}
|
105133
105163
|
return settings;
|
105134
105164
|
}
|
105135
|
-
var
|
105165
|
+
var import_chalk44, import_frameworks2, settingMap, settingKeys;
|
105136
105166
|
var init_edit_project_settings = __esm({
|
105137
105167
|
"src/util/input/edit-project-settings.ts"() {
|
105138
105168
|
"use strict";
|
105139
105169
|
init_confirm();
|
105140
|
-
|
105170
|
+
import_chalk44 = __toESM3(require_source());
|
105141
105171
|
import_frameworks2 = __toESM3(require_frameworks());
|
105142
105172
|
init_is_setting_value();
|
105143
105173
|
settingMap = {
|
@@ -108050,7 +108080,7 @@ async function displayRuntimeLogs(client2, options, abortController) {
|
|
108050
108080
|
const timeout = setTimeout(() => {
|
108051
108081
|
abortController.abort();
|
108052
108082
|
warn(
|
108053
|
-
`${
|
108083
|
+
`${import_chalk45.default.bold(
|
108054
108084
|
`Command automatically interrupted after ${CommandTimeout}.`
|
108055
108085
|
)}
|
108056
108086
|
`
|
@@ -108092,7 +108122,7 @@ async function displayRuntimeLogs(client2, options, abortController) {
|
|
108092
108122
|
stopSpinner();
|
108093
108123
|
if (isRuntimeLimitDelimiter(log3)) {
|
108094
108124
|
abortController.abort();
|
108095
|
-
warn(`${
|
108125
|
+
warn(`${import_chalk45.default.bold(log3.message)}
|
108096
108126
|
`);
|
108097
108127
|
return;
|
108098
108128
|
}
|
@@ -108128,8 +108158,8 @@ function printBuildLog(log2, print) {
|
|
108128
108158
|
if (!log2.created)
|
108129
108159
|
return;
|
108130
108160
|
const date = new Date(log2.created).toISOString();
|
108131
|
-
for (const line of colorize(sanitize(log2)).split("\n")) {
|
108132
|
-
print(`${
|
108161
|
+
for (const line of colorize(sanitize(log2), log2).split("\n")) {
|
108162
|
+
print(`${import_chalk45.default.dim(date)} ${line.replace("[now-builder-debug] ", "")}
|
108133
108163
|
`);
|
108134
108164
|
}
|
108135
108165
|
}
|
@@ -108154,9 +108184,9 @@ function prettyPrintLogline({
|
|
108154
108184
|
const date = (0, import_date_fns.format)(timestampInMs, dateTimeFormat);
|
108155
108185
|
const levelIcon = getLevelIcon(level);
|
108156
108186
|
const sourceIcon = getSourceIcon(source);
|
108157
|
-
const detailsLine = `${
|
108187
|
+
const detailsLine = `${import_chalk45.default.dim(date)} ${levelIcon} ${import_chalk45.default.bold(
|
108158
108188
|
method
|
108159
|
-
)} ${
|
108189
|
+
)} ${import_chalk45.default.grey(status <= 0 ? "---" : status)} ${import_chalk45.default.dim(
|
108160
108190
|
domain
|
108161
108191
|
)} ${sourceIcon} ${path11}`;
|
108162
108192
|
print(
|
@@ -108195,27 +108225,19 @@ function getSourceIcon(source) {
|
|
108195
108225
|
function sanitize(log2) {
|
108196
108226
|
return (log2.text || "").replace(/\n$/, "").replace(/^\n/, "").replace(/\x1b\[1000D/g, "").replace(/\x1b\[0K/g, "").replace(/\x1b\[1A/g, "");
|
108197
108227
|
}
|
108198
|
-
function colorize(text2) {
|
108199
|
-
if (
|
108200
|
-
return
|
108228
|
+
function colorize(text2, log2) {
|
108229
|
+
if (log2.level === "error") {
|
108230
|
+
return import_chalk45.default.red(text2);
|
108231
|
+
} else if (log2.level === "warning") {
|
108232
|
+
return import_chalk45.default.yellow(text2);
|
108201
108233
|
}
|
108202
|
-
return
|
108203
|
-
}
|
108204
|
-
function isError7(text2) {
|
108205
|
-
return /^(\s+⨯\s+|\s+at\s+|npm err!)/i.test(text2) || /(^| |\[|eval|internal|range|reference|syntax|type|uri|fetch)err(or)?( |:)/i.test(
|
108206
|
-
text2
|
108207
|
-
) || /(command not found|module not found|failed to compile|cannot open shared object file|err_pnpm_|please contact vercel.com\/help|exit code 1|elifecycle|exited)/i.test(
|
108208
|
-
text2
|
108209
|
-
);
|
108210
|
-
}
|
108211
|
-
function isWarning(text2) {
|
108212
|
-
return /^warn(ing)?(:|!)/i.test(text2) && !text2.includes("deprecationwarning");
|
108234
|
+
return text2;
|
108213
108235
|
}
|
108214
|
-
var
|
108236
|
+
var import_chalk45, import_date_fns, import_ms7, import_jsonlines2, import_split2, import_url13, runtimeLogSpinnerMessage, dateTimeFormat, moreSymbol, statusWidth;
|
108215
108237
|
var init_logs = __esm({
|
108216
108238
|
"src/util/logs.ts"() {
|
108217
108239
|
"use strict";
|
108218
|
-
|
108240
|
+
import_chalk45 = __toESM3(require_source());
|
108219
108241
|
import_date_fns = __toESM3(require_date_fns());
|
108220
108242
|
import_ms7 = __toESM3(require_ms2());
|
108221
108243
|
import_jsonlines2 = __toESM3(require_jsonlines());
|
@@ -108253,7 +108275,7 @@ function printInspectUrl(output2, inspectorUrl, deployStamp) {
|
|
108253
108275
|
}
|
108254
108276
|
output2.print(
|
108255
108277
|
prependEmoji(
|
108256
|
-
`Inspect: ${
|
108278
|
+
`Inspect: ${import_chalk46.default.bold(inspectorUrl)} ${deployStamp()}`,
|
108257
108279
|
emoji("inspect")
|
108258
108280
|
) + `
|
108259
108281
|
`
|
@@ -108294,7 +108316,7 @@ async function processDeployment({
|
|
108294
108316
|
teamId: org.type === "team" ? org.id : void 0,
|
108295
108317
|
apiUrl: now._apiUrl,
|
108296
108318
|
token,
|
108297
|
-
debug:
|
108319
|
+
debug: client2.output.isDebugEnabled(),
|
108298
108320
|
userAgent: ua_default,
|
108299
108321
|
path: path11,
|
108300
108322
|
force,
|
@@ -108306,7 +108328,7 @@ async function processDeployment({
|
|
108306
108328
|
archive,
|
108307
108329
|
agent
|
108308
108330
|
};
|
108309
|
-
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${
|
108331
|
+
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${import_chalk46.default.bold(`${org.slug}/${projectName}`)}`;
|
108310
108332
|
output2.spinner(deployingSpinnerVal, 0);
|
108311
108333
|
const indications = [];
|
108312
108334
|
let abortController;
|
@@ -108341,7 +108363,7 @@ async function processDeployment({
|
|
108341
108363
|
const percent = uploadedBytes / missingSize;
|
108342
108364
|
if (percent >= nextStep) {
|
108343
108365
|
output2.spinner(
|
108344
|
-
`Uploading ${
|
108366
|
+
`Uploading ${import_chalk46.default.reset(
|
108345
108367
|
`[${bar}] (${uploadedHuman}/${totalSizeHuman})`
|
108346
108368
|
)}`,
|
108347
108369
|
0
|
@@ -108379,7 +108401,7 @@ async function processDeployment({
|
|
108379
108401
|
const previewUrl = `https://${deployment.url}`;
|
108380
108402
|
output2.print(
|
108381
108403
|
prependEmoji(
|
108382
|
-
`${isProdDeployment ? "Production" : "Preview"}: ${
|
108404
|
+
`${isProdDeployment ? "Production" : "Preview"}: ${import_chalk46.default.bold(
|
108383
108405
|
previewUrl
|
108384
108406
|
)} ${deployStamp()}`,
|
108385
108407
|
emoji("success")
|
@@ -108449,13 +108471,13 @@ async function processDeployment({
|
|
108449
108471
|
throw err;
|
108450
108472
|
}
|
108451
108473
|
}
|
108452
|
-
var import_client3, import_bytes3,
|
108474
|
+
var import_client3, import_bytes3, import_chalk46;
|
108453
108475
|
var init_process_deployment = __esm({
|
108454
108476
|
"src/util/deploy/process-deployment.ts"() {
|
108455
108477
|
"use strict";
|
108456
108478
|
import_client3 = __toESM3(require_dist12());
|
108457
108479
|
import_bytes3 = __toESM3(require_bytes());
|
108458
|
-
|
108480
|
+
import_chalk46 = __toESM3(require_source());
|
108459
108481
|
init_emoji();
|
108460
108482
|
init_logs();
|
108461
108483
|
init_progress();
|
@@ -108465,18 +108487,17 @@ var init_process_deployment = __esm({
|
|
108465
108487
|
});
|
108466
108488
|
|
108467
108489
|
// src/util/index.ts
|
108468
|
-
var
|
108490
|
+
var import_querystring3, import_url14, import_async_retry5, import_ms8, import_node_fetch3, import_bytes4, import_chalk47, Now;
|
108469
108491
|
var init_util = __esm({
|
108470
108492
|
"src/util/index.ts"() {
|
108471
108493
|
"use strict";
|
108472
|
-
import_events3 = __toESM3(require("events"));
|
108473
108494
|
import_querystring3 = __toESM3(require("querystring"));
|
108474
108495
|
import_url14 = require("url");
|
108475
108496
|
import_async_retry5 = __toESM3(require_dist10());
|
108476
108497
|
import_ms8 = __toESM3(require_ms2());
|
108477
108498
|
import_node_fetch3 = __toESM3(require_lib7());
|
108478
108499
|
import_bytes4 = __toESM3(require_bytes());
|
108479
|
-
|
108500
|
+
import_chalk47 = __toESM3(require_source());
|
108480
108501
|
init_ua();
|
108481
108502
|
init_process_deployment();
|
108482
108503
|
init_highlight();
|
@@ -108485,7 +108506,7 @@ var init_util = __esm({
|
|
108485
108506
|
init_errors_ts();
|
108486
108507
|
init_print_indications();
|
108487
108508
|
init_client();
|
108488
|
-
Now = class
|
108509
|
+
Now = class {
|
108489
108510
|
constructor({
|
108490
108511
|
client: client2,
|
108491
108512
|
url: url3 = null,
|
@@ -108493,7 +108514,6 @@ var init_util = __esm({
|
|
108493
108514
|
forceNew = false,
|
108494
108515
|
withCache = false
|
108495
108516
|
}) {
|
108496
|
-
super();
|
108497
108517
|
this.url = url3;
|
108498
108518
|
this._client = client2;
|
108499
108519
|
this._forceNew = forceNew;
|
@@ -108507,12 +108527,6 @@ var init_util = __esm({
|
|
108507
108527
|
get _token() {
|
108508
108528
|
return this._client.authConfig.token;
|
108509
108529
|
}
|
108510
|
-
get _output() {
|
108511
|
-
return this._client.output;
|
108512
|
-
}
|
108513
|
-
get _debug() {
|
108514
|
-
return this._client.output.isDebugEnabled();
|
108515
|
-
}
|
108516
108530
|
async create(path11, {
|
108517
108531
|
// Legacy
|
108518
108532
|
nowConfig = {},
|
@@ -108582,7 +108596,7 @@ var init_util = __esm({
|
|
108582
108596
|
});
|
108583
108597
|
if (deployment && deployment.warnings) {
|
108584
108598
|
let sizeExceeded = 0;
|
108585
|
-
const { log: log2, warn } = this.
|
108599
|
+
const { log: log2, warn } = this._client.output;
|
108586
108600
|
deployment.warnings.forEach((warning) => {
|
108587
108601
|
if (warning.reason === "size_limit_exceeded") {
|
108588
108602
|
const { sha, limit } = warning;
|
@@ -108597,7 +108611,7 @@ var init_util = __esm({
|
|
108597
108611
|
if (sizeExceeded > 0) {
|
108598
108612
|
warn(`${sizeExceeded} of the files exceeded the limit for your plan.`);
|
108599
108613
|
log2(
|
108600
|
-
`Please upgrade your plan here: ${
|
108614
|
+
`Please upgrade your plan here: ${import_chalk47.default.cyan(
|
108601
108615
|
"https://vercel.com/account/plan"
|
108602
108616
|
)}`
|
108603
108617
|
);
|
@@ -108673,54 +108687,6 @@ var init_util = __esm({
|
|
108673
108687
|
}
|
108674
108688
|
return new Error(error3.message || error3.errorMessage);
|
108675
108689
|
}
|
108676
|
-
async findDeployment(hostOrId) {
|
108677
|
-
const { debug: debug3 } = this._output;
|
108678
|
-
let id = hostOrId && !hostOrId.includes(".");
|
108679
|
-
if (!id) {
|
108680
|
-
let host = hostOrId.replace(/^https:\/\//i, "");
|
108681
|
-
if (host.slice(-1) === "/") {
|
108682
|
-
host = host.slice(0, -1);
|
108683
|
-
}
|
108684
|
-
const url3 = `/v10/now/deployments/get?url=${encodeURIComponent(
|
108685
|
-
host
|
108686
|
-
)}&resolve=1&noState=1`;
|
108687
|
-
const deployment = await this.retry(
|
108688
|
-
async (bail) => {
|
108689
|
-
const res = await this._fetch(url3);
|
108690
|
-
if (res.status >= 400 && res.status < 500) {
|
108691
|
-
debug3(`Bailing on getting a deployment due to ${res.status}`);
|
108692
|
-
return bail(
|
108693
|
-
await responseError2(res, `Failed to resolve deployment "${id}"`)
|
108694
|
-
);
|
108695
|
-
}
|
108696
|
-
if (res.status !== 200) {
|
108697
|
-
throw new Error("Fetching a deployment failed");
|
108698
|
-
}
|
108699
|
-
return res.json();
|
108700
|
-
},
|
108701
|
-
{ retries: 3, minTimeout: 2500, onRetry: this._onRetry }
|
108702
|
-
);
|
108703
|
-
id = deployment.id;
|
108704
|
-
}
|
108705
|
-
return this.retry(
|
108706
|
-
async (bail) => {
|
108707
|
-
const res = await this._fetch(
|
108708
|
-
`/v11/now/deployments/${encodeURIComponent(id)}`
|
108709
|
-
);
|
108710
|
-
if (res.status >= 400 && res.status < 500) {
|
108711
|
-
debug3(`Bailing on getting a deployment due to ${res.status}`);
|
108712
|
-
return bail(
|
108713
|
-
await responseError2(res, `Failed to resolve deployment "${id}"`)
|
108714
|
-
);
|
108715
|
-
}
|
108716
|
-
if (res.status !== 200) {
|
108717
|
-
throw new Error("Fetching a deployment failed");
|
108718
|
-
}
|
108719
|
-
return res.json();
|
108720
|
-
},
|
108721
|
-
{ retries: 3, minTimeout: 2500, onRetry: this._onRetry }
|
108722
|
-
);
|
108723
|
-
}
|
108724
108690
|
async remove(deploymentId, { hard = false }) {
|
108725
108691
|
const url3 = `/now/deployments/${deploymentId}?hard=${hard ? 1 : 0}`;
|
108726
108692
|
await this.retry(async (bail) => {
|
@@ -108744,10 +108710,8 @@ var init_util = __esm({
|
|
108744
108710
|
});
|
108745
108711
|
}
|
108746
108712
|
_onRetry(err) {
|
108747
|
-
this.
|
108713
|
+
this._client.output.debug(`Retrying: ${err}
|
108748
108714
|
${err.stack}`);
|
108749
|
-
}
|
108750
|
-
close() {
|
108751
108715
|
}
|
108752
108716
|
async _fetch(_url, opts = {}) {
|
108753
108717
|
if (opts.useCurrentTeam !== false && this.currentTeam) {
|
@@ -108770,7 +108734,7 @@ ${err.stack}`);
|
|
108770
108734
|
} else {
|
108771
108735
|
body = opts.body;
|
108772
108736
|
}
|
108773
|
-
const res = await this.
|
108737
|
+
const res = await this._client.output.time(
|
108774
108738
|
`${opts.method || "GET"} ${this._apiUrl}${_url} ${opts.body || ""}`,
|
108775
108739
|
(0, import_node_fetch3.default)(`${this._apiUrl}${_url}`, { ...opts, body })
|
108776
108740
|
);
|
@@ -108853,7 +108817,7 @@ async function setupAndLink(client2, path11, {
|
|
108853
108817
|
}
|
108854
108818
|
const shouldStartSetup = autoConfirm || await confirm(
|
108855
108819
|
client2,
|
108856
|
-
`${setupMsg} ${
|
108820
|
+
`${setupMsg} ${import_chalk48.default.cyan(`\u201C${humanizePath(path11)}\u201D`)}?`,
|
108857
108821
|
true
|
108858
108822
|
);
|
108859
108823
|
if (!shouldStartSetup) {
|
@@ -109003,12 +108967,12 @@ async function setupAndLink(client2, path11, {
|
|
109003
108967
|
return { status: "error", exitCode: 1 };
|
109004
108968
|
}
|
109005
108969
|
}
|
109006
|
-
var import_path19,
|
108970
|
+
var import_path19, import_chalk48, import_fs_extra12;
|
109007
108971
|
var init_setup_and_link = __esm({
|
109008
108972
|
"src/util/link/setup-and-link.ts"() {
|
109009
108973
|
"use strict";
|
109010
108974
|
import_path19 = require("path");
|
109011
|
-
|
108975
|
+
import_chalk48 = __toESM3(require_source());
|
109012
108976
|
import_fs_extra12 = __toESM3(require_lib());
|
109013
108977
|
init_link2();
|
109014
108978
|
init_create_project();
|
@@ -109170,11 +109134,9 @@ async function pullAllEnvFiles(environment, client2, link4, project, flags, cwd)
|
|
109170
109134
|
return pull(
|
109171
109135
|
client2,
|
109172
109136
|
link4,
|
109173
|
-
project,
|
109174
109137
|
environment,
|
109175
109138
|
flags,
|
109176
109139
|
[(0, import_path20.join)(".vercel", environmentFile)],
|
109177
|
-
client2.output,
|
109178
109140
|
cwd,
|
109179
109141
|
"vercel-cli:pull"
|
109180
109142
|
);
|
@@ -109235,20 +109197,20 @@ async function main(client2) {
|
|
109235
109197
|
const settingsStamp = stamp_default();
|
109236
109198
|
client2.output.print(
|
109237
109199
|
`${prependEmoji(
|
109238
|
-
`Downloaded project settings to ${
|
109200
|
+
`Downloaded project settings to ${import_chalk49.default.bold(
|
109239
109201
|
humanizePath((0, import_path20.join)(cwd, VERCEL_DIR2, VERCEL_DIR_PROJECT))
|
109240
|
-
)} ${
|
109202
|
+
)} ${import_chalk49.default.gray(settingsStamp())}`,
|
109241
109203
|
emoji("success")
|
109242
109204
|
)}
|
109243
109205
|
`
|
109244
109206
|
);
|
109245
109207
|
return 0;
|
109246
109208
|
}
|
109247
|
-
var
|
109209
|
+
var import_chalk49, import_path20;
|
109248
109210
|
var init_pull2 = __esm({
|
109249
109211
|
"src/commands/pull/index.ts"() {
|
109250
109212
|
"use strict";
|
109251
|
-
|
109213
|
+
import_chalk49 = __toESM3(require_source());
|
109252
109214
|
import_path20 = require("path");
|
109253
109215
|
init_emoji();
|
109254
109216
|
init_get_args();
|
@@ -117496,15 +117458,15 @@ var require_fd_slicer = __commonJS2({
|
|
117496
117458
|
var Writable = stream.Writable;
|
117497
117459
|
var PassThrough = stream.PassThrough;
|
117498
117460
|
var Pend = require_pend();
|
117499
|
-
var
|
117461
|
+
var EventEmitter2 = require("events").EventEmitter;
|
117500
117462
|
exports2.createFromBuffer = createFromBuffer;
|
117501
117463
|
exports2.createFromFd = createFromFd;
|
117502
117464
|
exports2.BufferSlicer = BufferSlicer;
|
117503
117465
|
exports2.FdSlicer = FdSlicer;
|
117504
|
-
util.inherits(FdSlicer,
|
117466
|
+
util.inherits(FdSlicer, EventEmitter2);
|
117505
117467
|
function FdSlicer(fd, options) {
|
117506
117468
|
options = options || {};
|
117507
|
-
|
117469
|
+
EventEmitter2.call(this);
|
117508
117470
|
this.fd = fd;
|
117509
117471
|
this.pend = new Pend();
|
117510
117472
|
this.pend.max = 1;
|
@@ -117656,9 +117618,9 @@ var require_fd_slicer = __commonJS2({
|
|
117656
117618
|
this.destroyed = true;
|
117657
117619
|
this.context.unref();
|
117658
117620
|
};
|
117659
|
-
util.inherits(BufferSlicer,
|
117621
|
+
util.inherits(BufferSlicer, EventEmitter2);
|
117660
117622
|
function BufferSlicer(buffer, options) {
|
117661
|
-
|
117623
|
+
EventEmitter2.call(this);
|
117662
117624
|
options = options || {};
|
117663
117625
|
this.refCount = 0;
|
117664
117626
|
this.buffer = buffer;
|
@@ -118069,7 +118031,7 @@ var require_yauzl = __commonJS2({
|
|
118069
118031
|
var fd_slicer = require_fd_slicer();
|
118070
118032
|
var crc32 = require_buffer_crc32();
|
118071
118033
|
var util = require("util");
|
118072
|
-
var
|
118034
|
+
var EventEmitter2 = require("events").EventEmitter;
|
118073
118035
|
var Transform = require("stream").Transform;
|
118074
118036
|
var PassThrough = require("stream").PassThrough;
|
118075
118037
|
var Writable = require("stream").Writable;
|
@@ -118235,10 +118197,10 @@ var require_yauzl = __commonJS2({
|
|
118235
118197
|
callback(new Error("end of central directory record signature not found"));
|
118236
118198
|
});
|
118237
118199
|
}
|
118238
|
-
util.inherits(ZipFile2,
|
118200
|
+
util.inherits(ZipFile2, EventEmitter2);
|
118239
118201
|
function ZipFile2(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
118240
118202
|
var self2 = this;
|
118241
|
-
|
118203
|
+
EventEmitter2.call(self2);
|
118242
118204
|
self2.reader = reader;
|
118243
118205
|
self2.reader.on("error", function(err) {
|
118244
118206
|
emitError(self2, err);
|
@@ -118630,9 +118592,9 @@ var require_yauzl = __commonJS2({
|
|
118630
118592
|
}
|
118631
118593
|
cb();
|
118632
118594
|
};
|
118633
|
-
util.inherits(RandomAccessReader,
|
118595
|
+
util.inherits(RandomAccessReader, EventEmitter2);
|
118634
118596
|
function RandomAccessReader() {
|
118635
|
-
|
118597
|
+
EventEmitter2.call(this);
|
118636
118598
|
this.refCount = 0;
|
118637
118599
|
}
|
118638
118600
|
RandomAccessReader.prototype.ref = function() {
|
@@ -118783,7 +118745,7 @@ var require_events_intercept = __commonJS2({
|
|
118783
118745
|
if (typeof this._maxInterceptors !== "undefined") {
|
118784
118746
|
m = this._maxInterceptors;
|
118785
118747
|
} else {
|
118786
|
-
m =
|
118748
|
+
m = EventEmitter2.defaultMaxInterceptors;
|
118787
118749
|
}
|
118788
118750
|
if (m && m > 0 && this._interceptors[type].length > m) {
|
118789
118751
|
this._interceptors[type].warned = true;
|
@@ -118911,19 +118873,19 @@ var require_events_intercept = __commonJS2({
|
|
118911
118873
|
}
|
118912
118874
|
return this;
|
118913
118875
|
}
|
118914
|
-
function
|
118876
|
+
function EventEmitter2() {
|
118915
118877
|
events.EventEmitter.call(this);
|
118916
118878
|
fixListeners(this);
|
118917
118879
|
}
|
118918
|
-
util.inherits(
|
118919
|
-
|
118920
|
-
|
118921
|
-
|
118922
|
-
|
118923
|
-
|
118924
|
-
|
118925
|
-
|
118926
|
-
|
118880
|
+
util.inherits(EventEmitter2, events.EventEmitter);
|
118881
|
+
EventEmitter2.prototype.intercept = intercept;
|
118882
|
+
EventEmitter2.prototype.emit = emitFactory(EventEmitter2.super_.prototype.emit);
|
118883
|
+
EventEmitter2.prototype.interceptors = interceptors;
|
118884
|
+
EventEmitter2.prototype.removeInterceptor = removeInterceptor;
|
118885
|
+
EventEmitter2.prototype.removeAllInterceptors = removeAllInterceptors;
|
118886
|
+
EventEmitter2.prototype.setMaxInterceptors = setMaxInterceptors;
|
118887
|
+
EventEmitter2.prototype.listeners = listenersFactory(EventEmitter2.super_.prototype.listeners);
|
118888
|
+
EventEmitter2.defaultMaxInterceptors = 10;
|
118927
118889
|
function monkeyPatch(emitter) {
|
118928
118890
|
var oldEmit = emitter.emit;
|
118929
118891
|
var oldListeners = emitter.listeners;
|
@@ -118937,7 +118899,7 @@ var require_events_intercept = __commonJS2({
|
|
118937
118899
|
fixListeners(emitter);
|
118938
118900
|
}
|
118939
118901
|
module2.exports = {
|
118940
|
-
EventEmitter:
|
118902
|
+
EventEmitter: EventEmitter2,
|
118941
118903
|
patch: monkeyPatch
|
118942
118904
|
};
|
118943
118905
|
})();
|
@@ -121752,9 +121714,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
121752
121714
|
const relOutputDir = (0, import_path28.relative)(cwd, outputDir);
|
121753
121715
|
output2.print(
|
121754
121716
|
`${prependEmoji(
|
121755
|
-
`Build Completed in ${
|
121717
|
+
`Build Completed in ${import_chalk50.default.bold(
|
121756
121718
|
relOutputDir.startsWith("..") ? outputDir : relOutputDir
|
121757
|
-
)} ${
|
121719
|
+
)} ${import_chalk50.default.gray(buildStamp())}`,
|
121758
121720
|
emoji("success")
|
121759
121721
|
)}
|
121760
121722
|
`
|
@@ -121887,12 +121849,12 @@ async function getFrameworkRoutes(framework, dirPrefix) {
|
|
121887
121849
|
}
|
121888
121850
|
return routes2;
|
121889
121851
|
}
|
121890
|
-
var import_fs_extra18,
|
121852
|
+
var import_fs_extra18, import_chalk50, import_dotenv, import_semver3, import_minimatch2, import_path28, import_frameworks4, import_build_utils12, import_fs_detectors4, import_routing_utils2, import_client8;
|
121891
121853
|
var init_build = __esm({
|
121892
121854
|
"src/commands/build/index.ts"() {
|
121893
121855
|
"use strict";
|
121894
121856
|
import_fs_extra18 = __toESM3(require_lib());
|
121895
|
-
|
121857
|
+
import_chalk50 = __toESM3(require_source());
|
121896
121858
|
import_dotenv = __toESM3(require_main3());
|
121897
121859
|
import_semver3 = __toESM3(require_semver());
|
121898
121860
|
import_minimatch2 = __toESM3(require_minimatch2());
|
@@ -121989,7 +121951,7 @@ async function add(client2, opts, args2) {
|
|
121989
121951
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
121990
121952
|
);
|
121991
121953
|
output2.print(
|
121992
|
-
` ${
|
121954
|
+
` ${import_chalk51.default.cyan(
|
121993
121955
|
`${getCommandName(
|
121994
121956
|
"certs add --crt <domain.crt> --key <domain.key> --ca <ca.crt>"
|
121995
121957
|
)}`
|
@@ -122001,9 +121963,9 @@ async function add(client2, opts, args2) {
|
|
122001
121963
|
cert = await createCertFromFile(client2, keyPath, crtPath, caPath);
|
122002
121964
|
} else {
|
122003
121965
|
output2.warn(
|
122004
|
-
`${
|
121966
|
+
`${import_chalk51.default.cyan(
|
122005
121967
|
getCommandName("certs add")
|
122006
|
-
)} will be soon deprecated. Please use ${
|
121968
|
+
)} will be soon deprecated. Please use ${import_chalk51.default.cyan(
|
122007
121969
|
getCommandName("certs issue <cn> <cns>")
|
122008
121970
|
)} instead`
|
122009
121971
|
);
|
@@ -122012,7 +121974,7 @@ async function add(client2, opts, args2) {
|
|
122012
121974
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
122013
121975
|
);
|
122014
121976
|
output2.print(
|
122015
|
-
` ${
|
121977
|
+
` ${import_chalk51.default.cyan(getCommandName("certs add <cn>[, <cn>]"))}
|
122016
121978
|
`
|
122017
121979
|
);
|
122018
121980
|
return 1;
|
@@ -122022,7 +121984,7 @@ async function add(client2, opts, args2) {
|
|
122022
121984
|
[]
|
122023
121985
|
);
|
122024
121986
|
output2.spinner(
|
122025
|
-
`Generating a certificate for ${
|
121987
|
+
`Generating a certificate for ${import_chalk51.default.bold(cns.join(", "))}`
|
122026
121988
|
);
|
122027
121989
|
cert = await createCertForCns(client2, cns, contextName);
|
122028
121990
|
output2.stopSpinner();
|
@@ -122032,18 +121994,18 @@ async function add(client2, opts, args2) {
|
|
122032
121994
|
return 1;
|
122033
121995
|
} else {
|
122034
121996
|
output2.success(
|
122035
|
-
`Certificate entry for ${
|
121997
|
+
`Certificate entry for ${import_chalk51.default.bold(
|
122036
121998
|
cert.cns.join(", ")
|
122037
121999
|
)} created ${addStamp()}`
|
122038
122000
|
);
|
122039
122001
|
}
|
122040
122002
|
return 0;
|
122041
122003
|
}
|
122042
|
-
var
|
122004
|
+
var import_chalk51, add_default;
|
122043
122005
|
var init_add = __esm({
|
122044
122006
|
"src/commands/certs/add.ts"() {
|
122045
122007
|
"use strict";
|
122046
|
-
|
122008
|
+
import_chalk51 = __toESM3(require_source());
|
122047
122009
|
init_get_scope();
|
122048
122010
|
init_stamp();
|
122049
122011
|
init_create_cert_from_file();
|
@@ -122056,7 +122018,7 @@ var init_add = __esm({
|
|
122056
122018
|
// src/util/certs/finish-cert-order.ts
|
122057
122019
|
async function startCertOrder(client2, cns, context) {
|
122058
122020
|
client2.output.spinner(
|
122059
|
-
`Issuing a certificate for ${
|
122021
|
+
`Issuing a certificate for ${import_chalk52.default.bold(cns.join(", "))}`
|
122060
122022
|
);
|
122061
122023
|
try {
|
122062
122024
|
const cert = await client2.fetch("/v3/now/certs", {
|
@@ -122080,11 +122042,11 @@ async function startCertOrder(client2, cns, context) {
|
|
122080
122042
|
throw err;
|
122081
122043
|
}
|
122082
122044
|
}
|
122083
|
-
var
|
122045
|
+
var import_chalk52;
|
122084
122046
|
var init_finish_cert_order = __esm({
|
122085
122047
|
"src/util/certs/finish-cert-order.ts"() {
|
122086
122048
|
"use strict";
|
122087
|
-
|
122049
|
+
import_chalk52 = __toESM3(require_source());
|
122088
122050
|
init_errors_ts();
|
122089
122051
|
init_map_cert_error();
|
122090
122052
|
}
|
@@ -122103,9 +122065,9 @@ var init_get_cns_from_args = __esm({
|
|
122103
122065
|
// src/util/certs/start-cert-order.ts
|
122104
122066
|
async function startCertOrder2(client2, cns, contextName) {
|
122105
122067
|
client2.output.spinner(
|
122106
|
-
`Starting certificate issuance for ${
|
122068
|
+
`Starting certificate issuance for ${import_chalk53.default.bold(
|
122107
122069
|
cns.join(", ")
|
122108
|
-
)} under ${
|
122070
|
+
)} under ${import_chalk53.default.bold(contextName)}`
|
122109
122071
|
);
|
122110
122072
|
const order = await client2.fetch("/v3/now/certs", {
|
122111
122073
|
method: "PATCH",
|
@@ -122116,11 +122078,11 @@ async function startCertOrder2(client2, cns, contextName) {
|
|
122116
122078
|
});
|
122117
122079
|
return order;
|
122118
122080
|
}
|
122119
|
-
var
|
122081
|
+
var import_chalk53;
|
122120
122082
|
var init_start_cert_order = __esm({
|
122121
122083
|
"src/util/certs/start-cert-order.ts"() {
|
122122
122084
|
"use strict";
|
122123
|
-
|
122085
|
+
import_chalk53 = __toESM3(require_source());
|
122124
122086
|
}
|
122125
122087
|
});
|
122126
122088
|
|
@@ -122147,7 +122109,7 @@ async function issue(client2, opts, args2) {
|
|
122147
122109
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
122148
122110
|
);
|
122149
122111
|
output2.print(
|
122150
|
-
` ${
|
122112
|
+
` ${import_chalk54.default.cyan(
|
122151
122113
|
getCommandName(
|
122152
122114
|
"certs issue --crt <domain.crt> --key <domain.key> --ca <ca.crt>"
|
122153
122115
|
)
|
@@ -122162,7 +122124,7 @@ async function issue(client2, opts, args2) {
|
|
122162
122124
|
return 1;
|
122163
122125
|
}
|
122164
122126
|
output2.success(
|
122165
|
-
`Certificate entry for ${
|
122127
|
+
`Certificate entry for ${import_chalk54.default.bold(
|
122166
122128
|
cert.cns.join(", ")
|
122167
122129
|
)} created ${addStamp()}`
|
122168
122130
|
);
|
@@ -122173,7 +122135,7 @@ async function issue(client2, opts, args2) {
|
|
122173
122135
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
122174
122136
|
);
|
122175
122137
|
output2.print(
|
122176
|
-
` ${
|
122138
|
+
` ${import_chalk54.default.cyan(getCommandName("certs issue <cn>[, <cn>]"))}
|
122177
122139
|
`
|
122178
122140
|
);
|
122179
122141
|
return 1;
|
@@ -122199,14 +122161,14 @@ async function issue(client2, opts, args2) {
|
|
122199
122161
|
}
|
122200
122162
|
if (handledResult instanceof DomainPermissionDenied) {
|
122201
122163
|
output2.error(
|
122202
|
-
`You do not have permissions over domain ${
|
122164
|
+
`You do not have permissions over domain ${import_chalk54.default.underline(
|
122203
122165
|
handledResult.meta.domain
|
122204
|
-
)} under ${
|
122166
|
+
)} under ${import_chalk54.default.bold(handledResult.meta.context)}.`
|
122205
122167
|
);
|
122206
122168
|
return 1;
|
122207
122169
|
}
|
122208
122170
|
output2.success(
|
122209
|
-
`Certificate entry for ${
|
122171
|
+
`Certificate entry for ${import_chalk54.default.bold(
|
122210
122172
|
handledResult.cns.join(", ")
|
122211
122173
|
)} created ${addStamp()}`
|
122212
122174
|
);
|
@@ -122228,7 +122190,7 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
122228
122190
|
}
|
122229
122191
|
if (pendingChallenges.length === 0) {
|
122230
122192
|
output2.log(
|
122231
|
-
`A certificate issuance for ${
|
122193
|
+
`A certificate issuance for ${import_chalk54.default.bold(
|
122232
122194
|
cns.join(", ")
|
122233
122195
|
)} has been started ${stamp()}`
|
122234
122196
|
);
|
@@ -122237,13 +122199,13 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
122237
122199
|
`
|
122238
122200
|
);
|
122239
122201
|
output2.print(
|
122240
|
-
` ${
|
122202
|
+
` ${import_chalk54.default.cyan(getCommandName(`certs issue ${cns.join(" ")}`))}
|
122241
122203
|
`
|
122242
122204
|
);
|
122243
122205
|
return 0;
|
122244
122206
|
}
|
122245
122207
|
output2.log(
|
122246
|
-
`A certificate issuance for ${
|
122208
|
+
`A certificate issuance for ${import_chalk54.default.bold(
|
122247
122209
|
cns.join(", ")
|
122248
122210
|
)} has been started ${stamp()}`
|
122249
122211
|
);
|
@@ -122272,7 +122234,7 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
122272
122234
|
`);
|
122273
122235
|
output2.log(`To issue the certificate once the records are added, run:`);
|
122274
122236
|
output2.print(
|
122275
|
-
` ${
|
122237
|
+
` ${import_chalk54.default.cyan(getCommandName(`certs issue ${cns.join(" ")}`))}
|
122276
122238
|
`
|
122277
122239
|
);
|
122278
122240
|
output2.print(
|
@@ -122280,12 +122242,12 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
122280
122242
|
);
|
122281
122243
|
return 0;
|
122282
122244
|
}
|
122283
|
-
var import_psl5,
|
122245
|
+
var import_psl5, import_chalk54;
|
122284
122246
|
var init_issue = __esm({
|
122285
122247
|
"src/commands/certs/issue.ts"() {
|
122286
122248
|
"use strict";
|
122287
122249
|
import_psl5 = __toESM3(require_psl());
|
122288
|
-
|
122250
|
+
import_chalk54 = __toESM3(require_source());
|
122289
122251
|
init_errors_ts();
|
122290
122252
|
init_create_cert_for_cns();
|
122291
122253
|
init_create_cert_from_file();
|
@@ -122328,7 +122290,7 @@ async function ls2(client2, opts, args2) {
|
|
122328
122290
|
const lsStamp = stamp_default();
|
122329
122291
|
if (args2.length !== 0) {
|
122330
122292
|
output2.error(
|
122331
|
-
`Invalid number of arguments. Usage: ${
|
122293
|
+
`Invalid number of arguments. Usage: ${import_chalk55.default.cyan(
|
122332
122294
|
`${getCommandName("certs ls")}`
|
122333
122295
|
)}`
|
122334
122296
|
);
|
@@ -122336,7 +122298,7 @@ async function ls2(client2, opts, args2) {
|
|
122336
122298
|
}
|
122337
122299
|
const { certs, pagination } = await getCerts(client2, ...paginationOptions);
|
122338
122300
|
output2.log(
|
122339
|
-
`${certs.length > 0 ? "Certificates" : "No certificates"} found under ${
|
122301
|
+
`${certs.length > 0 ? "Certificates" : "No certificates"} found under ${import_chalk55.default.bold(contextName)} ${lsStamp()}`
|
122340
122302
|
);
|
122341
122303
|
if (certs.length > 0) {
|
122342
122304
|
client2.stdout.write(formatCertsTable(certs));
|
@@ -122360,11 +122322,11 @@ function formatCertsTable(certsList) {
|
|
122360
122322
|
}
|
122361
122323
|
function formatCertsTableHead() {
|
122362
122324
|
return [
|
122363
|
-
|
122364
|
-
|
122365
|
-
|
122366
|
-
|
122367
|
-
|
122325
|
+
import_chalk55.default.dim("id"),
|
122326
|
+
import_chalk55.default.dim("cns"),
|
122327
|
+
import_chalk55.default.dim("expiration"),
|
122328
|
+
import_chalk55.default.dim("renew"),
|
122329
|
+
import_chalk55.default.dim("age")
|
122368
122330
|
];
|
122369
122331
|
}
|
122370
122332
|
function formatCertsTableBody(certsList) {
|
@@ -122383,7 +122345,7 @@ function formatCertNonFirstCn(cn, multiple) {
|
|
122383
122345
|
return ["", formatCertCn(cn, multiple), "", "", ""];
|
122384
122346
|
}
|
122385
122347
|
function formatCertCn(cn, multiple) {
|
122386
|
-
return multiple ? `${
|
122348
|
+
return multiple ? `${import_chalk55.default.gray("-")} ${import_chalk55.default.bold(cn)}` : import_chalk55.default.bold(cn);
|
122387
122349
|
}
|
122388
122350
|
function formatCertFirstCn(time, cert, cn, multiple) {
|
122389
122351
|
return [
|
@@ -122391,18 +122353,18 @@ function formatCertFirstCn(time, cert, cn, multiple) {
|
|
122391
122353
|
formatCertCn(cn, multiple),
|
122392
122354
|
formatExpirationDate(new Date(cert.expiration)),
|
122393
122355
|
cert.autoRenew ? "yes" : "no",
|
122394
|
-
|
122356
|
+
import_chalk55.default.gray((0, import_ms9.default)(time.getTime() - new Date(cert.created).getTime()))
|
122395
122357
|
];
|
122396
122358
|
}
|
122397
122359
|
function formatExpirationDate(date) {
|
122398
122360
|
const diff = date.getTime() - Date.now();
|
122399
|
-
return diff < 0 ?
|
122361
|
+
return diff < 0 ? import_chalk55.default.gray(`${(0, import_ms9.default)(-diff)} ago`) : import_chalk55.default.gray(`in ${(0, import_ms9.default)(diff)}`);
|
122400
122362
|
}
|
122401
|
-
var
|
122363
|
+
var import_chalk55, import_ms9, ls_default;
|
122402
122364
|
var init_ls2 = __esm({
|
122403
122365
|
"src/commands/certs/ls.ts"() {
|
122404
122366
|
"use strict";
|
122405
|
-
|
122367
|
+
import_chalk55 = __toESM3(require_source());
|
122406
122368
|
import_ms9 = __toESM3(require_ms2());
|
122407
122369
|
init_table();
|
122408
122370
|
init_get_scope();
|
@@ -122475,7 +122437,7 @@ async function rm2(client2, opts, args2) {
|
|
122475
122437
|
const { contextName } = await getScope(client2);
|
122476
122438
|
if (args2.length !== 1) {
|
122477
122439
|
output2.error(
|
122478
|
-
`Invalid number of arguments. Usage: ${
|
122440
|
+
`Invalid number of arguments. Usage: ${import_chalk56.default.cyan(
|
122479
122441
|
`${getCommandName("certs rm <id or cn>")}`
|
122480
122442
|
)}`
|
122481
122443
|
);
|
@@ -122492,13 +122454,13 @@ async function rm2(client2, opts, args2) {
|
|
122492
122454
|
if (certs.length === 0) {
|
122493
122455
|
if (id.includes(".")) {
|
122494
122456
|
output2.error(
|
122495
|
-
`No custom certificates found for "${id}" under ${
|
122457
|
+
`No custom certificates found for "${id}" under ${import_chalk56.default.bold(
|
122496
122458
|
contextName
|
122497
122459
|
)}`
|
122498
122460
|
);
|
122499
122461
|
} else {
|
122500
122462
|
output2.error(
|
122501
|
-
`No certificates found by id "${id}" under ${
|
122463
|
+
`No certificates found by id "${id}" under ${import_chalk56.default.bold(contextName)}`
|
122502
122464
|
);
|
122503
122465
|
}
|
122504
122466
|
return 1;
|
@@ -122515,7 +122477,7 @@ async function rm2(client2, opts, args2) {
|
|
122515
122477
|
certs.map((cert) => deleteCertById(output2, client2, cert.uid))
|
122516
122478
|
);
|
122517
122479
|
output2.success(
|
122518
|
-
`${
|
122480
|
+
`${import_chalk56.default.bold(
|
122519
122481
|
(0, import_pluralize5.default)("Certificate", certs.length, true)
|
122520
122482
|
)} removed ${rmStamp()}`
|
122521
122483
|
);
|
@@ -122543,7 +122505,7 @@ function readConfirmation(output2, msg, certs) {
|
|
122543
122505
|
`
|
122544
122506
|
);
|
122545
122507
|
output2.print(
|
122546
|
-
`${
|
122508
|
+
`${import_chalk56.default.bold.red("> Are you sure?")} ${import_chalk56.default.gray("(y/N) ")}`
|
122547
122509
|
);
|
122548
122510
|
process.stdin.on("data", (d) => {
|
122549
122511
|
process.stdin.pause();
|
@@ -122554,15 +122516,15 @@ function readConfirmation(output2, msg, certs) {
|
|
122554
122516
|
function formatCertRow(cert) {
|
122555
122517
|
return [
|
122556
122518
|
cert.uid,
|
122557
|
-
|
122558
|
-
...cert.created ? [
|
122519
|
+
import_chalk56.default.bold(cert.cns ? cert.cns.join(", ") : "\u2013"),
|
122520
|
+
...cert.created ? [import_chalk56.default.gray(`${(0, import_ms10.default)(Date.now() - new Date(cert.created).getTime())} ago`)] : []
|
122559
122521
|
];
|
122560
122522
|
}
|
122561
|
-
var
|
122523
|
+
var import_chalk56, import_ms10, import_pluralize5, rm_default;
|
122562
122524
|
var init_rm2 = __esm({
|
122563
122525
|
"src/commands/certs/rm.ts"() {
|
122564
122526
|
"use strict";
|
122565
|
-
|
122527
|
+
import_chalk56 = __toESM3(require_source());
|
122566
122528
|
import_ms10 = __toESM3(require_ms2());
|
122567
122529
|
import_pluralize5 = __toESM3(require_pluralize());
|
122568
122530
|
init_table();
|
@@ -122844,21 +122806,21 @@ async function printDeploymentStatus(client2, {
|
|
122844
122806
|
}
|
122845
122807
|
const newline = "\n";
|
122846
122808
|
for (let indication of indications) {
|
122847
|
-
const message2 = prependEmoji(
|
122809
|
+
const message2 = prependEmoji(import_chalk57.default.dim(indication.payload), emoji(indication.type)) + newline;
|
122848
122810
|
let link4 = "";
|
122849
122811
|
if (indication.link)
|
122850
|
-
link4 =
|
122812
|
+
link4 = import_chalk57.default.dim(
|
122851
122813
|
`${indication.action || "Learn More"}: ${link_default(indication.link)}`
|
122852
122814
|
) + newline;
|
122853
122815
|
output2.print(message2 + link4);
|
122854
122816
|
}
|
122855
122817
|
return 0;
|
122856
122818
|
}
|
122857
|
-
var
|
122819
|
+
var import_chalk57;
|
122858
122820
|
var init_print_deployment_status = __esm({
|
122859
122821
|
"src/util/deploy/print-deployment-status.ts"() {
|
122860
122822
|
"use strict";
|
122861
|
-
|
122823
|
+
import_chalk57 = __toESM3(require_source());
|
122862
122824
|
init_is_deploying();
|
122863
122825
|
init_link();
|
122864
122826
|
init_emoji();
|
@@ -123097,7 +123059,7 @@ function handleCreateDeployError(output2, error3, localConfig) {
|
|
123097
123059
|
}
|
123098
123060
|
if (error3 instanceof DomainVerificationFailed) {
|
123099
123061
|
output2.error(
|
123100
|
-
`The domain used as a suffix ${
|
123062
|
+
`The domain used as a suffix ${import_chalk58.default.underline(
|
123101
123063
|
error3.meta.domain
|
123102
123064
|
)} is not verified and can't be used as custom suffix.`
|
123103
123065
|
);
|
@@ -123105,7 +123067,7 @@ function handleCreateDeployError(output2, error3, localConfig) {
|
|
123105
123067
|
}
|
123106
123068
|
if (error3 instanceof DomainPermissionDenied) {
|
123107
123069
|
output2.error(
|
123108
|
-
`You don't have permissions to access the domain used as a suffix ${
|
123070
|
+
`You don't have permissions to access the domain used as a suffix ${import_chalk58.default.underline(
|
123109
123071
|
error3.meta.domain
|
123110
123072
|
)}.`
|
123111
123073
|
);
|
@@ -123131,7 +123093,7 @@ function handleCreateDeployError(output2, error3, localConfig) {
|
|
123131
123093
|
}
|
123132
123094
|
if (error3 instanceof DomainNotVerified) {
|
123133
123095
|
output2.error(
|
123134
|
-
`The domain used as an alias ${
|
123096
|
+
`The domain used as an alias ${import_chalk58.default.underline(
|
123135
123097
|
error3.meta.domain
|
123136
123098
|
)} is not verified yet. Please verify it.`
|
123137
123099
|
);
|
@@ -123150,7 +123112,7 @@ function handleCreateDeployError(output2, error3, localConfig) {
|
|
123150
123112
|
}
|
123151
123113
|
return error3;
|
123152
123114
|
}
|
123153
|
-
var import_build_utils13, import_client10, import_error_utils18, import_bytes5,
|
123115
|
+
var import_build_utils13, import_client10, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms11, import_path32, deploy_default, addProcessEnv;
|
123154
123116
|
var init_deploy = __esm({
|
123155
123117
|
"src/commands/deploy/index.ts"() {
|
123156
123118
|
"use strict";
|
@@ -123158,7 +123120,7 @@ var init_deploy = __esm({
|
|
123158
123120
|
import_client10 = __toESM3(require_dist12());
|
123159
123121
|
import_error_utils18 = __toESM3(require_dist2());
|
123160
123122
|
import_bytes5 = __toESM3(require_bytes());
|
123161
|
-
|
123123
|
+
import_chalk58 = __toESM3(require_source());
|
123162
123124
|
import_fs_extra20 = __toESM3(require_lib());
|
123163
123125
|
import_ms11 = __toESM3(require_ms2());
|
123164
123126
|
import_path32 = require("path");
|
@@ -123298,7 +123260,7 @@ var init_deploy = __esm({
|
|
123298
123260
|
if (status === "not_linked") {
|
123299
123261
|
const shouldStartSetup = autoConfirm || await confirm(
|
123300
123262
|
client2,
|
123301
|
-
`Set up and deploy ${
|
123263
|
+
`Set up and deploy ${import_chalk58.default.cyan(`\u201C${humanizePath(cwd)}\u201D`)}?`,
|
123302
123264
|
true
|
123303
123265
|
);
|
123304
123266
|
if (!shouldStartSetup) {
|
@@ -123708,16 +123670,16 @@ ${err.stack}`);
|
|
123708
123670
|
val = process.env[key];
|
123709
123671
|
if (typeof val === "string") {
|
123710
123672
|
log2(
|
123711
|
-
`Reading ${
|
123712
|
-
`"${
|
123673
|
+
`Reading ${import_chalk58.default.bold(
|
123674
|
+
`"${import_chalk58.default.bold(key)}"`
|
123713
123675
|
)} from your env (as no value was specified)`
|
123714
123676
|
);
|
123715
123677
|
env[key] = val.replace(/^@/, "\\@");
|
123716
123678
|
} else {
|
123717
123679
|
throw new Error(
|
123718
|
-
`No value specified for env ${
|
123719
|
-
`"${
|
123720
|
-
)} and it was not found in your env
|
123680
|
+
`No value specified for env variable ${import_chalk58.default.bold(
|
123681
|
+
`"${import_chalk58.default.bold(key)}"`
|
123682
|
+
)} and it was not found in your env. If you meant to specify an environment to deploy to, use ${param("--target")}`
|
123721
123683
|
);
|
123722
123684
|
}
|
123723
123685
|
}
|
@@ -123896,7 +123858,7 @@ var require_event_listener_count = __commonJS2({
|
|
123896
123858
|
var require_compat = __commonJS2({
|
123897
123859
|
"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/index.js"(exports2, module2) {
|
123898
123860
|
"use strict";
|
123899
|
-
var
|
123861
|
+
var EventEmitter2 = require("events").EventEmitter;
|
123900
123862
|
lazyProperty(module2.exports, "callSiteToString", function callSiteToString2() {
|
123901
123863
|
var limit = Error.stackTraceLimit;
|
123902
123864
|
var obj = {};
|
@@ -123913,7 +123875,7 @@ var require_compat = __commonJS2({
|
|
123913
123875
|
return stack2[0].toString ? toString2 : require_callsite_tostring();
|
123914
123876
|
});
|
123915
123877
|
lazyProperty(module2.exports, "eventListenerCount", function eventListenerCount2() {
|
123916
|
-
return
|
123878
|
+
return EventEmitter2.listenerCount || require_event_listener_count();
|
123917
123879
|
});
|
123918
123880
|
function lazyProperty(obj, prop, getter) {
|
123919
123881
|
function get() {
|
@@ -128252,11 +128214,11 @@ var require_eventemitter3 = __commonJS2({
|
|
128252
128214
|
else
|
128253
128215
|
delete emitter._events[evt];
|
128254
128216
|
}
|
128255
|
-
function
|
128217
|
+
function EventEmitter2() {
|
128256
128218
|
this._events = new Events();
|
128257
128219
|
this._eventsCount = 0;
|
128258
128220
|
}
|
128259
|
-
|
128221
|
+
EventEmitter2.prototype.eventNames = function eventNames() {
|
128260
128222
|
var names = [], events, name;
|
128261
128223
|
if (this._eventsCount === 0)
|
128262
128224
|
return names;
|
@@ -128269,7 +128231,7 @@ var require_eventemitter3 = __commonJS2({
|
|
128269
128231
|
}
|
128270
128232
|
return names;
|
128271
128233
|
};
|
128272
|
-
|
128234
|
+
EventEmitter2.prototype.listeners = function listeners(event) {
|
128273
128235
|
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
128274
128236
|
if (!handlers)
|
128275
128237
|
return [];
|
@@ -128280,7 +128242,7 @@ var require_eventemitter3 = __commonJS2({
|
|
128280
128242
|
}
|
128281
128243
|
return ee;
|
128282
128244
|
};
|
128283
|
-
|
128245
|
+
EventEmitter2.prototype.listenerCount = function listenerCount(event) {
|
128284
128246
|
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
|
128285
128247
|
if (!listeners)
|
128286
128248
|
return 0;
|
@@ -128288,7 +128250,7 @@ var require_eventemitter3 = __commonJS2({
|
|
128288
128250
|
return 1;
|
128289
128251
|
return listeners.length;
|
128290
128252
|
};
|
128291
|
-
|
128253
|
+
EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
128292
128254
|
var evt = prefix ? prefix + event : event;
|
128293
128255
|
if (!this._events[evt])
|
128294
128256
|
return false;
|
@@ -128343,13 +128305,13 @@ var require_eventemitter3 = __commonJS2({
|
|
128343
128305
|
}
|
128344
128306
|
return true;
|
128345
128307
|
};
|
128346
|
-
|
128308
|
+
EventEmitter2.prototype.on = function on(event, fn2, context) {
|
128347
128309
|
return addListener(this, event, fn2, context, false);
|
128348
128310
|
};
|
128349
|
-
|
128311
|
+
EventEmitter2.prototype.once = function once2(event, fn2, context) {
|
128350
128312
|
return addListener(this, event, fn2, context, true);
|
128351
128313
|
};
|
128352
|
-
|
128314
|
+
EventEmitter2.prototype.removeListener = function removeListener(event, fn2, context, once2) {
|
128353
128315
|
var evt = prefix ? prefix + event : event;
|
128354
128316
|
if (!this._events[evt])
|
128355
128317
|
return this;
|
@@ -128375,7 +128337,7 @@ var require_eventemitter3 = __commonJS2({
|
|
128375
128337
|
}
|
128376
128338
|
return this;
|
128377
128339
|
};
|
128378
|
-
|
128340
|
+
EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
|
128379
128341
|
var evt;
|
128380
128342
|
if (event) {
|
128381
128343
|
evt = prefix ? prefix + event : event;
|
@@ -128387,12 +128349,12 @@ var require_eventemitter3 = __commonJS2({
|
|
128387
128349
|
}
|
128388
128350
|
return this;
|
128389
128351
|
};
|
128390
|
-
|
128391
|
-
|
128392
|
-
|
128393
|
-
|
128352
|
+
EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
|
128353
|
+
EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
|
128354
|
+
EventEmitter2.prefixed = prefix;
|
128355
|
+
EventEmitter2.EventEmitter = EventEmitter2;
|
128394
128356
|
if ("undefined" !== typeof module2) {
|
128395
|
-
module2.exports =
|
128357
|
+
module2.exports = EventEmitter2;
|
128396
128358
|
}
|
128397
128359
|
}
|
128398
128360
|
});
|
@@ -140836,14 +140798,14 @@ function buildMatchEquals(a, b) {
|
|
140836
140798
|
return false;
|
140837
140799
|
return true;
|
140838
140800
|
}
|
140839
|
-
var import_url18, import_http3, import_fs_extra21,
|
140801
|
+
var import_url18, import_http3, import_fs_extra21, import_chalk59, import_node_fetch5, import_pluralize7, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy, import_crypto2, import_serve_handler, import_chokidar, import_dotenv2, import_path36, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client11, import_routing_utils5, import_build_utils16, import_fs_detectors6, import_frameworks5, import_error_utils19, frontendRuntimeSet, DevServer;
|
140840
140802
|
var init_server = __esm({
|
140841
140803
|
"src/util/dev/server.ts"() {
|
140842
140804
|
"use strict";
|
140843
140805
|
import_url18 = __toESM3(require("url"));
|
140844
140806
|
import_http3 = __toESM3(require("http"));
|
140845
140807
|
import_fs_extra21 = __toESM3(require_lib());
|
140846
|
-
|
140808
|
+
import_chalk59 = __toESM3(require_source());
|
140847
140809
|
import_node_fetch5 = __toESM3(require_lib7());
|
140848
140810
|
import_pluralize7 = __toESM3(require_pluralize());
|
140849
140811
|
import_raw_body = __toESM3(require_raw_body());
|
@@ -140919,7 +140881,7 @@ var init_server = __esm({
|
|
140919
140881
|
return;
|
140920
140882
|
}
|
140921
140883
|
const method = req.method || "GET";
|
140922
|
-
this.output.debug(`${
|
140884
|
+
this.output.debug(`${import_chalk59.default.bold(method)} ${req.url}`);
|
140923
140885
|
try {
|
140924
140886
|
const vercelConfig = await this.getVercelConfig();
|
140925
140887
|
await this.serveProjectAsNowV2(req, res, requestId, vercelConfig);
|
@@ -141121,7 +141083,7 @@ var init_server = __esm({
|
|
141121
141083
|
}
|
141122
141084
|
} catch (err) {
|
141123
141085
|
if ((0, import_error_utils19.isSpawnError)(err) && err.code === "ENOENT") {
|
141124
|
-
err.message = `Command not found: ${
|
141086
|
+
err.message = `Command not found: ${import_chalk59.default.cyan(
|
141125
141087
|
err.path,
|
141126
141088
|
...err.spawnargs
|
141127
141089
|
)}
|
@@ -141378,7 +141340,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
141378
141340
|
});
|
141379
141341
|
} catch (err) {
|
141380
141342
|
if ((0, import_error_utils19.isSpawnError)(err) && err.code === "ENOENT") {
|
141381
|
-
err.message = `Command not found: ${
|
141343
|
+
err.message = `Command not found: ${import_chalk59.default.cyan(
|
141382
141344
|
err.path,
|
141383
141345
|
...err.spawnargs
|
141384
141346
|
)}
|
@@ -142077,10 +142039,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
142077
142039
|
*/
|
142078
142040
|
async _start(...listenSpec) {
|
142079
142041
|
if (!import_fs_extra21.default.existsSync(this.cwd)) {
|
142080
|
-
throw new Error(`${
|
142042
|
+
throw new Error(`${import_chalk59.default.bold(this.cwd)} doesn't exist`);
|
142081
142043
|
}
|
142082
142044
|
if (!import_fs_extra21.default.lstatSync(this.cwd).isDirectory()) {
|
142083
|
-
throw new Error(`${
|
142045
|
+
throw new Error(`${import_chalk59.default.bold(this.cwd)} is not a directory`);
|
142084
142046
|
}
|
142085
142047
|
const { ig } = await (0, import_client11.getVercelIgnore)(this.cwd);
|
142086
142048
|
this.filter = ig.createFilter();
|
@@ -142094,14 +142056,14 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
142094
142056
|
if (err.code === "EADDRINUSE") {
|
142095
142057
|
if (typeof listenSpec[0] === "number") {
|
142096
142058
|
this.output.note(
|
142097
|
-
`Requested port ${
|
142059
|
+
`Requested port ${import_chalk59.default.yellow(
|
142098
142060
|
String(listenSpec[0])
|
142099
142061
|
)} is already in use`
|
142100
142062
|
);
|
142101
142063
|
listenSpec[0]++;
|
142102
142064
|
} else {
|
142103
142065
|
this.output.error(
|
142104
|
-
`Requested socket ${
|
142066
|
+
`Requested socket ${import_chalk59.default.cyan(
|
142105
142067
|
listenSpec[0]
|
142106
142068
|
)} is already in use`
|
142107
142069
|
);
|
@@ -142494,7 +142456,7 @@ ${error_code}
|
|
142494
142456
|
await treeKill(this.devProcess.pid);
|
142495
142457
|
}
|
142496
142458
|
this.output.log(
|
142497
|
-
`Running Dev Command ${
|
142459
|
+
`Running Dev Command ${import_chalk59.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`
|
142498
142460
|
);
|
142499
142461
|
const port = await (0, import_get_port.default)();
|
142500
142462
|
const env = (0, import_build_utils16.cloneEnv)(
|
@@ -142793,17 +142755,17 @@ async function main4(client2) {
|
|
142793
142755
|
function stringifyError(err) {
|
142794
142756
|
if (err instanceof NowError) {
|
142795
142757
|
const errMeta = JSON.stringify(err.meta, null, 2).replace(/\\n/g, "\n");
|
142796
|
-
return `${
|
142758
|
+
return `${import_chalk60.default.red(err.code)} ${err.message}
|
142797
142759
|
${errMeta}`;
|
142798
142760
|
}
|
142799
142761
|
return err.stack;
|
142800
142762
|
}
|
142801
|
-
var import_path39,
|
142763
|
+
var import_path39, import_chalk60, import_error_utils20, COMMAND_CONFIG3;
|
142802
142764
|
var init_dev2 = __esm({
|
142803
142765
|
"src/commands/dev/index.ts"() {
|
142804
142766
|
"use strict";
|
142805
142767
|
import_path39 = __toESM3(require("path"));
|
142806
|
-
|
142768
|
+
import_chalk60 = __toESM3(require_source());
|
142807
142769
|
init_get_args();
|
142808
142770
|
init_get_subcommand();
|
142809
142771
|
init_now_error();
|
@@ -142979,13 +142941,13 @@ function text({
|
|
142979
142941
|
stdout.write(label);
|
142980
142942
|
} else {
|
142981
142943
|
const _label = label.replace("-", "\u2716");
|
142982
|
-
stdout.write(
|
142944
|
+
stdout.write(import_chalk61.default.red(_label));
|
142983
142945
|
}
|
142984
142946
|
value = initialValue;
|
142985
142947
|
stdout.write(initialValue);
|
142986
142948
|
if (mask) {
|
142987
142949
|
if (!value) {
|
142988
|
-
value =
|
142950
|
+
value = import_chalk61.default.gray(placeholder);
|
142989
142951
|
caretOffset = 0 - (0, import_strip_ansi4.default)(value).length;
|
142990
142952
|
stdout.write(value);
|
142991
142953
|
stdout.write(import_ansi_escapes6.default.cursorBackward(Math.abs(caretOffset)));
|
@@ -143068,11 +143030,11 @@ function text({
|
|
143068
143030
|
} else {
|
143069
143031
|
if (mask === "cc" || mask === "ccv") {
|
143070
143032
|
value = formatCC(value);
|
143071
|
-
value = value.replace(regex,
|
143033
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
143072
143034
|
} else if (mask === "expDate") {
|
143073
|
-
value = value.replace(regex,
|
143035
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
143074
143036
|
}
|
143075
|
-
const l =
|
143037
|
+
const l = import_chalk61.default.red(label.replace("-", "\u2716"));
|
143076
143038
|
stdout.write(eraseLines(1));
|
143077
143039
|
stdout.write(l + value + import_ansi_escapes6.default.beep);
|
143078
143040
|
if (caretOffset) {
|
@@ -143112,7 +143074,7 @@ function text({
|
|
143112
143074
|
if (caretOffset === 0) {
|
143113
143075
|
const completion = await autoComplete(value);
|
143114
143076
|
if (completion) {
|
143115
|
-
suggestion =
|
143077
|
+
suggestion = import_chalk61.default.gray(completion);
|
143116
143078
|
suggestion += import_ansi_escapes6.default.cursorBackward(completion.length);
|
143117
143079
|
} else {
|
143118
143080
|
suggestion = "";
|
@@ -143124,9 +143086,9 @@ function text({
|
|
143124
143086
|
}
|
143125
143087
|
if (mask === "cc" || mask === "ccv") {
|
143126
143088
|
value = formatCC(value);
|
143127
|
-
value = value.replace(regex,
|
143089
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
143128
143090
|
} else if (mask === "expDate") {
|
143129
|
-
value = value.replace(regex,
|
143091
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
143130
143092
|
}
|
143131
143093
|
stdout.write(eraseLines(1));
|
143132
143094
|
stdout.write(label + value + suggestion);
|
@@ -143139,11 +143101,11 @@ function text({
|
|
143139
143101
|
}
|
143140
143102
|
});
|
143141
143103
|
}
|
143142
|
-
var
|
143104
|
+
var import_chalk61, import_ansi_escapes6, import_ansi_regex, import_strip_ansi4, ESCAPES, formatCC;
|
143143
143105
|
var init_text = __esm({
|
143144
143106
|
"src/util/input/text.ts"() {
|
143145
143107
|
"use strict";
|
143146
|
-
|
143108
|
+
import_chalk61 = __toESM3(require_source());
|
143147
143109
|
import_ansi_escapes6 = __toESM3(require_ansi_escapes());
|
143148
143110
|
import_ansi_regex = __toESM3(require_ansi_regex2());
|
143149
143111
|
import_strip_ansi4 = __toESM3(require_strip_ansi2());
|
@@ -143179,9 +143141,9 @@ async function getDNSData(client2, data) {
|
|
143179
143141
|
const port = await getNumber(`- ${type} port: `);
|
143180
143142
|
const target = await getTrimmedString(`- ${type} target: `);
|
143181
143143
|
output2.log(
|
143182
|
-
`${
|
143144
|
+
`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(
|
143183
143145
|
`${priority}`
|
143184
|
-
)} ${
|
143146
|
+
)} ${import_chalk62.default.cyan(`${weight}`)} ${import_chalk62.default.cyan(`${port}`)} ${import_chalk62.default.cyan(
|
143185
143147
|
target
|
143186
143148
|
)}.`
|
143187
143149
|
);
|
@@ -143200,9 +143162,9 @@ async function getDNSData(client2, data) {
|
|
143200
143162
|
const mxPriority = await getNumber(`- ${type} priority: `);
|
143201
143163
|
const value2 = await getTrimmedString(`- ${type} host: `);
|
143202
143164
|
output2.log(
|
143203
|
-
`${
|
143165
|
+
`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(
|
143204
143166
|
`${mxPriority}`
|
143205
|
-
)} ${
|
143167
|
+
)} ${import_chalk62.default.cyan(value2)}`
|
143206
143168
|
);
|
143207
143169
|
return await verifyData(client2) ? {
|
143208
143170
|
name,
|
@@ -143212,7 +143174,7 @@ async function getDNSData(client2, data) {
|
|
143212
143174
|
} : null;
|
143213
143175
|
}
|
143214
143176
|
const value = await getTrimmedString(`- ${type} value: `);
|
143215
|
-
output2.log(`${
|
143177
|
+
output2.log(`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(value)}`);
|
143216
143178
|
return await verifyData(client2) ? {
|
143217
143179
|
name,
|
143218
143180
|
type,
|
@@ -143246,11 +143208,11 @@ async function getTrimmedString(label) {
|
|
143246
143208
|
});
|
143247
143209
|
return res.trim();
|
143248
143210
|
}
|
143249
|
-
var
|
143211
|
+
var import_chalk62, RECORD_TYPES;
|
143250
143212
|
var init_get_dns_data = __esm({
|
143251
143213
|
"src/util/dns/get-dns-data.ts"() {
|
143252
143214
|
"use strict";
|
143253
|
-
|
143215
|
+
import_chalk62 = __toESM3(require_source());
|
143254
143216
|
init_text();
|
143255
143217
|
init_confirm();
|
143256
143218
|
RECORD_TYPES = ["A", "AAAA", "ALIAS", "CAA", "CNAME", "MX", "SRV", "TXT"];
|
@@ -143264,7 +143226,7 @@ async function add2(client2, opts, args2) {
|
|
143264
143226
|
const parsedParams = parseAddArgs(args2);
|
143265
143227
|
if (!parsedParams) {
|
143266
143228
|
output2.error(
|
143267
|
-
`Invalid number of arguments. See: ${
|
143229
|
+
`Invalid number of arguments. See: ${import_chalk63.default.cyan(
|
143268
143230
|
`${getCommandName("dns --help")}`
|
143269
143231
|
)} for usage.`
|
143270
143232
|
);
|
@@ -143280,23 +143242,23 @@ async function add2(client2, opts, args2) {
|
|
143280
143242
|
const record = await addDNSRecord(client2, domain, data);
|
143281
143243
|
if (record instanceof DomainNotFound) {
|
143282
143244
|
output2.error(
|
143283
|
-
`The domain ${domain} can't be found under ${
|
143245
|
+
`The domain ${domain} can't be found under ${import_chalk63.default.bold(
|
143284
143246
|
contextName
|
143285
|
-
)} ${
|
143247
|
+
)} ${import_chalk63.default.gray(addStamp())}`
|
143286
143248
|
);
|
143287
143249
|
return 1;
|
143288
143250
|
}
|
143289
143251
|
if (record instanceof DNSPermissionDenied) {
|
143290
143252
|
output2.error(
|
143291
|
-
`You don't have permissions to add records to domain ${domain} under ${
|
143253
|
+
`You don't have permissions to add records to domain ${domain} under ${import_chalk63.default.bold(
|
143292
143254
|
contextName
|
143293
|
-
)} ${
|
143255
|
+
)} ${import_chalk63.default.gray(addStamp())}`
|
143294
143256
|
);
|
143295
143257
|
return 1;
|
143296
143258
|
}
|
143297
143259
|
if (record instanceof DNSInvalidPort) {
|
143298
143260
|
output2.error(
|
143299
|
-
`Invalid <port> parameter. A number was expected ${
|
143261
|
+
`Invalid <port> parameter. A number was expected ${import_chalk63.default.gray(
|
143300
143262
|
addStamp()
|
143301
143263
|
)}`
|
143302
143264
|
);
|
@@ -143304,7 +143266,7 @@ async function add2(client2, opts, args2) {
|
|
143304
143266
|
}
|
143305
143267
|
if (record instanceof DNSInvalidType) {
|
143306
143268
|
output2.error(
|
143307
|
-
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${
|
143269
|
+
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${import_chalk63.default.gray(
|
143308
143270
|
addStamp()
|
143309
143271
|
)}`
|
143310
143272
|
);
|
@@ -143315,17 +143277,17 @@ async function add2(client2, opts, args2) {
|
|
143315
143277
|
return 1;
|
143316
143278
|
}
|
143317
143279
|
output2.success(
|
143318
|
-
`DNS record for domain ${
|
143280
|
+
`DNS record for domain ${import_chalk63.default.bold(domain)} ${import_chalk63.default.gray(
|
143319
143281
|
`(${record.uid})`
|
143320
|
-
)} created under ${
|
143282
|
+
)} created under ${import_chalk63.default.bold(contextName)} ${import_chalk63.default.gray(addStamp())}`
|
143321
143283
|
);
|
143322
143284
|
return 0;
|
143323
143285
|
}
|
143324
|
-
var
|
143286
|
+
var import_chalk63;
|
143325
143287
|
var init_add2 = __esm({
|
143326
143288
|
"src/commands/dns/add.ts"() {
|
143327
143289
|
"use strict";
|
143328
|
-
|
143290
|
+
import_chalk63 = __toESM3(require_source());
|
143329
143291
|
init_errors_ts();
|
143330
143292
|
init_add_dns_record();
|
143331
143293
|
init_get_scope();
|
@@ -143339,7 +143301,7 @@ var init_add2 = __esm({
|
|
143339
143301
|
// src/util/dns/import-zonefile.ts
|
143340
143302
|
async function importZonefile(client2, contextName, domain, zonefilePath) {
|
143341
143303
|
client2.output.spinner(
|
143342
|
-
`Importing Zone file for domain ${domain} under ${
|
143304
|
+
`Importing Zone file for domain ${domain} under ${import_chalk64.default.bold(contextName)}`
|
143343
143305
|
);
|
143344
143306
|
const zonefile = (0, import_fs7.readFileSync)((0, import_path40.resolve)(zonefilePath), "utf8");
|
143345
143307
|
try {
|
@@ -143366,11 +143328,11 @@ async function importZonefile(client2, contextName, domain, zonefilePath) {
|
|
143366
143328
|
throw err;
|
143367
143329
|
}
|
143368
143330
|
}
|
143369
|
-
var
|
143331
|
+
var import_chalk64, import_fs7, import_path40;
|
143370
143332
|
var init_import_zonefile = __esm({
|
143371
143333
|
"src/util/dns/import-zonefile.ts"() {
|
143372
143334
|
"use strict";
|
143373
|
-
|
143335
|
+
import_chalk64 = __toESM3(require_source());
|
143374
143336
|
import_fs7 = require("fs");
|
143375
143337
|
import_path40 = require("path");
|
143376
143338
|
init_errors_ts();
|
@@ -143383,7 +143345,7 @@ async function add3(client2, opts, args2) {
|
|
143383
143345
|
const { contextName } = await getScope(client2);
|
143384
143346
|
if (args2.length !== 2) {
|
143385
143347
|
output2.error(
|
143386
|
-
`Invalid number of arguments. Usage: ${
|
143348
|
+
`Invalid number of arguments. Usage: ${import_chalk65.default.cyan(
|
143387
143349
|
`${getCommandName("dns import <domain> <zonefile>")}`
|
143388
143350
|
)}`
|
143389
143351
|
);
|
@@ -143399,32 +143361,32 @@ async function add3(client2, opts, args2) {
|
|
143399
143361
|
);
|
143400
143362
|
if (recordIds instanceof DomainNotFound) {
|
143401
143363
|
output2.error(
|
143402
|
-
`The domain ${domain} can't be found under ${
|
143364
|
+
`The domain ${domain} can't be found under ${import_chalk65.default.bold(
|
143403
143365
|
contextName
|
143404
|
-
)} ${
|
143366
|
+
)} ${import_chalk65.default.gray(addStamp())}`
|
143405
143367
|
);
|
143406
143368
|
return 1;
|
143407
143369
|
}
|
143408
143370
|
if (recordIds instanceof InvalidDomain) {
|
143409
143371
|
output2.error(
|
143410
|
-
`The domain ${domain} doesn't match with the one found in the Zone file ${
|
143372
|
+
`The domain ${domain} doesn't match with the one found in the Zone file ${import_chalk65.default.gray(
|
143411
143373
|
addStamp()
|
143412
143374
|
)}`
|
143413
143375
|
);
|
143414
143376
|
return 1;
|
143415
143377
|
}
|
143416
143378
|
output2.success(
|
143417
|
-
`${recordIds.length} DNS records for domain ${
|
143379
|
+
`${recordIds.length} DNS records for domain ${import_chalk65.default.bold(
|
143418
143380
|
domain
|
143419
|
-
)} created under ${
|
143381
|
+
)} created under ${import_chalk65.default.bold(contextName)} ${import_chalk65.default.gray(addStamp())}`
|
143420
143382
|
);
|
143421
143383
|
return 0;
|
143422
143384
|
}
|
143423
|
-
var
|
143385
|
+
var import_chalk65;
|
143424
143386
|
var init_import = __esm({
|
143425
143387
|
"src/commands/dns/import.ts"() {
|
143426
143388
|
"use strict";
|
143427
|
-
|
143389
|
+
import_chalk65 = __toESM3(require_source());
|
143428
143390
|
init_get_scope();
|
143429
143391
|
init_errors_ts();
|
143430
143392
|
init_stamp();
|
@@ -143461,7 +143423,7 @@ function formatTable(header, align, blocks) {
|
|
143461
143423
|
out += `${block.name}
|
143462
143424
|
`;
|
143463
143425
|
}
|
143464
|
-
const rows = [header.map((s) =>
|
143426
|
+
const rows = [header.map((s) => import_chalk66.default.dim(s))].concat(block.rows);
|
143465
143427
|
if (rows.length > 0) {
|
143466
143428
|
rows[0][0] = ` ${rows[0][0]}`;
|
143467
143429
|
for (let i = 1; i < rows.length; i++) {
|
@@ -143481,11 +143443,11 @@ function formatTable(header, align, blocks) {
|
|
143481
143443
|
}
|
143482
143444
|
return out.slice(0, -1);
|
143483
143445
|
}
|
143484
|
-
var
|
143446
|
+
var import_chalk66;
|
143485
143447
|
var init_format_table = __esm({
|
143486
143448
|
"src/util/format-table.ts"() {
|
143487
143449
|
"use strict";
|
143488
|
-
|
143450
|
+
import_chalk66 = __toESM3(require_source());
|
143489
143451
|
init_table();
|
143490
143452
|
init_strlen();
|
143491
143453
|
}
|
@@ -143568,18 +143530,18 @@ function getAddDomainName(domainNames) {
|
|
143568
143530
|
];
|
143569
143531
|
}
|
143570
143532
|
async function getDomainNames(client2, contextName, next) {
|
143571
|
-
client2.output.spinner(`Fetching domains under ${
|
143533
|
+
client2.output.spinner(`Fetching domains under ${import_chalk67.default.bold(contextName)}`);
|
143572
143534
|
const { domains: domains2, pagination } = await getDomains(client2, next);
|
143573
143535
|
return { domainNames: domains2.map((domain) => domain.name), pagination };
|
143574
143536
|
}
|
143575
|
-
var
|
143537
|
+
var import_chalk67;
|
143576
143538
|
var init_get_dns_records = __esm({
|
143577
143539
|
"src/util/dns/get-dns-records.ts"() {
|
143578
143540
|
"use strict";
|
143579
143541
|
init_errors_ts();
|
143580
143542
|
init_get_domain_dns_records();
|
143581
143543
|
init_get_domains();
|
143582
|
-
|
143544
|
+
import_chalk67 = __toESM3(require_source());
|
143583
143545
|
}
|
143584
143546
|
});
|
143585
143547
|
|
@@ -143591,7 +143553,7 @@ async function ls3(client2, opts, args2) {
|
|
143591
143553
|
const lsStamp = stamp_default();
|
143592
143554
|
if (args2.length > 1) {
|
143593
143555
|
output2.error(
|
143594
|
-
`Invalid number of arguments. Usage: ${
|
143556
|
+
`Invalid number of arguments. Usage: ${import_chalk68.default.cyan(
|
143595
143557
|
`${getCommandName("dns ls [domain]")}`
|
143596
143558
|
)}`
|
143597
143559
|
);
|
@@ -143614,15 +143576,15 @@ async function ls3(client2, opts, args2) {
|
|
143614
143576
|
);
|
143615
143577
|
if (data instanceof DomainNotFound) {
|
143616
143578
|
output2.error(
|
143617
|
-
`The domain ${domainName} can't be found under ${
|
143579
|
+
`The domain ${domainName} can't be found under ${import_chalk68.default.bold(
|
143618
143580
|
contextName
|
143619
|
-
)} ${
|
143581
|
+
)} ${import_chalk68.default.gray(lsStamp())}`
|
143620
143582
|
);
|
143621
143583
|
return 1;
|
143622
143584
|
}
|
143623
143585
|
const { records, pagination: pagination2 } = data;
|
143624
143586
|
output2.log(
|
143625
|
-
`${records.length > 0 ? "Records" : "No records"} found under ${
|
143587
|
+
`${records.length > 0 ? "Records" : "No records"} found under ${import_chalk68.default.bold(contextName)} ${import_chalk68.default.gray(lsStamp())}`
|
143626
143588
|
);
|
143627
143589
|
client2.stdout.write(getDNSRecordsTable([{ domainName, records }]));
|
143628
143590
|
if (pagination2 && pagination2.count === 20) {
|
@@ -143643,9 +143605,9 @@ async function ls3(client2, opts, args2) {
|
|
143643
143605
|
);
|
143644
143606
|
const nRecords = dnsRecords.reduce((p, r) => r.records.length + p, 0);
|
143645
143607
|
output2.log(
|
143646
|
-
`${nRecords > 0 ? "Records" : "No records"} found under ${
|
143608
|
+
`${nRecords > 0 ? "Records" : "No records"} found under ${import_chalk68.default.bold(
|
143647
143609
|
contextName
|
143648
|
-
)} ${
|
143610
|
+
)} ${import_chalk68.default.gray(lsStamp())}`
|
143649
143611
|
);
|
143650
143612
|
output2.log(getDNSRecordsTable(dnsRecords));
|
143651
143613
|
if (pagination && pagination.count === 20) {
|
@@ -143663,7 +143625,7 @@ function getDNSRecordsTable(dnsRecords) {
|
|
143663
143625
|
["", "id", "name", "type", "value", "created"],
|
143664
143626
|
["l", "r", "l", "l", "l", "l"],
|
143665
143627
|
dnsRecords.map(({ domainName, records }) => ({
|
143666
|
-
name:
|
143628
|
+
name: import_chalk68.default.bold(domainName),
|
143667
143629
|
rows: records.map(getDNSRecordRow)
|
143668
143630
|
}))
|
143669
143631
|
);
|
@@ -143680,14 +143642,14 @@ function getDNSRecordRow(record) {
|
|
143680
143642
|
record.name,
|
143681
143643
|
record.type,
|
143682
143644
|
priority ? `${priority} ${record.value}` : record.value,
|
143683
|
-
|
143645
|
+
import_chalk68.default.gray(isSystemRecord ? "default" : createdAt)
|
143684
143646
|
];
|
143685
143647
|
}
|
143686
|
-
var
|
143648
|
+
var import_chalk68, import_ms13;
|
143687
143649
|
var init_ls3 = __esm({
|
143688
143650
|
"src/commands/dns/ls.ts"() {
|
143689
143651
|
"use strict";
|
143690
|
-
|
143652
|
+
import_chalk68 = __toESM3(require_source());
|
143691
143653
|
import_ms13 = __toESM3(require_ms2());
|
143692
143654
|
init_errors_ts();
|
143693
143655
|
init_format_table();
|
@@ -143733,7 +143695,7 @@ async function rm3(client2, _opts, args2) {
|
|
143733
143695
|
const [recordId] = args2;
|
143734
143696
|
if (args2.length !== 1) {
|
143735
143697
|
output2.error(
|
143736
|
-
`Invalid number of arguments. Usage: ${
|
143698
|
+
`Invalid number of arguments. Usage: ${import_chalk69.default.cyan(
|
143737
143699
|
`${getCommandName("dns rm <id>")}`
|
143738
143700
|
)}`
|
143739
143701
|
);
|
@@ -143758,7 +143720,7 @@ async function rm3(client2, _opts, args2) {
|
|
143758
143720
|
const rmStamp = stamp_default();
|
143759
143721
|
await deleteDNSRecordById(client2, domainName, record.id);
|
143760
143722
|
output2.success(
|
143761
|
-
`Record ${
|
143723
|
+
`Record ${import_chalk69.default.gray(`${record.id}`)} removed ${import_chalk69.default.gray(rmStamp())}`
|
143762
143724
|
);
|
143763
143725
|
return 0;
|
143764
143726
|
}
|
@@ -143773,7 +143735,7 @@ function readConfirmation2(output2, msg, domainName, record) {
|
|
143773
143735
|
`
|
143774
143736
|
);
|
143775
143737
|
output2.print(
|
143776
|
-
`${
|
143738
|
+
`${import_chalk69.default.bold.red("> Are you sure?")} ${import_chalk69.default.gray("(y/N) ")}`
|
143777
143739
|
);
|
143778
143740
|
process.stdin.on("data", (d) => {
|
143779
143741
|
process.stdin.pause();
|
@@ -143785,19 +143747,19 @@ function getDeleteTableRow(domainName, record) {
|
|
143785
143747
|
const recordName = `${record.name.length > 0 ? `${record.name}.` : ""}${domainName}`;
|
143786
143748
|
return [
|
143787
143749
|
record.id,
|
143788
|
-
|
143750
|
+
import_chalk69.default.bold(
|
143789
143751
|
`${recordName} ${record.type} ${record.value} ${record.mxPriority || ""}`
|
143790
143752
|
),
|
143791
|
-
|
143753
|
+
import_chalk69.default.gray(
|
143792
143754
|
`${(0, import_ms14.default)(Date.now() - new Date(Number(record.createdAt)).getTime())} ago`
|
143793
143755
|
)
|
143794
143756
|
];
|
143795
143757
|
}
|
143796
|
-
var
|
143758
|
+
var import_chalk69, import_ms14;
|
143797
143759
|
var init_rm3 = __esm({
|
143798
143760
|
"src/commands/dns/rm.ts"() {
|
143799
143761
|
"use strict";
|
143800
|
-
|
143762
|
+
import_chalk69 = __toESM3(require_source());
|
143801
143763
|
import_ms14 = __toESM3(require_ms2());
|
143802
143764
|
init_table();
|
143803
143765
|
init_delete_dns_record_by_id();
|
@@ -144023,16 +143985,16 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
144023
143985
|
const rows = [];
|
144024
143986
|
for (let i = 0; i < maxLength; i++) {
|
144025
143987
|
rows.push([
|
144026
|
-
sortedIntended[i] ||
|
144027
|
-
sortedCurrent[i] ||
|
144028
|
-
sortedIntended[i] === sortedCurrent[i] ?
|
143988
|
+
sortedIntended[i] || import_chalk70.default.gray("-"),
|
143989
|
+
sortedCurrent[i] || import_chalk70.default.gray("-"),
|
143990
|
+
sortedIntended[i] === sortedCurrent[i] ? import_chalk70.default.green(chars_default.tick) : import_chalk70.default.red(chars_default.cross)
|
144029
143991
|
]);
|
144030
143992
|
}
|
144031
143993
|
return table(
|
144032
143994
|
[
|
144033
143995
|
[
|
144034
|
-
|
144035
|
-
|
143996
|
+
import_chalk70.default.gray("Intended Nameservers"),
|
143997
|
+
import_chalk70.default.gray("Current Nameservers"),
|
144036
143998
|
""
|
144037
143999
|
],
|
144038
144000
|
...rows
|
@@ -144040,11 +144002,11 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
144040
144002
|
{ hsep: 4 }
|
144041
144003
|
).replace(/^(.*)/gm, `${extraSpace}$1`);
|
144042
144004
|
}
|
144043
|
-
var
|
144005
|
+
var import_chalk70;
|
144044
144006
|
var init_format_ns_table = __esm({
|
144045
144007
|
"src/util/format-ns-table.ts"() {
|
144046
144008
|
"use strict";
|
144047
|
-
|
144009
|
+
import_chalk70 = __toESM3(require_source());
|
144048
144010
|
init_table();
|
144049
144011
|
init_chars();
|
144050
144012
|
}
|
@@ -144053,7 +144015,7 @@ var init_format_ns_table = __esm({
|
|
144053
144015
|
// src/util/domains/get-domain.ts
|
144054
144016
|
async function getDomain(client2, contextName, domainName) {
|
144055
144017
|
client2.output.spinner(
|
144056
|
-
`Fetching domain ${domainName} under ${
|
144018
|
+
`Fetching domain ${domainName} under ${import_chalk71.default.bold(contextName)}`
|
144057
144019
|
);
|
144058
144020
|
try {
|
144059
144021
|
const { domain } = await client2.fetch(
|
@@ -144067,11 +144029,11 @@ async function getDomain(client2, contextName, domainName) {
|
|
144067
144029
|
throw err;
|
144068
144030
|
}
|
144069
144031
|
}
|
144070
|
-
var
|
144032
|
+
var import_chalk71;
|
144071
144033
|
var init_get_domain = __esm({
|
144072
144034
|
"src/util/domains/get-domain.ts"() {
|
144073
144035
|
"use strict";
|
144074
|
-
|
144036
|
+
import_chalk71 = __toESM3(require_source());
|
144075
144037
|
init_errors_ts();
|
144076
144038
|
}
|
144077
144039
|
});
|
@@ -144110,7 +144072,7 @@ var init_get_domain_config = __esm({
|
|
144110
144072
|
// src/util/projects/add-domain-to-project.ts
|
144111
144073
|
async function addDomainToProject(client2, projectNameOrId, domain) {
|
144112
144074
|
client2.output.spinner(
|
144113
|
-
`Adding domain ${domain} to project ${
|
144075
|
+
`Adding domain ${domain} to project ${import_chalk72.default.bold(projectNameOrId)}`
|
144114
144076
|
);
|
144115
144077
|
try {
|
144116
144078
|
const response = await client2.fetch(
|
@@ -144139,11 +144101,11 @@ async function addDomainToProject(client2, projectNameOrId, domain) {
|
|
144139
144101
|
throw err;
|
144140
144102
|
}
|
144141
144103
|
}
|
144142
|
-
var
|
144104
|
+
var import_chalk72;
|
144143
144105
|
var init_add_domain_to_project = __esm({
|
144144
144106
|
"src/util/projects/add-domain-to-project.ts"() {
|
144145
144107
|
"use strict";
|
144146
|
-
|
144108
|
+
import_chalk72 = __toESM3(require_source());
|
144147
144109
|
init_errors_ts();
|
144148
144110
|
}
|
144149
144111
|
});
|
@@ -144151,7 +144113,7 @@ var init_add_domain_to_project = __esm({
|
|
144151
144113
|
// src/util/projects/remove-domain-from-project.ts
|
144152
144114
|
async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
144153
144115
|
client2.output.spinner(
|
144154
|
-
`Removing domain ${domain} from project ${
|
144116
|
+
`Removing domain ${domain} from project ${import_chalk73.default.bold(projectNameOrId)}`
|
144155
144117
|
);
|
144156
144118
|
try {
|
144157
144119
|
const response = await client2.fetch(
|
@@ -144170,11 +144132,11 @@ async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
|
144170
144132
|
throw err;
|
144171
144133
|
}
|
144172
144134
|
}
|
144173
|
-
var
|
144135
|
+
var import_chalk73;
|
144174
144136
|
var init_remove_domain_from_project = __esm({
|
144175
144137
|
"src/util/projects/remove-domain-from-project.ts"() {
|
144176
144138
|
"use strict";
|
144177
|
-
|
144139
|
+
import_chalk73 = __toESM3(require_source());
|
144178
144140
|
init_errors_ts();
|
144179
144141
|
}
|
144180
144142
|
});
|
@@ -144228,7 +144190,7 @@ async function add4(client2, opts, args2) {
|
|
144228
144190
|
}
|
144229
144191
|
}
|
144230
144192
|
output2.success(
|
144231
|
-
`Domain ${
|
144193
|
+
`Domain ${import_chalk74.default.bold(domainName)} added to project ${import_chalk74.default.bold(
|
144232
144194
|
projectName
|
144233
144195
|
)}. ${addStamp()}`
|
144234
144196
|
);
|
@@ -144249,11 +144211,11 @@ async function add4(client2, opts, args2) {
|
|
144249
144211
|
`This domain is not configured properly. To configure it you should either:`
|
144250
144212
|
);
|
144251
144213
|
output2.print(
|
144252
|
-
` ${
|
144214
|
+
` ${import_chalk74.default.grey("a)")} Set the following record on your DNS provider to continue: ${code(`A ${domainName} 76.76.21.21`)} ${import_chalk74.default.grey("[recommended]")}
|
144253
144215
|
`
|
144254
144216
|
);
|
144255
144217
|
output2.print(
|
144256
|
-
` ${
|
144218
|
+
` ${import_chalk74.default.grey("b)")} Change your Domains's nameservers to the intended set`
|
144257
144219
|
);
|
144258
144220
|
output2.print(
|
144259
144221
|
`
|
@@ -144277,11 +144239,11 @@ ${formatNSTable(
|
|
144277
144239
|
}
|
144278
144240
|
return 0;
|
144279
144241
|
}
|
144280
|
-
var
|
144242
|
+
var import_chalk74;
|
144281
144243
|
var init_add3 = __esm({
|
144282
144244
|
"src/commands/domains/add.ts"() {
|
144283
144245
|
"use strict";
|
144284
|
-
|
144246
|
+
import_chalk74 = __toESM3(require_source());
|
144285
144247
|
init_errors_ts();
|
144286
144248
|
init_format_ns_table();
|
144287
144249
|
init_get_scope();
|
@@ -144338,7 +144300,7 @@ async function buy(client2, opts, args2) {
|
|
144338
144300
|
}
|
144339
144301
|
if (!(await getDomainStatus(client2, domainName)).available) {
|
144340
144302
|
output2.error(
|
144341
|
-
`The domain ${param(domainName)} is ${
|
144303
|
+
`The domain ${param(domainName)} is ${import_chalk75.default.underline(
|
144342
144304
|
"unavailable"
|
144343
144305
|
)}! ${availableStamp()}`
|
144344
144306
|
);
|
@@ -144346,9 +144308,9 @@ async function buy(client2, opts, args2) {
|
|
144346
144308
|
}
|
144347
144309
|
const { period, price } = domainPrice;
|
144348
144310
|
output2.log(
|
144349
|
-
`The domain ${param(domainName)} is ${
|
144311
|
+
`The domain ${param(domainName)} is ${import_chalk75.default.underline(
|
144350
144312
|
"available"
|
144351
|
-
)} to buy under ${
|
144313
|
+
)} to buy under ${import_chalk75.default.bold(contextName)}! ${availableStamp()}`
|
144352
144314
|
);
|
144353
144315
|
let autoRenew;
|
144354
144316
|
if (skipConfirmation) {
|
@@ -144356,14 +144318,14 @@ async function buy(client2, opts, args2) {
|
|
144356
144318
|
} else {
|
144357
144319
|
if (!await confirm(
|
144358
144320
|
client2,
|
144359
|
-
`Buy now for ${
|
144321
|
+
`Buy now for ${import_chalk75.default.bold(`$${price}`)} (${`${period}yr${period > 1 ? "s" : ""}`})?`,
|
144360
144322
|
false
|
144361
144323
|
)) {
|
144362
144324
|
return 0;
|
144363
144325
|
}
|
144364
144326
|
autoRenew = await confirm(
|
144365
144327
|
client2,
|
144366
|
-
renewalPrice.period === 1 ? `Auto renew yearly for ${
|
144328
|
+
renewalPrice.period === 1 ? `Auto renew yearly for ${import_chalk75.default.bold(`$${price}`)}?` : `Auto renew every ${renewalPrice.period} years for ${import_chalk75.default.bold(
|
144367
144329
|
`$${price}`
|
144368
144330
|
)}?`,
|
144369
144331
|
true
|
@@ -144447,11 +144409,11 @@ async function buy(client2, opts, args2) {
|
|
144447
144409
|
}
|
144448
144410
|
return 0;
|
144449
144411
|
}
|
144450
|
-
var
|
144412
|
+
var import_chalk75, import_psl6, import_error_utils21;
|
144451
144413
|
var init_buy = __esm({
|
144452
144414
|
"src/commands/domains/buy.ts"() {
|
144453
144415
|
"use strict";
|
144454
|
-
|
144416
|
+
import_chalk75 = __toESM3(require_source());
|
144455
144417
|
import_psl6 = __toESM3(require_psl());
|
144456
144418
|
init_errors_ts();
|
144457
144419
|
init_get_domain_price();
|
@@ -144587,14 +144549,14 @@ async function transferIn(client2, opts, args2) {
|
|
144587
144549
|
}
|
144588
144550
|
const { price } = domainPrice;
|
144589
144551
|
output2.log(
|
144590
|
-
`The domain ${param(domainName)} is ${
|
144552
|
+
`The domain ${param(domainName)} is ${import_chalk76.default.underline(
|
144591
144553
|
"available"
|
144592
|
-
)} to transfer under ${
|
144554
|
+
)} to transfer under ${import_chalk76.default.bold(contextName)}! ${availableStamp()}`
|
144593
144555
|
);
|
144594
144556
|
const authCode = await getAuthCode(opts["--code"]);
|
144595
144557
|
const shouldTransfer = await confirm(
|
144596
144558
|
client2,
|
144597
|
-
transferPolicy === "no-change" ? `Transfer now for ${
|
144559
|
+
transferPolicy === "no-change" ? `Transfer now for ${import_chalk76.default.bold(`$${price}`)}?` : `Transfer now with 1yr renewal for ${import_chalk76.default.bold(`$${price}`)}?`,
|
144598
144560
|
false
|
144599
144561
|
);
|
144600
144562
|
if (!shouldTransfer) {
|
@@ -144662,11 +144624,11 @@ async function transferIn(client2, opts, args2) {
|
|
144662
144624
|
);
|
144663
144625
|
return 0;
|
144664
144626
|
}
|
144665
|
-
var
|
144627
|
+
var import_chalk76;
|
144666
144628
|
var init_transfer_in = __esm({
|
144667
144629
|
"src/commands/domains/transfer-in.ts"() {
|
144668
144630
|
"use strict";
|
144669
|
-
|
144631
|
+
import_chalk76 = __toESM3(require_source());
|
144670
144632
|
init_errors_ts();
|
144671
144633
|
init_get_scope();
|
144672
144634
|
init_param();
|
@@ -144741,7 +144703,7 @@ async function inspect2(client2, opts, args2) {
|
|
144741
144703
|
}
|
144742
144704
|
if (args2.length !== 1) {
|
144743
144705
|
output2.error(
|
144744
|
-
`Invalid number of arguments. Usage: ${
|
144706
|
+
`Invalid number of arguments. Usage: ${import_chalk77.default.cyan(
|
144745
144707
|
`${getCommandName("domains inspect <domain>")}`
|
144746
144708
|
)}`
|
144747
144709
|
);
|
@@ -144749,7 +144711,7 @@ async function inspect2(client2, opts, args2) {
|
|
144749
144711
|
}
|
144750
144712
|
output2.debug(`Fetching domain info`);
|
144751
144713
|
output2.spinner(
|
144752
|
-
`Fetching Domain ${domainName} under ${
|
144714
|
+
`Fetching Domain ${domainName} under ${import_chalk77.default.bold(contextName)}`
|
144753
144715
|
);
|
144754
144716
|
const information = await fetchInformation({
|
144755
144717
|
output: output2,
|
@@ -144762,38 +144724,38 @@ async function inspect2(client2, opts, args2) {
|
|
144762
144724
|
}
|
144763
144725
|
const { domain, projects, renewalPrice, domainConfig } = information;
|
144764
144726
|
output2.log(
|
144765
|
-
`Domain ${domainName} found under ${
|
144727
|
+
`Domain ${domainName} found under ${import_chalk77.default.bold(contextName)} ${import_chalk77.default.gray(
|
144766
144728
|
inspectStamp()
|
144767
144729
|
)}`
|
144768
144730
|
);
|
144769
144731
|
output2.print("\n");
|
144770
|
-
output2.print(
|
144771
|
-
output2.print(` ${
|
144732
|
+
output2.print(import_chalk77.default.bold(" General\n\n"));
|
144733
|
+
output2.print(` ${import_chalk77.default.cyan("Name")} ${domain.name}
|
144772
144734
|
`);
|
144773
144735
|
output2.print(
|
144774
|
-
` ${
|
144736
|
+
` ${import_chalk77.default.cyan("Registrar")} ${getDomainRegistrar(domain)}
|
144775
144737
|
`
|
144776
144738
|
);
|
144777
144739
|
output2.print(
|
144778
|
-
` ${
|
144740
|
+
` ${import_chalk77.default.cyan("Expiration Date")} ${formatDate(domain.expiresAt)}
|
144779
144741
|
`
|
144780
144742
|
);
|
144781
144743
|
output2.print(
|
144782
|
-
` ${
|
144744
|
+
` ${import_chalk77.default.cyan("Creator")} ${domain.creator.username}
|
144783
144745
|
`
|
144784
144746
|
);
|
144785
144747
|
output2.print(
|
144786
|
-
` ${
|
144748
|
+
` ${import_chalk77.default.cyan("Created At")} ${formatDate(domain.createdAt)}
|
144787
144749
|
`
|
144788
144750
|
);
|
144789
|
-
output2.print(` ${
|
144751
|
+
output2.print(` ${import_chalk77.default.cyan("Edge Network")} yes
|
144790
144752
|
`);
|
144791
144753
|
output2.print(
|
144792
|
-
` ${
|
144754
|
+
` ${import_chalk77.default.cyan("Renewal Price")} ${domain.boughtAt && renewalPrice ? `$${renewalPrice} USD` : import_chalk77.default.gray("-")}
|
144793
144755
|
`
|
144794
144756
|
);
|
144795
144757
|
output2.print("\n");
|
144796
|
-
output2.print(
|
144758
|
+
output2.print(import_chalk77.default.bold(" Nameservers\n\n"));
|
144797
144759
|
output2.print(
|
144798
144760
|
`${formatNSTable(domain.intendedNameservers, domain.nameservers, {
|
144799
144761
|
extraSpace: " "
|
@@ -144802,7 +144764,7 @@ async function inspect2(client2, opts, args2) {
|
|
144802
144764
|
);
|
144803
144765
|
output2.print("\n");
|
144804
144766
|
if (Array.isArray(projects) && projects.length > 0) {
|
144805
|
-
output2.print(
|
144767
|
+
output2.print(import_chalk77.default.bold(" Projects\n"));
|
144806
144768
|
const table2 = formatTable(
|
144807
144769
|
["Project", "Domains"],
|
144808
144770
|
["l", "l"],
|
@@ -144832,11 +144794,11 @@ async function inspect2(client2, opts, args2) {
|
|
144832
144794
|
null
|
144833
144795
|
);
|
144834
144796
|
output2.print(
|
144835
|
-
` ${
|
144797
|
+
` ${import_chalk77.default.grey("a)")} Set the following record on your DNS provider to continue: ${code(`A ${domainName} 76.76.21.21`)} ${import_chalk77.default.grey("[recommended]")}
|
144836
144798
|
`
|
144837
144799
|
);
|
144838
144800
|
output2.print(
|
144839
|
-
` ${
|
144801
|
+
` ${import_chalk77.default.grey("b)")} Change your Domains's nameservers to the intended set detailed above.
|
144840
144802
|
|
144841
144803
|
`
|
144842
144804
|
);
|
@@ -144896,11 +144858,11 @@ async function fetchInformation({
|
|
144896
144858
|
domainConfig
|
144897
144859
|
};
|
144898
144860
|
}
|
144899
|
-
var
|
144861
|
+
var import_chalk77;
|
144900
144862
|
var init_inspect = __esm({
|
144901
144863
|
"src/commands/domains/inspect.ts"() {
|
144902
144864
|
"use strict";
|
144903
|
-
|
144865
|
+
import_chalk77 = __toESM3(require_source());
|
144904
144866
|
init_errors_ts();
|
144905
144867
|
init_stamp();
|
144906
144868
|
init_format_date();
|
@@ -144931,21 +144893,21 @@ async function ls4(client2, opts, args2) {
|
|
144931
144893
|
const lsStamp = stamp_default();
|
144932
144894
|
if (args2.length !== 0) {
|
144933
144895
|
output2.error(
|
144934
|
-
`Invalid number of arguments. Usage: ${
|
144896
|
+
`Invalid number of arguments. Usage: ${import_chalk78.default.cyan(
|
144935
144897
|
`${getCommandName("domains ls")}`
|
144936
144898
|
)}`
|
144937
144899
|
);
|
144938
144900
|
return 1;
|
144939
144901
|
}
|
144940
|
-
output2.spinner(`Fetching Domains under ${
|
144902
|
+
output2.spinner(`Fetching Domains under ${import_chalk78.default.bold(contextName)}`);
|
144941
144903
|
const { domains: domains2, pagination } = await getDomains(
|
144942
144904
|
client2,
|
144943
144905
|
...paginationOptions
|
144944
144906
|
);
|
144945
144907
|
output2.log(
|
144946
|
-
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${
|
144908
|
+
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${import_chalk78.default.bold(
|
144947
144909
|
contextName
|
144948
|
-
)} ${
|
144910
|
+
)} ${import_chalk78.default.gray(lsStamp())}`
|
144949
144911
|
);
|
144950
144912
|
if (domains2.length > 0) {
|
144951
144913
|
output2.print(
|
@@ -144974,7 +144936,7 @@ function formatDomainsTable(domains2) {
|
|
144974
144936
|
isDomainExternal(domain) ? "Third Party" : "Vercel",
|
144975
144937
|
expiration,
|
144976
144938
|
domain.creator.username,
|
144977
|
-
|
144939
|
+
import_chalk78.default.gray(age)
|
144978
144940
|
];
|
144979
144941
|
});
|
144980
144942
|
return formatTable(
|
@@ -144983,12 +144945,12 @@ function formatDomainsTable(domains2) {
|
|
144983
144945
|
[{ rows }]
|
144984
144946
|
);
|
144985
144947
|
}
|
144986
|
-
var import_ms15,
|
144948
|
+
var import_ms15, import_chalk78, import_pluralize8;
|
144987
144949
|
var init_ls4 = __esm({
|
144988
144950
|
"src/commands/domains/ls.ts"() {
|
144989
144951
|
"use strict";
|
144990
144952
|
import_ms15 = __toESM3(require_ms2());
|
144991
|
-
|
144953
|
+
import_chalk78 = __toESM3(require_source());
|
144992
144954
|
import_pluralize8 = __toESM3(require_pluralize());
|
144993
144955
|
init_get_domains();
|
144994
144956
|
init_get_scope();
|
@@ -145092,7 +145054,7 @@ async function rm4(client2, opts, args2) {
|
|
145092
145054
|
}
|
145093
145055
|
if (args2.length !== 1) {
|
145094
145056
|
output2.error(
|
145095
|
-
`Invalid number of arguments. Usage: ${
|
145057
|
+
`Invalid number of arguments. Usage: ${import_chalk79.default.cyan(
|
145096
145058
|
`${getCommandName("domains rm <domain>")}`
|
145097
145059
|
)}`
|
145098
145060
|
);
|
@@ -145101,14 +145063,14 @@ async function rm4(client2, opts, args2) {
|
|
145101
145063
|
const domain = await getDomainByName(client2, contextName, domainName);
|
145102
145064
|
if (domain instanceof DomainNotFound || domain.name !== domainName) {
|
145103
145065
|
output2.error(
|
145104
|
-
`Domain not found by "${domainName}" under ${
|
145066
|
+
`Domain not found by "${domainName}" under ${import_chalk79.default.bold(contextName)}`
|
145105
145067
|
);
|
145106
145068
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
145107
145069
|
return 1;
|
145108
145070
|
}
|
145109
145071
|
if (domain instanceof DomainPermissionDenied) {
|
145110
145072
|
output2.error(
|
145111
|
-
`You don't have access to the domain ${domainName} under ${
|
145073
|
+
`You don't have access to the domain ${domainName} under ${import_chalk79.default.bold(
|
145112
145074
|
contextName
|
145113
145075
|
)}`
|
145114
145076
|
);
|
@@ -145169,15 +145131,15 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
145169
145131
|
domain.name
|
145170
145132
|
);
|
145171
145133
|
if (removeResult instanceof DomainNotFound) {
|
145172
|
-
output2.error(`Domain not found under ${
|
145134
|
+
output2.error(`Domain not found under ${import_chalk79.default.bold(contextName)}`);
|
145173
145135
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
145174
145136
|
return 1;
|
145175
145137
|
}
|
145176
145138
|
if (removeResult instanceof DomainPermissionDenied) {
|
145177
145139
|
output2.error(
|
145178
|
-
`You don't have permissions over domain ${
|
145140
|
+
`You don't have permissions over domain ${import_chalk79.default.underline(
|
145179
145141
|
removeResult.meta.domain
|
145180
|
-
)} under ${
|
145142
|
+
)} under ${import_chalk79.default.bold(removeResult.meta.context)}.`
|
145181
145143
|
);
|
145182
145144
|
return 1;
|
145183
145145
|
}
|
@@ -145219,21 +145181,21 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
145219
145181
|
);
|
145220
145182
|
if (aliases.length > 0) {
|
145221
145183
|
output2.warn(
|
145222
|
-
`This domain's ${
|
145184
|
+
`This domain's ${import_chalk79.default.bold(
|
145223
145185
|
(0, import_pluralize9.default)("alias", aliases.length, true)
|
145224
145186
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
145225
145187
|
);
|
145226
145188
|
}
|
145227
145189
|
if (certs.length > 0) {
|
145228
145190
|
output2.warn(
|
145229
|
-
`This domain's ${
|
145191
|
+
`This domain's ${import_chalk79.default.bold(
|
145230
145192
|
(0, import_pluralize9.default)("certificate", certs.length, true)
|
145231
145193
|
)} will be removed. Run ${getCommandName(`cert ls`)} to list them.`
|
145232
145194
|
);
|
145233
145195
|
}
|
145234
145196
|
if (suffix2) {
|
145235
145197
|
output2.warn(
|
145236
|
-
`The ${
|
145198
|
+
`The ${import_chalk79.default.bold(`custom suffix`)} associated with this domain.`
|
145237
145199
|
);
|
145238
145200
|
}
|
145239
145201
|
if (!skipConfirmation && !await confirm(
|
@@ -145256,14 +145218,14 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
145256
145218
|
attempt + 1
|
145257
145219
|
);
|
145258
145220
|
}
|
145259
|
-
output2.success(`Domain ${
|
145221
|
+
output2.success(`Domain ${import_chalk79.default.bold(domain.name)} removed ${removeStamp()}`);
|
145260
145222
|
return 0;
|
145261
145223
|
}
|
145262
|
-
var
|
145224
|
+
var import_chalk79, import_pluralize9;
|
145263
145225
|
var init_rm4 = __esm({
|
145264
145226
|
"src/commands/domains/rm.ts"() {
|
145265
145227
|
"use strict";
|
145266
|
-
|
145228
|
+
import_chalk79 = __toESM3(require_source());
|
145267
145229
|
import_pluralize9 = __toESM3(require_pluralize());
|
145268
145230
|
init_errors_ts();
|
145269
145231
|
init_delete_cert_by_id();
|
@@ -145349,15 +145311,15 @@ async function move2(client2, opts, args2) {
|
|
145349
145311
|
}
|
145350
145312
|
const domain = await getDomainByName(client2, contextName, domainName);
|
145351
145313
|
if (domain instanceof DomainNotFound) {
|
145352
|
-
output2.error(`Domain not found under ${
|
145314
|
+
output2.error(`Domain not found under ${import_chalk80.default.bold(contextName)}`);
|
145353
145315
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
145354
145316
|
return 1;
|
145355
145317
|
}
|
145356
145318
|
if (domain instanceof DomainPermissionDenied) {
|
145357
145319
|
output2.error(
|
145358
|
-
`You don't have permissions over domain ${
|
145320
|
+
`You don't have permissions over domain ${import_chalk80.default.underline(
|
145359
145321
|
domain.meta.domain
|
145360
|
-
)} under ${
|
145322
|
+
)} under ${import_chalk80.default.bold(domain.meta.context)}.`
|
145361
145323
|
);
|
145362
145324
|
return 1;
|
145363
145325
|
}
|
@@ -145388,7 +145350,7 @@ async function move2(client2, opts, args2) {
|
|
145388
145350
|
const aliases = await getDomainAliases(client2, domainName);
|
145389
145351
|
if (aliases.length > 0) {
|
145390
145352
|
output2.warn(
|
145391
|
-
`This domain's ${
|
145353
|
+
`This domain's ${import_chalk80.default.bold(
|
145392
145354
|
(0, import_pluralize10.default)("alias", aliases.length, true)
|
145393
145355
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
145394
145356
|
);
|
@@ -145430,21 +145392,21 @@ async function move2(client2, opts, args2) {
|
|
145430
145392
|
return 1;
|
145431
145393
|
}
|
145432
145394
|
if (moveTokenResult instanceof DomainNotFound) {
|
145433
|
-
output2.error(`Domain not found under ${
|
145395
|
+
output2.error(`Domain not found under ${import_chalk80.default.bold(contextName)}`);
|
145434
145396
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
145435
145397
|
return 1;
|
145436
145398
|
}
|
145437
145399
|
if (moveTokenResult instanceof DomainPermissionDenied) {
|
145438
145400
|
output2.error(
|
145439
|
-
`You don't have permissions over domain ${
|
145401
|
+
`You don't have permissions over domain ${import_chalk80.default.underline(
|
145440
145402
|
moveTokenResult.meta.domain
|
145441
|
-
)} under ${
|
145403
|
+
)} under ${import_chalk80.default.bold(moveTokenResult.meta.context)}.`
|
145442
145404
|
);
|
145443
145405
|
return 1;
|
145444
145406
|
}
|
145445
145407
|
if (moveTokenResult instanceof InvalidMoveDestination) {
|
145446
145408
|
output2.error(
|
145447
|
-
`Destination ${
|
145409
|
+
`Destination ${import_chalk80.default.bold(
|
145448
145410
|
destination
|
145449
145411
|
)} is invalid. Please supply a valid username, email, team slug, user id, or team id.`
|
145450
145412
|
);
|
@@ -145489,11 +145451,11 @@ async function findDestinationMatch(destination, user, teams) {
|
|
145489
145451
|
}
|
145490
145452
|
return null;
|
145491
145453
|
}
|
145492
|
-
var
|
145454
|
+
var import_chalk80, import_pluralize10;
|
145493
145455
|
var init_move = __esm({
|
145494
145456
|
"src/commands/domains/move.ts"() {
|
145495
145457
|
"use strict";
|
145496
|
-
|
145458
|
+
import_chalk80 = __toESM3(require_source());
|
145497
145459
|
import_pluralize10 = __toESM3(require_pluralize());
|
145498
145460
|
init_errors_ts();
|
145499
145461
|
init_get_scope();
|
@@ -145854,7 +145816,9 @@ var init_get_custom_environments = __esm({
|
|
145854
145816
|
});
|
145855
145817
|
|
145856
145818
|
// src/commands/env/add.ts
|
145857
|
-
async function add5(client2,
|
145819
|
+
async function add5(client2, link4, opts, args2) {
|
145820
|
+
const { output: output2 } = client2;
|
145821
|
+
const { project } = link4;
|
145858
145822
|
const stdInput = await readStandardInput(client2.stdin);
|
145859
145823
|
let [envName, envTargetArg, envGitBranch] = args2;
|
145860
145824
|
if (args2.length > 3) {
|
@@ -145884,7 +145848,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
145884
145848
|
});
|
145885
145849
|
}
|
145886
145850
|
const [{ envs }, customEnvironments] = await Promise.all([
|
145887
|
-
getEnvRecords(
|
145851
|
+
getEnvRecords(client2, project.id, "vercel-cli:env:add"),
|
145888
145852
|
getCustomEnvironments(client2, project.id)
|
145889
145853
|
]);
|
145890
145854
|
const matchingEnvs = envs.filter((r) => r.key === envName);
|
@@ -145968,20 +145932,20 @@ async function add5(client2, project, opts, args2, output2) {
|
|
145968
145932
|
}
|
145969
145933
|
output2.print(
|
145970
145934
|
`${prependEmoji(
|
145971
|
-
`${opts["--force"] ? "Overrode" : "Added"} Environment Variable ${
|
145935
|
+
`${opts["--force"] ? "Overrode" : "Added"} Environment Variable ${import_chalk81.default.bold(envName)} to Project ${import_chalk81.default.bold(
|
145972
145936
|
project.name
|
145973
|
-
)} ${
|
145937
|
+
)} ${import_chalk81.default.gray(addStamp())}`,
|
145974
145938
|
emoji("success")
|
145975
145939
|
)}
|
145976
145940
|
`
|
145977
145941
|
);
|
145978
145942
|
return 0;
|
145979
145943
|
}
|
145980
|
-
var
|
145944
|
+
var import_chalk81;
|
145981
145945
|
var init_add4 = __esm({
|
145982
145946
|
"src/commands/env/add.ts"() {
|
145983
145947
|
"use strict";
|
145984
|
-
|
145948
|
+
import_chalk81 = __toESM3(require_source());
|
145985
145949
|
init_stamp();
|
145986
145950
|
init_add_env_record();
|
145987
145951
|
init_get_env_records();
|
@@ -146006,8 +145970,51 @@ var init_ellipsis = __esm({
|
|
146006
145970
|
}
|
146007
145971
|
});
|
146008
145972
|
|
145973
|
+
// src/util/target/format-environment.ts
|
145974
|
+
function formatEnvironment(client2, orgSlug, projectSlug, environment) {
|
145975
|
+
const { output: output2 } = client2;
|
145976
|
+
const projectUrl = `https://vercel.com/${orgSlug}/${projectSlug}`;
|
145977
|
+
const boldName = import_chalk82.default.bold(environment.name);
|
145978
|
+
return output2.link(
|
145979
|
+
boldName,
|
145980
|
+
`${projectUrl}/settings/environments/${environment.id}`,
|
145981
|
+
{ fallback: () => boldName, color: false }
|
145982
|
+
);
|
145983
|
+
}
|
145984
|
+
var import_chalk82;
|
145985
|
+
var init_format_environment = __esm({
|
145986
|
+
"src/util/target/format-environment.ts"() {
|
145987
|
+
"use strict";
|
145988
|
+
import_chalk82 = __toESM3(require_source());
|
145989
|
+
}
|
145990
|
+
});
|
145991
|
+
|
145992
|
+
// src/util/env/format-environments.ts
|
145993
|
+
function formatEnvironments(client2, link4, env, customEnvironments) {
|
145994
|
+
const defaultTargets = (Array.isArray(env.target) ? env.target : [env.target || ""]).map((t) => {
|
145995
|
+
return formatEnvironment(client2, link4.org.slug, link4.project.name, {
|
145996
|
+
id: t,
|
145997
|
+
name: (0, import_title4.default)(t)
|
145998
|
+
});
|
145999
|
+
});
|
146000
|
+
const customTargets = env.customEnvironmentIds ? env.customEnvironmentIds.map((id) => customEnvironments.find((e2) => e2.id === id)).filter(Boolean).map(
|
146001
|
+
(e2) => formatEnvironment(client2, link4.org.slug, link4.project.name, e2)
|
146002
|
+
) : [];
|
146003
|
+
const targetsString = [...defaultTargets, ...customTargets].join(", ");
|
146004
|
+
return env.gitBranch ? `${targetsString} (${env.gitBranch})` : targetsString;
|
146005
|
+
}
|
146006
|
+
var import_title4;
|
146007
|
+
var init_format_environments = __esm({
|
146008
|
+
"src/util/env/format-environments.ts"() {
|
146009
|
+
"use strict";
|
146010
|
+
import_title4 = __toESM3(require_lib4());
|
146011
|
+
init_format_environment();
|
146012
|
+
}
|
146013
|
+
});
|
146014
|
+
|
146009
146015
|
// src/commands/env/ls.ts
|
146010
|
-
async function ls5(client2,
|
146016
|
+
async function ls5(client2, link4, opts, args2) {
|
146017
|
+
const { output: output2 } = client2;
|
146011
146018
|
if (args2.length > 2) {
|
146012
146019
|
output2.error(
|
146013
146020
|
`Invalid number of arguments. Usage: ${getCommandName(
|
@@ -146017,33 +146024,31 @@ async function ls5(client2, project, opts, args2, output2) {
|
|
146017
146024
|
return 1;
|
146018
146025
|
}
|
146019
146026
|
const [envTarget, envGitBranch] = args2;
|
146027
|
+
const { project, org } = link4;
|
146020
146028
|
const lsStamp = stamp_default();
|
146021
146029
|
const [envsResult, customEnvs] = await Promise.all([
|
146022
|
-
getEnvRecords(
|
146030
|
+
getEnvRecords(client2, project.id, "vercel-cli:env:ls", {
|
146023
146031
|
target: envTarget,
|
146024
146032
|
gitBranch: envGitBranch
|
146025
146033
|
}),
|
146026
146034
|
getCustomEnvironments(client2, project.id)
|
146027
146035
|
]);
|
146028
146036
|
const { envs } = envsResult;
|
146037
|
+
const projectSlugLink = formatProject(client2, org.slug, project.name);
|
146029
146038
|
if (envs.length === 0) {
|
146030
146039
|
output2.log(
|
146031
|
-
`No Environment Variables found
|
146032
|
-
project.name
|
146033
|
-
)} ${import_chalk81.default.gray(lsStamp())}`
|
146040
|
+
`No Environment Variables found for ${projectSlugLink} ${import_chalk83.default.gray(lsStamp())}`
|
146034
146041
|
);
|
146035
146042
|
} else {
|
146036
146043
|
output2.log(
|
146037
|
-
`Environment Variables found
|
146038
|
-
project.name
|
146039
|
-
)} ${import_chalk81.default.gray(lsStamp())}`
|
146044
|
+
`Environment Variables found for ${projectSlugLink} ${import_chalk83.default.gray(lsStamp())}`
|
146040
146045
|
);
|
146041
|
-
client2.stdout.write(`${getTable(envs, customEnvs)}
|
146046
|
+
client2.stdout.write(`${getTable(client2, link4, envs, customEnvs)}
|
146042
146047
|
`);
|
146043
146048
|
}
|
146044
146049
|
return 0;
|
146045
146050
|
}
|
146046
|
-
function getTable(records, customEnvironments) {
|
146051
|
+
function getTable(client2, link4, records, customEnvironments) {
|
146047
146052
|
const label = records.some((env) => env.gitBranch) ? "environments (git branch)" : "environments";
|
146048
146053
|
return formatTable(
|
146049
146054
|
["name", "value", label, "created"],
|
@@ -146051,42 +146056,35 @@ function getTable(records, customEnvironments) {
|
|
146051
146056
|
[
|
146052
146057
|
{
|
146053
146058
|
name: "",
|
146054
|
-
rows: records.map((row) => getRow(row, customEnvironments))
|
146059
|
+
rows: records.map((row) => getRow(client2, link4, row, customEnvironments))
|
146055
146060
|
}
|
146056
146061
|
]
|
146057
146062
|
);
|
146058
146063
|
}
|
146059
|
-
function getRow(env, customEnvironments) {
|
146064
|
+
function getRow(client2, link4, env, customEnvironments) {
|
146060
146065
|
let value;
|
146061
146066
|
if (env.type === "plain") {
|
146062
146067
|
const singleLineValue = env.value.replace(/\s/g, " ");
|
146063
|
-
value =
|
146068
|
+
value = import_chalk83.default.gray(ellipsis(singleLineValue, 19));
|
146064
146069
|
} else if (env.type === "system") {
|
146065
|
-
value =
|
146070
|
+
value = import_chalk83.default.gray.italic(env.value);
|
146066
146071
|
} else {
|
146067
|
-
value =
|
146072
|
+
value = import_chalk83.default.gray.italic("Encrypted");
|
146068
146073
|
}
|
146069
146074
|
const now = Date.now();
|
146070
146075
|
return [
|
146071
|
-
|
146076
|
+
import_chalk83.default.bold(env.key),
|
146072
146077
|
value,
|
146073
|
-
|
146078
|
+
formatEnvironments(client2, link4, env, customEnvironments),
|
146074
146079
|
env.createdAt ? `${(0, import_ms16.default)(now - env.createdAt)} ago` : ""
|
146075
146080
|
];
|
146076
146081
|
}
|
146077
|
-
|
146078
|
-
const defaultTargets = (Array.isArray(env.target) ? env.target : [env.target || ""]).map((t) => (0, import_title4.default)(t));
|
146079
|
-
const customTargets = env.customEnvironmentIds ? env.customEnvironmentIds.map((id) => customEnvironments.find((e2) => e2.id === id)?.name).filter(Boolean) : [];
|
146080
|
-
const targetsString = [...defaultTargets, ...customTargets].join(", ");
|
146081
|
-
return env.gitBranch ? `${targetsString} (${env.gitBranch})` : targetsString;
|
146082
|
-
}
|
146083
|
-
var import_chalk81, import_ms16, import_title4;
|
146082
|
+
var import_chalk83, import_ms16;
|
146084
146083
|
var init_ls5 = __esm({
|
146085
146084
|
"src/commands/env/ls.ts"() {
|
146086
146085
|
"use strict";
|
146087
|
-
|
146086
|
+
import_chalk83 = __toESM3(require_source());
|
146088
146087
|
import_ms16 = __toESM3(require_ms2());
|
146089
|
-
import_title4 = __toESM3(require_lib4());
|
146090
146088
|
init_format_table();
|
146091
146089
|
init_get_env_records();
|
146092
146090
|
init_env_target();
|
@@ -146094,6 +146092,8 @@ var init_ls5 = __esm({
|
|
146094
146092
|
init_pkg_name();
|
146095
146093
|
init_ellipsis();
|
146096
146094
|
init_get_custom_environments();
|
146095
|
+
init_format_environments();
|
146096
|
+
init_format_project();
|
146097
146097
|
}
|
146098
146098
|
});
|
146099
146099
|
|
@@ -146111,21 +146111,10 @@ var init_remove_env_record = __esm({
|
|
146111
146111
|
}
|
146112
146112
|
});
|
146113
146113
|
|
146114
|
-
// src/util/env/format-env-target.ts
|
146115
|
-
function formatEnvTarget2(env) {
|
146116
|
-
const target = (Array.isArray(env.target) ? env.target : [env.target || ""]).map((t) => (0, import_title5.default)(t)).join(", ");
|
146117
|
-
return env.gitBranch ? `${target} (${env.gitBranch})` : target;
|
146118
|
-
}
|
146119
|
-
var import_title5;
|
146120
|
-
var init_format_env_target = __esm({
|
146121
|
-
"src/util/env/format-env-target.ts"() {
|
146122
|
-
"use strict";
|
146123
|
-
import_title5 = __toESM3(require_lib4());
|
146124
|
-
}
|
146125
|
-
});
|
146126
|
-
|
146127
146114
|
// src/commands/env/rm.ts
|
146128
|
-
async function rm5(client2,
|
146115
|
+
async function rm5(client2, link4, opts, args2) {
|
146116
|
+
const { output: output2 } = client2;
|
146117
|
+
const { project } = link4;
|
146129
146118
|
if (args2.length > 3) {
|
146130
146119
|
output2.error(
|
146131
146120
|
`Invalid number of arguments. Usage: ${getCommandName(
|
@@ -146137,28 +146126,17 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
146137
146126
|
let [envName, envTarget, envGitBranch] = args2;
|
146138
146127
|
if (!envName) {
|
146139
146128
|
envName = await client2.input.text({
|
146140
|
-
message:
|
146129
|
+
message: "What's the name of the variable?",
|
146141
146130
|
validate: (val) => val ? true : "Name cannot be empty"
|
146142
146131
|
});
|
146143
146132
|
}
|
146144
|
-
|
146145
|
-
|
146146
|
-
`The Environment ${param(
|
146147
|
-
envTarget
|
146148
|
-
)} is invalid. It must be one of: ${getEnvTargetPlaceholder()}.`
|
146149
|
-
);
|
146150
|
-
return 1;
|
146151
|
-
}
|
146152
|
-
const result = await getEnvRecords(
|
146153
|
-
output2,
|
146154
|
-
client2,
|
146155
|
-
project.id,
|
146156
|
-
"vercel-cli:env:rm",
|
146157
|
-
{
|
146133
|
+
const [result, customEnvironments] = await Promise.all([
|
146134
|
+
getEnvRecords(client2, project.id, "vercel-cli:env:rm", {
|
146158
146135
|
target: envTarget,
|
146159
146136
|
gitBranch: envGitBranch
|
146160
|
-
}
|
146161
|
-
|
146137
|
+
}),
|
146138
|
+
getCustomEnvironments(client2, project.id)
|
146139
|
+
]);
|
146162
146140
|
let envs = result.envs.filter((env2) => env2.key === envName);
|
146163
146141
|
if (envs.length === 0) {
|
146164
146142
|
output2.error(`Environment Variable was not found.
|
@@ -146170,9 +146148,7 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
146170
146148
|
message: `Remove ${envName} from which Environments?`,
|
146171
146149
|
choices: envs.map((env2) => ({
|
146172
146150
|
value: env2.id,
|
146173
|
-
|
146174
|
-
// use new `formatEnvTarget` from `vc env ls`
|
146175
|
-
name: formatEnvTarget2(env2)
|
146151
|
+
name: formatEnvironments(client2, link4, env2, customEnvironments)
|
146176
146152
|
}))
|
146177
146153
|
});
|
146178
146154
|
if (!id) {
|
@@ -146184,9 +146160,12 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
146184
146160
|
const skipConfirmation = opts["--yes"];
|
146185
146161
|
if (!skipConfirmation && !await confirm(
|
146186
146162
|
client2,
|
146187
|
-
`Removing Environment Variable ${param(env.key)} from ${
|
146188
|
-
|
146189
|
-
|
146163
|
+
`Removing Environment Variable ${param(env.key)} from ${formatEnvironments(
|
146164
|
+
client2,
|
146165
|
+
link4,
|
146166
|
+
env,
|
146167
|
+
customEnvironments
|
146168
|
+
)} in Project ${import_chalk84.default.bold(project.name)}. Are you sure?`,
|
146190
146169
|
false
|
146191
146170
|
)) {
|
146192
146171
|
output2.log("Canceled");
|
@@ -146205,22 +146184,22 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
146205
146184
|
}
|
146206
146185
|
output2.print(
|
146207
146186
|
`${prependEmoji(
|
146208
|
-
`Removed Environment Variable ${
|
146187
|
+
`Removed Environment Variable ${import_chalk84.default.gray(rmStamp())}`,
|
146209
146188
|
emoji("success")
|
146210
146189
|
)}
|
146211
146190
|
`
|
146212
146191
|
);
|
146213
146192
|
return 0;
|
146214
146193
|
}
|
146215
|
-
var
|
146194
|
+
var import_chalk84;
|
146216
146195
|
var init_rm5 = __esm({
|
146217
146196
|
"src/commands/env/rm.ts"() {
|
146218
146197
|
"use strict";
|
146219
|
-
|
146198
|
+
import_chalk84 = __toESM3(require_source());
|
146220
146199
|
init_confirm();
|
146221
146200
|
init_remove_env_record();
|
146222
146201
|
init_get_env_records();
|
146223
|
-
|
146202
|
+
init_format_environments();
|
146224
146203
|
init_env_target();
|
146225
146204
|
init_stamp();
|
146226
146205
|
init_param();
|
@@ -146228,6 +146207,7 @@ var init_rm5 = __esm({
|
|
146228
146207
|
init_known_error();
|
146229
146208
|
init_pkg_name();
|
146230
146209
|
init_errors_ts();
|
146210
|
+
init_get_custom_environments();
|
146231
146211
|
}
|
146232
146212
|
});
|
146233
146213
|
|
@@ -146451,24 +146431,21 @@ async function main6(client2) {
|
|
146451
146431
|
);
|
146452
146432
|
return 1;
|
146453
146433
|
} else {
|
146454
|
-
|
146455
|
-
config2.currentTeam = org.type === "team" ? org.id : void 0;
|
146434
|
+
config2.currentTeam = link4.org.type === "team" ? link4.org.id : void 0;
|
146456
146435
|
switch (subcommand) {
|
146457
146436
|
case "ls":
|
146458
|
-
return ls5(client2,
|
146437
|
+
return ls5(client2, link4, parsedArgs.flags, args2);
|
146459
146438
|
case "add":
|
146460
|
-
return add5(client2,
|
146439
|
+
return add5(client2, link4, parsedArgs.flags, args2);
|
146461
146440
|
case "rm":
|
146462
|
-
return rm5(client2,
|
146441
|
+
return rm5(client2, link4, parsedArgs.flags, args2);
|
146463
146442
|
case "pull":
|
146464
146443
|
return pull(
|
146465
146444
|
client2,
|
146466
146445
|
link4,
|
146467
|
-
project,
|
146468
146446
|
target,
|
146469
146447
|
parsedArgs.flags,
|
146470
146448
|
args2,
|
146471
|
-
output2,
|
146472
146449
|
cwd,
|
146473
146450
|
"vercel-cli:env:pull"
|
146474
146451
|
);
|
@@ -146515,7 +146492,7 @@ async function connect(client2, argv, args2, project, org) {
|
|
146515
146492
|
const repoArg = args2[0];
|
146516
146493
|
if (args2.length > 1) {
|
146517
146494
|
output2.error(
|
146518
|
-
`Invalid number of arguments. Usage: ${
|
146495
|
+
`Invalid number of arguments. Usage: ${import_chalk85.default.cyan(
|
146519
146496
|
`${getCommandName("project connect")}`
|
146520
146497
|
)}`
|
146521
146498
|
);
|
@@ -146561,7 +146538,7 @@ async function connect(client2, argv, args2, project, org) {
|
|
146561
146538
|
}
|
146562
146539
|
if (!gitConfig) {
|
146563
146540
|
output2.error(
|
146564
|
-
`No local Git repository found. Run ${
|
146541
|
+
`No local Git repository found. Run ${import_chalk85.default.cyan(
|
146565
146542
|
"`git clone <url>`"
|
146566
146543
|
)} to clone a remote Git repository first.`
|
146567
146544
|
);
|
@@ -146570,7 +146547,7 @@ async function connect(client2, argv, args2, project, org) {
|
|
146570
146547
|
const remoteUrls = pluckRemoteUrls(gitConfig);
|
146571
146548
|
if (!remoteUrls) {
|
146572
146549
|
output2.error(
|
146573
|
-
`No remote URLs found in your Git config. Make sure you've configured a remote repo in your local Git config. Run ${
|
146550
|
+
`No remote URLs found in your Git config. Make sure you've configured a remote repo in your local Git config. Run ${import_chalk85.default.cyan(
|
146574
146551
|
"`git remote --help`"
|
146575
146552
|
)} for more details.`
|
146576
146553
|
);
|
@@ -146614,7 +146591,7 @@ async function connect(client2, argv, args2, project, org) {
|
|
146614
146591
|
return checkAndConnect;
|
146615
146592
|
}
|
146616
146593
|
output2.log(
|
146617
|
-
`Connected ${formatProvider(provider)} repository ${
|
146594
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(repoPath)}!`
|
146618
146595
|
);
|
146619
146596
|
return 0;
|
146620
146597
|
}
|
@@ -146651,7 +146628,7 @@ async function connectArg({
|
|
146651
146628
|
return connect2;
|
146652
146629
|
}
|
146653
146630
|
client2.output.log(
|
146654
|
-
`Connected ${formatProvider(provider)} repository ${
|
146631
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(repoPath)}!`
|
146655
146632
|
);
|
146656
146633
|
return 0;
|
146657
146634
|
}
|
@@ -146693,7 +146670,7 @@ async function connectArgWithLocalGit({
|
|
146693
146670
|
return connect2;
|
146694
146671
|
}
|
146695
146672
|
client2.output.log(
|
146696
|
-
`Connected ${formatProvider(provider)} repository ${
|
146673
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(
|
146697
146674
|
repoPath
|
146698
146675
|
)}!`
|
146699
146676
|
);
|
@@ -146726,7 +146703,7 @@ async function promptConnectArg({
|
|
146726
146703
|
return true;
|
146727
146704
|
}
|
146728
146705
|
client2.output.log(
|
146729
|
-
`Found a repository in your local Git Config: ${
|
146706
|
+
`Found a repository in your local Git Config: ${import_chalk85.default.cyan(
|
146730
146707
|
Object.values(remoteUrls)[0]
|
146731
146708
|
)}`
|
146732
146709
|
);
|
@@ -146775,7 +146752,7 @@ async function checkExistsAndConnect({
|
|
146775
146752
|
const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
|
146776
146753
|
if (isSameRepo) {
|
146777
146754
|
client2.output.log(
|
146778
|
-
`${
|
146755
|
+
`${import_chalk85.default.cyan(connectedRepoPath)} is already connected to your project.`
|
146779
146756
|
);
|
146780
146757
|
return 1;
|
146781
146758
|
}
|
@@ -146808,7 +146785,7 @@ async function confirmRepoConnect(client2, yes, connectedProvider, connectedRepo
|
|
146808
146785
|
client2,
|
146809
146786
|
`Looks like you already have a ${formatProvider(
|
146810
146787
|
connectedProvider
|
146811
|
-
)} repository connected: ${
|
146788
|
+
)} repository connected: ${import_chalk85.default.cyan(
|
146812
146789
|
connectedRepoPath
|
146813
146790
|
)}. Do you want to replace it?`,
|
146814
146791
|
true
|
@@ -146823,7 +146800,7 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
146823
146800
|
let choices = [];
|
146824
146801
|
for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
|
146825
146802
|
choices.push({
|
146826
|
-
name: `${urlValue} ${
|
146803
|
+
name: `${urlValue} ${import_chalk85.default.gray(`(${urlKey})`)}`,
|
146827
146804
|
value: urlValue,
|
146828
146805
|
short: urlKey
|
146829
146806
|
});
|
@@ -146833,11 +146810,11 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
146833
146810
|
choices
|
146834
146811
|
});
|
146835
146812
|
}
|
146836
|
-
var
|
146813
|
+
var import_chalk85, import_path41;
|
146837
146814
|
var init_connect = __esm({
|
146838
146815
|
"src/commands/git/connect.ts"() {
|
146839
146816
|
"use strict";
|
146840
|
-
|
146817
|
+
import_chalk85 = __toESM3(require_source());
|
146841
146818
|
import_path41 = require("path");
|
146842
146819
|
init_create_git_meta();
|
146843
146820
|
init_confirm();
|
@@ -146853,7 +146830,7 @@ async function disconnect(client2, args2, project, org) {
|
|
146853
146830
|
const { output: output2 } = client2;
|
146854
146831
|
if (args2.length !== 0) {
|
146855
146832
|
output2.error(
|
146856
|
-
`Invalid number of arguments. Usage: ${
|
146833
|
+
`Invalid number of arguments. Usage: ${import_chalk86.default.cyan(
|
146857
146834
|
`${getCommandName("project disconnect")}`
|
146858
146835
|
)}`
|
146859
146836
|
);
|
@@ -146871,14 +146848,14 @@ async function disconnect(client2, args2, project, org) {
|
|
146871
146848
|
);
|
146872
146849
|
const confirmDisconnect = await confirm(
|
146873
146850
|
client2,
|
146874
|
-
`Are you sure you want to disconnect ${
|
146851
|
+
`Are you sure you want to disconnect ${import_chalk86.default.cyan(
|
146875
146852
|
`${linkOrg}/${repo}`
|
146876
146853
|
)} from your project?`,
|
146877
146854
|
false
|
146878
146855
|
);
|
146879
146856
|
if (confirmDisconnect) {
|
146880
146857
|
await disconnectGitProvider(client2, org, project.id);
|
146881
|
-
output2.log(`Disconnected ${
|
146858
|
+
output2.log(`Disconnected ${import_chalk86.default.cyan(`${linkOrg}/${repo}`)}.`);
|
146882
146859
|
} else {
|
146883
146860
|
output2.log("Canceled");
|
146884
146861
|
}
|
@@ -146892,11 +146869,11 @@ async function disconnect(client2, args2, project, org) {
|
|
146892
146869
|
}
|
146893
146870
|
return 0;
|
146894
146871
|
}
|
146895
|
-
var
|
146872
|
+
var import_chalk86;
|
146896
146873
|
var init_disconnect = __esm({
|
146897
146874
|
"src/commands/git/disconnect.ts"() {
|
146898
146875
|
"use strict";
|
146899
|
-
|
146876
|
+
import_chalk86 = __toESM3(require_source());
|
146900
146877
|
init_confirm();
|
146901
146878
|
init_pkg_name();
|
146902
146879
|
init_connect_git_provider();
|
@@ -147026,11 +147003,11 @@ var init_git = __esm({
|
|
147026
147003
|
});
|
147027
147004
|
|
147028
147005
|
// src/util/output/list-item.ts
|
147029
|
-
var
|
147006
|
+
var import_chalk87, listItem, list_item_default;
|
147030
147007
|
var init_list_item = __esm({
|
147031
147008
|
"src/util/output/list-item.ts"() {
|
147032
147009
|
"use strict";
|
147033
|
-
|
147010
|
+
import_chalk87 = __toESM3(require_source());
|
147034
147011
|
listItem = (msg, n) => {
|
147035
147012
|
if (!n) {
|
147036
147013
|
n = "-";
|
@@ -147038,7 +147015,7 @@ var init_list_item = __esm({
|
|
147038
147015
|
if (Number(n)) {
|
147039
147016
|
n += ".";
|
147040
147017
|
}
|
147041
|
-
return `${(0,
|
147018
|
+
return `${(0, import_chalk87.default)(n.toString())} ${msg}`;
|
147042
147019
|
};
|
147043
147020
|
list_item_default = listItem;
|
147044
147021
|
}
|
@@ -147230,9 +147207,9 @@ async function extractExample(client2, name, dir, force, ver = "v2") {
|
|
147230
147207
|
extractor.on("finish", resolve12);
|
147231
147208
|
res.body.pipe(extractor);
|
147232
147209
|
});
|
147233
|
-
const successLog = `Initialized "${
|
147210
|
+
const successLog = `Initialized "${import_chalk88.default.bold(
|
147234
147211
|
name
|
147235
|
-
)}" example in ${
|
147212
|
+
)}" example in ${import_chalk88.default.bold(humanizePath(folder))}.`;
|
147236
147213
|
const folderRel = import_path42.default.relative(client2.cwd, folder);
|
147237
147214
|
const deployHint = folderRel === "" ? list_item_default(`To deploy, run ${getCommandName()}.`) : list_item_default(
|
147238
147215
|
`To deploy, ${cmd(
|
@@ -147252,14 +147229,14 @@ function prepareFolder(cwd, folder, force) {
|
|
147252
147229
|
if (import_fs8.default.existsSync(dest)) {
|
147253
147230
|
if (!import_fs8.default.lstatSync(dest).isDirectory()) {
|
147254
147231
|
throw new Error(
|
147255
|
-
`Destination path "${
|
147232
|
+
`Destination path "${import_chalk88.default.bold(
|
147256
147233
|
folder
|
147257
147234
|
)}" already exists and is not a directory.`
|
147258
147235
|
);
|
147259
147236
|
}
|
147260
147237
|
if (!force && import_fs8.default.readdirSync(dest).length !== 0) {
|
147261
147238
|
throw new Error(
|
147262
|
-
`Destination path "${
|
147239
|
+
`Destination path "${import_chalk88.default.bold(
|
147263
147240
|
folder
|
147264
147241
|
)}" already exists and is not an empty directory. You may use ${cmd(
|
147265
147242
|
"--force"
|
@@ -147270,14 +147247,14 @@ function prepareFolder(cwd, folder, force) {
|
|
147270
147247
|
try {
|
147271
147248
|
import_fs8.default.mkdirSync(dest);
|
147272
147249
|
} catch (e2) {
|
147273
|
-
throw new Error(`Could not create directory "${
|
147250
|
+
throw new Error(`Could not create directory "${import_chalk88.default.bold(folder)}".`);
|
147274
147251
|
}
|
147275
147252
|
}
|
147276
147253
|
return dest;
|
147277
147254
|
}
|
147278
147255
|
async function guess(client2, exampleList, name) {
|
147279
147256
|
const GuessError = new Error(
|
147280
|
-
`No example found for ${
|
147257
|
+
`No example found for ${import_chalk88.default.bold(name)}, run ${getCommandName(
|
147281
147258
|
`init`
|
147282
147259
|
)} to see the list of available examples.`
|
147283
147260
|
);
|
@@ -147286,21 +147263,21 @@ async function guess(client2, exampleList, name) {
|
|
147286
147263
|
}
|
147287
147264
|
const found = did_you_mean_default(name, exampleList, 0.7);
|
147288
147265
|
if (typeof found === "string") {
|
147289
|
-
if (await confirm(client2, `Did you mean ${
|
147266
|
+
if (await confirm(client2, `Did you mean ${import_chalk88.default.bold(found)}?`, false)) {
|
147290
147267
|
return found;
|
147291
147268
|
}
|
147292
147269
|
} else {
|
147293
147270
|
throw GuessError;
|
147294
147271
|
}
|
147295
147272
|
}
|
147296
|
-
var import_fs8, import_path42, import_tar_fs,
|
147273
|
+
var import_fs8, import_path42, import_tar_fs, import_chalk88, EXAMPLE_API;
|
147297
147274
|
var init_init = __esm({
|
147298
147275
|
"src/commands/init/init.ts"() {
|
147299
147276
|
"use strict";
|
147300
147277
|
import_fs8 = __toESM3(require("fs"));
|
147301
147278
|
import_path42 = __toESM3(require("path"));
|
147302
147279
|
import_tar_fs = __toESM3(require_tar_fs());
|
147303
|
-
|
147280
|
+
import_chalk88 = __toESM3(require_source());
|
147304
147281
|
init_list();
|
147305
147282
|
init_list_item();
|
147306
147283
|
init_confirm();
|
@@ -147426,11 +147403,11 @@ var init_build_state = __esm({
|
|
147426
147403
|
});
|
147427
147404
|
|
147428
147405
|
// src/util/output/builds.ts
|
147429
|
-
var
|
147406
|
+
var import_chalk89, import_bytes7, padding, MAX_BUILD_GROUPS, MAX_OUTPUTS_PER_GROUP, hasOutput, getCommonPath, styleBuild, styleHiddenBuilds, styleOutput, getDirPath, sortByEntrypoint, groupBuilds, builds_default;
|
147430
147407
|
var init_builds = __esm({
|
147431
147408
|
"src/util/output/builds.ts"() {
|
147432
147409
|
"use strict";
|
147433
|
-
|
147410
|
+
import_chalk89 = __toESM3(require_source());
|
147434
147411
|
import_bytes7 = __toESM3(require_bytes());
|
147435
147412
|
init_build_state();
|
147436
147413
|
padding = 8;
|
@@ -147459,48 +147436,48 @@ var init_builds = __esm({
|
|
147459
147436
|
styleBuild = (build2, times, longestSource) => {
|
147460
147437
|
const { entrypoint, id } = build2;
|
147461
147438
|
const time = typeof times[id] === "string" ? times[id] : "";
|
147462
|
-
let pathColor =
|
147439
|
+
let pathColor = import_chalk89.default.cyan;
|
147463
147440
|
if (isFailed(build2)) {
|
147464
|
-
pathColor =
|
147441
|
+
pathColor = import_chalk89.default.red;
|
147465
147442
|
}
|
147466
147443
|
const entry = entrypoint.padEnd(longestSource + padding);
|
147467
147444
|
const prefix = hasOutput(build2) ? "\u250C" : "\u2576";
|
147468
|
-
return `${
|
147445
|
+
return `${import_chalk89.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
147469
147446
|
};
|
147470
147447
|
styleHiddenBuilds = (commonPath, buildGroup, times, longestSource, isHidden = false) => {
|
147471
147448
|
const { id } = buildGroup[0];
|
147472
147449
|
const entry = commonPath.padEnd(longestSource + padding);
|
147473
147450
|
const time = typeof times[id] === "string" ? times[id] : "";
|
147474
147451
|
const prefix = isHidden === false && buildGroup.some(hasOutput) ? "\u250C" : "\u2576";
|
147475
|
-
let pathColor =
|
147452
|
+
let pathColor = import_chalk89.default.cyan;
|
147476
147453
|
if (buildGroup.every(isFailed)) {
|
147477
|
-
pathColor =
|
147454
|
+
pathColor = import_chalk89.default.red;
|
147478
147455
|
}
|
147479
147456
|
if (isHidden) {
|
147480
|
-
pathColor =
|
147457
|
+
pathColor = import_chalk89.default.grey;
|
147481
147458
|
}
|
147482
|
-
return `${
|
147459
|
+
return `${import_chalk89.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
147483
147460
|
};
|
147484
147461
|
styleOutput = (output2, readyState, isLast) => {
|
147485
147462
|
const { type, path: path11, size, lambda } = output2;
|
147486
147463
|
const prefix = type === "lambda" ? "\u03BB " : "";
|
147487
|
-
const finalSize = size ? ` ${
|
147488
|
-
let color =
|
147464
|
+
const finalSize = size ? ` ${import_chalk89.default.grey(`(${(0, import_bytes7.default)(size)})`)}` : "";
|
147465
|
+
let color = import_chalk89.default.grey;
|
147489
147466
|
let finalRegion = "";
|
147490
147467
|
if (isReady({ readyState })) {
|
147491
|
-
color =
|
147468
|
+
color = import_chalk89.default;
|
147492
147469
|
} else if (isFailed({ readyState })) {
|
147493
|
-
color =
|
147470
|
+
color = import_chalk89.default.red;
|
147494
147471
|
}
|
147495
147472
|
if (lambda) {
|
147496
147473
|
const { deployedTo } = lambda;
|
147497
147474
|
if (deployedTo && deployedTo.length > 0) {
|
147498
|
-
finalRegion = ` ${
|
147475
|
+
finalRegion = ` ${import_chalk89.default.grey(`[${deployedTo.join(", ")}]`)}`;
|
147499
147476
|
}
|
147500
147477
|
}
|
147501
147478
|
const corner = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
|
147502
147479
|
const main15 = prefix + path11 + finalSize + finalRegion;
|
147503
|
-
return `${
|
147480
|
+
return `${import_chalk89.default.grey(corner)} ${color(main15)}`;
|
147504
147481
|
};
|
147505
147482
|
getDirPath = (path11, level = 0, highestLevel = null) => {
|
147506
147483
|
const parts = path11.split("/").slice(0, -1);
|
@@ -147632,7 +147609,7 @@ var init_builds = __esm({
|
|
147632
147609
|
);
|
147633
147610
|
if (outputs.length > MAX_OUTPUTS_PER_GROUP) {
|
147634
147611
|
final.push(
|
147635
|
-
|
147612
|
+
import_chalk89.default.grey(
|
147636
147613
|
`\u2514\u2500\u2500 ${outputs.length - MAX_OUTPUTS_PER_GROUP} output items hidden
|
147637
147614
|
`
|
147638
147615
|
)
|
@@ -147680,19 +147657,19 @@ function routes(routes2) {
|
|
147680
147657
|
const padding2 = 6;
|
147681
147658
|
const space = " ".repeat(padding2);
|
147682
147659
|
const destSpace = " ".repeat(longestDest || 10);
|
147683
|
-
const arrow =
|
147660
|
+
const arrow = import_chalk90.default.grey("->");
|
147684
147661
|
for (const item of routes2) {
|
147685
147662
|
if ("handle" in item) {
|
147686
|
-
toPrint += `${
|
147663
|
+
toPrint += `${import_chalk90.default.grey("\u2576")} ${import_chalk90.default.cyan(item.handle)}`;
|
147687
147664
|
continue;
|
147688
147665
|
}
|
147689
147666
|
const { src, dest, status, headers } = item;
|
147690
147667
|
const last = routes2.indexOf(item) === routes2.length - 1;
|
147691
147668
|
const suffix = last ? "" : `
|
147692
147669
|
`;
|
147693
|
-
const finalSrc =
|
147670
|
+
const finalSrc = import_chalk90.default.cyan(src.padEnd(longestSrc + padding2));
|
147694
147671
|
const finalDest = dest ? `${arrow}${space}${dest}` : ` ${space}${destSpace}`;
|
147695
|
-
const finalStatus = status ?
|
147672
|
+
const finalStatus = status ? import_chalk90.default.grey(`[${status}]`) : "";
|
147696
147673
|
let finalHeaders = null;
|
147697
147674
|
if (headers) {
|
147698
147675
|
finalHeaders = `
|
@@ -147703,21 +147680,21 @@ function routes(routes2) {
|
|
147703
147680
|
const last2 = headerKeys.indexOf(header) === headerKeys.length - 1;
|
147704
147681
|
const suffix2 = last2 ? "" : `
|
147705
147682
|
`;
|
147706
|
-
const prefix2 =
|
147683
|
+
const prefix2 = import_chalk90.default.grey(last2 ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500");
|
147707
147684
|
finalHeaders += `${prefix2} ${header}: ${value}${suffix2}`;
|
147708
147685
|
}
|
147709
147686
|
}
|
147710
|
-
const prefix =
|
147687
|
+
const prefix = import_chalk90.default.grey(finalHeaders ? "\u250C" : "\u2576");
|
147711
147688
|
const fill = `${finalSrc}${finalDest}${space}${finalStatus}`;
|
147712
147689
|
toPrint += `${prefix} ${fill}${finalHeaders || ""}${suffix}`;
|
147713
147690
|
}
|
147714
147691
|
return toPrint;
|
147715
147692
|
}
|
147716
|
-
var
|
147693
|
+
var import_chalk90, longestProperty;
|
147717
147694
|
var init_routes = __esm({
|
147718
147695
|
"src/util/output/routes.ts"() {
|
147719
147696
|
"use strict";
|
147720
|
-
|
147697
|
+
import_chalk90 = __toESM3(require_source());
|
147721
147698
|
longestProperty = (routes2, name) => {
|
147722
147699
|
const longestItem = routes2.sort((a, b) => {
|
147723
147700
|
const aName = a[name];
|
@@ -147855,7 +147832,7 @@ async function inspect3(client2) {
|
|
147855
147832
|
} catch {
|
147856
147833
|
}
|
147857
147834
|
client2.output.spinner(
|
147858
|
-
`Fetching deployment "${deploymentIdOrHost}" in ${
|
147835
|
+
`Fetching deployment "${deploymentIdOrHost}" in ${import_chalk91.default.bold(contextName)}`
|
147859
147836
|
);
|
147860
147837
|
let deployment = await getDeployment(client2, contextName, deploymentIdOrHost);
|
147861
147838
|
let abortController;
|
@@ -147882,7 +147859,7 @@ async function inspect3(client2) {
|
|
147882
147859
|
}
|
147883
147860
|
}
|
147884
147861
|
if (withLogs) {
|
147885
|
-
print(`${
|
147862
|
+
print(`${import_chalk91.default.cyan("status")} ${stateString(deployment.readyState)}
|
147886
147863
|
`);
|
147887
147864
|
} else {
|
147888
147865
|
await printDetails({ deployment, contextName, client: client2, startTimestamp });
|
@@ -147891,21 +147868,21 @@ async function inspect3(client2) {
|
|
147891
147868
|
}
|
147892
147869
|
function stateString(s) {
|
147893
147870
|
const CIRCLE = "\u25CF ";
|
147894
|
-
const sTitle = s && (0,
|
147871
|
+
const sTitle = s && (0, import_title5.default)(s);
|
147895
147872
|
switch (s) {
|
147896
147873
|
case "INITIALIZING":
|
147897
147874
|
case "BUILDING":
|
147898
|
-
return
|
147875
|
+
return import_chalk91.default.yellow(CIRCLE) + sTitle;
|
147899
147876
|
case "ERROR":
|
147900
|
-
return
|
147877
|
+
return import_chalk91.default.red(CIRCLE) + sTitle;
|
147901
147878
|
case "READY":
|
147902
|
-
return
|
147879
|
+
return import_chalk91.default.green(CIRCLE) + sTitle;
|
147903
147880
|
case "QUEUED":
|
147904
|
-
return
|
147881
|
+
return import_chalk91.default.gray(CIRCLE) + sTitle;
|
147905
147882
|
case "CANCELED":
|
147906
|
-
return
|
147883
|
+
return import_chalk91.default.gray(CIRCLE) + sTitle;
|
147907
147884
|
default:
|
147908
|
-
return
|
147885
|
+
return import_chalk91.default.gray("UNKNOWN");
|
147909
147886
|
}
|
147910
147887
|
}
|
147911
147888
|
async function printDetails({
|
@@ -147915,7 +147892,7 @@ async function printDetails({
|
|
147915
147892
|
startTimestamp
|
147916
147893
|
}) {
|
147917
147894
|
client2.output.log(
|
147918
|
-
`Fetched deployment "${
|
147895
|
+
`Fetched deployment "${import_chalk91.default.bold(deployment.url)}" in ${import_chalk91.default.bold(
|
147919
147896
|
contextName
|
147920
147897
|
)} ${elapsed(Date.now() - startTimestamp)}`
|
147921
147898
|
);
|
@@ -147931,14 +147908,14 @@ async function printDetails({
|
|
147931
147908
|
const { print, link: link4 } = client2.output;
|
147932
147909
|
const { builds } = deployment.version === 2 ? await client2.fetch(`/v11/deployments/${id}/builds`) : { builds: [] };
|
147933
147910
|
print("\n");
|
147934
|
-
print(
|
147935
|
-
print(` ${
|
147911
|
+
print(import_chalk91.default.bold(" General\n\n"));
|
147912
|
+
print(` ${import_chalk91.default.cyan("id")} ${id}
|
147936
147913
|
`);
|
147937
|
-
print(` ${
|
147914
|
+
print(` ${import_chalk91.default.cyan("name")} ${name}
|
147938
147915
|
`);
|
147939
147916
|
const customEnvironmentName = deployment.customEnvironment?.name;
|
147940
147917
|
const target = customEnvironmentName ?? deployment.target ?? "preview";
|
147941
|
-
print(` ${
|
147918
|
+
print(` ${import_chalk91.default.cyan("target")} `);
|
147942
147919
|
print(
|
147943
147920
|
deployment.customEnvironment && deployment.team?.slug ? `${link4(
|
147944
147921
|
`${target}`,
|
@@ -147948,13 +147925,13 @@ async function printDetails({
|
|
147948
147925
|
` : `${target}
|
147949
147926
|
`
|
147950
147927
|
);
|
147951
|
-
print(` ${
|
147928
|
+
print(` ${import_chalk91.default.cyan("status")} ${stateString(readyState)}
|
147952
147929
|
`);
|
147953
|
-
print(` ${
|
147930
|
+
print(` ${import_chalk91.default.cyan("url")} https://${url3}
|
147954
147931
|
`);
|
147955
147932
|
if (createdAt) {
|
147956
147933
|
print(
|
147957
|
-
` ${
|
147934
|
+
` ${import_chalk91.default.cyan("created")} ${new Date(createdAt)} ${elapsed(
|
147958
147935
|
Date.now() - createdAt,
|
147959
147936
|
true
|
147960
147937
|
)}
|
@@ -147963,10 +147940,10 @@ async function printDetails({
|
|
147963
147940
|
}
|
147964
147941
|
print("\n\n");
|
147965
147942
|
if (aliases !== void 0 && aliases.length > 0) {
|
147966
|
-
print(
|
147943
|
+
print(import_chalk91.default.bold(" Aliases\n\n"));
|
147967
147944
|
let aliasList = "";
|
147968
147945
|
for (const alias2 of aliases) {
|
147969
|
-
aliasList += `${
|
147946
|
+
aliasList += `${import_chalk91.default.gray("\u2576")} https://${alias2}
|
147970
147947
|
`;
|
147971
147948
|
}
|
147972
147949
|
print(indent_default(aliasList, 4));
|
@@ -147978,12 +147955,12 @@ async function printDetails({
|
|
147978
147955
|
const { id: id2, createdAt: createdAt2, readyStateAt } = build2;
|
147979
147956
|
times[id2] = createdAt2 && readyStateAt ? elapsed(readyStateAt - createdAt2) : null;
|
147980
147957
|
}
|
147981
|
-
print(
|
147958
|
+
print(import_chalk91.default.bold(" Builds\n\n"));
|
147982
147959
|
print(indent_default(builds_default(builds, times).toPrint, 4));
|
147983
147960
|
print("\n\n");
|
147984
147961
|
}
|
147985
147962
|
if (Array.isArray(routes2) && routes2.length > 0) {
|
147986
|
-
print(
|
147963
|
+
print(import_chalk91.default.bold(" Routes\n\n"));
|
147987
147964
|
print(indent_default(routes(routes2), 4));
|
147988
147965
|
print(`
|
147989
147966
|
|
@@ -147996,14 +147973,14 @@ function exitCode(state) {
|
|
147996
147973
|
}
|
147997
147974
|
return 0;
|
147998
147975
|
}
|
147999
|
-
var import_error_utils25,
|
147976
|
+
var import_error_utils25, import_chalk91, import_ms17, import_title5, import_url19;
|
148000
147977
|
var init_inspect2 = __esm({
|
148001
147978
|
"src/commands/inspect/index.ts"() {
|
148002
147979
|
"use strict";
|
148003
147980
|
import_error_utils25 = __toESM3(require_dist2());
|
148004
|
-
|
147981
|
+
import_chalk91 = __toESM3(require_source());
|
148005
147982
|
import_ms17 = __toESM3(require_ms2());
|
148006
|
-
|
147983
|
+
import_title5 = __toESM3(require_lib4());
|
148007
147984
|
import_url19 = require("url");
|
148008
147985
|
init_is_deploying();
|
148009
147986
|
init_logs();
|
@@ -148540,7 +148517,7 @@ async function list2(client2) {
|
|
148540
148517
|
});
|
148541
148518
|
let project;
|
148542
148519
|
let pagination;
|
148543
|
-
let contextName;
|
148520
|
+
let contextName = "";
|
148544
148521
|
let app = parsedArgs.args[1];
|
148545
148522
|
let deployments = [];
|
148546
148523
|
let singleDeployment = false;
|
@@ -148577,11 +148554,12 @@ async function list2(client2) {
|
|
148577
148554
|
deployments.push(deployment);
|
148578
148555
|
singleDeployment = true;
|
148579
148556
|
}
|
148580
|
-
|
148581
|
-
if (
|
148557
|
+
const p = await getProjectByNameOrId(client2, app);
|
148558
|
+
if (p instanceof ProjectNotFound) {
|
148582
148559
|
error3(`The provided argument "${app}" is not a valid project name`);
|
148583
148560
|
return 1;
|
148584
148561
|
}
|
148562
|
+
project = p;
|
148585
148563
|
} else {
|
148586
148564
|
const link4 = await ensureLink("list", client2, client2.cwd, {
|
148587
148565
|
autoConfirm
|
@@ -148606,14 +148584,9 @@ async function list2(client2) {
|
|
148606
148584
|
error3("Please provide a number for flag `--next`");
|
148607
148585
|
return 1;
|
148608
148586
|
}
|
148609
|
-
const
|
148610
|
-
const projectSlugBold = import_chalk90.default.bold(`${contextName}/${project.name}`);
|
148611
|
-
const projectSlugLink = client2.output.link(projectSlugBold, projectUrl, {
|
148612
|
-
fallback: () => projectSlugBold,
|
148613
|
-
color: false
|
148614
|
-
});
|
148587
|
+
const projectSlugLink = formatProject(client2, contextName, project.name);
|
148615
148588
|
if (!singleDeployment) {
|
148616
|
-
spinner(`Fetching deployments in ${
|
148589
|
+
spinner(`Fetching deployments in ${import_chalk92.default.bold(contextName)}`);
|
148617
148590
|
const start = Date.now();
|
148618
148591
|
debug3("Fetching deployments");
|
148619
148592
|
const query = new URLSearchParams({ limit: "20", projectId: project.id });
|
@@ -148653,7 +148626,7 @@ async function list2(client2) {
|
|
148653
148626
|
const urls = [];
|
148654
148627
|
const tablePrint = table(
|
148655
148628
|
[
|
148656
|
-
headers.map((header) =>
|
148629
|
+
headers.map((header) => import_chalk92.default.bold(import_chalk92.default.cyan(header))),
|
148657
148630
|
...deployments.sort(sortByCreatedAt).map((dep) => {
|
148658
148631
|
urls.push(`https://${dep.url}`);
|
148659
148632
|
const proposedExp = dep.proposedExpiration ? toDate(Math.min(Date.now(), dep.proposedExpiration)) : "No expiration";
|
@@ -148663,17 +148636,16 @@ async function list2(client2) {
|
|
148663
148636
|
const targetName = dep.customEnvironment?.name || (dep.target === "production" ? "Production" : "Preview");
|
148664
148637
|
const targetSlug = dep.customEnvironment?.id || dep.target || "preview";
|
148665
148638
|
return [
|
148666
|
-
|
148639
|
+
import_chalk92.default.gray(createdAt),
|
148667
148640
|
`https://${dep.url}`,
|
148668
148641
|
stateString2(dep.readyState || ""),
|
148669
|
-
client2.
|
148670
|
-
|
148671
|
-
|
148672
|
-
|
148673
|
-
),
|
148674
|
-
...!showPolicy ? [
|
148675
|
-
|
148676
|
-
...showPolicy ? [import_chalk90.default.gray(proposedExp)] : []
|
148642
|
+
formatEnvironment(client2, contextName, project.name, {
|
148643
|
+
id: targetSlug,
|
148644
|
+
name: targetName
|
148645
|
+
}),
|
148646
|
+
...!showPolicy ? [import_chalk92.default.gray(getDeploymentDuration(dep))] : [],
|
148647
|
+
...!showPolicy ? [import_chalk92.default.gray(dep.creator?.username)] : [],
|
148648
|
+
...showPolicy ? [import_chalk92.default.gray(proposedExp)] : []
|
148677
148649
|
];
|
148678
148650
|
}).filter(
|
148679
148651
|
(app2) => (
|
@@ -148714,23 +148686,23 @@ function getDeploymentDuration(dep) {
|
|
148714
148686
|
}
|
148715
148687
|
function stateString2(s) {
|
148716
148688
|
const CIRCLE = "\u25CF ";
|
148717
|
-
const sTitle = (0,
|
148689
|
+
const sTitle = (0, import_title6.default)(s);
|
148718
148690
|
switch (s) {
|
148719
148691
|
case "INITIALIZING":
|
148720
148692
|
case "BUILDING":
|
148721
148693
|
case "DEPLOYING":
|
148722
148694
|
case "ANALYZING":
|
148723
|
-
return
|
148695
|
+
return import_chalk92.default.yellow(CIRCLE) + sTitle;
|
148724
148696
|
case "ERROR":
|
148725
|
-
return
|
148697
|
+
return import_chalk92.default.red(CIRCLE) + sTitle;
|
148726
148698
|
case "READY":
|
148727
|
-
return
|
148699
|
+
return import_chalk92.default.green(CIRCLE) + sTitle;
|
148728
148700
|
case "QUEUED":
|
148729
|
-
return
|
148701
|
+
return import_chalk92.default.white(CIRCLE) + sTitle;
|
148730
148702
|
case "CANCELED":
|
148731
|
-
return
|
148703
|
+
return import_chalk92.default.gray(sTitle);
|
148732
148704
|
default:
|
148733
|
-
return
|
148705
|
+
return import_chalk92.default.gray("UNKNOWN");
|
148734
148706
|
}
|
148735
148707
|
}
|
148736
148708
|
function sortByCreatedAt(a, b) {
|
@@ -148746,14 +148718,14 @@ function filterUniqueApps() {
|
|
148746
148718
|
return true;
|
148747
148719
|
};
|
148748
148720
|
}
|
148749
|
-
var
|
148721
|
+
var import_ms18, import_chalk92, import_title6, import_error_utils26;
|
148750
148722
|
var init_list2 = __esm({
|
148751
148723
|
"src/commands/list/index.ts"() {
|
148752
148724
|
"use strict";
|
148753
|
-
import_chalk90 = __toESM3(require_source());
|
148754
148725
|
import_ms18 = __toESM3(require_ms2());
|
148726
|
+
import_chalk92 = __toESM3(require_source());
|
148727
|
+
import_title6 = __toESM3(require_lib4());
|
148755
148728
|
init_table();
|
148756
|
-
import_title7 = __toESM3(require_lib4());
|
148757
148729
|
init_get_args();
|
148758
148730
|
init_error2();
|
148759
148731
|
init_elapsed();
|
@@ -148773,6 +148745,8 @@ var init_list2 = __esm({
|
|
148773
148745
|
init_get_flags_specification();
|
148774
148746
|
init_get_deployment();
|
148775
148747
|
init_get_project_by_id_or_name();
|
148748
|
+
init_format_project();
|
148749
|
+
init_format_environment();
|
148776
148750
|
}
|
148777
148751
|
});
|
148778
148752
|
|
@@ -148835,7 +148809,7 @@ async function logs(client2) {
|
|
148835
148809
|
} catch {
|
148836
148810
|
}
|
148837
148811
|
spinner(
|
148838
|
-
`Fetching deployment "${deploymentIdOrHost}" in ${
|
148812
|
+
`Fetching deployment "${deploymentIdOrHost}" in ${import_chalk93.default.bold(contextName)}`
|
148839
148813
|
);
|
148840
148814
|
let deployment;
|
148841
148815
|
try {
|
@@ -148871,19 +148845,19 @@ function printDisclaimer(deployment, { print, warn }) {
|
|
148871
148845
|
`This command now displays runtime logs. To access your build logs, run \`vercel inspect --logs ${deployment.url}\``
|
148872
148846
|
);
|
148873
148847
|
print(
|
148874
|
-
`Displaying runtime logs for deployment ${deployment.url} (${
|
148848
|
+
`Displaying runtime logs for deployment ${deployment.url} (${import_chalk93.default.dim(
|
148875
148849
|
deployment.id
|
148876
|
-
)}) starting from ${
|
148850
|
+
)}) starting from ${import_chalk93.default.bold((0, import_format2.default)(Date.now(), dateTimeFormat2))}
|
148877
148851
|
|
148878
148852
|
`
|
148879
148853
|
);
|
148880
148854
|
}
|
148881
|
-
var import_error_utils27,
|
148855
|
+
var import_error_utils27, import_chalk93, import_format2, deprecatedFlags, dateTimeFormat2;
|
148882
148856
|
var init_logs2 = __esm({
|
148883
148857
|
"src/commands/logs/index.ts"() {
|
148884
148858
|
"use strict";
|
148885
148859
|
import_error_utils27 = __toESM3(require_dist2());
|
148886
|
-
|
148860
|
+
import_chalk93 = __toESM3(require_source());
|
148887
148861
|
import_format2 = __toESM3(require_format());
|
148888
148862
|
init_build_state();
|
148889
148863
|
init_is_deploying();
|
@@ -149052,7 +149026,7 @@ async function login2(client2) {
|
|
149052
149026
|
writeToConfigFile(client2.config);
|
149053
149027
|
output2.debug(`Saved credentials in "${humanizePath(global_path_default())}"`);
|
149054
149028
|
output2.print(
|
149055
|
-
`${
|
149029
|
+
`${import_chalk94.default.cyan("Congratulations!")} You are now logged in. In order to deploy something, run ${getCommandName()}.
|
149056
149030
|
`
|
149057
149031
|
);
|
149058
149032
|
output2.print(
|
@@ -149064,12 +149038,12 @@ async function login2(client2) {
|
|
149064
149038
|
);
|
149065
149039
|
return 0;
|
149066
149040
|
}
|
149067
|
-
var import_email_validator,
|
149041
|
+
var import_email_validator, import_chalk94;
|
149068
149042
|
var init_login2 = __esm({
|
149069
149043
|
"src/commands/login/index.ts"() {
|
149070
149044
|
"use strict";
|
149071
149045
|
import_email_validator = __toESM3(require_email_validator());
|
149072
|
-
|
149046
|
+
import_chalk94 = __toESM3(require_source());
|
149073
149047
|
init_humanize_path();
|
149074
149048
|
init_get_args();
|
149075
149049
|
init_prompt();
|
@@ -149194,12 +149168,12 @@ async function add7(client2, args2, contextName) {
|
|
149194
149168
|
const { output: output2 } = client2;
|
149195
149169
|
if (args2.length !== 1) {
|
149196
149170
|
output2.error(
|
149197
|
-
`Invalid number of arguments. Usage: ${
|
149171
|
+
`Invalid number of arguments. Usage: ${import_chalk95.default.cyan(
|
149198
149172
|
`${getCommandName("project add <name>")}`
|
149199
149173
|
)}`
|
149200
149174
|
);
|
149201
149175
|
if (args2.length > 1) {
|
149202
|
-
const example =
|
149176
|
+
const example = import_chalk95.default.cyan(
|
149203
149177
|
`${getCommandName(`project add "${args2.join(" ")}"`)}`
|
149204
149178
|
);
|
149205
149179
|
output2.log(
|
@@ -149225,17 +149199,17 @@ async function add7(client2, args2, contextName) {
|
|
149225
149199
|
}
|
149226
149200
|
const elapsed2 = (0, import_ms19.default)(Date.now() - start);
|
149227
149201
|
output2.log(
|
149228
|
-
`${
|
149202
|
+
`${import_chalk95.default.cyan("Success!")} Project ${import_chalk95.default.bold(
|
149229
149203
|
name.toLowerCase()
|
149230
|
-
)} added (${
|
149204
|
+
)} added (${import_chalk95.default.bold(contextName)}) ${import_chalk95.default.gray(`[${elapsed2}]`)}`
|
149231
149205
|
);
|
149232
149206
|
return;
|
149233
149207
|
}
|
149234
|
-
var
|
149208
|
+
var import_chalk95, import_ms19;
|
149235
149209
|
var init_add6 = __esm({
|
149236
149210
|
"src/commands/project/add.ts"() {
|
149237
149211
|
"use strict";
|
149238
|
-
|
149212
|
+
import_chalk95 = __toESM3(require_source());
|
149239
149213
|
import_ms19 = __toESM3(require_ms2());
|
149240
149214
|
init_errors_ts();
|
149241
149215
|
init_pkg_name();
|
@@ -149248,14 +149222,14 @@ async function list3(client2, argv, args2, contextName) {
|
|
149248
149222
|
const { output: output2 } = client2;
|
149249
149223
|
if (args2.length !== 0) {
|
149250
149224
|
output2.error(
|
149251
|
-
`Invalid number of arguments. Usage: ${
|
149225
|
+
`Invalid number of arguments. Usage: ${import_chalk96.default.cyan(
|
149252
149226
|
`${getCommandName("project ls")}`
|
149253
149227
|
)}`
|
149254
149228
|
);
|
149255
149229
|
return 2;
|
149256
149230
|
}
|
149257
149231
|
const start = Date.now();
|
149258
|
-
output2.spinner(`Fetching projects in ${
|
149232
|
+
output2.spinner(`Fetching projects in ${import_chalk96.default.bold(contextName)}`);
|
149259
149233
|
let projectsUrl = `/v9/projects?limit=20`;
|
149260
149234
|
const deprecated = argv["--update-required"] || false;
|
149261
149235
|
if (deprecated) {
|
@@ -149290,19 +149264,19 @@ async function list3(client2, argv, args2, contextName) {
|
|
149290
149264
|
);
|
149291
149265
|
}
|
149292
149266
|
output2.log(
|
149293
|
-
`${projectList.length > 0 ? "Projects" : "No projects"} found under ${
|
149267
|
+
`${projectList.length > 0 ? "Projects" : "No projects"} found under ${import_chalk96.default.bold(contextName)} ${deprecated ? "that are using a deprecated Node.js version" : "\b"} ${import_chalk96.default.gray(`[${elapsed2}]`)}`
|
149294
149268
|
);
|
149295
149269
|
if (projectList.length > 0) {
|
149296
149270
|
const tablePrint = table(
|
149297
149271
|
[
|
149298
149272
|
["Project Name", "Latest Production URL", "Updated"].map(
|
149299
|
-
(header) =>
|
149273
|
+
(header) => import_chalk96.default.bold(import_chalk96.default.cyan(header))
|
149300
149274
|
),
|
149301
149275
|
...projectList.map((project) => [
|
149302
149276
|
[
|
149303
|
-
|
149277
|
+
import_chalk96.default.bold(project.name),
|
149304
149278
|
getLatestProdUrl(project),
|
149305
|
-
|
149279
|
+
import_chalk96.default.gray((0, import_ms20.default)(Date.now() - project.updatedAt))
|
149306
149280
|
]
|
149307
149281
|
]).flat()
|
149308
149282
|
],
|
@@ -149326,11 +149300,11 @@ function getLatestProdUrl(project) {
|
|
149326
149300
|
return "https://" + alias2;
|
149327
149301
|
return "--";
|
149328
149302
|
}
|
149329
|
-
var
|
149303
|
+
var import_chalk96, import_ms20, import_build_utils17;
|
149330
149304
|
var init_list3 = __esm({
|
149331
149305
|
"src/commands/project/list.ts"() {
|
149332
149306
|
"use strict";
|
149333
|
-
|
149307
|
+
import_chalk96 = __toESM3(require_source());
|
149334
149308
|
import_ms20 = __toESM3(require_ms2());
|
149335
149309
|
init_table();
|
149336
149310
|
init_get_command_flags();
|
@@ -149343,7 +149317,7 @@ var init_list3 = __esm({
|
|
149343
149317
|
async function rm6(client2, args2) {
|
149344
149318
|
if (args2.length !== 1) {
|
149345
149319
|
client2.output.error(
|
149346
|
-
`Invalid number of arguments. Usage: ${
|
149320
|
+
`Invalid number of arguments. Usage: ${import_chalk97.default.cyan(
|
149347
149321
|
`${getCommandName("project rm <name>")}`
|
149348
149322
|
)}`
|
149349
149323
|
);
|
@@ -149372,7 +149346,7 @@ async function rm6(client2, args2) {
|
|
149372
149346
|
}
|
149373
149347
|
const elapsed2 = (0, import_ms21.default)(Date.now() - start);
|
149374
149348
|
client2.output.log(
|
149375
|
-
`${
|
149349
|
+
`${import_chalk97.default.cyan("Success!")} Project ${import_chalk97.default.bold(name)} removed ${import_chalk97.default.gray(
|
149376
149350
|
`[${elapsed2}]`
|
149377
149351
|
)}`
|
149378
149352
|
);
|
@@ -149381,19 +149355,19 @@ async function rm6(client2, args2) {
|
|
149381
149355
|
async function readConfirmation3(client2, projectName) {
|
149382
149356
|
client2.output.print(
|
149383
149357
|
prependEmoji(
|
149384
|
-
`The project ${
|
149358
|
+
`The project ${import_chalk97.default.bold(projectName)} will be removed permanently.
|
149385
149359
|
It will also delete everything under the project including deployments.
|
149386
149360
|
`,
|
149387
149361
|
emoji("warning")
|
149388
149362
|
)
|
149389
149363
|
);
|
149390
|
-
return await confirm(client2, `${
|
149364
|
+
return await confirm(client2, `${import_chalk97.default.bold.red("Are you sure?")}`, false);
|
149391
149365
|
}
|
149392
|
-
var
|
149366
|
+
var import_chalk97, import_ms21, e;
|
149393
149367
|
var init_rm6 = __esm({
|
149394
149368
|
"src/commands/project/rm.ts"() {
|
149395
149369
|
"use strict";
|
149396
|
-
|
149370
|
+
import_chalk97 = __toESM3(require_source());
|
149397
149371
|
import_ms21 = __toESM3(require_ms2());
|
149398
149372
|
init_emoji();
|
149399
149373
|
init_errors_ts();
|
@@ -149602,7 +149576,7 @@ async function getProjectByDeployment({
|
|
149602
149576
|
let team;
|
149603
149577
|
try {
|
149604
149578
|
output2?.spinner(
|
149605
|
-
`Fetching deployment "${deployId}" in ${
|
149579
|
+
`Fetching deployment "${deployId}" in ${import_chalk98.default.bold(contextName)}\u2026`
|
149606
149580
|
);
|
149607
149581
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
149608
149582
|
config2.currentTeam ? getTeamById(client2, config2.currentTeam) : void 0,
|
@@ -149619,12 +149593,12 @@ async function getProjectByDeployment({
|
|
149619
149593
|
team = teamResult.value;
|
149620
149594
|
deployment = deploymentResult.value;
|
149621
149595
|
output2?.log(
|
149622
|
-
`Fetching deployment "${deployId}" in ${
|
149596
|
+
`Fetching deployment "${deployId}" in ${import_chalk98.default.bold(contextName)}\u2026`
|
149623
149597
|
);
|
149624
149598
|
if (deployment.team?.id) {
|
149625
149599
|
if (!team || deployment.team.id !== team.id) {
|
149626
149600
|
const err = new Error(
|
149627
|
-
team ? `Deployment doesn't belong to current team ${
|
149601
|
+
team ? `Deployment doesn't belong to current team ${import_chalk98.default.bold(
|
149628
149602
|
contextName
|
149629
149603
|
)}` : `Deployment belongs to a different team`
|
149630
149604
|
);
|
@@ -149633,7 +149607,7 @@ async function getProjectByDeployment({
|
|
149633
149607
|
}
|
149634
149608
|
} else if (team) {
|
149635
149609
|
const err = new Error(
|
149636
|
-
`Deployment doesn't belong to current team ${
|
149610
|
+
`Deployment doesn't belong to current team ${import_chalk98.default.bold(contextName)}`
|
149637
149611
|
);
|
149638
149612
|
err.code = "ERR_INVALID_TEAM";
|
149639
149613
|
throw err;
|
@@ -149654,11 +149628,11 @@ async function getProjectByDeployment({
|
|
149654
149628
|
output2?.stopSpinner();
|
149655
149629
|
}
|
149656
149630
|
}
|
149657
|
-
var
|
149631
|
+
var import_chalk98;
|
149658
149632
|
var init_get_project_by_deployment = __esm({
|
149659
149633
|
"src/util/projects/get-project-by-deployment.ts"() {
|
149660
149634
|
"use strict";
|
149661
|
-
|
149635
|
+
import_chalk98 = __toESM3(require_source());
|
149662
149636
|
init_get_deployment();
|
149663
149637
|
init_get_project_by_id_or_name();
|
149664
149638
|
init_get_scope();
|
@@ -149671,21 +149645,21 @@ var init_get_project_by_deployment = __esm({
|
|
149671
149645
|
// src/util/alias/render-alias-status.ts
|
149672
149646
|
function renderAliasStatus(status) {
|
149673
149647
|
if (status === "completed") {
|
149674
|
-
return
|
149648
|
+
return import_chalk99.default.green(status);
|
149675
149649
|
}
|
149676
149650
|
if (status === "failed") {
|
149677
|
-
return
|
149651
|
+
return import_chalk99.default.red(status);
|
149678
149652
|
}
|
149679
149653
|
if (status === "skipped") {
|
149680
|
-
return
|
149654
|
+
return import_chalk99.default.gray(status);
|
149681
149655
|
}
|
149682
|
-
return
|
149656
|
+
return import_chalk99.default.yellow(status);
|
149683
149657
|
}
|
149684
|
-
var
|
149658
|
+
var import_chalk99;
|
149685
149659
|
var init_render_alias_status = __esm({
|
149686
149660
|
"src/util/alias/render-alias-status.ts"() {
|
149687
149661
|
"use strict";
|
149688
|
-
|
149662
|
+
import_chalk99 = __toESM3(require_source());
|
149689
149663
|
}
|
149690
149664
|
});
|
149691
149665
|
|
@@ -149760,7 +149734,7 @@ async function promoteStatus({
|
|
149760
149734
|
}
|
149761
149735
|
if (requestedAt < recentThreshold || Date.now() >= promoteTimeout) {
|
149762
149736
|
output2.log(
|
149763
|
-
`The promotion exceeded its deadline - rerun ${
|
149737
|
+
`The promotion exceeded its deadline - rerun ${import_chalk100.default.bold(
|
149764
149738
|
`${packageName} promote ${toDeploymentId}`
|
149765
149739
|
)} to try again`
|
149766
149740
|
);
|
@@ -149826,26 +149800,26 @@ async function renderJobSucceeded({
|
|
149826
149800
|
let deploymentInfo = "";
|
149827
149801
|
try {
|
149828
149802
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
149829
|
-
deploymentInfo = `${
|
149803
|
+
deploymentInfo = `${import_chalk100.default.bold(deployment.url)} (${toDeploymentId})`;
|
149830
149804
|
} catch (err) {
|
149831
149805
|
output2.debug(
|
149832
149806
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
149833
149807
|
);
|
149834
|
-
deploymentInfo =
|
149808
|
+
deploymentInfo = import_chalk100.default.bold(toDeploymentId);
|
149835
149809
|
}
|
149836
149810
|
const duration = performingPromote ? elapsed(Date.now() - requestedAt) : "";
|
149837
149811
|
output2.log(
|
149838
|
-
`Success! ${
|
149812
|
+
`Success! ${import_chalk100.default.bold(
|
149839
149813
|
project.name
|
149840
149814
|
)} was promoted to ${deploymentInfo} ${duration}`
|
149841
149815
|
);
|
149842
149816
|
return 0;
|
149843
149817
|
}
|
149844
|
-
var
|
149818
|
+
var import_chalk100, import_ms22;
|
149845
149819
|
var init_status = __esm({
|
149846
149820
|
"src/commands/promote/status.ts"() {
|
149847
149821
|
"use strict";
|
149848
|
-
|
149822
|
+
import_chalk100 = __toESM3(require_source());
|
149849
149823
|
init_elapsed();
|
149850
149824
|
init_format_date();
|
149851
149825
|
init_get_deployment();
|
@@ -149888,7 +149862,7 @@ async function requestPromote({
|
|
149888
149862
|
});
|
149889
149863
|
if (timeout !== void 0 && (0, import_ms23.default)(timeout) === 0) {
|
149890
149864
|
output2.log(
|
149891
|
-
`Successfully requested promote of ${
|
149865
|
+
`Successfully requested promote of ${import_chalk101.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
149892
149866
|
);
|
149893
149867
|
output2.log(`To check promote status, run ${getCommandName("promote")}.`);
|
149894
149868
|
return 0;
|
@@ -149901,11 +149875,11 @@ async function requestPromote({
|
|
149901
149875
|
timeout
|
149902
149876
|
});
|
149903
149877
|
}
|
149904
|
-
var
|
149878
|
+
var import_chalk101, import_ms23;
|
149905
149879
|
var init_request_promote = __esm({
|
149906
149880
|
"src/commands/promote/request-promote.ts"() {
|
149907
149881
|
"use strict";
|
149908
|
-
|
149882
|
+
import_chalk101 = __toESM3(require_source());
|
149909
149883
|
init_pkg_name();
|
149910
149884
|
init_get_project_by_deployment();
|
149911
149885
|
import_ms23 = __toESM3(require_ms2());
|
@@ -150067,7 +150041,7 @@ async function getDeploymentByIdOrURL({
|
|
150067
150041
|
let team;
|
150068
150042
|
try {
|
150069
150043
|
output2.spinner(
|
150070
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
150044
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk102.default.bold(contextName)}\u2026`
|
150071
150045
|
);
|
150072
150046
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
150073
150047
|
config2.currentTeam ? getTeamById(client2, config2.currentTeam) : void 0,
|
@@ -150084,7 +150058,7 @@ async function getDeploymentByIdOrURL({
|
|
150084
150058
|
team = teamResult.value;
|
150085
150059
|
deployment = deploymentResult.value;
|
150086
150060
|
output2.log(
|
150087
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
150061
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk102.default.bold(contextName)}\u2026`
|
150088
150062
|
);
|
150089
150063
|
} finally {
|
150090
150064
|
output2.stopSpinner();
|
@@ -150092,7 +150066,7 @@ async function getDeploymentByIdOrURL({
|
|
150092
150066
|
if (deployment.team?.id) {
|
150093
150067
|
if (!team || deployment.team.id !== team.id) {
|
150094
150068
|
const err = new Error(
|
150095
|
-
team ? `Deployment doesn't belong to current team ${
|
150069
|
+
team ? `Deployment doesn't belong to current team ${import_chalk102.default.bold(
|
150096
150070
|
contextName
|
150097
150071
|
)}` : `Deployment belongs to a different team`
|
150098
150072
|
);
|
@@ -150101,18 +150075,18 @@ async function getDeploymentByIdOrURL({
|
|
150101
150075
|
}
|
150102
150076
|
} else if (team) {
|
150103
150077
|
const err = new Error(
|
150104
|
-
`Deployment doesn't belong to current team ${
|
150078
|
+
`Deployment doesn't belong to current team ${import_chalk102.default.bold(contextName)}`
|
150105
150079
|
);
|
150106
150080
|
err.code = "ERR_INVALID_TEAM";
|
150107
150081
|
throw err;
|
150108
150082
|
}
|
150109
150083
|
return deployment;
|
150110
150084
|
}
|
150111
|
-
var
|
150085
|
+
var import_chalk102;
|
150112
150086
|
var init_get_deployment_by_id_or_url = __esm({
|
150113
150087
|
"src/util/deploy/get-deployment-by-id-or-url.ts"() {
|
150114
150088
|
"use strict";
|
150115
|
-
|
150089
|
+
import_chalk102 = __toESM3(require_source());
|
150116
150090
|
init_get_deployment();
|
150117
150091
|
init_get_team_by_id();
|
150118
150092
|
init_is_valid_name();
|
@@ -150213,14 +150187,14 @@ async function redeploy(client2) {
|
|
150213
150187
|
const previewUrl = `https://${deployment.url}`;
|
150214
150188
|
output2.print(
|
150215
150189
|
`${prependEmoji(
|
150216
|
-
`Inspect: ${
|
150190
|
+
`Inspect: ${import_chalk103.default.bold(deployment.inspectorUrl)} ${deployStamp()}`,
|
150217
150191
|
emoji("inspect")
|
150218
150192
|
)}
|
150219
150193
|
`
|
150220
150194
|
);
|
150221
150195
|
output2.print(
|
150222
150196
|
prependEmoji(
|
150223
|
-
`${isProdDeployment ? "Production" : "Preview"}: ${
|
150197
|
+
`${isProdDeployment ? "Production" : "Preview"}: ${import_chalk103.default.bold(
|
150224
150198
|
previewUrl
|
150225
150199
|
)} ${deployStamp()}`,
|
150226
150200
|
emoji("success")
|
@@ -150290,17 +150264,17 @@ async function redeploy(client2) {
|
|
150290
150264
|
output2.prettyError(err);
|
150291
150265
|
if ((0, import_error_utils30.isErrnoException)(err) && err.code === "ERR_INVALID_TEAM") {
|
150292
150266
|
output2.error(
|
150293
|
-
`Use ${
|
150267
|
+
`Use ${import_chalk103.default.bold("vc switch")} to change your current team`
|
150294
150268
|
);
|
150295
150269
|
}
|
150296
150270
|
return 1;
|
150297
150271
|
}
|
150298
150272
|
}
|
150299
|
-
var
|
150273
|
+
var import_chalk103, import_client12, import_error_utils30;
|
150300
150274
|
var init_redeploy = __esm({
|
150301
150275
|
"src/commands/redeploy/index.ts"() {
|
150302
150276
|
"use strict";
|
150303
|
-
|
150277
|
+
import_chalk103 = __toESM3(require_source());
|
150304
150278
|
import_client12 = __toESM3(require_dist12());
|
150305
150279
|
init_emoji();
|
150306
150280
|
init_get_args();
|
@@ -150510,7 +150484,7 @@ async function remove3(client2) {
|
|
150510
150484
|
}
|
150511
150485
|
const { contextName } = await getScope(client2);
|
150512
150486
|
output2.spinner(
|
150513
|
-
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${
|
150487
|
+
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk104.default.bold(contextName)}`
|
150514
150488
|
);
|
150515
150489
|
let aliases;
|
150516
150490
|
let projects;
|
@@ -150576,12 +150550,12 @@ async function remove3(client2) {
|
|
150576
150550
|
});
|
150577
150551
|
if (deployments.length === 0 && projects.length === 0) {
|
150578
150552
|
log2(
|
150579
|
-
`Could not find ${parsedArgs.flags["--safe"] ? "unaliased" : "any"} deployments or projects matching ${ids.map((id) =>
|
150553
|
+
`Could not find ${parsedArgs.flags["--safe"] ? "unaliased" : "any"} deployments or projects matching ${ids.map((id) => import_chalk104.default.bold(`"${id}"`)).join(", ")}. Run ${getCommandName("projects ls")} to list.`
|
150580
150554
|
);
|
150581
150555
|
return 1;
|
150582
150556
|
}
|
150583
150557
|
log2(
|
150584
|
-
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${
|
150558
|
+
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk104.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
|
150585
150559
|
);
|
150586
150560
|
if (deployments.length > 200) {
|
150587
150561
|
output2.warn(
|
@@ -150608,11 +150582,11 @@ async function remove3(client2) {
|
|
150608
150582
|
`Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
|
150609
150583
|
);
|
150610
150584
|
deployments.forEach((depl) => {
|
150611
|
-
output2.print(`${
|
150585
|
+
output2.print(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(depl.url)}
|
150612
150586
|
`);
|
150613
150587
|
});
|
150614
150588
|
projects.forEach((project) => {
|
150615
|
-
output2.print(`${
|
150589
|
+
output2.print(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(project.name)}
|
150616
150590
|
`);
|
150617
150591
|
});
|
150618
150592
|
return 0;
|
@@ -150629,8 +150603,8 @@ function readConfirmation4(deployments, projects, output2) {
|
|
150629
150603
|
);
|
150630
150604
|
const deploymentTable = table(
|
150631
150605
|
deployments.map((depl) => {
|
150632
|
-
const time =
|
150633
|
-
const url3 = depl.url ?
|
150606
|
+
const time = import_chalk104.default.gray(`${(0, import_ms25.default)(Date.now() - depl.createdAt)} ago`);
|
150607
|
+
const url3 = depl.url ? import_chalk104.default.underline(`https://${depl.url}`) : "";
|
150634
150608
|
return [` ${depl.id}`, url3, time];
|
150635
150609
|
}),
|
150636
150610
|
{ align: ["l", "r", "l"], hsep: 6 }
|
@@ -150641,7 +150615,7 @@ function readConfirmation4(deployments, projects, output2) {
|
|
150641
150615
|
for (const depl of deployments) {
|
150642
150616
|
for (const { alias: alias2 } of depl.aliases) {
|
150643
150617
|
output2.warn(
|
150644
|
-
`${
|
150618
|
+
`${import_chalk104.default.underline(`https://${alias2}`)} is an alias for ${import_chalk104.default.bold(depl.url)} and will be removed`
|
150645
150619
|
);
|
150646
150620
|
}
|
150647
150621
|
}
|
@@ -150655,12 +150629,12 @@ function readConfirmation4(deployments, projects, output2) {
|
|
150655
150629
|
`
|
150656
150630
|
);
|
150657
150631
|
for (const project of projects) {
|
150658
|
-
output2.print(`${
|
150632
|
+
output2.print(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(project.name)}
|
150659
150633
|
`);
|
150660
150634
|
}
|
150661
150635
|
}
|
150662
150636
|
output2.print(
|
150663
|
-
`${
|
150637
|
+
`${import_chalk104.default.bold.red("> Are you sure?")} ${import_chalk104.default.gray("(y/N) ")}`
|
150664
150638
|
);
|
150665
150639
|
process.stdin.on("data", (d) => {
|
150666
150640
|
process.stdin.pause();
|
@@ -150677,11 +150651,11 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
150677
150651
|
}
|
150678
150652
|
return `${(0, import_pluralize11.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize11.default)("project", projects.length, true)}`;
|
150679
150653
|
}
|
150680
|
-
var
|
150654
|
+
var import_chalk104, import_ms25, import_pluralize11;
|
150681
150655
|
var init_remove = __esm({
|
150682
150656
|
"src/commands/remove/index.ts"() {
|
150683
150657
|
"use strict";
|
150684
|
-
|
150658
|
+
import_chalk104 = __toESM3(require_source());
|
150685
150659
|
import_ms25 = __toESM3(require_ms2());
|
150686
150660
|
import_pluralize11 = __toESM3(require_pluralize());
|
150687
150661
|
init_table();
|
@@ -150776,7 +150750,7 @@ async function rollbackStatus({
|
|
150776
150750
|
}
|
150777
150751
|
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
150778
150752
|
output2.log(
|
150779
|
-
`The rollback exceeded its deadline - rerun ${
|
150753
|
+
`The rollback exceeded its deadline - rerun ${import_chalk105.default.bold(
|
150780
150754
|
`${packageName} rollback ${toDeploymentId}`
|
150781
150755
|
)} to try again`
|
150782
150756
|
);
|
@@ -150842,26 +150816,26 @@ async function renderJobSucceeded2({
|
|
150842
150816
|
let deploymentInfo = "";
|
150843
150817
|
try {
|
150844
150818
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
150845
|
-
deploymentInfo = `${
|
150819
|
+
deploymentInfo = `${import_chalk105.default.bold(deployment.url)} (${toDeploymentId})`;
|
150846
150820
|
} catch (err) {
|
150847
150821
|
output2.debug(
|
150848
150822
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
150849
150823
|
);
|
150850
|
-
deploymentInfo =
|
150824
|
+
deploymentInfo = import_chalk105.default.bold(toDeploymentId);
|
150851
150825
|
}
|
150852
150826
|
const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
|
150853
150827
|
output2.log(
|
150854
|
-
`Success! ${
|
150828
|
+
`Success! ${import_chalk105.default.bold(
|
150855
150829
|
project.name
|
150856
150830
|
)} was rolled back to ${deploymentInfo} ${duration}`
|
150857
150831
|
);
|
150858
150832
|
return 0;
|
150859
150833
|
}
|
150860
|
-
var
|
150834
|
+
var import_chalk105, import_ms26;
|
150861
150835
|
var init_status2 = __esm({
|
150862
150836
|
"src/commands/rollback/status.ts"() {
|
150863
150837
|
"use strict";
|
150864
|
-
|
150838
|
+
import_chalk105 = __toESM3(require_source());
|
150865
150839
|
init_elapsed();
|
150866
150840
|
init_format_date();
|
150867
150841
|
init_get_deployment();
|
@@ -150894,7 +150868,7 @@ async function requestRollback({
|
|
150894
150868
|
});
|
150895
150869
|
if (timeout !== void 0 && (0, import_ms27.default)(timeout) === 0) {
|
150896
150870
|
output2.log(
|
150897
|
-
`Successfully requested rollback of ${
|
150871
|
+
`Successfully requested rollback of ${import_chalk106.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
150898
150872
|
);
|
150899
150873
|
output2.log(`To check rollback status, run ${getCommandName("rollback")}.`);
|
150900
150874
|
return 0;
|
@@ -150907,11 +150881,11 @@ async function requestRollback({
|
|
150907
150881
|
timeout
|
150908
150882
|
});
|
150909
150883
|
}
|
150910
|
-
var
|
150884
|
+
var import_chalk106, import_ms27;
|
150911
150885
|
var init_request_rollback = __esm({
|
150912
150886
|
"src/commands/rollback/request-rollback.ts"() {
|
150913
150887
|
"use strict";
|
150914
|
-
|
150888
|
+
import_chalk106 = __toESM3(require_source());
|
150915
150889
|
init_pkg_name();
|
150916
150890
|
init_get_project_by_deployment();
|
150917
150891
|
import_ms27 = __toESM3(require_ms2());
|
@@ -151059,21 +151033,17 @@ async function list4(client2, argv, args2, link4) {
|
|
151059
151033
|
const { output: output2 } = client2;
|
151060
151034
|
if (args2.length !== 0) {
|
151061
151035
|
output2.error(
|
151062
|
-
`Invalid number of arguments. Usage: ${
|
151036
|
+
`Invalid number of arguments. Usage: ${import_chalk107.default.cyan(
|
151063
151037
|
`${getCommandName("target ls")}`
|
151064
151038
|
)}`
|
151065
151039
|
);
|
151066
151040
|
return 2;
|
151067
151041
|
}
|
151068
151042
|
const start = Date.now();
|
151069
|
-
const
|
151070
|
-
|
151071
|
-
|
151072
|
-
|
151073
|
-
{
|
151074
|
-
fallback: () => import_chalk105.default.bold(`${link4.org.slug}/${link4.project.name}`),
|
151075
|
-
color: false
|
151076
|
-
}
|
151043
|
+
const projectSlugLink = formatProject(
|
151044
|
+
client2,
|
151045
|
+
link4.org.slug,
|
151046
|
+
link4.project.name
|
151077
151047
|
);
|
151078
151048
|
output2.spinner(`Fetching custom environments for ${projectSlugLink}`);
|
151079
151049
|
const url3 = `/projects/${encodeURIComponent(
|
@@ -151087,27 +151057,27 @@ async function list4(client2, argv, args2, link4) {
|
|
151087
151057
|
const elapsed2 = (0, import_ms29.default)(Date.now() - start);
|
151088
151058
|
result = withDefaultEnvironmentsIncluded(result);
|
151089
151059
|
output2.log(
|
151090
|
-
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${
|
151060
|
+
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk107.default.gray(`[${elapsed2}]`)}`
|
151091
151061
|
);
|
151092
151062
|
const tablePrint = table(
|
151093
151063
|
[
|
151094
151064
|
["Target Name", "Target Slug", "Target ID", "Type", "Updated"].map(
|
151095
|
-
(header) =>
|
151065
|
+
(header) => import_chalk107.default.bold(import_chalk107.default.cyan(header))
|
151096
151066
|
),
|
151097
151067
|
...result.map((target) => {
|
151098
|
-
const boldName = import_chalk105.default.bold(target.name);
|
151099
151068
|
const type = target.type === "production" ? "Production" : target.type === "development" ? "Development" : "Preview";
|
151100
151069
|
return [
|
151101
151070
|
[
|
151102
|
-
|
151103
|
-
|
151104
|
-
|
151105
|
-
|
151071
|
+
formatEnvironment(
|
151072
|
+
client2,
|
151073
|
+
link4.org.slug,
|
151074
|
+
link4.project.name,
|
151075
|
+
target
|
151106
151076
|
),
|
151107
151077
|
target.slug,
|
151108
151078
|
target.id,
|
151109
151079
|
type,
|
151110
|
-
|
151080
|
+
import_chalk107.default.gray(
|
151111
151081
|
target.updatedAt > 0 ? (0, import_ms29.default)(Date.now() - target.updatedAt) : "-"
|
151112
151082
|
)
|
151113
151083
|
]
|
@@ -151157,14 +151127,16 @@ function withDefaultEnvironmentsIncluded(environments) {
|
|
151157
151127
|
}
|
151158
151128
|
];
|
151159
151129
|
}
|
151160
|
-
var
|
151130
|
+
var import_ms29, import_chalk107;
|
151161
151131
|
var init_list4 = __esm({
|
151162
151132
|
"src/commands/target/list.ts"() {
|
151163
151133
|
"use strict";
|
151164
|
-
import_chalk105 = __toESM3(require_source());
|
151165
151134
|
import_ms29 = __toESM3(require_ms2());
|
151135
|
+
import_chalk107 = __toESM3(require_source());
|
151166
151136
|
init_table();
|
151167
151137
|
init_pkg_name();
|
151138
|
+
init_format_project();
|
151139
|
+
init_format_environment();
|
151168
151140
|
}
|
151169
151141
|
});
|
151170
151142
|
|
@@ -151407,7 +151379,7 @@ async function list5(client2) {
|
|
151407
151379
|
client2.stdout.write("\n");
|
151408
151380
|
const teamTable = table(
|
151409
151381
|
[
|
151410
|
-
["id", "email / name"].map((str) => (0,
|
151382
|
+
["id", "email / name"].map((str) => (0, import_chalk108.gray)(str)),
|
151411
151383
|
...teamList.map((team) => [team.value, team.name])
|
151412
151384
|
],
|
151413
151385
|
{ hsep: 5 }
|
@@ -151424,13 +151396,13 @@ async function list5(client2) {
|
|
151424
151396
|
}
|
151425
151397
|
return 0;
|
151426
151398
|
}
|
151427
|
-
var
|
151399
|
+
var import_chalk108;
|
151428
151400
|
var init_list5 = __esm({
|
151429
151401
|
"src/commands/teams/list.ts"() {
|
151430
151402
|
"use strict";
|
151431
151403
|
init_chars();
|
151432
151404
|
init_table();
|
151433
|
-
|
151405
|
+
import_chalk108 = __toESM3(require_source());
|
151434
151406
|
init_get_user();
|
151435
151407
|
init_get_teams();
|
151436
151408
|
init_pkg_name();
|
@@ -151490,7 +151462,7 @@ Please select a team scope using ${getCommandName(
|
|
151490
151462
|
return 1;
|
151491
151463
|
}
|
151492
151464
|
output2.log(
|
151493
|
-
introMsg || `Inviting team members to ${
|
151465
|
+
introMsg || `Inviting team members to ${import_chalk109.default.bold(currentTeam.name)}`
|
151494
151466
|
);
|
151495
151467
|
if (emails.length > 0) {
|
151496
151468
|
for (const email3 of emails) {
|
@@ -151509,10 +151481,10 @@ Please select a team scope using ${getCommandName(
|
|
151509
151481
|
throw err;
|
151510
151482
|
}
|
151511
151483
|
output2.log(
|
151512
|
-
`${
|
151484
|
+
`${import_chalk109.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
|
151513
151485
|
);
|
151514
151486
|
} else {
|
151515
|
-
output2.log(`${
|
151487
|
+
output2.log(`${import_chalk109.default.red(`\u2716 ${email3}`)} ${import_chalk109.default.gray("[invalid]")}`);
|
151516
151488
|
}
|
151517
151489
|
}
|
151518
151490
|
return 0;
|
@@ -151546,15 +151518,15 @@ Please select a team scope using ${getCommandName(
|
|
151546
151518
|
);
|
151547
151519
|
email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
|
151548
151520
|
emails.push(email2);
|
151549
|
-
output2.log(`${
|
151521
|
+
output2.log(`${import_chalk109.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
|
151550
151522
|
if (hasError) {
|
151551
151523
|
hasError = false;
|
151552
151524
|
process.stderr.write(eraseLines(emails.length + 2));
|
151553
151525
|
output2.log(
|
151554
|
-
introMsg || `Inviting team members to ${
|
151526
|
+
introMsg || `Inviting team members to ${import_chalk109.default.bold(currentTeam.name)}`
|
151555
151527
|
);
|
151556
151528
|
for (const email3 of emails) {
|
151557
|
-
output2.log(`${
|
151529
|
+
output2.log(`${import_chalk109.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
151558
151530
|
}
|
151559
151531
|
}
|
151560
151532
|
} catch (err) {
|
@@ -151563,7 +151535,7 @@ Please select a team scope using ${getCommandName(
|
|
151563
151535
|
output2.error((0, import_error_utils32.errorToString)(err));
|
151564
151536
|
hasError = true;
|
151565
151537
|
for (const email3 of emails) {
|
151566
|
-
output2.log(`${
|
151538
|
+
output2.log(`${import_chalk109.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
151567
151539
|
}
|
151568
151540
|
}
|
151569
151541
|
}
|
@@ -151576,16 +151548,16 @@ Please select a team scope using ${getCommandName(
|
|
151576
151548
|
} else {
|
151577
151549
|
output2.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
|
151578
151550
|
for (const email3 of emails) {
|
151579
|
-
output2.log(`${
|
151551
|
+
output2.log(`${import_chalk109.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
151580
151552
|
}
|
151581
151553
|
}
|
151582
151554
|
return 0;
|
151583
151555
|
}
|
151584
|
-
var
|
151556
|
+
var import_chalk109, import_error_utils32, validateEmail2, domains, emailAutoComplete;
|
151585
151557
|
var init_invite = __esm({
|
151586
151558
|
"src/commands/teams/invite.ts"() {
|
151587
151559
|
"use strict";
|
151588
|
-
|
151560
|
+
import_chalk109 = __toESM3(require_source());
|
151589
151561
|
init_cmd();
|
151590
151562
|
init_stamp();
|
151591
151563
|
init_param();
|
@@ -151674,7 +151646,7 @@ async function add8(client2) {
|
|
151674
151646
|
let elapsed2;
|
151675
151647
|
const { output: output2 } = client2;
|
151676
151648
|
output2.log(
|
151677
|
-
`Pick a team identifier for its URL (e.g.: ${
|
151649
|
+
`Pick a team identifier for its URL (e.g.: ${import_chalk110.default.cyan(
|
151678
151650
|
"`vercel.com/acme`"
|
151679
151651
|
)})`
|
151680
151652
|
);
|
@@ -151707,7 +151679,7 @@ async function add8(client2) {
|
|
151707
151679
|
output2.stopSpinner();
|
151708
151680
|
process.stdout.write(eraseLines(2));
|
151709
151681
|
output2.success(`Team created ${elapsed2()}`);
|
151710
|
-
output2.log(`${
|
151682
|
+
output2.log(`${import_chalk110.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
|
151711
151683
|
`);
|
151712
151684
|
output2.log("Pick a display name for your team");
|
151713
151685
|
let name;
|
@@ -151730,7 +151702,7 @@ async function add8(client2) {
|
|
151730
151702
|
process.stdout.write(eraseLines(2));
|
151731
151703
|
team = Object.assign(team, res);
|
151732
151704
|
output2.success(`Team name saved ${elapsed2()}`);
|
151733
|
-
output2.log(`${
|
151705
|
+
output2.log(`${import_chalk110.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
|
151734
151706
|
`);
|
151735
151707
|
output2.spinner("Saving");
|
151736
151708
|
client2.config.currentTeam = team.id;
|
@@ -151744,11 +151716,11 @@ async function add8(client2) {
|
|
151744
151716
|
});
|
151745
151717
|
return 0;
|
151746
151718
|
}
|
151747
|
-
var
|
151719
|
+
var import_chalk110, import_error_utils33, validateSlugKeypress, validateNameKeypress, teamUrlPrefix, teamNamePrefix;
|
151748
151720
|
var init_add7 = __esm({
|
151749
151721
|
"src/commands/teams/add.ts"() {
|
151750
151722
|
"use strict";
|
151751
|
-
|
151723
|
+
import_chalk110 = __toESM3(require_source());
|
151752
151724
|
init_stamp();
|
151753
151725
|
init_erase_lines();
|
151754
151726
|
init_chars();
|
@@ -151769,7 +151741,7 @@ var init_add7 = __esm({
|
|
151769
151741
|
// should be fixed on utils/input/text.js
|
151770
151742
|
/^[ a-zA-Z0-9_-]+$/.test(value + data)
|
151771
151743
|
);
|
151772
|
-
teamUrlPrefix = "Team URL".padEnd(14) +
|
151744
|
+
teamUrlPrefix = "Team URL".padEnd(14) + import_chalk110.default.gray("vercel.com/");
|
151773
151745
|
teamNamePrefix = "Team Name".padEnd(14);
|
151774
151746
|
}
|
151775
151747
|
});
|
@@ -151789,22 +151761,22 @@ async function main13(client2, desiredSlug) {
|
|
151789
151761
|
const teamChoices = teams.slice(0).sort((a, b) => {
|
151790
151762
|
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
151791
151763
|
}).map((team) => {
|
151792
|
-
let
|
151764
|
+
let title7 = `${team.name} (${team.slug})`;
|
151793
151765
|
const selected = team.id === currentTeam?.id;
|
151794
151766
|
if (selected) {
|
151795
|
-
|
151767
|
+
title7 += ` ${import_chalk111.default.bold("(current)")}`;
|
151796
151768
|
}
|
151797
151769
|
if (team.limited) {
|
151798
|
-
|
151770
|
+
title7 += ` ${emoji("locked")}`;
|
151799
151771
|
}
|
151800
151772
|
return {
|
151801
|
-
name:
|
151773
|
+
name: title7,
|
151802
151774
|
value: team.slug,
|
151803
151775
|
short: team.slug,
|
151804
151776
|
selected
|
151805
151777
|
};
|
151806
151778
|
});
|
151807
|
-
let suffix = personalScopeSelected ? ` ${
|
151779
|
+
let suffix = personalScopeSelected ? ` ${import_chalk111.default.bold("(current)")}` : "";
|
151808
151780
|
if (user.limited) {
|
151809
151781
|
suffix += ` ${emoji("locked")}`;
|
151810
151782
|
}
|
@@ -151850,14 +151822,14 @@ async function main13(client2, desiredSlug) {
|
|
151850
151822
|
}
|
151851
151823
|
updateCurrentTeam(config2);
|
151852
151824
|
output2.success(
|
151853
|
-
`Your account (${
|
151825
|
+
`Your account (${import_chalk111.default.bold(user.username)}) is now active!`
|
151854
151826
|
);
|
151855
151827
|
return 0;
|
151856
151828
|
}
|
151857
151829
|
const newTeam = teams.find((team) => team.slug === desiredSlug);
|
151858
151830
|
if (!newTeam) {
|
151859
151831
|
output2.error(
|
151860
|
-
`You do not have permission to access scope ${
|
151832
|
+
`You do not have permission to access scope ${import_chalk111.default.bold(desiredSlug)}.`
|
151861
151833
|
);
|
151862
151834
|
return 1;
|
151863
151835
|
}
|
@@ -151875,15 +151847,15 @@ async function main13(client2, desiredSlug) {
|
|
151875
151847
|
}
|
151876
151848
|
updateCurrentTeam(config2, newTeam);
|
151877
151849
|
output2.success(
|
151878
|
-
`The team ${
|
151850
|
+
`The team ${import_chalk111.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
|
151879
151851
|
);
|
151880
151852
|
return 0;
|
151881
151853
|
}
|
151882
|
-
var
|
151854
|
+
var import_chalk111, updateCurrentTeam;
|
151883
151855
|
var init_switch = __esm({
|
151884
151856
|
"src/commands/teams/switch.ts"() {
|
151885
151857
|
"use strict";
|
151886
|
-
|
151858
|
+
import_chalk111 = __toESM3(require_source());
|
151887
151859
|
init_emoji();
|
151888
151860
|
init_get_user();
|
151889
151861
|
init_get_teams();
|
@@ -152047,7 +152019,7 @@ var import_error_utils34 = __toESM3(require_dist2());
|
|
152047
152019
|
var import_path43 = require("path");
|
152048
152020
|
var import_fs9 = require("fs");
|
152049
152021
|
var import_fs_extra23 = __toESM3(require_lib());
|
152050
|
-
var
|
152022
|
+
var import_chalk112 = __toESM3(require_source());
|
152051
152023
|
var import_epipebomb = __toESM3(require_epipebomb());
|
152052
152024
|
|
152053
152025
|
// src/util/get-latest-version/index.ts
|
@@ -152848,13 +152820,13 @@ var main14 = async () => {
|
|
152848
152820
|
const betaCommands = [];
|
152849
152821
|
if (betaCommands.includes(targetOrSubcommand)) {
|
152850
152822
|
output.print(
|
152851
|
-
`${
|
152823
|
+
`${import_chalk112.default.grey(
|
152852
152824
|
`${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
|
152853
152825
|
)}
|
152854
152826
|
`
|
152855
152827
|
);
|
152856
152828
|
} else {
|
152857
|
-
output.print(`${
|
152829
|
+
output.print(`${import_chalk112.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
|
152858
152830
|
`);
|
152859
152831
|
}
|
152860
152832
|
if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
|
@@ -153305,20 +153277,20 @@ main14().then(async (exitCode2) => {
|
|
153305
153277
|
});
|
153306
153278
|
if (latest) {
|
153307
153279
|
const changelog = "https://github.com/vercel/vercel/releases";
|
153308
|
-
const errorMsg = exitCode2 && exitCode2 !== 2 ?
|
153280
|
+
const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk112.default.magenta(
|
153309
153281
|
`
|
153310
153282
|
|
153311
|
-
The latest update ${
|
153283
|
+
The latest update ${import_chalk112.default.italic(
|
153312
153284
|
"may"
|
153313
153285
|
)} fix any errors that occurred.`
|
153314
153286
|
) : "";
|
153315
153287
|
output.print(
|
153316
153288
|
box(
|
153317
|
-
`Update available! ${
|
153289
|
+
`Update available! ${import_chalk112.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk112.default.green(
|
153318
153290
|
`v${latest}`
|
153319
153291
|
)}
|
153320
153292
|
Changelog: ${output.link(changelog, changelog, { fallback: false })}
|
153321
|
-
Run ${
|
153293
|
+
Run ${import_chalk112.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
|
153322
153294
|
)
|
153323
153295
|
);
|
153324
153296
|
output.print("\n\n");
|