@socketsecurity/cli 0.14.26 → 0.14.27

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/vendor.js CHANGED
@@ -2,18 +2,15 @@
2
2
 
3
3
  var require$$1$1 = require('node:path');
4
4
  var require$$8 = require('node:url');
5
- var require$$0 = require('node:process');
5
+ var require$$0 = require('node:fs');
6
6
  var require$$1 = require('node:os');
7
- var require$$2 = require('node:tty');
8
- var require$$0$1 = require('node:fs');
7
+ var require$$0$1 = require('node:process');
9
8
  var require$$0$2 = require('node:util');
10
- var require$$2$1 = require('signal-exit');
11
- var require$$3 = require('cli-spinners');
12
- var require$$2$2 = require('emoji-regex');
13
- var require$$1$2 = require('supports-hyperlinks');
9
+ var require$$0$3 = require('supports-color');
10
+ var require$$1$2 = require('has-flag');
14
11
  var require$$1$3 = require('node:fs/promises');
15
- var require$$2$4 = require('node:buffer');
16
- var require$$2$3 = require('node:child_process');
12
+ var require$$2$1 = require('node:buffer');
13
+ var require$$2 = require('node:child_process');
17
14
 
18
15
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
19
16
  var interopRequireWildcard = {};
@@ -77,632 +74,6 @@ function _interopRequireDefault(e) {
77
74
  };
78
75
  }
79
76
 
80
- var source = {};
81
-
82
- var ansiStyles$1 = {};
83
-
84
- Object.defineProperty(ansiStyles$1, "__esModule", {
85
- value: true
86
- });
87
- ansiStyles$1.modifierNames = ansiStyles$1.foregroundColorNames = ansiStyles$1.default = ansiStyles$1.colorNames = ansiStyles$1.backgroundColorNames = void 0;
88
- const ANSI_BACKGROUND_OFFSET = 10;
89
- const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
90
- const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
91
- const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
92
- const styles = {
93
- modifier: {
94
- reset: [0, 0],
95
- // 21 isn't widely supported and 22 does the same thing
96
- bold: [1, 22],
97
- dim: [2, 22],
98
- italic: [3, 23],
99
- underline: [4, 24],
100
- overline: [53, 55],
101
- inverse: [7, 27],
102
- hidden: [8, 28],
103
- strikethrough: [9, 29]
104
- },
105
- color: {
106
- black: [30, 39],
107
- red: [31, 39],
108
- green: [32, 39],
109
- yellow: [33, 39],
110
- blue: [34, 39],
111
- magenta: [35, 39],
112
- cyan: [36, 39],
113
- white: [37, 39],
114
- // Bright color
115
- blackBright: [90, 39],
116
- gray: [90, 39],
117
- // Alias of `blackBright`
118
- grey: [90, 39],
119
- // Alias of `blackBright`
120
- redBright: [91, 39],
121
- greenBright: [92, 39],
122
- yellowBright: [93, 39],
123
- blueBright: [94, 39],
124
- magentaBright: [95, 39],
125
- cyanBright: [96, 39],
126
- whiteBright: [97, 39]
127
- },
128
- bgColor: {
129
- bgBlack: [40, 49],
130
- bgRed: [41, 49],
131
- bgGreen: [42, 49],
132
- bgYellow: [43, 49],
133
- bgBlue: [44, 49],
134
- bgMagenta: [45, 49],
135
- bgCyan: [46, 49],
136
- bgWhite: [47, 49],
137
- // Bright color
138
- bgBlackBright: [100, 49],
139
- bgGray: [100, 49],
140
- // Alias of `bgBlackBright`
141
- bgGrey: [100, 49],
142
- // Alias of `bgBlackBright`
143
- bgRedBright: [101, 49],
144
- bgGreenBright: [102, 49],
145
- bgYellowBright: [103, 49],
146
- bgBlueBright: [104, 49],
147
- bgMagentaBright: [105, 49],
148
- bgCyanBright: [106, 49],
149
- bgWhiteBright: [107, 49]
150
- }
151
- };
152
- ansiStyles$1.modifierNames = Object.keys(styles.modifier);
153
- const foregroundColorNames = ansiStyles$1.foregroundColorNames = Object.keys(styles.color);
154
- const backgroundColorNames = ansiStyles$1.backgroundColorNames = Object.keys(styles.bgColor);
155
- ansiStyles$1.colorNames = [...foregroundColorNames, ...backgroundColorNames];
156
- function assembleStyles() {
157
- const codes = new Map();
158
- for (const [groupName, group] of Object.entries(styles)) {
159
- for (const [styleName, style] of Object.entries(group)) {
160
- styles[styleName] = {
161
- open: `\u001B[${style[0]}m`,
162
- close: `\u001B[${style[1]}m`
163
- };
164
- group[styleName] = styles[styleName];
165
- codes.set(style[0], style[1]);
166
- }
167
- Object.defineProperty(styles, groupName, {
168
- value: group,
169
- enumerable: false
170
- });
171
- }
172
- Object.defineProperty(styles, 'codes', {
173
- value: codes,
174
- enumerable: false
175
- });
176
- styles.color.close = '\u001B[39m';
177
- styles.bgColor.close = '\u001B[49m';
178
- styles.color.ansi = wrapAnsi16();
179
- styles.color.ansi256 = wrapAnsi256();
180
- styles.color.ansi16m = wrapAnsi16m();
181
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
182
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
183
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
184
-
185
- // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
186
- Object.defineProperties(styles, {
187
- rgbToAnsi256: {
188
- value(red, green, blue) {
189
- // We use the extended greyscale palette here, with the exception of
190
- // black and white. normal palette only has 4 greyscale shades.
191
- if (red === green && green === blue) {
192
- if (red < 8) {
193
- return 16;
194
- }
195
- if (red > 248) {
196
- return 231;
197
- }
198
- return Math.round((red - 8) / 247 * 24) + 232;
199
- }
200
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
201
- },
202
- enumerable: false
203
- },
204
- hexToRgb: {
205
- value(hex) {
206
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
207
- if (!matches) {
208
- return [0, 0, 0];
209
- }
210
- let [colorString] = matches;
211
- if (colorString.length === 3) {
212
- colorString = [...colorString].map(character => character + character).join('');
213
- }
214
- const integer = Number.parseInt(colorString, 16);
215
- return [/* eslint-disable no-bitwise */
216
- integer >> 16 & 0xFF, integer >> 8 & 0xFF, integer & 0xFF
217
- /* eslint-enable no-bitwise */];
218
- },
219
- enumerable: false
220
- },
221
- hexToAnsi256: {
222
- value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
223
- enumerable: false
224
- },
225
- ansi256ToAnsi: {
226
- value(code) {
227
- if (code < 8) {
228
- return 30 + code;
229
- }
230
- if (code < 16) {
231
- return 90 + (code - 8);
232
- }
233
- let red;
234
- let green;
235
- let blue;
236
- if (code >= 232) {
237
- red = ((code - 232) * 10 + 8) / 255;
238
- green = red;
239
- blue = red;
240
- } else {
241
- code -= 16;
242
- const remainder = code % 36;
243
- red = Math.floor(code / 36) / 5;
244
- green = Math.floor(remainder / 6) / 5;
245
- blue = remainder % 6 / 5;
246
- }
247
- const value = Math.max(red, green, blue) * 2;
248
- if (value === 0) {
249
- return 30;
250
- }
251
-
252
- // eslint-disable-next-line no-bitwise
253
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
254
- if (value === 2) {
255
- result += 60;
256
- }
257
- return result;
258
- },
259
- enumerable: false
260
- },
261
- rgbToAnsi: {
262
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
263
- enumerable: false
264
- },
265
- hexToAnsi: {
266
- value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
267
- enumerable: false
268
- }
269
- });
270
- return styles;
271
- }
272
- const ansiStyles = assembleStyles();
273
- ansiStyles$1.default = ansiStyles;
274
-
275
- var supportsColor$1 = {};
276
-
277
- Object.defineProperty(supportsColor$1, "__esModule", {
278
- value: true
279
- });
280
- supportsColor$1.createSupportsColor = createSupportsColor;
281
- supportsColor$1.default = void 0;
282
- var _nodeProcess$g = require$$0;
283
- var _nodeOs$2 = require$$1;
284
- var _nodeTty = require$$2;
285
- // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
286
- /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
287
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : _nodeProcess$g.argv) {
288
- const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
289
- const position = argv.indexOf(prefix + flag);
290
- const terminatorPosition = argv.indexOf('--');
291
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
292
- }
293
- const {
294
- env
295
- } = _nodeProcess$g;
296
- let flagForceColor;
297
- if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) {
298
- flagForceColor = 0;
299
- } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
300
- flagForceColor = 1;
301
- }
302
- function envForceColor() {
303
- if ('FORCE_COLOR' in env) {
304
- if (env.FORCE_COLOR === 'true') {
305
- return 1;
306
- }
307
- if (env.FORCE_COLOR === 'false') {
308
- return 0;
309
- }
310
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
311
- }
312
- }
313
- function translateLevel(level) {
314
- if (level === 0) {
315
- return false;
316
- }
317
- return {
318
- level,
319
- hasBasic: true,
320
- has256: level >= 2,
321
- has16m: level >= 3
322
- };
323
- }
324
- function _supportsColor(haveStream, {
325
- streamIsTTY,
326
- sniffFlags = true
327
- } = {}) {
328
- const noFlagForceColor = envForceColor();
329
- if (noFlagForceColor !== undefined) {
330
- flagForceColor = noFlagForceColor;
331
- }
332
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
333
- if (forceColor === 0) {
334
- return 0;
335
- }
336
- if (sniffFlags) {
337
- if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
338
- return 3;
339
- }
340
- if (hasFlag('color=256')) {
341
- return 2;
342
- }
343
- }
344
-
345
- // Check for Azure DevOps pipelines.
346
- // Has to be above the `!streamIsTTY` check.
347
- if ('TF_BUILD' in env && 'AGENT_NAME' in env) {
348
- return 1;
349
- }
350
- if (haveStream && !streamIsTTY && forceColor === undefined) {
351
- return 0;
352
- }
353
- const min = forceColor || 0;
354
- if (env.TERM === 'dumb') {
355
- return min;
356
- }
357
- if (_nodeProcess$g.platform === 'win32') {
358
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
359
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
360
- const osRelease = _nodeOs$2.release().split('.');
361
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10_586) {
362
- return Number(osRelease[2]) >= 14_931 ? 3 : 2;
363
- }
364
- return 1;
365
- }
366
- if ('CI' in env) {
367
- if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
368
- return 3;
369
- }
370
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
371
- return 1;
372
- }
373
- return min;
374
- }
375
- if ('TEAMCITY_VERSION' in env) {
376
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
377
- }
378
- if (env.COLORTERM === 'truecolor') {
379
- return 3;
380
- }
381
- if (env.TERM === 'xterm-kitty') {
382
- return 3;
383
- }
384
- if ('TERM_PROGRAM' in env) {
385
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
386
- switch (env.TERM_PROGRAM) {
387
- case 'iTerm.app':
388
- {
389
- return version >= 3 ? 3 : 2;
390
- }
391
- case 'Apple_Terminal':
392
- {
393
- return 2;
394
- }
395
- // No default
396
- }
397
- }
398
- if (/-256(color)?$/i.test(env.TERM)) {
399
- return 2;
400
- }
401
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
402
- return 1;
403
- }
404
- if ('COLORTERM' in env) {
405
- return 1;
406
- }
407
- return min;
408
- }
409
- function createSupportsColor(stream, options = {}) {
410
- const level = _supportsColor(stream, {
411
- streamIsTTY: stream && stream.isTTY,
412
- ...options
413
- });
414
- return translateLevel(level);
415
- }
416
- const supportsColor = {
417
- stdout: createSupportsColor({
418
- isTTY: _nodeTty.isatty(1)
419
- }),
420
- stderr: createSupportsColor({
421
- isTTY: _nodeTty.isatty(2)
422
- })
423
- };
424
- supportsColor$1.default = supportsColor;
425
-
426
- var utilities = {};
427
-
428
- Object.defineProperty(utilities, "__esModule", {
429
- value: true
430
- });
431
- utilities.stringEncaseCRLFWithFirstIndex = stringEncaseCRLFWithFirstIndex;
432
- utilities.stringReplaceAll = stringReplaceAll;
433
- // TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
434
- function stringReplaceAll(string, substring, replacer) {
435
- let index = string.indexOf(substring);
436
- if (index === -1) {
437
- return string;
438
- }
439
- const substringLength = substring.length;
440
- let endIndex = 0;
441
- let returnValue = '';
442
- do {
443
- returnValue += string.slice(endIndex, index) + substring + replacer;
444
- endIndex = index + substringLength;
445
- index = string.indexOf(substring, endIndex);
446
- } while (index !== -1);
447
- returnValue += string.slice(endIndex);
448
- return returnValue;
449
- }
450
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
451
- let endIndex = 0;
452
- let returnValue = '';
453
- do {
454
- const gotCR = string[index - 1] === '\r';
455
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
456
- endIndex = index + 1;
457
- index = string.indexOf('\n', endIndex);
458
- } while (index !== -1);
459
- returnValue += string.slice(endIndex);
460
- return returnValue;
461
- }
462
-
463
- (function (exports) {
464
-
465
- Object.defineProperty(exports, "__esModule", {
466
- value: true
467
- });
468
- exports.Chalk = void 0;
469
- Object.defineProperty(exports, "backgroundColorNames", {
470
- enumerable: true,
471
- get: function () {
472
- return _index.backgroundColorNames;
473
- }
474
- });
475
- Object.defineProperty(exports, "backgroundColors", {
476
- enumerable: true,
477
- get: function () {
478
- return _index.backgroundColorNames;
479
- }
480
- });
481
- exports.chalkStderr = void 0;
482
- Object.defineProperty(exports, "colorNames", {
483
- enumerable: true,
484
- get: function () {
485
- return _index.colorNames;
486
- }
487
- });
488
- Object.defineProperty(exports, "colors", {
489
- enumerable: true,
490
- get: function () {
491
- return _index.colorNames;
492
- }
493
- });
494
- exports.default = void 0;
495
- Object.defineProperty(exports, "foregroundColorNames", {
496
- enumerable: true,
497
- get: function () {
498
- return _index.foregroundColorNames;
499
- }
500
- });
501
- Object.defineProperty(exports, "foregroundColors", {
502
- enumerable: true,
503
- get: function () {
504
- return _index.foregroundColorNames;
505
- }
506
- });
507
- Object.defineProperty(exports, "modifierNames", {
508
- enumerable: true,
509
- get: function () {
510
- return _index.modifierNames;
511
- }
512
- });
513
- Object.defineProperty(exports, "modifiers", {
514
- enumerable: true,
515
- get: function () {
516
- return _index.modifierNames;
517
- }
518
- });
519
- exports.supportsColorStderr = exports.supportsColor = void 0;
520
- var _ansiStyles = ansiStyles$1;
521
- var _supportsColor = supportsColor$1;
522
- var _utilities = utilities;
523
- var _index = ansiStyles$1;
524
- const {
525
- stdout: stdoutColor,
526
- stderr: stderrColor
527
- } = _supportsColor.default;
528
- exports.supportsColorStderr = stderrColor;
529
- exports.supportsColor = stdoutColor;
530
- const GENERATOR = Symbol('GENERATOR');
531
- const STYLER = Symbol('STYLER');
532
- const IS_EMPTY = Symbol('IS_EMPTY');
533
-
534
- // `supportsColor.level` → `ansiStyles.color[name]` mapping
535
- const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
536
- const styles = Object.create(null);
537
- const applyOptions = (object, options = {}) => {
538
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
539
- throw new Error('The `level` option should be an integer from 0 to 3');
540
- }
541
-
542
- // Detect level if not set manually
543
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
544
- object.level = options.level === undefined ? colorLevel : options.level;
545
- };
546
- class Chalk {
547
- constructor(options) {
548
- // eslint-disable-next-line no-constructor-return
549
- return chalkFactory(options);
550
- }
551
- }
552
- exports.Chalk = Chalk;
553
- const chalkFactory = options => {
554
- const chalk = (...strings) => strings.join(' ');
555
- applyOptions(chalk, options);
556
- Object.setPrototypeOf(chalk, createChalk.prototype);
557
- return chalk;
558
- };
559
- function createChalk(options) {
560
- return chalkFactory(options);
561
- }
562
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
563
- for (const [styleName, style] of Object.entries(_ansiStyles.default)) {
564
- styles[styleName] = {
565
- get() {
566
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
567
- Object.defineProperty(this, styleName, {
568
- value: builder
569
- });
570
- return builder;
571
- }
572
- };
573
- }
574
- styles.visible = {
575
- get() {
576
- const builder = createBuilder(this, this[STYLER], true);
577
- Object.defineProperty(this, 'visible', {
578
- value: builder
579
- });
580
- return builder;
581
- }
582
- };
583
- const getModelAnsi = (model, level, type, ...arguments_) => {
584
- if (model === 'rgb') {
585
- if (level === 'ansi16m') {
586
- return _ansiStyles.default[type].ansi16m(...arguments_);
587
- }
588
- if (level === 'ansi256') {
589
- return _ansiStyles.default[type].ansi256(_ansiStyles.default.rgbToAnsi256(...arguments_));
590
- }
591
- return _ansiStyles.default[type].ansi(_ansiStyles.default.rgbToAnsi(...arguments_));
592
- }
593
- if (model === 'hex') {
594
- return getModelAnsi('rgb', level, type, ..._ansiStyles.default.hexToRgb(...arguments_));
595
- }
596
- return _ansiStyles.default[type][model](...arguments_);
597
- };
598
- const usedModels = ['rgb', 'hex', 'ansi256'];
599
- for (const model of usedModels) {
600
- styles[model] = {
601
- get() {
602
- const {
603
- level
604
- } = this;
605
- return function (...arguments_) {
606
- const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), _ansiStyles.default.color.close, this[STYLER]);
607
- return createBuilder(this, styler, this[IS_EMPTY]);
608
- };
609
- }
610
- };
611
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
612
- styles[bgModel] = {
613
- get() {
614
- const {
615
- level
616
- } = this;
617
- return function (...arguments_) {
618
- const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), _ansiStyles.default.bgColor.close, this[STYLER]);
619
- return createBuilder(this, styler, this[IS_EMPTY]);
620
- };
621
- }
622
- };
623
- }
624
- const proto = Object.defineProperties(() => {}, {
625
- ...styles,
626
- level: {
627
- enumerable: true,
628
- get() {
629
- return this[GENERATOR].level;
630
- },
631
- set(level) {
632
- this[GENERATOR].level = level;
633
- }
634
- }
635
- });
636
- const createStyler = (open, close, parent) => {
637
- let openAll;
638
- let closeAll;
639
- if (parent === undefined) {
640
- openAll = open;
641
- closeAll = close;
642
- } else {
643
- openAll = parent.openAll + open;
644
- closeAll = close + parent.closeAll;
645
- }
646
- return {
647
- open,
648
- close,
649
- openAll,
650
- closeAll,
651
- parent
652
- };
653
- };
654
- const createBuilder = (self, _styler, _isEmpty) => {
655
- // Single argument is hot path, implicit coercion is faster than anything
656
- // eslint-disable-next-line no-implicit-coercion
657
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? '' + arguments_[0] : arguments_.join(' '));
658
-
659
- // We alter the prototype because we must return a function, but there is
660
- // no way to create a function with a different prototype
661
- Object.setPrototypeOf(builder, proto);
662
- builder[GENERATOR] = self;
663
- builder[STYLER] = _styler;
664
- builder[IS_EMPTY] = _isEmpty;
665
- return builder;
666
- };
667
- const applyStyle = (self, string) => {
668
- if (self.level <= 0 || !string) {
669
- return self[IS_EMPTY] ? '' : string;
670
- }
671
- let styler = self[STYLER];
672
- if (styler === undefined) {
673
- return string;
674
- }
675
- const {
676
- openAll,
677
- closeAll
678
- } = styler;
679
- if (string.includes('\u001B')) {
680
- while (styler !== undefined) {
681
- // Replace any instances already present with a re-opening code
682
- // otherwise only the part of the string until said closing code
683
- // will be colored, and the rest will simply be 'plain'.
684
- string = (0, _utilities.stringReplaceAll)(string, styler.close, styler.open);
685
- styler = styler.parent;
686
- }
687
- }
688
-
689
- // We can move both next actions out of loop, because remaining actions in loop won't have
690
- // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
691
- // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
692
- const lfIndex = string.indexOf('\n');
693
- if (lfIndex !== -1) {
694
- string = (0, _utilities.stringEncaseCRLFWithFirstIndex)(string, closeAll, openAll, lfIndex);
695
- }
696
- return openAll + string + closeAll;
697
- };
698
- Object.defineProperties(createChalk.prototype, styles);
699
- const chalk = createChalk();
700
- exports.chalkStderr = createChalk({
701
- level: stderrColor ? stderrColor.level : 0
702
- });
703
- exports.default = chalk;
704
- } (source));
705
-
706
77
  var dist$1 = {};
707
78
 
708
79
  var store = {};
@@ -794,7 +165,7 @@ Object.defineProperty(node$1, "__esModule", {
794
165
  value: true
795
166
  });
796
167
  node$1.default = void 0;
797
- var _nodeFs$3 = require$$0$1;
168
+ var _nodeFs$3 = require$$0;
798
169
  var _nodeOs$1 = require$$1;
799
170
  var _nodePath$2 = require$$1$1;
800
171
  var _abstract = abstract;
@@ -919,12 +290,12 @@ Object.defineProperty(constants, "__esModule", {
919
290
  value: true
920
291
  });
921
292
  constants.IS_WINDOWS = constants.IS_LINUX = void 0;
922
- var _nodeProcess$f = require$$0;
293
+ var _nodeProcess$a = require$$0$1;
923
294
  /* IMPORT */
924
295
 
925
296
  /* MAIN */
926
- constants.IS_LINUX = _nodeProcess$f.platform === 'linux';
927
- constants.IS_WINDOWS = _nodeProcess$f.platform === 'win32';
297
+ constants.IS_LINUX = _nodeProcess$a.platform === 'linux';
298
+ constants.IS_WINDOWS = _nodeProcess$a.platform === 'win32';
928
299
 
929
300
  var signals = {};
930
301
 
@@ -951,7 +322,7 @@ Object.defineProperty(interceptor, "__esModule", {
951
322
  value: true
952
323
  });
953
324
  interceptor.default = void 0;
954
- var _nodeProcess$e = require$$0;
325
+ var _nodeProcess$9 = require$$0$1;
955
326
  var _constants = constants;
956
327
  var _signals = signals;
957
328
  /* IMPORT */
@@ -973,17 +344,17 @@ class Interceptor {
973
344
  if (signal) {
974
345
  if (_constants.IS_WINDOWS && signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL') {
975
346
  // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us
976
- _nodeProcess$e.kill(_nodeProcess$e.pid, 'SIGTERM');
347
+ _nodeProcess$9.kill(_nodeProcess$9.pid, 'SIGTERM');
977
348
  } else {
978
- _nodeProcess$e.kill(_nodeProcess$e.pid, signal);
349
+ _nodeProcess$9.kill(_nodeProcess$9.pid, signal);
979
350
  }
980
351
  }
981
352
  };
982
353
  this.hook = () => {
983
- _nodeProcess$e.once('exit', () => this.exit());
354
+ _nodeProcess$9.once('exit', () => this.exit());
984
355
  for (const signal of _signals.default) {
985
356
  try {
986
- _nodeProcess$e.once(signal, () => this.exit(signal));
357
+ _nodeProcess$9.once(signal, () => this.exit(signal));
987
358
  } catch {
988
359
  // Sometimes "process.once" can throw...
989
360
  }
@@ -1203,11 +574,11 @@ var dependencies = {};
1203
574
  exports.y = void 0;
1204
575
  var _util = _interopRequireWildcard2(require$$0$2, true);
1205
576
  var _path = require$$1$1;
1206
- var _fs = require$$0$1;
577
+ var _fs = require$$0;
1207
578
  var _nodePath = require$$1$1;
1208
- var _nodeProcess = require$$0;
579
+ var _nodeProcess = require$$0$1;
1209
580
  var _nodeUrl = require$$8;
1210
- var _nodeFs = require$$0$1;
581
+ var _nodeFs = require$$0;
1211
582
  var _os = require$$1;
1212
583
  var _url = require$$8;
1213
584
  function camelCase$1(str) {
@@ -9260,7 +8631,7 @@ Object.defineProperty(options, "__esModule", {
9260
8631
  value: true
9261
8632
  });
9262
8633
  options.buildOptions = void 0;
9263
- var _nodeProcess$d = require$$0;
8634
+ var _nodeProcess$8 = require$$0$1;
9264
8635
  var _nodePath$1 = require$$1$1;
9265
8636
  var _nodeUrl$1 = require$$8;
9266
8637
  var _dependencies$2 = dependencies;
@@ -9325,7 +8696,7 @@ const buildOptions = (helpText, options) => {
9325
8696
  });
9326
8697
  const parsedOptions = {
9327
8698
  pkg: foundPackage ? foundPackage.packageJson : {},
9328
- argv: _nodeProcess$d.argv.slice(2),
8699
+ argv: _nodeProcess$8.argv.slice(2),
9329
8700
  flags: {},
9330
8701
  inferType: false,
9331
8702
  input: 'string',
@@ -9424,13 +8795,13 @@ const buildParserOptions = options => {
9424
8795
  };
9425
8796
  parser.buildParserOptions = buildParserOptions;
9426
8797
 
9427
- var validate$2 = {};
8798
+ var validate$1 = {};
9428
8799
 
9429
- Object.defineProperty(validate$2, "__esModule", {
8800
+ Object.defineProperty(validate$1, "__esModule", {
9430
8801
  value: true
9431
8802
  });
9432
- validate$2.validate = validate$2.checkUnknownFlags = validate$2.checkMissingRequiredFlags = void 0;
9433
- var _nodeProcess$c = require$$0;
8803
+ validate$1.validate = validate$1.checkUnknownFlags = validate$1.checkMissingRequiredFlags = void 0;
8804
+ var _nodeProcess$7 = require$$0$1;
9434
8805
  var _utils = utils;
9435
8806
  const validateFlags = (flags, options) => {
9436
8807
  for (const [flagKey, flagValue] of Object.entries(options.flags)) {
@@ -9477,11 +8848,11 @@ const validateChoices = (flags, receivedFlags) => {
9477
8848
  throw new Error(`${errors.join('\n')}`);
9478
8849
  }
9479
8850
  };
9480
- const validate$1 = (flags, options) => {
8851
+ const validate = (flags, options) => {
9481
8852
  validateFlags(flags, options);
9482
8853
  validateChoices(options.flags, flags);
9483
8854
  };
9484
- validate$2.validate = validate$1;
8855
+ validate$1.validate = validate;
9485
8856
  const reportUnknownFlags = unknownFlags => {
9486
8857
  console.error([`Unknown flag${unknownFlags.length > 1 ? 's' : ''}`, ...unknownFlags].join('\n'));
9487
8858
  };
@@ -9489,10 +8860,10 @@ const checkUnknownFlags = input => {
9489
8860
  const unknownFlags = input.filter(item => typeof item === 'string' && item.startsWith('-'));
9490
8861
  if (unknownFlags.length > 0) {
9491
8862
  reportUnknownFlags(unknownFlags);
9492
- _nodeProcess$c.exit(2);
8863
+ _nodeProcess$7.exit(2);
9493
8864
  }
9494
8865
  };
9495
- validate$2.checkUnknownFlags = checkUnknownFlags;
8866
+ validate$1.checkUnknownFlags = checkUnknownFlags;
9496
8867
  const isFlagMissing = (flagName, definedFlags, receivedFlags, input) => {
9497
8868
  const flag = definedFlags[flagName];
9498
8869
  let isFlagRequired = true;
@@ -9528,20 +8899,20 @@ const checkMissingRequiredFlags = (flags, receivedFlags, input) => {
9528
8899
  }
9529
8900
  if (missingRequiredFlags.length > 0) {
9530
8901
  reportMissingRequiredFlags(missingRequiredFlags);
9531
- _nodeProcess$c.exit(2);
8902
+ _nodeProcess$7.exit(2);
9532
8903
  }
9533
8904
  };
9534
- validate$2.checkMissingRequiredFlags = checkMissingRequiredFlags;
8905
+ validate$1.checkMissingRequiredFlags = checkMissingRequiredFlags;
9535
8906
 
9536
8907
  Object.defineProperty(build, "__esModule", {
9537
8908
  value: true
9538
8909
  });
9539
8910
  build.default = void 0;
9540
- var _nodeProcess$b = require$$0;
8911
+ var _nodeProcess$6 = require$$0$1;
9541
8912
  var _dependencies = dependencies;
9542
8913
  var _options = options;
9543
8914
  var _parser = parser;
9544
- var _validate = validate$2;
8915
+ var _validate = validate$1;
9545
8916
  const buildResult = (options, parserOptions) => {
9546
8917
  const {
9547
8918
  pkg: package_
@@ -9568,11 +8939,11 @@ const buildResult = (options, parserOptions) => {
9568
8939
  help = `${description || ''}${help}\n`;
9569
8940
  const showHelp = code => {
9570
8941
  console.log(help);
9571
- _nodeProcess$b.exit(typeof code === 'number' ? code : 2);
8942
+ _nodeProcess$6.exit(typeof code === 'number' ? code : 2);
9572
8943
  };
9573
8944
  const showVersion = () => {
9574
8945
  console.log(typeof options.version === 'string' ? options.version : package_.version);
9575
- _nodeProcess$b.exit(0);
8946
+ _nodeProcess$6.exit(0);
9576
8947
  };
9577
8948
  if (argv._.length === 0 && options.argv.length === 1) {
9578
8949
  if (argv.version === true && options.autoVersion) {
@@ -9616,431 +8987,27 @@ const meow = (helpText, options = {}) => {
9616
8987
  const parsedOptions = (0, _options.buildOptions)(helpText, options);
9617
8988
  const parserOptions = (0, _parser.buildParserOptions)(parsedOptions);
9618
8989
  const result = buildResult(parsedOptions, parserOptions);
9619
- _nodeProcess$b.title = result.pkg.bin ? Object.keys(result.pkg.bin).at(0) : result.pkg.name;
8990
+ _nodeProcess$6.title = result.pkg.bin ? Object.keys(result.pkg.bin).at(0) : result.pkg.name;
9620
8991
  return result;
9621
8992
  };
9622
8993
  build.default = meow;
9623
8994
 
9624
- var ora$1 = {};
9625
-
9626
- var cliCursor$1 = {};
9627
-
9628
- var restoreCursor$1 = {};
9629
-
9630
- var onetime$1 = {};
9631
-
9632
- var mimicFunction$1 = {};
9633
-
9634
- Object.defineProperty(mimicFunction$1, "__esModule", {
9635
- value: true
9636
- });
9637
- mimicFunction$1.default = mimicFunction;
9638
- const copyProperty = (to, from, property, ignoreNonConfigurable) => {
9639
- // `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
9640
- // `Function#prototype` is non-writable and non-configurable so can never be modified.
9641
- if (property === 'length' || property === 'prototype') {
9642
- return;
9643
- }
9644
-
9645
- // `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
9646
- if (property === 'arguments' || property === 'caller') {
9647
- return;
9648
- }
9649
- const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
9650
- const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
9651
- if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
9652
- return;
9653
- }
9654
- Object.defineProperty(to, property, fromDescriptor);
9655
- };
9656
-
9657
- // `Object.defineProperty()` throws if the property exists, is not configurable and either:
9658
- // - one its descriptors is changed
9659
- // - it is non-writable and its value is changed
9660
- const canCopyProperty = function (toDescriptor, fromDescriptor) {
9661
- return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
9662
- };
9663
- const changePrototype = (to, from) => {
9664
- const fromPrototype = Object.getPrototypeOf(from);
9665
- if (fromPrototype === Object.getPrototypeOf(to)) {
9666
- return;
9667
- }
9668
- Object.setPrototypeOf(to, fromPrototype);
9669
- };
9670
- const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`;
9671
- const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
9672
- const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');
9673
-
9674
- // We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.
9675
- // We use `bind()` instead of a closure for the same reason.
9676
- // Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.
9677
- const changeToString = (to, from, name) => {
9678
- const withName = name === '' ? '' : `with ${name.trim()}() `;
9679
- const newToString = wrappedToString.bind(null, withName, from.toString());
9680
- // Ensure `to.toString.toString` is non-enumerable and has the same `same`
9681
- Object.defineProperty(newToString, 'name', toStringName);
9682
- const {
9683
- writable,
9684
- enumerable,
9685
- configurable
9686
- } = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.
9687
- Object.defineProperty(to, 'toString', {
9688
- value: newToString,
9689
- writable,
9690
- enumerable,
9691
- configurable
9692
- });
9693
- };
9694
- function mimicFunction(to, from, {
9695
- ignoreNonConfigurable = false
9696
- } = {}) {
9697
- const {
9698
- name
9699
- } = to;
9700
- for (const property of Reflect.ownKeys(from)) {
9701
- copyProperty(to, from, property, ignoreNonConfigurable);
9702
- }
9703
- changePrototype(to, from);
9704
- changeToString(to, from, name);
9705
- return to;
9706
- }
9707
-
9708
- Object.defineProperty(onetime$1, "__esModule", {
9709
- value: true
9710
- });
9711
- onetime$1.default = void 0;
9712
- var _mimicFunction = mimicFunction$1;
9713
- const calledFunctions = new WeakMap();
9714
- const onetime = (function_, options = {}) => {
9715
- if (typeof function_ !== 'function') {
9716
- throw new TypeError('Expected a function');
9717
- }
9718
- let returnValue;
9719
- let callCount = 0;
9720
- const functionName = function_.displayName || function_.name || '<anonymous>';
9721
- const onetime = function (...arguments_) {
9722
- calledFunctions.set(onetime, ++callCount);
9723
- if (callCount === 1) {
9724
- returnValue = function_.apply(this, arguments_);
9725
- function_ = undefined;
9726
- } else if (options.throw === true) {
9727
- throw new Error(`Function \`${functionName}\` can only be called once`);
9728
- }
9729
- return returnValue;
9730
- };
9731
- (0, _mimicFunction.default)(onetime, function_);
9732
- calledFunctions.set(onetime, callCount);
9733
- return onetime;
9734
- };
9735
- onetime.callCount = function_ => {
9736
- if (!calledFunctions.has(function_)) {
9737
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
9738
- }
9739
- return calledFunctions.get(function_);
9740
- };
9741
- onetime$1.default = onetime;
9742
-
9743
- Object.defineProperty(restoreCursor$1, "__esModule", {
9744
- value: true
9745
- });
9746
- restoreCursor$1.default = void 0;
9747
- var _nodeProcess$a = require$$0;
9748
- var _onetime = onetime$1;
9749
- var _signalExit = require$$2$1;
9750
- const terminal = _nodeProcess$a.stderr.isTTY ? _nodeProcess$a.stderr : _nodeProcess$a.stdout.isTTY ? _nodeProcess$a.stdout : undefined;
9751
- const restoreCursor = terminal ? (0, _onetime.default)(() => {
9752
- (0, _signalExit.onExit)(() => {
9753
- terminal.write('\u001B[?25h');
9754
- }, {
9755
- alwaysLast: true
9756
- });
9757
- }) : () => {};
9758
- restoreCursor$1.default = restoreCursor;
9759
-
9760
- Object.defineProperty(cliCursor$1, "__esModule", {
9761
- value: true
9762
- });
9763
- cliCursor$1.default = void 0;
9764
- var _nodeProcess$9 = require$$0;
9765
- var _restoreCursor = restoreCursor$1;
9766
- let isHidden = false;
9767
- const cliCursor = {};
9768
- cliCursor.show = (writableStream = _nodeProcess$9.stderr) => {
9769
- if (!writableStream.isTTY) {
9770
- return;
9771
- }
9772
- isHidden = false;
9773
- writableStream.write('\u001B[?25h');
9774
- };
9775
- cliCursor.hide = (writableStream = _nodeProcess$9.stderr) => {
9776
- if (!writableStream.isTTY) {
9777
- return;
9778
- }
9779
- (0, _restoreCursor.default)();
9780
- isHidden = true;
9781
- writableStream.write('\u001B[?25l');
9782
- };
9783
- cliCursor.toggle = (force, writableStream) => {
9784
- if (force !== undefined) {
9785
- isHidden = force;
9786
- }
9787
- if (isHidden) {
9788
- cliCursor.show(writableStream);
9789
- } else {
9790
- cliCursor.hide(writableStream);
9791
- }
9792
- };
9793
- cliCursor$1.default = cliCursor;
9794
-
9795
- var logSymbols$1 = {};
9796
-
9797
- var isUnicodeSupported$3 = {};
9798
-
9799
- Object.defineProperty(isUnicodeSupported$3, "__esModule", {
9800
- value: true
9801
- });
9802
- isUnicodeSupported$3.default = isUnicodeSupported$2;
9803
- var _nodeProcess$8 = require$$0;
9804
- function isUnicodeSupported$2() {
9805
- if (_nodeProcess$8.platform !== 'win32') {
9806
- return _nodeProcess$8.env.TERM !== 'linux'; // Linux console (kernel)
9807
- }
9808
- return Boolean(_nodeProcess$8.env.CI) || Boolean(_nodeProcess$8.env.WT_SESSION) // Windows Terminal
9809
- || Boolean(_nodeProcess$8.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
9810
- || _nodeProcess$8.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
9811
- || _nodeProcess$8.env.TERM_PROGRAM === 'Terminus-Sublime' || _nodeProcess$8.env.TERM_PROGRAM === 'vscode' || _nodeProcess$8.env.TERM === 'xterm-256color' || _nodeProcess$8.env.TERM === 'alacritty' || _nodeProcess$8.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
9812
- }
9813
-
9814
- Object.defineProperty(logSymbols$1, "__esModule", {
9815
- value: true
9816
- });
9817
- logSymbols$1.default = void 0;
9818
- var _chalk$1 = source;
9819
- var _isUnicodeSupported$1 = isUnicodeSupported$3;
9820
- const main = {
9821
- info: _chalk$1.default.blue('ℹ'),
9822
- success: _chalk$1.default.green('✔'),
9823
- warning: _chalk$1.default.yellow('⚠'),
9824
- error: _chalk$1.default.red('✖')
9825
- };
9826
- const fallback = {
9827
- info: _chalk$1.default.blue('i'),
9828
- success: _chalk$1.default.green('√'),
9829
- warning: _chalk$1.default.yellow('‼'),
9830
- error: _chalk$1.default.red('×')
9831
- };
9832
- const logSymbols = (0, _isUnicodeSupported$1.default)() ? main : fallback;
9833
- logSymbols$1.default = logSymbols;
9834
-
9835
- var stripAnsi$1 = {};
9836
-
9837
- var ansiRegex$1 = {};
9838
-
9839
- Object.defineProperty(ansiRegex$1, "__esModule", {
9840
- value: true
9841
- });
9842
- ansiRegex$1.default = ansiRegex;
9843
- function ansiRegex({
9844
- onlyFirst = false
9845
- } = {}) {
9846
- // Valid string terminator sequences are BEL, ESC\, and 0x9c
9847
- const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
9848
- const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))'].join('|');
9849
- return new RegExp(pattern, onlyFirst ? undefined : 'g');
9850
- }
9851
-
9852
- Object.defineProperty(stripAnsi$1, "__esModule", {
9853
- value: true
9854
- });
9855
- stripAnsi$1.default = stripAnsi;
9856
- var _ansiRegex = ansiRegex$1;
9857
- const regex = (0, _ansiRegex.default)();
9858
- function stripAnsi(string) {
9859
- if (typeof string !== 'string') {
9860
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
9861
- }
9862
-
9863
- // Even though the regex is global, we don't need to reset the `.lastIndex`
9864
- // because unlike `.exec()` and `.test()`, `.replace()` does it automatically
9865
- // and doing it manually has a performance penalty.
9866
- return string.replace(regex, '');
9867
- }
9868
-
9869
- var stringWidth$1 = {};
9870
-
9871
- var getEastAsianWidth = {};
9872
-
9873
- var lookup = {};
9874
-
9875
- Object.defineProperty(lookup, "__esModule", {
9876
- value: true
9877
- });
9878
- lookup.getCategory = getCategory;
9879
- lookup.isAmbiguous = isAmbiguous;
9880
- lookup.isFullWidth = isFullWidth;
9881
- lookup.isWide = isWide;
9882
- // Generated code.
9883
-
9884
- function isAmbiguous(x) {
9885
- return x === 0xA1 || x === 0xA4 || x === 0xA7 || x === 0xA8 || x === 0xAA || x === 0xAD || x === 0xAE || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || x === 0xC6 || x === 0xD0 || x === 0xD7 || x === 0xD8 || x >= 0xDE && x <= 0xE1 || x === 0xE6 || x >= 0xE8 && x <= 0xEA || x === 0xEC || x === 0xED || x === 0xF0 || x === 0xF2 || x === 0xF3 || x >= 0xF7 && x <= 0xFA || x === 0xFC || x === 0xFE || x === 0x101 || x === 0x111 || x === 0x113 || x === 0x11B || x === 0x126 || x === 0x127 || x === 0x12B || x >= 0x131 && x <= 0x133 || x === 0x138 || x >= 0x13F && x <= 0x142 || x === 0x144 || x >= 0x148 && x <= 0x14B || x === 0x14D || x === 0x152 || x === 0x153 || x === 0x166 || x === 0x167 || x === 0x16B || x === 0x1CE || x === 0x1D0 || x === 0x1D2 || x === 0x1D4 || x === 0x1D6 || x === 0x1D8 || x === 0x1DA || x === 0x1DC || x === 0x251 || x === 0x261 || x === 0x2C4 || x === 0x2C7 || x >= 0x2C9 && x <= 0x2CB || x === 0x2CD || x === 0x2D0 || x >= 0x2D8 && x <= 0x2DB || x === 0x2DD || x === 0x2DF || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || x === 0x401 || x >= 0x410 && x <= 0x44F || x === 0x451 || x === 0x2010 || x >= 0x2013 && x <= 0x2016 || x === 0x2018 || x === 0x2019 || x === 0x201C || x === 0x201D || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || x === 0x2030 || x === 0x2032 || x === 0x2033 || x === 0x2035 || x === 0x203B || x === 0x203E || x === 0x2074 || x === 0x207F || x >= 0x2081 && x <= 0x2084 || x === 0x20AC || x === 0x2103 || x === 0x2105 || x === 0x2109 || x === 0x2113 || x === 0x2116 || x === 0x2121 || x === 0x2122 || x === 0x2126 || x === 0x212B || x === 0x2153 || x === 0x2154 || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || x === 0x2189 || x >= 0x2190 && x <= 0x2199 || x === 0x21B8 || x === 0x21B9 || x === 0x21D2 || x === 0x21D4 || x === 0x21E7 || x === 0x2200 || x === 0x2202 || x === 0x2203 || x === 0x2207 || x === 0x2208 || x === 0x220B || x === 0x220F || x === 0x2211 || x === 0x2215 || x === 0x221A || x >= 0x221D && x <= 0x2220 || x === 0x2223 || x === 0x2225 || x >= 0x2227 && x <= 0x222C || x === 0x222E || x >= 0x2234 && x <= 0x2237 || x === 0x223C || x === 0x223D || x === 0x2248 || x === 0x224C || x === 0x2252 || x === 0x2260 || x === 0x2261 || x >= 0x2264 && x <= 0x2267 || x === 0x226A || x === 0x226B || x === 0x226E || x === 0x226F || x === 0x2282 || x === 0x2283 || x === 0x2286 || x === 0x2287 || x === 0x2295 || x === 0x2299 || x === 0x22A5 || x === 0x22BF || x === 0x2312 || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || x === 0x25A0 || x === 0x25A1 || x >= 0x25A3 && x <= 0x25A9 || x === 0x25B2 || x === 0x25B3 || x === 0x25B6 || x === 0x25B7 || x === 0x25BC || x === 0x25BD || x === 0x25C0 || x === 0x25C1 || x >= 0x25C6 && x <= 0x25C8 || x === 0x25CB || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || x === 0x25EF || x === 0x2605 || x === 0x2606 || x === 0x2609 || x === 0x260E || x === 0x260F || x === 0x261C || x === 0x261E || x === 0x2640 || x === 0x2642 || x === 0x2660 || x === 0x2661 || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || x === 0x266C || x === 0x266D || x === 0x266F || x === 0x269E || x === 0x269F || x === 0x26BF || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || x === 0x26E3 || x === 0x26E8 || x === 0x26E9 || x >= 0x26EB && x <= 0x26F1 || x === 0x26F4 || x >= 0x26F6 && x <= 0x26F9 || x === 0x26FB || x === 0x26FC || x === 0x26FE || x === 0x26FF || x === 0x273D || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || x === 0xFFFD || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || x === 0x1F18F || x === 0x1F190 || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;
9886
- }
9887
- function isFullWidth(x) {
9888
- return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;
9889
- }
9890
- function isWide(x) {
9891
- return x >= 0x1100 && x <= 0x115F || x === 0x231A || x === 0x231B || x === 0x2329 || x === 0x232A || x >= 0x23E9 && x <= 0x23EC || x === 0x23F0 || x === 0x23F3 || x === 0x25FD || x === 0x25FE || x === 0x2614 || x === 0x2615 || x >= 0x2630 && x <= 0x2637 || x >= 0x2648 && x <= 0x2653 || x === 0x267F || x >= 0x268A && x <= 0x268F || x === 0x2693 || x === 0x26A1 || x === 0x26AA || x === 0x26AB || x === 0x26BD || x === 0x26BE || x === 0x26C4 || x === 0x26C5 || x === 0x26CE || x === 0x26D4 || x === 0x26EA || x === 0x26F2 || x === 0x26F3 || x === 0x26F5 || x === 0x26FA || x === 0x26FD || x === 0x2705 || x === 0x270A || x === 0x270B || x === 0x2728 || x === 0x274C || x === 0x274E || x >= 0x2753 && x <= 0x2755 || x === 0x2757 || x >= 0x2795 && x <= 0x2797 || x === 0x27B0 || x === 0x27BF || x === 0x2B1B || x === 0x2B1C || x === 0x2B50 || x === 0x2B55 || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E5 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || x === 0x16FF0 || x === 0x16FF1 || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18CFF && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || x === 0x1AFFD || x === 0x1AFFE || x >= 0x1B000 && x <= 0x1B122 || x === 0x1B132 || x >= 0x1B150 && x <= 0x1B152 || x === 0x1B155 || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || x >= 0x1D300 && x <= 0x1D356 || x >= 0x1D360 && x <= 0x1D376 || x === 0x1F004 || x === 0x1F0CF || x === 0x1F18E || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x === 0x1F250 || x === 0x1F251 || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || x === 0x1F3F4 || x >= 0x1F3F8 && x <= 0x1F43E || x === 0x1F440 || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || x === 0x1F57A || x === 0x1F595 || x === 0x1F596 || x === 0x1F5A4 || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || x === 0x1F6CC || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || x === 0x1F6EB || x === 0x1F6EC || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || x === 0x1F7F0 || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA89 || x >= 0x1FA8F && x <= 0x1FAC6 || x >= 0x1FACE && x <= 0x1FADC || x >= 0x1FADF && x <= 0x1FAE9 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;
9892
- }
9893
- function getCategory(x) {
9894
- if (isAmbiguous(x)) return 'ambiguous';
9895
- if (isFullWidth(x)) return 'fullwidth';
9896
- if (x === 0x20A9 || x >= 0xFF61 && x <= 0xFFBE || x >= 0xFFC2 && x <= 0xFFC7 || x >= 0xFFCA && x <= 0xFFCF || x >= 0xFFD2 && x <= 0xFFD7 || x >= 0xFFDA && x <= 0xFFDC || x >= 0xFFE8 && x <= 0xFFEE) {
9897
- return 'halfwidth';
9898
- }
9899
- if (x >= 0x20 && x <= 0x7E || x === 0xA2 || x === 0xA3 || x === 0xA5 || x === 0xA6 || x === 0xAC || x === 0xAF || x >= 0x27E6 && x <= 0x27ED || x === 0x2985 || x === 0x2986) {
9900
- return 'narrow';
9901
- }
9902
- if (isWide(x)) return 'wide';
9903
- return 'neutral';
9904
- }
9905
-
9906
- Object.defineProperty(getEastAsianWidth, "__esModule", {
9907
- value: true
9908
- });
9909
- getEastAsianWidth._isNarrowWidth = void 0;
9910
- getEastAsianWidth.eastAsianWidth = eastAsianWidth;
9911
- getEastAsianWidth.eastAsianWidthType = eastAsianWidthType;
9912
- var _lookup = lookup;
9913
- function validate(codePoint) {
9914
- if (!Number.isSafeInteger(codePoint)) {
9915
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
9916
- }
9917
- }
9918
- function eastAsianWidthType(codePoint) {
9919
- validate(codePoint);
9920
- return (0, _lookup.getCategory)(codePoint);
9921
- }
9922
- function eastAsianWidth(codePoint, {
9923
- ambiguousAsWide = false
9924
- } = {}) {
9925
- validate(codePoint);
9926
- if ((0, _lookup.isFullWidth)(codePoint) || (0, _lookup.isWide)(codePoint) || ambiguousAsWide && (0, _lookup.isAmbiguous)(codePoint)) {
9927
- return 2;
9928
- }
9929
- return 1;
9930
- }
9931
-
9932
- // For Prettier. This doesn't count "ambiguous" characters or check for valid input.
9933
- // https://github.com/sindresorhus/get-east-asian-width/pull/6
9934
- const _isNarrowWidth = codePoint => !((0, _lookup.isFullWidth)(codePoint) || (0, _lookup.isWide)(codePoint));
9935
- getEastAsianWidth._isNarrowWidth = _isNarrowWidth;
9936
-
9937
- Object.defineProperty(stringWidth$1, "__esModule", {
9938
- value: true
9939
- });
9940
- stringWidth$1.default = stringWidth;
9941
- var _stripAnsi$1 = stripAnsi$1;
9942
- var _getEastAsianWidth = getEastAsianWidth;
9943
- var _emojiRegex = require$$2$2;
9944
- const segmenter = new Intl.Segmenter();
9945
- const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
9946
- function stringWidth(string, options = {}) {
9947
- if (typeof string !== 'string' || string.length === 0) {
9948
- return 0;
9949
- }
9950
- const {
9951
- ambiguousIsNarrow = true,
9952
- countAnsiEscapeCodes = false
9953
- } = options;
9954
- if (!countAnsiEscapeCodes) {
9955
- string = (0, _stripAnsi$1.default)(string);
9956
- }
9957
- if (string.length === 0) {
9958
- return 0;
9959
- }
9960
- let width = 0;
9961
- const eastAsianWidthOptions = {
9962
- ambiguousAsWide: !ambiguousIsNarrow
9963
- };
9964
- for (const {
9965
- segment: character
9966
- } of segmenter.segment(string)) {
9967
- const codePoint = character.codePointAt(0);
9968
-
9969
- // Ignore control characters
9970
- if (codePoint <= 0x1F || codePoint >= 0x7F && codePoint <= 0x9F) {
9971
- continue;
9972
- }
9973
-
9974
- // Ignore zero-width characters
9975
- if (codePoint >= 0x20_0B && codePoint <= 0x20_0F // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
9976
- || codePoint === 0xFE_FF // Zero-width no-break space
9977
- ) {
9978
- continue;
9979
- }
9980
-
9981
- // Ignore combining characters
9982
- if (codePoint >= 0x3_00 && codePoint <= 0x3_6F // Combining diacritical marks
9983
- || codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF // Combining diacritical marks extended
9984
- || codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF // Combining diacritical marks supplement
9985
- || codePoint >= 0x20_D0 && codePoint <= 0x20_FF // Combining diacritical marks for symbols
9986
- || codePoint >= 0xFE_20 && codePoint <= 0xFE_2F // Combining half marks
9987
- ) {
9988
- continue;
9989
- }
9990
-
9991
- // Ignore surrogate pairs
9992
- if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
9993
- continue;
9994
- }
9995
-
9996
- // Ignore variation selectors
9997
- if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
9998
- continue;
9999
- }
10000
-
10001
- // This covers some of the above cases, but we still keep them for performance reasons.
10002
- if (defaultIgnorableCodePointRegex.test(character)) {
10003
- continue;
10004
- }
10005
-
10006
- // TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
10007
- if (_emojiRegex().test(character)) {
10008
- width += 2;
10009
- continue;
10010
- }
10011
- width += (0, _getEastAsianWidth.eastAsianWidth)(codePoint, eastAsianWidthOptions);
10012
- }
10013
- return width;
10014
- }
10015
-
10016
- var isInteractive$1 = {};
10017
-
10018
- Object.defineProperty(isInteractive$1, "__esModule", {
10019
- value: true
10020
- });
10021
- isInteractive$1.default = isInteractive;
10022
- function isInteractive({
10023
- stream = process.stdout
10024
- } = {}) {
10025
- return Boolean(stream && stream.isTTY && process.env.TERM !== 'dumb' && !('CI' in process.env));
10026
- }
10027
-
10028
8995
  var isUnicodeSupported$1 = {};
10029
8996
 
10030
8997
  Object.defineProperty(isUnicodeSupported$1, "__esModule", {
10031
8998
  value: true
10032
8999
  });
10033
9000
  isUnicodeSupported$1.default = isUnicodeSupported;
10034
- var _nodeProcess$7 = require$$0;
9001
+ var _nodeProcess$5 = require$$0$1;
10035
9002
  function isUnicodeSupported() {
10036
9003
  const {
10037
9004
  env
10038
- } = _nodeProcess$7;
9005
+ } = _nodeProcess$5;
10039
9006
  const {
10040
9007
  TERM,
10041
9008
  TERM_PROGRAM
10042
9009
  } = env;
10043
- if (_nodeProcess$7.platform !== 'win32') {
9010
+ if (_nodeProcess$5.platform !== 'win32') {
10044
9011
  return TERM !== 'linux'; // Linux console (kernel)
10045
9012
  }
10046
9013
  return Boolean(env.WT_SESSION) // Windows Terminal
@@ -10049,416 +9016,6 @@ function isUnicodeSupported() {
10049
9016
  || TERM_PROGRAM === 'Terminus-Sublime' || TERM_PROGRAM === 'vscode' || TERM === 'xterm-256color' || TERM === 'alacritty' || TERM === 'rxvt-unicode' || TERM === 'rxvt-unicode-256color' || env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
10050
9017
  }
10051
9018
 
10052
- var stdinDiscarder$1 = {};
10053
-
10054
- Object.defineProperty(stdinDiscarder$1, "__esModule", {
10055
- value: true
10056
- });
10057
- stdinDiscarder$1.default = void 0;
10058
- var _nodeProcess$6 = require$$0;
10059
- const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code
10060
-
10061
- class StdinDiscarder {
10062
- #activeCount = 0;
10063
- start() {
10064
- this.#activeCount++;
10065
- if (this.#activeCount === 1) {
10066
- this.#realStart();
10067
- }
10068
- }
10069
- stop() {
10070
- if (this.#activeCount <= 0) {
10071
- throw new Error('`stop` called more times than `start`');
10072
- }
10073
- this.#activeCount--;
10074
- if (this.#activeCount === 0) {
10075
- this.#realStop();
10076
- }
10077
- }
10078
- #realStart() {
10079
- // No known way to make it work reliably on Windows.
10080
- if (_nodeProcess$6.platform === 'win32' || !_nodeProcess$6.stdin.isTTY) {
10081
- return;
10082
- }
10083
- _nodeProcess$6.stdin.setRawMode(true);
10084
- _nodeProcess$6.stdin.on('data', this.#handleInput);
10085
- _nodeProcess$6.stdin.resume();
10086
- }
10087
- #realStop() {
10088
- if (!_nodeProcess$6.stdin.isTTY) {
10089
- return;
10090
- }
10091
- _nodeProcess$6.stdin.off('data', this.#handleInput);
10092
- _nodeProcess$6.stdin.pause();
10093
- _nodeProcess$6.stdin.setRawMode(false);
10094
- }
10095
- #handleInput(chunk) {
10096
- // Allow Ctrl+C to gracefully exit.
10097
- if (chunk[0] === ASCII_ETX_CODE) {
10098
- _nodeProcess$6.emit('SIGINT');
10099
- }
10100
- }
10101
- }
10102
- const stdinDiscarder = new StdinDiscarder();
10103
- stdinDiscarder$1.default = stdinDiscarder;
10104
-
10105
- Object.defineProperty(ora$1, "__esModule", {
10106
- value: true
10107
- });
10108
- ora$1.default = ora;
10109
- ora$1.oraPromise = oraPromise;
10110
- ora$1.spinners = require$$3;
10111
- var _nodeProcess$5 = require$$0;
10112
- var _chalk = source;
10113
- var _cliCursor = cliCursor$1;
10114
- var _cliSpinners = require$$3;
10115
- var _logSymbols = logSymbols$1;
10116
- var _stripAnsi = stripAnsi$1;
10117
- var _stringWidth = stringWidth$1;
10118
- var _isInteractive = isInteractive$1;
10119
- var _isUnicodeSupported = isUnicodeSupported$1;
10120
- var _stdinDiscarder = stdinDiscarder$1;
10121
- class Ora {
10122
- #linesToClear = 0;
10123
- #isDiscardingStdin = false;
10124
- #lineCount = 0;
10125
- #frameIndex = -1;
10126
- #lastSpinnerFrameTime = 0;
10127
- #options;
10128
- #spinner;
10129
- #stream;
10130
- #id;
10131
- #initialInterval;
10132
- #isEnabled;
10133
- #isSilent;
10134
- #indent;
10135
- #text;
10136
- #prefixText;
10137
- #suffixText;
10138
- color;
10139
- constructor(options) {
10140
- if (typeof options === 'string') {
10141
- options = {
10142
- text: options
10143
- };
10144
- }
10145
- this.#options = {
10146
- color: 'cyan',
10147
- stream: _nodeProcess$5.stderr,
10148
- discardStdin: true,
10149
- hideCursor: true,
10150
- ...options
10151
- };
10152
-
10153
- // Public
10154
- this.color = this.#options.color;
10155
-
10156
- // It's important that these use the public setters.
10157
- this.spinner = this.#options.spinner;
10158
- this.#initialInterval = this.#options.interval;
10159
- this.#stream = this.#options.stream;
10160
- this.#isEnabled = typeof this.#options.isEnabled === 'boolean' ? this.#options.isEnabled : (0, _isInteractive.default)({
10161
- stream: this.#stream
10162
- });
10163
- this.#isSilent = typeof this.#options.isSilent === 'boolean' ? this.#options.isSilent : false;
10164
-
10165
- // Set *after* `this.#stream`.
10166
- // It's important that these use the public setters.
10167
- this.text = this.#options.text;
10168
- this.prefixText = this.#options.prefixText;
10169
- this.suffixText = this.#options.suffixText;
10170
- this.indent = this.#options.indent;
10171
- if (_nodeProcess$5.env.NODE_ENV === 'test') {
10172
- this._stream = this.#stream;
10173
- this._isEnabled = this.#isEnabled;
10174
- Object.defineProperty(this, '_linesToClear', {
10175
- get() {
10176
- return this.#linesToClear;
10177
- },
10178
- set(newValue) {
10179
- this.#linesToClear = newValue;
10180
- }
10181
- });
10182
- Object.defineProperty(this, '_frameIndex', {
10183
- get() {
10184
- return this.#frameIndex;
10185
- }
10186
- });
10187
- Object.defineProperty(this, '_lineCount', {
10188
- get() {
10189
- return this.#lineCount;
10190
- }
10191
- });
10192
- }
10193
- }
10194
- get indent() {
10195
- return this.#indent;
10196
- }
10197
- set indent(indent = 0) {
10198
- if (!(indent >= 0 && Number.isInteger(indent))) {
10199
- throw new Error('The `indent` option must be an integer from 0 and up');
10200
- }
10201
- this.#indent = indent;
10202
- this.#updateLineCount();
10203
- }
10204
- get interval() {
10205
- return this.#initialInterval ?? this.#spinner.interval ?? 100;
10206
- }
10207
- get spinner() {
10208
- return this.#spinner;
10209
- }
10210
- set spinner(spinner) {
10211
- this.#frameIndex = -1;
10212
- this.#initialInterval = undefined;
10213
- if (typeof spinner === 'object') {
10214
- if (spinner.frames === undefined) {
10215
- throw new Error('The given spinner must have a `frames` property');
10216
- }
10217
- this.#spinner = spinner;
10218
- } else if (!(0, _isUnicodeSupported.default)()) {
10219
- this.#spinner = _cliSpinners.line;
10220
- } else if (spinner === undefined) {
10221
- // Set default spinner
10222
- this.#spinner = _cliSpinners.dots;
10223
- } else if (spinner !== 'default' && _cliSpinners[spinner]) {
10224
- this.#spinner = _cliSpinners[spinner];
10225
- } else {
10226
- throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
10227
- }
10228
- }
10229
- get text() {
10230
- return this.#text;
10231
- }
10232
- set text(value = '') {
10233
- this.#text = value;
10234
- this.#updateLineCount();
10235
- }
10236
- get prefixText() {
10237
- return this.#prefixText;
10238
- }
10239
- set prefixText(value = '') {
10240
- this.#prefixText = value;
10241
- this.#updateLineCount();
10242
- }
10243
- get suffixText() {
10244
- return this.#suffixText;
10245
- }
10246
- set suffixText(value = '') {
10247
- this.#suffixText = value;
10248
- this.#updateLineCount();
10249
- }
10250
- get isSpinning() {
10251
- return this.#id !== undefined;
10252
- }
10253
- #getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {
10254
- if (typeof prefixText === 'string' && prefixText !== '') {
10255
- return prefixText + postfix;
10256
- }
10257
- if (typeof prefixText === 'function') {
10258
- return prefixText() + postfix;
10259
- }
10260
- return '';
10261
- }
10262
- #getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {
10263
- if (typeof suffixText === 'string' && suffixText !== '') {
10264
- return prefix + suffixText;
10265
- }
10266
- if (typeof suffixText === 'function') {
10267
- return prefix + suffixText();
10268
- }
10269
- return '';
10270
- }
10271
- #updateLineCount() {
10272
- const columns = this.#stream.columns ?? 80;
10273
- const fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');
10274
- const fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');
10275
- const fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;
10276
- this.#lineCount = 0;
10277
- for (const line of (0, _stripAnsi.default)(fullText).split('\n')) {
10278
- this.#lineCount += Math.max(1, Math.ceil((0, _stringWidth.default)(line, {
10279
- countAnsiEscapeCodes: true
10280
- }) / columns));
10281
- }
10282
- }
10283
- get isEnabled() {
10284
- return this.#isEnabled && !this.#isSilent;
10285
- }
10286
- set isEnabled(value) {
10287
- if (typeof value !== 'boolean') {
10288
- throw new TypeError('The `isEnabled` option must be a boolean');
10289
- }
10290
- this.#isEnabled = value;
10291
- }
10292
- get isSilent() {
10293
- return this.#isSilent;
10294
- }
10295
- set isSilent(value) {
10296
- if (typeof value !== 'boolean') {
10297
- throw new TypeError('The `isSilent` option must be a boolean');
10298
- }
10299
- this.#isSilent = value;
10300
- }
10301
- frame() {
10302
- // Ensure we only update the spinner frame at the wanted interval,
10303
- // even if the render method is called more often.
10304
- const now = Date.now();
10305
- if (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {
10306
- this.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;
10307
- this.#lastSpinnerFrameTime = now;
10308
- }
10309
- const {
10310
- frames
10311
- } = this.#spinner;
10312
- let frame = frames[this.#frameIndex];
10313
- if (this.color) {
10314
- frame = _chalk.default[this.color](frame);
10315
- }
10316
- const fullPrefixText = typeof this.#prefixText === 'string' && this.#prefixText !== '' ? this.#prefixText + ' ' : '';
10317
- const fullText = typeof this.text === 'string' ? ' ' + this.text : '';
10318
- const fullSuffixText = typeof this.#suffixText === 'string' && this.#suffixText !== '' ? ' ' + this.#suffixText : '';
10319
- return fullPrefixText + frame + fullText + fullSuffixText;
10320
- }
10321
- clear() {
10322
- if (!this.#isEnabled || !this.#stream.isTTY) {
10323
- return this;
10324
- }
10325
- this.#stream.cursorTo(0);
10326
- for (let index = 0; index < this.#linesToClear; index++) {
10327
- if (index > 0) {
10328
- this.#stream.moveCursor(0, -1);
10329
- }
10330
- this.#stream.clearLine(1);
10331
- }
10332
- if (this.#indent || this.lastIndent !== this.#indent) {
10333
- this.#stream.cursorTo(this.#indent);
10334
- }
10335
- this.lastIndent = this.#indent;
10336
- this.#linesToClear = 0;
10337
- return this;
10338
- }
10339
- render() {
10340
- if (this.#isSilent) {
10341
- return this;
10342
- }
10343
- this.clear();
10344
- this.#stream.write(this.frame());
10345
- this.#linesToClear = this.#lineCount;
10346
- return this;
10347
- }
10348
- start(text) {
10349
- if (text) {
10350
- this.text = text;
10351
- }
10352
- if (this.#isSilent) {
10353
- return this;
10354
- }
10355
- if (!this.#isEnabled) {
10356
- if (this.text) {
10357
- this.#stream.write(`- ${this.text}\n`);
10358
- }
10359
- return this;
10360
- }
10361
- if (this.isSpinning) {
10362
- return this;
10363
- }
10364
- if (this.#options.hideCursor) {
10365
- _cliCursor.default.hide(this.#stream);
10366
- }
10367
- if (this.#options.discardStdin && _nodeProcess$5.stdin.isTTY) {
10368
- this.#isDiscardingStdin = true;
10369
- _stdinDiscarder.default.start();
10370
- }
10371
- this.render();
10372
- this.#id = setInterval(this.render.bind(this), this.interval);
10373
- return this;
10374
- }
10375
- stop() {
10376
- if (!this.#isEnabled) {
10377
- return this;
10378
- }
10379
- clearInterval(this.#id);
10380
- this.#id = undefined;
10381
- this.#frameIndex = 0;
10382
- this.clear();
10383
- if (this.#options.hideCursor) {
10384
- _cliCursor.default.show(this.#stream);
10385
- }
10386
- if (this.#options.discardStdin && _nodeProcess$5.stdin.isTTY && this.#isDiscardingStdin) {
10387
- _stdinDiscarder.default.stop();
10388
- this.#isDiscardingStdin = false;
10389
- }
10390
- return this;
10391
- }
10392
- succeed(text) {
10393
- return this.stopAndPersist({
10394
- symbol: _logSymbols.default.success,
10395
- text
10396
- });
10397
- }
10398
- fail(text) {
10399
- return this.stopAndPersist({
10400
- symbol: _logSymbols.default.error,
10401
- text
10402
- });
10403
- }
10404
- warn(text) {
10405
- return this.stopAndPersist({
10406
- symbol: _logSymbols.default.warning,
10407
- text
10408
- });
10409
- }
10410
- info(text) {
10411
- return this.stopAndPersist({
10412
- symbol: _logSymbols.default.info,
10413
- text
10414
- });
10415
- }
10416
- stopAndPersist(options = {}) {
10417
- if (this.#isSilent) {
10418
- return this;
10419
- }
10420
- const prefixText = options.prefixText ?? this.#prefixText;
10421
- const fullPrefixText = this.#getFullPrefixText(prefixText, ' ');
10422
- const symbolText = options.symbol ?? ' ';
10423
- const text = options.text ?? this.text;
10424
- const separatorText = symbolText ? ' ' : '';
10425
- const fullText = typeof text === 'string' ? separatorText + text : '';
10426
- const suffixText = options.suffixText ?? this.#suffixText;
10427
- const fullSuffixText = this.#getFullSuffixText(suffixText, ' ');
10428
- const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\n';
10429
- this.stop();
10430
- this.#stream.write(textToWrite);
10431
- return this;
10432
- }
10433
- }
10434
- function ora(options) {
10435
- return new Ora(options);
10436
- }
10437
- async function oraPromise(action, options) {
10438
- const actionIsFunction = typeof action === 'function';
10439
- const actionIsPromise = typeof action.then === 'function';
10440
- if (!actionIsFunction && !actionIsPromise) {
10441
- throw new TypeError('Parameter `action` must be a Function or a Promise');
10442
- }
10443
- const {
10444
- successText,
10445
- failText
10446
- } = typeof options === 'object' ? options : {
10447
- successText: undefined,
10448
- failText: undefined
10449
- };
10450
- const spinner = ora(options).start();
10451
- try {
10452
- const promise = actionIsFunction ? action(spinner) : action;
10453
- const result = await promise;
10454
- spinner.succeed(successText === undefined ? undefined : typeof successText === 'string' ? successText : successText(result));
10455
- return result;
10456
- } catch (error) {
10457
- spinner.fail(failText === undefined ? undefined : typeof failText === 'string' ? failText : failText(error));
10458
- throw error;
10459
- }
10460
- }
10461
-
10462
9019
  var terminalLink$1 = {};
10463
9020
 
10464
9021
  var ansiEscapes$1 = {};
@@ -10574,12 +9131,97 @@ ansiEscapes.iTerm = {
10574
9131
  };
10575
9132
  ansiEscapes$1.default = ansiEscapes;
10576
9133
 
9134
+ const supportsColor = require$$0$3;
9135
+ const hasFlag = require$$1$2;
9136
+ function parseVersion(versionString) {
9137
+ if (/^\d{3,4}$/.test(versionString)) {
9138
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
9139
+ const m = /(\d{1,2})(\d{2})/.exec(versionString);
9140
+ return {
9141
+ major: 0,
9142
+ minor: parseInt(m[1], 10),
9143
+ patch: parseInt(m[2], 10)
9144
+ };
9145
+ }
9146
+ const versions = (versionString || '').split('.').map(n => parseInt(n, 10));
9147
+ return {
9148
+ major: versions[0],
9149
+ minor: versions[1],
9150
+ patch: versions[2]
9151
+ };
9152
+ }
9153
+ function supportsHyperlink(stream) {
9154
+ const {
9155
+ env
9156
+ } = process;
9157
+ if ('FORCE_HYPERLINK' in env) {
9158
+ return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
9159
+ }
9160
+ if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {
9161
+ return false;
9162
+ }
9163
+ if (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {
9164
+ return true;
9165
+ }
9166
+
9167
+ // Netlify does not run a TTY, it does not need `supportsColor` check
9168
+ if ('NETLIFY' in env) {
9169
+ return true;
9170
+ }
9171
+
9172
+ // If they specify no colors, they probably don't want hyperlinks.
9173
+ if (!supportsColor.supportsColor(stream)) {
9174
+ return false;
9175
+ }
9176
+ if (stream && !stream.isTTY) {
9177
+ return false;
9178
+ }
9179
+ if (process.platform === 'win32') {
9180
+ return false;
9181
+ }
9182
+ if ('CI' in env) {
9183
+ return false;
9184
+ }
9185
+ if ('TEAMCITY_VERSION' in env) {
9186
+ return false;
9187
+ }
9188
+ if ('TERM_PROGRAM' in env) {
9189
+ const version = parseVersion(env.TERM_PROGRAM_VERSION);
9190
+ switch (env.TERM_PROGRAM) {
9191
+ case 'iTerm.app':
9192
+ if (version.major === 3) {
9193
+ return version.minor >= 1;
9194
+ }
9195
+ return version.major > 3;
9196
+ case 'WezTerm':
9197
+ return version.major >= 20200620;
9198
+ case 'vscode':
9199
+ return version.major > 1 || version.major === 1 && version.minor >= 72;
9200
+ // No default
9201
+ }
9202
+ }
9203
+ if ('VTE_VERSION' in env) {
9204
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
9205
+ if (env.VTE_VERSION === '0.50.0') {
9206
+ return false;
9207
+ }
9208
+ const version = parseVersion(env.VTE_VERSION);
9209
+ return version.major > 0 || version.minor >= 50;
9210
+ }
9211
+ return false;
9212
+ }
9213
+ var supportsHyperlinks = {
9214
+ supportsHyperlink,
9215
+ stdout: supportsHyperlink(process.stdout),
9216
+ stderr: supportsHyperlink(process.stderr)
9217
+ };
9218
+
10577
9219
  Object.defineProperty(terminalLink$1, "__esModule", {
10578
9220
  value: true
10579
9221
  });
10580
9222
  terminalLink$1.default = terminalLink;
10581
9223
  var _ansiEscapes = ansiEscapes$1;
10582
- var _supportsHyperlinks = require$$1$2;
9224
+ var _supportsHyperlinks = supportsHyperlinks;
10583
9225
  function terminalLink(text, url, {
10584
9226
  target = 'stdout',
10585
9227
  ...options
@@ -10600,6 +9242,18 @@ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {
10600
9242
  });
10601
9243
  terminalLink.stderr.isSupported = _supportsHyperlinks.stderr;
10602
9244
 
9245
+ var isInteractive$1 = {};
9246
+
9247
+ Object.defineProperty(isInteractive$1, "__esModule", {
9248
+ value: true
9249
+ });
9250
+ isInteractive$1.default = isInteractive;
9251
+ function isInteractive({
9252
+ stream = process.stdout
9253
+ } = {}) {
9254
+ return Boolean(stream && stream.isTTY && process.env.TERM !== 'dumb' && !('CI' in process.env));
9255
+ }
9256
+
10603
9257
  var open$1 = {};
10604
9258
 
10605
9259
  var isWsl$1 = {};
@@ -10612,7 +9266,7 @@ Object.defineProperty(isDocker$1, "__esModule", {
10612
9266
  value: true
10613
9267
  });
10614
9268
  isDocker$1.default = isDocker;
10615
- var _nodeFs$2 = require$$0$1;
9269
+ var _nodeFs$2 = require$$0;
10616
9270
  let isDockerCached;
10617
9271
  function hasDockerEnv() {
10618
9272
  try {
@@ -10641,7 +9295,7 @@ Object.defineProperty(isInsideContainer$1, "__esModule", {
10641
9295
  value: true
10642
9296
  });
10643
9297
  isInsideContainer$1.default = isInsideContainer;
10644
- var _nodeFs$1 = require$$0$1;
9298
+ var _nodeFs$1 = require$$0;
10645
9299
  var _isDocker = isDocker$1;
10646
9300
  let cachedResult;
10647
9301
 
@@ -10666,9 +9320,9 @@ Object.defineProperty(isWsl$1, "__esModule", {
10666
9320
  value: true
10667
9321
  });
10668
9322
  isWsl$1.default = void 0;
10669
- var _nodeProcess$4 = require$$0;
9323
+ var _nodeProcess$4 = require$$0$1;
10670
9324
  var _nodeOs = require$$1;
10671
- var _nodeFs = require$$0$1;
9325
+ var _nodeFs = require$$0;
10672
9326
  var _isInsideContainer$1 = isInsideContainer$1;
10673
9327
  const isWsl = () => {
10674
9328
  if (_nodeProcess$4.platform !== 'linux') {
@@ -10724,8 +9378,8 @@ Object.defineProperty(defaultBrowserId$1, "__esModule", {
10724
9378
  });
10725
9379
  defaultBrowserId$1.default = defaultBrowserId;
10726
9380
  var _nodeUtil$3 = require$$0$2;
10727
- var _nodeProcess$3 = require$$0;
10728
- var _nodeChild_process$4 = require$$2$3;
9381
+ var _nodeProcess$3 = require$$0$1;
9382
+ var _nodeChild_process$4 = require$$2;
10729
9383
  const execFileAsync$3 = (0, _nodeUtil$3.promisify)(_nodeChild_process$4.execFile);
10730
9384
  async function defaultBrowserId() {
10731
9385
  if (_nodeProcess$3.platform !== 'darwin') {
@@ -10749,9 +9403,9 @@ Object.defineProperty(runApplescript, "__esModule", {
10749
9403
  });
10750
9404
  runApplescript.runAppleScript = runAppleScript;
10751
9405
  runApplescript.runAppleScriptSync = runAppleScriptSync;
10752
- var _nodeProcess$2 = require$$0;
9406
+ var _nodeProcess$2 = require$$0$1;
10753
9407
  var _nodeUtil$2 = require$$0$2;
10754
- var _nodeChild_process$3 = require$$2$3;
9408
+ var _nodeChild_process$3 = require$$2;
10755
9409
  const execFileAsync$2 = (0, _nodeUtil$2.promisify)(_nodeChild_process$3.execFile);
10756
9410
  async function runAppleScript(script, {
10757
9411
  humanReadableOutput = true
@@ -10797,7 +9451,7 @@ Object.defineProperty(windows, "__esModule", {
10797
9451
  windows.UnknownBrowserError = void 0;
10798
9452
  windows.default = defaultBrowser$1;
10799
9453
  var _nodeUtil$1 = require$$0$2;
10800
- var _nodeChild_process$2 = require$$2$3;
9454
+ var _nodeChild_process$2 = require$$2;
10801
9455
  const execFileAsync$1 = (0, _nodeUtil$1.promisify)(_nodeChild_process$2.execFile);
10802
9456
 
10803
9457
  // Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake
@@ -10867,8 +9521,8 @@ Object.defineProperty(defaultBrowser$2, "__esModule", {
10867
9521
  });
10868
9522
  defaultBrowser$2.default = defaultBrowser;
10869
9523
  var _nodeUtil = require$$0$2;
10870
- var _nodeProcess$1 = require$$0;
10871
- var _nodeChild_process$1 = require$$2$3;
9524
+ var _nodeProcess$1 = require$$0$1;
9525
+ var _nodeChild_process$1 = require$$2;
10872
9526
  var _defaultBrowserId = defaultBrowserId$1;
10873
9527
  var _bundleName = bundleName$1;
10874
9528
  var _windows = windows;
@@ -10907,11 +9561,11 @@ Object.defineProperty(open$1, "__esModule", {
10907
9561
  value: true
10908
9562
  });
10909
9563
  open$1.openApp = open$1.default = open$1.apps = void 0;
10910
- var _nodeProcess = require$$0;
10911
- var _nodeBuffer = require$$2$4;
9564
+ var _nodeProcess = require$$0$1;
9565
+ var _nodeBuffer = require$$2$1;
10912
9566
  var _nodePath = require$$1$1;
10913
9567
  var _nodeUrl = require$$8;
10914
- var _nodeChild_process = require$$2$3;
9568
+ var _nodeChild_process = require$$2;
10915
9569
  var _promises = _interopRequireWildcard(require$$1$3, true);
10916
9570
  var _isWsl = isWsl$1;
10917
9571
  var _defineLazyProp = defineLazyProp;
@@ -11219,6 +9873,4 @@ exports.interopRequireWildcard = interopRequireWildcard;
11219
9873
  exports.isInteractive = isInteractive$1;
11220
9874
  exports.isUnicodeSupported = isUnicodeSupported$1;
11221
9875
  exports.open = open$1;
11222
- exports.ora = ora$1;
11223
- exports.source = source;
11224
9876
  exports.terminalLink = terminalLink$1;