vercel 33.6.3 → 33.7.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 +808 -847
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -4073,14 +4073,14 @@ var require_templates = __commonJS2({
|
|
4073
4073
|
}
|
4074
4074
|
return results;
|
4075
4075
|
}
|
4076
|
-
function buildStyle(
|
4076
|
+
function buildStyle(chalk110, 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 = chalk110;
|
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 = (chalk110, 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(chalk110, 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(chalk110, 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 chalk111 = {};
|
4160
|
+
applyOptions(chalk111, options);
|
4161
|
+
chalk111.template = (...arguments_) => chalkTag(chalk111.template, ...arguments_);
|
4162
|
+
Object.setPrototypeOf(chalk111, Chalk2.prototype);
|
4163
|
+
Object.setPrototypeOf(chalk111.template, chalk111);
|
4164
|
+
chalk111.template.constructor = () => {
|
4165
4165
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
4166
4166
|
};
|
4167
|
-
|
4168
|
-
return
|
4167
|
+
chalk111.template.Instance = ChalkClass;
|
4168
|
+
return chalk111.template;
|
4169
4169
|
};
|
4170
4170
|
function Chalk2(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 = (chalk111, ...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(chalk111, parts.join(""));
|
4296
4296
|
};
|
4297
4297
|
Object.defineProperties(Chalk2.prototype, styles);
|
4298
|
-
var
|
4299
|
-
|
4300
|
-
|
4301
|
-
|
4302
|
-
module2.exports =
|
4298
|
+
var chalk110 = Chalk2();
|
4299
|
+
chalk110.supportsColor = stdoutColor;
|
4300
|
+
chalk110.stderr = Chalk2({ level: stderrColor ? stderrColor.level : 0 });
|
4301
|
+
chalk110.stderr.supportsColor = stderrColor;
|
4302
|
+
module2.exports = chalk110;
|
4303
4303
|
}
|
4304
4304
|
});
|
4305
4305
|
|
@@ -13478,14 +13478,14 @@ var require_templates2 = __commonJS2({
|
|
13478
13478
|
}
|
13479
13479
|
return results;
|
13480
13480
|
}
|
13481
|
-
function buildStyle(
|
13481
|
+
function buildStyle(chalk110, 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 = chalk110;
|
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 = (chalk110, 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(chalk110, 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(chalk110, 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 Chalk2(options) {
|
13555
13555
|
if (!this || !(this instanceof Chalk2) || this.template) {
|
13556
|
-
const
|
13557
|
-
applyOptions(
|
13558
|
-
|
13556
|
+
const chalk110 = {};
|
13557
|
+
applyOptions(chalk110, options);
|
13558
|
+
chalk110.template = function() {
|
13559
13559
|
const args2 = [].slice.call(arguments);
|
13560
|
-
return chalkTag.apply(null, [
|
13560
|
+
return chalkTag.apply(null, [chalk110.template].concat(args2));
|
13561
13561
|
};
|
13562
|
-
Object.setPrototypeOf(
|
13563
|
-
Object.setPrototypeOf(
|
13564
|
-
|
13565
|
-
return
|
13562
|
+
Object.setPrototypeOf(chalk110, Chalk2.prototype);
|
13563
|
+
Object.setPrototypeOf(chalk110.template, chalk110);
|
13564
|
+
chalk110.template.constructor = Chalk2;
|
13565
|
+
return chalk110.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(chalk110, 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(chalk110, parts.join(""));
|
13695
13695
|
}
|
13696
13696
|
Object.defineProperties(Chalk2.prototype, styles);
|
13697
13697
|
module2.exports = Chalk2();
|
@@ -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 chalk110 = require_chalk();
|
15492
15492
|
var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
|
15493
15493
|
var main14 = {
|
15494
|
-
info:
|
15495
|
-
success:
|
15496
|
-
warning:
|
15497
|
-
error:
|
15494
|
+
info: chalk110.blue("\u2139"),
|
15495
|
+
success: chalk110.green("\u2714"),
|
15496
|
+
warning: chalk110.yellow("\u26A0"),
|
15497
|
+
error: chalk110.red("\u2716")
|
15498
15498
|
};
|
15499
15499
|
var fallbacks = {
|
15500
|
-
info:
|
15501
|
-
success:
|
15502
|
-
warning:
|
15503
|
-
error:
|
15500
|
+
info: chalk110.blue("i"),
|
15501
|
+
success: chalk110.green("\u221A"),
|
15502
|
+
warning: chalk110.yellow("\u203C"),
|
15503
|
+
error: chalk110.red("\xD7")
|
15504
15504
|
};
|
15505
15505
|
module2.exports = isSupported ? main14 : 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 chalk110 = 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 = chalk110[this.color](frame);
|
15989
15989
|
}
|
15990
15990
|
this.frameIndex = ++this.frameIndex % frames.length;
|
15991
15991
|
const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
|
@@ -70612,14 +70612,14 @@ var require_templates3 = __commonJS2({
|
|
70612
70612
|
}
|
70613
70613
|
return results;
|
70614
70614
|
}
|
70615
|
-
function buildStyle(
|
70615
|
+
function buildStyle(chalk110, styles) {
|
70616
70616
|
const enabled = {};
|
70617
70617
|
for (const layer of styles) {
|
70618
70618
|
for (const style of layer.styles) {
|
70619
70619
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
70620
70620
|
}
|
70621
70621
|
}
|
70622
|
-
let current =
|
70622
|
+
let current = chalk110;
|
70623
70623
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
70624
70624
|
if (!Array.isArray(styles2)) {
|
70625
70625
|
continue;
|
@@ -70631,7 +70631,7 @@ var require_templates3 = __commonJS2({
|
|
70631
70631
|
}
|
70632
70632
|
return current;
|
70633
70633
|
}
|
70634
|
-
module2.exports = (
|
70634
|
+
module2.exports = (chalk110, temporary) => {
|
70635
70635
|
const styles = [];
|
70636
70636
|
const chunks = [];
|
70637
70637
|
let chunk = [];
|
@@ -70641,13 +70641,13 @@ var require_templates3 = __commonJS2({
|
|
70641
70641
|
} else if (style) {
|
70642
70642
|
const string = chunk.join("");
|
70643
70643
|
chunk = [];
|
70644
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
70644
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk110, styles)(string));
|
70645
70645
|
styles.push({ inverse, styles: parseStyle(style) });
|
70646
70646
|
} else if (close2) {
|
70647
70647
|
if (styles.length === 0) {
|
70648
70648
|
throw new Error("Found extraneous } in Chalk template literal");
|
70649
70649
|
}
|
70650
|
-
chunks.push(buildStyle(
|
70650
|
+
chunks.push(buildStyle(chalk110, styles)(chunk.join("")));
|
70651
70651
|
chunk = [];
|
70652
70652
|
styles.pop();
|
70653
70653
|
} else {
|
@@ -70695,16 +70695,16 @@ var require_source2 = __commonJS2({
|
|
70695
70695
|
}
|
70696
70696
|
};
|
70697
70697
|
var chalkFactory = (options) => {
|
70698
|
-
const
|
70699
|
-
applyOptions(
|
70700
|
-
|
70701
|
-
Object.setPrototypeOf(
|
70702
|
-
Object.setPrototypeOf(
|
70703
|
-
|
70698
|
+
const chalk111 = {};
|
70699
|
+
applyOptions(chalk111, options);
|
70700
|
+
chalk111.template = (...arguments_) => chalkTag(chalk111.template, ...arguments_);
|
70701
|
+
Object.setPrototypeOf(chalk111, Chalk2.prototype);
|
70702
|
+
Object.setPrototypeOf(chalk111.template, chalk111);
|
70703
|
+
chalk111.template.constructor = () => {
|
70704
70704
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
70705
70705
|
};
|
70706
|
-
|
70707
|
-
return
|
70706
|
+
chalk111.template.Instance = ChalkClass;
|
70707
|
+
return chalk111.template;
|
70708
70708
|
};
|
70709
70709
|
function Chalk2(options) {
|
70710
70710
|
return chalkFactory(options);
|
@@ -70815,7 +70815,7 @@ var require_source2 = __commonJS2({
|
|
70815
70815
|
return openAll + string + closeAll;
|
70816
70816
|
};
|
70817
70817
|
var template;
|
70818
|
-
var chalkTag = (
|
70818
|
+
var chalkTag = (chalk111, ...strings) => {
|
70819
70819
|
const [firstString] = strings;
|
70820
70820
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
70821
70821
|
return strings.join(" ");
|
@@ -70831,14 +70831,14 @@ var require_source2 = __commonJS2({
|
|
70831
70831
|
if (template === void 0) {
|
70832
70832
|
template = require_templates3();
|
70833
70833
|
}
|
70834
|
-
return template(
|
70834
|
+
return template(chalk111, parts.join(""));
|
70835
70835
|
};
|
70836
70836
|
Object.defineProperties(Chalk2.prototype, styles);
|
70837
|
-
var
|
70838
|
-
|
70839
|
-
|
70840
|
-
|
70841
|
-
module2.exports =
|
70837
|
+
var chalk110 = Chalk2();
|
70838
|
+
chalk110.supportsColor = stdoutColor;
|
70839
|
+
chalk110.stderr = Chalk2({ level: stderrColor ? stderrColor.level : 0 });
|
70840
|
+
chalk110.stderr.supportsColor = stderrColor;
|
70841
|
+
module2.exports = chalk110;
|
70842
70842
|
}
|
70843
70843
|
});
|
70844
70844
|
|
@@ -73455,11 +73455,11 @@ var init_screen_manager = __esm({
|
|
73455
73455
|
this.rl.output.unmute();
|
73456
73456
|
const promptLine = lastLine(content);
|
73457
73457
|
const rawPromptLine = (0, import_strip_ansi.default)(promptLine);
|
73458
|
-
let
|
73458
|
+
let prompt2 = rawPromptLine;
|
73459
73459
|
if (this.rl.line.length) {
|
73460
|
-
|
73460
|
+
prompt2 = prompt2.slice(0, -this.rl.line.length);
|
73461
73461
|
}
|
73462
|
-
this.rl.setPrompt(
|
73462
|
+
this.rl.setPrompt(prompt2);
|
73463
73463
|
this.cursorPos = this.rl.getCursorPos();
|
73464
73464
|
const width = readlineWidth();
|
73465
73465
|
content = breakLines(content, width);
|
@@ -73517,7 +73517,7 @@ var init_screen_manager = __esm({
|
|
73517
73517
|
|
73518
73518
|
// ../../node_modules/.pnpm/@inquirer+core@7.1.0/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs
|
73519
73519
|
function createPrompt(view) {
|
73520
|
-
const
|
73520
|
+
const prompt2 = (config3, context) => {
|
73521
73521
|
const input = context?.input ?? process.stdin;
|
73522
73522
|
const output2 = new import_mute_stream.default();
|
73523
73523
|
output2.pipe(context?.output ?? process.stdout);
|
@@ -73585,7 +73585,7 @@ function createPrompt(view) {
|
|
73585
73585
|
answer.cancel = cancel;
|
73586
73586
|
return answer;
|
73587
73587
|
};
|
73588
|
-
return
|
73588
|
+
return prompt2;
|
73589
73589
|
}
|
73590
73590
|
var readline2, import_mute_stream;
|
73591
73591
|
var init_create_prompt = __esm({
|
@@ -74390,11 +74390,11 @@ var init_screen_manager2 = __esm({
|
|
74390
74390
|
this.rl.output.unmute();
|
74391
74391
|
const promptLine = lastLine2(content);
|
74392
74392
|
const rawPromptLine = (0, import_strip_ansi2.default)(promptLine);
|
74393
|
-
let
|
74393
|
+
let prompt2 = rawPromptLine;
|
74394
74394
|
if (this.rl.line.length) {
|
74395
|
-
|
74395
|
+
prompt2 = prompt2.slice(0, -this.rl.line.length);
|
74396
74396
|
}
|
74397
|
-
this.rl.setPrompt(
|
74397
|
+
this.rl.setPrompt(prompt2);
|
74398
74398
|
this.cursorPos = this.rl.getCursorPos();
|
74399
74399
|
const width = readlineWidth2();
|
74400
74400
|
content = breakLines2(content, width);
|
@@ -74452,7 +74452,7 @@ var init_screen_manager2 = __esm({
|
|
74452
74452
|
|
74453
74453
|
// ../../node_modules/.pnpm/@inquirer+core@7.1.1/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs
|
74454
74454
|
function createPrompt2(view) {
|
74455
|
-
const
|
74455
|
+
const prompt2 = (config3, context) => {
|
74456
74456
|
const input = context?.input ?? process.stdin;
|
74457
74457
|
const output2 = new import_mute_stream2.default();
|
74458
74458
|
output2.pipe(context?.output ?? process.stdout);
|
@@ -74520,7 +74520,7 @@ function createPrompt2(view) {
|
|
74520
74520
|
answer.cancel = cancel;
|
74521
74521
|
return answer;
|
74522
74522
|
};
|
74523
|
-
return
|
74523
|
+
return prompt2;
|
74524
74524
|
}
|
74525
74525
|
var readline4, import_mute_stream2;
|
74526
74526
|
var init_create_prompt2 = __esm({
|
@@ -76210,6 +76210,9 @@ function handleError(error4, { debug: debug3 = false } = {}) {
|
|
76210
76210
|
if (debug3) {
|
76211
76211
|
console.log(`> [debug] handling error: ${stack2}`);
|
76212
76212
|
}
|
76213
|
+
if (message2 === "User force closed the prompt with 0 null") {
|
76214
|
+
return;
|
76215
|
+
}
|
76213
76216
|
if (status === 403) {
|
76214
76217
|
console.error(
|
76215
76218
|
error(
|
@@ -110834,76 +110837,6 @@ var init_get_domain_status = __esm({
|
|
110834
110837
|
}
|
110835
110838
|
});
|
110836
110839
|
|
110837
|
-
// src/util/input/prompt-bool.ts
|
110838
|
-
async function promptBool(label, options) {
|
110839
|
-
const {
|
110840
|
-
stdin,
|
110841
|
-
stdout,
|
110842
|
-
defaultValue = false,
|
110843
|
-
abortSequences = /* @__PURE__ */ new Set([""]),
|
110844
|
-
resolveChars = /* @__PURE__ */ new Set(["\r"]),
|
110845
|
-
yesChar = "y",
|
110846
|
-
noChar = "n",
|
110847
|
-
trailing = ""
|
110848
|
-
} = options;
|
110849
|
-
return new Promise((resolve12) => {
|
110850
|
-
const isRaw = Boolean(stdin && stdin.isRaw);
|
110851
|
-
if (stdin) {
|
110852
|
-
if (stdin.setRawMode) {
|
110853
|
-
stdin.setRawMode(true);
|
110854
|
-
}
|
110855
|
-
stdin.resume();
|
110856
|
-
}
|
110857
|
-
function restore() {
|
110858
|
-
stdout.write(trailing);
|
110859
|
-
if (stdin) {
|
110860
|
-
if (stdin.setRawMode) {
|
110861
|
-
stdin.setRawMode(isRaw);
|
110862
|
-
}
|
110863
|
-
stdin.pause();
|
110864
|
-
stdin.removeListener("data", onData);
|
110865
|
-
}
|
110866
|
-
}
|
110867
|
-
function onData(buffer) {
|
110868
|
-
const data = buffer.toString();
|
110869
|
-
if (data[0].toLowerCase() === yesChar) {
|
110870
|
-
restore();
|
110871
|
-
stdout.write(`
|
110872
|
-
`);
|
110873
|
-
resolve12(true);
|
110874
|
-
} else if (data[0].toLowerCase() === noChar) {
|
110875
|
-
stdout.write(`
|
110876
|
-
`);
|
110877
|
-
restore();
|
110878
|
-
resolve12(false);
|
110879
|
-
} else if (abortSequences.has(data)) {
|
110880
|
-
stdout.write(`
|
110881
|
-
`);
|
110882
|
-
restore();
|
110883
|
-
resolve12(false);
|
110884
|
-
} else if (resolveChars.has(data[0])) {
|
110885
|
-
stdout.write(`
|
110886
|
-
`);
|
110887
|
-
restore();
|
110888
|
-
resolve12(defaultValue);
|
110889
|
-
} else {
|
110890
|
-
}
|
110891
|
-
}
|
110892
|
-
const defaultText = defaultValue === null ? `[${yesChar}|${noChar}]` : defaultValue ? `[${import_chalk30.default.bold(yesChar.toUpperCase())}|${noChar}]` : `[${yesChar}|${import_chalk30.default.bold(noChar.toUpperCase())}]`;
|
110893
|
-
stdout.write(`${import_chalk30.default.gray(">")} ${label} ${import_chalk30.default.gray(defaultText)} `);
|
110894
|
-
if (stdin) {
|
110895
|
-
stdin.on("data", onData);
|
110896
|
-
}
|
110897
|
-
});
|
110898
|
-
}
|
110899
|
-
var import_chalk30;
|
110900
|
-
var init_prompt_bool = __esm({
|
110901
|
-
"src/util/input/prompt-bool.ts"() {
|
110902
|
-
"use strict";
|
110903
|
-
import_chalk30 = __toESM3(require_source());
|
110904
|
-
}
|
110905
|
-
});
|
110906
|
-
|
110907
110840
|
// src/util/domains/purchase-domain.ts
|
110908
110841
|
async function purchaseDomain(client2, name, expectedPrice, renew = true) {
|
110909
110842
|
try {
|
@@ -110947,7 +110880,7 @@ var init_purchase_domain = __esm({
|
|
110947
110880
|
|
110948
110881
|
// src/util/domains/purchase-domain-if-available.ts
|
110949
110882
|
async function purchaseDomainIfAvailable(output2, client2, domain, contextName) {
|
110950
|
-
output2.spinner(`Checking status of ${
|
110883
|
+
output2.spinner(`Checking status of ${import_chalk30.default.bold(domain)}`);
|
110951
110884
|
const buyDomainStamp = stamp_default();
|
110952
110885
|
const { available } = await getDomainStatus(client2, domain);
|
110953
110886
|
if (available) {
|
@@ -110966,15 +110899,16 @@ async function purchaseDomainIfAvailable(output2, client2, domain, contextName)
|
|
110966
110899
|
}
|
110967
110900
|
const { price, period } = domainPrice;
|
110968
110901
|
output2.log(
|
110969
|
-
`Domain not found, but you can buy it under ${
|
110902
|
+
`Domain not found, but you can buy it under ${import_chalk30.default.bold(
|
110970
110903
|
contextName
|
110971
110904
|
)}! ${buyDomainStamp()}`
|
110972
110905
|
);
|
110973
|
-
if (!await
|
110974
|
-
|
110906
|
+
if (!await confirm(
|
110907
|
+
client2,
|
110908
|
+
`Buy ${import_chalk30.default.underline(domain)} for ${import_chalk30.default.bold(
|
110975
110909
|
`$${price}`
|
110976
110910
|
)} (${(0, import_pluralize.default)("yr", period, true)})?`,
|
110977
|
-
|
110911
|
+
false
|
110978
110912
|
)) {
|
110979
110913
|
output2.print(eraseLines(1));
|
110980
110914
|
return new UserAborted();
|
@@ -110992,16 +110926,16 @@ async function purchaseDomainIfAvailable(output2, client2, domain, contextName)
|
|
110992
110926
|
output2.debug(`Domain ${domain} is not available to be purchased`);
|
110993
110927
|
return false;
|
110994
110928
|
}
|
110995
|
-
var
|
110929
|
+
var import_chalk30, import_pluralize, isTTY;
|
110996
110930
|
var init_purchase_domain_if_available = __esm({
|
110997
110931
|
"src/util/domains/purchase-domain-if-available.ts"() {
|
110998
110932
|
"use strict";
|
110999
|
-
|
110933
|
+
import_chalk30 = __toESM3(require_source());
|
111000
110934
|
import_pluralize = __toESM3(require_pluralize());
|
111001
110935
|
init_erase_lines();
|
111002
110936
|
init_get_domain_price();
|
111003
110937
|
init_get_domain_status();
|
111004
|
-
|
110938
|
+
init_confirm();
|
111005
110939
|
init_purchase_domain();
|
111006
110940
|
init_stamp();
|
111007
110941
|
init_errors_ts();
|
@@ -111182,7 +111116,7 @@ async function getAppLastDeployment(output2, client2, appName, user, contextName
|
|
111182
111116
|
return null;
|
111183
111117
|
}
|
111184
111118
|
async function getDeploymentForAlias(client2, output2, args2, localConfigPath, user, contextName, localConfig) {
|
111185
|
-
output2.spinner(`Fetching deployment to alias in ${
|
111119
|
+
output2.spinner(`Fetching deployment to alias in ${import_chalk31.default.bold(contextName)}`);
|
111186
111120
|
if (args2.length === 2) {
|
111187
111121
|
const [deploymentId] = args2;
|
111188
111122
|
try {
|
@@ -111207,12 +111141,12 @@ async function getDeploymentForAlias(client2, output2, args2, localConfigPath, u
|
|
111207
111141
|
output2.stopSpinner();
|
111208
111142
|
}
|
111209
111143
|
}
|
111210
|
-
var import_path9,
|
111144
|
+
var import_path9, import_chalk31;
|
111211
111145
|
var init_get_deployment_by_alias = __esm({
|
111212
111146
|
"src/util/alias/get-deployment-by-alias.ts"() {
|
111213
111147
|
"use strict";
|
111214
111148
|
import_path9 = __toESM3(require("path"));
|
111215
|
-
|
111149
|
+
import_chalk31 = __toESM3(require_source());
|
111216
111150
|
init_get_deployments_by_appname();
|
111217
111151
|
init_get_deployment();
|
111218
111152
|
}
|
@@ -111226,14 +111160,14 @@ function formatDNSTable(rows, { extraSpace = "" } = {}) {
|
|
111226
111160
|
stringLength: strlen
|
111227
111161
|
}).replace(/^(.*)/gm, `${extraSpace}$1`);
|
111228
111162
|
}
|
111229
|
-
var
|
111163
|
+
var import_chalk32, import_text_table3, HEADER;
|
111230
111164
|
var init_format_dns_table = __esm({
|
111231
111165
|
"src/util/format-dns-table.ts"() {
|
111232
111166
|
"use strict";
|
111233
|
-
|
111167
|
+
import_chalk32 = __toESM3(require_source());
|
111234
111168
|
import_text_table3 = __toESM3(require_text_table());
|
111235
111169
|
init_strlen();
|
111236
|
-
HEADER = ["name", "type", "value"].map((v) =>
|
111170
|
+
HEADER = ["name", "type", "value"].map((v) => import_chalk32.default.gray(v));
|
111237
111171
|
}
|
111238
111172
|
});
|
111239
111173
|
|
@@ -111265,7 +111199,7 @@ function handleCertError(output2, error4) {
|
|
111265
111199
|
if (error4 instanceof CertConfigurationError) {
|
111266
111200
|
const { external, cns } = error4.meta;
|
111267
111201
|
output2.error(
|
111268
|
-
`We couldn't verify the propagation of the DNS settings for ${error4.meta.cns.map((cn) =>
|
111202
|
+
`We couldn't verify the propagation of the DNS settings for ${error4.meta.cns.map((cn) => import_chalk33.default.underline(cn)).join(", ")}`
|
111269
111203
|
);
|
111270
111204
|
if (external) {
|
111271
111205
|
output2.print(
|
@@ -111306,13 +111240,13 @@ function handleCertError(output2, error4) {
|
|
111306
111240
|
}
|
111307
111241
|
return error4;
|
111308
111242
|
}
|
111309
|
-
var import_ms5, import_psl3,
|
111243
|
+
var import_ms5, import_psl3, import_chalk33;
|
111310
111244
|
var init_handle_cert_error = __esm({
|
111311
111245
|
"src/util/certs/handle-cert-error.ts"() {
|
111312
111246
|
"use strict";
|
111313
111247
|
import_ms5 = __toESM3(require_ms2());
|
111314
111248
|
import_psl3 = __toESM3(require_psl());
|
111315
|
-
|
111249
|
+
import_chalk33 = __toESM3(require_source());
|
111316
111250
|
init_errors_ts();
|
111317
111251
|
init_format_dns_table();
|
111318
111252
|
init_pkg_name();
|
@@ -111398,7 +111332,7 @@ async function set(client2, opts, args2) {
|
|
111398
111332
|
return 1;
|
111399
111333
|
}
|
111400
111334
|
console.log(
|
111401
|
-
`${
|
111335
|
+
`${import_chalk34.default.cyan("> Success!")} ${import_chalk34.default.bold(
|
111402
111336
|
`${isWildcardAlias(target) ? "" : "https://"}${handleResult2.alias}`
|
111403
111337
|
)} now points to https://${deployment2.url} ${setStamp()}`
|
111404
111338
|
);
|
@@ -111437,7 +111371,7 @@ async function set(client2, opts, args2) {
|
|
111437
111371
|
}
|
111438
111372
|
const prefix = isWildcard ? "" : "https://";
|
111439
111373
|
console.log(
|
111440
|
-
`${
|
111374
|
+
`${import_chalk34.default.cyan("> Success!")} ${import_chalk34.default.bold(
|
111441
111375
|
`${prefix}${handleResult.alias}`
|
111442
111376
|
)} now points to https://${deployment.url} ${setStamp()}`
|
111443
111377
|
);
|
@@ -111446,9 +111380,9 @@ async function set(client2, opts, args2) {
|
|
111446
111380
|
function handleSetupDomainError(output2, error4) {
|
111447
111381
|
if (error4 instanceof DomainPermissionDenied) {
|
111448
111382
|
output2.error(
|
111449
|
-
`You don't have permissions over domain ${
|
111383
|
+
`You don't have permissions over domain ${import_chalk34.default.underline(
|
111450
111384
|
error4.meta.domain
|
111451
|
-
)} under ${
|
111385
|
+
)} under ${import_chalk34.default.bold(error4.meta.context)}.`
|
111452
111386
|
);
|
111453
111387
|
return 1;
|
111454
111388
|
}
|
@@ -111529,7 +111463,7 @@ function handleCreateAliasError(output2, errorOrResult) {
|
|
111529
111463
|
}
|
111530
111464
|
if (error4 instanceof AliasInUse) {
|
111531
111465
|
output2.error(
|
111532
|
-
`The alias ${
|
111466
|
+
`The alias ${import_chalk34.default.dim(
|
111533
111467
|
error4.meta.alias
|
111534
111468
|
)} is a deployment URL or it's in use by a different team.`
|
111535
111469
|
);
|
@@ -111537,7 +111471,7 @@ function handleCreateAliasError(output2, errorOrResult) {
|
|
111537
111471
|
}
|
111538
111472
|
if (error4 instanceof DeploymentNotFound) {
|
111539
111473
|
output2.error(
|
111540
|
-
`Failed to find deployment ${
|
111474
|
+
`Failed to find deployment ${import_chalk34.default.dim(error4.meta.id)} under ${import_chalk34.default.bold(
|
111541
111475
|
error4.meta.context
|
111542
111476
|
)}`
|
111543
111477
|
);
|
@@ -111551,9 +111485,9 @@ function handleCreateAliasError(output2, errorOrResult) {
|
|
111551
111485
|
}
|
111552
111486
|
if (error4 instanceof DeploymentPermissionDenied) {
|
111553
111487
|
output2.error(
|
111554
|
-
`No permission to access deployment ${
|
111488
|
+
`No permission to access deployment ${import_chalk34.default.dim(
|
111555
111489
|
error4.meta.id
|
111556
|
-
)} under ${
|
111490
|
+
)} under ${import_chalk34.default.bold(error4.meta.context)}`
|
111557
111491
|
);
|
111558
111492
|
return 1;
|
111559
111493
|
}
|
@@ -111596,11 +111530,11 @@ function getTargetsForAlias(args2, { alias: alias2 } = {}) {
|
|
111596
111530
|
}
|
111597
111531
|
return typeof alias2 === "string" ? [alias2] : alias2;
|
111598
111532
|
}
|
111599
|
-
var
|
111533
|
+
var import_chalk34;
|
111600
111534
|
var init_set = __esm({
|
111601
111535
|
"src/commands/alias/set.ts"() {
|
111602
111536
|
"use strict";
|
111603
|
-
|
111537
|
+
import_chalk34 = __toESM3(require_source());
|
111604
111538
|
init_errors_ts();
|
111605
111539
|
init_assign_alias();
|
111606
111540
|
init_get_deployment();
|
@@ -112607,30 +112541,30 @@ var require_format2 = __commonJS2({
|
|
112607
112541
|
// src/util/format-date.ts
|
112608
112542
|
function formatDate(dateStrOrNumber) {
|
112609
112543
|
if (!dateStrOrNumber) {
|
112610
|
-
return
|
112544
|
+
return import_chalk35.default.gray("-");
|
112611
112545
|
}
|
112612
112546
|
const date = new Date(dateStrOrNumber);
|
112613
112547
|
const diff = date.getTime() - Date.now();
|
112614
|
-
return diff < 0 ? `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${
|
112548
|
+
return diff < 0 ? `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${import_chalk35.default.gray(
|
112615
112549
|
`[${(0, import_ms6.default)(-diff)} ago]`
|
112616
|
-
)}` : `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${
|
112550
|
+
)}` : `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${import_chalk35.default.gray(
|
112617
112551
|
`[in ${(0, import_ms6.default)(diff)}]`
|
112618
112552
|
)}`;
|
112619
112553
|
}
|
112620
112554
|
function formatDateWithoutTime(dateStrOrNumber) {
|
112621
112555
|
if (!dateStrOrNumber) {
|
112622
|
-
return
|
112556
|
+
return import_chalk35.default.gray("-");
|
112623
112557
|
}
|
112624
112558
|
const date = new Date(dateStrOrNumber);
|
112625
112559
|
const diff = date.getTime() - Date.now();
|
112626
|
-
return diff < 0 ? `${(0, import_format.default)(date, "MMM DD YYYY")} ${
|
112560
|
+
return diff < 0 ? `${(0, import_format.default)(date, "MMM DD YYYY")} ${import_chalk35.default.gray(`[${(0, import_ms6.default)(-diff)} ago]`)}` : `${(0, import_format.default)(date, "MMM DD YYYY")} ${import_chalk35.default.gray(`[in ${(0, import_ms6.default)(diff)}]`)}`;
|
112627
112561
|
}
|
112628
|
-
var import_ms6,
|
112562
|
+
var import_ms6, import_chalk35, import_format;
|
112629
112563
|
var init_format_date = __esm({
|
112630
112564
|
"src/util/format-date.ts"() {
|
112631
112565
|
"use strict";
|
112632
112566
|
import_ms6 = __toESM3(require_ms2());
|
112633
|
-
|
112567
|
+
import_chalk35 = __toESM3(require_source());
|
112634
112568
|
import_format = __toESM3(require_format2());
|
112635
112569
|
}
|
112636
112570
|
});
|
@@ -112748,8 +112682,14 @@ async function bisect(client2) {
|
|
112748
112682
|
output2.print(help2(bisectCommand, { columns: client2.stderr.columns }));
|
112749
112683
|
return 2;
|
112750
112684
|
}
|
112751
|
-
let bad = argv2["--bad"] || await
|
112752
|
-
|
112685
|
+
let bad = argv2["--bad"] || await client2.input.text({
|
112686
|
+
message: `Specify a URL where the bug occurs:`,
|
112687
|
+
validate: (val) => val ? true : "A URL must be provided"
|
112688
|
+
});
|
112689
|
+
let good = argv2["--good"] || await client2.input.text({
|
112690
|
+
message: `Specify a URL where the bug does not occur:`,
|
112691
|
+
validate: (val) => val ? true : "A URL must be provided"
|
112692
|
+
});
|
112753
112693
|
let subpath = argv2["--path"] || "";
|
112754
112694
|
let run2 = argv2["--run"] || "";
|
112755
112695
|
const openEnabled = argv2["--open"] || false;
|
@@ -112766,9 +112706,9 @@ async function bisect(client2) {
|
|
112766
112706
|
if (typeof parsed.path === "string" && parsed.path !== "/") {
|
112767
112707
|
if (subpath && subpath !== parsed.path) {
|
112768
112708
|
output2.note(
|
112769
|
-
`Ignoring subpath ${
|
112709
|
+
`Ignoring subpath ${import_chalk36.default.bold(
|
112770
112710
|
parsed.path
|
112771
|
-
)} in favor of \`--path\` argument ${
|
112711
|
+
)} in favor of \`--path\` argument ${import_chalk36.default.bold(subpath)}`
|
112772
112712
|
);
|
112773
112713
|
} else {
|
112774
112714
|
subpath = parsed.path;
|
@@ -112783,16 +112723,16 @@ async function bisect(client2) {
|
|
112783
112723
|
good = parsed.hostname;
|
112784
112724
|
if (typeof parsed.path === "string" && parsed.path !== "/" && subpath && subpath !== parsed.path) {
|
112785
112725
|
output2.note(
|
112786
|
-
`Ignoring subpath ${
|
112726
|
+
`Ignoring subpath ${import_chalk36.default.bold(
|
112787
112727
|
parsed.path
|
112788
|
-
)} which does not match ${
|
112728
|
+
)} which does not match ${import_chalk36.default.bold(subpath)}`
|
112789
112729
|
);
|
112790
112730
|
}
|
112791
112731
|
if (!subpath) {
|
112792
|
-
subpath = await
|
112793
|
-
|
112794
|
-
|
112795
|
-
);
|
112732
|
+
subpath = await client2.input.text({
|
112733
|
+
message: `Specify the URL subpath where the bug occurs:`,
|
112734
|
+
validate: (val) => val ? true : "A subpath must be provided"
|
112735
|
+
});
|
112796
112736
|
}
|
112797
112737
|
output2.spinner("Retrieving deployments\u2026");
|
112798
112738
|
const badDeployment = await getDeployment(client2, contextName, bad).catch(
|
@@ -112808,7 +112748,7 @@ async function bisect(client2) {
|
|
112808
112748
|
}
|
112809
112749
|
bad = badDeployment.url;
|
112810
112750
|
} else {
|
112811
|
-
output2.error(`Failed to retrieve ${
|
112751
|
+
output2.error(`Failed to retrieve ${import_chalk36.default.bold("bad")} Deployment: ${bad}`);
|
112812
112752
|
return 1;
|
112813
112753
|
}
|
112814
112754
|
const goodDeployment = await getDeployment(client2, contextName, good).catch(
|
@@ -112825,7 +112765,7 @@ async function bisect(client2) {
|
|
112825
112765
|
good = goodDeployment.url;
|
112826
112766
|
} else {
|
112827
112767
|
output2.error(
|
112828
|
-
`Failed to retrieve ${
|
112768
|
+
`Failed to retrieve ${import_chalk36.default.bold("good")} Deployment: ${good}`
|
112829
112769
|
);
|
112830
112770
|
return 1;
|
112831
112771
|
}
|
@@ -112886,21 +112826,21 @@ async function bisect(client2) {
|
|
112886
112826
|
const steps = Math.floor(Math.log2(deployments.length));
|
112887
112827
|
const pSteps = (0, import_pluralize2.default)("step", steps, true);
|
112888
112828
|
output2.log(
|
112889
|
-
|
112890
|
-
`${
|
112829
|
+
import_chalk36.default.magenta(
|
112830
|
+
`${import_chalk36.default.bold(
|
112891
112831
|
"Bisecting:"
|
112892
112832
|
)} ${rem} left to test after this (roughly ${pSteps})`
|
112893
112833
|
),
|
112894
|
-
|
112834
|
+
import_chalk36.default.magenta
|
112895
112835
|
);
|
112896
112836
|
const testUrl = `https://${deployment.url}${subpath}`;
|
112897
|
-
output2.log(`${
|
112898
|
-
output2.log(`${
|
112837
|
+
output2.log(`${import_chalk36.default.bold("Deployment URL:")} ${link_default(testUrl)}`);
|
112838
|
+
output2.log(`${import_chalk36.default.bold("Date:")} ${formatDate(deployment.createdAt)}`);
|
112899
112839
|
const commit2 = getCommit(deployment);
|
112900
112840
|
if (commit2) {
|
112901
112841
|
const shortSha = commit2.sha.substring(0, 7);
|
112902
112842
|
const firstLine = commit2.message?.split("\n")[0];
|
112903
|
-
output2.log(`${
|
112843
|
+
output2.log(`${import_chalk36.default.bold("Commit:")} [${shortSha}] ${firstLine}`);
|
112904
112844
|
}
|
112905
112845
|
let action;
|
112906
112846
|
if (run2) {
|
@@ -112920,17 +112860,17 @@ async function bisect(client2) {
|
|
112920
112860
|
const { exitCode } = proc;
|
112921
112861
|
let color;
|
112922
112862
|
if (exitCode === 0) {
|
112923
|
-
color =
|
112863
|
+
color = import_chalk36.default.green;
|
112924
112864
|
action = "good";
|
112925
112865
|
} else if (exitCode === 125) {
|
112926
112866
|
action = "skip";
|
112927
|
-
color =
|
112867
|
+
color = import_chalk36.default.grey;
|
112928
112868
|
} else {
|
112929
112869
|
action = "bad";
|
112930
|
-
color =
|
112870
|
+
color = import_chalk36.default.red;
|
112931
112871
|
}
|
112932
112872
|
output2.log(
|
112933
|
-
`Run script returned exit code ${
|
112873
|
+
`Run script returned exit code ${import_chalk36.default.bold(String(exitCode))}: ${color(
|
112934
112874
|
action
|
112935
112875
|
)}`
|
112936
112876
|
);
|
@@ -112958,19 +112898,19 @@ async function bisect(client2) {
|
|
112958
112898
|
}
|
112959
112899
|
output2.print("\n");
|
112960
112900
|
let result = [
|
112961
|
-
|
112901
|
+
import_chalk36.default.bold(
|
112962
112902
|
`The first bad deployment is: ${link_default(`https://${lastBad.url}`)}`
|
112963
112903
|
),
|
112964
112904
|
"",
|
112965
|
-
` ${
|
112905
|
+
` ${import_chalk36.default.bold("Date:")} ${formatDate(lastBad.createdAt)}`
|
112966
112906
|
];
|
112967
112907
|
const commit = getCommit(lastBad);
|
112968
112908
|
if (commit) {
|
112969
112909
|
const shortSha = commit.sha.substring(0, 7);
|
112970
112910
|
const firstLine = commit.message?.split("\n")[0];
|
112971
|
-
result.push(` ${
|
112911
|
+
result.push(` ${import_chalk36.default.bold("Commit:")} [${shortSha}] ${firstLine}`);
|
112972
112912
|
}
|
112973
|
-
result.push(`${
|
112913
|
+
result.push(`${import_chalk36.default.bold("Inspect:")} ${link_default(lastBad.inspectorUrl)}`);
|
112974
112914
|
output2.print(box(result.join("\n")));
|
112975
112915
|
output2.print("\n");
|
112976
112916
|
return 0;
|
@@ -112982,17 +112922,7 @@ function getCommit(deployment) {
|
|
112982
112922
|
const message2 = deployment.meta?.githubCommitMessage || deployment.meta?.gitlabCommitMessage || deployment.meta?.bitbucketCommitMessage;
|
112983
112923
|
return { sha, message: message2 };
|
112984
112924
|
}
|
112985
|
-
|
112986
|
-
while (true) {
|
112987
|
-
const val = await client2.input.text({ message: message2 });
|
112988
|
-
if (val) {
|
112989
|
-
return val;
|
112990
|
-
} else {
|
112991
|
-
client2.output.error("A value must be specified");
|
112992
|
-
}
|
112993
|
-
}
|
112994
|
-
}
|
112995
|
-
var import_open2, import_execa2, import_pluralize2, import_path10, import_chalk37, import_url9;
|
112925
|
+
var import_open2, import_execa2, import_pluralize2, import_path10, import_chalk36, import_url9;
|
112996
112926
|
var init_bisect = __esm({
|
112997
112927
|
"src/commands/bisect/index.ts"() {
|
112998
112928
|
"use strict";
|
@@ -113000,7 +112930,7 @@ var init_bisect = __esm({
|
|
113000
112930
|
import_execa2 = __toESM3(require_execa());
|
113001
112931
|
import_pluralize2 = __toESM3(require_pluralize());
|
113002
112932
|
import_path10 = require("path");
|
113003
|
-
|
112933
|
+
import_chalk36 = __toESM3(require_source());
|
113004
112934
|
import_url9 = require("url");
|
113005
112935
|
init_box();
|
113006
112936
|
init_format_date();
|
@@ -138744,13 +138674,13 @@ async function connectGitProvider(client2, org, projectId, type, repo) {
|
|
138744
138674
|
const apiError = isAPIError(err);
|
138745
138675
|
if (apiError && (err.action === "Install GitHub App" || err.code === "repo_not_found")) {
|
138746
138676
|
client2.output.error(
|
138747
|
-
`Failed to connect ${
|
138677
|
+
`Failed to connect ${import_chalk37.default.cyan(
|
138748
138678
|
repo
|
138749
138679
|
)} to project. Make sure there aren't any typos and that you have access to the repository if it's private.`
|
138750
138680
|
);
|
138751
138681
|
} else if (apiError && err.action === "Add a Login Connection") {
|
138752
138682
|
client2.output.error(
|
138753
|
-
err.message.replace(repo,
|
138683
|
+
err.message.replace(repo, import_chalk37.default.cyan(repo)) + `
|
138754
138684
|
Visit ${link_default(err.link)} for more information.`
|
138755
138685
|
);
|
138756
138686
|
} else {
|
@@ -138807,21 +138737,57 @@ function parseRepoUrl(originUrl) {
|
|
138807
138737
|
}
|
138808
138738
|
function printRemoteUrls(output2, remoteUrls) {
|
138809
138739
|
for (const [name, url3] of Object.entries(remoteUrls)) {
|
138810
|
-
output2.print(` \u2022 ${name}: ${
|
138740
|
+
output2.print(` \u2022 ${name}: ${import_chalk37.default.cyan(url3)}
|
138811
138741
|
`);
|
138812
138742
|
}
|
138813
138743
|
}
|
138814
|
-
var import_url10,
|
138744
|
+
var import_url10, import_chalk37;
|
138815
138745
|
var init_connect_git_provider = __esm({
|
138816
138746
|
"src/util/git/connect-git-provider.ts"() {
|
138817
138747
|
"use strict";
|
138818
138748
|
import_url10 = require("url");
|
138819
|
-
|
138749
|
+
import_chalk37 = __toESM3(require_source());
|
138820
138750
|
init_link();
|
138821
138751
|
init_errors_ts();
|
138822
138752
|
}
|
138823
138753
|
});
|
138824
138754
|
|
138755
|
+
// src/util/git-helpers.ts
|
138756
|
+
function getGitDirectory(opts) {
|
138757
|
+
const { cwd: cwd2, unsafe } = { ...DEFAULT_GIT_EXEC_OPTS, ...opts };
|
138758
|
+
try {
|
138759
|
+
const gitConfigPath = (0, import_node_child_process.execSync)("git rev-parse --git-dir", {
|
138760
|
+
cwd: cwd2,
|
138761
|
+
encoding: "utf8"
|
138762
|
+
});
|
138763
|
+
return gitConfigPath;
|
138764
|
+
} catch (error4) {
|
138765
|
+
if (unsafe) {
|
138766
|
+
throw error4;
|
138767
|
+
}
|
138768
|
+
return null;
|
138769
|
+
}
|
138770
|
+
}
|
138771
|
+
function isGitWorktreeOrSubmodule(opts) {
|
138772
|
+
const gitDir = getGitDirectory(opts);
|
138773
|
+
if (gitDir === null) {
|
138774
|
+
return false;
|
138775
|
+
}
|
138776
|
+
const isGitWorktree = gitDir.includes(".git/worktrees/");
|
138777
|
+
const isGitSubmodule = gitDir.includes(".git/modules/");
|
138778
|
+
return isGitWorktree || isGitSubmodule;
|
138779
|
+
}
|
138780
|
+
var import_node_child_process, DEFAULT_GIT_EXEC_OPTS;
|
138781
|
+
var init_git_helpers = __esm({
|
138782
|
+
"src/util/git-helpers.ts"() {
|
138783
|
+
"use strict";
|
138784
|
+
import_node_child_process = require("child_process");
|
138785
|
+
DEFAULT_GIT_EXEC_OPTS = {
|
138786
|
+
unsafe: false
|
138787
|
+
};
|
138788
|
+
}
|
138789
|
+
});
|
138790
|
+
|
138825
138791
|
// src/util/link/repo.ts
|
138826
138792
|
async function getRepoLink(client2, cwd2) {
|
138827
138793
|
const rootPath = await findRepoRoot(client2, cwd2);
|
@@ -138852,7 +138818,7 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
138852
138818
|
});
|
138853
138819
|
let shouldLink = yes || await confirm(
|
138854
138820
|
client2,
|
138855
|
-
`Link Git repository at ${
|
138821
|
+
`Link Git repository at ${import_chalk38.default.cyan(
|
138856
138822
|
`\u201C${humanizePath(rootPath)}\u201D`
|
138857
138823
|
)} to your Project(s)?`,
|
138858
138824
|
true
|
@@ -138902,7 +138868,7 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
138902
138868
|
fallback: () => link_default(repoUrl)
|
138903
138869
|
});
|
138904
138870
|
output2.spinner(
|
138905
|
-
`Fetching Projects for ${repoUrlLink} under ${
|
138871
|
+
`Fetching Projects for ${repoUrlLink} under ${import_chalk38.default.bold(org.slug)}\u2026`
|
138906
138872
|
);
|
138907
138873
|
let projects = [];
|
138908
138874
|
const query = new URLSearchParams({ repoUrl });
|
@@ -138911,12 +138877,12 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
138911
138877
|
for await (const chunk of projectsIterator) {
|
138912
138878
|
projects = projects.concat(chunk.projects);
|
138913
138879
|
if (chunk.pagination.next) {
|
138914
|
-
output2.spinner(`Found ${
|
138880
|
+
output2.spinner(`Found ${import_chalk38.default.bold(projects.length)} Projects\u2026`, 0);
|
138915
138881
|
}
|
138916
138882
|
}
|
138917
138883
|
if (projects.length === 0) {
|
138918
138884
|
output2.log(
|
138919
|
-
`No Projects are linked to ${repoUrlLink} under ${
|
138885
|
+
`No Projects are linked to ${repoUrlLink} under ${import_chalk38.default.bold(
|
138920
138886
|
org.slug
|
138921
138887
|
)}.`
|
138922
138888
|
);
|
@@ -138926,7 +138892,7 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
138926
138892
|
"Project",
|
138927
138893
|
projects.length,
|
138928
138894
|
true
|
138929
|
-
)} linked to ${repoUrlLink} under ${
|
138895
|
+
)} linked to ${repoUrlLink} under ${import_chalk38.default.bold(org.slug)}`
|
138930
138896
|
);
|
138931
138897
|
}
|
138932
138898
|
for (const project of projects) {
|
@@ -139050,7 +139016,7 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
139050
139016
|
"Project",
|
139051
139017
|
selected.length,
|
139052
139018
|
true
|
139053
|
-
)} under ${
|
139019
|
+
)} under ${import_chalk38.default.bold(org.slug)} (created ${VERCEL_DIR2}${isGitIgnoreUpdated ? " and added it to .gitignore" : ""})`,
|
139054
139020
|
emoji("link")
|
139055
139021
|
) + "\n"
|
139056
139022
|
);
|
@@ -139064,7 +139030,7 @@ async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
|
139064
139030
|
async function findRepoRoot(client2, start) {
|
139065
139031
|
const { debug: debug3 } = client2.output;
|
139066
139032
|
const REPO_JSON_PATH = (0, import_path14.join)(VERCEL_DIR2, VERCEL_DIR_REPO);
|
139067
|
-
const
|
139033
|
+
const GIT_PATH = isGitWorktreeOrSubmodule({ cwd: client2.cwd }) ? (0, import_path14.normalize)(".git") : (0, import_path14.normalize)(".git/config");
|
139068
139034
|
for (const current of (0, import_build_utils5.traverseUpDirectories)({ start })) {
|
139069
139035
|
if (current === home) {
|
139070
139036
|
debug3("Arrived at home directory");
|
@@ -139079,13 +139045,13 @@ async function findRepoRoot(client2, start) {
|
|
139079
139045
|
debug3(`Found "${REPO_JSON_PATH}" - detected "${current}" as repo root`);
|
139080
139046
|
return current;
|
139081
139047
|
}
|
139082
|
-
const gitConfigPath = (0, import_path14.join)(current,
|
139048
|
+
const gitConfigPath = (0, import_path14.join)(current, GIT_PATH);
|
139083
139049
|
stat2 = await (0, import_fs_extra6.lstat)(gitConfigPath).catch((err) => {
|
139084
139050
|
if (err.code !== "ENOENT")
|
139085
139051
|
throw err;
|
139086
139052
|
});
|
139087
139053
|
if (stat2) {
|
139088
|
-
debug3(`Found "${
|
139054
|
+
debug3(`Found "${GIT_PATH}" - detected "${current}" as repo root`);
|
139089
139055
|
return current;
|
139090
139056
|
}
|
139091
139057
|
}
|
@@ -139107,11 +139073,11 @@ function findProjectsFromPath(projects, path11) {
|
|
139107
139073
|
const firstMatch = matches[0];
|
139108
139074
|
return matches.filter((match) => match.directory === firstMatch.directory);
|
139109
139075
|
}
|
139110
|
-
var
|
139076
|
+
var import_chalk38, import_pluralize3, import_os7, import_slugify, import_path14, import_build_utils5, import_fs_extra6, home;
|
139111
139077
|
var init_repo = __esm({
|
139112
139078
|
"src/util/link/repo.ts"() {
|
139113
139079
|
"use strict";
|
139114
|
-
|
139080
|
+
import_chalk38 = __toESM3(require_source());
|
139115
139081
|
init_esm3();
|
139116
139082
|
import_pluralize3 = __toESM3(require_pluralize());
|
139117
139083
|
import_os7 = require("os");
|
@@ -139132,6 +139098,7 @@ var init_repo = __esm({
|
|
139132
139098
|
init_repo_info_to_url();
|
139133
139099
|
init_connect_git_provider();
|
139134
139100
|
init_errors_ts();
|
139101
|
+
init_git_helpers();
|
139135
139102
|
home = (0, import_os7.homedir)();
|
139136
139103
|
}
|
139137
139104
|
});
|
@@ -139325,20 +139292,20 @@ async function linkFolderToProject(client2, path11, projectLink, projectName, or
|
|
139325
139292
|
const isGitIgnoreUpdated = await addToGitIgnore(path11);
|
139326
139293
|
client2.output.print(
|
139327
139294
|
prependEmoji(
|
139328
|
-
`Linked to ${
|
139295
|
+
`Linked to ${import_chalk39.default.bold(
|
139329
139296
|
`${orgSlug}/${projectName}`
|
139330
139297
|
)} (created ${VERCEL_DIR2}${isGitIgnoreUpdated ? " and added it to .gitignore" : ""})`,
|
139331
139298
|
emoji(successEmoji)
|
139332
139299
|
) + "\n"
|
139333
139300
|
);
|
139334
139301
|
}
|
139335
|
-
var import_fs4, import_ajv,
|
139302
|
+
var import_fs4, import_ajv, import_chalk39, import_path15, import_fs_extra7, import_util, import_build_utils6, import_error_utils12, readFile3, writeFile2, VERCEL_DIR2, VERCEL_DIR_FALLBACK, VERCEL_DIR_README, VERCEL_DIR_PROJECT, VERCEL_DIR_REPO, linkSchema;
|
139336
139303
|
var init_link2 = __esm({
|
139337
139304
|
"src/util/projects/link.ts"() {
|
139338
139305
|
"use strict";
|
139339
139306
|
import_fs4 = __toESM3(require("fs"));
|
139340
139307
|
import_ajv = __toESM3(require_ajv2());
|
139341
|
-
|
139308
|
+
import_chalk39 = __toESM3(require_source());
|
139342
139309
|
import_path15 = require("path");
|
139343
139310
|
import_fs_extra7 = __toESM3(require_lib());
|
139344
139311
|
import_util = require("util");
|
@@ -139569,23 +139536,23 @@ function findChanges(oldEnv, newEnv) {
|
|
139569
139536
|
function buildDeltaString(oldEnv, newEnv) {
|
139570
139537
|
const { added, changed, removed } = findChanges(oldEnv, newEnv);
|
139571
139538
|
let deltaString = "";
|
139572
|
-
deltaString +=
|
139573
|
-
deltaString +=
|
139574
|
-
deltaString +=
|
139575
|
-
return deltaString ?
|
139539
|
+
deltaString += import_chalk40.default.green(addDeltaSection("+", changed, true));
|
139540
|
+
deltaString += import_chalk40.default.green(addDeltaSection("+", added));
|
139541
|
+
deltaString += import_chalk40.default.red(addDeltaSection("-", removed));
|
139542
|
+
return deltaString ? import_chalk40.default.gray("Changes:\n") + deltaString + "\n" : deltaString;
|
139576
139543
|
}
|
139577
139544
|
function addDeltaSection(prefix, arr, changed = false) {
|
139578
139545
|
if (arr.length === 0)
|
139579
139546
|
return "";
|
139580
139547
|
return arr.sort().map((item) => `${prefix} ${item}${changed ? " (Updated)" : ""}`).join("\n") + "\n";
|
139581
139548
|
}
|
139582
|
-
var import_fs_extra9,
|
139549
|
+
var import_fs_extra9, import_chalk40;
|
139583
139550
|
var init_diff_env_files = __esm({
|
139584
139551
|
"src/util/env/diff-env-files.ts"() {
|
139585
139552
|
"use strict";
|
139586
139553
|
import_fs_extra9 = __toESM3(require_lib());
|
139587
139554
|
init_parse_env();
|
139588
|
-
|
139555
|
+
import_chalk40 = __toESM3(require_source());
|
139589
139556
|
}
|
139590
139557
|
});
|
139591
139558
|
|
@@ -139623,7 +139590,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
139623
139590
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
139624
139591
|
const exists = typeof head !== "undefined";
|
139625
139592
|
if (head === CONTENTS_PREFIX) {
|
139626
|
-
output2.log(`Overwriting existing ${
|
139593
|
+
output2.log(`Overwriting existing ${import_chalk41.default.bold(filename)} file`);
|
139627
139594
|
} else if (exists && !skipConfirmation && !await confirm(
|
139628
139595
|
client2,
|
139629
139596
|
`Found existing file ${param(filename)}. Do you want to overwrite?`,
|
@@ -139633,9 +139600,9 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
139633
139600
|
return 0;
|
139634
139601
|
}
|
139635
139602
|
output2.log(
|
139636
|
-
`Downloading \`${
|
139603
|
+
`Downloading \`${import_chalk41.default.cyan(
|
139637
139604
|
environment
|
139638
|
-
)}\` Environment Variables for Project ${
|
139605
|
+
)}\` Environment Variables for Project ${import_chalk41.default.bold(project.name)}`
|
139639
139606
|
);
|
139640
139607
|
const pullStamp = stamp_default();
|
139641
139608
|
output2.spinner("Downloading");
|
@@ -139666,7 +139633,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
139666
139633
|
}
|
139667
139634
|
output2.print(
|
139668
139635
|
`${prependEmoji(
|
139669
|
-
`${exists ? "Updated" : "Created"} ${
|
139636
|
+
`${exists ? "Updated" : "Created"} ${import_chalk41.default.bold(filename)} file ${isGitIgnoreUpdated ? "and added it to .gitignore" : ""} ${import_chalk41.default.gray(pullStamp())}`,
|
139670
139637
|
emoji("success")
|
139671
139638
|
)}
|
139672
139639
|
`
|
@@ -139676,11 +139643,11 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
139676
139643
|
function escapeValue(value) {
|
139677
139644
|
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
139678
139645
|
}
|
139679
|
-
var
|
139646
|
+
var import_chalk41, import_fs_extra10, import_fs5, import_path17, import_error_utils14, import_json_parse_better_errors2, CONTENTS_PREFIX, VARIABLES_TO_IGNORE;
|
139680
139647
|
var init_pull = __esm({
|
139681
139648
|
"src/commands/env/pull.ts"() {
|
139682
139649
|
"use strict";
|
139683
|
-
|
139650
|
+
import_chalk41 = __toESM3(require_source());
|
139684
139651
|
import_fs_extra10 = __toESM3(require_lib());
|
139685
139652
|
import_fs5 = require("fs");
|
139686
139653
|
import_path17 = require("path");
|
@@ -139751,7 +139718,7 @@ async function inputProject(client2, org, detectedProjectName, autoConfirm = fal
|
|
139751
139718
|
} else {
|
139752
139719
|
if (await confirm(
|
139753
139720
|
client2,
|
139754
|
-
`Found project ${
|
139721
|
+
`Found project ${import_chalk42.default.cyan(
|
139755
139722
|
`\u201C${org.slug}/${detectedProject.name}\u201D`
|
139756
139723
|
)}. Link to it?`,
|
139757
139724
|
true
|
@@ -139765,62 +139732,45 @@ async function inputProject(client2, org, detectedProjectName, autoConfirm = fal
|
|
139765
139732
|
);
|
139766
139733
|
}
|
139767
139734
|
if (shouldLinkProject) {
|
139768
|
-
let
|
139769
|
-
|
139770
|
-
|
139771
|
-
|
139772
|
-
|
139773
|
-
|
139774
|
-
|
139775
|
-
|
139735
|
+
let toLink;
|
139736
|
+
await client2.input.text({
|
139737
|
+
message: "What\u2019s the name of your existing project?",
|
139738
|
+
validate: async (val) => {
|
139739
|
+
if (!val) {
|
139740
|
+
return "Project name cannot be empty";
|
139741
|
+
}
|
139742
|
+
const project2 = await getProjectByNameOrId(client2, val, org.id);
|
139743
|
+
if (project2 instanceof ProjectNotFound) {
|
139744
|
+
return "Project not found";
|
139745
|
+
}
|
139746
|
+
toLink = project2;
|
139747
|
+
return true;
|
139776
139748
|
}
|
139777
|
-
|
139778
|
-
|
139779
|
-
|
139780
|
-
|
139781
|
-
|
139749
|
+
});
|
139750
|
+
return toLink;
|
139751
|
+
}
|
139752
|
+
return await client2.input.text({
|
139753
|
+
message: `What\u2019s your project\u2019s name?`,
|
139754
|
+
default: !detectedProject ? slugifiedName : void 0,
|
139755
|
+
validate: async (val) => {
|
139756
|
+
if (!val) {
|
139757
|
+
return "Project name cannot be empty";
|
139782
139758
|
}
|
139783
|
-
|
139784
|
-
|
139759
|
+
const project2 = await getProjectByNameOrId(client2, val, org.id);
|
139760
|
+
if (!(project2 instanceof ProjectNotFound)) {
|
139761
|
+
return "Project already exists";
|
139785
139762
|
}
|
139763
|
+
return true;
|
139786
139764
|
}
|
139787
|
-
|
139788
|
-
}
|
139789
|
-
let newProjectName = null;
|
139790
|
-
while (!newProjectName) {
|
139791
|
-
newProjectName = await client2.input.text({
|
139792
|
-
message: `What\u2019s your project\u2019s name?`,
|
139793
|
-
default: !detectedProject ? slugifiedName : void 0
|
139794
|
-
});
|
139795
|
-
if (!newProjectName) {
|
139796
|
-
output2.error(`Project name cannot be empty`);
|
139797
|
-
continue;
|
139798
|
-
}
|
139799
|
-
output2.spinner("Verifying project name\u2026", 1e3);
|
139800
|
-
let existingProject;
|
139801
|
-
try {
|
139802
|
-
existingProject = await getProjectByNameOrId(
|
139803
|
-
client2,
|
139804
|
-
newProjectName,
|
139805
|
-
org.id
|
139806
|
-
);
|
139807
|
-
} finally {
|
139808
|
-
output2.stopSpinner();
|
139809
|
-
}
|
139810
|
-
if (existingProject && !(existingProject instanceof ProjectNotFound)) {
|
139811
|
-
output2.print(`Project already exists`);
|
139812
|
-
newProjectName = null;
|
139813
|
-
}
|
139814
|
-
}
|
139815
|
-
return newProjectName;
|
139765
|
+
});
|
139816
139766
|
}
|
139817
|
-
var
|
139767
|
+
var import_chalk42, import_slugify2;
|
139818
139768
|
var init_input_project = __esm({
|
139819
139769
|
"src/util/input/input-project.ts"() {
|
139820
139770
|
"use strict";
|
139821
139771
|
init_confirm();
|
139822
139772
|
init_get_project_by_id_or_name();
|
139823
|
-
|
139773
|
+
import_chalk42 = __toESM3(require_source());
|
139824
139774
|
init_errors_ts();
|
139825
139775
|
import_slugify2 = __toESM3(require_slugify());
|
139826
139776
|
}
|
@@ -139832,7 +139782,7 @@ async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
|
|
139832
139782
|
const suffix = errorSuffix ? ` ${errorSuffix}` : "";
|
139833
139783
|
if (!pathStat) {
|
139834
139784
|
output2.error(
|
139835
|
-
`The provided path ${
|
139785
|
+
`The provided path ${import_chalk43.default.cyan(
|
139836
139786
|
`\u201C${humanizePath(path11)}\u201D`
|
139837
139787
|
)} does not exist.${suffix}`
|
139838
139788
|
);
|
@@ -139840,7 +139790,7 @@ async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
|
|
139840
139790
|
}
|
139841
139791
|
if (!pathStat.isDirectory()) {
|
139842
139792
|
output2.error(
|
139843
|
-
`The provided path ${
|
139793
|
+
`The provided path ${import_chalk43.default.cyan(
|
139844
139794
|
`\u201C${humanizePath(path11)}\u201D`
|
139845
139795
|
)} is a file, but expected a directory.${suffix}`
|
139846
139796
|
);
|
@@ -139848,7 +139798,7 @@ async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
|
|
139848
139798
|
}
|
139849
139799
|
if (!path11.startsWith(cwd2)) {
|
139850
139800
|
output2.error(
|
139851
|
-
`The provided path ${
|
139801
|
+
`The provided path ${import_chalk43.default.cyan(
|
139852
139802
|
`\u201C${humanizePath(path11)}\u201D`
|
139853
139803
|
)} is outside of the project.${suffix}`
|
139854
139804
|
);
|
@@ -139865,7 +139815,7 @@ async function validatePaths(client2, paths) {
|
|
139865
139815
|
const path11 = paths[0];
|
139866
139816
|
const pathStat = await (0, import_fs_extra11.lstat)(path11).catch(() => null);
|
139867
139817
|
if (!pathStat) {
|
139868
|
-
output2.error(`Could not find ${
|
139818
|
+
output2.error(`Could not find ${import_chalk43.default.cyan(`\u201C${humanizePath(path11)}\u201D`)}`);
|
139869
139819
|
return { valid: false, exitCode: 1 };
|
139870
139820
|
}
|
139871
139821
|
if (!pathStat.isDirectory()) {
|
@@ -139889,12 +139839,12 @@ async function validatePaths(client2, paths) {
|
|
139889
139839
|
}
|
139890
139840
|
return { valid: true, path: path11 };
|
139891
139841
|
}
|
139892
|
-
var import_fs_extra11,
|
139842
|
+
var import_fs_extra11, import_chalk43, import_os8;
|
139893
139843
|
var init_validate_paths = __esm({
|
139894
139844
|
"src/util/validate-paths.ts"() {
|
139895
139845
|
"use strict";
|
139896
139846
|
import_fs_extra11 = __toESM3(require_lib());
|
139897
|
-
|
139847
|
+
import_chalk43 = __toESM3(require_source());
|
139898
139848
|
import_os8 = require("os");
|
139899
139849
|
init_confirm();
|
139900
139850
|
init_humanize_path();
|
@@ -139910,7 +139860,7 @@ async function inputRootDirectory(client2, cwd2, autoConfirm = false) {
|
|
139910
139860
|
const rootDirectory = await client2.input.text({
|
139911
139861
|
message: `In which directory is your code located?`,
|
139912
139862
|
transformer: (input) => {
|
139913
|
-
return `${
|
139863
|
+
return `${import_chalk44.default.dim(`./`)}${input}`;
|
139914
139864
|
}
|
139915
139865
|
});
|
139916
139866
|
if (!rootDirectory) {
|
@@ -139932,12 +139882,12 @@ async function inputRootDirectory(client2, cwd2, autoConfirm = false) {
|
|
139932
139882
|
return normal;
|
139933
139883
|
}
|
139934
139884
|
}
|
139935
|
-
var import_path18,
|
139885
|
+
var import_path18, import_chalk44;
|
139936
139886
|
var init_input_root_directory = __esm({
|
139937
139887
|
"src/util/input/input-root-directory.ts"() {
|
139938
139888
|
"use strict";
|
139939
139889
|
import_path18 = __toESM3(require("path"));
|
139940
|
-
|
139890
|
+
import_chalk44 = __toESM3(require_source());
|
139941
139891
|
init_validate_paths();
|
139942
139892
|
}
|
139943
139893
|
});
|
@@ -139977,8 +139927,8 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
139977
139927
|
const override = localConfigurationOverrides[setting];
|
139978
139928
|
if (override) {
|
139979
139929
|
output2.print(
|
139980
|
-
`${
|
139981
|
-
`- ${
|
139930
|
+
`${import_chalk45.default.dim(
|
139931
|
+
`- ${import_chalk45.default.bold(`${settingMap[setting]}:`)} ${override}`
|
139982
139932
|
)}
|
139983
139933
|
`
|
139984
139934
|
);
|
@@ -140003,7 +139953,7 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
140003
139953
|
}
|
140004
139954
|
output2.print(
|
140005
139955
|
!framework.slug ? `No framework detected. Default Project Settings:
|
140006
|
-
` : `Auto-detected Project Settings (${
|
139956
|
+
` : `Auto-detected Project Settings (${import_chalk45.default.bold(framework.name)}):
|
140007
139957
|
`
|
140008
139958
|
);
|
140009
139959
|
settings.framework = framework.slug;
|
@@ -140015,8 +139965,8 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
140015
139965
|
const override = localConfigurationOverrides?.[setting];
|
140016
139966
|
if (!override && defaultSetting) {
|
140017
139967
|
output2.print(
|
140018
|
-
`${
|
140019
|
-
`- ${
|
139968
|
+
`${import_chalk45.default.dim(
|
139969
|
+
`- ${import_chalk45.default.bold(`${settingMap[setting]}:`)} ${isSettingValue(defaultSetting) ? defaultSetting.value : import_chalk45.default.italic(`${defaultSetting.placeholder}`)}`
|
140020
139970
|
)}
|
140021
139971
|
`
|
140022
139972
|
);
|
@@ -140038,17 +139988,17 @@ async function editProjectSettings(client2, projectSettings, framework, autoConf
|
|
140038
139988
|
for (let setting of settingFields) {
|
140039
139989
|
const field = settingMap[setting];
|
140040
139990
|
settings[setting] = await client2.input.text({
|
140041
|
-
message: `What's your ${
|
139991
|
+
message: `What's your ${import_chalk45.default.bold(field)}?`
|
140042
139992
|
});
|
140043
139993
|
}
|
140044
139994
|
return settings;
|
140045
139995
|
}
|
140046
|
-
var
|
139996
|
+
var import_chalk45, import_frameworks2, settingMap, settingKeys;
|
140047
139997
|
var init_edit_project_settings = __esm({
|
140048
139998
|
"src/util/input/edit-project-settings.ts"() {
|
140049
139999
|
"use strict";
|
140050
140000
|
init_confirm();
|
140051
|
-
|
140001
|
+
import_chalk45 = __toESM3(require_source());
|
140052
140002
|
import_frameworks2 = __toESM3(require_frameworks());
|
140053
140003
|
init_is_setting_value();
|
140054
140004
|
settingMap = {
|
@@ -140225,7 +140175,7 @@ function printInspectUrl(output2, inspectorUrl, deployStamp) {
|
|
140225
140175
|
}
|
140226
140176
|
output2.print(
|
140227
140177
|
prependEmoji(
|
140228
|
-
`Inspect: ${
|
140178
|
+
`Inspect: ${import_chalk46.default.bold(inspectorUrl)} ${deployStamp()}`,
|
140229
140179
|
emoji("inspect")
|
140230
140180
|
) + `
|
140231
140181
|
`
|
@@ -140277,7 +140227,7 @@ async function processDeployment({
|
|
140277
140227
|
archive,
|
140278
140228
|
agent
|
140279
140229
|
};
|
140280
|
-
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${
|
140230
|
+
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${import_chalk46.default.bold(`${org.slug}/${projectName}`)}`;
|
140281
140231
|
output2.spinner(deployingSpinnerVal, 0);
|
140282
140232
|
const indications = [];
|
140283
140233
|
try {
|
@@ -140307,7 +140257,7 @@ async function processDeployment({
|
|
140307
140257
|
const percent = uploadedBytes / missingSize;
|
140308
140258
|
if (percent >= nextStep) {
|
140309
140259
|
output2.spinner(
|
140310
|
-
`Uploading ${
|
140260
|
+
`Uploading ${import_chalk46.default.reset(
|
140311
140261
|
`[${bar}] (${uploadedHuman}/${totalSizeHuman})`
|
140312
140262
|
)}`,
|
140313
140263
|
0
|
@@ -140345,7 +140295,7 @@ async function processDeployment({
|
|
140345
140295
|
const previewUrl = `https://${deployment.url}`;
|
140346
140296
|
output2.print(
|
140347
140297
|
prependEmoji(
|
140348
|
-
`${isProdDeployment ? "Production" : "Preview"}: ${
|
140298
|
+
`${isProdDeployment ? "Production" : "Preview"}: ${import_chalk46.default.bold(
|
140349
140299
|
previewUrl
|
140350
140300
|
)} ${deployStamp()}`,
|
140351
140301
|
emoji("success")
|
@@ -140404,12 +140354,12 @@ async function processDeployment({
|
|
140404
140354
|
throw err;
|
140405
140355
|
}
|
140406
140356
|
}
|
140407
|
-
var import_bytes3,
|
140357
|
+
var import_bytes3, import_chalk46, import_client3;
|
140408
140358
|
var init_process_deployment = __esm({
|
140409
140359
|
"src/util/deploy/process-deployment.ts"() {
|
140410
140360
|
"use strict";
|
140411
140361
|
import_bytes3 = __toESM3(require_bytes());
|
140412
|
-
|
140362
|
+
import_chalk46 = __toESM3(require_source());
|
140413
140363
|
import_client3 = __toESM3(require_dist10());
|
140414
140364
|
init_progress();
|
140415
140365
|
init_ua();
|
@@ -140419,7 +140369,7 @@ var init_process_deployment = __esm({
|
|
140419
140369
|
});
|
140420
140370
|
|
140421
140371
|
// src/util/index.ts
|
140422
|
-
var import_events2, import_querystring3, import_url12, import_async_retry4, import_ms7, import_node_fetch3, import_url13, import_bytes4,
|
140372
|
+
var import_events2, import_querystring3, import_url12, import_async_retry4, import_ms7, import_node_fetch3, import_url13, import_bytes4, import_chalk47, Now;
|
140423
140373
|
var init_util = __esm({
|
140424
140374
|
"src/util/index.ts"() {
|
140425
140375
|
"use strict";
|
@@ -140431,7 +140381,7 @@ var init_util = __esm({
|
|
140431
140381
|
import_node_fetch3 = __toESM3(require_lib14());
|
140432
140382
|
import_url13 = require("url");
|
140433
140383
|
import_bytes4 = __toESM3(require_bytes());
|
140434
|
-
|
140384
|
+
import_chalk47 = __toESM3(require_source());
|
140435
140385
|
init_ua();
|
140436
140386
|
init_process_deployment();
|
140437
140387
|
init_highlight();
|
@@ -140550,7 +140500,7 @@ var init_util = __esm({
|
|
140550
140500
|
if (sizeExceeded > 0) {
|
140551
140501
|
warn(`${sizeExceeded} of the files exceeded the limit for your plan.`);
|
140552
140502
|
log2(
|
140553
|
-
`Please upgrade your plan here: ${
|
140503
|
+
`Please upgrade your plan here: ${import_chalk47.default.cyan(
|
140554
140504
|
"https://vercel.com/account/plan"
|
140555
140505
|
)}`
|
140556
140506
|
);
|
@@ -140883,7 +140833,7 @@ async function setupAndLink(client2, path11, {
|
|
140883
140833
|
}
|
140884
140834
|
const shouldStartSetup = autoConfirm || await confirm(
|
140885
140835
|
client2,
|
140886
|
-
`${setupMsg} ${
|
140836
|
+
`${setupMsg} ${import_chalk48.default.cyan(`\u201C${humanizePath(path11)}\u201D`)}?`,
|
140887
140837
|
true
|
140888
140838
|
);
|
140889
140839
|
if (!shouldStartSetup) {
|
@@ -141035,12 +140985,12 @@ async function setupAndLink(client2, path11, {
|
|
141035
140985
|
return { status: "error", exitCode: 1 };
|
141036
140986
|
}
|
141037
140987
|
}
|
141038
|
-
var import_path19,
|
140988
|
+
var import_path19, import_chalk48, import_fs_extra12;
|
141039
140989
|
var init_setup_and_link = __esm({
|
141040
140990
|
"src/util/link/setup-and-link.ts"() {
|
141041
140991
|
"use strict";
|
141042
140992
|
import_path19 = require("path");
|
141043
|
-
|
140993
|
+
import_chalk48 = __toESM3(require_source());
|
141044
140994
|
import_fs_extra12 = __toESM3(require_lib());
|
141045
140995
|
init_link2();
|
141046
140996
|
init_create_project();
|
@@ -141246,20 +141196,20 @@ async function main(client2) {
|
|
141246
141196
|
const settingsStamp = stamp_default();
|
141247
141197
|
client2.output.print(
|
141248
141198
|
`${prependEmoji(
|
141249
|
-
`Downloaded project settings to ${
|
141199
|
+
`Downloaded project settings to ${import_chalk49.default.bold(
|
141250
141200
|
humanizePath((0, import_path20.join)(cwd2, VERCEL_DIR2, VERCEL_DIR_PROJECT))
|
141251
|
-
)} ${
|
141201
|
+
)} ${import_chalk49.default.gray(settingsStamp())}`,
|
141252
141202
|
emoji("success")
|
141253
141203
|
)}
|
141254
141204
|
`
|
141255
141205
|
);
|
141256
141206
|
return 0;
|
141257
141207
|
}
|
141258
|
-
var
|
141208
|
+
var import_chalk49, import_path20;
|
141259
141209
|
var init_pull2 = __esm({
|
141260
141210
|
"src/commands/pull/index.ts"() {
|
141261
141211
|
"use strict";
|
141262
|
-
|
141212
|
+
import_chalk49 = __toESM3(require_source());
|
141263
141213
|
import_path20 = require("path");
|
141264
141214
|
init_emoji();
|
141265
141215
|
init_get_args();
|
@@ -145792,9 +145742,9 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
|
|
145792
145742
|
const relOutputDir = (0, import_path28.relative)(cwd2, outputDir);
|
145793
145743
|
output2.print(
|
145794
145744
|
`${prependEmoji(
|
145795
|
-
`Build Completed in ${
|
145745
|
+
`Build Completed in ${import_chalk50.default.bold(
|
145796
145746
|
relOutputDir.startsWith("..") ? outputDir : relOutputDir
|
145797
|
-
)} ${
|
145747
|
+
)} ${import_chalk50.default.gray(buildStamp())}`,
|
145798
145748
|
emoji("success")
|
145799
145749
|
)}
|
145800
145750
|
`
|
@@ -145932,12 +145882,12 @@ async function readInstalledVersion({ output: output2 }, pkgName) {
|
|
145932
145882
|
}
|
145933
145883
|
return;
|
145934
145884
|
}
|
145935
|
-
var import_fs_extra18,
|
145885
|
+
var import_fs_extra18, import_chalk50, import_dotenv, import_semver3, import_minimatch2, import_path28, import_frameworks4, import_build_utils13, import_fs_detectors4, import_routing_utils2, import_client8, import_process;
|
145936
145886
|
var init_build = __esm({
|
145937
145887
|
"src/commands/build/index.ts"() {
|
145938
145888
|
"use strict";
|
145939
145889
|
import_fs_extra18 = __toESM3(require_lib());
|
145940
|
-
|
145890
|
+
import_chalk50 = __toESM3(require_source());
|
145941
145891
|
import_dotenv = __toESM3(require_main3());
|
145942
145892
|
import_semver3 = __toESM3(require_semver());
|
145943
145893
|
import_minimatch2 = __toESM3(require_minimatch2());
|
@@ -146033,7 +145983,7 @@ async function add(client2, opts, args2) {
|
|
146033
145983
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
146034
145984
|
);
|
146035
145985
|
output2.print(
|
146036
|
-
` ${
|
145986
|
+
` ${import_chalk51.default.cyan(
|
146037
145987
|
`${getCommandName(
|
146038
145988
|
"certs add --crt <domain.crt> --key <domain.key> --ca <ca.crt>"
|
146039
145989
|
)}`
|
@@ -146045,9 +145995,9 @@ async function add(client2, opts, args2) {
|
|
146045
145995
|
cert = await createCertFromFile(client2, keyPath, crtPath, caPath);
|
146046
145996
|
} else {
|
146047
145997
|
output2.warn(
|
146048
|
-
`${
|
145998
|
+
`${import_chalk51.default.cyan(
|
146049
145999
|
getCommandName("certs add")
|
146050
|
-
)} will be soon deprecated. Please use ${
|
146000
|
+
)} will be soon deprecated. Please use ${import_chalk51.default.cyan(
|
146051
146001
|
getCommandName("certs issue <cn> <cns>")
|
146052
146002
|
)} instead`
|
146053
146003
|
);
|
@@ -146056,7 +146006,7 @@ async function add(client2, opts, args2) {
|
|
146056
146006
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
146057
146007
|
);
|
146058
146008
|
output2.print(
|
146059
|
-
` ${
|
146009
|
+
` ${import_chalk51.default.cyan(getCommandName("certs add <cn>[, <cn>]"))}
|
146060
146010
|
`
|
146061
146011
|
);
|
146062
146012
|
return 1;
|
@@ -146066,7 +146016,7 @@ async function add(client2, opts, args2) {
|
|
146066
146016
|
[]
|
146067
146017
|
);
|
146068
146018
|
output2.spinner(
|
146069
|
-
`Generating a certificate for ${
|
146019
|
+
`Generating a certificate for ${import_chalk51.default.bold(cns.join(", "))}`
|
146070
146020
|
);
|
146071
146021
|
cert = await createCertForCns(client2, cns, contextName);
|
146072
146022
|
output2.stopSpinner();
|
@@ -146076,18 +146026,18 @@ async function add(client2, opts, args2) {
|
|
146076
146026
|
return 1;
|
146077
146027
|
} else {
|
146078
146028
|
output2.success(
|
146079
|
-
`Certificate entry for ${
|
146029
|
+
`Certificate entry for ${import_chalk51.default.bold(
|
146080
146030
|
cert.cns.join(", ")
|
146081
146031
|
)} created ${addStamp()}`
|
146082
146032
|
);
|
146083
146033
|
}
|
146084
146034
|
return 0;
|
146085
146035
|
}
|
146086
|
-
var
|
146036
|
+
var import_chalk51, add_default;
|
146087
146037
|
var init_add = __esm({
|
146088
146038
|
"src/commands/certs/add.ts"() {
|
146089
146039
|
"use strict";
|
146090
|
-
|
146040
|
+
import_chalk51 = __toESM3(require_source());
|
146091
146041
|
init_get_scope();
|
146092
146042
|
init_stamp();
|
146093
146043
|
init_create_cert_from_file();
|
@@ -146100,7 +146050,7 @@ var init_add = __esm({
|
|
146100
146050
|
// src/util/certs/finish-cert-order.ts
|
146101
146051
|
async function startCertOrder(client2, cns, context) {
|
146102
146052
|
client2.output.spinner(
|
146103
|
-
`Issuing a certificate for ${
|
146053
|
+
`Issuing a certificate for ${import_chalk52.default.bold(cns.join(", "))}`
|
146104
146054
|
);
|
146105
146055
|
try {
|
146106
146056
|
const cert = await client2.fetch("/v3/now/certs", {
|
@@ -146124,11 +146074,11 @@ async function startCertOrder(client2, cns, context) {
|
|
146124
146074
|
throw err;
|
146125
146075
|
}
|
146126
146076
|
}
|
146127
|
-
var
|
146077
|
+
var import_chalk52;
|
146128
146078
|
var init_finish_cert_order = __esm({
|
146129
146079
|
"src/util/certs/finish-cert-order.ts"() {
|
146130
146080
|
"use strict";
|
146131
|
-
|
146081
|
+
import_chalk52 = __toESM3(require_source());
|
146132
146082
|
init_errors_ts();
|
146133
146083
|
init_map_cert_error();
|
146134
146084
|
}
|
@@ -146147,9 +146097,9 @@ var init_get_cns_from_args = __esm({
|
|
146147
146097
|
// src/util/certs/start-cert-order.ts
|
146148
146098
|
async function startCertOrder2(client2, cns, contextName) {
|
146149
146099
|
client2.output.spinner(
|
146150
|
-
`Starting certificate issuance for ${
|
146100
|
+
`Starting certificate issuance for ${import_chalk53.default.bold(
|
146151
146101
|
cns.join(", ")
|
146152
|
-
)} under ${
|
146102
|
+
)} under ${import_chalk53.default.bold(contextName)}`
|
146153
146103
|
);
|
146154
146104
|
const order = await client2.fetch("/v3/now/certs", {
|
146155
146105
|
method: "PATCH",
|
@@ -146160,11 +146110,11 @@ async function startCertOrder2(client2, cns, contextName) {
|
|
146160
146110
|
});
|
146161
146111
|
return order;
|
146162
146112
|
}
|
146163
|
-
var
|
146113
|
+
var import_chalk53;
|
146164
146114
|
var init_start_cert_order = __esm({
|
146165
146115
|
"src/util/certs/start-cert-order.ts"() {
|
146166
146116
|
"use strict";
|
146167
|
-
|
146117
|
+
import_chalk53 = __toESM3(require_source());
|
146168
146118
|
}
|
146169
146119
|
});
|
146170
146120
|
|
@@ -146191,7 +146141,7 @@ async function issue(client2, opts, args2) {
|
|
146191
146141
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
146192
146142
|
);
|
146193
146143
|
output2.print(
|
146194
|
-
` ${
|
146144
|
+
` ${import_chalk54.default.cyan(
|
146195
146145
|
getCommandName(
|
146196
146146
|
"certs issue --crt <domain.crt> --key <domain.key> --ca <ca.crt>"
|
146197
146147
|
)
|
@@ -146206,7 +146156,7 @@ async function issue(client2, opts, args2) {
|
|
146206
146156
|
return 1;
|
146207
146157
|
}
|
146208
146158
|
output2.success(
|
146209
|
-
`Certificate entry for ${
|
146159
|
+
`Certificate entry for ${import_chalk54.default.bold(
|
146210
146160
|
cert.cns.join(", ")
|
146211
146161
|
)} created ${addStamp()}`
|
146212
146162
|
);
|
@@ -146217,7 +146167,7 @@ async function issue(client2, opts, args2) {
|
|
146217
146167
|
`Invalid number of arguments to create a custom certificate entry. Usage:`
|
146218
146168
|
);
|
146219
146169
|
output2.print(
|
146220
|
-
` ${
|
146170
|
+
` ${import_chalk54.default.cyan(getCommandName("certs issue <cn>[, <cn>]"))}
|
146221
146171
|
`
|
146222
146172
|
);
|
146223
146173
|
return 1;
|
@@ -146243,14 +146193,14 @@ async function issue(client2, opts, args2) {
|
|
146243
146193
|
}
|
146244
146194
|
if (handledResult instanceof DomainPermissionDenied) {
|
146245
146195
|
output2.error(
|
146246
|
-
`You do not have permissions over domain ${
|
146196
|
+
`You do not have permissions over domain ${import_chalk54.default.underline(
|
146247
146197
|
handledResult.meta.domain
|
146248
|
-
)} under ${
|
146198
|
+
)} under ${import_chalk54.default.bold(handledResult.meta.context)}.`
|
146249
146199
|
);
|
146250
146200
|
return 1;
|
146251
146201
|
}
|
146252
146202
|
output2.success(
|
146253
|
-
`Certificate entry for ${
|
146203
|
+
`Certificate entry for ${import_chalk54.default.bold(
|
146254
146204
|
handledResult.cns.join(", ")
|
146255
146205
|
)} created ${addStamp()}`
|
146256
146206
|
);
|
@@ -146272,7 +146222,7 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
146272
146222
|
}
|
146273
146223
|
if (pendingChallenges.length === 0) {
|
146274
146224
|
output2.log(
|
146275
|
-
`A certificate issuance for ${
|
146225
|
+
`A certificate issuance for ${import_chalk54.default.bold(
|
146276
146226
|
cns.join(", ")
|
146277
146227
|
)} has been started ${stamp()}`
|
146278
146228
|
);
|
@@ -146281,13 +146231,13 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
146281
146231
|
`
|
146282
146232
|
);
|
146283
146233
|
output2.print(
|
146284
|
-
` ${
|
146234
|
+
` ${import_chalk54.default.cyan(getCommandName(`certs issue ${cns.join(" ")}`))}
|
146285
146235
|
`
|
146286
146236
|
);
|
146287
146237
|
return 0;
|
146288
146238
|
}
|
146289
146239
|
output2.log(
|
146290
|
-
`A certificate issuance for ${
|
146240
|
+
`A certificate issuance for ${import_chalk54.default.bold(
|
146291
146241
|
cns.join(", ")
|
146292
146242
|
)} has been started ${stamp()}`
|
146293
146243
|
);
|
@@ -146316,7 +146266,7 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
146316
146266
|
`);
|
146317
146267
|
output2.log(`To issue the certificate once the records are added, run:`);
|
146318
146268
|
output2.print(
|
146319
|
-
` ${
|
146269
|
+
` ${import_chalk54.default.cyan(getCommandName(`certs issue ${cns.join(" ")}`))}
|
146320
146270
|
`
|
146321
146271
|
);
|
146322
146272
|
output2.print(
|
@@ -146324,12 +146274,12 @@ async function runStartOrder(output2, client2, cns, contextName, stamp, { fallin
|
|
146324
146274
|
);
|
146325
146275
|
return 0;
|
146326
146276
|
}
|
146327
|
-
var import_psl5,
|
146277
|
+
var import_psl5, import_chalk54;
|
146328
146278
|
var init_issue = __esm({
|
146329
146279
|
"src/commands/certs/issue.ts"() {
|
146330
146280
|
"use strict";
|
146331
146281
|
import_psl5 = __toESM3(require_psl());
|
146332
|
-
|
146282
|
+
import_chalk54 = __toESM3(require_source());
|
146333
146283
|
init_errors_ts();
|
146334
146284
|
init_create_cert_for_cns();
|
146335
146285
|
init_create_cert_from_file();
|
@@ -146372,7 +146322,7 @@ async function ls2(client2, opts, args2) {
|
|
146372
146322
|
const lsStamp = stamp_default();
|
146373
146323
|
if (args2.length !== 0) {
|
146374
146324
|
output2.error(
|
146375
|
-
`Invalid number of arguments. Usage: ${
|
146325
|
+
`Invalid number of arguments. Usage: ${import_chalk55.default.cyan(
|
146376
146326
|
`${getCommandName("certs ls")}`
|
146377
146327
|
)}`
|
146378
146328
|
);
|
@@ -146380,7 +146330,7 @@ async function ls2(client2, opts, args2) {
|
|
146380
146330
|
}
|
146381
146331
|
const { certs, pagination } = await getCerts(client2, ...paginationOptions);
|
146382
146332
|
output2.log(
|
146383
|
-
`${certs.length > 0 ? "Certificates" : "No certificates"} found under ${
|
146333
|
+
`${certs.length > 0 ? "Certificates" : "No certificates"} found under ${import_chalk55.default.bold(contextName)} ${lsStamp()}`
|
146384
146334
|
);
|
146385
146335
|
if (certs.length > 0) {
|
146386
146336
|
client2.stdout.write(formatCertsTable(certs));
|
@@ -146408,11 +146358,11 @@ function formatCertsTable(certsList) {
|
|
146408
146358
|
}
|
146409
146359
|
function formatCertsTableHead() {
|
146410
146360
|
return [
|
146411
|
-
|
146412
|
-
|
146413
|
-
|
146414
|
-
|
146415
|
-
|
146361
|
+
import_chalk55.default.dim("id"),
|
146362
|
+
import_chalk55.default.dim("cns"),
|
146363
|
+
import_chalk55.default.dim("expiration"),
|
146364
|
+
import_chalk55.default.dim("renew"),
|
146365
|
+
import_chalk55.default.dim("age")
|
146416
146366
|
];
|
146417
146367
|
}
|
146418
146368
|
function formatCertsTableBody(certsList) {
|
@@ -146431,7 +146381,7 @@ function formatCertNonFirstCn(cn, multiple) {
|
|
146431
146381
|
return ["", formatCertCn(cn, multiple), "", "", ""];
|
146432
146382
|
}
|
146433
146383
|
function formatCertCn(cn, multiple) {
|
146434
|
-
return multiple ? `${
|
146384
|
+
return multiple ? `${import_chalk55.default.gray("-")} ${import_chalk55.default.bold(cn)}` : import_chalk55.default.bold(cn);
|
146435
146385
|
}
|
146436
146386
|
function formatCertFirstCn(time, cert, cn, multiple) {
|
146437
146387
|
return [
|
@@ -146439,18 +146389,18 @@ function formatCertFirstCn(time, cert, cn, multiple) {
|
|
146439
146389
|
formatCertCn(cn, multiple),
|
146440
146390
|
formatExpirationDate(new Date(cert.expiration)),
|
146441
146391
|
cert.autoRenew ? "yes" : "no",
|
146442
|
-
|
146392
|
+
import_chalk55.default.gray((0, import_ms8.default)(time.getTime() - new Date(cert.created).getTime()))
|
146443
146393
|
];
|
146444
146394
|
}
|
146445
146395
|
function formatExpirationDate(date) {
|
146446
146396
|
const diff = date.getTime() - Date.now();
|
146447
|
-
return diff < 0 ?
|
146397
|
+
return diff < 0 ? import_chalk55.default.gray(`${(0, import_ms8.default)(-diff)} ago`) : import_chalk55.default.gray(`in ${(0, import_ms8.default)(diff)}`);
|
146448
146398
|
}
|
146449
|
-
var
|
146399
|
+
var import_chalk55, import_ms8, import_text_table4, ls_default;
|
146450
146400
|
var init_ls2 = __esm({
|
146451
146401
|
"src/commands/certs/ls.ts"() {
|
146452
146402
|
"use strict";
|
146453
|
-
|
146403
|
+
import_chalk55 = __toESM3(require_source());
|
146454
146404
|
import_ms8 = __toESM3(require_ms2());
|
146455
146405
|
import_text_table4 = __toESM3(require_text_table());
|
146456
146406
|
init_get_scope();
|
@@ -146524,7 +146474,7 @@ async function rm2(client2, opts, args2) {
|
|
146524
146474
|
const { contextName } = await getScope(client2);
|
146525
146475
|
if (args2.length !== 1) {
|
146526
146476
|
output2.error(
|
146527
|
-
`Invalid number of arguments. Usage: ${
|
146477
|
+
`Invalid number of arguments. Usage: ${import_chalk56.default.cyan(
|
146528
146478
|
`${getCommandName("certs rm <id or cn>")}`
|
146529
146479
|
)}`
|
146530
146480
|
);
|
@@ -146541,13 +146491,13 @@ async function rm2(client2, opts, args2) {
|
|
146541
146491
|
if (certs.length === 0) {
|
146542
146492
|
if (id.includes(".")) {
|
146543
146493
|
output2.error(
|
146544
|
-
`No custom certificates found for "${id}" under ${
|
146494
|
+
`No custom certificates found for "${id}" under ${import_chalk56.default.bold(
|
146545
146495
|
contextName
|
146546
146496
|
)}`
|
146547
146497
|
);
|
146548
146498
|
} else {
|
146549
146499
|
output2.error(
|
146550
|
-
`No certificates found by id "${id}" under ${
|
146500
|
+
`No certificates found by id "${id}" under ${import_chalk56.default.bold(contextName)}`
|
146551
146501
|
);
|
146552
146502
|
}
|
146553
146503
|
return 1;
|
@@ -146564,7 +146514,7 @@ async function rm2(client2, opts, args2) {
|
|
146564
146514
|
certs.map((cert) => deleteCertById(output2, client2, cert.uid))
|
146565
146515
|
);
|
146566
146516
|
output2.success(
|
146567
|
-
`${
|
146517
|
+
`${import_chalk56.default.bold(
|
146568
146518
|
(0, import_pluralize5.default)("Certificate", certs.length, true)
|
146569
146519
|
)} removed ${rmStamp()}`
|
146570
146520
|
);
|
@@ -146592,7 +146542,7 @@ function readConfirmation(output2, msg, certs) {
|
|
146592
146542
|
`
|
146593
146543
|
);
|
146594
146544
|
output2.print(
|
146595
|
-
`${
|
146545
|
+
`${import_chalk56.default.bold.red("> Are you sure?")} ${import_chalk56.default.gray("(y/N) ")}`
|
146596
146546
|
);
|
146597
146547
|
process.stdin.on("data", (d) => {
|
146598
146548
|
process.stdin.pause();
|
@@ -146603,15 +146553,15 @@ function readConfirmation(output2, msg, certs) {
|
|
146603
146553
|
function formatCertRow(cert) {
|
146604
146554
|
return [
|
146605
146555
|
cert.uid,
|
146606
|
-
|
146607
|
-
...cert.created ? [
|
146556
|
+
import_chalk56.default.bold(cert.cns ? cert.cns.join(", ") : "\u2013"),
|
146557
|
+
...cert.created ? [import_chalk56.default.gray(`${(0, import_ms9.default)(Date.now() - new Date(cert.created).getTime())} ago`)] : []
|
146608
146558
|
];
|
146609
146559
|
}
|
146610
|
-
var
|
146560
|
+
var import_chalk56, import_ms9, import_pluralize5, import_text_table5, rm_default;
|
146611
146561
|
var init_rm2 = __esm({
|
146612
146562
|
"src/commands/certs/rm.ts"() {
|
146613
146563
|
"use strict";
|
146614
|
-
|
146564
|
+
import_chalk56 = __toESM3(require_source());
|
146615
146565
|
import_ms9 = __toESM3(require_ms2());
|
146616
146566
|
import_pluralize5 = __toESM3(require_pluralize());
|
146617
146567
|
import_text_table5 = __toESM3(require_text_table());
|
@@ -146941,21 +146891,21 @@ async function printDeploymentStatus(client2, {
|
|
146941
146891
|
}
|
146942
146892
|
const newline = "\n";
|
146943
146893
|
for (let indication of indications) {
|
146944
|
-
const message2 = prependEmoji(
|
146894
|
+
const message2 = prependEmoji(import_chalk57.default.dim(indication.payload), emoji(indication.type)) + newline;
|
146945
146895
|
let link4 = "";
|
146946
146896
|
if (indication.link)
|
146947
|
-
link4 =
|
146897
|
+
link4 = import_chalk57.default.dim(
|
146948
146898
|
`${indication.action || "Learn More"}: ${link_default(indication.link)}`
|
146949
146899
|
) + newline;
|
146950
146900
|
output2.print(message2 + link4);
|
146951
146901
|
}
|
146952
146902
|
return 0;
|
146953
146903
|
}
|
146954
|
-
var
|
146904
|
+
var import_chalk57;
|
146955
146905
|
var init_print_deployment_status = __esm({
|
146956
146906
|
"src/util/deploy/print-deployment-status.ts"() {
|
146957
146907
|
"use strict";
|
146958
|
-
|
146908
|
+
import_chalk57 = __toESM3(require_source());
|
146959
146909
|
init_is_deploying();
|
146960
146910
|
init_link();
|
146961
146911
|
init_emoji();
|
@@ -147212,7 +147162,7 @@ function handleCreateDeployError(output2, error4, localConfig) {
|
|
147212
147162
|
}
|
147213
147163
|
if (error4 instanceof DomainVerificationFailed) {
|
147214
147164
|
output2.error(
|
147215
|
-
`The domain used as a suffix ${
|
147165
|
+
`The domain used as a suffix ${import_chalk58.default.underline(
|
147216
147166
|
error4.meta.domain
|
147217
147167
|
)} is not verified and can't be used as custom suffix.`
|
147218
147168
|
);
|
@@ -147220,7 +147170,7 @@ function handleCreateDeployError(output2, error4, localConfig) {
|
|
147220
147170
|
}
|
147221
147171
|
if (error4 instanceof DomainPermissionDenied) {
|
147222
147172
|
output2.error(
|
147223
|
-
`You don't have permissions to access the domain used as a suffix ${
|
147173
|
+
`You don't have permissions to access the domain used as a suffix ${import_chalk58.default.underline(
|
147224
147174
|
error4.meta.domain
|
147225
147175
|
)}.`
|
147226
147176
|
);
|
@@ -147246,7 +147196,7 @@ function handleCreateDeployError(output2, error4, localConfig) {
|
|
147246
147196
|
}
|
147247
147197
|
if (error4 instanceof DomainNotVerified) {
|
147248
147198
|
output2.error(
|
147249
|
-
`The domain used as an alias ${
|
147199
|
+
`The domain used as an alias ${import_chalk58.default.underline(
|
147250
147200
|
error4.meta.domain
|
147251
147201
|
)} is not verified yet. Please verify it.`
|
147252
147202
|
);
|
@@ -147265,7 +147215,7 @@ function handleCreateDeployError(output2, error4, localConfig) {
|
|
147265
147215
|
}
|
147266
147216
|
return error4;
|
147267
147217
|
}
|
147268
|
-
var import_build_utils14, import_client10, import_error_utils18, import_bytes5,
|
147218
|
+
var import_build_utils14, import_client10, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms10, import_path32, deploy_default, addProcessEnv;
|
147269
147219
|
var init_deploy = __esm({
|
147270
147220
|
"src/commands/deploy/index.ts"() {
|
147271
147221
|
"use strict";
|
@@ -147273,7 +147223,7 @@ var init_deploy = __esm({
|
|
147273
147223
|
import_client10 = __toESM3(require_dist10());
|
147274
147224
|
import_error_utils18 = __toESM3(require_dist2());
|
147275
147225
|
import_bytes5 = __toESM3(require_bytes());
|
147276
|
-
|
147226
|
+
import_chalk58 = __toESM3(require_source());
|
147277
147227
|
import_fs_extra20 = __toESM3(require_lib());
|
147278
147228
|
import_ms10 = __toESM3(require_ms2());
|
147279
147229
|
import_path32 = require("path");
|
@@ -147420,7 +147370,7 @@ var init_deploy = __esm({
|
|
147420
147370
|
if (status === "not_linked") {
|
147421
147371
|
const shouldStartSetup = autoConfirm || await confirm(
|
147422
147372
|
client2,
|
147423
|
-
`Set up and deploy ${
|
147373
|
+
`Set up and deploy ${import_chalk58.default.cyan(`\u201C${humanizePath(cwd2)}\u201D`)}?`,
|
147424
147374
|
true
|
147425
147375
|
);
|
147426
147376
|
if (!shouldStartSetup) {
|
@@ -147823,15 +147773,15 @@ ${err.stack}`);
|
|
147823
147773
|
val = process.env[key];
|
147824
147774
|
if (typeof val === "string") {
|
147825
147775
|
log2(
|
147826
|
-
`Reading ${
|
147827
|
-
`"${
|
147776
|
+
`Reading ${import_chalk58.default.bold(
|
147777
|
+
`"${import_chalk58.default.bold(key)}"`
|
147828
147778
|
)} from your env (as no value was specified)`
|
147829
147779
|
);
|
147830
147780
|
env[key] = val.replace(/^@/, "\\@");
|
147831
147781
|
} else {
|
147832
147782
|
throw new Error(
|
147833
|
-
`No value specified for env ${
|
147834
|
-
`"${
|
147783
|
+
`No value specified for env ${import_chalk58.default.bold(
|
147784
|
+
`"${import_chalk58.default.bold(key)}"`
|
147835
147785
|
)} and it was not found in your env.`
|
147836
147786
|
);
|
147837
147787
|
}
|
@@ -164879,14 +164829,14 @@ function buildMatchEquals(a, b) {
|
|
164879
164829
|
return false;
|
164880
164830
|
return true;
|
164881
164831
|
}
|
164882
|
-
var import_url17, import_http3, import_fs_extra21,
|
164832
|
+
var import_url17, import_http3, import_fs_extra21, import_chalk59, import_node_fetch5, import_pluralize7, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy, import_crypto3, 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_utils17, import_fs_detectors6, import_frameworks5, import_error_utils19, frontendRuntimeSet, DevServer;
|
164883
164833
|
var init_server = __esm({
|
164884
164834
|
"src/util/dev/server.ts"() {
|
164885
164835
|
"use strict";
|
164886
164836
|
import_url17 = __toESM3(require("url"));
|
164887
164837
|
import_http3 = __toESM3(require("http"));
|
164888
164838
|
import_fs_extra21 = __toESM3(require_lib());
|
164889
|
-
|
164839
|
+
import_chalk59 = __toESM3(require_source());
|
164890
164840
|
import_node_fetch5 = __toESM3(require_lib14());
|
164891
164841
|
import_pluralize7 = __toESM3(require_pluralize());
|
164892
164842
|
import_raw_body = __toESM3(require_raw_body());
|
@@ -164962,7 +164912,7 @@ var init_server = __esm({
|
|
164962
164912
|
return;
|
164963
164913
|
}
|
164964
164914
|
const method = req.method || "GET";
|
164965
|
-
this.output.debug(`${
|
164915
|
+
this.output.debug(`${import_chalk59.default.bold(method)} ${req.url}`);
|
164966
164916
|
try {
|
164967
164917
|
const vercelConfig = await this.getVercelConfig();
|
164968
164918
|
await this.serveProjectAsNowV2(req, res, requestId, vercelConfig);
|
@@ -165164,7 +165114,7 @@ var init_server = __esm({
|
|
165164
165114
|
}
|
165165
165115
|
} catch (err) {
|
165166
165116
|
if ((0, import_error_utils19.isSpawnError)(err) && err.code === "ENOENT") {
|
165167
|
-
err.message = `Command not found: ${
|
165117
|
+
err.message = `Command not found: ${import_chalk59.default.cyan(
|
165168
165118
|
err.path,
|
165169
165119
|
...err.spawnargs
|
165170
165120
|
)}
|
@@ -165421,7 +165371,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
165421
165371
|
});
|
165422
165372
|
} catch (err) {
|
165423
165373
|
if ((0, import_error_utils19.isSpawnError)(err) && err.code === "ENOENT") {
|
165424
|
-
err.message = `Command not found: ${
|
165374
|
+
err.message = `Command not found: ${import_chalk59.default.cyan(
|
165425
165375
|
err.path,
|
165426
165376
|
...err.spawnargs
|
165427
165377
|
)}
|
@@ -166120,10 +166070,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
166120
166070
|
*/
|
166121
166071
|
async _start(...listenSpec) {
|
166122
166072
|
if (!import_fs_extra21.default.existsSync(this.cwd)) {
|
166123
|
-
throw new Error(`${
|
166073
|
+
throw new Error(`${import_chalk59.default.bold(this.cwd)} doesn't exist`);
|
166124
166074
|
}
|
166125
166075
|
if (!import_fs_extra21.default.lstatSync(this.cwd).isDirectory()) {
|
166126
|
-
throw new Error(`${
|
166076
|
+
throw new Error(`${import_chalk59.default.bold(this.cwd)} is not a directory`);
|
166127
166077
|
}
|
166128
166078
|
const { ig } = await (0, import_client11.getVercelIgnore)(this.cwd);
|
166129
166079
|
this.filter = ig.createFilter();
|
@@ -166137,14 +166087,14 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
166137
166087
|
if (err.code === "EADDRINUSE") {
|
166138
166088
|
if (typeof listenSpec[0] === "number") {
|
166139
166089
|
this.output.note(
|
166140
|
-
`Requested port ${
|
166090
|
+
`Requested port ${import_chalk59.default.yellow(
|
166141
166091
|
String(listenSpec[0])
|
166142
166092
|
)} is already in use`
|
166143
166093
|
);
|
166144
166094
|
listenSpec[0]++;
|
166145
166095
|
} else {
|
166146
166096
|
this.output.error(
|
166147
|
-
`Requested socket ${
|
166097
|
+
`Requested socket ${import_chalk59.default.cyan(
|
166148
166098
|
listenSpec[0]
|
166149
166099
|
)} is already in use`
|
166150
166100
|
);
|
@@ -166537,7 +166487,7 @@ ${error_code}
|
|
166537
166487
|
await treeKill(this.devProcess.pid);
|
166538
166488
|
}
|
166539
166489
|
this.output.log(
|
166540
|
-
`Running Dev Command ${
|
166490
|
+
`Running Dev Command ${import_chalk59.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`
|
166541
166491
|
);
|
166542
166492
|
const port = await (0, import_get_port.default)();
|
166543
166493
|
const env = (0, import_build_utils17.cloneEnv)(
|
@@ -166842,17 +166792,17 @@ async function main4(client2) {
|
|
166842
166792
|
function stringifyError(err) {
|
166843
166793
|
if (err instanceof NowError) {
|
166844
166794
|
const errMeta = JSON.stringify(err.meta, null, 2).replace(/\\n/g, "\n");
|
166845
|
-
return `${
|
166795
|
+
return `${import_chalk60.default.red(err.code)} ${err.message}
|
166846
166796
|
${errMeta}`;
|
166847
166797
|
}
|
166848
166798
|
return err.stack;
|
166849
166799
|
}
|
166850
|
-
var import_path39,
|
166800
|
+
var import_path39, import_chalk60, import_error_utils20, COMMAND_CONFIG3;
|
166851
166801
|
var init_dev2 = __esm({
|
166852
166802
|
"src/commands/dev/index.ts"() {
|
166853
166803
|
"use strict";
|
166854
166804
|
import_path39 = __toESM3(require("path"));
|
166855
|
-
|
166805
|
+
import_chalk60 = __toESM3(require_source());
|
166856
166806
|
init_get_args();
|
166857
166807
|
init_get_subcommand();
|
166858
166808
|
init_now_error();
|
@@ -167027,13 +166977,13 @@ function text({
|
|
167027
166977
|
stdout.write(label);
|
167028
166978
|
} else {
|
167029
166979
|
const _label = label.replace("-", "\u2716");
|
167030
|
-
stdout.write(
|
166980
|
+
stdout.write(import_chalk61.default.red(_label));
|
167031
166981
|
}
|
167032
166982
|
value = initialValue;
|
167033
166983
|
stdout.write(initialValue);
|
167034
166984
|
if (mask) {
|
167035
166985
|
if (!value) {
|
167036
|
-
value =
|
166986
|
+
value = import_chalk61.default.gray(placeholder);
|
167037
166987
|
caretOffset = 0 - (0, import_strip_ansi6.default)(value).length;
|
167038
166988
|
stdout.write(value);
|
167039
166989
|
stdout.write(import_ansi_escapes6.default.cursorBackward(Math.abs(caretOffset)));
|
@@ -167116,11 +167066,11 @@ function text({
|
|
167116
167066
|
} else {
|
167117
167067
|
if (mask === "cc" || mask === "ccv") {
|
167118
167068
|
value = formatCC(value);
|
167119
|
-
value = value.replace(regex,
|
167069
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
167120
167070
|
} else if (mask === "expDate") {
|
167121
|
-
value = value.replace(regex,
|
167071
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
167122
167072
|
}
|
167123
|
-
const l =
|
167073
|
+
const l = import_chalk61.default.red(label.replace("-", "\u2716"));
|
167124
167074
|
stdout.write(eraseLines(1));
|
167125
167075
|
stdout.write(l + value + import_ansi_escapes6.default.beep);
|
167126
167076
|
if (caretOffset) {
|
@@ -167160,7 +167110,7 @@ function text({
|
|
167160
167110
|
if (caretOffset === 0) {
|
167161
167111
|
const completion = await autoComplete(value);
|
167162
167112
|
if (completion) {
|
167163
|
-
suggestion =
|
167113
|
+
suggestion = import_chalk61.default.gray(completion);
|
167164
167114
|
suggestion += import_ansi_escapes6.default.cursorBackward(completion.length);
|
167165
167115
|
} else {
|
167166
167116
|
suggestion = "";
|
@@ -167172,9 +167122,9 @@ function text({
|
|
167172
167122
|
}
|
167173
167123
|
if (mask === "cc" || mask === "ccv") {
|
167174
167124
|
value = formatCC(value);
|
167175
|
-
value = value.replace(regex,
|
167125
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
167176
167126
|
} else if (mask === "expDate") {
|
167177
|
-
value = value.replace(regex,
|
167127
|
+
value = value.replace(regex, import_chalk61.default.gray("$1"));
|
167178
167128
|
}
|
167179
167129
|
stdout.write(eraseLines(1));
|
167180
167130
|
stdout.write(label + value + suggestion);
|
@@ -167187,11 +167137,11 @@ function text({
|
|
167187
167137
|
}
|
167188
167138
|
});
|
167189
167139
|
}
|
167190
|
-
var
|
167140
|
+
var import_chalk61, import_ansi_escapes6, import_ansi_regex, import_strip_ansi6, ESCAPES, formatCC;
|
167191
167141
|
var init_text = __esm({
|
167192
167142
|
"src/util/input/text.ts"() {
|
167193
167143
|
"use strict";
|
167194
|
-
|
167144
|
+
import_chalk61 = __toESM3(require_source());
|
167195
167145
|
import_ansi_escapes6 = __toESM3(require_ansi_escapes());
|
167196
167146
|
import_ansi_regex = __toESM3(require_ansi_regex2());
|
167197
167147
|
import_strip_ansi6 = __toESM3(require_strip_ansi2());
|
@@ -167227,9 +167177,9 @@ async function getDNSData(client2, data) {
|
|
167227
167177
|
const port = await getNumber(`- ${type} port: `);
|
167228
167178
|
const target = await getTrimmedString(`- ${type} target: `);
|
167229
167179
|
output2.log(
|
167230
|
-
`${
|
167180
|
+
`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(
|
167231
167181
|
`${priority}`
|
167232
|
-
)} ${
|
167182
|
+
)} ${import_chalk62.default.cyan(`${weight}`)} ${import_chalk62.default.cyan(`${port}`)} ${import_chalk62.default.cyan(
|
167233
167183
|
target
|
167234
167184
|
)}.`
|
167235
167185
|
);
|
@@ -167248,9 +167198,9 @@ async function getDNSData(client2, data) {
|
|
167248
167198
|
const mxPriority = await getNumber(`- ${type} priority: `);
|
167249
167199
|
const value2 = await getTrimmedString(`- ${type} host: `);
|
167250
167200
|
output2.log(
|
167251
|
-
`${
|
167201
|
+
`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(
|
167252
167202
|
`${mxPriority}`
|
167253
|
-
)} ${
|
167203
|
+
)} ${import_chalk62.default.cyan(value2)}`
|
167254
167204
|
);
|
167255
167205
|
return await verifyData(client2) ? {
|
167256
167206
|
name,
|
@@ -167260,7 +167210,7 @@ async function getDNSData(client2, data) {
|
|
167260
167210
|
} : null;
|
167261
167211
|
}
|
167262
167212
|
const value = await getTrimmedString(`- ${type} value: `);
|
167263
|
-
output2.log(`${
|
167213
|
+
output2.log(`${import_chalk62.default.cyan(name)} ${import_chalk62.default.bold(type)} ${import_chalk62.default.cyan(value)}`);
|
167264
167214
|
return await verifyData(client2) ? {
|
167265
167215
|
name,
|
167266
167216
|
type,
|
@@ -167271,7 +167221,7 @@ async function getDNSData(client2, data) {
|
|
167271
167221
|
}
|
167272
167222
|
}
|
167273
167223
|
async function verifyData(client2) {
|
167274
|
-
return
|
167224
|
+
return confirm(client2, "Is this correct?", false);
|
167275
167225
|
}
|
167276
167226
|
async function getRecordName(type) {
|
167277
167227
|
const input = await text({
|
@@ -167294,13 +167244,13 @@ async function getTrimmedString(label) {
|
|
167294
167244
|
});
|
167295
167245
|
return res.trim();
|
167296
167246
|
}
|
167297
|
-
var
|
167247
|
+
var import_chalk62, RECORD_TYPES;
|
167298
167248
|
var init_get_dns_data = __esm({
|
167299
167249
|
"src/util/dns/get-dns-data.ts"() {
|
167300
167250
|
"use strict";
|
167301
|
-
|
167251
|
+
import_chalk62 = __toESM3(require_source());
|
167302
167252
|
init_text();
|
167303
|
-
|
167253
|
+
init_confirm();
|
167304
167254
|
RECORD_TYPES = ["A", "AAAA", "ALIAS", "CAA", "CNAME", "MX", "SRV", "TXT"];
|
167305
167255
|
}
|
167306
167256
|
});
|
@@ -167312,7 +167262,7 @@ async function add2(client2, opts, args2) {
|
|
167312
167262
|
const parsedParams = parseAddArgs(args2);
|
167313
167263
|
if (!parsedParams) {
|
167314
167264
|
output2.error(
|
167315
|
-
`Invalid number of arguments. See: ${
|
167265
|
+
`Invalid number of arguments. See: ${import_chalk63.default.cyan(
|
167316
167266
|
`${getCommandName("dns --help")}`
|
167317
167267
|
)} for usage.`
|
167318
167268
|
);
|
@@ -167328,23 +167278,23 @@ async function add2(client2, opts, args2) {
|
|
167328
167278
|
const record = await addDNSRecord(client2, domain, data);
|
167329
167279
|
if (record instanceof DomainNotFound) {
|
167330
167280
|
output2.error(
|
167331
|
-
`The domain ${domain} can't be found under ${
|
167281
|
+
`The domain ${domain} can't be found under ${import_chalk63.default.bold(
|
167332
167282
|
contextName
|
167333
|
-
)} ${
|
167283
|
+
)} ${import_chalk63.default.gray(addStamp())}`
|
167334
167284
|
);
|
167335
167285
|
return 1;
|
167336
167286
|
}
|
167337
167287
|
if (record instanceof DNSPermissionDenied) {
|
167338
167288
|
output2.error(
|
167339
|
-
`You don't have permissions to add records to domain ${domain} under ${
|
167289
|
+
`You don't have permissions to add records to domain ${domain} under ${import_chalk63.default.bold(
|
167340
167290
|
contextName
|
167341
|
-
)} ${
|
167291
|
+
)} ${import_chalk63.default.gray(addStamp())}`
|
167342
167292
|
);
|
167343
167293
|
return 1;
|
167344
167294
|
}
|
167345
167295
|
if (record instanceof DNSInvalidPort) {
|
167346
167296
|
output2.error(
|
167347
|
-
`Invalid <port> parameter. A number was expected ${
|
167297
|
+
`Invalid <port> parameter. A number was expected ${import_chalk63.default.gray(
|
167348
167298
|
addStamp()
|
167349
167299
|
)}`
|
167350
167300
|
);
|
@@ -167352,7 +167302,7 @@ async function add2(client2, opts, args2) {
|
|
167352
167302
|
}
|
167353
167303
|
if (record instanceof DNSInvalidType) {
|
167354
167304
|
output2.error(
|
167355
|
-
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${
|
167305
|
+
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${import_chalk63.default.gray(
|
167356
167306
|
addStamp()
|
167357
167307
|
)}`
|
167358
167308
|
);
|
@@ -167363,19 +167313,19 @@ async function add2(client2, opts, args2) {
|
|
167363
167313
|
return 1;
|
167364
167314
|
}
|
167365
167315
|
console.log(
|
167366
|
-
`${
|
167316
|
+
`${import_chalk63.default.cyan("> Success!")} DNS record for domain ${import_chalk63.default.bold(
|
167367
167317
|
domain
|
167368
|
-
)} ${
|
167318
|
+
)} ${import_chalk63.default.gray(`(${record.uid})`)} created under ${import_chalk63.default.bold(
|
167369
167319
|
contextName
|
167370
|
-
)} ${
|
167320
|
+
)} ${import_chalk63.default.gray(addStamp())}`
|
167371
167321
|
);
|
167372
167322
|
return 0;
|
167373
167323
|
}
|
167374
|
-
var
|
167324
|
+
var import_chalk63;
|
167375
167325
|
var init_add2 = __esm({
|
167376
167326
|
"src/commands/dns/add.ts"() {
|
167377
167327
|
"use strict";
|
167378
|
-
|
167328
|
+
import_chalk63 = __toESM3(require_source());
|
167379
167329
|
init_errors_ts();
|
167380
167330
|
init_add_dns_record();
|
167381
167331
|
init_get_scope();
|
@@ -167389,7 +167339,7 @@ var init_add2 = __esm({
|
|
167389
167339
|
// src/util/dns/import-zonefile.ts
|
167390
167340
|
async function importZonefile(client2, contextName, domain, zonefilePath) {
|
167391
167341
|
client2.output.spinner(
|
167392
|
-
`Importing Zone file for domain ${domain} under ${
|
167342
|
+
`Importing Zone file for domain ${domain} under ${import_chalk64.default.bold(contextName)}`
|
167393
167343
|
);
|
167394
167344
|
const zonefile = (0, import_fs7.readFileSync)((0, import_path40.resolve)(zonefilePath), "utf8");
|
167395
167345
|
try {
|
@@ -167416,11 +167366,11 @@ async function importZonefile(client2, contextName, domain, zonefilePath) {
|
|
167416
167366
|
throw err;
|
167417
167367
|
}
|
167418
167368
|
}
|
167419
|
-
var
|
167369
|
+
var import_chalk64, import_fs7, import_path40;
|
167420
167370
|
var init_import_zonefile = __esm({
|
167421
167371
|
"src/util/dns/import-zonefile.ts"() {
|
167422
167372
|
"use strict";
|
167423
|
-
|
167373
|
+
import_chalk64 = __toESM3(require_source());
|
167424
167374
|
import_fs7 = require("fs");
|
167425
167375
|
import_path40 = require("path");
|
167426
167376
|
init_errors_ts();
|
@@ -167433,7 +167383,7 @@ async function add3(client2, opts, args2) {
|
|
167433
167383
|
const { contextName } = await getScope(client2);
|
167434
167384
|
if (args2.length !== 2) {
|
167435
167385
|
output2.error(
|
167436
|
-
`Invalid number of arguments. Usage: ${
|
167386
|
+
`Invalid number of arguments. Usage: ${import_chalk65.default.cyan(
|
167437
167387
|
`${getCommandName("dns import <domain> <zonefile>")}`
|
167438
167388
|
)}`
|
167439
167389
|
);
|
@@ -167449,32 +167399,32 @@ async function add3(client2, opts, args2) {
|
|
167449
167399
|
);
|
167450
167400
|
if (recordIds instanceof DomainNotFound) {
|
167451
167401
|
output2.error(
|
167452
|
-
`The domain ${domain} can't be found under ${
|
167402
|
+
`The domain ${domain} can't be found under ${import_chalk65.default.bold(
|
167453
167403
|
contextName
|
167454
|
-
)} ${
|
167404
|
+
)} ${import_chalk65.default.gray(addStamp())}`
|
167455
167405
|
);
|
167456
167406
|
return 1;
|
167457
167407
|
}
|
167458
167408
|
if (recordIds instanceof InvalidDomain) {
|
167459
167409
|
output2.error(
|
167460
|
-
`The domain ${domain} doesn't match with the one found in the Zone file ${
|
167410
|
+
`The domain ${domain} doesn't match with the one found in the Zone file ${import_chalk65.default.gray(
|
167461
167411
|
addStamp()
|
167462
167412
|
)}`
|
167463
167413
|
);
|
167464
167414
|
return 1;
|
167465
167415
|
}
|
167466
167416
|
console.log(
|
167467
|
-
`${
|
167417
|
+
`${import_chalk65.default.cyan("> Success!")} ${recordIds.length} DNS records for domain ${import_chalk65.default.bold(domain)} created under ${import_chalk65.default.bold(
|
167468
167418
|
contextName
|
167469
|
-
)} ${
|
167419
|
+
)} ${import_chalk65.default.gray(addStamp())}`
|
167470
167420
|
);
|
167471
167421
|
return 0;
|
167472
167422
|
}
|
167473
|
-
var
|
167423
|
+
var import_chalk65;
|
167474
167424
|
var init_import = __esm({
|
167475
167425
|
"src/commands/dns/import.ts"() {
|
167476
167426
|
"use strict";
|
167477
|
-
|
167427
|
+
import_chalk65 = __toESM3(require_source());
|
167478
167428
|
init_get_scope();
|
167479
167429
|
init_errors_ts();
|
167480
167430
|
init_stamp();
|
@@ -167499,7 +167449,7 @@ function formatTable(header, align, blocks, hsep = " ") {
|
|
167499
167449
|
out += `${block.name}
|
167500
167450
|
`;
|
167501
167451
|
}
|
167502
|
-
const rows = [header.map((s) =>
|
167452
|
+
const rows = [header.map((s) => import_chalk66.default.dim(s))].concat(block.rows);
|
167503
167453
|
if (rows.length > 0) {
|
167504
167454
|
rows[0][0] = ` ${rows[0][0]}`;
|
167505
167455
|
for (let i = 1; i < rows.length; i++) {
|
@@ -167519,11 +167469,11 @@ function formatTable(header, align, blocks, hsep = " ") {
|
|
167519
167469
|
}
|
167520
167470
|
return out.slice(0, -1);
|
167521
167471
|
}
|
167522
|
-
var
|
167472
|
+
var import_chalk66, import_text_table6;
|
167523
167473
|
var init_format_table = __esm({
|
167524
167474
|
"src/util/format-table.ts"() {
|
167525
167475
|
"use strict";
|
167526
|
-
|
167476
|
+
import_chalk66 = __toESM3(require_source());
|
167527
167477
|
import_text_table6 = __toESM3(require_text_table());
|
167528
167478
|
init_strlen();
|
167529
167479
|
}
|
@@ -167606,18 +167556,18 @@ function getAddDomainName(domainNames) {
|
|
167606
167556
|
];
|
167607
167557
|
}
|
167608
167558
|
async function getDomainNames(client2, contextName, next) {
|
167609
|
-
client2.output.spinner(`Fetching domains under ${
|
167559
|
+
client2.output.spinner(`Fetching domains under ${import_chalk67.default.bold(contextName)}`);
|
167610
167560
|
const { domains: domains2, pagination } = await getDomains(client2, next);
|
167611
167561
|
return { domainNames: domains2.map((domain) => domain.name), pagination };
|
167612
167562
|
}
|
167613
|
-
var
|
167563
|
+
var import_chalk67;
|
167614
167564
|
var init_get_dns_records = __esm({
|
167615
167565
|
"src/util/dns/get-dns-records.ts"() {
|
167616
167566
|
"use strict";
|
167617
167567
|
init_errors_ts();
|
167618
167568
|
init_get_domain_dns_records();
|
167619
167569
|
init_get_domains();
|
167620
|
-
|
167570
|
+
import_chalk67 = __toESM3(require_source());
|
167621
167571
|
}
|
167622
167572
|
});
|
167623
167573
|
|
@@ -167629,7 +167579,7 @@ async function ls3(client2, opts, args2) {
|
|
167629
167579
|
const lsStamp = stamp_default();
|
167630
167580
|
if (args2.length > 1) {
|
167631
167581
|
output2.error(
|
167632
|
-
`Invalid number of arguments. Usage: ${
|
167582
|
+
`Invalid number of arguments. Usage: ${import_chalk68.default.cyan(
|
167633
167583
|
`${getCommandName("dns ls [domain]")}`
|
167634
167584
|
)}`
|
167635
167585
|
);
|
@@ -167652,15 +167602,15 @@ async function ls3(client2, opts, args2) {
|
|
167652
167602
|
);
|
167653
167603
|
if (data instanceof DomainNotFound) {
|
167654
167604
|
output2.error(
|
167655
|
-
`The domain ${domainName} can't be found under ${
|
167605
|
+
`The domain ${domainName} can't be found under ${import_chalk68.default.bold(
|
167656
167606
|
contextName
|
167657
|
-
)} ${
|
167607
|
+
)} ${import_chalk68.default.gray(lsStamp())}`
|
167658
167608
|
);
|
167659
167609
|
return 1;
|
167660
167610
|
}
|
167661
167611
|
const { records, pagination: pagination2 } = data;
|
167662
167612
|
output2.log(
|
167663
|
-
`${records.length > 0 ? "Records" : "No records"} found under ${
|
167613
|
+
`${records.length > 0 ? "Records" : "No records"} found under ${import_chalk68.default.bold(contextName)} ${import_chalk68.default.gray(lsStamp())}`
|
167664
167614
|
);
|
167665
167615
|
client2.stdout.write(getDNSRecordsTable([{ domainName, records }]));
|
167666
167616
|
if (pagination2 && pagination2.count === 20) {
|
@@ -167681,9 +167631,9 @@ async function ls3(client2, opts, args2) {
|
|
167681
167631
|
);
|
167682
167632
|
const nRecords = dnsRecords.reduce((p, r) => r.records.length + p, 0);
|
167683
167633
|
output2.log(
|
167684
|
-
`${nRecords > 0 ? "Records" : "No records"} found under ${
|
167634
|
+
`${nRecords > 0 ? "Records" : "No records"} found under ${import_chalk68.default.bold(
|
167685
167635
|
contextName
|
167686
|
-
)} ${
|
167636
|
+
)} ${import_chalk68.default.gray(lsStamp())}`
|
167687
167637
|
);
|
167688
167638
|
output2.log(getDNSRecordsTable(dnsRecords));
|
167689
167639
|
if (pagination && pagination.count === 20) {
|
@@ -167701,7 +167651,7 @@ function getDNSRecordsTable(dnsRecords) {
|
|
167701
167651
|
["", "id", "name", "type", "value", "created"],
|
167702
167652
|
["l", "r", "l", "l", "l", "l"],
|
167703
167653
|
dnsRecords.map(({ domainName, records }) => ({
|
167704
|
-
name:
|
167654
|
+
name: import_chalk68.default.bold(domainName),
|
167705
167655
|
rows: records.map(getDNSRecordRow)
|
167706
167656
|
}))
|
167707
167657
|
);
|
@@ -167718,14 +167668,14 @@ function getDNSRecordRow(record) {
|
|
167718
167668
|
record.name,
|
167719
167669
|
record.type,
|
167720
167670
|
priority ? `${priority} ${record.value}` : record.value,
|
167721
|
-
|
167671
|
+
import_chalk68.default.gray(isSystemRecord ? "default" : createdAt)
|
167722
167672
|
];
|
167723
167673
|
}
|
167724
|
-
var
|
167674
|
+
var import_chalk68, import_ms12;
|
167725
167675
|
var init_ls3 = __esm({
|
167726
167676
|
"src/commands/dns/ls.ts"() {
|
167727
167677
|
"use strict";
|
167728
|
-
|
167678
|
+
import_chalk68 = __toESM3(require_source());
|
167729
167679
|
import_ms12 = __toESM3(require_ms2());
|
167730
167680
|
init_errors_ts();
|
167731
167681
|
init_format_table();
|
@@ -167771,7 +167721,7 @@ async function rm3(client2, _opts, args2) {
|
|
167771
167721
|
const [recordId] = args2;
|
167772
167722
|
if (args2.length !== 1) {
|
167773
167723
|
output2.error(
|
167774
|
-
`Invalid number of arguments. Usage: ${
|
167724
|
+
`Invalid number of arguments. Usage: ${import_chalk69.default.cyan(
|
167775
167725
|
`${getCommandName("dns rm <id>")}`
|
167776
167726
|
)}`
|
167777
167727
|
);
|
@@ -167796,9 +167746,9 @@ async function rm3(client2, _opts, args2) {
|
|
167796
167746
|
const rmStamp = stamp_default();
|
167797
167747
|
await deleteDNSRecordById(client2, domainName, record.id);
|
167798
167748
|
console.log(
|
167799
|
-
`${
|
167749
|
+
`${import_chalk69.default.cyan("> Success!")} Record ${import_chalk69.default.gray(
|
167800
167750
|
`${record.id}`
|
167801
|
-
)} removed ${
|
167751
|
+
)} removed ${import_chalk69.default.gray(rmStamp())}`
|
167802
167752
|
);
|
167803
167753
|
return 0;
|
167804
167754
|
}
|
@@ -167813,7 +167763,7 @@ function readConfirmation2(output2, msg, domainName, record) {
|
|
167813
167763
|
`
|
167814
167764
|
);
|
167815
167765
|
output2.print(
|
167816
|
-
`${
|
167766
|
+
`${import_chalk69.default.bold.red("> Are you sure?")} ${import_chalk69.default.gray("(y/N) ")}`
|
167817
167767
|
);
|
167818
167768
|
process.stdin.on("data", (d) => {
|
167819
167769
|
process.stdin.pause();
|
@@ -167825,19 +167775,19 @@ function getDeleteTableRow(domainName, record) {
|
|
167825
167775
|
const recordName = `${record.name.length > 0 ? `${record.name}.` : ""}${domainName}`;
|
167826
167776
|
return [
|
167827
167777
|
record.id,
|
167828
|
-
|
167778
|
+
import_chalk69.default.bold(
|
167829
167779
|
`${recordName} ${record.type} ${record.value} ${record.mxPriority || ""}`
|
167830
167780
|
),
|
167831
|
-
|
167781
|
+
import_chalk69.default.gray(
|
167832
167782
|
`${(0, import_ms13.default)(Date.now() - new Date(Number(record.createdAt)).getTime())} ago`
|
167833
167783
|
)
|
167834
167784
|
];
|
167835
167785
|
}
|
167836
|
-
var
|
167786
|
+
var import_chalk69, import_ms13, import_text_table7;
|
167837
167787
|
var init_rm3 = __esm({
|
167838
167788
|
"src/commands/dns/rm.ts"() {
|
167839
167789
|
"use strict";
|
167840
|
-
|
167790
|
+
import_chalk69 = __toESM3(require_source());
|
167841
167791
|
import_ms13 = __toESM3(require_ms2());
|
167842
167792
|
import_text_table7 = __toESM3(require_text_table());
|
167843
167793
|
init_delete_dns_record_by_id();
|
@@ -168068,16 +168018,16 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
168068
168018
|
const rows = [];
|
168069
168019
|
for (let i = 0; i < maxLength; i++) {
|
168070
168020
|
rows.push([
|
168071
|
-
sortedIntended[i] ||
|
168072
|
-
sortedCurrent[i] ||
|
168073
|
-
sortedIntended[i] === sortedCurrent[i] ?
|
168021
|
+
sortedIntended[i] || import_chalk70.default.gray("-"),
|
168022
|
+
sortedCurrent[i] || import_chalk70.default.gray("-"),
|
168023
|
+
sortedIntended[i] === sortedCurrent[i] ? import_chalk70.default.green(chars_default.tick) : import_chalk70.default.red(chars_default.cross)
|
168074
168024
|
]);
|
168075
168025
|
}
|
168076
168026
|
return (0, import_text_table8.default)(
|
168077
168027
|
[
|
168078
168028
|
[
|
168079
|
-
|
168080
|
-
|
168029
|
+
import_chalk70.default.gray("Intended Nameservers"),
|
168030
|
+
import_chalk70.default.gray("Current Nameservers"),
|
168081
168031
|
""
|
168082
168032
|
],
|
168083
168033
|
...rows
|
@@ -168089,11 +168039,11 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
168089
168039
|
}
|
168090
168040
|
).replace(/^(.*)/gm, `${extraSpace}$1`);
|
168091
168041
|
}
|
168092
|
-
var
|
168042
|
+
var import_chalk70, import_text_table8;
|
168093
168043
|
var init_format_ns_table = __esm({
|
168094
168044
|
"src/util/format-ns-table.ts"() {
|
168095
168045
|
"use strict";
|
168096
|
-
|
168046
|
+
import_chalk70 = __toESM3(require_source());
|
168097
168047
|
import_text_table8 = __toESM3(require_text_table());
|
168098
168048
|
init_strlen();
|
168099
168049
|
init_chars();
|
@@ -168103,7 +168053,7 @@ var init_format_ns_table = __esm({
|
|
168103
168053
|
// src/util/domains/get-domain.ts
|
168104
168054
|
async function getDomain(client2, contextName, domainName) {
|
168105
168055
|
client2.output.spinner(
|
168106
|
-
`Fetching domain ${domainName} under ${
|
168056
|
+
`Fetching domain ${domainName} under ${import_chalk71.default.bold(contextName)}`
|
168107
168057
|
);
|
168108
168058
|
try {
|
168109
168059
|
const { domain } = await client2.fetch(
|
@@ -168117,11 +168067,11 @@ async function getDomain(client2, contextName, domainName) {
|
|
168117
168067
|
throw err;
|
168118
168068
|
}
|
168119
168069
|
}
|
168120
|
-
var
|
168070
|
+
var import_chalk71;
|
168121
168071
|
var init_get_domain = __esm({
|
168122
168072
|
"src/util/domains/get-domain.ts"() {
|
168123
168073
|
"use strict";
|
168124
|
-
|
168074
|
+
import_chalk71 = __toESM3(require_source());
|
168125
168075
|
init_errors_ts();
|
168126
168076
|
}
|
168127
168077
|
});
|
@@ -168160,7 +168110,7 @@ var init_get_domain_config = __esm({
|
|
168160
168110
|
// src/util/projects/add-domain-to-project.ts
|
168161
168111
|
async function addDomainToProject(client2, projectNameOrId, domain) {
|
168162
168112
|
client2.output.spinner(
|
168163
|
-
`Adding domain ${domain} to project ${
|
168113
|
+
`Adding domain ${domain} to project ${import_chalk72.default.bold(projectNameOrId)}`
|
168164
168114
|
);
|
168165
168115
|
try {
|
168166
168116
|
const response = await client2.fetch(
|
@@ -168189,11 +168139,11 @@ async function addDomainToProject(client2, projectNameOrId, domain) {
|
|
168189
168139
|
throw err;
|
168190
168140
|
}
|
168191
168141
|
}
|
168192
|
-
var
|
168142
|
+
var import_chalk72;
|
168193
168143
|
var init_add_domain_to_project = __esm({
|
168194
168144
|
"src/util/projects/add-domain-to-project.ts"() {
|
168195
168145
|
"use strict";
|
168196
|
-
|
168146
|
+
import_chalk72 = __toESM3(require_source());
|
168197
168147
|
init_errors_ts();
|
168198
168148
|
}
|
168199
168149
|
});
|
@@ -168201,7 +168151,7 @@ var init_add_domain_to_project = __esm({
|
|
168201
168151
|
// src/util/projects/remove-domain-from-project.ts
|
168202
168152
|
async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
168203
168153
|
client2.output.spinner(
|
168204
|
-
`Removing domain ${domain} from project ${
|
168154
|
+
`Removing domain ${domain} from project ${import_chalk73.default.bold(projectNameOrId)}`
|
168205
168155
|
);
|
168206
168156
|
try {
|
168207
168157
|
const response = await client2.fetch(
|
@@ -168220,11 +168170,11 @@ async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
|
168220
168170
|
throw err;
|
168221
168171
|
}
|
168222
168172
|
}
|
168223
|
-
var
|
168173
|
+
var import_chalk73;
|
168224
168174
|
var init_remove_domain_from_project = __esm({
|
168225
168175
|
"src/util/projects/remove-domain-from-project.ts"() {
|
168226
168176
|
"use strict";
|
168227
|
-
|
168177
|
+
import_chalk73 = __toESM3(require_source());
|
168228
168178
|
init_errors_ts();
|
168229
168179
|
}
|
168230
168180
|
});
|
@@ -168278,9 +168228,9 @@ async function add4(client2, opts, args2) {
|
|
168278
168228
|
}
|
168279
168229
|
}
|
168280
168230
|
console.log(
|
168281
|
-
`${
|
168231
|
+
`${import_chalk74.default.cyan("> Success!")} Domain ${import_chalk74.default.bold(
|
168282
168232
|
domainName
|
168283
|
-
)} added to project ${
|
168233
|
+
)} added to project ${import_chalk74.default.bold(projectName)}. ${addStamp()}`
|
168284
168234
|
);
|
168285
168235
|
if (isPublicSuffix(domainName)) {
|
168286
168236
|
output2.log(
|
@@ -168299,11 +168249,11 @@ async function add4(client2, opts, args2) {
|
|
168299
168249
|
`This domain is not configured properly. To configure it you should either:`
|
168300
168250
|
);
|
168301
168251
|
output2.print(
|
168302
|
-
` ${
|
168252
|
+
` ${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]")}
|
168303
168253
|
`
|
168304
168254
|
);
|
168305
168255
|
output2.print(
|
168306
|
-
` ${
|
168256
|
+
` ${import_chalk74.default.grey("b)")} Change your Domains's nameservers to the intended set`
|
168307
168257
|
);
|
168308
168258
|
output2.print(
|
168309
168259
|
`
|
@@ -168327,11 +168277,11 @@ ${formatNSTable(
|
|
168327
168277
|
}
|
168328
168278
|
return 0;
|
168329
168279
|
}
|
168330
|
-
var
|
168280
|
+
var import_chalk74;
|
168331
168281
|
var init_add3 = __esm({
|
168332
168282
|
"src/commands/domains/add.ts"() {
|
168333
168283
|
"use strict";
|
168334
|
-
|
168284
|
+
import_chalk74 = __toESM3(require_source());
|
168335
168285
|
init_errors_ts();
|
168336
168286
|
init_format_ns_table();
|
168337
168287
|
init_get_scope();
|
@@ -168388,7 +168338,7 @@ async function buy(client2, opts, args2) {
|
|
168388
168338
|
}
|
168389
168339
|
if (!(await getDomainStatus(client2, domainName)).available) {
|
168390
168340
|
output2.error(
|
168391
|
-
`The domain ${param(domainName)} is ${
|
168341
|
+
`The domain ${param(domainName)} is ${import_chalk75.default.underline(
|
168392
168342
|
"unavailable"
|
168393
168343
|
)}! ${availableStamp()}`
|
168394
168344
|
);
|
@@ -168396,25 +168346,27 @@ async function buy(client2, opts, args2) {
|
|
168396
168346
|
}
|
168397
168347
|
const { period, price } = domainPrice;
|
168398
168348
|
output2.log(
|
168399
|
-
`The domain ${param(domainName)} is ${
|
168349
|
+
`The domain ${param(domainName)} is ${import_chalk75.default.underline(
|
168400
168350
|
"available"
|
168401
|
-
)} to buy under ${
|
168351
|
+
)} to buy under ${import_chalk75.default.bold(contextName)}! ${availableStamp()}`
|
168402
168352
|
);
|
168403
168353
|
let autoRenew;
|
168404
168354
|
if (skipConfirmation) {
|
168405
168355
|
autoRenew = true;
|
168406
168356
|
} else {
|
168407
|
-
if (!await
|
168408
|
-
|
168409
|
-
|
168357
|
+
if (!await confirm(
|
168358
|
+
client2,
|
168359
|
+
`Buy now for ${import_chalk75.default.bold(`$${price}`)} (${`${period}yr${period > 1 ? "s" : ""}`})?`,
|
168360
|
+
false
|
168410
168361
|
)) {
|
168411
168362
|
return 0;
|
168412
168363
|
}
|
168413
|
-
autoRenew = await
|
168414
|
-
|
168364
|
+
autoRenew = await confirm(
|
168365
|
+
client2,
|
168366
|
+
renewalPrice.period === 1 ? `Auto renew yearly for ${import_chalk75.default.bold(`$${price}`)}?` : `Auto renew every ${renewalPrice.period} years for ${import_chalk75.default.bold(
|
168415
168367
|
`$${price}`
|
168416
168368
|
)}?`,
|
168417
|
-
|
168369
|
+
true
|
168418
168370
|
);
|
168419
168371
|
}
|
168420
168372
|
let buyResult;
|
@@ -168466,7 +168418,7 @@ async function buy(client2, opts, args2) {
|
|
168466
168418
|
}
|
168467
168419
|
if (buyResult.pending) {
|
168468
168420
|
console.log(
|
168469
|
-
`${
|
168421
|
+
`${import_chalk75.default.cyan("> Success!")} Domain ${param(
|
168470
168422
|
domainName
|
168471
168423
|
)} order was submitted ${purchaseStamp()}`
|
168472
168424
|
);
|
@@ -168479,7 +168431,7 @@ async function buy(client2, opts, args2) {
|
|
168479
168431
|
);
|
168480
168432
|
} else {
|
168481
168433
|
console.log(
|
168482
|
-
`${
|
168434
|
+
`${import_chalk75.default.cyan("> Success!")} Domain ${param(
|
168483
168435
|
domainName
|
168484
168436
|
)} purchased ${purchaseStamp()}`
|
168485
168437
|
);
|
@@ -168501,18 +168453,18 @@ async function buy(client2, opts, args2) {
|
|
168501
168453
|
}
|
168502
168454
|
return 0;
|
168503
168455
|
}
|
168504
|
-
var
|
168456
|
+
var import_chalk75, import_psl6, import_error_utils21;
|
168505
168457
|
var init_buy = __esm({
|
168506
168458
|
"src/commands/domains/buy.ts"() {
|
168507
168459
|
"use strict";
|
168508
|
-
|
168460
|
+
import_chalk75 = __toESM3(require_source());
|
168509
168461
|
import_psl6 = __toESM3(require_psl());
|
168510
168462
|
init_errors_ts();
|
168511
168463
|
init_get_domain_price();
|
168512
168464
|
init_get_domain_status();
|
168513
168465
|
init_get_scope();
|
168514
168466
|
init_param();
|
168515
|
-
|
168467
|
+
init_confirm();
|
168516
168468
|
init_purchase_domain();
|
168517
168469
|
init_stamp();
|
168518
168470
|
init_pkg_name();
|
@@ -168641,14 +168593,15 @@ async function transferIn(client2, opts, args2) {
|
|
168641
168593
|
}
|
168642
168594
|
const { price } = domainPrice;
|
168643
168595
|
output2.log(
|
168644
|
-
`The domain ${param(domainName)} is ${
|
168596
|
+
`The domain ${param(domainName)} is ${import_chalk76.default.underline(
|
168645
168597
|
"available"
|
168646
|
-
)} to transfer under ${
|
168598
|
+
)} to transfer under ${import_chalk76.default.bold(contextName)}! ${availableStamp()}`
|
168647
168599
|
);
|
168648
168600
|
const authCode = await getAuthCode(opts["--code"]);
|
168649
|
-
const shouldTransfer = await
|
168650
|
-
|
168651
|
-
|
168601
|
+
const shouldTransfer = await confirm(
|
168602
|
+
client2,
|
168603
|
+
transferPolicy === "no-change" ? `Transfer now for ${import_chalk76.default.bold(`$${price}`)}?` : `Transfer now with 1yr renewal for ${import_chalk76.default.bold(`$${price}`)}?`,
|
168604
|
+
false
|
168652
168605
|
);
|
168653
168606
|
if (!shouldTransfer) {
|
168654
168607
|
return 0;
|
@@ -168688,7 +168641,7 @@ async function transferIn(client2, opts, args2) {
|
|
168688
168641
|
return 1;
|
168689
168642
|
}
|
168690
168643
|
console.log(
|
168691
|
-
`${
|
168644
|
+
`${import_chalk76.default.cyan("> Success!")} Domain ${param(
|
168692
168645
|
domainName
|
168693
168646
|
)} transfer started ${transferStamp()}`
|
168694
168647
|
);
|
@@ -168717,11 +168670,11 @@ async function transferIn(client2, opts, args2) {
|
|
168717
168670
|
);
|
168718
168671
|
return 0;
|
168719
168672
|
}
|
168720
|
-
var
|
168673
|
+
var import_chalk76;
|
168721
168674
|
var init_transfer_in = __esm({
|
168722
168675
|
"src/commands/domains/transfer-in.ts"() {
|
168723
168676
|
"use strict";
|
168724
|
-
|
168677
|
+
import_chalk76 = __toESM3(require_source());
|
168725
168678
|
init_errors_ts();
|
168726
168679
|
init_get_scope();
|
168727
168680
|
init_param();
|
@@ -168730,7 +168683,7 @@ var init_transfer_in = __esm({
|
|
168730
168683
|
init_get_auth_code();
|
168731
168684
|
init_get_domain_price();
|
168732
168685
|
init_check_transfer();
|
168733
|
-
|
168686
|
+
init_confirm();
|
168734
168687
|
init_is_root_domain();
|
168735
168688
|
init_pkg_name();
|
168736
168689
|
}
|
@@ -168802,7 +168755,7 @@ async function inspect(client2, opts, args2) {
|
|
168802
168755
|
}
|
168803
168756
|
if (args2.length !== 1) {
|
168804
168757
|
output2.error(
|
168805
|
-
`Invalid number of arguments. Usage: ${
|
168758
|
+
`Invalid number of arguments. Usage: ${import_chalk77.default.cyan(
|
168806
168759
|
`${getCommandName("domains inspect <domain>")}`
|
168807
168760
|
)}`
|
168808
168761
|
);
|
@@ -168810,7 +168763,7 @@ async function inspect(client2, opts, args2) {
|
|
168810
168763
|
}
|
168811
168764
|
output2.debug(`Fetching domain info`);
|
168812
168765
|
output2.spinner(
|
168813
|
-
`Fetching Domain ${domainName} under ${
|
168766
|
+
`Fetching Domain ${domainName} under ${import_chalk77.default.bold(contextName)}`
|
168814
168767
|
);
|
168815
168768
|
const information = await fetchInformation({
|
168816
168769
|
output: output2,
|
@@ -168823,38 +168776,38 @@ async function inspect(client2, opts, args2) {
|
|
168823
168776
|
}
|
168824
168777
|
const { domain, projects, renewalPrice, domainConfig } = information;
|
168825
168778
|
output2.log(
|
168826
|
-
`Domain ${domainName} found under ${
|
168779
|
+
`Domain ${domainName} found under ${import_chalk77.default.bold(contextName)} ${import_chalk77.default.gray(
|
168827
168780
|
inspectStamp()
|
168828
168781
|
)}`
|
168829
168782
|
);
|
168830
168783
|
output2.print("\n");
|
168831
|
-
output2.print(
|
168832
|
-
output2.print(` ${
|
168784
|
+
output2.print(import_chalk77.default.bold(" General\n\n"));
|
168785
|
+
output2.print(` ${import_chalk77.default.cyan("Name")} ${domain.name}
|
168833
168786
|
`);
|
168834
168787
|
output2.print(
|
168835
|
-
` ${
|
168788
|
+
` ${import_chalk77.default.cyan("Registrar")} ${getDomainRegistrar(domain)}
|
168836
168789
|
`
|
168837
168790
|
);
|
168838
168791
|
output2.print(
|
168839
|
-
` ${
|
168792
|
+
` ${import_chalk77.default.cyan("Expiration Date")} ${formatDate(domain.expiresAt)}
|
168840
168793
|
`
|
168841
168794
|
);
|
168842
168795
|
output2.print(
|
168843
|
-
` ${
|
168796
|
+
` ${import_chalk77.default.cyan("Creator")} ${domain.creator.username}
|
168844
168797
|
`
|
168845
168798
|
);
|
168846
168799
|
output2.print(
|
168847
|
-
` ${
|
168800
|
+
` ${import_chalk77.default.cyan("Created At")} ${formatDate(domain.createdAt)}
|
168848
168801
|
`
|
168849
168802
|
);
|
168850
|
-
output2.print(` ${
|
168803
|
+
output2.print(` ${import_chalk77.default.cyan("Edge Network")} yes
|
168851
168804
|
`);
|
168852
168805
|
output2.print(
|
168853
|
-
` ${
|
168806
|
+
` ${import_chalk77.default.cyan("Renewal Price")} ${domain.boughtAt && renewalPrice ? `$${renewalPrice} USD` : import_chalk77.default.gray("-")}
|
168854
168807
|
`
|
168855
168808
|
);
|
168856
168809
|
output2.print("\n");
|
168857
|
-
output2.print(
|
168810
|
+
output2.print(import_chalk77.default.bold(" Nameservers\n\n"));
|
168858
168811
|
output2.print(
|
168859
168812
|
`${formatNSTable(domain.intendedNameservers, domain.nameservers, {
|
168860
168813
|
extraSpace: " "
|
@@ -168863,7 +168816,7 @@ async function inspect(client2, opts, args2) {
|
|
168863
168816
|
);
|
168864
168817
|
output2.print("\n");
|
168865
168818
|
if (Array.isArray(projects) && projects.length > 0) {
|
168866
|
-
output2.print(
|
168819
|
+
output2.print(import_chalk77.default.bold(" Projects\n"));
|
168867
168820
|
const table14 = formatTable(
|
168868
168821
|
["Project", "Domains"],
|
168869
168822
|
["l", "l"],
|
@@ -168891,11 +168844,11 @@ async function inspect(client2, opts, args2) {
|
|
168891
168844
|
null
|
168892
168845
|
);
|
168893
168846
|
output2.print(
|
168894
|
-
` ${
|
168847
|
+
` ${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]")}
|
168895
168848
|
`
|
168896
168849
|
);
|
168897
168850
|
output2.print(
|
168898
|
-
` ${
|
168851
|
+
` ${import_chalk77.default.grey("b)")} Change your Domains's nameservers to the intended set detailed above.
|
168899
168852
|
|
168900
168853
|
`
|
168901
168854
|
);
|
@@ -168955,11 +168908,11 @@ async function fetchInformation({
|
|
168955
168908
|
domainConfig
|
168956
168909
|
};
|
168957
168910
|
}
|
168958
|
-
var
|
168911
|
+
var import_chalk77;
|
168959
168912
|
var init_inspect = __esm({
|
168960
168913
|
"src/commands/domains/inspect.ts"() {
|
168961
168914
|
"use strict";
|
168962
|
-
|
168915
|
+
import_chalk77 = __toESM3(require_source());
|
168963
168916
|
init_errors_ts();
|
168964
168917
|
init_stamp();
|
168965
168918
|
init_format_date();
|
@@ -168990,21 +168943,21 @@ async function ls4(client2, opts, args2) {
|
|
168990
168943
|
const lsStamp = stamp_default();
|
168991
168944
|
if (args2.length !== 0) {
|
168992
168945
|
output2.error(
|
168993
|
-
`Invalid number of arguments. Usage: ${
|
168946
|
+
`Invalid number of arguments. Usage: ${import_chalk78.default.cyan(
|
168994
168947
|
`${getCommandName("domains ls")}`
|
168995
168948
|
)}`
|
168996
168949
|
);
|
168997
168950
|
return 1;
|
168998
168951
|
}
|
168999
|
-
output2.spinner(`Fetching Domains under ${
|
168952
|
+
output2.spinner(`Fetching Domains under ${import_chalk78.default.bold(contextName)}`);
|
169000
168953
|
const { domains: domains2, pagination } = await getDomains(
|
169001
168954
|
client2,
|
169002
168955
|
...paginationOptions
|
169003
168956
|
);
|
169004
168957
|
output2.log(
|
169005
|
-
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${
|
168958
|
+
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${import_chalk78.default.bold(
|
169006
168959
|
contextName
|
169007
|
-
)} ${
|
168960
|
+
)} ${import_chalk78.default.gray(lsStamp())}`
|
169008
168961
|
);
|
169009
168962
|
if (domains2.length > 0) {
|
169010
168963
|
output2.print(
|
@@ -169033,7 +168986,7 @@ function formatDomainsTable(domains2) {
|
|
169033
168986
|
isDomainExternal(domain) ? "Third Party" : "Vercel",
|
169034
168987
|
expiration,
|
169035
168988
|
domain.creator.username,
|
169036
|
-
|
168989
|
+
import_chalk78.default.gray(age)
|
169037
168990
|
];
|
169038
168991
|
});
|
169039
168992
|
return formatTable(
|
@@ -169042,12 +168995,12 @@ function formatDomainsTable(domains2) {
|
|
169042
168995
|
[{ rows }]
|
169043
168996
|
);
|
169044
168997
|
}
|
169045
|
-
var import_ms14,
|
168998
|
+
var import_ms14, import_chalk78, import_pluralize8;
|
169046
168999
|
var init_ls4 = __esm({
|
169047
169000
|
"src/commands/domains/ls.ts"() {
|
169048
169001
|
"use strict";
|
169049
169002
|
import_ms14 = __toESM3(require_ms2());
|
169050
|
-
|
169003
|
+
import_chalk78 = __toESM3(require_source());
|
169051
169004
|
import_pluralize8 = __toESM3(require_pluralize());
|
169052
169005
|
init_get_domains();
|
169053
169006
|
init_get_scope();
|
@@ -169151,7 +169104,7 @@ async function rm4(client2, opts, args2) {
|
|
169151
169104
|
}
|
169152
169105
|
if (args2.length !== 1) {
|
169153
169106
|
output2.error(
|
169154
|
-
`Invalid number of arguments. Usage: ${
|
169107
|
+
`Invalid number of arguments. Usage: ${import_chalk79.default.cyan(
|
169155
169108
|
`${getCommandName("domains rm <domain>")}`
|
169156
169109
|
)}`
|
169157
169110
|
);
|
@@ -169160,14 +169113,14 @@ async function rm4(client2, opts, args2) {
|
|
169160
169113
|
const domain = await getDomainByName(client2, contextName, domainName);
|
169161
169114
|
if (domain instanceof DomainNotFound || domain.name !== domainName) {
|
169162
169115
|
output2.error(
|
169163
|
-
`Domain not found by "${domainName}" under ${
|
169116
|
+
`Domain not found by "${domainName}" under ${import_chalk79.default.bold(contextName)}`
|
169164
169117
|
);
|
169165
169118
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
169166
169119
|
return 1;
|
169167
169120
|
}
|
169168
169121
|
if (domain instanceof DomainPermissionDenied) {
|
169169
169122
|
output2.error(
|
169170
|
-
`You don't have access to the domain ${domainName} under ${
|
169123
|
+
`You don't have access to the domain ${domainName} under ${import_chalk79.default.bold(
|
169171
169124
|
contextName
|
169172
169125
|
)}`
|
169173
169126
|
);
|
@@ -169185,9 +169138,10 @@ async function rm4(client2, opts, args2) {
|
|
169185
169138
|
);
|
169186
169139
|
}
|
169187
169140
|
const skipConfirmation = opts["--yes"] || false;
|
169188
|
-
if (!skipConfirmation && !await
|
169141
|
+
if (!skipConfirmation && !await confirm(
|
169142
|
+
client2,
|
169189
169143
|
`Are you sure you want to remove ${param(domainName)}?`,
|
169190
|
-
|
169144
|
+
false
|
169191
169145
|
)) {
|
169192
169146
|
output2.log("Canceled");
|
169193
169147
|
return 0;
|
@@ -169227,15 +169181,15 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
169227
169181
|
domain.name
|
169228
169182
|
);
|
169229
169183
|
if (removeResult instanceof DomainNotFound) {
|
169230
|
-
output2.error(`Domain not found under ${
|
169184
|
+
output2.error(`Domain not found under ${import_chalk79.default.bold(contextName)}`);
|
169231
169185
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
169232
169186
|
return 1;
|
169233
169187
|
}
|
169234
169188
|
if (removeResult instanceof DomainPermissionDenied) {
|
169235
169189
|
output2.error(
|
169236
|
-
`You don't have permissions over domain ${
|
169190
|
+
`You don't have permissions over domain ${import_chalk79.default.underline(
|
169237
169191
|
removeResult.meta.domain
|
169238
|
-
)} under ${
|
169192
|
+
)} under ${import_chalk79.default.bold(removeResult.meta.context)}.`
|
169239
169193
|
);
|
169240
169194
|
return 1;
|
169241
169195
|
}
|
@@ -169277,24 +169231,28 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
169277
169231
|
);
|
169278
169232
|
if (aliases.length > 0) {
|
169279
169233
|
output2.warn(
|
169280
|
-
`This domain's ${
|
169234
|
+
`This domain's ${import_chalk79.default.bold(
|
169281
169235
|
(0, import_pluralize9.default)("alias", aliases.length, true)
|
169282
169236
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
169283
169237
|
);
|
169284
169238
|
}
|
169285
169239
|
if (certs.length > 0) {
|
169286
169240
|
output2.warn(
|
169287
|
-
`This domain's ${
|
169241
|
+
`This domain's ${import_chalk79.default.bold(
|
169288
169242
|
(0, import_pluralize9.default)("certificate", certs.length, true)
|
169289
169243
|
)} will be removed. Run ${getCommandName(`cert ls`)} to list them.`
|
169290
169244
|
);
|
169291
169245
|
}
|
169292
169246
|
if (suffix2) {
|
169293
169247
|
output2.warn(
|
169294
|
-
`The ${
|
169248
|
+
`The ${import_chalk79.default.bold(`custom suffix`)} associated with this domain.`
|
169295
169249
|
);
|
169296
169250
|
}
|
169297
|
-
if (!skipConfirmation && !await
|
169251
|
+
if (!skipConfirmation && !await confirm(
|
169252
|
+
client2,
|
169253
|
+
`Remove conflicts associated with domain?`,
|
169254
|
+
false
|
169255
|
+
)) {
|
169298
169256
|
output2.log("Canceled");
|
169299
169257
|
return 0;
|
169300
169258
|
}
|
@@ -169310,14 +169268,14 @@ async function removeDomain(output2, client2, contextName, skipConfirmation, dom
|
|
169310
169268
|
attempt + 1
|
169311
169269
|
);
|
169312
169270
|
}
|
169313
|
-
output2.success(`Domain ${
|
169271
|
+
output2.success(`Domain ${import_chalk79.default.bold(domain.name)} removed ${removeStamp()}`);
|
169314
169272
|
return 0;
|
169315
169273
|
}
|
169316
|
-
var
|
169274
|
+
var import_chalk79, import_pluralize9;
|
169317
169275
|
var init_rm4 = __esm({
|
169318
169276
|
"src/commands/domains/rm.ts"() {
|
169319
169277
|
"use strict";
|
169320
|
-
|
169278
|
+
import_chalk79 = __toESM3(require_source());
|
169321
169279
|
import_pluralize9 = __toESM3(require_pluralize());
|
169322
169280
|
init_errors_ts();
|
169323
169281
|
init_delete_cert_by_id();
|
@@ -169328,7 +169286,7 @@ var init_rm4 = __esm({
|
|
169328
169286
|
init_stamp();
|
169329
169287
|
init_errors_ts();
|
169330
169288
|
init_param();
|
169331
|
-
|
169289
|
+
init_confirm();
|
169332
169290
|
init_set_custom_suffix();
|
169333
169291
|
init_find_projects_for_domain();
|
169334
169292
|
init_pkg_name();
|
@@ -169403,15 +169361,15 @@ async function move2(client2, opts, args2) {
|
|
169403
169361
|
}
|
169404
169362
|
const domain = await getDomainByName(client2, contextName, domainName);
|
169405
169363
|
if (domain instanceof DomainNotFound) {
|
169406
|
-
output2.error(`Domain not found under ${
|
169364
|
+
output2.error(`Domain not found under ${import_chalk80.default.bold(contextName)}`);
|
169407
169365
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
169408
169366
|
return 1;
|
169409
169367
|
}
|
169410
169368
|
if (domain instanceof DomainPermissionDenied) {
|
169411
169369
|
output2.error(
|
169412
|
-
`You don't have permissions over domain ${
|
169370
|
+
`You don't have permissions over domain ${import_chalk80.default.underline(
|
169413
169371
|
domain.meta.domain
|
169414
|
-
)} under ${
|
169372
|
+
)} under ${import_chalk80.default.bold(domain.meta.context)}.`
|
169415
169373
|
);
|
169416
169374
|
return 1;
|
169417
169375
|
}
|
@@ -169427,11 +169385,12 @@ async function move2(client2, opts, args2) {
|
|
169427
169385
|
destination
|
169428
169386
|
)} will have 24 hours to accept your move request before it expires.`
|
169429
169387
|
);
|
169430
|
-
if (!await
|
169388
|
+
if (!await confirm(
|
169389
|
+
client2,
|
169431
169390
|
`Are you sure you want to move ${param(domainName)} to ${param(
|
169432
169391
|
destination
|
169433
169392
|
)}?`,
|
169434
|
-
|
169393
|
+
false
|
169435
169394
|
)) {
|
169436
169395
|
output2.log("Canceled");
|
169437
169396
|
return 0;
|
@@ -169441,13 +169400,14 @@ async function move2(client2, opts, args2) {
|
|
169441
169400
|
const aliases = await getDomainAliases(client2, domainName);
|
169442
169401
|
if (aliases.length > 0) {
|
169443
169402
|
output2.warn(
|
169444
|
-
`This domain's ${
|
169403
|
+
`This domain's ${import_chalk80.default.bold(
|
169445
169404
|
(0, import_pluralize10.default)("alias", aliases.length, true)
|
169446
169405
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
169447
169406
|
);
|
169448
|
-
if (!await
|
169407
|
+
if (!await confirm(
|
169408
|
+
client2,
|
169449
169409
|
`Are you sure you want to move ${param(domainName)}?`,
|
169450
|
-
|
169410
|
+
false
|
169451
169411
|
)) {
|
169452
169412
|
output2.log("Canceled");
|
169453
169413
|
return 0;
|
@@ -169482,21 +169442,21 @@ async function move2(client2, opts, args2) {
|
|
169482
169442
|
return 1;
|
169483
169443
|
}
|
169484
169444
|
if (moveTokenResult instanceof DomainNotFound) {
|
169485
|
-
output2.error(`Domain not found under ${
|
169445
|
+
output2.error(`Domain not found under ${import_chalk80.default.bold(contextName)}`);
|
169486
169446
|
output2.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
169487
169447
|
return 1;
|
169488
169448
|
}
|
169489
169449
|
if (moveTokenResult instanceof DomainPermissionDenied) {
|
169490
169450
|
output2.error(
|
169491
|
-
`You don't have permissions over domain ${
|
169451
|
+
`You don't have permissions over domain ${import_chalk80.default.underline(
|
169492
169452
|
moveTokenResult.meta.domain
|
169493
|
-
)} under ${
|
169453
|
+
)} under ${import_chalk80.default.bold(moveTokenResult.meta.context)}.`
|
169494
169454
|
);
|
169495
169455
|
return 1;
|
169496
169456
|
}
|
169497
169457
|
if (moveTokenResult instanceof InvalidMoveDestination) {
|
169498
169458
|
output2.error(
|
169499
|
-
`Destination ${
|
169459
|
+
`Destination ${import_chalk80.default.bold(
|
169500
169460
|
destination
|
169501
169461
|
)} is invalid. Please supply a valid username, email, team slug, user id, or team id.`
|
169502
169462
|
);
|
@@ -169541,11 +169501,11 @@ async function findDestinationMatch(destination, user, teams) {
|
|
169541
169501
|
}
|
169542
169502
|
return null;
|
169543
169503
|
}
|
169544
|
-
var
|
169504
|
+
var import_chalk80, import_pluralize10;
|
169545
169505
|
var init_move = __esm({
|
169546
169506
|
"src/commands/domains/move.ts"() {
|
169547
169507
|
"use strict";
|
169548
|
-
|
169508
|
+
import_chalk80 = __toESM3(require_source());
|
169549
169509
|
import_pluralize10 = __toESM3(require_pluralize());
|
169550
169510
|
init_errors_ts();
|
169551
169511
|
init_get_scope();
|
@@ -169555,7 +169515,7 @@ var init_move = __esm({
|
|
169555
169515
|
init_param();
|
169556
169516
|
init_get_domain_aliases();
|
169557
169517
|
init_get_domain_by_name();
|
169558
|
-
|
169518
|
+
init_confirm();
|
169559
169519
|
init_get_teams();
|
169560
169520
|
init_pkg_name();
|
169561
169521
|
}
|
@@ -169900,13 +169860,11 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169900
169860
|
}
|
169901
169861
|
envTargets.push(envTargetArg);
|
169902
169862
|
}
|
169903
|
-
|
169863
|
+
if (!envName) {
|
169904
169864
|
envName = await client2.input.text({
|
169905
|
-
message: `What\u2019s the name of the variable
|
169865
|
+
message: `What\u2019s the name of the variable?`,
|
169866
|
+
validate: (val) => val ? true : "Name cannot be empty"
|
169906
169867
|
});
|
169907
|
-
if (!envName) {
|
169908
|
-
output2.error("Name cannot be empty");
|
169909
|
-
}
|
169910
169868
|
}
|
169911
169869
|
const { envs } = await getEnvRecords(
|
169912
169870
|
output2,
|
@@ -169932,10 +169890,9 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169932
169890
|
if (stdInput) {
|
169933
169891
|
envValue = stdInput;
|
169934
169892
|
} else {
|
169935
|
-
|
169893
|
+
envValue = await client2.input.text({
|
169936
169894
|
message: `What\u2019s the value of ${envName}?`
|
169937
169895
|
});
|
169938
|
-
envValue = inputValue || "";
|
169939
169896
|
}
|
169940
169897
|
while (envTargets.length === 0) {
|
169941
169898
|
envTargets = await client2.input.checkbox({
|
@@ -169947,10 +169904,9 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169947
169904
|
}
|
169948
169905
|
}
|
169949
169906
|
if (!stdInput && !envGitBranch && envTargets.length === 1 && envTargets[0] === "preview") {
|
169950
|
-
|
169907
|
+
envGitBranch = await client2.input.text({
|
169951
169908
|
message: `Add ${envName} to which Git branch? (leave empty for all Preview branches)?`
|
169952
169909
|
});
|
169953
|
-
envGitBranch = inputValue || "";
|
169954
169910
|
}
|
169955
169911
|
const type = opts["--sensitive"] ? "sensitive" : "encrypted";
|
169956
169912
|
const addStamp = stamp_default();
|
@@ -169975,20 +169931,20 @@ async function add5(client2, project, opts, args2, output2) {
|
|
169975
169931
|
}
|
169976
169932
|
output2.print(
|
169977
169933
|
`${prependEmoji(
|
169978
|
-
`Added Environment Variable ${
|
169934
|
+
`Added Environment Variable ${import_chalk81.default.bold(
|
169979
169935
|
envName
|
169980
|
-
)} to Project ${
|
169936
|
+
)} to Project ${import_chalk81.default.bold(project.name)} ${import_chalk81.default.gray(addStamp())}`,
|
169981
169937
|
emoji("success")
|
169982
169938
|
)}
|
169983
169939
|
`
|
169984
169940
|
);
|
169985
169941
|
return 0;
|
169986
169942
|
}
|
169987
|
-
var
|
169943
|
+
var import_chalk81;
|
169988
169944
|
var init_add4 = __esm({
|
169989
169945
|
"src/commands/env/add.ts"() {
|
169990
169946
|
"use strict";
|
169991
|
-
|
169947
|
+
import_chalk81 = __toESM3(require_source());
|
169992
169948
|
init_stamp();
|
169993
169949
|
init_add_env_record();
|
169994
169950
|
init_get_env_records();
|
@@ -170057,15 +170013,15 @@ async function ls5(client2, project, opts, args2, output2) {
|
|
170057
170013
|
);
|
170058
170014
|
if (envs.length === 0) {
|
170059
170015
|
output2.log(
|
170060
|
-
`No Environment Variables found in Project ${
|
170016
|
+
`No Environment Variables found in Project ${import_chalk82.default.bold(
|
170061
170017
|
project.name
|
170062
|
-
)} ${
|
170018
|
+
)} ${import_chalk82.default.gray(lsStamp())}`
|
170063
170019
|
);
|
170064
170020
|
} else {
|
170065
170021
|
output2.log(
|
170066
|
-
`Environment Variables found in Project ${
|
170022
|
+
`Environment Variables found in Project ${import_chalk82.default.bold(
|
170067
170023
|
project.name
|
170068
|
-
)} ${
|
170024
|
+
)} ${import_chalk82.default.gray(lsStamp())}`
|
170069
170025
|
);
|
170070
170026
|
console.log(getTable(envs));
|
170071
170027
|
}
|
@@ -170088,25 +170044,25 @@ function getRow(env) {
|
|
170088
170044
|
let value;
|
170089
170045
|
if (env.type === "plain") {
|
170090
170046
|
const singleLineValue = env.value.replace(/\s/g, " ");
|
170091
|
-
value =
|
170047
|
+
value = import_chalk82.default.gray(ellipsis(singleLineValue, 19));
|
170092
170048
|
} else if (env.type === "system") {
|
170093
|
-
value =
|
170049
|
+
value = import_chalk82.default.gray.italic(env.value);
|
170094
170050
|
} else {
|
170095
|
-
value =
|
170051
|
+
value = import_chalk82.default.gray.italic("Encrypted");
|
170096
170052
|
}
|
170097
170053
|
const now = Date.now();
|
170098
170054
|
return [
|
170099
|
-
|
170055
|
+
import_chalk82.default.bold(env.key),
|
170100
170056
|
value,
|
170101
170057
|
formatEnvTarget(env),
|
170102
170058
|
env.createdAt ? `${(0, import_ms15.default)(now - env.createdAt)} ago` : ""
|
170103
170059
|
];
|
170104
170060
|
}
|
170105
|
-
var
|
170061
|
+
var import_chalk82, import_ms15;
|
170106
170062
|
var init_ls5 = __esm({
|
170107
170063
|
"src/commands/env/ls.ts"() {
|
170108
170064
|
"use strict";
|
170109
|
-
|
170065
|
+
import_chalk82 = __toESM3(require_source());
|
170110
170066
|
import_ms15 = __toESM3(require_ms2());
|
170111
170067
|
init_format_table();
|
170112
170068
|
init_get_env_records();
|
@@ -170144,15 +170100,11 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
170144
170100
|
return 1;
|
170145
170101
|
}
|
170146
170102
|
let [envName, envTarget, envGitBranch] = args2;
|
170147
|
-
|
170148
|
-
|
170149
|
-
message: `What\u2019s the name of the variable
|
170103
|
+
if (!envName) {
|
170104
|
+
envName = await client2.input.text({
|
170105
|
+
message: `What\u2019s the name of the variable?`,
|
170106
|
+
validate: (val) => val ? true : "Name cannot be empty"
|
170150
170107
|
});
|
170151
|
-
if (!inputName) {
|
170152
|
-
output2.error(`Name cannot be empty`);
|
170153
|
-
continue;
|
170154
|
-
}
|
170155
|
-
envName = inputName;
|
170156
170108
|
}
|
170157
170109
|
if (!isValidEnvTarget(envTarget)) {
|
170158
170110
|
output2.error(
|
@@ -170194,7 +170146,7 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
170194
170146
|
client2,
|
170195
170147
|
`Removing Environment Variable ${param(env.key)} from ${formatEnvTarget(
|
170196
170148
|
env
|
170197
|
-
)} in Project ${
|
170149
|
+
)} in Project ${import_chalk83.default.bold(project.name)}. Are you sure?`,
|
170198
170150
|
false
|
170199
170151
|
)) {
|
170200
170152
|
output2.log("Canceled");
|
@@ -170213,18 +170165,18 @@ async function rm5(client2, project, opts, args2, output2) {
|
|
170213
170165
|
}
|
170214
170166
|
output2.print(
|
170215
170167
|
`${prependEmoji(
|
170216
|
-
`Removed Environment Variable ${
|
170168
|
+
`Removed Environment Variable ${import_chalk83.default.gray(rmStamp())}`,
|
170217
170169
|
emoji("success")
|
170218
170170
|
)}
|
170219
170171
|
`
|
170220
170172
|
);
|
170221
170173
|
return 0;
|
170222
170174
|
}
|
170223
|
-
var
|
170175
|
+
var import_chalk83;
|
170224
170176
|
var init_rm5 = __esm({
|
170225
170177
|
"src/commands/env/rm.ts"() {
|
170226
170178
|
"use strict";
|
170227
|
-
|
170179
|
+
import_chalk83 = __toESM3(require_source());
|
170228
170180
|
init_confirm();
|
170229
170181
|
init_remove_env_record();
|
170230
170182
|
init_get_env_records();
|
@@ -170440,7 +170392,7 @@ async function main6(client2) {
|
|
170440
170392
|
const target = argv2["--environment"]?.toLowerCase() || "development";
|
170441
170393
|
if (!isValidEnvTarget(target)) {
|
170442
170394
|
output2.error(
|
170443
|
-
`Invalid environment \`${
|
170395
|
+
`Invalid environment \`${import_chalk84.default.cyan(
|
170444
170396
|
target
|
170445
170397
|
)}\`. Valid options: ${getEnvTargetPlaceholder()}`
|
170446
170398
|
);
|
@@ -170487,11 +170439,11 @@ async function main6(client2) {
|
|
170487
170439
|
}
|
170488
170440
|
}
|
170489
170441
|
}
|
170490
|
-
var
|
170442
|
+
var import_chalk84, COMMAND_CONFIG6;
|
170491
170443
|
var init_env = __esm({
|
170492
170444
|
"src/commands/env/index.ts"() {
|
170493
170445
|
"use strict";
|
170494
|
-
|
170446
|
+
import_chalk84 = __toESM3(require_source());
|
170495
170447
|
init_env_target();
|
170496
170448
|
init_get_args();
|
170497
170449
|
init_get_invalid_subcommand();
|
@@ -170521,7 +170473,7 @@ async function connect(client2, argv2, args2, project, org) {
|
|
170521
170473
|
const repoArg = argv2._[1];
|
170522
170474
|
if (args2.length > 1) {
|
170523
170475
|
output2.error(
|
170524
|
-
`Invalid number of arguments. Usage: ${
|
170476
|
+
`Invalid number of arguments. Usage: ${import_chalk85.default.cyan(
|
170525
170477
|
`${getCommandName("project connect")}`
|
170526
170478
|
)}`
|
170527
170479
|
);
|
@@ -170567,7 +170519,7 @@ async function connect(client2, argv2, args2, project, org) {
|
|
170567
170519
|
}
|
170568
170520
|
if (!gitConfig) {
|
170569
170521
|
output2.error(
|
170570
|
-
`No local Git repository found. Run ${
|
170522
|
+
`No local Git repository found. Run ${import_chalk85.default.cyan(
|
170571
170523
|
"`git clone <url>`"
|
170572
170524
|
)} to clone a remote Git repository first.`
|
170573
170525
|
);
|
@@ -170576,7 +170528,7 @@ async function connect(client2, argv2, args2, project, org) {
|
|
170576
170528
|
const remoteUrls = pluckRemoteUrls(gitConfig);
|
170577
170529
|
if (!remoteUrls) {
|
170578
170530
|
output2.error(
|
170579
|
-
`No remote URLs found in your Git config. Make sure you've configured a remote repo in your local Git config. Run ${
|
170531
|
+
`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(
|
170580
170532
|
"`git remote --help`"
|
170581
170533
|
)} for more details.`
|
170582
170534
|
);
|
@@ -170620,7 +170572,7 @@ async function connect(client2, argv2, args2, project, org) {
|
|
170620
170572
|
return checkAndConnect;
|
170621
170573
|
}
|
170622
170574
|
output2.log(
|
170623
|
-
`Connected ${formatProvider(provider)} repository ${
|
170575
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(repoPath)}!`
|
170624
170576
|
);
|
170625
170577
|
return 0;
|
170626
170578
|
}
|
@@ -170657,7 +170609,7 @@ async function connectArg({
|
|
170657
170609
|
return connect2;
|
170658
170610
|
}
|
170659
170611
|
client2.output.log(
|
170660
|
-
`Connected ${formatProvider(provider)} repository ${
|
170612
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(repoPath)}!`
|
170661
170613
|
);
|
170662
170614
|
return 0;
|
170663
170615
|
}
|
@@ -170699,7 +170651,7 @@ async function connectArgWithLocalGit({
|
|
170699
170651
|
return connect2;
|
170700
170652
|
}
|
170701
170653
|
client2.output.log(
|
170702
|
-
`Connected ${formatProvider(provider)} repository ${
|
170654
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk85.default.cyan(
|
170703
170655
|
repoPath
|
170704
170656
|
)}!`
|
170705
170657
|
);
|
@@ -170732,7 +170684,7 @@ async function promptConnectArg({
|
|
170732
170684
|
return true;
|
170733
170685
|
}
|
170734
170686
|
client2.output.log(
|
170735
|
-
`Found a repository in your local Git Config: ${
|
170687
|
+
`Found a repository in your local Git Config: ${import_chalk85.default.cyan(
|
170736
170688
|
Object.values(remoteUrls)[0]
|
170737
170689
|
)}`
|
170738
170690
|
);
|
@@ -170781,7 +170733,7 @@ async function checkExistsAndConnect({
|
|
170781
170733
|
const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
|
170782
170734
|
if (isSameRepo) {
|
170783
170735
|
client2.output.log(
|
170784
|
-
`${
|
170736
|
+
`${import_chalk85.default.cyan(connectedRepoPath)} is already connected to your project.`
|
170785
170737
|
);
|
170786
170738
|
return 1;
|
170787
170739
|
}
|
@@ -170814,7 +170766,7 @@ async function confirmRepoConnect(client2, yes, connectedProvider, connectedRepo
|
|
170814
170766
|
client2,
|
170815
170767
|
`Looks like you already have a ${formatProvider(
|
170816
170768
|
connectedProvider
|
170817
|
-
)} repository connected: ${
|
170769
|
+
)} repository connected: ${import_chalk85.default.cyan(
|
170818
170770
|
connectedRepoPath
|
170819
170771
|
)}. Do you want to replace it?`,
|
170820
170772
|
true
|
@@ -170829,7 +170781,7 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
170829
170781
|
let choices = [];
|
170830
170782
|
for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
|
170831
170783
|
choices.push({
|
170832
|
-
name: `${urlValue} ${
|
170784
|
+
name: `${urlValue} ${import_chalk85.default.gray(`(${urlKey})`)}`,
|
170833
170785
|
value: urlValue,
|
170834
170786
|
short: urlKey
|
170835
170787
|
});
|
@@ -170839,11 +170791,11 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
170839
170791
|
choices
|
170840
170792
|
});
|
170841
170793
|
}
|
170842
|
-
var
|
170794
|
+
var import_chalk85, import_path41;
|
170843
170795
|
var init_connect = __esm({
|
170844
170796
|
"src/commands/git/connect.ts"() {
|
170845
170797
|
"use strict";
|
170846
|
-
|
170798
|
+
import_chalk85 = __toESM3(require_source());
|
170847
170799
|
import_path41 = require("path");
|
170848
170800
|
init_create_git_meta();
|
170849
170801
|
init_confirm();
|
@@ -170859,7 +170811,7 @@ async function disconnect(client2, args2, project, org) {
|
|
170859
170811
|
const { output: output2 } = client2;
|
170860
170812
|
if (args2.length !== 0) {
|
170861
170813
|
output2.error(
|
170862
|
-
`Invalid number of arguments. Usage: ${
|
170814
|
+
`Invalid number of arguments. Usage: ${import_chalk86.default.cyan(
|
170863
170815
|
`${getCommandName("project disconnect")}`
|
170864
170816
|
)}`
|
170865
170817
|
);
|
@@ -170877,14 +170829,14 @@ async function disconnect(client2, args2, project, org) {
|
|
170877
170829
|
);
|
170878
170830
|
const confirmDisconnect = await confirm(
|
170879
170831
|
client2,
|
170880
|
-
`Are you sure you want to disconnect ${
|
170832
|
+
`Are you sure you want to disconnect ${import_chalk86.default.cyan(
|
170881
170833
|
`${linkOrg}/${repo}`
|
170882
170834
|
)} from your project?`,
|
170883
170835
|
false
|
170884
170836
|
);
|
170885
170837
|
if (confirmDisconnect) {
|
170886
170838
|
await disconnectGitProvider(client2, org, project.id);
|
170887
|
-
output2.log(`Disconnected ${
|
170839
|
+
output2.log(`Disconnected ${import_chalk86.default.cyan(`${linkOrg}/${repo}`)}.`);
|
170888
170840
|
} else {
|
170889
170841
|
output2.log("Canceled");
|
170890
170842
|
}
|
@@ -170898,11 +170850,11 @@ async function disconnect(client2, args2, project, org) {
|
|
170898
170850
|
}
|
170899
170851
|
return 0;
|
170900
170852
|
}
|
170901
|
-
var
|
170853
|
+
var import_chalk86;
|
170902
170854
|
var init_disconnect = __esm({
|
170903
170855
|
"src/commands/git/disconnect.ts"() {
|
170904
170856
|
"use strict";
|
170905
|
-
|
170857
|
+
import_chalk86 = __toESM3(require_source());
|
170906
170858
|
init_confirm();
|
170907
170859
|
init_pkg_name();
|
170908
170860
|
init_connect_git_provider();
|
@@ -171030,11 +170982,11 @@ var init_git = __esm({
|
|
171030
170982
|
});
|
171031
170983
|
|
171032
170984
|
// src/util/output/list-item.ts
|
171033
|
-
var
|
170985
|
+
var import_chalk87, listItem, list_item_default;
|
171034
170986
|
var init_list_item = __esm({
|
171035
170987
|
"src/util/output/list-item.ts"() {
|
171036
170988
|
"use strict";
|
171037
|
-
|
170989
|
+
import_chalk87 = __toESM3(require_source());
|
171038
170990
|
listItem = (msg, n) => {
|
171039
170991
|
if (!n) {
|
171040
170992
|
n = "-";
|
@@ -171042,7 +170994,7 @@ var init_list_item = __esm({
|
|
171042
170994
|
if (Number(n)) {
|
171043
170995
|
n += ".";
|
171044
170996
|
}
|
171045
|
-
return `${(0,
|
170997
|
+
return `${(0, import_chalk87.default)(n.toString())} ${msg}`;
|
171046
170998
|
};
|
171047
170999
|
list_item_default = listItem;
|
171048
171000
|
}
|
@@ -171170,6 +171122,10 @@ async function init(client2, opts, args2) {
|
|
171170
171122
|
}
|
171171
171123
|
const exampleList = examples.filter((x) => x.visible).map((x) => x.name);
|
171172
171124
|
if (!name) {
|
171125
|
+
if (client2.stdin.isTTY !== true) {
|
171126
|
+
client2.output.print(`No framework provided`);
|
171127
|
+
return 0;
|
171128
|
+
}
|
171173
171129
|
const chosen = await chooseFromDropdown(
|
171174
171130
|
client2,
|
171175
171131
|
"Select example:",
|
@@ -171215,7 +171171,7 @@ async function chooseFromDropdown(client2, message2, exampleList) {
|
|
171215
171171
|
}
|
171216
171172
|
async function extractExample(client2, name, dir, force, ver = "v2") {
|
171217
171173
|
const { output: output2 } = client2;
|
171218
|
-
const folder = prepareFolder(
|
171174
|
+
const folder = prepareFolder(client2.cwd, dir || name, force);
|
171219
171175
|
output2.spinner(`Fetching ${name}`);
|
171220
171176
|
const url3 = `${EXAMPLE_API}/${ver}/download/${name}.tar.gz`;
|
171221
171177
|
return client2.fetch(url3, { json: false }).then(async (res) => {
|
@@ -171230,10 +171186,10 @@ async function extractExample(client2, name, dir, force, ver = "v2") {
|
|
171230
171186
|
extractor.on("finish", resolve12);
|
171231
171187
|
res.body.pipe(extractor);
|
171232
171188
|
});
|
171233
|
-
const successLog = `Initialized "${
|
171189
|
+
const successLog = `Initialized "${import_chalk88.default.bold(
|
171234
171190
|
name
|
171235
|
-
)}" example in ${
|
171236
|
-
const folderRel = import_path42.default.relative(
|
171191
|
+
)}" example in ${import_chalk88.default.bold(humanizePath(folder))}.`;
|
171192
|
+
const folderRel = import_path42.default.relative(client2.cwd, folder);
|
171237
171193
|
const deployHint = folderRel === "" ? list_item_default(`To deploy, run ${getCommandName()}.`) : list_item_default(
|
171238
171194
|
`To deploy, ${cmd(
|
171239
171195
|
`cd ${folderRel}`
|
@@ -171252,14 +171208,14 @@ function prepareFolder(cwd2, folder, force) {
|
|
171252
171208
|
if (import_fs8.default.existsSync(dest)) {
|
171253
171209
|
if (!import_fs8.default.lstatSync(dest).isDirectory()) {
|
171254
171210
|
throw new Error(
|
171255
|
-
`Destination path "${
|
171211
|
+
`Destination path "${import_chalk88.default.bold(
|
171256
171212
|
folder
|
171257
171213
|
)}" already exists and is not a directory.`
|
171258
171214
|
);
|
171259
171215
|
}
|
171260
171216
|
if (!force && import_fs8.default.readdirSync(dest).length !== 0) {
|
171261
171217
|
throw new Error(
|
171262
|
-
`Destination path "${
|
171218
|
+
`Destination path "${import_chalk88.default.bold(
|
171263
171219
|
folder
|
171264
171220
|
)}" already exists and is not an empty directory. You may use ${cmd(
|
171265
171221
|
"--force"
|
@@ -171270,40 +171226,40 @@ function prepareFolder(cwd2, folder, force) {
|
|
171270
171226
|
try {
|
171271
171227
|
import_fs8.default.mkdirSync(dest);
|
171272
171228
|
} catch (e2) {
|
171273
|
-
throw new Error(`Could not create directory "${
|
171229
|
+
throw new Error(`Could not create directory "${import_chalk88.default.bold(folder)}".`);
|
171274
171230
|
}
|
171275
171231
|
}
|
171276
171232
|
return dest;
|
171277
171233
|
}
|
171278
171234
|
async function guess(client2, exampleList, name) {
|
171279
171235
|
const GuessError = new Error(
|
171280
|
-
`No example found for ${
|
171236
|
+
`No example found for ${import_chalk88.default.bold(name)}, run ${getCommandName(
|
171281
171237
|
`init`
|
171282
171238
|
)} to see the list of available examples.`
|
171283
171239
|
);
|
171284
|
-
if (
|
171240
|
+
if (client2.stdin.isTTY !== true) {
|
171285
171241
|
throw GuessError;
|
171286
171242
|
}
|
171287
171243
|
const found = did_you_mean_default(name, exampleList, 0.7);
|
171288
171244
|
if (typeof found === "string") {
|
171289
|
-
if (await
|
171245
|
+
if (await confirm(client2, `Did you mean ${import_chalk88.default.bold(found)}?`, false)) {
|
171290
171246
|
return found;
|
171291
171247
|
}
|
171292
171248
|
} else {
|
171293
171249
|
throw GuessError;
|
171294
171250
|
}
|
171295
171251
|
}
|
171296
|
-
var import_fs8, import_path42, import_tar_fs,
|
171252
|
+
var import_fs8, import_path42, import_tar_fs, import_chalk88, EXAMPLE_API;
|
171297
171253
|
var init_init = __esm({
|
171298
171254
|
"src/commands/init/init.ts"() {
|
171299
171255
|
"use strict";
|
171300
171256
|
import_fs8 = __toESM3(require("fs"));
|
171301
171257
|
import_path42 = __toESM3(require("path"));
|
171302
171258
|
import_tar_fs = __toESM3(require_tar_fs());
|
171303
|
-
|
171259
|
+
import_chalk88 = __toESM3(require_source());
|
171304
171260
|
init_list();
|
171305
171261
|
init_list_item();
|
171306
|
-
|
171262
|
+
init_confirm();
|
171307
171263
|
init_humanize_path();
|
171308
171264
|
init_info();
|
171309
171265
|
init_cmd();
|
@@ -171431,11 +171387,11 @@ var init_build_state = __esm({
|
|
171431
171387
|
});
|
171432
171388
|
|
171433
171389
|
// src/util/output/builds.ts
|
171434
|
-
var
|
171390
|
+
var import_chalk89, import_bytes7, padding, MAX_BUILD_GROUPS, MAX_OUTPUTS_PER_GROUP, hasOutput, getCommonPath, styleBuild, styleHiddenBuilds, styleOutput, getDirPath, sortByEntrypoint, groupBuilds, builds_default;
|
171435
171391
|
var init_builds = __esm({
|
171436
171392
|
"src/util/output/builds.ts"() {
|
171437
171393
|
"use strict";
|
171438
|
-
|
171394
|
+
import_chalk89 = __toESM3(require_source());
|
171439
171395
|
import_bytes7 = __toESM3(require_bytes());
|
171440
171396
|
init_build_state();
|
171441
171397
|
padding = 8;
|
@@ -171464,48 +171420,48 @@ var init_builds = __esm({
|
|
171464
171420
|
styleBuild = (build2, times, longestSource) => {
|
171465
171421
|
const { entrypoint, id } = build2;
|
171466
171422
|
const time = typeof times[id] === "string" ? times[id] : "";
|
171467
|
-
let pathColor =
|
171423
|
+
let pathColor = import_chalk89.default.cyan;
|
171468
171424
|
if (isFailed(build2)) {
|
171469
|
-
pathColor =
|
171425
|
+
pathColor = import_chalk89.default.red;
|
171470
171426
|
}
|
171471
171427
|
const entry = entrypoint.padEnd(longestSource + padding);
|
171472
171428
|
const prefix = hasOutput(build2) ? "\u250C" : "\u2576";
|
171473
|
-
return `${
|
171429
|
+
return `${import_chalk89.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
171474
171430
|
};
|
171475
171431
|
styleHiddenBuilds = (commonPath, buildGroup, times, longestSource, isHidden = false) => {
|
171476
171432
|
const { id } = buildGroup[0];
|
171477
171433
|
const entry = commonPath.padEnd(longestSource + padding);
|
171478
171434
|
const time = typeof times[id] === "string" ? times[id] : "";
|
171479
171435
|
const prefix = isHidden === false && buildGroup.some(hasOutput) ? "\u250C" : "\u2576";
|
171480
|
-
let pathColor =
|
171436
|
+
let pathColor = import_chalk89.default.cyan;
|
171481
171437
|
if (buildGroup.every(isFailed)) {
|
171482
|
-
pathColor =
|
171438
|
+
pathColor = import_chalk89.default.red;
|
171483
171439
|
}
|
171484
171440
|
if (isHidden) {
|
171485
|
-
pathColor =
|
171441
|
+
pathColor = import_chalk89.default.grey;
|
171486
171442
|
}
|
171487
|
-
return `${
|
171443
|
+
return `${import_chalk89.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
171488
171444
|
};
|
171489
171445
|
styleOutput = (output2, readyState, isLast) => {
|
171490
171446
|
const { type, path: path11, size, lambda } = output2;
|
171491
171447
|
const prefix = type === "lambda" ? "\u03BB " : "";
|
171492
|
-
const finalSize = size ? ` ${
|
171493
|
-
let color =
|
171448
|
+
const finalSize = size ? ` ${import_chalk89.default.grey(`(${(0, import_bytes7.default)(size)})`)}` : "";
|
171449
|
+
let color = import_chalk89.default.grey;
|
171494
171450
|
let finalRegion = "";
|
171495
171451
|
if (isReady({ readyState })) {
|
171496
|
-
color =
|
171452
|
+
color = import_chalk89.default;
|
171497
171453
|
} else if (isFailed({ readyState })) {
|
171498
|
-
color =
|
171454
|
+
color = import_chalk89.default.red;
|
171499
171455
|
}
|
171500
171456
|
if (lambda) {
|
171501
171457
|
const { deployedTo } = lambda;
|
171502
171458
|
if (deployedTo && deployedTo.length > 0) {
|
171503
|
-
finalRegion = ` ${
|
171459
|
+
finalRegion = ` ${import_chalk89.default.grey(`[${deployedTo.join(", ")}]`)}`;
|
171504
171460
|
}
|
171505
171461
|
}
|
171506
171462
|
const corner = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
|
171507
171463
|
const main14 = prefix + path11 + finalSize + finalRegion;
|
171508
|
-
return `${
|
171464
|
+
return `${import_chalk89.default.grey(corner)} ${color(main14)}`;
|
171509
171465
|
};
|
171510
171466
|
getDirPath = (path11, level = 0, highestLevel = null) => {
|
171511
171467
|
const parts = path11.split("/").slice(0, -1);
|
@@ -171637,7 +171593,7 @@ var init_builds = __esm({
|
|
171637
171593
|
);
|
171638
171594
|
if (outputs.length > MAX_OUTPUTS_PER_GROUP) {
|
171639
171595
|
final.push(
|
171640
|
-
|
171596
|
+
import_chalk89.default.grey(
|
171641
171597
|
`\u2514\u2500\u2500 ${outputs.length - MAX_OUTPUTS_PER_GROUP} output items hidden
|
171642
171598
|
`
|
171643
171599
|
)
|
@@ -171672,19 +171628,19 @@ function routes(routes2) {
|
|
171672
171628
|
const padding2 = 6;
|
171673
171629
|
const space = " ".repeat(padding2);
|
171674
171630
|
const destSpace = " ".repeat(longestDest || 10);
|
171675
|
-
const arrow =
|
171631
|
+
const arrow = import_chalk90.default.grey("->");
|
171676
171632
|
for (const item of routes2) {
|
171677
171633
|
if ("handle" in item) {
|
171678
|
-
toPrint += `${
|
171634
|
+
toPrint += `${import_chalk90.default.grey("\u2576")} ${import_chalk90.default.cyan(item.handle)}`;
|
171679
171635
|
continue;
|
171680
171636
|
}
|
171681
171637
|
const { src, dest, status, headers } = item;
|
171682
171638
|
const last = routes2.indexOf(item) === routes2.length - 1;
|
171683
171639
|
const suffix = last ? "" : `
|
171684
171640
|
`;
|
171685
|
-
const finalSrc =
|
171641
|
+
const finalSrc = import_chalk90.default.cyan(src.padEnd(longestSrc + padding2));
|
171686
171642
|
const finalDest = dest ? `${arrow}${space}${dest}` : ` ${space}${destSpace}`;
|
171687
|
-
const finalStatus = status ?
|
171643
|
+
const finalStatus = status ? import_chalk90.default.grey(`[${status}]`) : "";
|
171688
171644
|
let finalHeaders = null;
|
171689
171645
|
if (headers) {
|
171690
171646
|
finalHeaders = `
|
@@ -171695,21 +171651,21 @@ function routes(routes2) {
|
|
171695
171651
|
const last2 = headerKeys.indexOf(header) === headerKeys.length - 1;
|
171696
171652
|
const suffix2 = last2 ? "" : `
|
171697
171653
|
`;
|
171698
|
-
const prefix2 =
|
171654
|
+
const prefix2 = import_chalk90.default.grey(last2 ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500");
|
171699
171655
|
finalHeaders += `${prefix2} ${header}: ${value}${suffix2}`;
|
171700
171656
|
}
|
171701
171657
|
}
|
171702
|
-
const prefix =
|
171658
|
+
const prefix = import_chalk90.default.grey(finalHeaders ? "\u250C" : "\u2576");
|
171703
171659
|
const fill = `${finalSrc}${finalDest}${space}${finalStatus}`;
|
171704
171660
|
toPrint += `${prefix} ${fill}${finalHeaders || ""}${suffix}`;
|
171705
171661
|
}
|
171706
171662
|
return toPrint;
|
171707
171663
|
}
|
171708
|
-
var
|
171664
|
+
var import_chalk90, longestProperty;
|
171709
171665
|
var init_routes = __esm({
|
171710
171666
|
"src/util/output/routes.ts"() {
|
171711
171667
|
"use strict";
|
171712
|
-
|
171668
|
+
import_chalk90 = __toESM3(require_source());
|
171713
171669
|
longestProperty = (routes2, name) => {
|
171714
171670
|
const longestItem = routes2.sort((a, b) => {
|
171715
171671
|
const aName = a[name];
|
@@ -171848,7 +171804,7 @@ async function inspect2(client2) {
|
|
171848
171804
|
} catch {
|
171849
171805
|
}
|
171850
171806
|
client2.output.spinner(
|
171851
|
-
`Fetching deployment "${deploymentIdOrHost}" in ${
|
171807
|
+
`Fetching deployment "${deploymentIdOrHost}" in ${import_chalk91.default.bold(contextName)}`
|
171852
171808
|
);
|
171853
171809
|
const until = Date.now() + timeout;
|
171854
171810
|
const wait2 = argv2["--wait"];
|
@@ -171871,23 +171827,23 @@ async function inspect2(client2) {
|
|
171871
171827
|
} = deployment;
|
171872
171828
|
const { builds } = deployment.version === 2 ? await client2.fetch(`/v11/deployments/${id}/builds`) : { builds: [] };
|
171873
171829
|
log2(
|
171874
|
-
`Fetched deployment "${
|
171830
|
+
`Fetched deployment "${import_chalk91.default.bold(url3)}" in ${import_chalk91.default.bold(
|
171875
171831
|
contextName
|
171876
171832
|
)} ${elapsed(Date.now() - depFetchStart)}`
|
171877
171833
|
);
|
171878
171834
|
print("\n");
|
171879
|
-
print(
|
171880
|
-
print(` ${
|
171835
|
+
print(import_chalk91.default.bold(" General\n\n"));
|
171836
|
+
print(` ${import_chalk91.default.cyan("id")} ${id}
|
171881
171837
|
`);
|
171882
|
-
print(` ${
|
171838
|
+
print(` ${import_chalk91.default.cyan("name")} ${name}
|
171883
171839
|
`);
|
171884
|
-
print(` ${
|
171840
|
+
print(` ${import_chalk91.default.cyan("status")} ${stateString(readyState)}
|
171885
171841
|
`);
|
171886
|
-
print(` ${
|
171842
|
+
print(` ${import_chalk91.default.cyan("url")} https://${url3}
|
171887
171843
|
`);
|
171888
171844
|
if (createdAt) {
|
171889
171845
|
print(
|
171890
|
-
` ${
|
171846
|
+
` ${import_chalk91.default.cyan("created")} ${new Date(createdAt)} ${elapsed(
|
171891
171847
|
Date.now() - createdAt,
|
171892
171848
|
true
|
171893
171849
|
)}
|
@@ -171896,10 +171852,10 @@ async function inspect2(client2) {
|
|
171896
171852
|
}
|
171897
171853
|
print("\n\n");
|
171898
171854
|
if (aliases !== void 0 && aliases.length > 0) {
|
171899
|
-
print(
|
171855
|
+
print(import_chalk91.default.bold(" Aliases\n\n"));
|
171900
171856
|
let aliasList = "";
|
171901
171857
|
for (const alias2 of aliases) {
|
171902
|
-
aliasList += `${
|
171858
|
+
aliasList += `${import_chalk91.default.gray("\u2576")} https://${alias2}
|
171903
171859
|
`;
|
171904
171860
|
}
|
171905
171861
|
print(indent_default(aliasList, 4));
|
@@ -171911,12 +171867,12 @@ async function inspect2(client2) {
|
|
171911
171867
|
const { id: id2, createdAt: createdAt2, readyStateAt } = build2;
|
171912
171868
|
times[id2] = createdAt2 && readyStateAt ? elapsed(readyStateAt - createdAt2) : null;
|
171913
171869
|
}
|
171914
|
-
print(
|
171870
|
+
print(import_chalk91.default.bold(" Builds\n\n"));
|
171915
171871
|
print(indent_default(builds_default(builds, times).toPrint, 4));
|
171916
171872
|
print("\n\n");
|
171917
171873
|
}
|
171918
171874
|
if (Array.isArray(routes2) && routes2.length > 0) {
|
171919
|
-
print(
|
171875
|
+
print(import_chalk91.default.bold(" Routes\n\n"));
|
171920
171876
|
print(indent_default(routes(routes2), 4));
|
171921
171877
|
print(`
|
171922
171878
|
|
@@ -171930,24 +171886,24 @@ function stateString(s) {
|
|
171930
171886
|
switch (s) {
|
171931
171887
|
case "INITIALIZING":
|
171932
171888
|
case "BUILDING":
|
171933
|
-
return
|
171889
|
+
return import_chalk91.default.yellow(CIRCLE) + sTitle;
|
171934
171890
|
case "ERROR":
|
171935
|
-
return
|
171891
|
+
return import_chalk91.default.red(CIRCLE) + sTitle;
|
171936
171892
|
case "READY":
|
171937
|
-
return
|
171893
|
+
return import_chalk91.default.green(CIRCLE) + sTitle;
|
171938
171894
|
case "QUEUED":
|
171939
|
-
return
|
171895
|
+
return import_chalk91.default.gray(CIRCLE) + sTitle;
|
171940
171896
|
case "CANCELED":
|
171941
|
-
return
|
171897
|
+
return import_chalk91.default.gray(CIRCLE) + sTitle;
|
171942
171898
|
default:
|
171943
|
-
return
|
171899
|
+
return import_chalk91.default.gray("UNKNOWN");
|
171944
171900
|
}
|
171945
171901
|
}
|
171946
|
-
var
|
171902
|
+
var import_chalk91, import_title5, import_error_utils24, import_url19, import_ms16;
|
171947
171903
|
var init_inspect2 = __esm({
|
171948
171904
|
"src/commands/inspect/index.ts"() {
|
171949
171905
|
"use strict";
|
171950
|
-
|
171906
|
+
import_chalk91 = __toESM3(require_source());
|
171951
171907
|
init_get_args();
|
171952
171908
|
init_builds();
|
171953
171909
|
init_routes();
|
@@ -172255,7 +172211,7 @@ async function list2(client2) {
|
|
172255
172211
|
error4("Please provide a number for flag `--next`");
|
172256
172212
|
return 1;
|
172257
172213
|
}
|
172258
|
-
spinner(`Fetching deployments in ${
|
172214
|
+
spinner(`Fetching deployments in ${import_chalk92.default.bold(contextName)}`);
|
172259
172215
|
const now = new Now({
|
172260
172216
|
client: client2,
|
172261
172217
|
currentTeam
|
@@ -172326,7 +172282,7 @@ async function list2(client2) {
|
|
172326
172282
|
return 0;
|
172327
172283
|
}
|
172328
172284
|
log2(
|
172329
|
-
`${target === "production" ? `Production deployments` : `Deployments`} for ${
|
172285
|
+
`${target === "production" ? `Production deployments` : `Deployments`} for ${import_chalk92.default.bold(app)} under ${import_chalk92.default.bold(contextName)} ${elapsed(
|
172330
172286
|
Date.now() - start
|
172331
172287
|
)}`
|
172332
172288
|
);
|
@@ -172341,16 +172297,16 @@ async function list2(client2) {
|
|
172341
172297
|
client2.output.print(
|
172342
172298
|
`${(0, import_text_table9.default)(
|
172343
172299
|
[
|
172344
|
-
headers.map((header) =>
|
172300
|
+
headers.map((header) => import_chalk92.default.bold(import_chalk92.default.cyan(header))),
|
172345
172301
|
...deployments.sort(sortRecent()).map((dep) => {
|
172346
172302
|
urls.push(`https://${dep.url}`);
|
172347
172303
|
return [
|
172348
|
-
|
172304
|
+
import_chalk92.default.gray((0, import_ms17.default)(Date.now() - dep.createdAt)),
|
172349
172305
|
`https://${dep.url}`,
|
172350
172306
|
stateString2(dep.state || ""),
|
172351
172307
|
dep.target === "production" ? "Production" : "Preview",
|
172352
|
-
|
172353
|
-
showUsername ?
|
172308
|
+
import_chalk92.default.gray(getDeploymentDuration(dep)),
|
172309
|
+
showUsername ? import_chalk92.default.gray(dep.creator?.username) : ""
|
172354
172310
|
];
|
172355
172311
|
}).filter(
|
172356
172312
|
(app2) => (
|
@@ -172400,17 +172356,17 @@ function stateString2(s) {
|
|
172400
172356
|
case "BUILDING":
|
172401
172357
|
case "DEPLOYING":
|
172402
172358
|
case "ANALYZING":
|
172403
|
-
return
|
172359
|
+
return import_chalk92.default.yellow(CIRCLE) + sTitle;
|
172404
172360
|
case "ERROR":
|
172405
|
-
return
|
172361
|
+
return import_chalk92.default.red(CIRCLE) + sTitle;
|
172406
172362
|
case "READY":
|
172407
|
-
return
|
172363
|
+
return import_chalk92.default.green(CIRCLE) + sTitle;
|
172408
172364
|
case "QUEUED":
|
172409
|
-
return
|
172365
|
+
return import_chalk92.default.white(CIRCLE) + sTitle;
|
172410
172366
|
case "CANCELED":
|
172411
|
-
return
|
172367
|
+
return import_chalk92.default.gray(sTitle);
|
172412
172368
|
default:
|
172413
|
-
return
|
172369
|
+
return import_chalk92.default.gray("UNKNOWN");
|
172414
172370
|
}
|
172415
172371
|
}
|
172416
172372
|
function sortRecent() {
|
@@ -172428,11 +172384,11 @@ function filterUniqueApps() {
|
|
172428
172384
|
return true;
|
172429
172385
|
};
|
172430
172386
|
}
|
172431
|
-
var
|
172387
|
+
var import_chalk92, import_ms17, import_text_table9, import_title6, import_error_utils25;
|
172432
172388
|
var init_list2 = __esm({
|
172433
172389
|
"src/commands/list/index.ts"() {
|
172434
172390
|
"use strict";
|
172435
|
-
|
172391
|
+
import_chalk92 = __toESM3(require_source());
|
172436
172392
|
import_ms17 = __toESM3(require_ms2());
|
172437
172393
|
import_text_table9 = __toESM3(require_text_table());
|
172438
172394
|
import_title6 = __toESM3(require_lib17());
|
@@ -172841,7 +172797,7 @@ async function logs(client2) {
|
|
172841
172797
|
const { contextName } = await getScope(client2);
|
172842
172798
|
const id = deploymentIdOrURL;
|
172843
172799
|
const depFetchStart = Date.now();
|
172844
|
-
output2.spinner(`Fetching deployment "${id}" in ${
|
172800
|
+
output2.spinner(`Fetching deployment "${id}" in ${import_chalk93.default.bold(contextName)}`);
|
172845
172801
|
let deployment;
|
172846
172802
|
try {
|
172847
172803
|
deployment = await getDeployment(client2, contextName, id);
|
@@ -172849,7 +172805,7 @@ async function logs(client2) {
|
|
172849
172805
|
output2.stopSpinner();
|
172850
172806
|
}
|
172851
172807
|
output2.log(
|
172852
|
-
`Fetched deployment "${deployment.url}" in ${
|
172808
|
+
`Fetched deployment "${deployment.url}" in ${import_chalk93.default.bold(
|
172853
172809
|
contextName
|
172854
172810
|
)} ${elapsed(Date.now() - depFetchStart)}`
|
172855
172811
|
);
|
@@ -172920,9 +172876,9 @@ function printLogShort(log2) {
|
|
172920
172876
|
} else {
|
172921
172877
|
data = (log2.text || "").replace(/\n$/, "").replace(/^\n/, "").replace(/\x1b\[1000D/g, "").replace(/\x1b\[0K/g, "").replace(/\x1b\[1A/g, "");
|
172922
172878
|
if (/warning/i.test(data)) {
|
172923
|
-
data =
|
172879
|
+
data = import_chalk93.default.yellow(data);
|
172924
172880
|
} else if (log2.type === "stderr") {
|
172925
|
-
data =
|
172881
|
+
data = import_chalk93.default.red(data);
|
172926
172882
|
}
|
172927
172883
|
}
|
172928
172884
|
const date = new Date(log2.created).toISOString();
|
@@ -172937,7 +172893,7 @@ function printLogShort(log2) {
|
|
172937
172893
|
}
|
172938
172894
|
}
|
172939
172895
|
console.log(
|
172940
|
-
`${
|
172896
|
+
`${import_chalk93.default.dim(date)} ${line.replace("[now-builder-debug] ", "")}`
|
172941
172897
|
);
|
172942
172898
|
});
|
172943
172899
|
return 0;
|
@@ -172961,11 +172917,11 @@ function toTimestamp(datestr) {
|
|
172961
172917
|
}
|
172962
172918
|
return t;
|
172963
172919
|
}
|
172964
|
-
var
|
172920
|
+
var import_chalk93, logPrinters, isLogPrinter, getLogPrinter;
|
172965
172921
|
var init_logs = __esm({
|
172966
172922
|
"src/commands/logs/index.ts"() {
|
172967
172923
|
"use strict";
|
172968
|
-
|
172924
|
+
import_chalk93 = __toESM3(require_source());
|
172969
172925
|
init_elapsed();
|
172970
172926
|
init_url();
|
172971
172927
|
init_events();
|
@@ -173137,7 +173093,7 @@ async function login2(client2) {
|
|
173137
173093
|
writeToConfigFile(client2.config);
|
173138
173094
|
output2.debug(`Saved credentials in "${humanizePath(global_path_default())}"`);
|
173139
173095
|
output2.print(
|
173140
|
-
`${
|
173096
|
+
`${import_chalk94.default.cyan("Congratulations!")} You are now logged in. In order to deploy something, run ${getCommandName()}.
|
173141
173097
|
`
|
173142
173098
|
);
|
173143
173099
|
output2.print(
|
@@ -173149,12 +173105,12 @@ async function login2(client2) {
|
|
173149
173105
|
);
|
173150
173106
|
return 0;
|
173151
173107
|
}
|
173152
|
-
var import_email_validator,
|
173108
|
+
var import_email_validator, import_chalk94;
|
173153
173109
|
var init_login2 = __esm({
|
173154
173110
|
"src/commands/login/index.ts"() {
|
173155
173111
|
"use strict";
|
173156
173112
|
import_email_validator = __toESM3(require_email_validator());
|
173157
|
-
|
173113
|
+
import_chalk94 = __toESM3(require_source());
|
173158
173114
|
init_humanize_path();
|
173159
173115
|
init_get_args();
|
173160
173116
|
init_prompt();
|
@@ -173278,12 +173234,12 @@ async function add6(client2, args2, contextName) {
|
|
173278
173234
|
const { output: output2 } = client2;
|
173279
173235
|
if (args2.length !== 1) {
|
173280
173236
|
output2.error(
|
173281
|
-
`Invalid number of arguments. Usage: ${
|
173237
|
+
`Invalid number of arguments. Usage: ${import_chalk95.default.cyan(
|
173282
173238
|
`${getCommandName("project add <name>")}`
|
173283
173239
|
)}`
|
173284
173240
|
);
|
173285
173241
|
if (args2.length > 1) {
|
173286
|
-
const example =
|
173242
|
+
const example = import_chalk95.default.cyan(
|
173287
173243
|
`${getCommandName(`project add "${args2.join(" ")}"`)}`
|
173288
173244
|
);
|
173289
173245
|
output2.log(
|
@@ -173309,17 +173265,17 @@ async function add6(client2, args2, contextName) {
|
|
173309
173265
|
}
|
173310
173266
|
const elapsed2 = (0, import_ms18.default)(Date.now() - start);
|
173311
173267
|
output2.log(
|
173312
|
-
`${
|
173268
|
+
`${import_chalk95.default.cyan("Success!")} Project ${import_chalk95.default.bold(
|
173313
173269
|
name.toLowerCase()
|
173314
|
-
)} added (${
|
173270
|
+
)} added (${import_chalk95.default.bold(contextName)}) ${import_chalk95.default.gray(`[${elapsed2}]`)}`
|
173315
173271
|
);
|
173316
173272
|
return;
|
173317
173273
|
}
|
173318
|
-
var
|
173274
|
+
var import_chalk95, import_ms18;
|
173319
173275
|
var init_add5 = __esm({
|
173320
173276
|
"src/commands/project/add.ts"() {
|
173321
173277
|
"use strict";
|
173322
|
-
|
173278
|
+
import_chalk95 = __toESM3(require_source());
|
173323
173279
|
import_ms18 = __toESM3(require_ms2());
|
173324
173280
|
init_errors_ts();
|
173325
173281
|
init_pkg_name();
|
@@ -173332,14 +173288,14 @@ async function list3(client2, argv2, args2, contextName) {
|
|
173332
173288
|
const { output: output2 } = client2;
|
173333
173289
|
if (args2.length !== 0) {
|
173334
173290
|
output2.error(
|
173335
|
-
`Invalid number of arguments. Usage: ${
|
173291
|
+
`Invalid number of arguments. Usage: ${import_chalk96.default.cyan(
|
173336
173292
|
`${getCommandName("project ls")}`
|
173337
173293
|
)}`
|
173338
173294
|
);
|
173339
173295
|
return 2;
|
173340
173296
|
}
|
173341
173297
|
const start = Date.now();
|
173342
|
-
output2.spinner(`Fetching projects in ${
|
173298
|
+
output2.spinner(`Fetching projects in ${import_chalk96.default.bold(contextName)}`);
|
173343
173299
|
let projectsUrl = `/v4/projects/?limit=20`;
|
173344
173300
|
const deprecated = argv2["--update-required"] || false;
|
173345
173301
|
if (deprecated) {
|
@@ -173374,19 +173330,19 @@ async function list3(client2, argv2, args2, contextName) {
|
|
173374
173330
|
);
|
173375
173331
|
}
|
173376
173332
|
output2.log(
|
173377
|
-
`${projectList.length > 0 ? "Projects" : "No projects"} found under ${
|
173333
|
+
`${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}]`)}`
|
173378
173334
|
);
|
173379
173335
|
if (projectList.length > 0) {
|
173380
173336
|
const tablePrint = (0, import_text_table10.default)(
|
173381
173337
|
[
|
173382
173338
|
["Project Name", "Latest Production URL", "Updated"].map(
|
173383
|
-
(header) =>
|
173339
|
+
(header) => import_chalk96.default.bold(import_chalk96.default.cyan(header))
|
173384
173340
|
),
|
173385
173341
|
...projectList.map((project) => [
|
173386
173342
|
[
|
173387
|
-
|
173343
|
+
import_chalk96.default.bold(project.name),
|
173388
173344
|
getLatestProdUrl(project),
|
173389
|
-
|
173345
|
+
import_chalk96.default.gray((0, import_ms19.default)(Date.now() - project.updatedAt))
|
173390
173346
|
]
|
173391
173347
|
]).flat()
|
173392
173348
|
],
|
@@ -173414,11 +173370,11 @@ function getLatestProdUrl(project) {
|
|
173414
173370
|
return "https://" + alias2;
|
173415
173371
|
return "--";
|
173416
173372
|
}
|
173417
|
-
var
|
173373
|
+
var import_chalk96, import_ms19, import_text_table10, import_build_utils18;
|
173418
173374
|
var init_list3 = __esm({
|
173419
173375
|
"src/commands/project/list.ts"() {
|
173420
173376
|
"use strict";
|
173421
|
-
|
173377
|
+
import_chalk96 = __toESM3(require_source());
|
173422
173378
|
import_ms19 = __toESM3(require_ms2());
|
173423
173379
|
import_text_table10 = __toESM3(require_text_table());
|
173424
173380
|
init_get_command_flags();
|
@@ -173432,7 +173388,7 @@ var init_list3 = __esm({
|
|
173432
173388
|
async function rm6(client2, args2) {
|
173433
173389
|
if (args2.length !== 1) {
|
173434
173390
|
client2.output.error(
|
173435
|
-
`Invalid number of arguments. Usage: ${
|
173391
|
+
`Invalid number of arguments. Usage: ${import_chalk97.default.cyan(
|
173436
173392
|
`${getCommandName("project rm <name>")}`
|
173437
173393
|
)}`
|
173438
173394
|
);
|
@@ -173461,7 +173417,7 @@ async function rm6(client2, args2) {
|
|
173461
173417
|
}
|
173462
173418
|
const elapsed2 = (0, import_ms20.default)(Date.now() - start);
|
173463
173419
|
client2.output.log(
|
173464
|
-
`${
|
173420
|
+
`${import_chalk97.default.cyan("Success!")} Project ${import_chalk97.default.bold(name)} removed ${import_chalk97.default.gray(
|
173465
173421
|
`[${elapsed2}]`
|
173466
173422
|
)}`
|
173467
173423
|
);
|
@@ -173470,19 +173426,19 @@ async function rm6(client2, args2) {
|
|
173470
173426
|
async function readConfirmation3(client2, projectName) {
|
173471
173427
|
client2.output.print(
|
173472
173428
|
prependEmoji(
|
173473
|
-
`The project ${
|
173429
|
+
`The project ${import_chalk97.default.bold(projectName)} will be removed permanently.
|
173474
173430
|
It will also delete everything under the project including deployments.
|
173475
173431
|
`,
|
173476
173432
|
emoji("warning")
|
173477
173433
|
)
|
173478
173434
|
);
|
173479
|
-
return await confirm(client2, `${
|
173435
|
+
return await confirm(client2, `${import_chalk97.default.bold.red("Are you sure?")}`, false);
|
173480
173436
|
}
|
173481
|
-
var
|
173437
|
+
var import_chalk97, import_ms20, e;
|
173482
173438
|
var init_rm6 = __esm({
|
173483
173439
|
"src/commands/project/rm.ts"() {
|
173484
173440
|
"use strict";
|
173485
|
-
|
173441
|
+
import_chalk97 = __toESM3(require_source());
|
173486
173442
|
import_ms20 = __toESM3(require_ms2());
|
173487
173443
|
init_emoji();
|
173488
173444
|
init_errors_ts();
|
@@ -173693,7 +173649,7 @@ async function getProjectByDeployment({
|
|
173693
173649
|
let team;
|
173694
173650
|
try {
|
173695
173651
|
output2?.spinner(
|
173696
|
-
`Fetching deployment "${deployId}" in ${
|
173652
|
+
`Fetching deployment "${deployId}" in ${import_chalk98.default.bold(contextName)}\u2026`
|
173697
173653
|
);
|
173698
173654
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
173699
173655
|
config3.currentTeam ? getTeamById(client2, config3.currentTeam) : void 0,
|
@@ -173710,12 +173666,12 @@ async function getProjectByDeployment({
|
|
173710
173666
|
team = teamResult.value;
|
173711
173667
|
deployment = deploymentResult.value;
|
173712
173668
|
output2?.log(
|
173713
|
-
`Fetching deployment "${deployId}" in ${
|
173669
|
+
`Fetching deployment "${deployId}" in ${import_chalk98.default.bold(contextName)}\u2026`
|
173714
173670
|
);
|
173715
173671
|
if (deployment.team?.id) {
|
173716
173672
|
if (!team || deployment.team.id !== team.id) {
|
173717
173673
|
const err = new Error(
|
173718
|
-
team ? `Deployment doesn't belong to current team ${
|
173674
|
+
team ? `Deployment doesn't belong to current team ${import_chalk98.default.bold(
|
173719
173675
|
contextName
|
173720
173676
|
)}` : `Deployment belongs to a different team`
|
173721
173677
|
);
|
@@ -173724,7 +173680,7 @@ async function getProjectByDeployment({
|
|
173724
173680
|
}
|
173725
173681
|
} else if (team) {
|
173726
173682
|
const err = new Error(
|
173727
|
-
`Deployment doesn't belong to current team ${
|
173683
|
+
`Deployment doesn't belong to current team ${import_chalk98.default.bold(contextName)}`
|
173728
173684
|
);
|
173729
173685
|
err.code = "ERR_INVALID_TEAM";
|
173730
173686
|
throw err;
|
@@ -173745,11 +173701,11 @@ async function getProjectByDeployment({
|
|
173745
173701
|
output2?.stopSpinner();
|
173746
173702
|
}
|
173747
173703
|
}
|
173748
|
-
var
|
173704
|
+
var import_chalk98;
|
173749
173705
|
var init_get_project_by_deployment = __esm({
|
173750
173706
|
"src/util/projects/get-project-by-deployment.ts"() {
|
173751
173707
|
"use strict";
|
173752
|
-
|
173708
|
+
import_chalk98 = __toESM3(require_source());
|
173753
173709
|
init_get_deployment();
|
173754
173710
|
init_get_project_by_id_or_name();
|
173755
173711
|
init_get_scope();
|
@@ -173762,21 +173718,21 @@ var init_get_project_by_deployment = __esm({
|
|
173762
173718
|
// src/util/alias/render-alias-status.ts
|
173763
173719
|
function renderAliasStatus(status) {
|
173764
173720
|
if (status === "completed") {
|
173765
|
-
return
|
173721
|
+
return import_chalk99.default.green(status);
|
173766
173722
|
}
|
173767
173723
|
if (status === "failed") {
|
173768
|
-
return
|
173724
|
+
return import_chalk99.default.red(status);
|
173769
173725
|
}
|
173770
173726
|
if (status === "skipped") {
|
173771
|
-
return
|
173727
|
+
return import_chalk99.default.gray(status);
|
173772
173728
|
}
|
173773
|
-
return
|
173729
|
+
return import_chalk99.default.yellow(status);
|
173774
173730
|
}
|
173775
|
-
var
|
173731
|
+
var import_chalk99;
|
173776
173732
|
var init_render_alias_status = __esm({
|
173777
173733
|
"src/util/alias/render-alias-status.ts"() {
|
173778
173734
|
"use strict";
|
173779
|
-
|
173735
|
+
import_chalk99 = __toESM3(require_source());
|
173780
173736
|
}
|
173781
173737
|
});
|
173782
173738
|
|
@@ -173851,7 +173807,7 @@ async function promoteStatus({
|
|
173851
173807
|
}
|
173852
173808
|
if (requestedAt < recentThreshold || Date.now() >= promoteTimeout) {
|
173853
173809
|
output2.log(
|
173854
|
-
`The promotion exceeded its deadline - rerun ${
|
173810
|
+
`The promotion exceeded its deadline - rerun ${import_chalk100.default.bold(
|
173855
173811
|
`${packageName} promote ${toDeploymentId}`
|
173856
173812
|
)} to try again`
|
173857
173813
|
);
|
@@ -173917,26 +173873,26 @@ async function renderJobSucceeded({
|
|
173917
173873
|
let deploymentInfo = "";
|
173918
173874
|
try {
|
173919
173875
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
173920
|
-
deploymentInfo = `${
|
173876
|
+
deploymentInfo = `${import_chalk100.default.bold(deployment.url)} (${toDeploymentId})`;
|
173921
173877
|
} catch (err) {
|
173922
173878
|
output2.debug(
|
173923
173879
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
173924
173880
|
);
|
173925
|
-
deploymentInfo =
|
173881
|
+
deploymentInfo = import_chalk100.default.bold(toDeploymentId);
|
173926
173882
|
}
|
173927
173883
|
const duration = performingPromote ? elapsed(Date.now() - requestedAt) : "";
|
173928
173884
|
output2.log(
|
173929
|
-
`Success! ${
|
173885
|
+
`Success! ${import_chalk100.default.bold(
|
173930
173886
|
project.name
|
173931
173887
|
)} was promoted to ${deploymentInfo} ${duration}`
|
173932
173888
|
);
|
173933
173889
|
return 0;
|
173934
173890
|
}
|
173935
|
-
var
|
173891
|
+
var import_chalk100, import_ms21;
|
173936
173892
|
var init_status = __esm({
|
173937
173893
|
"src/commands/promote/status.ts"() {
|
173938
173894
|
"use strict";
|
173939
|
-
|
173895
|
+
import_chalk100 = __toESM3(require_source());
|
173940
173896
|
init_elapsed();
|
173941
173897
|
init_format_date();
|
173942
173898
|
init_get_deployment();
|
@@ -173963,6 +173919,11 @@ async function requestPromote({
|
|
173963
173919
|
deployId,
|
173964
173920
|
output: client2.output
|
173965
173921
|
});
|
173922
|
+
if (deployment.target !== "production") {
|
173923
|
+
output2.warn(
|
173924
|
+
"Promoting a preview deployment to production is deprecated and will be removed in the next major release. This behavior will be removed entirely on 2024-05-03."
|
173925
|
+
);
|
173926
|
+
}
|
173966
173927
|
if (deployment.target !== "production" && !yes) {
|
173967
173928
|
const question = "This deployment does not target production, therefore promotion will not apply production environment variables. Are you sure you want to continue?";
|
173968
173929
|
const answer = await confirm(client2, question, false);
|
@@ -173979,7 +173940,7 @@ async function requestPromote({
|
|
173979
173940
|
});
|
173980
173941
|
if (timeout !== void 0 && (0, import_ms22.default)(timeout) === 0) {
|
173981
173942
|
output2.log(
|
173982
|
-
`Successfully requested promote of ${
|
173943
|
+
`Successfully requested promote of ${import_chalk101.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
173983
173944
|
);
|
173984
173945
|
output2.log(`To check promote status, run ${getCommandName("promote")}.`);
|
173985
173946
|
return 0;
|
@@ -173992,11 +173953,11 @@ async function requestPromote({
|
|
173992
173953
|
timeout
|
173993
173954
|
});
|
173994
173955
|
}
|
173995
|
-
var
|
173956
|
+
var import_chalk101, import_ms22;
|
173996
173957
|
var init_request_promote = __esm({
|
173997
173958
|
"src/commands/promote/request-promote.ts"() {
|
173998
173959
|
"use strict";
|
173999
|
-
|
173960
|
+
import_chalk101 = __toESM3(require_source());
|
174000
173961
|
init_pkg_name();
|
174001
173962
|
init_get_project_by_deployment();
|
174002
173963
|
import_ms22 = __toESM3(require_ms2());
|
@@ -174160,7 +174121,7 @@ async function getDeploymentByIdOrURL({
|
|
174160
174121
|
let team;
|
174161
174122
|
try {
|
174162
174123
|
output2.spinner(
|
174163
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
174124
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk102.default.bold(contextName)}\u2026`
|
174164
174125
|
);
|
174165
174126
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
174166
174127
|
config3.currentTeam ? getTeamById(client2, config3.currentTeam) : void 0,
|
@@ -174177,7 +174138,7 @@ async function getDeploymentByIdOrURL({
|
|
174177
174138
|
team = teamResult.value;
|
174178
174139
|
deployment = deploymentResult.value;
|
174179
174140
|
output2.log(
|
174180
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
174141
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk102.default.bold(contextName)}\u2026`
|
174181
174142
|
);
|
174182
174143
|
} finally {
|
174183
174144
|
output2.stopSpinner();
|
@@ -174185,7 +174146,7 @@ async function getDeploymentByIdOrURL({
|
|
174185
174146
|
if (deployment.team?.id) {
|
174186
174147
|
if (!team || deployment.team.id !== team.id) {
|
174187
174148
|
const err = new Error(
|
174188
|
-
team ? `Deployment doesn't belong to current team ${
|
174149
|
+
team ? `Deployment doesn't belong to current team ${import_chalk102.default.bold(
|
174189
174150
|
contextName
|
174190
174151
|
)}` : `Deployment belongs to a different team`
|
174191
174152
|
);
|
@@ -174194,18 +174155,18 @@ async function getDeploymentByIdOrURL({
|
|
174194
174155
|
}
|
174195
174156
|
} else if (team) {
|
174196
174157
|
const err = new Error(
|
174197
|
-
`Deployment doesn't belong to current team ${
|
174158
|
+
`Deployment doesn't belong to current team ${import_chalk102.default.bold(contextName)}`
|
174198
174159
|
);
|
174199
174160
|
err.code = "ERR_INVALID_TEAM";
|
174200
174161
|
throw err;
|
174201
174162
|
}
|
174202
174163
|
return deployment;
|
174203
174164
|
}
|
174204
|
-
var
|
174165
|
+
var import_chalk102;
|
174205
174166
|
var init_get_deployment_by_id_or_url = __esm({
|
174206
174167
|
"src/util/deploy/get-deployment-by-id-or-url.ts"() {
|
174207
174168
|
"use strict";
|
174208
|
-
|
174169
|
+
import_chalk102 = __toESM3(require_source());
|
174209
174170
|
init_get_deployment();
|
174210
174171
|
init_get_team_by_id();
|
174211
174172
|
init_is_valid_name();
|
@@ -174308,14 +174269,14 @@ async function redeploy(client2) {
|
|
174308
174269
|
const previewUrl = `https://${deployment.url}`;
|
174309
174270
|
output2.print(
|
174310
174271
|
`${prependEmoji(
|
174311
|
-
`Inspect: ${
|
174272
|
+
`Inspect: ${import_chalk103.default.bold(deployment.inspectorUrl)} ${deployStamp()}`,
|
174312
174273
|
emoji("inspect")
|
174313
174274
|
)}
|
174314
174275
|
`
|
174315
174276
|
);
|
174316
174277
|
output2.print(
|
174317
174278
|
prependEmoji(
|
174318
|
-
`${isProdDeployment ? "Production" : "Preview"}: ${
|
174279
|
+
`${isProdDeployment ? "Production" : "Preview"}: ${import_chalk103.default.bold(
|
174319
174280
|
previewUrl
|
174320
174281
|
)} ${deployStamp()}`,
|
174321
174282
|
emoji("success")
|
@@ -174385,17 +174346,17 @@ async function redeploy(client2) {
|
|
174385
174346
|
output2.prettyError(err);
|
174386
174347
|
if ((0, import_error_utils28.isErrnoException)(err) && err.code === "ERR_INVALID_TEAM") {
|
174387
174348
|
output2.error(
|
174388
|
-
`Use ${
|
174349
|
+
`Use ${import_chalk103.default.bold("vc switch")} to change your current team`
|
174389
174350
|
);
|
174390
174351
|
}
|
174391
174352
|
return 1;
|
174392
174353
|
}
|
174393
174354
|
}
|
174394
|
-
var
|
174355
|
+
var import_chalk103, import_client12, import_error_utils28;
|
174395
174356
|
var init_redeploy = __esm({
|
174396
174357
|
"src/commands/redeploy/index.ts"() {
|
174397
174358
|
"use strict";
|
174398
|
-
|
174359
|
+
import_chalk103 = __toESM3(require_source());
|
174399
174360
|
import_client12 = __toESM3(require_dist10());
|
174400
174361
|
init_emoji();
|
174401
174362
|
init_get_args();
|
@@ -174597,7 +174558,7 @@ async function remove3(client2) {
|
|
174597
174558
|
}
|
174598
174559
|
const { contextName } = await getScope(client2);
|
174599
174560
|
output2.spinner(
|
174600
|
-
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${
|
174561
|
+
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk104.default.bold(contextName)}`
|
174601
174562
|
);
|
174602
174563
|
let aliases;
|
174603
174564
|
let projects;
|
@@ -174663,12 +174624,12 @@ async function remove3(client2) {
|
|
174663
174624
|
});
|
174664
174625
|
if (deployments.length === 0 && projects.length === 0) {
|
174665
174626
|
log2(
|
174666
|
-
`Could not find ${argv2["--safe"] ? "unaliased" : "any"} deployments or projects matching ${ids.map((id) =>
|
174627
|
+
`Could not find ${argv2["--safe"] ? "unaliased" : "any"} deployments or projects matching ${ids.map((id) => import_chalk104.default.bold(`"${id}"`)).join(", ")}. Run ${getCommandName("ls")} to list.`
|
174667
174628
|
);
|
174668
174629
|
return 1;
|
174669
174630
|
}
|
174670
174631
|
log2(
|
174671
|
-
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${
|
174632
|
+
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk104.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
|
174672
174633
|
);
|
174673
174634
|
if (deployments.length > 200) {
|
174674
174635
|
output2.warn(
|
@@ -174695,10 +174656,10 @@ async function remove3(client2) {
|
|
174695
174656
|
`Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
|
174696
174657
|
);
|
174697
174658
|
deployments.forEach((depl) => {
|
174698
|
-
console.log(`${
|
174659
|
+
console.log(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(depl.url)}`);
|
174699
174660
|
});
|
174700
174661
|
projects.forEach((project) => {
|
174701
|
-
console.log(`${
|
174662
|
+
console.log(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(project.name)}`);
|
174702
174663
|
});
|
174703
174664
|
return 0;
|
174704
174665
|
}
|
@@ -174714,8 +174675,8 @@ function readConfirmation4(deployments, projects, output2) {
|
|
174714
174675
|
);
|
174715
174676
|
const deploymentTable = (0, import_text_table11.default)(
|
174716
174677
|
deployments.map((depl) => {
|
174717
|
-
const time =
|
174718
|
-
const url3 = depl.url ?
|
174678
|
+
const time = import_chalk104.default.gray(`${(0, import_ms24.default)(Date.now() - depl.createdAt)} ago`);
|
174679
|
+
const url3 = depl.url ? import_chalk104.default.underline(`https://${depl.url}`) : "";
|
174719
174680
|
return [` ${depl.id}`, url3, time];
|
174720
174681
|
}),
|
174721
174682
|
{ align: ["l", "r", "l"], hsep: " ".repeat(6) }
|
@@ -174726,7 +174687,7 @@ function readConfirmation4(deployments, projects, output2) {
|
|
174726
174687
|
for (const depl of deployments) {
|
174727
174688
|
for (const { alias: alias2 } of depl.aliases) {
|
174728
174689
|
output2.warn(
|
174729
|
-
`${
|
174690
|
+
`${import_chalk104.default.underline(`https://${alias2}`)} is an alias for ${import_chalk104.default.bold(depl.url)} and will be removed`
|
174730
174691
|
);
|
174731
174692
|
}
|
174732
174693
|
}
|
@@ -174739,11 +174700,11 @@ function readConfirmation4(deployments, projects, output2) {
|
|
174739
174700
|
)} will be permanently removed, including all ${projects.length > 1 ? "their" : "its"} deployments and aliases:`
|
174740
174701
|
);
|
174741
174702
|
for (const project of projects) {
|
174742
|
-
console.log(`${
|
174703
|
+
console.log(`${import_chalk104.default.gray("-")} ${import_chalk104.default.bold(project.name)}`);
|
174743
174704
|
}
|
174744
174705
|
}
|
174745
174706
|
output2.print(
|
174746
|
-
`${
|
174707
|
+
`${import_chalk104.default.bold.red("> Are you sure?")} ${import_chalk104.default.gray("(y/N) ")}`
|
174747
174708
|
);
|
174748
174709
|
process.stdin.on("data", (d) => {
|
174749
174710
|
process.stdin.pause();
|
@@ -174760,11 +174721,11 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
174760
174721
|
}
|
174761
174722
|
return `${(0, import_pluralize11.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize11.default)("project", projects.length, true)}`;
|
174762
174723
|
}
|
174763
|
-
var
|
174724
|
+
var import_chalk104, import_ms24, import_pluralize11, import_text_table11;
|
174764
174725
|
var init_remove = __esm({
|
174765
174726
|
"src/commands/remove/index.ts"() {
|
174766
174727
|
"use strict";
|
174767
|
-
|
174728
|
+
import_chalk104 = __toESM3(require_source());
|
174768
174729
|
import_ms24 = __toESM3(require_ms2());
|
174769
174730
|
import_pluralize11 = __toESM3(require_pluralize());
|
174770
174731
|
import_text_table11 = __toESM3(require_text_table());
|
@@ -174858,7 +174819,7 @@ async function rollbackStatus({
|
|
174858
174819
|
}
|
174859
174820
|
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
174860
174821
|
output2.log(
|
174861
|
-
`The rollback exceeded its deadline - rerun ${
|
174822
|
+
`The rollback exceeded its deadline - rerun ${import_chalk105.default.bold(
|
174862
174823
|
`${packageName} rollback ${toDeploymentId}`
|
174863
174824
|
)} to try again`
|
174864
174825
|
);
|
@@ -174926,26 +174887,26 @@ async function renderJobSucceeded2({
|
|
174926
174887
|
let deploymentInfo = "";
|
174927
174888
|
try {
|
174928
174889
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
174929
|
-
deploymentInfo = `${
|
174890
|
+
deploymentInfo = `${import_chalk105.default.bold(deployment.url)} (${toDeploymentId})`;
|
174930
174891
|
} catch (err) {
|
174931
174892
|
output2.debug(
|
174932
174893
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
174933
174894
|
);
|
174934
|
-
deploymentInfo =
|
174895
|
+
deploymentInfo = import_chalk105.default.bold(toDeploymentId);
|
174935
174896
|
}
|
174936
174897
|
const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
|
174937
174898
|
output2.log(
|
174938
|
-
`Success! ${
|
174899
|
+
`Success! ${import_chalk105.default.bold(
|
174939
174900
|
project.name
|
174940
174901
|
)} was rolled back to ${deploymentInfo} ${duration}`
|
174941
174902
|
);
|
174942
174903
|
return 0;
|
174943
174904
|
}
|
174944
|
-
var
|
174905
|
+
var import_chalk105, import_ms25;
|
174945
174906
|
var init_status2 = __esm({
|
174946
174907
|
"src/commands/rollback/status.ts"() {
|
174947
174908
|
"use strict";
|
174948
|
-
|
174909
|
+
import_chalk105 = __toESM3(require_source());
|
174949
174910
|
init_elapsed();
|
174950
174911
|
init_format_date();
|
174951
174912
|
init_get_deployment();
|
@@ -174978,7 +174939,7 @@ async function requestRollback({
|
|
174978
174939
|
});
|
174979
174940
|
if (timeout !== void 0 && (0, import_ms26.default)(timeout) === 0) {
|
174980
174941
|
output2.log(
|
174981
|
-
`Successfully requested rollback of ${
|
174942
|
+
`Successfully requested rollback of ${import_chalk106.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
174982
174943
|
);
|
174983
174944
|
output2.log(`To check rollback status, run ${getCommandName("rollback")}.`);
|
174984
174945
|
return 0;
|
@@ -174991,11 +174952,11 @@ async function requestRollback({
|
|
174991
174952
|
timeout
|
174992
174953
|
});
|
174993
174954
|
}
|
174994
|
-
var
|
174955
|
+
var import_chalk106, import_ms26;
|
174995
174956
|
var init_request_rollback = __esm({
|
174996
174957
|
"src/commands/rollback/request-rollback.ts"() {
|
174997
174958
|
"use strict";
|
174998
|
-
|
174959
|
+
import_chalk106 = __toESM3(require_source());
|
174999
174960
|
init_pkg_name();
|
175000
174961
|
init_get_project_by_deployment();
|
175001
174962
|
import_ms26 = __toESM3(require_ms2());
|
@@ -175382,7 +175343,7 @@ async function run({ output: output2, contextName, currentTeam, client: client2
|
|
175382
175343
|
if (args2.length > 1) {
|
175383
175344
|
console.error(
|
175384
175345
|
error2(
|
175385
|
-
`Invalid number of arguments. Usage: ${
|
175346
|
+
`Invalid number of arguments. Usage: ${import_chalk107.default.cyan(
|
175386
175347
|
`${getCommandName("secret ls")}`
|
175387
175348
|
)}`
|
175388
175349
|
)
|
@@ -175395,19 +175356,19 @@ async function run({ output: output2, contextName, currentTeam, client: client2
|
|
175395
175356
|
);
|
175396
175357
|
const elapsed2 = (0, import_ms28.default)(Date.now() - start);
|
175397
175358
|
console.log(
|
175398
|
-
`${list5.length > 0 ? "Secrets" : "No secrets"} found under ${
|
175359
|
+
`${list5.length > 0 ? "Secrets" : "No secrets"} found under ${import_chalk107.default.bold(
|
175399
175360
|
contextName
|
175400
|
-
)} ${
|
175361
|
+
)} ${import_chalk107.default.gray(`[${elapsed2}]`)}`
|
175401
175362
|
);
|
175402
175363
|
if (list5.length > 0) {
|
175403
175364
|
const cur = Date.now();
|
175404
|
-
const header = [["", "name", "created"].map((s) =>
|
175365
|
+
const header = [["", "name", "created"].map((s) => import_chalk107.default.dim(s))];
|
175405
175366
|
const out = (0, import_text_table12.default)(
|
175406
175367
|
header.concat(
|
175407
175368
|
list5.map((secret) => [
|
175408
175369
|
"",
|
175409
|
-
|
175410
|
-
|
175370
|
+
import_chalk107.default.bold(secret.name),
|
175371
|
+
import_chalk107.default.gray(`${(0, import_ms28.default)(cur - new Date(secret.created))} ago`)
|
175411
175372
|
])
|
175412
175373
|
),
|
175413
175374
|
{
|
@@ -175439,7 +175400,7 @@ ${out}
|
|
175439
175400
|
if (args2.length !== 1) {
|
175440
175401
|
console.error(
|
175441
175402
|
error2(
|
175442
|
-
`Invalid number of arguments. Usage: ${
|
175403
|
+
`Invalid number of arguments. Usage: ${import_chalk107.default.cyan(
|
175443
175404
|
`${getCommandName("secret rm <name>")}`
|
175444
175405
|
)}`
|
175445
175406
|
)
|
@@ -175457,7 +175418,7 @@ ${out}
|
|
175457
175418
|
} else {
|
175458
175419
|
console.error(
|
175459
175420
|
error2(
|
175460
|
-
`No secret found by name "${args2[0]}" under ${
|
175421
|
+
`No secret found by name "${args2[0]}" under ${import_chalk107.default.bold(
|
175461
175422
|
contextName
|
175462
175423
|
)}`
|
175463
175424
|
)
|
@@ -175467,9 +175428,9 @@ ${out}
|
|
175467
175428
|
const secret = await secrets.rm(args2[0]);
|
175468
175429
|
const elapsed2 = (0, import_ms28.default)(/* @__PURE__ */ new Date() - start);
|
175469
175430
|
console.log(
|
175470
|
-
`${
|
175431
|
+
`${import_chalk107.default.cyan("Success!")} Secret ${import_chalk107.default.bold(
|
175471
175432
|
secret.name
|
175472
|
-
)} under ${
|
175433
|
+
)} under ${import_chalk107.default.bold(contextName)} removed ${import_chalk107.default.gray(`[${elapsed2}]`)}`
|
175473
175434
|
);
|
175474
175435
|
return secrets.close();
|
175475
175436
|
}
|
@@ -175483,7 +175444,7 @@ ${out}
|
|
175483
175444
|
if (args2.length !== 2) {
|
175484
175445
|
console.error(
|
175485
175446
|
error2(
|
175486
|
-
`Invalid number of arguments. Usage: ${
|
175447
|
+
`Invalid number of arguments. Usage: ${import_chalk107.default.cyan(
|
175487
175448
|
`${getCommandName("secret rename <old-name> <new-name>")}`
|
175488
175449
|
)}`
|
175489
175450
|
)
|
@@ -175493,11 +175454,11 @@ ${out}
|
|
175493
175454
|
const secret = await secrets.rename(args2[0], args2[1]);
|
175494
175455
|
const elapsed2 = (0, import_ms28.default)(/* @__PURE__ */ new Date() - start);
|
175495
175456
|
console.log(
|
175496
|
-
`${
|
175457
|
+
`${import_chalk107.default.cyan("Success!")} Secret ${import_chalk107.default.bold(
|
175497
175458
|
secret.oldName
|
175498
|
-
)} renamed to ${
|
175459
|
+
)} renamed to ${import_chalk107.default.bold(args2[1])} under ${import_chalk107.default.bold(
|
175499
175460
|
contextName
|
175500
|
-
)} ${
|
175461
|
+
)} ${import_chalk107.default.gray(`[${elapsed2}]`)}`
|
175501
175462
|
);
|
175502
175463
|
return secrets.close();
|
175503
175464
|
}
|
@@ -175511,13 +175472,13 @@ ${out}
|
|
175511
175472
|
if (args2.length !== 2) {
|
175512
175473
|
console.error(
|
175513
175474
|
error2(
|
175514
|
-
`Invalid number of arguments. Usage: ${
|
175475
|
+
`Invalid number of arguments. Usage: ${import_chalk107.default.cyan(
|
175515
175476
|
`${getCommandName("secret add <name> <value>")}`
|
175516
175477
|
)}`
|
175517
175478
|
)
|
175518
175479
|
);
|
175519
175480
|
if (args2.length > 2) {
|
175520
|
-
const example =
|
175481
|
+
const example = import_chalk107.default.cyan(
|
175521
175482
|
`$ ${getCommandName('secret add -- "${args[0]}"')}`
|
175522
175483
|
);
|
175523
175484
|
console.log(
|
@@ -175529,7 +175490,7 @@ ${out}
|
|
175529
175490
|
}
|
175530
175491
|
const [name, value] = args2;
|
175531
175492
|
if (typeof value === "boolean") {
|
175532
|
-
const example =
|
175493
|
+
const example = import_chalk107.default.cyan(
|
175533
175494
|
`$ ${getCommandName('secret add -- "${name}"')}`
|
175534
175495
|
);
|
175535
175496
|
console.log(
|
@@ -175544,9 +175505,9 @@ ${out}
|
|
175544
175505
|
output2.warn(`Your secret name was converted to lower-case`);
|
175545
175506
|
}
|
175546
175507
|
console.log(
|
175547
|
-
`${
|
175508
|
+
`${import_chalk107.default.cyan("Success!")} Secret ${import_chalk107.default.bold(
|
175548
175509
|
name.toLowerCase()
|
175549
|
-
)} added under ${
|
175510
|
+
)} added under ${import_chalk107.default.bold(contextName)} ${import_chalk107.default.gray(`[${elapsed2}]`)}`
|
175550
175511
|
);
|
175551
175512
|
return secrets.close();
|
175552
175513
|
}
|
@@ -175557,27 +175518,27 @@ ${out}
|
|
175557
175518
|
return 2;
|
175558
175519
|
}
|
175559
175520
|
async function readConfirmation5(client2, output2, secret, contextName) {
|
175560
|
-
const time =
|
175561
|
-
const tbl = (0, import_text_table12.default)([[
|
175521
|
+
const time = import_chalk107.default.gray(`${(0, import_ms28.default)(/* @__PURE__ */ new Date() - new Date(secret.created))} ago`);
|
175522
|
+
const tbl = (0, import_text_table12.default)([[import_chalk107.default.bold(secret.name), time]], {
|
175562
175523
|
align: ["r", "l"],
|
175563
175524
|
hsep: " ".repeat(6)
|
175564
175525
|
});
|
175565
175526
|
output2.print(
|
175566
|
-
`The following secret will be removed permanently from ${
|
175527
|
+
`The following secret will be removed permanently from ${import_chalk107.default.bold(
|
175567
175528
|
contextName
|
175568
175529
|
)}
|
175569
175530
|
`
|
175570
175531
|
);
|
175571
175532
|
output2.print(` ${tbl}
|
175572
175533
|
`);
|
175573
|
-
return confirm(client2, `${
|
175534
|
+
return confirm(client2, `${import_chalk107.default.bold.red("Are you sure?")}`, false);
|
175574
175535
|
}
|
175575
|
-
var import_error_utils30,
|
175536
|
+
var import_error_utils30, import_chalk107, import_text_table12, import_ms28, argv, subcommand, nextTimestamp, main11, secrets_default;
|
175576
175537
|
var init_secrets2 = __esm({
|
175577
175538
|
"src/commands/secrets/index.js"() {
|
175578
175539
|
"use strict";
|
175579
175540
|
import_error_utils30 = __toESM3(require_dist2());
|
175580
|
-
|
175541
|
+
import_chalk107 = __toESM3(require_source());
|
175581
175542
|
import_text_table12 = __toESM3(require_text_table());
|
175582
175543
|
import_ms28 = __toESM3(require_ms2());
|
175583
175544
|
init_strlen();
|
@@ -175646,18 +175607,18 @@ function table13(fieldNames = [], data = [], margins = [], print) {
|
|
175646
175607
|
}),
|
175647
175608
|
fieldNames.map((col) => col.length)
|
175648
175609
|
).map((size, i) => i < margins.length && size + margins[i] || size);
|
175649
|
-
print(
|
175610
|
+
print(import_chalk108.default.grey(printLine(fieldNames, sizes)));
|
175650
175611
|
print("\n");
|
175651
175612
|
for (const row of data) {
|
175652
175613
|
print(printLine(row, sizes));
|
175653
175614
|
print("\n");
|
175654
175615
|
}
|
175655
175616
|
}
|
175656
|
-
var
|
175617
|
+
var import_chalk108, printLine;
|
175657
175618
|
var init_table = __esm({
|
175658
175619
|
"src/util/output/table.ts"() {
|
175659
175620
|
"use strict";
|
175660
|
-
|
175621
|
+
import_chalk108 = __toESM3(require_source());
|
175661
175622
|
printLine = (data, sizes) => data.reduce((line, col, i) => line + col.padEnd(sizes[i]), "");
|
175662
175623
|
}
|
175663
175624
|
});
|
@@ -175747,12 +175708,12 @@ var init_list4 = __esm({
|
|
175747
175708
|
});
|
175748
175709
|
|
175749
175710
|
// src/util/output/note.ts
|
175750
|
-
var
|
175711
|
+
var import_chalk109, note_default;
|
175751
175712
|
var init_note = __esm({
|
175752
175713
|
"src/util/output/note.ts"() {
|
175753
175714
|
"use strict";
|
175754
|
-
|
175755
|
-
note_default = (msg) => `${(0,
|
175715
|
+
import_chalk109 = __toESM3(require_source());
|
175716
|
+
note_default = (msg) => `${(0, import_chalk109.yellow)("> NOTE:")} ${msg}`;
|
175756
175717
|
}
|
175757
175718
|
});
|
175758
175719
|
|
@@ -175803,7 +175764,7 @@ Please select a team scope using ${getCommandName(
|
|
175803
175764
|
return 1;
|
175804
175765
|
}
|
175805
175766
|
output2.log(
|
175806
|
-
introMsg || `Inviting team members to ${
|
175767
|
+
introMsg || `Inviting team members to ${import_chalk110.default.bold(currentTeam.name)}`
|
175807
175768
|
);
|
175808
175769
|
if (emails.length > 0) {
|
175809
175770
|
for (const email3 of emails) {
|
@@ -175822,10 +175783,10 @@ Please select a team scope using ${getCommandName(
|
|
175822
175783
|
throw err;
|
175823
175784
|
}
|
175824
175785
|
output2.log(
|
175825
|
-
`${
|
175786
|
+
`${import_chalk110.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
|
175826
175787
|
);
|
175827
175788
|
} else {
|
175828
|
-
output2.log(`${
|
175789
|
+
output2.log(`${import_chalk110.default.red(`\u2716 ${email3}`)} ${import_chalk110.default.gray("[invalid]")}`);
|
175829
175790
|
}
|
175830
175791
|
}
|
175831
175792
|
return 0;
|
@@ -175859,15 +175820,15 @@ Please select a team scope using ${getCommandName(
|
|
175859
175820
|
);
|
175860
175821
|
email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
|
175861
175822
|
emails.push(email2);
|
175862
|
-
output2.log(`${
|
175823
|
+
output2.log(`${import_chalk110.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
|
175863
175824
|
if (hasError) {
|
175864
175825
|
hasError = false;
|
175865
175826
|
process.stderr.write(eraseLines(emails.length + 2));
|
175866
175827
|
output2.log(
|
175867
|
-
introMsg || `Inviting team members to ${
|
175828
|
+
introMsg || `Inviting team members to ${import_chalk110.default.bold(currentTeam.name)}`
|
175868
175829
|
);
|
175869
175830
|
for (const email3 of emails) {
|
175870
|
-
output2.log(`${
|
175831
|
+
output2.log(`${import_chalk110.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
175871
175832
|
}
|
175872
175833
|
}
|
175873
175834
|
} catch (err) {
|
@@ -175876,7 +175837,7 @@ Please select a team scope using ${getCommandName(
|
|
175876
175837
|
output2.error((0, import_error_utils31.errorToString)(err));
|
175877
175838
|
hasError = true;
|
175878
175839
|
for (const email3 of emails) {
|
175879
|
-
output2.log(`${
|
175840
|
+
output2.log(`${import_chalk110.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
175880
175841
|
}
|
175881
175842
|
}
|
175882
175843
|
}
|
@@ -175889,16 +175850,16 @@ Please select a team scope using ${getCommandName(
|
|
175889
175850
|
} else {
|
175890
175851
|
output2.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
|
175891
175852
|
for (const email3 of emails) {
|
175892
|
-
output2.log(`${
|
175853
|
+
output2.log(`${import_chalk110.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
175893
175854
|
}
|
175894
175855
|
}
|
175895
175856
|
return 0;
|
175896
175857
|
}
|
175897
|
-
var
|
175858
|
+
var import_chalk110, import_error_utils31, validateEmail2, domains, emailAutoComplete;
|
175898
175859
|
var init_invite = __esm({
|
175899
175860
|
"src/commands/teams/invite.ts"() {
|
175900
175861
|
"use strict";
|
175901
|
-
|
175862
|
+
import_chalk110 = __toESM3(require_source());
|
175902
175863
|
init_cmd();
|
175903
175864
|
init_stamp();
|
175904
175865
|
init_param();
|
@@ -175987,7 +175948,7 @@ async function add7(client2) {
|
|
175987
175948
|
let elapsed2;
|
175988
175949
|
const { output: output2 } = client2;
|
175989
175950
|
output2.log(
|
175990
|
-
`Pick a team identifier for its URL (e.g.: ${
|
175951
|
+
`Pick a team identifier for its URL (e.g.: ${import_chalk111.default.cyan(
|
175991
175952
|
"`vercel.com/acme`"
|
175992
175953
|
)})`
|
175993
175954
|
);
|
@@ -176020,7 +175981,7 @@ async function add7(client2) {
|
|
176020
175981
|
output2.stopSpinner();
|
176021
175982
|
process.stdout.write(eraseLines(2));
|
176022
175983
|
output2.success(`Team created ${elapsed2()}`);
|
176023
|
-
output2.log(`${
|
175984
|
+
output2.log(`${import_chalk111.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
|
176024
175985
|
`);
|
176025
175986
|
output2.log("Pick a display name for your team");
|
176026
175987
|
let name;
|
@@ -176043,7 +176004,7 @@ async function add7(client2) {
|
|
176043
176004
|
process.stdout.write(eraseLines(2));
|
176044
176005
|
team = Object.assign(team, res);
|
176045
176006
|
output2.success(`Team name saved ${elapsed2()}`);
|
176046
|
-
output2.log(`${
|
176007
|
+
output2.log(`${import_chalk111.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
|
176047
176008
|
`);
|
176048
176009
|
output2.spinner("Saving");
|
176049
176010
|
client2.config.currentTeam = team.id;
|
@@ -176057,11 +176018,11 @@ async function add7(client2) {
|
|
176057
176018
|
});
|
176058
176019
|
return gracefulExit();
|
176059
176020
|
}
|
176060
|
-
var
|
176021
|
+
var import_chalk111, import_error_utils32, validateSlugKeypress, validateNameKeypress, gracefulExit, teamUrlPrefix, teamNamePrefix;
|
176061
176022
|
var init_add6 = __esm({
|
176062
176023
|
"src/commands/teams/add.ts"() {
|
176063
176024
|
"use strict";
|
176064
|
-
|
176025
|
+
import_chalk111 = __toESM3(require_source());
|
176065
176026
|
init_stamp();
|
176066
176027
|
init_info();
|
176067
176028
|
init_erase_lines();
|
@@ -176094,7 +176055,7 @@ var init_add6 = __esm({
|
|
176094
176055
|
);
|
176095
176056
|
return 0;
|
176096
176057
|
};
|
176097
|
-
teamUrlPrefix = "Team URL".padEnd(14) +
|
176058
|
+
teamUrlPrefix = "Team URL".padEnd(14) + import_chalk111.default.gray("vercel.com/");
|
176098
176059
|
teamNamePrefix = "Team Name".padEnd(14);
|
176099
176060
|
}
|
176100
176061
|
});
|
@@ -176117,7 +176078,7 @@ async function main12(client2, desiredSlug) {
|
|
176117
176078
|
let title7 = `${team.name} (${team.slug})`;
|
176118
176079
|
const selected = team.id === currentTeam?.id;
|
176119
176080
|
if (selected) {
|
176120
|
-
title7 += ` ${
|
176081
|
+
title7 += ` ${import_chalk112.default.bold("(current)")}`;
|
176121
176082
|
}
|
176122
176083
|
if (team.limited) {
|
176123
176084
|
title7 += ` ${emoji("locked")}`;
|
@@ -176129,7 +176090,7 @@ async function main12(client2, desiredSlug) {
|
|
176129
176090
|
selected
|
176130
176091
|
};
|
176131
176092
|
});
|
176132
|
-
let suffix = personalScopeSelected ? ` ${
|
176093
|
+
let suffix = personalScopeSelected ? ` ${import_chalk112.default.bold("(current)")}` : "";
|
176133
176094
|
if (user.limited) {
|
176134
176095
|
suffix += ` ${emoji("locked")}`;
|
176135
176096
|
}
|
@@ -176175,14 +176136,14 @@ async function main12(client2, desiredSlug) {
|
|
176175
176136
|
}
|
176176
176137
|
updateCurrentTeam(config3);
|
176177
176138
|
output2.success(
|
176178
|
-
`Your account (${
|
176139
|
+
`Your account (${import_chalk112.default.bold(user.username)}) is now active!`
|
176179
176140
|
);
|
176180
176141
|
return 0;
|
176181
176142
|
}
|
176182
176143
|
const newTeam = teams.find((team) => team.slug === desiredSlug);
|
176183
176144
|
if (!newTeam) {
|
176184
176145
|
output2.error(
|
176185
|
-
`You do not have permission to access scope ${
|
176146
|
+
`You do not have permission to access scope ${import_chalk112.default.bold(desiredSlug)}.`
|
176186
176147
|
);
|
176187
176148
|
return 1;
|
176188
176149
|
}
|
@@ -176200,15 +176161,15 @@ async function main12(client2, desiredSlug) {
|
|
176200
176161
|
}
|
176201
176162
|
updateCurrentTeam(config3, newTeam);
|
176202
176163
|
output2.success(
|
176203
|
-
`The team ${
|
176164
|
+
`The team ${import_chalk112.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
|
176204
176165
|
);
|
176205
176166
|
return 0;
|
176206
176167
|
}
|
176207
|
-
var
|
176168
|
+
var import_chalk112, updateCurrentTeam;
|
176208
176169
|
var init_switch = __esm({
|
176209
176170
|
"src/commands/teams/switch.ts"() {
|
176210
176171
|
"use strict";
|
176211
|
-
|
176172
|
+
import_chalk112 = __toESM3(require_source());
|
176212
176173
|
init_emoji();
|
176213
176174
|
init_get_user();
|
176214
176175
|
init_get_teams();
|
@@ -176435,7 +176396,7 @@ var import_error_utils33 = __toESM3(require_dist2());
|
|
176435
176396
|
var import_path43 = require("path");
|
176436
176397
|
var import_fs9 = require("fs");
|
176437
176398
|
var import_fs_extra23 = __toESM3(require_lib());
|
176438
|
-
var
|
176399
|
+
var import_chalk113 = __toESM3(require_source());
|
176439
176400
|
var import_epipebomb = __toESM3(require_epipebomb());
|
176440
176401
|
|
176441
176402
|
// src/util/get-latest-version/index.ts
|
@@ -177227,12 +177188,12 @@ var main13 = async () => {
|
|
177227
177188
|
const betaCommands = [];
|
177228
177189
|
if (betaCommands.includes(targetOrSubcommand)) {
|
177229
177190
|
console.log(
|
177230
|
-
`${
|
177191
|
+
`${import_chalk113.default.grey(
|
177231
177192
|
`${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
|
177232
177193
|
)}`
|
177233
177194
|
);
|
177234
177195
|
} else {
|
177235
|
-
output.print(`${
|
177196
|
+
output.print(`${import_chalk113.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
|
177236
177197
|
`);
|
177237
177198
|
}
|
177238
177199
|
if (!targetOrSubcommand && argv2["--version"]) {
|
@@ -177697,20 +177658,20 @@ main13().then(async (exitCode) => {
|
|
177697
177658
|
});
|
177698
177659
|
if (latest) {
|
177699
177660
|
const changelog = "https://github.com/vercel/vercel/releases";
|
177700
|
-
const errorMsg = exitCode && exitCode !== 2 ?
|
177661
|
+
const errorMsg = exitCode && exitCode !== 2 ? import_chalk113.default.magenta(
|
177701
177662
|
`
|
177702
177663
|
|
177703
|
-
The latest update ${
|
177664
|
+
The latest update ${import_chalk113.default.italic(
|
177704
177665
|
"may"
|
177705
177666
|
)} fix any errors that occurred.`
|
177706
177667
|
) : "";
|
177707
177668
|
output.print(
|
177708
177669
|
box(
|
177709
|
-
`Update available! ${
|
177670
|
+
`Update available! ${import_chalk113.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk113.default.green(
|
177710
177671
|
`v${latest}`
|
177711
177672
|
)}
|
177712
177673
|
Changelog: ${output.link(changelog, changelog, { fallback: false })}
|
177713
|
-
Run ${
|
177674
|
+
Run ${import_chalk113.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
|
177714
177675
|
)
|
177715
177676
|
);
|
177716
177677
|
output.print("\n\n");
|