create-vue 3.2.0 → 3.2.3
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/outfile.cjs +224 -2891
- package/package.json +6 -6
- package/template/base/node_modules/.bin/vite +2 -2
- package/template/base/package.json +2 -2
- package/template/{code/default → base}/src/assets/base.css +0 -0
- package/template/{code/default → base}/src/assets/logo.svg +0 -0
- package/template/base/src/assets/main.css +35 -0
- package/template/code/default/src/App.vue +5 -39
- package/template/code/router/src/App.vue +6 -40
- package/template/code/typescript-default/src/App.vue +5 -39
- package/template/code/typescript-router/src/App.vue +6 -40
- package/template/config/cypress/node_modules/.bin/cypress +2 -2
- package/template/config/cypress/package.json +1 -1
- package/template/config/cypress-ct/cypress/support/component.js +3 -0
- package/template/config/cypress-ct/cypress/support/component.ts +3 -0
- package/template/config/cypress-ct/node_modules/.bin/cypress +2 -2
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/pinia/package.json +1 -1
- package/template/config/router/package.json +2 -2
- package/template/config/typescript/node_modules/.bin/tsc +2 -2
- package/template/config/typescript/node_modules/.bin/tsserver +2 -2
- package/template/config/typescript/node_modules/.bin/vue-tsc +2 -2
- package/template/config/typescript/package.json +3 -3
- package/template/config/vitest/node_modules/.bin/vitest +2 -2
- package/template/config/vitest/package.json +4 -4
- package/template/entry/default/src/main.js +2 -0
- package/template/entry/pinia/src/main.js +2 -0
- package/template/entry/router/src/main.js +2 -0
- package/template/entry/router-and-pinia/src/main.js +2 -0
- package/template/eslint/package.json +2 -2
- package/template/code/router/src/assets/base.css +0 -74
- package/template/code/router/src/assets/logo.svg +0 -1
- package/template/code/typescript-default/src/assets/base.css +0 -74
- package/template/code/typescript-default/src/assets/logo.svg +0 -1
- package/template/code/typescript-router/src/assets/base.css +0 -74
- package/template/code/typescript-router/src/assets/logo.svg +0 -1
- package/template/config/vuex/package.json +0 -6
- package/template/config/vuex/src/store/index.js +0 -8
package/outfile.cjs
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.2.
|
|
2
|
+
/*! create-vue v3.2.3 | MIT */
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
9
|
var __commonJS = (cb, mod) => function __require() {
|
|
24
10
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
25
11
|
};
|
|
@@ -273,2773 +259,67 @@ var require_kleur = __commonJS({
|
|
|
273
259
|
bgWhite: init2(47, 49)
|
|
274
260
|
};
|
|
275
261
|
function run(arr, str) {
|
|
276
|
-
let i = 0, tmp, beg = "", end = "";
|
|
277
|
-
for (; i < arr.length; i++) {
|
|
278
|
-
tmp = arr[i];
|
|
279
|
-
beg += tmp.open;
|
|
280
|
-
end += tmp.close;
|
|
281
|
-
if (str.includes(tmp.close)) {
|
|
282
|
-
str = str.replace(tmp.rgx, tmp.close + tmp.open);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return beg + str + end;
|
|
286
|
-
}
|
|
287
|
-
function chain(has, keys) {
|
|
288
|
-
let ctx = { has, keys };
|
|
289
|
-
ctx.reset = $.reset.bind(ctx);
|
|
290
|
-
ctx.bold = $.bold.bind(ctx);
|
|
291
|
-
ctx.dim = $.dim.bind(ctx);
|
|
292
|
-
ctx.italic = $.italic.bind(ctx);
|
|
293
|
-
ctx.underline = $.underline.bind(ctx);
|
|
294
|
-
ctx.inverse = $.inverse.bind(ctx);
|
|
295
|
-
ctx.hidden = $.hidden.bind(ctx);
|
|
296
|
-
ctx.strikethrough = $.strikethrough.bind(ctx);
|
|
297
|
-
ctx.black = $.black.bind(ctx);
|
|
298
|
-
ctx.red = $.red.bind(ctx);
|
|
299
|
-
ctx.green = $.green.bind(ctx);
|
|
300
|
-
ctx.yellow = $.yellow.bind(ctx);
|
|
301
|
-
ctx.blue = $.blue.bind(ctx);
|
|
302
|
-
ctx.magenta = $.magenta.bind(ctx);
|
|
303
|
-
ctx.cyan = $.cyan.bind(ctx);
|
|
304
|
-
ctx.white = $.white.bind(ctx);
|
|
305
|
-
ctx.gray = $.gray.bind(ctx);
|
|
306
|
-
ctx.grey = $.grey.bind(ctx);
|
|
307
|
-
ctx.bgBlack = $.bgBlack.bind(ctx);
|
|
308
|
-
ctx.bgRed = $.bgRed.bind(ctx);
|
|
309
|
-
ctx.bgGreen = $.bgGreen.bind(ctx);
|
|
310
|
-
ctx.bgYellow = $.bgYellow.bind(ctx);
|
|
311
|
-
ctx.bgBlue = $.bgBlue.bind(ctx);
|
|
312
|
-
ctx.bgMagenta = $.bgMagenta.bind(ctx);
|
|
313
|
-
ctx.bgCyan = $.bgCyan.bind(ctx);
|
|
314
|
-
ctx.bgWhite = $.bgWhite.bind(ctx);
|
|
315
|
-
return ctx;
|
|
316
|
-
}
|
|
317
|
-
function init2(open, close) {
|
|
318
|
-
let blk = {
|
|
319
|
-
open: `\x1B[${open}m`,
|
|
320
|
-
close: `\x1B[${close}m`,
|
|
321
|
-
rgx: new RegExp(`\\x1b\\[${close}m`, "g")
|
|
322
|
-
};
|
|
323
|
-
return function(txt) {
|
|
324
|
-
if (this !== void 0 && this.has !== void 0) {
|
|
325
|
-
this.has.includes(open) || (this.has.push(open), this.keys.push(blk));
|
|
326
|
-
return txt === void 0 ? this : $.enabled ? run(this.keys, txt + "") : txt + "";
|
|
327
|
-
}
|
|
328
|
-
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt + "") : txt + "";
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
module2.exports = $;
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js
|
|
336
|
-
var require_action = __commonJS({
|
|
337
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js"(exports, module2) {
|
|
338
|
-
"use strict";
|
|
339
|
-
module2.exports = (key, isSelect) => {
|
|
340
|
-
if (key.meta && key.name !== "escape")
|
|
341
|
-
return;
|
|
342
|
-
if (key.ctrl) {
|
|
343
|
-
if (key.name === "a")
|
|
344
|
-
return "first";
|
|
345
|
-
if (key.name === "c")
|
|
346
|
-
return "abort";
|
|
347
|
-
if (key.name === "d")
|
|
348
|
-
return "abort";
|
|
349
|
-
if (key.name === "e")
|
|
350
|
-
return "last";
|
|
351
|
-
if (key.name === "g")
|
|
352
|
-
return "reset";
|
|
353
|
-
}
|
|
354
|
-
if (isSelect) {
|
|
355
|
-
if (key.name === "j")
|
|
356
|
-
return "down";
|
|
357
|
-
if (key.name === "k")
|
|
358
|
-
return "up";
|
|
359
|
-
}
|
|
360
|
-
if (key.name === "return")
|
|
361
|
-
return "submit";
|
|
362
|
-
if (key.name === "enter")
|
|
363
|
-
return "submit";
|
|
364
|
-
if (key.name === "backspace")
|
|
365
|
-
return "delete";
|
|
366
|
-
if (key.name === "delete")
|
|
367
|
-
return "deleteForward";
|
|
368
|
-
if (key.name === "abort")
|
|
369
|
-
return "abort";
|
|
370
|
-
if (key.name === "escape")
|
|
371
|
-
return "exit";
|
|
372
|
-
if (key.name === "tab")
|
|
373
|
-
return "next";
|
|
374
|
-
if (key.name === "pagedown")
|
|
375
|
-
return "nextPage";
|
|
376
|
-
if (key.name === "pageup")
|
|
377
|
-
return "prevPage";
|
|
378
|
-
if (key.name === "home")
|
|
379
|
-
return "home";
|
|
380
|
-
if (key.name === "end")
|
|
381
|
-
return "end";
|
|
382
|
-
if (key.name === "up")
|
|
383
|
-
return "up";
|
|
384
|
-
if (key.name === "down")
|
|
385
|
-
return "down";
|
|
386
|
-
if (key.name === "right")
|
|
387
|
-
return "right";
|
|
388
|
-
if (key.name === "left")
|
|
389
|
-
return "left";
|
|
390
|
-
return false;
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js
|
|
396
|
-
var require_strip = __commonJS({
|
|
397
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js"(exports, module2) {
|
|
398
|
-
"use strict";
|
|
399
|
-
module2.exports = (str) => {
|
|
400
|
-
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");
|
|
401
|
-
const RGX = new RegExp(pattern, "g");
|
|
402
|
-
return typeof str === "string" ? str.replace(RGX, "") : str;
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
408
|
-
var require_src = __commonJS({
|
|
409
|
-
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
|
|
410
|
-
"use strict";
|
|
411
|
-
var ESC = "\x1B";
|
|
412
|
-
var CSI = `${ESC}[`;
|
|
413
|
-
var beep = "\x07";
|
|
414
|
-
var cursor = {
|
|
415
|
-
to(x, y) {
|
|
416
|
-
if (!y)
|
|
417
|
-
return `${CSI}${x + 1}G`;
|
|
418
|
-
return `${CSI}${y + 1};${x + 1}H`;
|
|
419
|
-
},
|
|
420
|
-
move(x, y) {
|
|
421
|
-
let ret = "";
|
|
422
|
-
if (x < 0)
|
|
423
|
-
ret += `${CSI}${-x}D`;
|
|
424
|
-
else if (x > 0)
|
|
425
|
-
ret += `${CSI}${x}C`;
|
|
426
|
-
if (y < 0)
|
|
427
|
-
ret += `${CSI}${-y}A`;
|
|
428
|
-
else if (y > 0)
|
|
429
|
-
ret += `${CSI}${y}B`;
|
|
430
|
-
return ret;
|
|
431
|
-
},
|
|
432
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
433
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
434
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
435
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
436
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
437
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
438
|
-
left: `${CSI}G`,
|
|
439
|
-
hide: `${CSI}?25l`,
|
|
440
|
-
show: `${CSI}?25h`,
|
|
441
|
-
save: `${ESC}7`,
|
|
442
|
-
restore: `${ESC}8`
|
|
443
|
-
};
|
|
444
|
-
var scroll = {
|
|
445
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
446
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
447
|
-
};
|
|
448
|
-
var erase = {
|
|
449
|
-
screen: `${CSI}2J`,
|
|
450
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
451
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
452
|
-
line: `${CSI}2K`,
|
|
453
|
-
lineEnd: `${CSI}K`,
|
|
454
|
-
lineStart: `${CSI}1K`,
|
|
455
|
-
lines(count) {
|
|
456
|
-
let clear = "";
|
|
457
|
-
for (let i = 0; i < count; i++)
|
|
458
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
459
|
-
if (count)
|
|
460
|
-
clear += cursor.left;
|
|
461
|
-
return clear;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
module2.exports = { cursor, scroll, erase, beep };
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js
|
|
469
|
-
var require_clear = __commonJS({
|
|
470
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js"(exports, module2) {
|
|
471
|
-
"use strict";
|
|
472
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
473
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
474
|
-
if (!it) {
|
|
475
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
476
|
-
if (it)
|
|
477
|
-
o = it;
|
|
478
|
-
var i = 0;
|
|
479
|
-
var F = function F2() {
|
|
480
|
-
};
|
|
481
|
-
return { s: F, n: function n() {
|
|
482
|
-
if (i >= o.length)
|
|
483
|
-
return { done: true };
|
|
484
|
-
return { done: false, value: o[i++] };
|
|
485
|
-
}, e: function e(_e) {
|
|
486
|
-
throw _e;
|
|
487
|
-
}, f: F };
|
|
488
|
-
}
|
|
489
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
490
|
-
}
|
|
491
|
-
var normalCompletion = true, didErr = false, err;
|
|
492
|
-
return { s: function s() {
|
|
493
|
-
it = it.call(o);
|
|
494
|
-
}, n: function n() {
|
|
495
|
-
var step = it.next();
|
|
496
|
-
normalCompletion = step.done;
|
|
497
|
-
return step;
|
|
498
|
-
}, e: function e(_e2) {
|
|
499
|
-
didErr = true;
|
|
500
|
-
err = _e2;
|
|
501
|
-
}, f: function f() {
|
|
502
|
-
try {
|
|
503
|
-
if (!normalCompletion && it.return != null)
|
|
504
|
-
it.return();
|
|
505
|
-
} finally {
|
|
506
|
-
if (didErr)
|
|
507
|
-
throw err;
|
|
508
|
-
}
|
|
509
|
-
} };
|
|
510
|
-
}
|
|
511
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
512
|
-
if (!o)
|
|
513
|
-
return;
|
|
514
|
-
if (typeof o === "string")
|
|
515
|
-
return _arrayLikeToArray(o, minLen);
|
|
516
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
517
|
-
if (n === "Object" && o.constructor)
|
|
518
|
-
n = o.constructor.name;
|
|
519
|
-
if (n === "Map" || n === "Set")
|
|
520
|
-
return Array.from(o);
|
|
521
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
522
|
-
return _arrayLikeToArray(o, minLen);
|
|
523
|
-
}
|
|
524
|
-
function _arrayLikeToArray(arr, len) {
|
|
525
|
-
if (len == null || len > arr.length)
|
|
526
|
-
len = arr.length;
|
|
527
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
528
|
-
arr2[i] = arr[i];
|
|
529
|
-
return arr2;
|
|
530
|
-
}
|
|
531
|
-
var strip = require_strip();
|
|
532
|
-
var _require = require_src();
|
|
533
|
-
var erase = _require.erase;
|
|
534
|
-
var cursor = _require.cursor;
|
|
535
|
-
var width = (str) => [...strip(str)].length;
|
|
536
|
-
module2.exports = function(prompt, perLine) {
|
|
537
|
-
if (!perLine)
|
|
538
|
-
return erase.line + cursor.to(0);
|
|
539
|
-
let rows = 0;
|
|
540
|
-
const lines = prompt.split(/\r?\n/);
|
|
541
|
-
var _iterator = _createForOfIteratorHelper(lines), _step;
|
|
542
|
-
try {
|
|
543
|
-
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
544
|
-
let line = _step.value;
|
|
545
|
-
rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);
|
|
546
|
-
}
|
|
547
|
-
} catch (err) {
|
|
548
|
-
_iterator.e(err);
|
|
549
|
-
} finally {
|
|
550
|
-
_iterator.f();
|
|
551
|
-
}
|
|
552
|
-
return erase.lines(rows);
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
|
|
557
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js
|
|
558
|
-
var require_figures = __commonJS({
|
|
559
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js"(exports, module2) {
|
|
560
|
-
"use strict";
|
|
561
|
-
var main = {
|
|
562
|
-
arrowUp: "\u2191",
|
|
563
|
-
arrowDown: "\u2193",
|
|
564
|
-
arrowLeft: "\u2190",
|
|
565
|
-
arrowRight: "\u2192",
|
|
566
|
-
radioOn: "\u25C9",
|
|
567
|
-
radioOff: "\u25EF",
|
|
568
|
-
tick: "\u2714",
|
|
569
|
-
cross: "\u2716",
|
|
570
|
-
ellipsis: "\u2026",
|
|
571
|
-
pointerSmall: "\u203A",
|
|
572
|
-
line: "\u2500",
|
|
573
|
-
pointer: "\u276F"
|
|
574
|
-
};
|
|
575
|
-
var win = {
|
|
576
|
-
arrowUp: main.arrowUp,
|
|
577
|
-
arrowDown: main.arrowDown,
|
|
578
|
-
arrowLeft: main.arrowLeft,
|
|
579
|
-
arrowRight: main.arrowRight,
|
|
580
|
-
radioOn: "(*)",
|
|
581
|
-
radioOff: "( )",
|
|
582
|
-
tick: "\u221A",
|
|
583
|
-
cross: "\xD7",
|
|
584
|
-
ellipsis: "...",
|
|
585
|
-
pointerSmall: "\xBB",
|
|
586
|
-
line: "\u2500",
|
|
587
|
-
pointer: ">"
|
|
588
|
-
};
|
|
589
|
-
var figures = process.platform === "win32" ? win : main;
|
|
590
|
-
module2.exports = figures;
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js
|
|
595
|
-
var require_style = __commonJS({
|
|
596
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js"(exports, module2) {
|
|
597
|
-
"use strict";
|
|
598
|
-
var c = require_kleur();
|
|
599
|
-
var figures = require_figures();
|
|
600
|
-
var styles = Object.freeze({
|
|
601
|
-
password: {
|
|
602
|
-
scale: 1,
|
|
603
|
-
render: (input) => "*".repeat(input.length)
|
|
604
|
-
},
|
|
605
|
-
emoji: {
|
|
606
|
-
scale: 2,
|
|
607
|
-
render: (input) => "\u{1F603}".repeat(input.length)
|
|
608
|
-
},
|
|
609
|
-
invisible: {
|
|
610
|
-
scale: 0,
|
|
611
|
-
render: (input) => ""
|
|
612
|
-
},
|
|
613
|
-
default: {
|
|
614
|
-
scale: 1,
|
|
615
|
-
render: (input) => `${input}`
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
var render = (type) => styles[type] || styles.default;
|
|
619
|
-
var symbols = Object.freeze({
|
|
620
|
-
aborted: c.red(figures.cross),
|
|
621
|
-
done: c.green(figures.tick),
|
|
622
|
-
exited: c.yellow(figures.cross),
|
|
623
|
-
default: c.cyan("?")
|
|
624
|
-
});
|
|
625
|
-
var symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
|
|
626
|
-
var delimiter = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall);
|
|
627
|
-
var item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
|
|
628
|
-
module2.exports = {
|
|
629
|
-
styles,
|
|
630
|
-
render,
|
|
631
|
-
symbols,
|
|
632
|
-
symbol,
|
|
633
|
-
delimiter,
|
|
634
|
-
item
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js
|
|
640
|
-
var require_lines = __commonJS({
|
|
641
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js"(exports, module2) {
|
|
642
|
-
"use strict";
|
|
643
|
-
var strip = require_strip();
|
|
644
|
-
module2.exports = function(msg, perLine) {
|
|
645
|
-
let lines = String(strip(msg) || "").split(/\r?\n/);
|
|
646
|
-
if (!perLine)
|
|
647
|
-
return lines.length;
|
|
648
|
-
return lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js
|
|
654
|
-
var require_wrap = __commonJS({
|
|
655
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js"(exports, module2) {
|
|
656
|
-
"use strict";
|
|
657
|
-
module2.exports = (msg, opts = {}) => {
|
|
658
|
-
const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || "";
|
|
659
|
-
const width = opts.width;
|
|
660
|
-
return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w) => {
|
|
661
|
-
if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)
|
|
662
|
-
arr[arr.length - 1] += ` ${w}`;
|
|
663
|
-
else
|
|
664
|
-
arr.push(`${tab}${w}`);
|
|
665
|
-
return arr;
|
|
666
|
-
}, [tab]).join("\n")).join("\n");
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
|
|
671
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js
|
|
672
|
-
var require_entriesToDisplay = __commonJS({
|
|
673
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js"(exports, module2) {
|
|
674
|
-
"use strict";
|
|
675
|
-
module2.exports = (cursor, total, maxVisible) => {
|
|
676
|
-
maxVisible = maxVisible || total;
|
|
677
|
-
let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
|
|
678
|
-
if (startIndex < 0)
|
|
679
|
-
startIndex = 0;
|
|
680
|
-
let endIndex = Math.min(startIndex + maxVisible, total);
|
|
681
|
-
return {
|
|
682
|
-
startIndex,
|
|
683
|
-
endIndex
|
|
684
|
-
};
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
|
|
689
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js
|
|
690
|
-
var require_util = __commonJS({
|
|
691
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js"(exports, module2) {
|
|
692
|
-
"use strict";
|
|
693
|
-
module2.exports = {
|
|
694
|
-
action: require_action(),
|
|
695
|
-
clear: require_clear(),
|
|
696
|
-
style: require_style(),
|
|
697
|
-
strip: require_strip(),
|
|
698
|
-
figures: require_figures(),
|
|
699
|
-
lines: require_lines(),
|
|
700
|
-
wrap: require_wrap(),
|
|
701
|
-
entriesToDisplay: require_entriesToDisplay()
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
|
|
706
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js
|
|
707
|
-
var require_prompt = __commonJS({
|
|
708
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js"(exports, module2) {
|
|
709
|
-
"use strict";
|
|
710
|
-
var readline = require("readline");
|
|
711
|
-
var _require = require_util();
|
|
712
|
-
var action = _require.action;
|
|
713
|
-
var EventEmitter = require("events");
|
|
714
|
-
var _require2 = require_src();
|
|
715
|
-
var beep = _require2.beep;
|
|
716
|
-
var cursor = _require2.cursor;
|
|
717
|
-
var color = require_kleur();
|
|
718
|
-
var Prompt = class extends EventEmitter {
|
|
719
|
-
constructor(opts = {}) {
|
|
720
|
-
super();
|
|
721
|
-
this.firstRender = true;
|
|
722
|
-
this.in = opts.stdin || process.stdin;
|
|
723
|
-
this.out = opts.stdout || process.stdout;
|
|
724
|
-
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
725
|
-
const rl = readline.createInterface({
|
|
726
|
-
input: this.in,
|
|
727
|
-
escapeCodeTimeout: 50
|
|
728
|
-
});
|
|
729
|
-
readline.emitKeypressEvents(this.in, rl);
|
|
730
|
-
if (this.in.isTTY)
|
|
731
|
-
this.in.setRawMode(true);
|
|
732
|
-
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
733
|
-
const keypress = (str, key) => {
|
|
734
|
-
let a = action(key, isSelect);
|
|
735
|
-
if (a === false) {
|
|
736
|
-
this._ && this._(str, key);
|
|
737
|
-
} else if (typeof this[a] === "function") {
|
|
738
|
-
this[a](key);
|
|
739
|
-
} else {
|
|
740
|
-
this.bell();
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
this.close = () => {
|
|
744
|
-
this.out.write(cursor.show);
|
|
745
|
-
this.in.removeListener("keypress", keypress);
|
|
746
|
-
if (this.in.isTTY)
|
|
747
|
-
this.in.setRawMode(false);
|
|
748
|
-
rl.close();
|
|
749
|
-
this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
|
|
750
|
-
this.closed = true;
|
|
751
|
-
};
|
|
752
|
-
this.in.on("keypress", keypress);
|
|
753
|
-
}
|
|
754
|
-
fire() {
|
|
755
|
-
this.emit("state", {
|
|
756
|
-
value: this.value,
|
|
757
|
-
aborted: !!this.aborted,
|
|
758
|
-
exited: !!this.exited
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
bell() {
|
|
762
|
-
this.out.write(beep);
|
|
763
|
-
}
|
|
764
|
-
render() {
|
|
765
|
-
this.onRender(color);
|
|
766
|
-
if (this.firstRender)
|
|
767
|
-
this.firstRender = false;
|
|
768
|
-
}
|
|
769
|
-
};
|
|
770
|
-
module2.exports = Prompt;
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js
|
|
775
|
-
var require_text = __commonJS({
|
|
776
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports, module2) {
|
|
777
|
-
"use strict";
|
|
778
|
-
function asyncGeneratorStep(gen, resolve5, reject, _next, _throw, key, arg) {
|
|
779
|
-
try {
|
|
780
|
-
var info = gen[key](arg);
|
|
781
|
-
var value = info.value;
|
|
782
|
-
} catch (error) {
|
|
783
|
-
reject(error);
|
|
784
|
-
return;
|
|
785
|
-
}
|
|
786
|
-
if (info.done) {
|
|
787
|
-
resolve5(value);
|
|
788
|
-
} else {
|
|
789
|
-
Promise.resolve(value).then(_next, _throw);
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
function _asyncToGenerator(fn) {
|
|
793
|
-
return function() {
|
|
794
|
-
var self2 = this, args = arguments;
|
|
795
|
-
return new Promise(function(resolve5, reject) {
|
|
796
|
-
var gen = fn.apply(self2, args);
|
|
797
|
-
function _next(value) {
|
|
798
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
|
|
799
|
-
}
|
|
800
|
-
function _throw(err) {
|
|
801
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
|
|
802
|
-
}
|
|
803
|
-
_next(void 0);
|
|
804
|
-
});
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
var color = require_kleur();
|
|
808
|
-
var Prompt = require_prompt();
|
|
809
|
-
var _require = require_src();
|
|
810
|
-
var erase = _require.erase;
|
|
811
|
-
var cursor = _require.cursor;
|
|
812
|
-
var _require2 = require_util();
|
|
813
|
-
var style = _require2.style;
|
|
814
|
-
var clear = _require2.clear;
|
|
815
|
-
var lines = _require2.lines;
|
|
816
|
-
var figures = _require2.figures;
|
|
817
|
-
var TextPrompt = class extends Prompt {
|
|
818
|
-
constructor(opts = {}) {
|
|
819
|
-
super(opts);
|
|
820
|
-
this.transform = style.render(opts.style);
|
|
821
|
-
this.scale = this.transform.scale;
|
|
822
|
-
this.msg = opts.message;
|
|
823
|
-
this.initial = opts.initial || ``;
|
|
824
|
-
this.validator = opts.validate || (() => true);
|
|
825
|
-
this.value = ``;
|
|
826
|
-
this.errorMsg = opts.error || `Please Enter A Valid Value`;
|
|
827
|
-
this.cursor = Number(!!this.initial);
|
|
828
|
-
this.cursorOffset = 0;
|
|
829
|
-
this.clear = clear(``, this.out.columns);
|
|
830
|
-
this.render();
|
|
831
|
-
}
|
|
832
|
-
set value(v) {
|
|
833
|
-
if (!v && this.initial) {
|
|
834
|
-
this.placeholder = true;
|
|
835
|
-
this.rendered = color.gray(this.transform.render(this.initial));
|
|
836
|
-
} else {
|
|
837
|
-
this.placeholder = false;
|
|
838
|
-
this.rendered = this.transform.render(v);
|
|
839
|
-
}
|
|
840
|
-
this._value = v;
|
|
841
|
-
this.fire();
|
|
842
|
-
}
|
|
843
|
-
get value() {
|
|
844
|
-
return this._value;
|
|
845
|
-
}
|
|
846
|
-
reset() {
|
|
847
|
-
this.value = ``;
|
|
848
|
-
this.cursor = Number(!!this.initial);
|
|
849
|
-
this.cursorOffset = 0;
|
|
850
|
-
this.fire();
|
|
851
|
-
this.render();
|
|
852
|
-
}
|
|
853
|
-
exit() {
|
|
854
|
-
this.abort();
|
|
855
|
-
}
|
|
856
|
-
abort() {
|
|
857
|
-
this.value = this.value || this.initial;
|
|
858
|
-
this.done = this.aborted = true;
|
|
859
|
-
this.error = false;
|
|
860
|
-
this.red = false;
|
|
861
|
-
this.fire();
|
|
862
|
-
this.render();
|
|
863
|
-
this.out.write("\n");
|
|
864
|
-
this.close();
|
|
865
|
-
}
|
|
866
|
-
validate() {
|
|
867
|
-
var _this = this;
|
|
868
|
-
return _asyncToGenerator(function* () {
|
|
869
|
-
let valid = yield _this.validator(_this.value);
|
|
870
|
-
if (typeof valid === `string`) {
|
|
871
|
-
_this.errorMsg = valid;
|
|
872
|
-
valid = false;
|
|
873
|
-
}
|
|
874
|
-
_this.error = !valid;
|
|
875
|
-
})();
|
|
876
|
-
}
|
|
877
|
-
submit() {
|
|
878
|
-
var _this2 = this;
|
|
879
|
-
return _asyncToGenerator(function* () {
|
|
880
|
-
_this2.value = _this2.value || _this2.initial;
|
|
881
|
-
_this2.cursorOffset = 0;
|
|
882
|
-
_this2.cursor = _this2.rendered.length;
|
|
883
|
-
yield _this2.validate();
|
|
884
|
-
if (_this2.error) {
|
|
885
|
-
_this2.red = true;
|
|
886
|
-
_this2.fire();
|
|
887
|
-
_this2.render();
|
|
888
|
-
return;
|
|
889
|
-
}
|
|
890
|
-
_this2.done = true;
|
|
891
|
-
_this2.aborted = false;
|
|
892
|
-
_this2.fire();
|
|
893
|
-
_this2.render();
|
|
894
|
-
_this2.out.write("\n");
|
|
895
|
-
_this2.close();
|
|
896
|
-
})();
|
|
897
|
-
}
|
|
898
|
-
next() {
|
|
899
|
-
if (!this.placeholder)
|
|
900
|
-
return this.bell();
|
|
901
|
-
this.value = this.initial;
|
|
902
|
-
this.cursor = this.rendered.length;
|
|
903
|
-
this.fire();
|
|
904
|
-
this.render();
|
|
905
|
-
}
|
|
906
|
-
moveCursor(n) {
|
|
907
|
-
if (this.placeholder)
|
|
908
|
-
return;
|
|
909
|
-
this.cursor = this.cursor + n;
|
|
910
|
-
this.cursorOffset += n;
|
|
911
|
-
}
|
|
912
|
-
_(c, key) {
|
|
913
|
-
let s1 = this.value.slice(0, this.cursor);
|
|
914
|
-
let s2 = this.value.slice(this.cursor);
|
|
915
|
-
this.value = `${s1}${c}${s2}`;
|
|
916
|
-
this.red = false;
|
|
917
|
-
this.cursor = this.placeholder ? 0 : s1.length + 1;
|
|
918
|
-
this.render();
|
|
919
|
-
}
|
|
920
|
-
delete() {
|
|
921
|
-
if (this.isCursorAtStart())
|
|
922
|
-
return this.bell();
|
|
923
|
-
let s1 = this.value.slice(0, this.cursor - 1);
|
|
924
|
-
let s2 = this.value.slice(this.cursor);
|
|
925
|
-
this.value = `${s1}${s2}`;
|
|
926
|
-
this.red = false;
|
|
927
|
-
if (this.isCursorAtStart()) {
|
|
928
|
-
this.cursorOffset = 0;
|
|
929
|
-
} else {
|
|
930
|
-
this.cursorOffset++;
|
|
931
|
-
this.moveCursor(-1);
|
|
932
|
-
}
|
|
933
|
-
this.render();
|
|
934
|
-
}
|
|
935
|
-
deleteForward() {
|
|
936
|
-
if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
|
|
937
|
-
return this.bell();
|
|
938
|
-
let s1 = this.value.slice(0, this.cursor);
|
|
939
|
-
let s2 = this.value.slice(this.cursor + 1);
|
|
940
|
-
this.value = `${s1}${s2}`;
|
|
941
|
-
this.red = false;
|
|
942
|
-
if (this.isCursorAtEnd()) {
|
|
943
|
-
this.cursorOffset = 0;
|
|
944
|
-
} else {
|
|
945
|
-
this.cursorOffset++;
|
|
946
|
-
}
|
|
947
|
-
this.render();
|
|
948
|
-
}
|
|
949
|
-
first() {
|
|
950
|
-
this.cursor = 0;
|
|
951
|
-
this.render();
|
|
952
|
-
}
|
|
953
|
-
last() {
|
|
954
|
-
this.cursor = this.value.length;
|
|
955
|
-
this.render();
|
|
956
|
-
}
|
|
957
|
-
left() {
|
|
958
|
-
if (this.cursor <= 0 || this.placeholder)
|
|
959
|
-
return this.bell();
|
|
960
|
-
this.moveCursor(-1);
|
|
961
|
-
this.render();
|
|
962
|
-
}
|
|
963
|
-
right() {
|
|
964
|
-
if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
|
|
965
|
-
return this.bell();
|
|
966
|
-
this.moveCursor(1);
|
|
967
|
-
this.render();
|
|
968
|
-
}
|
|
969
|
-
isCursorAtStart() {
|
|
970
|
-
return this.cursor === 0 || this.placeholder && this.cursor === 1;
|
|
971
|
-
}
|
|
972
|
-
isCursorAtEnd() {
|
|
973
|
-
return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
|
|
974
|
-
}
|
|
975
|
-
render() {
|
|
976
|
-
if (this.closed)
|
|
977
|
-
return;
|
|
978
|
-
if (!this.firstRender) {
|
|
979
|
-
if (this.outputError)
|
|
980
|
-
this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
981
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
982
|
-
}
|
|
983
|
-
super.render();
|
|
984
|
-
this.outputError = "";
|
|
985
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);
|
|
986
|
-
if (this.error) {
|
|
987
|
-
this.outputError += this.errorMsg.split(`
|
|
988
|
-
`).reduce((a, l, i) => a + `
|
|
989
|
-
${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
990
|
-
}
|
|
991
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));
|
|
992
|
-
}
|
|
993
|
-
};
|
|
994
|
-
module2.exports = TextPrompt;
|
|
995
|
-
}
|
|
996
|
-
});
|
|
997
|
-
|
|
998
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js
|
|
999
|
-
var require_select = __commonJS({
|
|
1000
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports, module2) {
|
|
1001
|
-
"use strict";
|
|
1002
|
-
var color = require_kleur();
|
|
1003
|
-
var Prompt = require_prompt();
|
|
1004
|
-
var _require = require_util();
|
|
1005
|
-
var style = _require.style;
|
|
1006
|
-
var clear = _require.clear;
|
|
1007
|
-
var figures = _require.figures;
|
|
1008
|
-
var wrap = _require.wrap;
|
|
1009
|
-
var entriesToDisplay = _require.entriesToDisplay;
|
|
1010
|
-
var _require2 = require_src();
|
|
1011
|
-
var cursor = _require2.cursor;
|
|
1012
|
-
var SelectPrompt = class extends Prompt {
|
|
1013
|
-
constructor(opts = {}) {
|
|
1014
|
-
super(opts);
|
|
1015
|
-
this.msg = opts.message;
|
|
1016
|
-
this.hint = opts.hint || "- Use arrow-keys. Return to submit.";
|
|
1017
|
-
this.warn = opts.warn || "- This option is disabled";
|
|
1018
|
-
this.cursor = opts.initial || 0;
|
|
1019
|
-
this.choices = opts.choices.map((ch, idx) => {
|
|
1020
|
-
if (typeof ch === "string")
|
|
1021
|
-
ch = {
|
|
1022
|
-
title: ch,
|
|
1023
|
-
value: idx
|
|
1024
|
-
};
|
|
1025
|
-
return {
|
|
1026
|
-
title: ch && (ch.title || ch.value || ch),
|
|
1027
|
-
value: ch && (ch.value === void 0 ? idx : ch.value),
|
|
1028
|
-
description: ch && ch.description,
|
|
1029
|
-
selected: ch && ch.selected,
|
|
1030
|
-
disabled: ch && ch.disabled
|
|
1031
|
-
};
|
|
1032
|
-
});
|
|
1033
|
-
this.optionsPerPage = opts.optionsPerPage || 10;
|
|
1034
|
-
this.value = (this.choices[this.cursor] || {}).value;
|
|
1035
|
-
this.clear = clear("", this.out.columns);
|
|
1036
|
-
this.render();
|
|
1037
|
-
}
|
|
1038
|
-
moveCursor(n) {
|
|
1039
|
-
this.cursor = n;
|
|
1040
|
-
this.value = this.choices[n].value;
|
|
1041
|
-
this.fire();
|
|
1042
|
-
}
|
|
1043
|
-
reset() {
|
|
1044
|
-
this.moveCursor(0);
|
|
1045
|
-
this.fire();
|
|
1046
|
-
this.render();
|
|
1047
|
-
}
|
|
1048
|
-
exit() {
|
|
1049
|
-
this.abort();
|
|
1050
|
-
}
|
|
1051
|
-
abort() {
|
|
1052
|
-
this.done = this.aborted = true;
|
|
1053
|
-
this.fire();
|
|
1054
|
-
this.render();
|
|
1055
|
-
this.out.write("\n");
|
|
1056
|
-
this.close();
|
|
1057
|
-
}
|
|
1058
|
-
submit() {
|
|
1059
|
-
if (!this.selection.disabled) {
|
|
1060
|
-
this.done = true;
|
|
1061
|
-
this.aborted = false;
|
|
1062
|
-
this.fire();
|
|
1063
|
-
this.render();
|
|
1064
|
-
this.out.write("\n");
|
|
1065
|
-
this.close();
|
|
1066
|
-
} else
|
|
1067
|
-
this.bell();
|
|
1068
|
-
}
|
|
1069
|
-
first() {
|
|
1070
|
-
this.moveCursor(0);
|
|
1071
|
-
this.render();
|
|
1072
|
-
}
|
|
1073
|
-
last() {
|
|
1074
|
-
this.moveCursor(this.choices.length - 1);
|
|
1075
|
-
this.render();
|
|
1076
|
-
}
|
|
1077
|
-
up() {
|
|
1078
|
-
if (this.cursor === 0) {
|
|
1079
|
-
this.moveCursor(this.choices.length - 1);
|
|
1080
|
-
} else {
|
|
1081
|
-
this.moveCursor(this.cursor - 1);
|
|
1082
|
-
}
|
|
1083
|
-
this.render();
|
|
1084
|
-
}
|
|
1085
|
-
down() {
|
|
1086
|
-
if (this.cursor === this.choices.length - 1) {
|
|
1087
|
-
this.moveCursor(0);
|
|
1088
|
-
} else {
|
|
1089
|
-
this.moveCursor(this.cursor + 1);
|
|
1090
|
-
}
|
|
1091
|
-
this.render();
|
|
1092
|
-
}
|
|
1093
|
-
next() {
|
|
1094
|
-
this.moveCursor((this.cursor + 1) % this.choices.length);
|
|
1095
|
-
this.render();
|
|
1096
|
-
}
|
|
1097
|
-
_(c, key) {
|
|
1098
|
-
if (c === " ")
|
|
1099
|
-
return this.submit();
|
|
1100
|
-
}
|
|
1101
|
-
get selection() {
|
|
1102
|
-
return this.choices[this.cursor];
|
|
1103
|
-
}
|
|
1104
|
-
render() {
|
|
1105
|
-
if (this.closed)
|
|
1106
|
-
return;
|
|
1107
|
-
if (this.firstRender)
|
|
1108
|
-
this.out.write(cursor.hide);
|
|
1109
|
-
else
|
|
1110
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1111
|
-
super.render();
|
|
1112
|
-
let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
1113
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(" ");
|
|
1114
|
-
if (!this.done) {
|
|
1115
|
-
this.outputText += "\n";
|
|
1116
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
1117
|
-
let title, prefix, desc = "", v = this.choices[i];
|
|
1118
|
-
if (i === startIndex && startIndex > 0) {
|
|
1119
|
-
prefix = figures.arrowUp;
|
|
1120
|
-
} else if (i === endIndex - 1 && endIndex < this.choices.length) {
|
|
1121
|
-
prefix = figures.arrowDown;
|
|
1122
|
-
} else {
|
|
1123
|
-
prefix = " ";
|
|
1124
|
-
}
|
|
1125
|
-
if (v.disabled) {
|
|
1126
|
-
title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
1127
|
-
prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix;
|
|
1128
|
-
} else {
|
|
1129
|
-
title = this.cursor === i ? color.cyan().underline(v.title) : v.title;
|
|
1130
|
-
prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
1131
|
-
if (v.description && this.cursor === i) {
|
|
1132
|
-
desc = ` - ${v.description}`;
|
|
1133
|
-
if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
1134
|
-
desc = "\n" + wrap(v.description, {
|
|
1135
|
-
margin: 3,
|
|
1136
|
-
width: this.out.columns
|
|
1137
|
-
});
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
this.outputText += `${prefix} ${title}${color.gray(desc)}
|
|
1142
|
-
`;
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
this.out.write(this.outputText);
|
|
1146
|
-
}
|
|
1147
|
-
};
|
|
1148
|
-
module2.exports = SelectPrompt;
|
|
1149
|
-
}
|
|
1150
|
-
});
|
|
1151
|
-
|
|
1152
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js
|
|
1153
|
-
var require_toggle = __commonJS({
|
|
1154
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports, module2) {
|
|
1155
|
-
"use strict";
|
|
1156
|
-
var color = require_kleur();
|
|
1157
|
-
var Prompt = require_prompt();
|
|
1158
|
-
var _require = require_util();
|
|
1159
|
-
var style = _require.style;
|
|
1160
|
-
var clear = _require.clear;
|
|
1161
|
-
var _require2 = require_src();
|
|
1162
|
-
var cursor = _require2.cursor;
|
|
1163
|
-
var erase = _require2.erase;
|
|
1164
|
-
var TogglePrompt = class extends Prompt {
|
|
1165
|
-
constructor(opts = {}) {
|
|
1166
|
-
super(opts);
|
|
1167
|
-
this.msg = opts.message;
|
|
1168
|
-
this.value = !!opts.initial;
|
|
1169
|
-
this.active = opts.active || "on";
|
|
1170
|
-
this.inactive = opts.inactive || "off";
|
|
1171
|
-
this.initialValue = this.value;
|
|
1172
|
-
this.render();
|
|
1173
|
-
}
|
|
1174
|
-
reset() {
|
|
1175
|
-
this.value = this.initialValue;
|
|
1176
|
-
this.fire();
|
|
1177
|
-
this.render();
|
|
1178
|
-
}
|
|
1179
|
-
exit() {
|
|
1180
|
-
this.abort();
|
|
1181
|
-
}
|
|
1182
|
-
abort() {
|
|
1183
|
-
this.done = this.aborted = true;
|
|
1184
|
-
this.fire();
|
|
1185
|
-
this.render();
|
|
1186
|
-
this.out.write("\n");
|
|
1187
|
-
this.close();
|
|
1188
|
-
}
|
|
1189
|
-
submit() {
|
|
1190
|
-
this.done = true;
|
|
1191
|
-
this.aborted = false;
|
|
1192
|
-
this.fire();
|
|
1193
|
-
this.render();
|
|
1194
|
-
this.out.write("\n");
|
|
1195
|
-
this.close();
|
|
1196
|
-
}
|
|
1197
|
-
deactivate() {
|
|
1198
|
-
if (this.value === false)
|
|
1199
|
-
return this.bell();
|
|
1200
|
-
this.value = false;
|
|
1201
|
-
this.render();
|
|
1202
|
-
}
|
|
1203
|
-
activate() {
|
|
1204
|
-
if (this.value === true)
|
|
1205
|
-
return this.bell();
|
|
1206
|
-
this.value = true;
|
|
1207
|
-
this.render();
|
|
1208
|
-
}
|
|
1209
|
-
delete() {
|
|
1210
|
-
this.deactivate();
|
|
1211
|
-
}
|
|
1212
|
-
left() {
|
|
1213
|
-
this.deactivate();
|
|
1214
|
-
}
|
|
1215
|
-
right() {
|
|
1216
|
-
this.activate();
|
|
1217
|
-
}
|
|
1218
|
-
down() {
|
|
1219
|
-
this.deactivate();
|
|
1220
|
-
}
|
|
1221
|
-
up() {
|
|
1222
|
-
this.activate();
|
|
1223
|
-
}
|
|
1224
|
-
next() {
|
|
1225
|
-
this.value = !this.value;
|
|
1226
|
-
this.fire();
|
|
1227
|
-
this.render();
|
|
1228
|
-
}
|
|
1229
|
-
_(c, key) {
|
|
1230
|
-
if (c === " ") {
|
|
1231
|
-
this.value = !this.value;
|
|
1232
|
-
} else if (c === "1") {
|
|
1233
|
-
this.value = true;
|
|
1234
|
-
} else if (c === "0") {
|
|
1235
|
-
this.value = false;
|
|
1236
|
-
} else
|
|
1237
|
-
return this.bell();
|
|
1238
|
-
this.render();
|
|
1239
|
-
}
|
|
1240
|
-
render() {
|
|
1241
|
-
if (this.closed)
|
|
1242
|
-
return;
|
|
1243
|
-
if (this.firstRender)
|
|
1244
|
-
this.out.write(cursor.hide);
|
|
1245
|
-
else
|
|
1246
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1247
|
-
super.render();
|
|
1248
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray("/"), this.value ? color.cyan().underline(this.active) : this.active].join(" ");
|
|
1249
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText);
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
module2.exports = TogglePrompt;
|
|
1253
|
-
}
|
|
1254
|
-
});
|
|
1255
|
-
|
|
1256
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js
|
|
1257
|
-
var require_datepart = __commonJS({
|
|
1258
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js"(exports, module2) {
|
|
1259
|
-
"use strict";
|
|
1260
|
-
var DatePart = class {
|
|
1261
|
-
constructor({
|
|
1262
|
-
token,
|
|
1263
|
-
date,
|
|
1264
|
-
parts,
|
|
1265
|
-
locales
|
|
1266
|
-
}) {
|
|
1267
|
-
this.token = token;
|
|
1268
|
-
this.date = date || new Date();
|
|
1269
|
-
this.parts = parts || [this];
|
|
1270
|
-
this.locales = locales || {};
|
|
1271
|
-
}
|
|
1272
|
-
up() {
|
|
1273
|
-
}
|
|
1274
|
-
down() {
|
|
1275
|
-
}
|
|
1276
|
-
next() {
|
|
1277
|
-
const currentIdx = this.parts.indexOf(this);
|
|
1278
|
-
return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
|
|
1279
|
-
}
|
|
1280
|
-
setTo(val) {
|
|
1281
|
-
}
|
|
1282
|
-
prev() {
|
|
1283
|
-
let parts = [].concat(this.parts).reverse();
|
|
1284
|
-
const currentIdx = parts.indexOf(this);
|
|
1285
|
-
return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
|
|
1286
|
-
}
|
|
1287
|
-
toString() {
|
|
1288
|
-
return String(this.date);
|
|
1289
|
-
}
|
|
1290
|
-
};
|
|
1291
|
-
module2.exports = DatePart;
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
|
|
1295
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js
|
|
1296
|
-
var require_meridiem = __commonJS({
|
|
1297
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js"(exports, module2) {
|
|
1298
|
-
"use strict";
|
|
1299
|
-
var DatePart = require_datepart();
|
|
1300
|
-
var Meridiem = class extends DatePart {
|
|
1301
|
-
constructor(opts = {}) {
|
|
1302
|
-
super(opts);
|
|
1303
|
-
}
|
|
1304
|
-
up() {
|
|
1305
|
-
this.date.setHours((this.date.getHours() + 12) % 24);
|
|
1306
|
-
}
|
|
1307
|
-
down() {
|
|
1308
|
-
this.up();
|
|
1309
|
-
}
|
|
1310
|
-
toString() {
|
|
1311
|
-
let meridiem = this.date.getHours() > 12 ? "pm" : "am";
|
|
1312
|
-
return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
|
|
1313
|
-
}
|
|
1314
|
-
};
|
|
1315
|
-
module2.exports = Meridiem;
|
|
1316
|
-
}
|
|
1317
|
-
});
|
|
1318
|
-
|
|
1319
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js
|
|
1320
|
-
var require_day = __commonJS({
|
|
1321
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js"(exports, module2) {
|
|
1322
|
-
"use strict";
|
|
1323
|
-
var DatePart = require_datepart();
|
|
1324
|
-
var pos = (n) => {
|
|
1325
|
-
n = n % 10;
|
|
1326
|
-
return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th";
|
|
1327
|
-
};
|
|
1328
|
-
var Day = class extends DatePart {
|
|
1329
|
-
constructor(opts = {}) {
|
|
1330
|
-
super(opts);
|
|
1331
|
-
}
|
|
1332
|
-
up() {
|
|
1333
|
-
this.date.setDate(this.date.getDate() + 1);
|
|
1334
|
-
}
|
|
1335
|
-
down() {
|
|
1336
|
-
this.date.setDate(this.date.getDate() - 1);
|
|
1337
|
-
}
|
|
1338
|
-
setTo(val) {
|
|
1339
|
-
this.date.setDate(parseInt(val.substr(-2)));
|
|
1340
|
-
}
|
|
1341
|
-
toString() {
|
|
1342
|
-
let date = this.date.getDate();
|
|
1343
|
-
let day = this.date.getDay();
|
|
1344
|
-
return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date;
|
|
1345
|
-
}
|
|
1346
|
-
};
|
|
1347
|
-
module2.exports = Day;
|
|
1348
|
-
}
|
|
1349
|
-
});
|
|
1350
|
-
|
|
1351
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js
|
|
1352
|
-
var require_hours = __commonJS({
|
|
1353
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js"(exports, module2) {
|
|
1354
|
-
"use strict";
|
|
1355
|
-
var DatePart = require_datepart();
|
|
1356
|
-
var Hours = class extends DatePart {
|
|
1357
|
-
constructor(opts = {}) {
|
|
1358
|
-
super(opts);
|
|
1359
|
-
}
|
|
1360
|
-
up() {
|
|
1361
|
-
this.date.setHours(this.date.getHours() + 1);
|
|
1362
|
-
}
|
|
1363
|
-
down() {
|
|
1364
|
-
this.date.setHours(this.date.getHours() - 1);
|
|
1365
|
-
}
|
|
1366
|
-
setTo(val) {
|
|
1367
|
-
this.date.setHours(parseInt(val.substr(-2)));
|
|
1368
|
-
}
|
|
1369
|
-
toString() {
|
|
1370
|
-
let hours = this.date.getHours();
|
|
1371
|
-
if (/h/.test(this.token))
|
|
1372
|
-
hours = hours % 12 || 12;
|
|
1373
|
-
return this.token.length > 1 ? String(hours).padStart(2, "0") : hours;
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
module2.exports = Hours;
|
|
1377
|
-
}
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js
|
|
1381
|
-
var require_milliseconds = __commonJS({
|
|
1382
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js"(exports, module2) {
|
|
1383
|
-
"use strict";
|
|
1384
|
-
var DatePart = require_datepart();
|
|
1385
|
-
var Milliseconds = class extends DatePart {
|
|
1386
|
-
constructor(opts = {}) {
|
|
1387
|
-
super(opts);
|
|
1388
|
-
}
|
|
1389
|
-
up() {
|
|
1390
|
-
this.date.setMilliseconds(this.date.getMilliseconds() + 1);
|
|
1391
|
-
}
|
|
1392
|
-
down() {
|
|
1393
|
-
this.date.setMilliseconds(this.date.getMilliseconds() - 1);
|
|
1394
|
-
}
|
|
1395
|
-
setTo(val) {
|
|
1396
|
-
this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));
|
|
1397
|
-
}
|
|
1398
|
-
toString() {
|
|
1399
|
-
return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length);
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
module2.exports = Milliseconds;
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
|
|
1406
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js
|
|
1407
|
-
var require_minutes = __commonJS({
|
|
1408
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js"(exports, module2) {
|
|
1409
|
-
"use strict";
|
|
1410
|
-
var DatePart = require_datepart();
|
|
1411
|
-
var Minutes = class extends DatePart {
|
|
1412
|
-
constructor(opts = {}) {
|
|
1413
|
-
super(opts);
|
|
1414
|
-
}
|
|
1415
|
-
up() {
|
|
1416
|
-
this.date.setMinutes(this.date.getMinutes() + 1);
|
|
1417
|
-
}
|
|
1418
|
-
down() {
|
|
1419
|
-
this.date.setMinutes(this.date.getMinutes() - 1);
|
|
1420
|
-
}
|
|
1421
|
-
setTo(val) {
|
|
1422
|
-
this.date.setMinutes(parseInt(val.substr(-2)));
|
|
1423
|
-
}
|
|
1424
|
-
toString() {
|
|
1425
|
-
let m = this.date.getMinutes();
|
|
1426
|
-
return this.token.length > 1 ? String(m).padStart(2, "0") : m;
|
|
1427
|
-
}
|
|
1428
|
-
};
|
|
1429
|
-
module2.exports = Minutes;
|
|
1430
|
-
}
|
|
1431
|
-
});
|
|
1432
|
-
|
|
1433
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js
|
|
1434
|
-
var require_month = __commonJS({
|
|
1435
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js"(exports, module2) {
|
|
1436
|
-
"use strict";
|
|
1437
|
-
var DatePart = require_datepart();
|
|
1438
|
-
var Month = class extends DatePart {
|
|
1439
|
-
constructor(opts = {}) {
|
|
1440
|
-
super(opts);
|
|
1441
|
-
}
|
|
1442
|
-
up() {
|
|
1443
|
-
this.date.setMonth(this.date.getMonth() + 1);
|
|
1444
|
-
}
|
|
1445
|
-
down() {
|
|
1446
|
-
this.date.setMonth(this.date.getMonth() - 1);
|
|
1447
|
-
}
|
|
1448
|
-
setTo(val) {
|
|
1449
|
-
val = parseInt(val.substr(-2)) - 1;
|
|
1450
|
-
this.date.setMonth(val < 0 ? 0 : val);
|
|
1451
|
-
}
|
|
1452
|
-
toString() {
|
|
1453
|
-
let month = this.date.getMonth();
|
|
1454
|
-
let tl = this.token.length;
|
|
1455
|
-
return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);
|
|
1456
|
-
}
|
|
1457
|
-
};
|
|
1458
|
-
module2.exports = Month;
|
|
1459
|
-
}
|
|
1460
|
-
});
|
|
1461
|
-
|
|
1462
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js
|
|
1463
|
-
var require_seconds = __commonJS({
|
|
1464
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js"(exports, module2) {
|
|
1465
|
-
"use strict";
|
|
1466
|
-
var DatePart = require_datepart();
|
|
1467
|
-
var Seconds = class extends DatePart {
|
|
1468
|
-
constructor(opts = {}) {
|
|
1469
|
-
super(opts);
|
|
1470
|
-
}
|
|
1471
|
-
up() {
|
|
1472
|
-
this.date.setSeconds(this.date.getSeconds() + 1);
|
|
1473
|
-
}
|
|
1474
|
-
down() {
|
|
1475
|
-
this.date.setSeconds(this.date.getSeconds() - 1);
|
|
1476
|
-
}
|
|
1477
|
-
setTo(val) {
|
|
1478
|
-
this.date.setSeconds(parseInt(val.substr(-2)));
|
|
1479
|
-
}
|
|
1480
|
-
toString() {
|
|
1481
|
-
let s = this.date.getSeconds();
|
|
1482
|
-
return this.token.length > 1 ? String(s).padStart(2, "0") : s;
|
|
1483
|
-
}
|
|
1484
|
-
};
|
|
1485
|
-
module2.exports = Seconds;
|
|
1486
|
-
}
|
|
1487
|
-
});
|
|
1488
|
-
|
|
1489
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js
|
|
1490
|
-
var require_year = __commonJS({
|
|
1491
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js"(exports, module2) {
|
|
1492
|
-
"use strict";
|
|
1493
|
-
var DatePart = require_datepart();
|
|
1494
|
-
var Year = class extends DatePart {
|
|
1495
|
-
constructor(opts = {}) {
|
|
1496
|
-
super(opts);
|
|
1497
|
-
}
|
|
1498
|
-
up() {
|
|
1499
|
-
this.date.setFullYear(this.date.getFullYear() + 1);
|
|
1500
|
-
}
|
|
1501
|
-
down() {
|
|
1502
|
-
this.date.setFullYear(this.date.getFullYear() - 1);
|
|
1503
|
-
}
|
|
1504
|
-
setTo(val) {
|
|
1505
|
-
this.date.setFullYear(val.substr(-4));
|
|
1506
|
-
}
|
|
1507
|
-
toString() {
|
|
1508
|
-
let year = String(this.date.getFullYear()).padStart(4, "0");
|
|
1509
|
-
return this.token.length === 2 ? year.substr(-2) : year;
|
|
1510
|
-
}
|
|
1511
|
-
};
|
|
1512
|
-
module2.exports = Year;
|
|
1513
|
-
}
|
|
1514
|
-
});
|
|
1515
|
-
|
|
1516
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js
|
|
1517
|
-
var require_dateparts = __commonJS({
|
|
1518
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js"(exports, module2) {
|
|
1519
|
-
"use strict";
|
|
1520
|
-
module2.exports = {
|
|
1521
|
-
DatePart: require_datepart(),
|
|
1522
|
-
Meridiem: require_meridiem(),
|
|
1523
|
-
Day: require_day(),
|
|
1524
|
-
Hours: require_hours(),
|
|
1525
|
-
Milliseconds: require_milliseconds(),
|
|
1526
|
-
Minutes: require_minutes(),
|
|
1527
|
-
Month: require_month(),
|
|
1528
|
-
Seconds: require_seconds(),
|
|
1529
|
-
Year: require_year()
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
|
-
});
|
|
1533
|
-
|
|
1534
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js
|
|
1535
|
-
var require_date = __commonJS({
|
|
1536
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports, module2) {
|
|
1537
|
-
"use strict";
|
|
1538
|
-
function asyncGeneratorStep(gen, resolve5, reject, _next, _throw, key, arg) {
|
|
1539
|
-
try {
|
|
1540
|
-
var info = gen[key](arg);
|
|
1541
|
-
var value = info.value;
|
|
1542
|
-
} catch (error) {
|
|
1543
|
-
reject(error);
|
|
1544
|
-
return;
|
|
1545
|
-
}
|
|
1546
|
-
if (info.done) {
|
|
1547
|
-
resolve5(value);
|
|
1548
|
-
} else {
|
|
1549
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
function _asyncToGenerator(fn) {
|
|
1553
|
-
return function() {
|
|
1554
|
-
var self2 = this, args = arguments;
|
|
1555
|
-
return new Promise(function(resolve5, reject) {
|
|
1556
|
-
var gen = fn.apply(self2, args);
|
|
1557
|
-
function _next(value) {
|
|
1558
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
|
|
1559
|
-
}
|
|
1560
|
-
function _throw(err) {
|
|
1561
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
|
|
1562
|
-
}
|
|
1563
|
-
_next(void 0);
|
|
1564
|
-
});
|
|
1565
|
-
};
|
|
1566
|
-
}
|
|
1567
|
-
var color = require_kleur();
|
|
1568
|
-
var Prompt = require_prompt();
|
|
1569
|
-
var _require = require_util();
|
|
1570
|
-
var style = _require.style;
|
|
1571
|
-
var clear = _require.clear;
|
|
1572
|
-
var figures = _require.figures;
|
|
1573
|
-
var _require2 = require_src();
|
|
1574
|
-
var erase = _require2.erase;
|
|
1575
|
-
var cursor = _require2.cursor;
|
|
1576
|
-
var _require3 = require_dateparts();
|
|
1577
|
-
var DatePart = _require3.DatePart;
|
|
1578
|
-
var Meridiem = _require3.Meridiem;
|
|
1579
|
-
var Day = _require3.Day;
|
|
1580
|
-
var Hours = _require3.Hours;
|
|
1581
|
-
var Milliseconds = _require3.Milliseconds;
|
|
1582
|
-
var Minutes = _require3.Minutes;
|
|
1583
|
-
var Month = _require3.Month;
|
|
1584
|
-
var Seconds = _require3.Seconds;
|
|
1585
|
-
var Year = _require3.Year;
|
|
1586
|
-
var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
|
|
1587
|
-
var regexGroups = {
|
|
1588
|
-
1: ({
|
|
1589
|
-
token
|
|
1590
|
-
}) => token.replace(/\\(.)/g, "$1"),
|
|
1591
|
-
2: (opts) => new Day(opts),
|
|
1592
|
-
3: (opts) => new Month(opts),
|
|
1593
|
-
4: (opts) => new Year(opts),
|
|
1594
|
-
5: (opts) => new Meridiem(opts),
|
|
1595
|
-
6: (opts) => new Hours(opts),
|
|
1596
|
-
7: (opts) => new Minutes(opts),
|
|
1597
|
-
8: (opts) => new Seconds(opts),
|
|
1598
|
-
9: (opts) => new Milliseconds(opts)
|
|
1599
|
-
};
|
|
1600
|
-
var dfltLocales = {
|
|
1601
|
-
months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
|
|
1602
|
-
monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
|
|
1603
|
-
weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
|
|
1604
|
-
weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")
|
|
1605
|
-
};
|
|
1606
|
-
var DatePrompt = class extends Prompt {
|
|
1607
|
-
constructor(opts = {}) {
|
|
1608
|
-
super(opts);
|
|
1609
|
-
this.msg = opts.message;
|
|
1610
|
-
this.cursor = 0;
|
|
1611
|
-
this.typed = "";
|
|
1612
|
-
this.locales = Object.assign(dfltLocales, opts.locales);
|
|
1613
|
-
this._date = opts.initial || new Date();
|
|
1614
|
-
this.errorMsg = opts.error || "Please Enter A Valid Value";
|
|
1615
|
-
this.validator = opts.validate || (() => true);
|
|
1616
|
-
this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
|
|
1617
|
-
this.clear = clear("", this.out.columns);
|
|
1618
|
-
this.render();
|
|
1619
|
-
}
|
|
1620
|
-
get value() {
|
|
1621
|
-
return this.date;
|
|
1622
|
-
}
|
|
1623
|
-
get date() {
|
|
1624
|
-
return this._date;
|
|
1625
|
-
}
|
|
1626
|
-
set date(date) {
|
|
1627
|
-
if (date)
|
|
1628
|
-
this._date.setTime(date.getTime());
|
|
1629
|
-
}
|
|
1630
|
-
set mask(mask) {
|
|
1631
|
-
let result;
|
|
1632
|
-
this.parts = [];
|
|
1633
|
-
while (result = regex.exec(mask)) {
|
|
1634
|
-
let match = result.shift();
|
|
1635
|
-
let idx = result.findIndex((gr) => gr != null);
|
|
1636
|
-
this.parts.push(idx in regexGroups ? regexGroups[idx]({
|
|
1637
|
-
token: result[idx] || match,
|
|
1638
|
-
date: this.date,
|
|
1639
|
-
parts: this.parts,
|
|
1640
|
-
locales: this.locales
|
|
1641
|
-
}) : result[idx] || match);
|
|
1642
|
-
}
|
|
1643
|
-
let parts = this.parts.reduce((arr, i) => {
|
|
1644
|
-
if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
|
|
1645
|
-
arr[arr.length - 1] += i;
|
|
1646
|
-
else
|
|
1647
|
-
arr.push(i);
|
|
1648
|
-
return arr;
|
|
1649
|
-
}, []);
|
|
1650
|
-
this.parts.splice(0);
|
|
1651
|
-
this.parts.push(...parts);
|
|
1652
|
-
this.reset();
|
|
1653
|
-
}
|
|
1654
|
-
moveCursor(n) {
|
|
1655
|
-
this.typed = "";
|
|
1656
|
-
this.cursor = n;
|
|
1657
|
-
this.fire();
|
|
1658
|
-
}
|
|
1659
|
-
reset() {
|
|
1660
|
-
this.moveCursor(this.parts.findIndex((p) => p instanceof DatePart));
|
|
1661
|
-
this.fire();
|
|
1662
|
-
this.render();
|
|
1663
|
-
}
|
|
1664
|
-
exit() {
|
|
1665
|
-
this.abort();
|
|
1666
|
-
}
|
|
1667
|
-
abort() {
|
|
1668
|
-
this.done = this.aborted = true;
|
|
1669
|
-
this.error = false;
|
|
1670
|
-
this.fire();
|
|
1671
|
-
this.render();
|
|
1672
|
-
this.out.write("\n");
|
|
1673
|
-
this.close();
|
|
1674
|
-
}
|
|
1675
|
-
validate() {
|
|
1676
|
-
var _this = this;
|
|
1677
|
-
return _asyncToGenerator(function* () {
|
|
1678
|
-
let valid = yield _this.validator(_this.value);
|
|
1679
|
-
if (typeof valid === "string") {
|
|
1680
|
-
_this.errorMsg = valid;
|
|
1681
|
-
valid = false;
|
|
1682
|
-
}
|
|
1683
|
-
_this.error = !valid;
|
|
1684
|
-
})();
|
|
1685
|
-
}
|
|
1686
|
-
submit() {
|
|
1687
|
-
var _this2 = this;
|
|
1688
|
-
return _asyncToGenerator(function* () {
|
|
1689
|
-
yield _this2.validate();
|
|
1690
|
-
if (_this2.error) {
|
|
1691
|
-
_this2.color = "red";
|
|
1692
|
-
_this2.fire();
|
|
1693
|
-
_this2.render();
|
|
1694
|
-
return;
|
|
1695
|
-
}
|
|
1696
|
-
_this2.done = true;
|
|
1697
|
-
_this2.aborted = false;
|
|
1698
|
-
_this2.fire();
|
|
1699
|
-
_this2.render();
|
|
1700
|
-
_this2.out.write("\n");
|
|
1701
|
-
_this2.close();
|
|
1702
|
-
})();
|
|
1703
|
-
}
|
|
1704
|
-
up() {
|
|
1705
|
-
this.typed = "";
|
|
1706
|
-
this.parts[this.cursor].up();
|
|
1707
|
-
this.render();
|
|
1708
|
-
}
|
|
1709
|
-
down() {
|
|
1710
|
-
this.typed = "";
|
|
1711
|
-
this.parts[this.cursor].down();
|
|
1712
|
-
this.render();
|
|
1713
|
-
}
|
|
1714
|
-
left() {
|
|
1715
|
-
let prev = this.parts[this.cursor].prev();
|
|
1716
|
-
if (prev == null)
|
|
1717
|
-
return this.bell();
|
|
1718
|
-
this.moveCursor(this.parts.indexOf(prev));
|
|
1719
|
-
this.render();
|
|
1720
|
-
}
|
|
1721
|
-
right() {
|
|
1722
|
-
let next = this.parts[this.cursor].next();
|
|
1723
|
-
if (next == null)
|
|
1724
|
-
return this.bell();
|
|
1725
|
-
this.moveCursor(this.parts.indexOf(next));
|
|
1726
|
-
this.render();
|
|
1727
|
-
}
|
|
1728
|
-
next() {
|
|
1729
|
-
let next = this.parts[this.cursor].next();
|
|
1730
|
-
this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart));
|
|
1731
|
-
this.render();
|
|
1732
|
-
}
|
|
1733
|
-
_(c) {
|
|
1734
|
-
if (/\d/.test(c)) {
|
|
1735
|
-
this.typed += c;
|
|
1736
|
-
this.parts[this.cursor].setTo(this.typed);
|
|
1737
|
-
this.render();
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
render() {
|
|
1741
|
-
if (this.closed)
|
|
1742
|
-
return;
|
|
1743
|
-
if (this.firstRender)
|
|
1744
|
-
this.out.write(cursor.hide);
|
|
1745
|
-
else
|
|
1746
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1747
|
-
super.render();
|
|
1748
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join("")].join(" ");
|
|
1749
|
-
if (this.error) {
|
|
1750
|
-
this.outputText += this.errorMsg.split("\n").reduce((a, l, i) => a + `
|
|
1751
|
-
${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
1752
|
-
}
|
|
1753
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText);
|
|
1754
|
-
}
|
|
1755
|
-
};
|
|
1756
|
-
module2.exports = DatePrompt;
|
|
1757
|
-
}
|
|
1758
|
-
});
|
|
1759
|
-
|
|
1760
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js
|
|
1761
|
-
var require_number = __commonJS({
|
|
1762
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports, module2) {
|
|
1763
|
-
"use strict";
|
|
1764
|
-
function asyncGeneratorStep(gen, resolve5, reject, _next, _throw, key, arg) {
|
|
1765
|
-
try {
|
|
1766
|
-
var info = gen[key](arg);
|
|
1767
|
-
var value = info.value;
|
|
1768
|
-
} catch (error) {
|
|
1769
|
-
reject(error);
|
|
1770
|
-
return;
|
|
1771
|
-
}
|
|
1772
|
-
if (info.done) {
|
|
1773
|
-
resolve5(value);
|
|
1774
|
-
} else {
|
|
1775
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
function _asyncToGenerator(fn) {
|
|
1779
|
-
return function() {
|
|
1780
|
-
var self2 = this, args = arguments;
|
|
1781
|
-
return new Promise(function(resolve5, reject) {
|
|
1782
|
-
var gen = fn.apply(self2, args);
|
|
1783
|
-
function _next(value) {
|
|
1784
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
|
|
1785
|
-
}
|
|
1786
|
-
function _throw(err) {
|
|
1787
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
|
|
1788
|
-
}
|
|
1789
|
-
_next(void 0);
|
|
1790
|
-
});
|
|
1791
|
-
};
|
|
1792
|
-
}
|
|
1793
|
-
var color = require_kleur();
|
|
1794
|
-
var Prompt = require_prompt();
|
|
1795
|
-
var _require = require_src();
|
|
1796
|
-
var cursor = _require.cursor;
|
|
1797
|
-
var erase = _require.erase;
|
|
1798
|
-
var _require2 = require_util();
|
|
1799
|
-
var style = _require2.style;
|
|
1800
|
-
var figures = _require2.figures;
|
|
1801
|
-
var clear = _require2.clear;
|
|
1802
|
-
var lines = _require2.lines;
|
|
1803
|
-
var isNumber = /[0-9]/;
|
|
1804
|
-
var isDef = (any) => any !== void 0;
|
|
1805
|
-
var round = (number, precision) => {
|
|
1806
|
-
let factor = Math.pow(10, precision);
|
|
1807
|
-
return Math.round(number * factor) / factor;
|
|
1808
|
-
};
|
|
1809
|
-
var NumberPrompt = class extends Prompt {
|
|
1810
|
-
constructor(opts = {}) {
|
|
1811
|
-
super(opts);
|
|
1812
|
-
this.transform = style.render(opts.style);
|
|
1813
|
-
this.msg = opts.message;
|
|
1814
|
-
this.initial = isDef(opts.initial) ? opts.initial : "";
|
|
1815
|
-
this.float = !!opts.float;
|
|
1816
|
-
this.round = opts.round || 2;
|
|
1817
|
-
this.inc = opts.increment || 1;
|
|
1818
|
-
this.min = isDef(opts.min) ? opts.min : -Infinity;
|
|
1819
|
-
this.max = isDef(opts.max) ? opts.max : Infinity;
|
|
1820
|
-
this.errorMsg = opts.error || `Please Enter A Valid Value`;
|
|
1821
|
-
this.validator = opts.validate || (() => true);
|
|
1822
|
-
this.color = `cyan`;
|
|
1823
|
-
this.value = ``;
|
|
1824
|
-
this.typed = ``;
|
|
1825
|
-
this.lastHit = 0;
|
|
1826
|
-
this.render();
|
|
1827
|
-
}
|
|
1828
|
-
set value(v) {
|
|
1829
|
-
if (!v && v !== 0) {
|
|
1830
|
-
this.placeholder = true;
|
|
1831
|
-
this.rendered = color.gray(this.transform.render(`${this.initial}`));
|
|
1832
|
-
this._value = ``;
|
|
1833
|
-
} else {
|
|
1834
|
-
this.placeholder = false;
|
|
1835
|
-
this.rendered = this.transform.render(`${round(v, this.round)}`);
|
|
1836
|
-
this._value = round(v, this.round);
|
|
1837
|
-
}
|
|
1838
|
-
this.fire();
|
|
1839
|
-
}
|
|
1840
|
-
get value() {
|
|
1841
|
-
return this._value;
|
|
1842
|
-
}
|
|
1843
|
-
parse(x) {
|
|
1844
|
-
return this.float ? parseFloat(x) : parseInt(x);
|
|
1845
|
-
}
|
|
1846
|
-
valid(c) {
|
|
1847
|
-
return c === `-` || c === `.` && this.float || isNumber.test(c);
|
|
1848
|
-
}
|
|
1849
|
-
reset() {
|
|
1850
|
-
this.typed = ``;
|
|
1851
|
-
this.value = ``;
|
|
1852
|
-
this.fire();
|
|
1853
|
-
this.render();
|
|
1854
|
-
}
|
|
1855
|
-
exit() {
|
|
1856
|
-
this.abort();
|
|
1857
|
-
}
|
|
1858
|
-
abort() {
|
|
1859
|
-
let x = this.value;
|
|
1860
|
-
this.value = x !== `` ? x : this.initial;
|
|
1861
|
-
this.done = this.aborted = true;
|
|
1862
|
-
this.error = false;
|
|
1863
|
-
this.fire();
|
|
1864
|
-
this.render();
|
|
1865
|
-
this.out.write(`
|
|
1866
|
-
`);
|
|
1867
|
-
this.close();
|
|
1868
|
-
}
|
|
1869
|
-
validate() {
|
|
1870
|
-
var _this = this;
|
|
1871
|
-
return _asyncToGenerator(function* () {
|
|
1872
|
-
let valid = yield _this.validator(_this.value);
|
|
1873
|
-
if (typeof valid === `string`) {
|
|
1874
|
-
_this.errorMsg = valid;
|
|
1875
|
-
valid = false;
|
|
1876
|
-
}
|
|
1877
|
-
_this.error = !valid;
|
|
1878
|
-
})();
|
|
1879
|
-
}
|
|
1880
|
-
submit() {
|
|
1881
|
-
var _this2 = this;
|
|
1882
|
-
return _asyncToGenerator(function* () {
|
|
1883
|
-
yield _this2.validate();
|
|
1884
|
-
if (_this2.error) {
|
|
1885
|
-
_this2.color = `red`;
|
|
1886
|
-
_this2.fire();
|
|
1887
|
-
_this2.render();
|
|
1888
|
-
return;
|
|
1889
|
-
}
|
|
1890
|
-
let x = _this2.value;
|
|
1891
|
-
_this2.value = x !== `` ? x : _this2.initial;
|
|
1892
|
-
_this2.done = true;
|
|
1893
|
-
_this2.aborted = false;
|
|
1894
|
-
_this2.error = false;
|
|
1895
|
-
_this2.fire();
|
|
1896
|
-
_this2.render();
|
|
1897
|
-
_this2.out.write(`
|
|
1898
|
-
`);
|
|
1899
|
-
_this2.close();
|
|
1900
|
-
})();
|
|
1901
|
-
}
|
|
1902
|
-
up() {
|
|
1903
|
-
this.typed = ``;
|
|
1904
|
-
if (this.value === "") {
|
|
1905
|
-
this.value = this.min - this.inc;
|
|
1906
|
-
}
|
|
1907
|
-
if (this.value >= this.max)
|
|
1908
|
-
return this.bell();
|
|
1909
|
-
this.value += this.inc;
|
|
1910
|
-
this.color = `cyan`;
|
|
1911
|
-
this.fire();
|
|
1912
|
-
this.render();
|
|
1913
|
-
}
|
|
1914
|
-
down() {
|
|
1915
|
-
this.typed = ``;
|
|
1916
|
-
if (this.value === "") {
|
|
1917
|
-
this.value = this.min + this.inc;
|
|
1918
|
-
}
|
|
1919
|
-
if (this.value <= this.min)
|
|
1920
|
-
return this.bell();
|
|
1921
|
-
this.value -= this.inc;
|
|
1922
|
-
this.color = `cyan`;
|
|
1923
|
-
this.fire();
|
|
1924
|
-
this.render();
|
|
1925
|
-
}
|
|
1926
|
-
delete() {
|
|
1927
|
-
let val = this.value.toString();
|
|
1928
|
-
if (val.length === 0)
|
|
1929
|
-
return this.bell();
|
|
1930
|
-
this.value = this.parse(val = val.slice(0, -1)) || ``;
|
|
1931
|
-
if (this.value !== "" && this.value < this.min) {
|
|
1932
|
-
this.value = this.min;
|
|
1933
|
-
}
|
|
1934
|
-
this.color = `cyan`;
|
|
1935
|
-
this.fire();
|
|
1936
|
-
this.render();
|
|
1937
|
-
}
|
|
1938
|
-
next() {
|
|
1939
|
-
this.value = this.initial;
|
|
1940
|
-
this.fire();
|
|
1941
|
-
this.render();
|
|
1942
|
-
}
|
|
1943
|
-
_(c, key) {
|
|
1944
|
-
if (!this.valid(c))
|
|
1945
|
-
return this.bell();
|
|
1946
|
-
const now = Date.now();
|
|
1947
|
-
if (now - this.lastHit > 1e3)
|
|
1948
|
-
this.typed = ``;
|
|
1949
|
-
this.typed += c;
|
|
1950
|
-
this.lastHit = now;
|
|
1951
|
-
this.color = `cyan`;
|
|
1952
|
-
if (c === `.`)
|
|
1953
|
-
return this.fire();
|
|
1954
|
-
this.value = Math.min(this.parse(this.typed), this.max);
|
|
1955
|
-
if (this.value > this.max)
|
|
1956
|
-
this.value = this.max;
|
|
1957
|
-
if (this.value < this.min)
|
|
1958
|
-
this.value = this.min;
|
|
1959
|
-
this.fire();
|
|
1960
|
-
this.render();
|
|
1961
|
-
}
|
|
1962
|
-
render() {
|
|
1963
|
-
if (this.closed)
|
|
1964
|
-
return;
|
|
1965
|
-
if (!this.firstRender) {
|
|
1966
|
-
if (this.outputError)
|
|
1967
|
-
this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
1968
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1969
|
-
}
|
|
1970
|
-
super.render();
|
|
1971
|
-
this.outputError = "";
|
|
1972
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `);
|
|
1973
|
-
if (this.error) {
|
|
1974
|
-
this.outputError += this.errorMsg.split(`
|
|
1975
|
-
`).reduce((a, l, i) => a + `
|
|
1976
|
-
${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
1977
|
-
}
|
|
1978
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);
|
|
1979
|
-
}
|
|
1980
|
-
};
|
|
1981
|
-
module2.exports = NumberPrompt;
|
|
1982
|
-
}
|
|
1983
|
-
});
|
|
1984
|
-
|
|
1985
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js
|
|
1986
|
-
var require_multiselect = __commonJS({
|
|
1987
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports, module2) {
|
|
1988
|
-
"use strict";
|
|
1989
|
-
var color = require_kleur();
|
|
1990
|
-
var _require = require_src();
|
|
1991
|
-
var cursor = _require.cursor;
|
|
1992
|
-
var Prompt = require_prompt();
|
|
1993
|
-
var _require2 = require_util();
|
|
1994
|
-
var clear = _require2.clear;
|
|
1995
|
-
var figures = _require2.figures;
|
|
1996
|
-
var style = _require2.style;
|
|
1997
|
-
var wrap = _require2.wrap;
|
|
1998
|
-
var entriesToDisplay = _require2.entriesToDisplay;
|
|
1999
|
-
var MultiselectPrompt = class extends Prompt {
|
|
2000
|
-
constructor(opts = {}) {
|
|
2001
|
-
super(opts);
|
|
2002
|
-
this.msg = opts.message;
|
|
2003
|
-
this.cursor = opts.cursor || 0;
|
|
2004
|
-
this.scrollIndex = opts.cursor || 0;
|
|
2005
|
-
this.hint = opts.hint || "";
|
|
2006
|
-
this.warn = opts.warn || "- This option is disabled -";
|
|
2007
|
-
this.minSelected = opts.min;
|
|
2008
|
-
this.showMinError = false;
|
|
2009
|
-
this.maxChoices = opts.max;
|
|
2010
|
-
this.instructions = opts.instructions;
|
|
2011
|
-
this.optionsPerPage = opts.optionsPerPage || 10;
|
|
2012
|
-
this.value = opts.choices.map((ch, idx) => {
|
|
2013
|
-
if (typeof ch === "string")
|
|
2014
|
-
ch = {
|
|
2015
|
-
title: ch,
|
|
2016
|
-
value: idx
|
|
2017
|
-
};
|
|
2018
|
-
return {
|
|
2019
|
-
title: ch && (ch.title || ch.value || ch),
|
|
2020
|
-
description: ch && ch.description,
|
|
2021
|
-
value: ch && (ch.value === void 0 ? idx : ch.value),
|
|
2022
|
-
selected: ch && ch.selected,
|
|
2023
|
-
disabled: ch && ch.disabled
|
|
2024
|
-
};
|
|
2025
|
-
});
|
|
2026
|
-
this.clear = clear("", this.out.columns);
|
|
2027
|
-
if (!opts.overrideRender) {
|
|
2028
|
-
this.render();
|
|
2029
|
-
}
|
|
2030
|
-
}
|
|
2031
|
-
reset() {
|
|
2032
|
-
this.value.map((v) => !v.selected);
|
|
2033
|
-
this.cursor = 0;
|
|
2034
|
-
this.fire();
|
|
2035
|
-
this.render();
|
|
2036
|
-
}
|
|
2037
|
-
selected() {
|
|
2038
|
-
return this.value.filter((v) => v.selected);
|
|
2039
|
-
}
|
|
2040
|
-
exit() {
|
|
2041
|
-
this.abort();
|
|
2042
|
-
}
|
|
2043
|
-
abort() {
|
|
2044
|
-
this.done = this.aborted = true;
|
|
2045
|
-
this.fire();
|
|
2046
|
-
this.render();
|
|
2047
|
-
this.out.write("\n");
|
|
2048
|
-
this.close();
|
|
2049
|
-
}
|
|
2050
|
-
submit() {
|
|
2051
|
-
const selected = this.value.filter((e) => e.selected);
|
|
2052
|
-
if (this.minSelected && selected.length < this.minSelected) {
|
|
2053
|
-
this.showMinError = true;
|
|
2054
|
-
this.render();
|
|
2055
|
-
} else {
|
|
2056
|
-
this.done = true;
|
|
2057
|
-
this.aborted = false;
|
|
2058
|
-
this.fire();
|
|
2059
|
-
this.render();
|
|
2060
|
-
this.out.write("\n");
|
|
2061
|
-
this.close();
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
first() {
|
|
2065
|
-
this.cursor = 0;
|
|
2066
|
-
this.render();
|
|
2067
|
-
}
|
|
2068
|
-
last() {
|
|
2069
|
-
this.cursor = this.value.length - 1;
|
|
2070
|
-
this.render();
|
|
2071
|
-
}
|
|
2072
|
-
next() {
|
|
2073
|
-
this.cursor = (this.cursor + 1) % this.value.length;
|
|
2074
|
-
this.render();
|
|
2075
|
-
}
|
|
2076
|
-
up() {
|
|
2077
|
-
if (this.cursor === 0) {
|
|
2078
|
-
this.cursor = this.value.length - 1;
|
|
2079
|
-
} else {
|
|
2080
|
-
this.cursor--;
|
|
2081
|
-
}
|
|
2082
|
-
this.render();
|
|
2083
|
-
}
|
|
2084
|
-
down() {
|
|
2085
|
-
if (this.cursor === this.value.length - 1) {
|
|
2086
|
-
this.cursor = 0;
|
|
2087
|
-
} else {
|
|
2088
|
-
this.cursor++;
|
|
2089
|
-
}
|
|
2090
|
-
this.render();
|
|
2091
|
-
}
|
|
2092
|
-
left() {
|
|
2093
|
-
this.value[this.cursor].selected = false;
|
|
2094
|
-
this.render();
|
|
2095
|
-
}
|
|
2096
|
-
right() {
|
|
2097
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
2098
|
-
return this.bell();
|
|
2099
|
-
this.value[this.cursor].selected = true;
|
|
2100
|
-
this.render();
|
|
2101
|
-
}
|
|
2102
|
-
handleSpaceToggle() {
|
|
2103
|
-
const v = this.value[this.cursor];
|
|
2104
|
-
if (v.selected) {
|
|
2105
|
-
v.selected = false;
|
|
2106
|
-
this.render();
|
|
2107
|
-
} else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) {
|
|
2108
|
-
return this.bell();
|
|
2109
|
-
} else {
|
|
2110
|
-
v.selected = true;
|
|
2111
|
-
this.render();
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
toggleAll() {
|
|
2115
|
-
if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) {
|
|
2116
|
-
return this.bell();
|
|
2117
|
-
}
|
|
2118
|
-
const newSelected = !this.value[this.cursor].selected;
|
|
2119
|
-
this.value.filter((v) => !v.disabled).forEach((v) => v.selected = newSelected);
|
|
2120
|
-
this.render();
|
|
2121
|
-
}
|
|
2122
|
-
_(c, key) {
|
|
2123
|
-
if (c === " ") {
|
|
2124
|
-
this.handleSpaceToggle();
|
|
2125
|
-
} else if (c === "a") {
|
|
2126
|
-
this.toggleAll();
|
|
2127
|
-
} else {
|
|
2128
|
-
return this.bell();
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
renderInstructions() {
|
|
2132
|
-
if (this.instructions === void 0 || this.instructions) {
|
|
2133
|
-
if (typeof this.instructions === "string") {
|
|
2134
|
-
return this.instructions;
|
|
2135
|
-
}
|
|
2136
|
-
return `
|
|
2137
|
-
Instructions:
|
|
2138
|
-
${figures.arrowUp}/${figures.arrowDown}: Highlight option
|
|
2139
|
-
${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
|
|
2140
|
-
` + (this.maxChoices === void 0 ? ` a: Toggle all
|
|
2141
|
-
` : "") + ` enter/return: Complete answer`;
|
|
2142
|
-
}
|
|
2143
|
-
return "";
|
|
2144
|
-
}
|
|
2145
|
-
renderOption(cursor2, v, i, arrowIndicator) {
|
|
2146
|
-
const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
|
|
2147
|
-
let title, desc;
|
|
2148
|
-
if (v.disabled) {
|
|
2149
|
-
title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
2150
|
-
} else {
|
|
2151
|
-
title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
2152
|
-
if (cursor2 === i && v.description) {
|
|
2153
|
-
desc = ` - ${v.description}`;
|
|
2154
|
-
if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
2155
|
-
desc = "\n" + wrap(v.description, {
|
|
2156
|
-
margin: prefix.length,
|
|
2157
|
-
width: this.out.columns
|
|
2158
|
-
});
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
return prefix + title + color.gray(desc || "");
|
|
2163
|
-
}
|
|
2164
|
-
paginateOptions(options2) {
|
|
2165
|
-
if (options2.length === 0) {
|
|
2166
|
-
return color.red("No matches for this query.");
|
|
2167
|
-
}
|
|
2168
|
-
let _entriesToDisplay = entriesToDisplay(this.cursor, options2.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
2169
|
-
let prefix, styledOptions = [];
|
|
2170
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
2171
|
-
if (i === startIndex && startIndex > 0) {
|
|
2172
|
-
prefix = figures.arrowUp;
|
|
2173
|
-
} else if (i === endIndex - 1 && endIndex < options2.length) {
|
|
2174
|
-
prefix = figures.arrowDown;
|
|
2175
|
-
} else {
|
|
2176
|
-
prefix = " ";
|
|
2177
|
-
}
|
|
2178
|
-
styledOptions.push(this.renderOption(this.cursor, options2[i], i, prefix));
|
|
2179
|
-
}
|
|
2180
|
-
return "\n" + styledOptions.join("\n");
|
|
2181
|
-
}
|
|
2182
|
-
renderOptions(options2) {
|
|
2183
|
-
if (!this.done) {
|
|
2184
|
-
return this.paginateOptions(options2);
|
|
2185
|
-
}
|
|
2186
|
-
return "";
|
|
2187
|
-
}
|
|
2188
|
-
renderDoneOrInstructions() {
|
|
2189
|
-
if (this.done) {
|
|
2190
|
-
return this.value.filter((e) => e.selected).map((v) => v.title).join(", ");
|
|
2191
|
-
}
|
|
2192
|
-
const output = [color.gray(this.hint), this.renderInstructions()];
|
|
2193
|
-
if (this.value[this.cursor].disabled) {
|
|
2194
|
-
output.push(color.yellow(this.warn));
|
|
2195
|
-
}
|
|
2196
|
-
return output.join(" ");
|
|
2197
|
-
}
|
|
2198
|
-
render() {
|
|
2199
|
-
if (this.closed)
|
|
2200
|
-
return;
|
|
2201
|
-
if (this.firstRender)
|
|
2202
|
-
this.out.write(cursor.hide);
|
|
2203
|
-
super.render();
|
|
2204
|
-
let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
2205
|
-
if (this.showMinError) {
|
|
2206
|
-
prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
2207
|
-
this.showMinError = false;
|
|
2208
|
-
}
|
|
2209
|
-
prompt += this.renderOptions(this.value);
|
|
2210
|
-
this.out.write(this.clear + prompt);
|
|
2211
|
-
this.clear = clear(prompt, this.out.columns);
|
|
2212
|
-
}
|
|
2213
|
-
};
|
|
2214
|
-
module2.exports = MultiselectPrompt;
|
|
2215
|
-
}
|
|
2216
|
-
});
|
|
2217
|
-
|
|
2218
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js
|
|
2219
|
-
var require_autocomplete = __commonJS({
|
|
2220
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports, module2) {
|
|
2221
|
-
"use strict";
|
|
2222
|
-
function asyncGeneratorStep(gen, resolve5, reject, _next, _throw, key, arg) {
|
|
2223
|
-
try {
|
|
2224
|
-
var info = gen[key](arg);
|
|
2225
|
-
var value = info.value;
|
|
2226
|
-
} catch (error) {
|
|
2227
|
-
reject(error);
|
|
2228
|
-
return;
|
|
2229
|
-
}
|
|
2230
|
-
if (info.done) {
|
|
2231
|
-
resolve5(value);
|
|
2232
|
-
} else {
|
|
2233
|
-
Promise.resolve(value).then(_next, _throw);
|
|
2234
|
-
}
|
|
2235
|
-
}
|
|
2236
|
-
function _asyncToGenerator(fn) {
|
|
2237
|
-
return function() {
|
|
2238
|
-
var self2 = this, args = arguments;
|
|
2239
|
-
return new Promise(function(resolve5, reject) {
|
|
2240
|
-
var gen = fn.apply(self2, args);
|
|
2241
|
-
function _next(value) {
|
|
2242
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
|
|
2243
|
-
}
|
|
2244
|
-
function _throw(err) {
|
|
2245
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
|
|
2246
|
-
}
|
|
2247
|
-
_next(void 0);
|
|
2248
|
-
});
|
|
2249
|
-
};
|
|
2250
|
-
}
|
|
2251
|
-
var color = require_kleur();
|
|
2252
|
-
var Prompt = require_prompt();
|
|
2253
|
-
var _require = require_src();
|
|
2254
|
-
var erase = _require.erase;
|
|
2255
|
-
var cursor = _require.cursor;
|
|
2256
|
-
var _require2 = require_util();
|
|
2257
|
-
var style = _require2.style;
|
|
2258
|
-
var clear = _require2.clear;
|
|
2259
|
-
var figures = _require2.figures;
|
|
2260
|
-
var wrap = _require2.wrap;
|
|
2261
|
-
var entriesToDisplay = _require2.entriesToDisplay;
|
|
2262
|
-
var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);
|
|
2263
|
-
var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);
|
|
2264
|
-
var getIndex = (arr, valOrTitle) => {
|
|
2265
|
-
const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle);
|
|
2266
|
-
return index > -1 ? index : void 0;
|
|
2267
|
-
};
|
|
2268
|
-
var AutocompletePrompt = class extends Prompt {
|
|
2269
|
-
constructor(opts = {}) {
|
|
2270
|
-
super(opts);
|
|
2271
|
-
this.msg = opts.message;
|
|
2272
|
-
this.suggest = opts.suggest;
|
|
2273
|
-
this.choices = opts.choices;
|
|
2274
|
-
this.initial = typeof opts.initial === "number" ? opts.initial : getIndex(opts.choices, opts.initial);
|
|
2275
|
-
this.select = this.initial || opts.cursor || 0;
|
|
2276
|
-
this.i18n = {
|
|
2277
|
-
noMatches: opts.noMatches || "no matches found"
|
|
2278
|
-
};
|
|
2279
|
-
this.fallback = opts.fallback || this.initial;
|
|
2280
|
-
this.clearFirst = opts.clearFirst || false;
|
|
2281
|
-
this.suggestions = [];
|
|
2282
|
-
this.input = "";
|
|
2283
|
-
this.limit = opts.limit || 10;
|
|
2284
|
-
this.cursor = 0;
|
|
2285
|
-
this.transform = style.render(opts.style);
|
|
2286
|
-
this.scale = this.transform.scale;
|
|
2287
|
-
this.render = this.render.bind(this);
|
|
2288
|
-
this.complete = this.complete.bind(this);
|
|
2289
|
-
this.clear = clear("", this.out.columns);
|
|
2290
|
-
this.complete(this.render);
|
|
2291
|
-
this.render();
|
|
2292
|
-
}
|
|
2293
|
-
set fallback(fb) {
|
|
2294
|
-
this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;
|
|
2295
|
-
}
|
|
2296
|
-
get fallback() {
|
|
2297
|
-
let choice;
|
|
2298
|
-
if (typeof this._fb === "number")
|
|
2299
|
-
choice = this.choices[this._fb];
|
|
2300
|
-
else if (typeof this._fb === "string")
|
|
2301
|
-
choice = {
|
|
2302
|
-
title: this._fb
|
|
2303
|
-
};
|
|
2304
|
-
return choice || this._fb || {
|
|
2305
|
-
title: this.i18n.noMatches
|
|
2306
|
-
};
|
|
2307
|
-
}
|
|
2308
|
-
moveSelect(i) {
|
|
2309
|
-
this.select = i;
|
|
2310
|
-
if (this.suggestions.length > 0)
|
|
2311
|
-
this.value = getVal(this.suggestions, i);
|
|
2312
|
-
else
|
|
2313
|
-
this.value = this.fallback.value;
|
|
2314
|
-
this.fire();
|
|
2315
|
-
}
|
|
2316
|
-
complete(cb) {
|
|
2317
|
-
var _this = this;
|
|
2318
|
-
return _asyncToGenerator(function* () {
|
|
2319
|
-
const p = _this.completing = _this.suggest(_this.input, _this.choices);
|
|
2320
|
-
const suggestions = yield p;
|
|
2321
|
-
if (_this.completing !== p)
|
|
2322
|
-
return;
|
|
2323
|
-
_this.suggestions = suggestions.map((s, i, arr) => ({
|
|
2324
|
-
title: getTitle(arr, i),
|
|
2325
|
-
value: getVal(arr, i),
|
|
2326
|
-
description: s.description
|
|
2327
|
-
}));
|
|
2328
|
-
_this.completing = false;
|
|
2329
|
-
const l = Math.max(suggestions.length - 1, 0);
|
|
2330
|
-
_this.moveSelect(Math.min(l, _this.select));
|
|
2331
|
-
cb && cb();
|
|
2332
|
-
})();
|
|
2333
|
-
}
|
|
2334
|
-
reset() {
|
|
2335
|
-
this.input = "";
|
|
2336
|
-
this.complete(() => {
|
|
2337
|
-
this.moveSelect(this.initial !== void 0 ? this.initial : 0);
|
|
2338
|
-
this.render();
|
|
2339
|
-
});
|
|
2340
|
-
this.render();
|
|
2341
|
-
}
|
|
2342
|
-
exit() {
|
|
2343
|
-
if (this.clearFirst && this.input.length > 0) {
|
|
2344
|
-
this.reset();
|
|
2345
|
-
} else {
|
|
2346
|
-
this.done = this.exited = true;
|
|
2347
|
-
this.aborted = false;
|
|
2348
|
-
this.fire();
|
|
2349
|
-
this.render();
|
|
2350
|
-
this.out.write("\n");
|
|
2351
|
-
this.close();
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
abort() {
|
|
2355
|
-
this.done = this.aborted = true;
|
|
2356
|
-
this.exited = false;
|
|
2357
|
-
this.fire();
|
|
2358
|
-
this.render();
|
|
2359
|
-
this.out.write("\n");
|
|
2360
|
-
this.close();
|
|
2361
|
-
}
|
|
2362
|
-
submit() {
|
|
2363
|
-
this.done = true;
|
|
2364
|
-
this.aborted = this.exited = false;
|
|
2365
|
-
this.fire();
|
|
2366
|
-
this.render();
|
|
2367
|
-
this.out.write("\n");
|
|
2368
|
-
this.close();
|
|
2369
|
-
}
|
|
2370
|
-
_(c, key) {
|
|
2371
|
-
let s1 = this.input.slice(0, this.cursor);
|
|
2372
|
-
let s2 = this.input.slice(this.cursor);
|
|
2373
|
-
this.input = `${s1}${c}${s2}`;
|
|
2374
|
-
this.cursor = s1.length + 1;
|
|
2375
|
-
this.complete(this.render);
|
|
2376
|
-
this.render();
|
|
2377
|
-
}
|
|
2378
|
-
delete() {
|
|
2379
|
-
if (this.cursor === 0)
|
|
2380
|
-
return this.bell();
|
|
2381
|
-
let s1 = this.input.slice(0, this.cursor - 1);
|
|
2382
|
-
let s2 = this.input.slice(this.cursor);
|
|
2383
|
-
this.input = `${s1}${s2}`;
|
|
2384
|
-
this.complete(this.render);
|
|
2385
|
-
this.cursor = this.cursor - 1;
|
|
2386
|
-
this.render();
|
|
2387
|
-
}
|
|
2388
|
-
deleteForward() {
|
|
2389
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
2390
|
-
return this.bell();
|
|
2391
|
-
let s1 = this.input.slice(0, this.cursor);
|
|
2392
|
-
let s2 = this.input.slice(this.cursor + 1);
|
|
2393
|
-
this.input = `${s1}${s2}`;
|
|
2394
|
-
this.complete(this.render);
|
|
2395
|
-
this.render();
|
|
2396
|
-
}
|
|
2397
|
-
first() {
|
|
2398
|
-
this.moveSelect(0);
|
|
2399
|
-
this.render();
|
|
2400
|
-
}
|
|
2401
|
-
last() {
|
|
2402
|
-
this.moveSelect(this.suggestions.length - 1);
|
|
2403
|
-
this.render();
|
|
2404
|
-
}
|
|
2405
|
-
up() {
|
|
2406
|
-
if (this.select === 0) {
|
|
2407
|
-
this.moveSelect(this.suggestions.length - 1);
|
|
2408
|
-
} else {
|
|
2409
|
-
this.moveSelect(this.select - 1);
|
|
2410
|
-
}
|
|
2411
|
-
this.render();
|
|
2412
|
-
}
|
|
2413
|
-
down() {
|
|
2414
|
-
if (this.select === this.suggestions.length - 1) {
|
|
2415
|
-
this.moveSelect(0);
|
|
2416
|
-
} else {
|
|
2417
|
-
this.moveSelect(this.select + 1);
|
|
2418
|
-
}
|
|
2419
|
-
this.render();
|
|
2420
|
-
}
|
|
2421
|
-
next() {
|
|
2422
|
-
if (this.select === this.suggestions.length - 1) {
|
|
2423
|
-
this.moveSelect(0);
|
|
2424
|
-
} else
|
|
2425
|
-
this.moveSelect(this.select + 1);
|
|
2426
|
-
this.render();
|
|
2427
|
-
}
|
|
2428
|
-
nextPage() {
|
|
2429
|
-
this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));
|
|
2430
|
-
this.render();
|
|
2431
|
-
}
|
|
2432
|
-
prevPage() {
|
|
2433
|
-
this.moveSelect(Math.max(this.select - this.limit, 0));
|
|
2434
|
-
this.render();
|
|
2435
|
-
}
|
|
2436
|
-
left() {
|
|
2437
|
-
if (this.cursor <= 0)
|
|
2438
|
-
return this.bell();
|
|
2439
|
-
this.cursor = this.cursor - 1;
|
|
2440
|
-
this.render();
|
|
2441
|
-
}
|
|
2442
|
-
right() {
|
|
2443
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
2444
|
-
return this.bell();
|
|
2445
|
-
this.cursor = this.cursor + 1;
|
|
2446
|
-
this.render();
|
|
2447
|
-
}
|
|
2448
|
-
renderOption(v, hovered, isStart, isEnd) {
|
|
2449
|
-
let desc;
|
|
2450
|
-
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
|
|
2451
|
-
let title = hovered ? color.cyan().underline(v.title) : v.title;
|
|
2452
|
-
prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
2453
|
-
if (v.description) {
|
|
2454
|
-
desc = ` - ${v.description}`;
|
|
2455
|
-
if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
2456
|
-
desc = "\n" + wrap(v.description, {
|
|
2457
|
-
margin: 3,
|
|
2458
|
-
width: this.out.columns
|
|
2459
|
-
});
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
return prefix + " " + title + color.gray(desc || "");
|
|
2463
|
-
}
|
|
2464
|
-
render() {
|
|
2465
|
-
if (this.closed)
|
|
2466
|
-
return;
|
|
2467
|
-
if (this.firstRender)
|
|
2468
|
-
this.out.write(cursor.hide);
|
|
2469
|
-
else
|
|
2470
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
2471
|
-
super.render();
|
|
2472
|
-
let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
2473
|
-
this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" ");
|
|
2474
|
-
if (!this.done) {
|
|
2475
|
-
const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption(item, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n");
|
|
2476
|
-
this.outputText += `
|
|
2477
|
-
` + (suggestions || color.gray(this.fallback.title));
|
|
2478
|
-
}
|
|
2479
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText);
|
|
2480
|
-
}
|
|
2481
|
-
};
|
|
2482
|
-
module2.exports = AutocompletePrompt;
|
|
2483
|
-
}
|
|
2484
|
-
});
|
|
2485
|
-
|
|
2486
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js
|
|
2487
|
-
var require_autocompleteMultiselect = __commonJS({
|
|
2488
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports, module2) {
|
|
2489
|
-
"use strict";
|
|
2490
|
-
var color = require_kleur();
|
|
2491
|
-
var _require = require_src();
|
|
2492
|
-
var cursor = _require.cursor;
|
|
2493
|
-
var MultiselectPrompt = require_multiselect();
|
|
2494
|
-
var _require2 = require_util();
|
|
2495
|
-
var clear = _require2.clear;
|
|
2496
|
-
var style = _require2.style;
|
|
2497
|
-
var figures = _require2.figures;
|
|
2498
|
-
var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
|
|
2499
|
-
constructor(opts = {}) {
|
|
2500
|
-
opts.overrideRender = true;
|
|
2501
|
-
super(opts);
|
|
2502
|
-
this.inputValue = "";
|
|
2503
|
-
this.clear = clear("", this.out.columns);
|
|
2504
|
-
this.filteredOptions = this.value;
|
|
2505
|
-
this.render();
|
|
2506
|
-
}
|
|
2507
|
-
last() {
|
|
2508
|
-
this.cursor = this.filteredOptions.length - 1;
|
|
2509
|
-
this.render();
|
|
2510
|
-
}
|
|
2511
|
-
next() {
|
|
2512
|
-
this.cursor = (this.cursor + 1) % this.filteredOptions.length;
|
|
2513
|
-
this.render();
|
|
2514
|
-
}
|
|
2515
|
-
up() {
|
|
2516
|
-
if (this.cursor === 0) {
|
|
2517
|
-
this.cursor = this.filteredOptions.length - 1;
|
|
2518
|
-
} else {
|
|
2519
|
-
this.cursor--;
|
|
2520
|
-
}
|
|
2521
|
-
this.render();
|
|
2522
|
-
}
|
|
2523
|
-
down() {
|
|
2524
|
-
if (this.cursor === this.filteredOptions.length - 1) {
|
|
2525
|
-
this.cursor = 0;
|
|
2526
|
-
} else {
|
|
2527
|
-
this.cursor++;
|
|
2528
|
-
}
|
|
2529
|
-
this.render();
|
|
2530
|
-
}
|
|
2531
|
-
left() {
|
|
2532
|
-
this.filteredOptions[this.cursor].selected = false;
|
|
2533
|
-
this.render();
|
|
2534
|
-
}
|
|
2535
|
-
right() {
|
|
2536
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
2537
|
-
return this.bell();
|
|
2538
|
-
this.filteredOptions[this.cursor].selected = true;
|
|
2539
|
-
this.render();
|
|
2540
|
-
}
|
|
2541
|
-
delete() {
|
|
2542
|
-
if (this.inputValue.length) {
|
|
2543
|
-
this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);
|
|
2544
|
-
this.updateFilteredOptions();
|
|
2545
|
-
}
|
|
2546
|
-
}
|
|
2547
|
-
updateFilteredOptions() {
|
|
2548
|
-
const currentHighlight = this.filteredOptions[this.cursor];
|
|
2549
|
-
this.filteredOptions = this.value.filter((v) => {
|
|
2550
|
-
if (this.inputValue) {
|
|
2551
|
-
if (typeof v.title === "string") {
|
|
2552
|
-
if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {
|
|
2553
|
-
return true;
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
if (typeof v.value === "string") {
|
|
2557
|
-
if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {
|
|
2558
|
-
return true;
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
return false;
|
|
2562
|
-
}
|
|
2563
|
-
return true;
|
|
2564
|
-
});
|
|
2565
|
-
const newHighlightIndex = this.filteredOptions.findIndex((v) => v === currentHighlight);
|
|
2566
|
-
this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;
|
|
2567
|
-
this.render();
|
|
2568
|
-
}
|
|
2569
|
-
handleSpaceToggle() {
|
|
2570
|
-
const v = this.filteredOptions[this.cursor];
|
|
2571
|
-
if (v.selected) {
|
|
2572
|
-
v.selected = false;
|
|
2573
|
-
this.render();
|
|
2574
|
-
} else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) {
|
|
2575
|
-
return this.bell();
|
|
2576
|
-
} else {
|
|
2577
|
-
v.selected = true;
|
|
2578
|
-
this.render();
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
handleInputChange(c) {
|
|
2582
|
-
this.inputValue = this.inputValue + c;
|
|
2583
|
-
this.updateFilteredOptions();
|
|
2584
|
-
}
|
|
2585
|
-
_(c, key) {
|
|
2586
|
-
if (c === " ") {
|
|
2587
|
-
this.handleSpaceToggle();
|
|
2588
|
-
} else {
|
|
2589
|
-
this.handleInputChange(c);
|
|
2590
|
-
}
|
|
2591
|
-
}
|
|
2592
|
-
renderInstructions() {
|
|
2593
|
-
if (this.instructions === void 0 || this.instructions) {
|
|
2594
|
-
if (typeof this.instructions === "string") {
|
|
2595
|
-
return this.instructions;
|
|
2596
|
-
}
|
|
2597
|
-
return `
|
|
2598
|
-
Instructions:
|
|
2599
|
-
${figures.arrowUp}/${figures.arrowDown}: Highlight option
|
|
2600
|
-
${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
|
|
2601
|
-
[a,b,c]/delete: Filter choices
|
|
2602
|
-
enter/return: Complete answer
|
|
2603
|
-
`;
|
|
2604
|
-
}
|
|
2605
|
-
return "";
|
|
2606
|
-
}
|
|
2607
|
-
renderCurrentInput() {
|
|
2608
|
-
return `
|
|
2609
|
-
Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")}
|
|
2610
|
-
`;
|
|
2611
|
-
}
|
|
2612
|
-
renderOption(cursor2, v, i) {
|
|
2613
|
-
let title;
|
|
2614
|
-
if (v.disabled)
|
|
2615
|
-
title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
2616
|
-
else
|
|
2617
|
-
title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
2618
|
-
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title;
|
|
2619
|
-
}
|
|
2620
|
-
renderDoneOrInstructions() {
|
|
2621
|
-
if (this.done) {
|
|
2622
|
-
return this.value.filter((e) => e.selected).map((v) => v.title).join(", ");
|
|
2623
|
-
}
|
|
2624
|
-
const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
|
|
2625
|
-
if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
|
|
2626
|
-
output.push(color.yellow(this.warn));
|
|
2627
|
-
}
|
|
2628
|
-
return output.join(" ");
|
|
2629
|
-
}
|
|
2630
|
-
render() {
|
|
2631
|
-
if (this.closed)
|
|
2632
|
-
return;
|
|
2633
|
-
if (this.firstRender)
|
|
2634
|
-
this.out.write(cursor.hide);
|
|
2635
|
-
super.render();
|
|
2636
|
-
let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
2637
|
-
if (this.showMinError) {
|
|
2638
|
-
prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
2639
|
-
this.showMinError = false;
|
|
2640
|
-
}
|
|
2641
|
-
prompt += this.renderOptions(this.filteredOptions);
|
|
2642
|
-
this.out.write(this.clear + prompt);
|
|
2643
|
-
this.clear = clear(prompt, this.out.columns);
|
|
2644
|
-
}
|
|
2645
|
-
};
|
|
2646
|
-
module2.exports = AutocompleteMultiselectPrompt;
|
|
2647
|
-
}
|
|
2648
|
-
});
|
|
2649
|
-
|
|
2650
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js
|
|
2651
|
-
var require_confirm = __commonJS({
|
|
2652
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports, module2) {
|
|
2653
|
-
"use strict";
|
|
2654
|
-
var color = require_kleur();
|
|
2655
|
-
var Prompt = require_prompt();
|
|
2656
|
-
var _require = require_util();
|
|
2657
|
-
var style = _require.style;
|
|
2658
|
-
var clear = _require.clear;
|
|
2659
|
-
var _require2 = require_src();
|
|
2660
|
-
var erase = _require2.erase;
|
|
2661
|
-
var cursor = _require2.cursor;
|
|
2662
|
-
var ConfirmPrompt = class extends Prompt {
|
|
2663
|
-
constructor(opts = {}) {
|
|
2664
|
-
super(opts);
|
|
2665
|
-
this.msg = opts.message;
|
|
2666
|
-
this.value = opts.initial;
|
|
2667
|
-
this.initialValue = !!opts.initial;
|
|
2668
|
-
this.yesMsg = opts.yes || "yes";
|
|
2669
|
-
this.yesOption = opts.yesOption || "(Y/n)";
|
|
2670
|
-
this.noMsg = opts.no || "no";
|
|
2671
|
-
this.noOption = opts.noOption || "(y/N)";
|
|
2672
|
-
this.render();
|
|
2673
|
-
}
|
|
2674
|
-
reset() {
|
|
2675
|
-
this.value = this.initialValue;
|
|
2676
|
-
this.fire();
|
|
2677
|
-
this.render();
|
|
2678
|
-
}
|
|
2679
|
-
exit() {
|
|
2680
|
-
this.abort();
|
|
2681
|
-
}
|
|
2682
|
-
abort() {
|
|
2683
|
-
this.done = this.aborted = true;
|
|
2684
|
-
this.fire();
|
|
2685
|
-
this.render();
|
|
2686
|
-
this.out.write("\n");
|
|
2687
|
-
this.close();
|
|
2688
|
-
}
|
|
2689
|
-
submit() {
|
|
2690
|
-
this.value = this.value || false;
|
|
2691
|
-
this.done = true;
|
|
2692
|
-
this.aborted = false;
|
|
2693
|
-
this.fire();
|
|
2694
|
-
this.render();
|
|
2695
|
-
this.out.write("\n");
|
|
2696
|
-
this.close();
|
|
2697
|
-
}
|
|
2698
|
-
_(c, key) {
|
|
2699
|
-
if (c.toLowerCase() === "y") {
|
|
2700
|
-
this.value = true;
|
|
2701
|
-
return this.submit();
|
|
2702
|
-
}
|
|
2703
|
-
if (c.toLowerCase() === "n") {
|
|
2704
|
-
this.value = false;
|
|
2705
|
-
return this.submit();
|
|
2706
|
-
}
|
|
2707
|
-
return this.bell();
|
|
2708
|
-
}
|
|
2709
|
-
render() {
|
|
2710
|
-
if (this.closed)
|
|
2711
|
-
return;
|
|
2712
|
-
if (this.firstRender)
|
|
2713
|
-
this.out.write(cursor.hide);
|
|
2714
|
-
else
|
|
2715
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
2716
|
-
super.render();
|
|
2717
|
-
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(" ");
|
|
2718
|
-
this.out.write(erase.line + cursor.to(0) + this.outputText);
|
|
2719
|
-
}
|
|
2720
|
-
};
|
|
2721
|
-
module2.exports = ConfirmPrompt;
|
|
2722
|
-
}
|
|
2723
|
-
});
|
|
2724
|
-
|
|
2725
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js
|
|
2726
|
-
var require_elements = __commonJS({
|
|
2727
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js"(exports, module2) {
|
|
2728
|
-
"use strict";
|
|
2729
|
-
module2.exports = {
|
|
2730
|
-
TextPrompt: require_text(),
|
|
2731
|
-
SelectPrompt: require_select(),
|
|
2732
|
-
TogglePrompt: require_toggle(),
|
|
2733
|
-
DatePrompt: require_date(),
|
|
2734
|
-
NumberPrompt: require_number(),
|
|
2735
|
-
MultiselectPrompt: require_multiselect(),
|
|
2736
|
-
AutocompletePrompt: require_autocomplete(),
|
|
2737
|
-
AutocompleteMultiselectPrompt: require_autocompleteMultiselect(),
|
|
2738
|
-
ConfirmPrompt: require_confirm()
|
|
2739
|
-
};
|
|
2740
|
-
}
|
|
2741
|
-
});
|
|
2742
|
-
|
|
2743
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js
|
|
2744
|
-
var require_prompts = __commonJS({
|
|
2745
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js"(exports) {
|
|
2746
|
-
"use strict";
|
|
2747
|
-
var $ = exports;
|
|
2748
|
-
var el = require_elements();
|
|
2749
|
-
var noop = (v) => v;
|
|
2750
|
-
function toPrompt(type, args, opts = {}) {
|
|
2751
|
-
return new Promise((res, rej) => {
|
|
2752
|
-
const p = new el[type](args);
|
|
2753
|
-
const onAbort = opts.onAbort || noop;
|
|
2754
|
-
const onSubmit = opts.onSubmit || noop;
|
|
2755
|
-
const onExit = opts.onExit || noop;
|
|
2756
|
-
p.on("state", args.onState || noop);
|
|
2757
|
-
p.on("submit", (x) => res(onSubmit(x)));
|
|
2758
|
-
p.on("exit", (x) => res(onExit(x)));
|
|
2759
|
-
p.on("abort", (x) => rej(onAbort(x)));
|
|
2760
|
-
});
|
|
2761
|
-
}
|
|
2762
|
-
$.text = (args) => toPrompt("TextPrompt", args);
|
|
2763
|
-
$.password = (args) => {
|
|
2764
|
-
args.style = "password";
|
|
2765
|
-
return $.text(args);
|
|
2766
|
-
};
|
|
2767
|
-
$.invisible = (args) => {
|
|
2768
|
-
args.style = "invisible";
|
|
2769
|
-
return $.text(args);
|
|
2770
|
-
};
|
|
2771
|
-
$.number = (args) => toPrompt("NumberPrompt", args);
|
|
2772
|
-
$.date = (args) => toPrompt("DatePrompt", args);
|
|
2773
|
-
$.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
2774
|
-
$.list = (args) => {
|
|
2775
|
-
const sep = args.separator || ",";
|
|
2776
|
-
return toPrompt("TextPrompt", args, {
|
|
2777
|
-
onSubmit: (str) => str.split(sep).map((s) => s.trim())
|
|
2778
|
-
});
|
|
2779
|
-
};
|
|
2780
|
-
$.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
2781
|
-
$.select = (args) => toPrompt("SelectPrompt", args);
|
|
2782
|
-
$.multiselect = (args) => {
|
|
2783
|
-
args.choices = [].concat(args.choices || []);
|
|
2784
|
-
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
2785
|
-
return toPrompt("MultiselectPrompt", args, {
|
|
2786
|
-
onAbort: toSelected,
|
|
2787
|
-
onSubmit: toSelected
|
|
2788
|
-
});
|
|
2789
|
-
};
|
|
2790
|
-
$.autocompleteMultiselect = (args) => {
|
|
2791
|
-
args.choices = [].concat(args.choices || []);
|
|
2792
|
-
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
2793
|
-
return toPrompt("AutocompleteMultiselectPrompt", args, {
|
|
2794
|
-
onAbort: toSelected,
|
|
2795
|
-
onSubmit: toSelected
|
|
2796
|
-
});
|
|
2797
|
-
};
|
|
2798
|
-
var byTitle = (input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));
|
|
2799
|
-
$.autocomplete = (args) => {
|
|
2800
|
-
args.suggest = args.suggest || byTitle;
|
|
2801
|
-
args.choices = [].concat(args.choices || []);
|
|
2802
|
-
return toPrompt("AutocompletePrompt", args);
|
|
2803
|
-
};
|
|
2804
|
-
}
|
|
2805
|
-
});
|
|
2806
|
-
|
|
2807
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js
|
|
2808
|
-
var require_dist = __commonJS({
|
|
2809
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js"(exports, module2) {
|
|
2810
|
-
"use strict";
|
|
2811
|
-
function ownKeys(object, enumerableOnly) {
|
|
2812
|
-
var keys = Object.keys(object);
|
|
2813
|
-
if (Object.getOwnPropertySymbols) {
|
|
2814
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2815
|
-
if (enumerableOnly) {
|
|
2816
|
-
symbols = symbols.filter(function(sym) {
|
|
2817
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2818
|
-
});
|
|
2819
|
-
}
|
|
2820
|
-
keys.push.apply(keys, symbols);
|
|
2821
|
-
}
|
|
2822
|
-
return keys;
|
|
2823
|
-
}
|
|
2824
|
-
function _objectSpread(target) {
|
|
2825
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2826
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2827
|
-
if (i % 2) {
|
|
2828
|
-
ownKeys(Object(source), true).forEach(function(key) {
|
|
2829
|
-
_defineProperty(target, key, source[key]);
|
|
2830
|
-
});
|
|
2831
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
2832
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2833
|
-
} else {
|
|
2834
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
2835
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2836
|
-
});
|
|
262
|
+
let i = 0, tmp, beg = "", end = "";
|
|
263
|
+
for (; i < arr.length; i++) {
|
|
264
|
+
tmp = arr[i];
|
|
265
|
+
beg += tmp.open;
|
|
266
|
+
end += tmp.close;
|
|
267
|
+
if (str.includes(tmp.close)) {
|
|
268
|
+
str = str.replace(tmp.rgx, tmp.close + tmp.open);
|
|
2837
269
|
}
|
|
2838
270
|
}
|
|
2839
|
-
return
|
|
2840
|
-
}
|
|
2841
|
-
function _defineProperty(obj, key, value) {
|
|
2842
|
-
if (key in obj) {
|
|
2843
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2844
|
-
} else {
|
|
2845
|
-
obj[key] = value;
|
|
2846
|
-
}
|
|
2847
|
-
return obj;
|
|
2848
|
-
}
|
|
2849
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
2850
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
2851
|
-
if (!it) {
|
|
2852
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
2853
|
-
if (it)
|
|
2854
|
-
o = it;
|
|
2855
|
-
var i = 0;
|
|
2856
|
-
var F = function F2() {
|
|
2857
|
-
};
|
|
2858
|
-
return { s: F, n: function n() {
|
|
2859
|
-
if (i >= o.length)
|
|
2860
|
-
return { done: true };
|
|
2861
|
-
return { done: false, value: o[i++] };
|
|
2862
|
-
}, e: function e(_e) {
|
|
2863
|
-
throw _e;
|
|
2864
|
-
}, f: F };
|
|
2865
|
-
}
|
|
2866
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2867
|
-
}
|
|
2868
|
-
var normalCompletion = true, didErr = false, err;
|
|
2869
|
-
return { s: function s() {
|
|
2870
|
-
it = it.call(o);
|
|
2871
|
-
}, n: function n() {
|
|
2872
|
-
var step = it.next();
|
|
2873
|
-
normalCompletion = step.done;
|
|
2874
|
-
return step;
|
|
2875
|
-
}, e: function e(_e2) {
|
|
2876
|
-
didErr = true;
|
|
2877
|
-
err = _e2;
|
|
2878
|
-
}, f: function f() {
|
|
2879
|
-
try {
|
|
2880
|
-
if (!normalCompletion && it.return != null)
|
|
2881
|
-
it.return();
|
|
2882
|
-
} finally {
|
|
2883
|
-
if (didErr)
|
|
2884
|
-
throw err;
|
|
2885
|
-
}
|
|
2886
|
-
} };
|
|
2887
|
-
}
|
|
2888
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
2889
|
-
if (!o)
|
|
2890
|
-
return;
|
|
2891
|
-
if (typeof o === "string")
|
|
2892
|
-
return _arrayLikeToArray(o, minLen);
|
|
2893
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2894
|
-
if (n === "Object" && o.constructor)
|
|
2895
|
-
n = o.constructor.name;
|
|
2896
|
-
if (n === "Map" || n === "Set")
|
|
2897
|
-
return Array.from(o);
|
|
2898
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
2899
|
-
return _arrayLikeToArray(o, minLen);
|
|
2900
|
-
}
|
|
2901
|
-
function _arrayLikeToArray(arr, len) {
|
|
2902
|
-
if (len == null || len > arr.length)
|
|
2903
|
-
len = arr.length;
|
|
2904
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
2905
|
-
arr2[i] = arr[i];
|
|
2906
|
-
return arr2;
|
|
271
|
+
return beg + str + end;
|
|
2907
272
|
}
|
|
2908
|
-
function
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
273
|
+
function chain(has, keys) {
|
|
274
|
+
let ctx = { has, keys };
|
|
275
|
+
ctx.reset = $.reset.bind(ctx);
|
|
276
|
+
ctx.bold = $.bold.bind(ctx);
|
|
277
|
+
ctx.dim = $.dim.bind(ctx);
|
|
278
|
+
ctx.italic = $.italic.bind(ctx);
|
|
279
|
+
ctx.underline = $.underline.bind(ctx);
|
|
280
|
+
ctx.inverse = $.inverse.bind(ctx);
|
|
281
|
+
ctx.hidden = $.hidden.bind(ctx);
|
|
282
|
+
ctx.strikethrough = $.strikethrough.bind(ctx);
|
|
283
|
+
ctx.black = $.black.bind(ctx);
|
|
284
|
+
ctx.red = $.red.bind(ctx);
|
|
285
|
+
ctx.green = $.green.bind(ctx);
|
|
286
|
+
ctx.yellow = $.yellow.bind(ctx);
|
|
287
|
+
ctx.blue = $.blue.bind(ctx);
|
|
288
|
+
ctx.magenta = $.magenta.bind(ctx);
|
|
289
|
+
ctx.cyan = $.cyan.bind(ctx);
|
|
290
|
+
ctx.white = $.white.bind(ctx);
|
|
291
|
+
ctx.gray = $.gray.bind(ctx);
|
|
292
|
+
ctx.grey = $.grey.bind(ctx);
|
|
293
|
+
ctx.bgBlack = $.bgBlack.bind(ctx);
|
|
294
|
+
ctx.bgRed = $.bgRed.bind(ctx);
|
|
295
|
+
ctx.bgGreen = $.bgGreen.bind(ctx);
|
|
296
|
+
ctx.bgYellow = $.bgYellow.bind(ctx);
|
|
297
|
+
ctx.bgBlue = $.bgBlue.bind(ctx);
|
|
298
|
+
ctx.bgMagenta = $.bgMagenta.bind(ctx);
|
|
299
|
+
ctx.bgCyan = $.bgCyan.bind(ctx);
|
|
300
|
+
ctx.bgWhite = $.bgWhite.bind(ctx);
|
|
301
|
+
return ctx;
|
|
2921
302
|
}
|
|
2922
|
-
function
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
function _next(value) {
|
|
2928
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
|
|
2929
|
-
}
|
|
2930
|
-
function _throw(err) {
|
|
2931
|
-
asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
|
|
2932
|
-
}
|
|
2933
|
-
_next(void 0);
|
|
2934
|
-
});
|
|
303
|
+
function init2(open, close) {
|
|
304
|
+
let blk = {
|
|
305
|
+
open: `\x1B[${open}m`,
|
|
306
|
+
close: `\x1B[${close}m`,
|
|
307
|
+
rgx: new RegExp(`\\x1b\\[${close}m`, "g")
|
|
2935
308
|
};
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
};
|
|
2941
|
-
function prompt() {
|
|
2942
|
-
return _prompt.apply(this, arguments);
|
|
2943
|
-
}
|
|
2944
|
-
function _prompt() {
|
|
2945
|
-
_prompt = _asyncToGenerator(function* (questions = [], {
|
|
2946
|
-
onSubmit = noop,
|
|
2947
|
-
onCancel = noop
|
|
2948
|
-
} = {}) {
|
|
2949
|
-
const answers = {};
|
|
2950
|
-
const override2 = prompt._override || {};
|
|
2951
|
-
questions = [].concat(questions);
|
|
2952
|
-
let answer, question, quit, name, type, lastPrompt;
|
|
2953
|
-
const getFormattedAnswer = /* @__PURE__ */ function() {
|
|
2954
|
-
var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) {
|
|
2955
|
-
if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
|
|
2956
|
-
return;
|
|
2957
|
-
}
|
|
2958
|
-
return question2.format ? yield question2.format(answer2, answers) : answer2;
|
|
2959
|
-
});
|
|
2960
|
-
return function getFormattedAnswer2(_x, _x2) {
|
|
2961
|
-
return _ref.apply(this, arguments);
|
|
2962
|
-
};
|
|
2963
|
-
}();
|
|
2964
|
-
var _iterator = _createForOfIteratorHelper(questions), _step;
|
|
2965
|
-
try {
|
|
2966
|
-
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
2967
|
-
question = _step.value;
|
|
2968
|
-
var _question = question;
|
|
2969
|
-
name = _question.name;
|
|
2970
|
-
type = _question.type;
|
|
2971
|
-
if (typeof type === "function") {
|
|
2972
|
-
type = yield type(answer, _objectSpread({}, answers), question);
|
|
2973
|
-
question["type"] = type;
|
|
2974
|
-
}
|
|
2975
|
-
if (!type)
|
|
2976
|
-
continue;
|
|
2977
|
-
for (let key in question) {
|
|
2978
|
-
if (passOn.includes(key))
|
|
2979
|
-
continue;
|
|
2980
|
-
let value = question[key];
|
|
2981
|
-
question[key] = typeof value === "function" ? yield value(answer, _objectSpread({}, answers), lastPrompt) : value;
|
|
2982
|
-
}
|
|
2983
|
-
lastPrompt = question;
|
|
2984
|
-
if (typeof question.message !== "string") {
|
|
2985
|
-
throw new Error("prompt message is required");
|
|
2986
|
-
}
|
|
2987
|
-
var _question2 = question;
|
|
2988
|
-
name = _question2.name;
|
|
2989
|
-
type = _question2.type;
|
|
2990
|
-
if (prompts2[type] === void 0) {
|
|
2991
|
-
throw new Error(`prompt type (${type}) is not defined`);
|
|
2992
|
-
}
|
|
2993
|
-
if (override2[question.name] !== void 0) {
|
|
2994
|
-
answer = yield getFormattedAnswer(question, override2[question.name]);
|
|
2995
|
-
if (answer !== void 0) {
|
|
2996
|
-
answers[name] = answer;
|
|
2997
|
-
continue;
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
try {
|
|
3001
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts2[type](question);
|
|
3002
|
-
answers[name] = answer = yield getFormattedAnswer(question, answer, true);
|
|
3003
|
-
quit = yield onSubmit(question, answer, answers);
|
|
3004
|
-
} catch (err) {
|
|
3005
|
-
quit = !(yield onCancel(question, answers));
|
|
3006
|
-
}
|
|
3007
|
-
if (quit)
|
|
3008
|
-
return answers;
|
|
3009
|
-
}
|
|
3010
|
-
} catch (err) {
|
|
3011
|
-
_iterator.e(err);
|
|
3012
|
-
} finally {
|
|
3013
|
-
_iterator.f();
|
|
309
|
+
return function(txt) {
|
|
310
|
+
if (this !== void 0 && this.has !== void 0) {
|
|
311
|
+
this.has.includes(open) || (this.has.push(open), this.keys.push(blk));
|
|
312
|
+
return txt === void 0 ? this : $.enabled ? run(this.keys, txt + "") : txt + "";
|
|
3014
313
|
}
|
|
3015
|
-
return
|
|
3016
|
-
}
|
|
3017
|
-
return _prompt.apply(this, arguments);
|
|
3018
|
-
}
|
|
3019
|
-
function getInjectedAnswer(injected, deafultValue) {
|
|
3020
|
-
const answer = injected.shift();
|
|
3021
|
-
if (answer instanceof Error) {
|
|
3022
|
-
throw answer;
|
|
3023
|
-
}
|
|
3024
|
-
return answer === void 0 ? deafultValue : answer;
|
|
3025
|
-
}
|
|
3026
|
-
function inject(answers) {
|
|
3027
|
-
prompt._injected = (prompt._injected || []).concat(answers);
|
|
3028
|
-
}
|
|
3029
|
-
function override(answers) {
|
|
3030
|
-
prompt._override = Object.assign({}, answers);
|
|
314
|
+
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt + "") : txt + "";
|
|
315
|
+
};
|
|
3031
316
|
}
|
|
3032
|
-
module2.exports =
|
|
3033
|
-
prompt,
|
|
3034
|
-
prompts: prompts2,
|
|
3035
|
-
inject,
|
|
3036
|
-
override
|
|
3037
|
-
});
|
|
317
|
+
module2.exports = $;
|
|
3038
318
|
}
|
|
3039
319
|
});
|
|
3040
320
|
|
|
3041
321
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js
|
|
3042
|
-
var
|
|
322
|
+
var require_action = __commonJS({
|
|
3043
323
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js"(exports, module2) {
|
|
3044
324
|
"use strict";
|
|
3045
325
|
module2.exports = (key, isSelect) => {
|
|
@@ -3099,7 +379,7 @@ var require_action2 = __commonJS({
|
|
|
3099
379
|
});
|
|
3100
380
|
|
|
3101
381
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js
|
|
3102
|
-
var
|
|
382
|
+
var require_strip = __commonJS({
|
|
3103
383
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js"(exports, module2) {
|
|
3104
384
|
"use strict";
|
|
3105
385
|
module2.exports = (str) => {
|
|
@@ -3113,11 +393,72 @@ var require_strip2 = __commonJS({
|
|
|
3113
393
|
}
|
|
3114
394
|
});
|
|
3115
395
|
|
|
396
|
+
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
397
|
+
var require_src = __commonJS({
|
|
398
|
+
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
|
|
399
|
+
"use strict";
|
|
400
|
+
var ESC = "\x1B";
|
|
401
|
+
var CSI = `${ESC}[`;
|
|
402
|
+
var beep = "\x07";
|
|
403
|
+
var cursor = {
|
|
404
|
+
to(x, y) {
|
|
405
|
+
if (!y)
|
|
406
|
+
return `${CSI}${x + 1}G`;
|
|
407
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
408
|
+
},
|
|
409
|
+
move(x, y) {
|
|
410
|
+
let ret = "";
|
|
411
|
+
if (x < 0)
|
|
412
|
+
ret += `${CSI}${-x}D`;
|
|
413
|
+
else if (x > 0)
|
|
414
|
+
ret += `${CSI}${x}C`;
|
|
415
|
+
if (y < 0)
|
|
416
|
+
ret += `${CSI}${-y}A`;
|
|
417
|
+
else if (y > 0)
|
|
418
|
+
ret += `${CSI}${y}B`;
|
|
419
|
+
return ret;
|
|
420
|
+
},
|
|
421
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
422
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
423
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
424
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
425
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
426
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
427
|
+
left: `${CSI}G`,
|
|
428
|
+
hide: `${CSI}?25l`,
|
|
429
|
+
show: `${CSI}?25h`,
|
|
430
|
+
save: `${ESC}7`,
|
|
431
|
+
restore: `${ESC}8`
|
|
432
|
+
};
|
|
433
|
+
var scroll = {
|
|
434
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
435
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
436
|
+
};
|
|
437
|
+
var erase = {
|
|
438
|
+
screen: `${CSI}2J`,
|
|
439
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
440
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
441
|
+
line: `${CSI}2K`,
|
|
442
|
+
lineEnd: `${CSI}K`,
|
|
443
|
+
lineStart: `${CSI}1K`,
|
|
444
|
+
lines(count) {
|
|
445
|
+
let clear = "";
|
|
446
|
+
for (let i = 0; i < count; i++)
|
|
447
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
448
|
+
if (count)
|
|
449
|
+
clear += cursor.left;
|
|
450
|
+
return clear;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
module2.exports = { cursor, scroll, erase, beep };
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
|
|
3116
457
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js
|
|
3117
|
-
var
|
|
458
|
+
var require_clear = __commonJS({
|
|
3118
459
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js"(exports, module2) {
|
|
3119
460
|
"use strict";
|
|
3120
|
-
var strip =
|
|
461
|
+
var strip = require_strip();
|
|
3121
462
|
var { erase, cursor } = require_src();
|
|
3122
463
|
var width = (str) => [...strip(str)].length;
|
|
3123
464
|
module2.exports = function(prompt, perLine) {
|
|
@@ -3134,7 +475,7 @@ var require_clear2 = __commonJS({
|
|
|
3134
475
|
});
|
|
3135
476
|
|
|
3136
477
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js
|
|
3137
|
-
var
|
|
478
|
+
var require_figures = __commonJS({
|
|
3138
479
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js"(exports, module2) {
|
|
3139
480
|
"use strict";
|
|
3140
481
|
var main = {
|
|
@@ -3171,11 +512,11 @@ var require_figures2 = __commonJS({
|
|
|
3171
512
|
});
|
|
3172
513
|
|
|
3173
514
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js
|
|
3174
|
-
var
|
|
515
|
+
var require_style = __commonJS({
|
|
3175
516
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js"(exports, module2) {
|
|
3176
517
|
"use strict";
|
|
3177
518
|
var c = require_kleur();
|
|
3178
|
-
var figures =
|
|
519
|
+
var figures = require_figures();
|
|
3179
520
|
var styles = Object.freeze({
|
|
3180
521
|
password: { scale: 1, render: (input) => "*".repeat(input.length) },
|
|
3181
522
|
emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) },
|
|
@@ -3204,10 +545,10 @@ var require_style2 = __commonJS({
|
|
|
3204
545
|
});
|
|
3205
546
|
|
|
3206
547
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js
|
|
3207
|
-
var
|
|
548
|
+
var require_lines = __commonJS({
|
|
3208
549
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js"(exports, module2) {
|
|
3209
550
|
"use strict";
|
|
3210
|
-
var strip =
|
|
551
|
+
var strip = require_strip();
|
|
3211
552
|
module2.exports = function(msg, perLine) {
|
|
3212
553
|
let lines = String(strip(msg) || "").split(/\r?\n/);
|
|
3213
554
|
if (!perLine)
|
|
@@ -3218,7 +559,7 @@ var require_lines2 = __commonJS({
|
|
|
3218
559
|
});
|
|
3219
560
|
|
|
3220
561
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js
|
|
3221
|
-
var
|
|
562
|
+
var require_wrap = __commonJS({
|
|
3222
563
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js"(exports, module2) {
|
|
3223
564
|
"use strict";
|
|
3224
565
|
module2.exports = (msg, opts = {}) => {
|
|
@@ -3236,7 +577,7 @@ var require_wrap2 = __commonJS({
|
|
|
3236
577
|
});
|
|
3237
578
|
|
|
3238
579
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js
|
|
3239
|
-
var
|
|
580
|
+
var require_entriesToDisplay = __commonJS({
|
|
3240
581
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js"(exports, module2) {
|
|
3241
582
|
"use strict";
|
|
3242
583
|
module2.exports = (cursor, total, maxVisible) => {
|
|
@@ -3251,28 +592,28 @@ var require_entriesToDisplay2 = __commonJS({
|
|
|
3251
592
|
});
|
|
3252
593
|
|
|
3253
594
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js
|
|
3254
|
-
var
|
|
595
|
+
var require_util = __commonJS({
|
|
3255
596
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js"(exports, module2) {
|
|
3256
597
|
"use strict";
|
|
3257
598
|
module2.exports = {
|
|
3258
|
-
action:
|
|
3259
|
-
clear:
|
|
3260
|
-
style:
|
|
3261
|
-
strip:
|
|
3262
|
-
figures:
|
|
3263
|
-
lines:
|
|
3264
|
-
wrap:
|
|
3265
|
-
entriesToDisplay:
|
|
599
|
+
action: require_action(),
|
|
600
|
+
clear: require_clear(),
|
|
601
|
+
style: require_style(),
|
|
602
|
+
strip: require_strip(),
|
|
603
|
+
figures: require_figures(),
|
|
604
|
+
lines: require_lines(),
|
|
605
|
+
wrap: require_wrap(),
|
|
606
|
+
entriesToDisplay: require_entriesToDisplay()
|
|
3266
607
|
};
|
|
3267
608
|
}
|
|
3268
609
|
});
|
|
3269
610
|
|
|
3270
611
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js
|
|
3271
|
-
var
|
|
612
|
+
var require_prompt = __commonJS({
|
|
3272
613
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports, module2) {
|
|
3273
614
|
"use strict";
|
|
3274
615
|
var readline = require("readline");
|
|
3275
|
-
var { action } =
|
|
616
|
+
var { action } = require_util();
|
|
3276
617
|
var EventEmitter = require("events");
|
|
3277
618
|
var { beep, cursor } = require_src();
|
|
3278
619
|
var color = require_kleur();
|
|
@@ -3330,12 +671,12 @@ var require_prompt2 = __commonJS({
|
|
|
3330
671
|
});
|
|
3331
672
|
|
|
3332
673
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js
|
|
3333
|
-
var
|
|
674
|
+
var require_text = __commonJS({
|
|
3334
675
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports, module2) {
|
|
3335
676
|
var color = require_kleur();
|
|
3336
|
-
var Prompt =
|
|
677
|
+
var Prompt = require_prompt();
|
|
3337
678
|
var { erase, cursor } = require_src();
|
|
3338
|
-
var { style, clear, lines, figures } =
|
|
679
|
+
var { style, clear, lines, figures } = require_util();
|
|
3339
680
|
var TextPrompt = class extends Prompt {
|
|
3340
681
|
constructor(opts = {}) {
|
|
3341
682
|
super(opts);
|
|
@@ -3517,12 +858,12 @@ ${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
|
3517
858
|
});
|
|
3518
859
|
|
|
3519
860
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js
|
|
3520
|
-
var
|
|
861
|
+
var require_select = __commonJS({
|
|
3521
862
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports, module2) {
|
|
3522
863
|
"use strict";
|
|
3523
864
|
var color = require_kleur();
|
|
3524
|
-
var Prompt =
|
|
3525
|
-
var { style, clear, figures, wrap, entriesToDisplay } =
|
|
865
|
+
var Prompt = require_prompt();
|
|
866
|
+
var { style, clear, figures, wrap, entriesToDisplay } = require_util();
|
|
3526
867
|
var { cursor } = require_src();
|
|
3527
868
|
var SelectPrompt = class extends Prompt {
|
|
3528
869
|
constructor(opts = {}) {
|
|
@@ -3664,11 +1005,11 @@ var require_select2 = __commonJS({
|
|
|
3664
1005
|
});
|
|
3665
1006
|
|
|
3666
1007
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js
|
|
3667
|
-
var
|
|
1008
|
+
var require_toggle = __commonJS({
|
|
3668
1009
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports, module2) {
|
|
3669
1010
|
var color = require_kleur();
|
|
3670
|
-
var Prompt =
|
|
3671
|
-
var { style, clear } =
|
|
1011
|
+
var Prompt = require_prompt();
|
|
1012
|
+
var { style, clear } = require_util();
|
|
3672
1013
|
var { cursor, erase } = require_src();
|
|
3673
1014
|
var TogglePrompt = class extends Prompt {
|
|
3674
1015
|
constructor(opts = {}) {
|
|
@@ -3770,7 +1111,7 @@ var require_toggle2 = __commonJS({
|
|
|
3770
1111
|
});
|
|
3771
1112
|
|
|
3772
1113
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js
|
|
3773
|
-
var
|
|
1114
|
+
var require_datepart = __commonJS({
|
|
3774
1115
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js"(exports, module2) {
|
|
3775
1116
|
"use strict";
|
|
3776
1117
|
var DatePart = class {
|
|
@@ -3804,10 +1145,10 @@ var require_datepart2 = __commonJS({
|
|
|
3804
1145
|
});
|
|
3805
1146
|
|
|
3806
1147
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js
|
|
3807
|
-
var
|
|
1148
|
+
var require_meridiem = __commonJS({
|
|
3808
1149
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js"(exports, module2) {
|
|
3809
1150
|
"use strict";
|
|
3810
|
-
var DatePart =
|
|
1151
|
+
var DatePart = require_datepart();
|
|
3811
1152
|
var Meridiem = class extends DatePart {
|
|
3812
1153
|
constructor(opts = {}) {
|
|
3813
1154
|
super(opts);
|
|
@@ -3828,10 +1169,10 @@ var require_meridiem2 = __commonJS({
|
|
|
3828
1169
|
});
|
|
3829
1170
|
|
|
3830
1171
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js
|
|
3831
|
-
var
|
|
1172
|
+
var require_day = __commonJS({
|
|
3832
1173
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js"(exports, module2) {
|
|
3833
1174
|
"use strict";
|
|
3834
|
-
var DatePart =
|
|
1175
|
+
var DatePart = require_datepart();
|
|
3835
1176
|
var pos = (n) => {
|
|
3836
1177
|
n = n % 10;
|
|
3837
1178
|
return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th";
|
|
@@ -3860,10 +1201,10 @@ var require_day2 = __commonJS({
|
|
|
3860
1201
|
});
|
|
3861
1202
|
|
|
3862
1203
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js
|
|
3863
|
-
var
|
|
1204
|
+
var require_hours = __commonJS({
|
|
3864
1205
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js"(exports, module2) {
|
|
3865
1206
|
"use strict";
|
|
3866
|
-
var DatePart =
|
|
1207
|
+
var DatePart = require_datepart();
|
|
3867
1208
|
var Hours = class extends DatePart {
|
|
3868
1209
|
constructor(opts = {}) {
|
|
3869
1210
|
super(opts);
|
|
@@ -3889,10 +1230,10 @@ var require_hours2 = __commonJS({
|
|
|
3889
1230
|
});
|
|
3890
1231
|
|
|
3891
1232
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js
|
|
3892
|
-
var
|
|
1233
|
+
var require_milliseconds = __commonJS({
|
|
3893
1234
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js"(exports, module2) {
|
|
3894
1235
|
"use strict";
|
|
3895
|
-
var DatePart =
|
|
1236
|
+
var DatePart = require_datepart();
|
|
3896
1237
|
var Milliseconds = class extends DatePart {
|
|
3897
1238
|
constructor(opts = {}) {
|
|
3898
1239
|
super(opts);
|
|
@@ -3915,10 +1256,10 @@ var require_milliseconds2 = __commonJS({
|
|
|
3915
1256
|
});
|
|
3916
1257
|
|
|
3917
1258
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js
|
|
3918
|
-
var
|
|
1259
|
+
var require_minutes = __commonJS({
|
|
3919
1260
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js"(exports, module2) {
|
|
3920
1261
|
"use strict";
|
|
3921
|
-
var DatePart =
|
|
1262
|
+
var DatePart = require_datepart();
|
|
3922
1263
|
var Minutes = class extends DatePart {
|
|
3923
1264
|
constructor(opts = {}) {
|
|
3924
1265
|
super(opts);
|
|
@@ -3942,10 +1283,10 @@ var require_minutes2 = __commonJS({
|
|
|
3942
1283
|
});
|
|
3943
1284
|
|
|
3944
1285
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js
|
|
3945
|
-
var
|
|
1286
|
+
var require_month = __commonJS({
|
|
3946
1287
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js"(exports, module2) {
|
|
3947
1288
|
"use strict";
|
|
3948
|
-
var DatePart =
|
|
1289
|
+
var DatePart = require_datepart();
|
|
3949
1290
|
var Month = class extends DatePart {
|
|
3950
1291
|
constructor(opts = {}) {
|
|
3951
1292
|
super(opts);
|
|
@@ -3971,10 +1312,10 @@ var require_month2 = __commonJS({
|
|
|
3971
1312
|
});
|
|
3972
1313
|
|
|
3973
1314
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js
|
|
3974
|
-
var
|
|
1315
|
+
var require_seconds = __commonJS({
|
|
3975
1316
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js"(exports, module2) {
|
|
3976
1317
|
"use strict";
|
|
3977
|
-
var DatePart =
|
|
1318
|
+
var DatePart = require_datepart();
|
|
3978
1319
|
var Seconds = class extends DatePart {
|
|
3979
1320
|
constructor(opts = {}) {
|
|
3980
1321
|
super(opts);
|
|
@@ -3998,10 +1339,10 @@ var require_seconds2 = __commonJS({
|
|
|
3998
1339
|
});
|
|
3999
1340
|
|
|
4000
1341
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js
|
|
4001
|
-
var
|
|
1342
|
+
var require_year = __commonJS({
|
|
4002
1343
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js"(exports, module2) {
|
|
4003
1344
|
"use strict";
|
|
4004
|
-
var DatePart =
|
|
1345
|
+
var DatePart = require_datepart();
|
|
4005
1346
|
var Year = class extends DatePart {
|
|
4006
1347
|
constructor(opts = {}) {
|
|
4007
1348
|
super(opts);
|
|
@@ -4025,32 +1366,32 @@ var require_year2 = __commonJS({
|
|
|
4025
1366
|
});
|
|
4026
1367
|
|
|
4027
1368
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js
|
|
4028
|
-
var
|
|
1369
|
+
var require_dateparts = __commonJS({
|
|
4029
1370
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js"(exports, module2) {
|
|
4030
1371
|
"use strict";
|
|
4031
1372
|
module2.exports = {
|
|
4032
|
-
DatePart:
|
|
4033
|
-
Meridiem:
|
|
4034
|
-
Day:
|
|
4035
|
-
Hours:
|
|
4036
|
-
Milliseconds:
|
|
4037
|
-
Minutes:
|
|
4038
|
-
Month:
|
|
4039
|
-
Seconds:
|
|
4040
|
-
Year:
|
|
1373
|
+
DatePart: require_datepart(),
|
|
1374
|
+
Meridiem: require_meridiem(),
|
|
1375
|
+
Day: require_day(),
|
|
1376
|
+
Hours: require_hours(),
|
|
1377
|
+
Milliseconds: require_milliseconds(),
|
|
1378
|
+
Minutes: require_minutes(),
|
|
1379
|
+
Month: require_month(),
|
|
1380
|
+
Seconds: require_seconds(),
|
|
1381
|
+
Year: require_year()
|
|
4041
1382
|
};
|
|
4042
1383
|
}
|
|
4043
1384
|
});
|
|
4044
1385
|
|
|
4045
1386
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js
|
|
4046
|
-
var
|
|
1387
|
+
var require_date = __commonJS({
|
|
4047
1388
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports, module2) {
|
|
4048
1389
|
"use strict";
|
|
4049
1390
|
var color = require_kleur();
|
|
4050
|
-
var Prompt =
|
|
4051
|
-
var { style, clear, figures } =
|
|
1391
|
+
var Prompt = require_prompt();
|
|
1392
|
+
var { style, clear, figures } = require_util();
|
|
4052
1393
|
var { erase, cursor } = require_src();
|
|
4053
|
-
var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } =
|
|
1394
|
+
var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts();
|
|
4054
1395
|
var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
|
|
4055
1396
|
var regexGroups = {
|
|
4056
1397
|
1: ({ token }) => token.replace(/\\(.)/g, "$1"),
|
|
@@ -4218,12 +1559,12 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
|
4218
1559
|
});
|
|
4219
1560
|
|
|
4220
1561
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js
|
|
4221
|
-
var
|
|
1562
|
+
var require_number = __commonJS({
|
|
4222
1563
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports, module2) {
|
|
4223
1564
|
var color = require_kleur();
|
|
4224
|
-
var Prompt =
|
|
1565
|
+
var Prompt = require_prompt();
|
|
4225
1566
|
var { cursor, erase } = require_src();
|
|
4226
|
-
var { style, figures, clear, lines } =
|
|
1567
|
+
var { style, figures, clear, lines } = require_util();
|
|
4227
1568
|
var isNumber = /[0-9]/;
|
|
4228
1569
|
var isDef = (any) => any !== void 0;
|
|
4229
1570
|
var round = (number, precision) => {
|
|
@@ -4406,13 +1747,13 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
|
4406
1747
|
});
|
|
4407
1748
|
|
|
4408
1749
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js
|
|
4409
|
-
var
|
|
1750
|
+
var require_multiselect = __commonJS({
|
|
4410
1751
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports, module2) {
|
|
4411
1752
|
"use strict";
|
|
4412
1753
|
var color = require_kleur();
|
|
4413
1754
|
var { cursor } = require_src();
|
|
4414
|
-
var Prompt =
|
|
4415
|
-
var { clear, figures, style, wrap, entriesToDisplay } =
|
|
1755
|
+
var Prompt = require_prompt();
|
|
1756
|
+
var { clear, figures, style, wrap, entriesToDisplay } = require_util();
|
|
4416
1757
|
var MultiselectPrompt = class extends Prompt {
|
|
4417
1758
|
constructor(opts = {}) {
|
|
4418
1759
|
super(opts);
|
|
@@ -4632,13 +1973,13 @@ Instructions:
|
|
|
4632
1973
|
});
|
|
4633
1974
|
|
|
4634
1975
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js
|
|
4635
|
-
var
|
|
1976
|
+
var require_autocomplete = __commonJS({
|
|
4636
1977
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports, module2) {
|
|
4637
1978
|
"use strict";
|
|
4638
1979
|
var color = require_kleur();
|
|
4639
|
-
var Prompt =
|
|
1980
|
+
var Prompt = require_prompt();
|
|
4640
1981
|
var { erase, cursor } = require_src();
|
|
4641
|
-
var { style, clear, figures, wrap, entriesToDisplay } =
|
|
1982
|
+
var { style, clear, figures, wrap, entriesToDisplay } = require_util();
|
|
4642
1983
|
var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);
|
|
4643
1984
|
var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);
|
|
4644
1985
|
var getIndex = (arr, valOrTitle) => {
|
|
@@ -4853,13 +2194,13 @@ var require_autocomplete2 = __commonJS({
|
|
|
4853
2194
|
});
|
|
4854
2195
|
|
|
4855
2196
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js
|
|
4856
|
-
var
|
|
2197
|
+
var require_autocompleteMultiselect = __commonJS({
|
|
4857
2198
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports, module2) {
|
|
4858
2199
|
"use strict";
|
|
4859
2200
|
var color = require_kleur();
|
|
4860
2201
|
var { cursor } = require_src();
|
|
4861
|
-
var MultiselectPrompt =
|
|
4862
|
-
var { clear, style, figures } =
|
|
2202
|
+
var MultiselectPrompt = require_multiselect();
|
|
2203
|
+
var { clear, style, figures } = require_util();
|
|
4863
2204
|
var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
|
|
4864
2205
|
constructor(opts = {}) {
|
|
4865
2206
|
opts.overrideRender = true;
|
|
@@ -5018,11 +2359,11 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
5018
2359
|
});
|
|
5019
2360
|
|
|
5020
2361
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js
|
|
5021
|
-
var
|
|
2362
|
+
var require_confirm = __commonJS({
|
|
5022
2363
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports, module2) {
|
|
5023
2364
|
var color = require_kleur();
|
|
5024
|
-
var Prompt =
|
|
5025
|
-
var { style, clear } =
|
|
2365
|
+
var Prompt = require_prompt();
|
|
2366
|
+
var { style, clear } = require_util();
|
|
5026
2367
|
var { erase, cursor } = require_src();
|
|
5027
2368
|
var ConfirmPrompt = class extends Prompt {
|
|
5028
2369
|
constructor(opts = {}) {
|
|
@@ -5093,29 +2434,29 @@ var require_confirm2 = __commonJS({
|
|
|
5093
2434
|
});
|
|
5094
2435
|
|
|
5095
2436
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js
|
|
5096
|
-
var
|
|
2437
|
+
var require_elements = __commonJS({
|
|
5097
2438
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js"(exports, module2) {
|
|
5098
2439
|
"use strict";
|
|
5099
2440
|
module2.exports = {
|
|
5100
|
-
TextPrompt:
|
|
5101
|
-
SelectPrompt:
|
|
5102
|
-
TogglePrompt:
|
|
5103
|
-
DatePrompt:
|
|
5104
|
-
NumberPrompt:
|
|
5105
|
-
MultiselectPrompt:
|
|
5106
|
-
AutocompletePrompt:
|
|
5107
|
-
AutocompleteMultiselectPrompt:
|
|
5108
|
-
ConfirmPrompt:
|
|
2441
|
+
TextPrompt: require_text(),
|
|
2442
|
+
SelectPrompt: require_select(),
|
|
2443
|
+
TogglePrompt: require_toggle(),
|
|
2444
|
+
DatePrompt: require_date(),
|
|
2445
|
+
NumberPrompt: require_number(),
|
|
2446
|
+
MultiselectPrompt: require_multiselect(),
|
|
2447
|
+
AutocompletePrompt: require_autocomplete(),
|
|
2448
|
+
AutocompleteMultiselectPrompt: require_autocompleteMultiselect(),
|
|
2449
|
+
ConfirmPrompt: require_confirm()
|
|
5109
2450
|
};
|
|
5110
2451
|
}
|
|
5111
2452
|
});
|
|
5112
2453
|
|
|
5113
2454
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js
|
|
5114
|
-
var
|
|
2455
|
+
var require_prompts = __commonJS({
|
|
5115
2456
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js"(exports) {
|
|
5116
2457
|
"use strict";
|
|
5117
2458
|
var $ = exports;
|
|
5118
|
-
var el =
|
|
2459
|
+
var el = require_elements();
|
|
5119
2460
|
var noop = (v) => v;
|
|
5120
2461
|
function toPrompt(type, args, opts = {}) {
|
|
5121
2462
|
return new Promise((res, rej) => {
|
|
@@ -5178,7 +2519,7 @@ var require_prompts2 = __commonJS({
|
|
|
5178
2519
|
var require_lib = __commonJS({
|
|
5179
2520
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js"(exports, module2) {
|
|
5180
2521
|
"use strict";
|
|
5181
|
-
var prompts2 =
|
|
2522
|
+
var prompts2 = require_prompts();
|
|
5182
2523
|
var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
5183
2524
|
var noop = () => {
|
|
5184
2525
|
};
|
|
@@ -5196,7 +2537,7 @@ var require_lib = __commonJS({
|
|
|
5196
2537
|
for (question of questions) {
|
|
5197
2538
|
({ name, type } = question);
|
|
5198
2539
|
if (typeof type === "function") {
|
|
5199
|
-
type = await type(answer,
|
|
2540
|
+
type = await type(answer, { ...answers }, question);
|
|
5200
2541
|
question["type"] = type;
|
|
5201
2542
|
}
|
|
5202
2543
|
if (!type)
|
|
@@ -5205,7 +2546,7 @@ var require_lib = __commonJS({
|
|
|
5205
2546
|
if (passOn.includes(key))
|
|
5206
2547
|
continue;
|
|
5207
2548
|
let value = question[key];
|
|
5208
|
-
question[key] = typeof value === "function" ? await value(answer,
|
|
2549
|
+
question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
|
|
5209
2550
|
}
|
|
5210
2551
|
lastPrompt = question;
|
|
5211
2552
|
if (typeof question.message !== "string") {
|
|
@@ -5251,29 +2592,11 @@ var require_lib = __commonJS({
|
|
|
5251
2592
|
}
|
|
5252
2593
|
});
|
|
5253
2594
|
|
|
5254
|
-
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js
|
|
5255
|
-
var require_prompts3 = __commonJS({
|
|
5256
|
-
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js"(exports, module2) {
|
|
5257
|
-
function isNodeLT(tar) {
|
|
5258
|
-
tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number);
|
|
5259
|
-
let i = 0, src = process.versions.node.split(".").map(Number);
|
|
5260
|
-
for (; i < tar.length; i++) {
|
|
5261
|
-
if (src[i] > tar[i])
|
|
5262
|
-
return false;
|
|
5263
|
-
if (tar[i] > src[i])
|
|
5264
|
-
return true;
|
|
5265
|
-
}
|
|
5266
|
-
return false;
|
|
5267
|
-
}
|
|
5268
|
-
module2.exports = isNodeLT("8.6.0") ? require_dist() : require_lib();
|
|
5269
|
-
}
|
|
5270
|
-
});
|
|
5271
|
-
|
|
5272
2595
|
// index.ts
|
|
5273
2596
|
var fs4 = __toESM(require("fs"), 1);
|
|
5274
2597
|
var path4 = __toESM(require("path"), 1);
|
|
5275
2598
|
var import_minimist = __toESM(require_minimist(), 1);
|
|
5276
|
-
var import_prompts = __toESM(
|
|
2599
|
+
var import_prompts = __toESM(require_lib(), 1);
|
|
5277
2600
|
|
|
5278
2601
|
// node_modules/.pnpm/kolorist@1.5.1/node_modules/kolorist/dist/esm/index.mjs
|
|
5279
2602
|
var enabled = true;
|
|
@@ -5392,7 +2715,10 @@ function sortDependencies(packageJson) {
|
|
|
5392
2715
|
});
|
|
5393
2716
|
}
|
|
5394
2717
|
}
|
|
5395
|
-
return
|
|
2718
|
+
return {
|
|
2719
|
+
...packageJson,
|
|
2720
|
+
...sorted
|
|
2721
|
+
};
|
|
5396
2722
|
}
|
|
5397
2723
|
|
|
5398
2724
|
// utils/renderTemplate.ts
|
|
@@ -5563,10 +2889,10 @@ var path3 = __toESM(require("path"), 1);
|
|
|
5563
2889
|
var devDependencies = {
|
|
5564
2890
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
5565
2891
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
5566
|
-
"@vue/eslint-config-typescript": "^
|
|
2892
|
+
"@vue/eslint-config-typescript": "^11.0.0",
|
|
5567
2893
|
eslint: "^8.5.0",
|
|
5568
2894
|
"eslint-plugin-cypress": "^2.12.1",
|
|
5569
|
-
"eslint-plugin-vue": "^
|
|
2895
|
+
"eslint-plugin-vue": "^9.0.0",
|
|
5570
2896
|
prettier: "^2.5.1"
|
|
5571
2897
|
};
|
|
5572
2898
|
|
|
@@ -5579,10 +2905,7 @@ addEslintDependency("eslint");
|
|
|
5579
2905
|
addEslintDependency("eslint-plugin-vue");
|
|
5580
2906
|
var config = {
|
|
5581
2907
|
root: true,
|
|
5582
|
-
extends: ["plugin:vue/vue3-essential"]
|
|
5583
|
-
env: {
|
|
5584
|
-
"vue/setup-compiler-macros": true
|
|
5585
|
-
}
|
|
2908
|
+
extends: ["plugin:vue/vue3-essential"]
|
|
5586
2909
|
};
|
|
5587
2910
|
function configureEslint({ language, styleGuide, needsPrettier, needsCypress, needsCypressCT }) {
|
|
5588
2911
|
switch (`${styleGuide}-${language}`) {
|
|
@@ -5656,8 +2979,18 @@ function isValidPackageName(projectName) {
|
|
|
5656
2979
|
function toValidPackageName(projectName) {
|
|
5657
2980
|
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
|
|
5658
2981
|
}
|
|
5659
|
-
function
|
|
5660
|
-
|
|
2982
|
+
function canSkipEmptying(dir) {
|
|
2983
|
+
if (!fs4.existsSync(dir)) {
|
|
2984
|
+
return true;
|
|
2985
|
+
}
|
|
2986
|
+
const files = fs4.readdirSync(dir);
|
|
2987
|
+
if (files.length === 0) {
|
|
2988
|
+
return true;
|
|
2989
|
+
}
|
|
2990
|
+
if (files.length === 1 && files[0] === ".git") {
|
|
2991
|
+
return true;
|
|
2992
|
+
}
|
|
2993
|
+
return false;
|
|
5661
2994
|
}
|
|
5662
2995
|
function emptyDir(dir) {
|
|
5663
2996
|
if (!fs4.existsSync(dir)) {
|
|
@@ -5694,7 +3027,7 @@ ${banner_default}
|
|
|
5694
3027
|
},
|
|
5695
3028
|
{
|
|
5696
3029
|
name: "shouldOverwrite",
|
|
5697
|
-
type: () =>
|
|
3030
|
+
type: () => canSkipEmptying(targetDir) || forceOverwrite ? null : "confirm",
|
|
5698
3031
|
message: () => {
|
|
5699
3032
|
const dirForPrompt = targetDir === "." ? "Current directory" : `Target directory "${targetDir}"`;
|
|
5700
3033
|
return `${dirForPrompt} is not empty. Remove existing files and continue?`;
|