@form8ion/utils-cli 11.0.15 → 11.0.17
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/bin/form8ion-utils.js +35 -439
- package/bin/form8ion-utils.js.map +1 -1
- package/package.json +20 -20
package/bin/form8ion-utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import yargs from 'yargs';
|
|
3
|
-
import { format
|
|
4
|
-
import { resolve, normalize
|
|
5
|
-
import { readFileSync,
|
|
6
|
-
import
|
|
3
|
+
import { format } from 'util';
|
|
4
|
+
import { resolve, normalize } from 'path';
|
|
5
|
+
import { readFileSync, writeFile, statSync } from 'fs';
|
|
6
|
+
import 'assert';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import updateNotifier from 'update-notifier';
|
|
9
9
|
import { questionNames as questionNames$1, scaffold as scaffold$1 } from '@form8ion/project';
|
|
@@ -31,16 +31,6 @@ import { lift as lift$2, test } from '@form8ion/jetbrains';
|
|
|
31
31
|
import { scaffold as scaffold$3 } from '@form8ion/codecov';
|
|
32
32
|
import { scaffold as scaffold$2 } from '@form8ion/prettier';
|
|
33
33
|
|
|
34
|
-
class YError extends Error {
|
|
35
|
-
constructor(msg) {
|
|
36
|
-
super(msg || 'yargs error');
|
|
37
|
-
this.name = 'YError';
|
|
38
|
-
if (Error.captureStackTrace) {
|
|
39
|
-
Error.captureStackTrace(this, YError);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
34
|
function getProcessArgvBinIndex() {
|
|
45
35
|
if (isBundledElectronApp())
|
|
46
36
|
return 0;
|
|
@@ -55,9 +45,6 @@ function isElectronApp() {
|
|
|
55
45
|
function hideBin(argv) {
|
|
56
46
|
return argv.slice(getProcessArgvBinIndex() + 1);
|
|
57
47
|
}
|
|
58
|
-
function getProcessArgvBin() {
|
|
59
|
-
return process.argv[getProcessArgvBinIndex()];
|
|
60
|
-
}
|
|
61
48
|
|
|
62
49
|
/**
|
|
63
50
|
* @license
|
|
@@ -184,10 +171,10 @@ var DefaultValuesForTypeKey;
|
|
|
184
171
|
* Copyright (c) 2016, Contributors
|
|
185
172
|
* SPDX-License-Identifier: ISC
|
|
186
173
|
*/
|
|
187
|
-
let mixin
|
|
174
|
+
let mixin;
|
|
188
175
|
class YargsParser {
|
|
189
176
|
constructor(_mixin) {
|
|
190
|
-
mixin
|
|
177
|
+
mixin = _mixin;
|
|
191
178
|
}
|
|
192
179
|
parse(argsInput, options) {
|
|
193
180
|
const opts = Object.assign({
|
|
@@ -244,7 +231,7 @@ class YargsParser {
|
|
|
244
231
|
const newAliases = Object.create(null);
|
|
245
232
|
const defaulted = Object.create(null);
|
|
246
233
|
// allow a i18n handler to be passed in, default to a fake one (util.format).
|
|
247
|
-
const __ = opts.__ || mixin
|
|
234
|
+
const __ = opts.__ || mixin.format;
|
|
248
235
|
const flags = {
|
|
249
236
|
aliases: Object.create(null),
|
|
250
237
|
arrays: Object.create(null),
|
|
@@ -718,7 +705,7 @@ class YargsParser {
|
|
|
718
705
|
return val;
|
|
719
706
|
},
|
|
720
707
|
set(value) {
|
|
721
|
-
val = typeof value === 'string' ? mixin
|
|
708
|
+
val = typeof value === 'string' ? mixin.normalize(value) : value;
|
|
722
709
|
}
|
|
723
710
|
});
|
|
724
711
|
});
|
|
@@ -753,9 +740,9 @@ class YargsParser {
|
|
|
753
740
|
// Set normalized value when key is in 'normalize' and in 'arrays'
|
|
754
741
|
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
|
|
755
742
|
if (Array.isArray(val))
|
|
756
|
-
value = val.map((val) => { return mixin
|
|
743
|
+
value = val.map((val) => { return mixin.normalize(val); });
|
|
757
744
|
else
|
|
758
|
-
value = mixin
|
|
745
|
+
value = mixin.normalize(val);
|
|
759
746
|
}
|
|
760
747
|
return value;
|
|
761
748
|
}
|
|
@@ -782,7 +769,7 @@ class YargsParser {
|
|
|
782
769
|
if (configPath) {
|
|
783
770
|
try {
|
|
784
771
|
let config = null;
|
|
785
|
-
const resolvedConfigPath = mixin
|
|
772
|
+
const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
|
|
786
773
|
const resolveConfig = flags.configs[configKey];
|
|
787
774
|
if (typeof resolveConfig === 'function') {
|
|
788
775
|
try {
|
|
@@ -797,7 +784,7 @@ class YargsParser {
|
|
|
797
784
|
}
|
|
798
785
|
}
|
|
799
786
|
else {
|
|
800
|
-
config = mixin
|
|
787
|
+
config = mixin.require(resolvedConfigPath);
|
|
801
788
|
}
|
|
802
789
|
setConfigObject(config);
|
|
803
790
|
}
|
|
@@ -846,7 +833,7 @@ class YargsParser {
|
|
|
846
833
|
if (typeof envPrefix === 'undefined')
|
|
847
834
|
return;
|
|
848
835
|
const prefix = typeof envPrefix === 'string' ? envPrefix : '';
|
|
849
|
-
const env = mixin
|
|
836
|
+
const env = mixin.env();
|
|
850
837
|
Object.keys(env).forEach(function (envVar) {
|
|
851
838
|
if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
|
|
852
839
|
// get array of nested keys and convert them to camel case
|
|
@@ -1233,7 +1220,7 @@ var _a, _b, _c;
|
|
|
1233
1220
|
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
|
|
1234
1221
|
? Number(process.env.YARGS_MIN_NODE_VERSION)
|
|
1235
1222
|
: 12;
|
|
1236
|
-
const nodeVersion = (_b = (_a = process === null || process ===
|
|
1223
|
+
const nodeVersion = (_b = (_a = process === null || process === undefined ? undefined : process.versions) === null || _a === undefined ? undefined : _a.node) !== null && _b !== undefined ? _b : (_c = process === null || process === undefined ? undefined : process.version) === null || _c === undefined ? undefined : _c.slice(1);
|
|
1237
1224
|
if (nodeVersion) {
|
|
1238
1225
|
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
|
1239
1226
|
if (major < minNodeVersion) {
|
|
@@ -1242,7 +1229,7 @@ if (nodeVersion) {
|
|
|
1242
1229
|
}
|
|
1243
1230
|
// Creates a yargs-parser instance using Node.js standard libraries:
|
|
1244
1231
|
const env = process ? process.env : {};
|
|
1245
|
-
|
|
1232
|
+
new YargsParser({
|
|
1246
1233
|
cwd: process.cwd,
|
|
1247
1234
|
env: () => {
|
|
1248
1235
|
return env;
|
|
@@ -1265,359 +1252,6 @@ const parser = new YargsParser({
|
|
|
1265
1252
|
}
|
|
1266
1253
|
}
|
|
1267
1254
|
});
|
|
1268
|
-
const yargsParser = function Parser(args, opts) {
|
|
1269
|
-
const result = parser.parse(args.slice(), opts);
|
|
1270
|
-
return result.argv;
|
|
1271
|
-
};
|
|
1272
|
-
yargsParser.detailed = function (args, opts) {
|
|
1273
|
-
return parser.parse(args.slice(), opts);
|
|
1274
|
-
};
|
|
1275
|
-
yargsParser.camelCase = camelCase;
|
|
1276
|
-
yargsParser.decamelize = decamelize;
|
|
1277
|
-
yargsParser.looksLikeNumber = looksLikeNumber;
|
|
1278
|
-
|
|
1279
|
-
const align = {
|
|
1280
|
-
right: alignRight,
|
|
1281
|
-
center: alignCenter
|
|
1282
|
-
};
|
|
1283
|
-
const top = 0;
|
|
1284
|
-
const right = 1;
|
|
1285
|
-
const bottom = 2;
|
|
1286
|
-
const left = 3;
|
|
1287
|
-
class UI {
|
|
1288
|
-
constructor(opts) {
|
|
1289
|
-
var _a;
|
|
1290
|
-
this.width = opts.width;
|
|
1291
|
-
this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
|
|
1292
|
-
this.rows = [];
|
|
1293
|
-
}
|
|
1294
|
-
span(...args) {
|
|
1295
|
-
const cols = this.div(...args);
|
|
1296
|
-
cols.span = true;
|
|
1297
|
-
}
|
|
1298
|
-
resetOutput() {
|
|
1299
|
-
this.rows = [];
|
|
1300
|
-
}
|
|
1301
|
-
div(...args) {
|
|
1302
|
-
if (args.length === 0) {
|
|
1303
|
-
this.div('');
|
|
1304
|
-
}
|
|
1305
|
-
if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
|
|
1306
|
-
return this.applyLayoutDSL(args[0]);
|
|
1307
|
-
}
|
|
1308
|
-
const cols = args.map(arg => {
|
|
1309
|
-
if (typeof arg === 'string') {
|
|
1310
|
-
return this.colFromString(arg);
|
|
1311
|
-
}
|
|
1312
|
-
return arg;
|
|
1313
|
-
});
|
|
1314
|
-
this.rows.push(cols);
|
|
1315
|
-
return cols;
|
|
1316
|
-
}
|
|
1317
|
-
shouldApplyLayoutDSL(...args) {
|
|
1318
|
-
return args.length === 1 && typeof args[0] === 'string' &&
|
|
1319
|
-
/[\t\n]/.test(args[0]);
|
|
1320
|
-
}
|
|
1321
|
-
applyLayoutDSL(str) {
|
|
1322
|
-
const rows = str.split('\n').map(row => row.split('\t'));
|
|
1323
|
-
let leftColumnWidth = 0;
|
|
1324
|
-
// simple heuristic for layout, make sure the
|
|
1325
|
-
// second column lines up along the left-hand.
|
|
1326
|
-
// don't allow the first column to take up more
|
|
1327
|
-
// than 50% of the screen.
|
|
1328
|
-
rows.forEach(columns => {
|
|
1329
|
-
if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
|
|
1330
|
-
leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
|
|
1331
|
-
}
|
|
1332
|
-
});
|
|
1333
|
-
// generate a table:
|
|
1334
|
-
// replacing ' ' with padding calculations.
|
|
1335
|
-
// using the algorithmically generated width.
|
|
1336
|
-
rows.forEach(columns => {
|
|
1337
|
-
this.div(...columns.map((r, i) => {
|
|
1338
|
-
return {
|
|
1339
|
-
text: r.trim(),
|
|
1340
|
-
padding: this.measurePadding(r),
|
|
1341
|
-
width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
|
|
1342
|
-
};
|
|
1343
|
-
}));
|
|
1344
|
-
});
|
|
1345
|
-
return this.rows[this.rows.length - 1];
|
|
1346
|
-
}
|
|
1347
|
-
colFromString(text) {
|
|
1348
|
-
return {
|
|
1349
|
-
text,
|
|
1350
|
-
padding: this.measurePadding(text)
|
|
1351
|
-
};
|
|
1352
|
-
}
|
|
1353
|
-
measurePadding(str) {
|
|
1354
|
-
// measure padding without ansi escape codes
|
|
1355
|
-
const noAnsi = mixin.stripAnsi(str);
|
|
1356
|
-
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
|
|
1357
|
-
}
|
|
1358
|
-
toString() {
|
|
1359
|
-
const lines = [];
|
|
1360
|
-
this.rows.forEach(row => {
|
|
1361
|
-
this.rowToString(row, lines);
|
|
1362
|
-
});
|
|
1363
|
-
// don't display any lines with the
|
|
1364
|
-
// hidden flag set.
|
|
1365
|
-
return lines
|
|
1366
|
-
.filter(line => !line.hidden)
|
|
1367
|
-
.map(line => line.text)
|
|
1368
|
-
.join('\n');
|
|
1369
|
-
}
|
|
1370
|
-
rowToString(row, lines) {
|
|
1371
|
-
this.rasterize(row).forEach((rrow, r) => {
|
|
1372
|
-
let str = '';
|
|
1373
|
-
rrow.forEach((col, c) => {
|
|
1374
|
-
const { width } = row[c]; // the width with padding.
|
|
1375
|
-
const wrapWidth = this.negatePadding(row[c]); // the width without padding.
|
|
1376
|
-
let ts = col; // temporary string used during alignment/padding.
|
|
1377
|
-
if (wrapWidth > mixin.stringWidth(col)) {
|
|
1378
|
-
ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
|
|
1379
|
-
}
|
|
1380
|
-
// align the string within its column.
|
|
1381
|
-
if (row[c].align && row[c].align !== 'left' && this.wrap) {
|
|
1382
|
-
const fn = align[row[c].align];
|
|
1383
|
-
ts = fn(ts, wrapWidth);
|
|
1384
|
-
if (mixin.stringWidth(ts) < wrapWidth) {
|
|
1385
|
-
ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
// apply border and padding to string.
|
|
1389
|
-
const padding = row[c].padding || [0, 0, 0, 0];
|
|
1390
|
-
if (padding[left]) {
|
|
1391
|
-
str += ' '.repeat(padding[left]);
|
|
1392
|
-
}
|
|
1393
|
-
str += addBorder(row[c], ts, '| ');
|
|
1394
|
-
str += ts;
|
|
1395
|
-
str += addBorder(row[c], ts, ' |');
|
|
1396
|
-
if (padding[right]) {
|
|
1397
|
-
str += ' '.repeat(padding[right]);
|
|
1398
|
-
}
|
|
1399
|
-
// if prior row is span, try to render the
|
|
1400
|
-
// current row on the prior line.
|
|
1401
|
-
if (r === 0 && lines.length > 0) {
|
|
1402
|
-
str = this.renderInline(str, lines[lines.length - 1]);
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
// remove trailing whitespace.
|
|
1406
|
-
lines.push({
|
|
1407
|
-
text: str.replace(/ +$/, ''),
|
|
1408
|
-
span: row.span
|
|
1409
|
-
});
|
|
1410
|
-
});
|
|
1411
|
-
return lines;
|
|
1412
|
-
}
|
|
1413
|
-
// if the full 'source' can render in
|
|
1414
|
-
// the target line, do so.
|
|
1415
|
-
renderInline(source, previousLine) {
|
|
1416
|
-
const match = source.match(/^ */);
|
|
1417
|
-
const leadingWhitespace = match ? match[0].length : 0;
|
|
1418
|
-
const target = previousLine.text;
|
|
1419
|
-
const targetTextWidth = mixin.stringWidth(target.trimRight());
|
|
1420
|
-
if (!previousLine.span) {
|
|
1421
|
-
return source;
|
|
1422
|
-
}
|
|
1423
|
-
// if we're not applying wrapping logic,
|
|
1424
|
-
// just always append to the span.
|
|
1425
|
-
if (!this.wrap) {
|
|
1426
|
-
previousLine.hidden = true;
|
|
1427
|
-
return target + source;
|
|
1428
|
-
}
|
|
1429
|
-
if (leadingWhitespace < targetTextWidth) {
|
|
1430
|
-
return source;
|
|
1431
|
-
}
|
|
1432
|
-
previousLine.hidden = true;
|
|
1433
|
-
return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
|
|
1434
|
-
}
|
|
1435
|
-
rasterize(row) {
|
|
1436
|
-
const rrows = [];
|
|
1437
|
-
const widths = this.columnWidths(row);
|
|
1438
|
-
let wrapped;
|
|
1439
|
-
// word wrap all columns, and create
|
|
1440
|
-
// a data-structure that is easy to rasterize.
|
|
1441
|
-
row.forEach((col, c) => {
|
|
1442
|
-
// leave room for left and right padding.
|
|
1443
|
-
col.width = widths[c];
|
|
1444
|
-
if (this.wrap) {
|
|
1445
|
-
wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
|
|
1446
|
-
}
|
|
1447
|
-
else {
|
|
1448
|
-
wrapped = col.text.split('\n');
|
|
1449
|
-
}
|
|
1450
|
-
if (col.border) {
|
|
1451
|
-
wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
|
|
1452
|
-
wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
|
|
1453
|
-
}
|
|
1454
|
-
// add top and bottom padding.
|
|
1455
|
-
if (col.padding) {
|
|
1456
|
-
wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
|
|
1457
|
-
wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
|
|
1458
|
-
}
|
|
1459
|
-
wrapped.forEach((str, r) => {
|
|
1460
|
-
if (!rrows[r]) {
|
|
1461
|
-
rrows.push([]);
|
|
1462
|
-
}
|
|
1463
|
-
const rrow = rrows[r];
|
|
1464
|
-
for (let i = 0; i < c; i++) {
|
|
1465
|
-
if (rrow[i] === undefined) {
|
|
1466
|
-
rrow.push('');
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
rrow.push(str);
|
|
1470
|
-
});
|
|
1471
|
-
});
|
|
1472
|
-
return rrows;
|
|
1473
|
-
}
|
|
1474
|
-
negatePadding(col) {
|
|
1475
|
-
let wrapWidth = col.width || 0;
|
|
1476
|
-
if (col.padding) {
|
|
1477
|
-
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
|
|
1478
|
-
}
|
|
1479
|
-
if (col.border) {
|
|
1480
|
-
wrapWidth -= 4;
|
|
1481
|
-
}
|
|
1482
|
-
return wrapWidth;
|
|
1483
|
-
}
|
|
1484
|
-
columnWidths(row) {
|
|
1485
|
-
if (!this.wrap) {
|
|
1486
|
-
return row.map(col => {
|
|
1487
|
-
return col.width || mixin.stringWidth(col.text);
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
let unset = row.length;
|
|
1491
|
-
let remainingWidth = this.width;
|
|
1492
|
-
// column widths can be set in config.
|
|
1493
|
-
const widths = row.map(col => {
|
|
1494
|
-
if (col.width) {
|
|
1495
|
-
unset--;
|
|
1496
|
-
remainingWidth -= col.width;
|
|
1497
|
-
return col.width;
|
|
1498
|
-
}
|
|
1499
|
-
return undefined;
|
|
1500
|
-
});
|
|
1501
|
-
// any unset widths should be calculated.
|
|
1502
|
-
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
|
|
1503
|
-
return widths.map((w, i) => {
|
|
1504
|
-
if (w === undefined) {
|
|
1505
|
-
return Math.max(unsetWidth, _minWidth(row[i]));
|
|
1506
|
-
}
|
|
1507
|
-
return w;
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
function addBorder(col, ts, style) {
|
|
1512
|
-
if (col.border) {
|
|
1513
|
-
if (/[.']-+[.']/.test(ts)) {
|
|
1514
|
-
return '';
|
|
1515
|
-
}
|
|
1516
|
-
if (ts.trim().length !== 0) {
|
|
1517
|
-
return style;
|
|
1518
|
-
}
|
|
1519
|
-
return ' ';
|
|
1520
|
-
}
|
|
1521
|
-
return '';
|
|
1522
|
-
}
|
|
1523
|
-
// calculates the minimum width of
|
|
1524
|
-
// a column, based on padding preferences.
|
|
1525
|
-
function _minWidth(col) {
|
|
1526
|
-
const padding = col.padding || [];
|
|
1527
|
-
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
|
|
1528
|
-
if (col.border) {
|
|
1529
|
-
return minWidth + 4;
|
|
1530
|
-
}
|
|
1531
|
-
return minWidth;
|
|
1532
|
-
}
|
|
1533
|
-
function getWindowWidth() {
|
|
1534
|
-
/* istanbul ignore next: depends on terminal */
|
|
1535
|
-
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
|
1536
|
-
return process.stdout.columns;
|
|
1537
|
-
}
|
|
1538
|
-
return 80;
|
|
1539
|
-
}
|
|
1540
|
-
function alignRight(str, width) {
|
|
1541
|
-
str = str.trim();
|
|
1542
|
-
const strWidth = mixin.stringWidth(str);
|
|
1543
|
-
if (strWidth < width) {
|
|
1544
|
-
return ' '.repeat(width - strWidth) + str;
|
|
1545
|
-
}
|
|
1546
|
-
return str;
|
|
1547
|
-
}
|
|
1548
|
-
function alignCenter(str, width) {
|
|
1549
|
-
str = str.trim();
|
|
1550
|
-
const strWidth = mixin.stringWidth(str);
|
|
1551
|
-
/* istanbul ignore next */
|
|
1552
|
-
if (strWidth >= width) {
|
|
1553
|
-
return str;
|
|
1554
|
-
}
|
|
1555
|
-
return ' '.repeat((width - strWidth) >> 1) + str;
|
|
1556
|
-
}
|
|
1557
|
-
let mixin;
|
|
1558
|
-
function cliui(opts, _mixin) {
|
|
1559
|
-
mixin = _mixin;
|
|
1560
|
-
return new UI({
|
|
1561
|
-
width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
|
|
1562
|
-
wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
// Minimal replacement for ansi string helpers "wrap-ansi" and "strip-ansi".
|
|
1567
|
-
// to facilitate ESM and Deno modules.
|
|
1568
|
-
// TODO: look at porting https://www.npmjs.com/package/wrap-ansi to ESM.
|
|
1569
|
-
// The npm application
|
|
1570
|
-
// Copyright (c) npm, Inc. and Contributors
|
|
1571
|
-
// Licensed on the terms of The Artistic License 2.0
|
|
1572
|
-
// See: https://github.com/npm/cli/blob/4c65cd952bc8627811735bea76b9b110cc4fc80e/lib/utils/ansi-trim.js
|
|
1573
|
-
const ansi = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
|
|
1574
|
-
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g');
|
|
1575
|
-
function stripAnsi(str) {
|
|
1576
|
-
return str.replace(ansi, '');
|
|
1577
|
-
}
|
|
1578
|
-
function wrap(str, width) {
|
|
1579
|
-
const [start, end] = str.match(ansi) || ['', ''];
|
|
1580
|
-
str = stripAnsi(str);
|
|
1581
|
-
let wrapped = '';
|
|
1582
|
-
for (let i = 0; i < str.length; i++) {
|
|
1583
|
-
if (i !== 0 && (i % width) === 0) {
|
|
1584
|
-
wrapped += '\n';
|
|
1585
|
-
}
|
|
1586
|
-
wrapped += str.charAt(i);
|
|
1587
|
-
}
|
|
1588
|
-
if (start && end) {
|
|
1589
|
-
wrapped = `${start}${wrapped}${end}`;
|
|
1590
|
-
}
|
|
1591
|
-
return wrapped;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
// Bootstrap cliui with CommonJS dependencies:
|
|
1595
|
-
|
|
1596
|
-
function ui (opts) {
|
|
1597
|
-
return cliui(opts, {
|
|
1598
|
-
stringWidth: (str) => {
|
|
1599
|
-
return [...str].length
|
|
1600
|
-
},
|
|
1601
|
-
stripAnsi,
|
|
1602
|
-
wrap
|
|
1603
|
-
})
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
function escalade (start, callback) {
|
|
1607
|
-
let dir = resolve('.', start);
|
|
1608
|
-
let tmp, stats = statSync(dir);
|
|
1609
|
-
|
|
1610
|
-
if (!stats.isDirectory()) {
|
|
1611
|
-
dir = dirname(dir);
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
while (true) {
|
|
1615
|
-
tmp = callback(dir, readdirSync(dir));
|
|
1616
|
-
if (tmp) return resolve(dir, tmp);
|
|
1617
|
-
dir = dirname(tmp = dir);
|
|
1618
|
-
if (tmp === dir) break;
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
1255
|
|
|
1622
1256
|
var shim$1 = {
|
|
1623
1257
|
fs: {
|
|
@@ -1815,9 +1449,6 @@ const y18n = (opts) => {
|
|
|
1815
1449
|
return y18n$1(opts, shim$1)
|
|
1816
1450
|
};
|
|
1817
1451
|
|
|
1818
|
-
const REQUIRE_ERROR = 'require is not supported by ESM';
|
|
1819
|
-
const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM';
|
|
1820
|
-
|
|
1821
1452
|
let __dirname;
|
|
1822
1453
|
try {
|
|
1823
1454
|
__dirname = fileURLToPath(import.meta.url);
|
|
@@ -1827,48 +1458,13 @@ try {
|
|
|
1827
1458
|
const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));
|
|
1828
1459
|
|
|
1829
1460
|
({
|
|
1830
|
-
assert: {
|
|
1831
|
-
notStrictEqual,
|
|
1832
|
-
strictEqual
|
|
1833
|
-
},
|
|
1834
|
-
cliui: ui,
|
|
1835
|
-
findUp: escalade,
|
|
1836
|
-
getEnv: (key) => {
|
|
1837
|
-
return process.env[key]
|
|
1838
|
-
},
|
|
1839
|
-
inspect,
|
|
1840
|
-
getCallerFile: () => {
|
|
1841
|
-
throw new YError(REQUIRE_DIRECTORY_ERROR)
|
|
1842
|
-
},
|
|
1843
|
-
getProcessArgvBin,
|
|
1844
1461
|
mainFilename: mainFilename || process.cwd(),
|
|
1845
|
-
Parser: yargsParser,
|
|
1846
|
-
path: {
|
|
1847
|
-
basename,
|
|
1848
|
-
dirname,
|
|
1849
|
-
extname,
|
|
1850
|
-
relative,
|
|
1851
|
-
resolve
|
|
1852
|
-
},
|
|
1853
1462
|
process: {
|
|
1854
|
-
argv: () => process.argv,
|
|
1855
1463
|
cwd: process.cwd,
|
|
1856
|
-
emitWarning: (warning, type) => process.emitWarning(warning, type),
|
|
1857
|
-
execPath: () => process.execPath,
|
|
1858
1464
|
exit: process.exit,
|
|
1859
1465
|
nextTick: process.nextTick,
|
|
1860
1466
|
stdColumns: typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null
|
|
1861
1467
|
},
|
|
1862
|
-
readFileSync,
|
|
1863
|
-
require: () => {
|
|
1864
|
-
throw new YError(REQUIRE_ERROR)
|
|
1865
|
-
},
|
|
1866
|
-
requireDirectory: () => {
|
|
1867
|
-
throw new YError(REQUIRE_DIRECTORY_ERROR)
|
|
1868
|
-
},
|
|
1869
|
-
stringWidth: (str) => {
|
|
1870
|
-
return [...str].length
|
|
1871
|
-
},
|
|
1872
1468
|
y18n: y18n({
|
|
1873
1469
|
directory: resolve(__dirname, '../../../locales'),
|
|
1874
1470
|
updateFiles: false
|
|
@@ -1878,7 +1474,7 @@ const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'
|
|
|
1878
1474
|
var name = "@form8ion/utils-cli";
|
|
1879
1475
|
var description = "cli for various tools for the organization";
|
|
1880
1476
|
var license = "MIT";
|
|
1881
|
-
var version = "11.0.
|
|
1477
|
+
var version = "11.0.17";
|
|
1882
1478
|
var type = "module";
|
|
1883
1479
|
var engines = {
|
|
1884
1480
|
node: "^18.19.0 || ^20.6.1 || >=22"
|
|
@@ -1927,14 +1523,14 @@ var publishConfig = {
|
|
|
1927
1523
|
access: "public",
|
|
1928
1524
|
provenance: true
|
|
1929
1525
|
};
|
|
1930
|
-
var packageManager = "npm@
|
|
1526
|
+
var packageManager = "npm@11.1.0+sha512.acf301ad9b9ddba948fcb72341e2f0fcae477f56a95cc2a092934d133a7461062633cefbf93d5934a3dc0768674e2edee9f04dcfcc4bb4c327ff0e3a7d552a1b";
|
|
1931
1527
|
var dependencies = {
|
|
1932
1528
|
"@form8ion/codecov": "6.2.0",
|
|
1933
1529
|
"@form8ion/cucumber-scaffolder": "4.0.0",
|
|
1934
1530
|
"@form8ion/github": "2.0.0",
|
|
1935
1531
|
"@form8ion/github-actions-node-ci": "5.0.1",
|
|
1936
1532
|
"@form8ion/hapi-scaffolder": "4.1.1",
|
|
1937
|
-
"@form8ion/javascript": "13.0
|
|
1533
|
+
"@form8ion/javascript": "13.2.0",
|
|
1938
1534
|
"@form8ion/javascript-core": "12.3.0",
|
|
1939
1535
|
"@form8ion/jetbrains": "1.1.3",
|
|
1940
1536
|
"@form8ion/lift": "10.0.0",
|
|
@@ -1950,52 +1546,52 @@ var dependencies = {
|
|
|
1950
1546
|
"@form8ion/rollup": "5.0.1",
|
|
1951
1547
|
"@form8ion/scaffolder-scaffolder": "6.1.0",
|
|
1952
1548
|
"@form8ion/vite": "2.0.1",
|
|
1953
|
-
"@form8ion/vitest": "4.
|
|
1549
|
+
"@form8ion/vitest": "4.3.0",
|
|
1954
1550
|
"update-notifier": "7.3.1",
|
|
1955
1551
|
yargs: "17.7.2"
|
|
1956
1552
|
};
|
|
1957
1553
|
var devDependencies = {
|
|
1958
|
-
"@cucumber/cucumber": "11.
|
|
1959
|
-
"@form8ion/commitlint-config": "2.0.
|
|
1554
|
+
"@cucumber/cucumber": "11.2.0",
|
|
1555
|
+
"@form8ion/commitlint-config": "2.0.4",
|
|
1960
1556
|
"@form8ion/core": "4.8.0",
|
|
1961
1557
|
"@form8ion/eslint-config": "7.0.12",
|
|
1962
1558
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
1963
1559
|
"@form8ion/eslint-config-mocha": "3.0.6",
|
|
1964
|
-
"@form8ion/remark-lint-preset": "6.0.
|
|
1965
|
-
"@rollup/plugin-node-resolve": "
|
|
1560
|
+
"@form8ion/remark-lint-preset": "6.0.6",
|
|
1561
|
+
"@rollup/plugin-node-resolve": "16.0.0",
|
|
1966
1562
|
"@travi/any": "3.1.2",
|
|
1967
|
-
"ban-sensitive-files": "1.10.
|
|
1968
|
-
c8: "10.1.
|
|
1563
|
+
"ban-sensitive-files": "1.10.7",
|
|
1564
|
+
c8: "10.1.3",
|
|
1969
1565
|
camelcase: "8.0.0",
|
|
1970
1566
|
chai: "5.1.2",
|
|
1971
1567
|
"clear-module": "4.1.2",
|
|
1972
1568
|
"cross-env": "7.0.3",
|
|
1973
1569
|
"cz-conventional-changelog": "3.3.0",
|
|
1974
1570
|
"deep-equal": "2.2.3",
|
|
1975
|
-
execa: "9.5.
|
|
1571
|
+
execa: "9.5.2",
|
|
1976
1572
|
"gherkin-lint": "4.2.4",
|
|
1977
1573
|
"http-status-codes": "2.3.0",
|
|
1978
|
-
husky: "9.1.
|
|
1979
|
-
"import-fresh": "3.3.
|
|
1980
|
-
"jest-when": "3.
|
|
1574
|
+
husky: "9.1.7",
|
|
1575
|
+
"import-fresh": "3.3.1",
|
|
1576
|
+
"jest-when": "3.7.0",
|
|
1981
1577
|
"js-yaml": "4.1.0",
|
|
1982
1578
|
"lockfile-lint": "4.14.0",
|
|
1983
1579
|
"ls-engines": "0.9.3",
|
|
1984
1580
|
"mdast-util-from-markdown": "2.0.2",
|
|
1985
1581
|
"mdast-zone": "6.1.0",
|
|
1986
|
-
"mock-fs": "5.
|
|
1987
|
-
msw: "2.
|
|
1988
|
-
"npm-run-all2": "7.0.
|
|
1989
|
-
publint: "0.
|
|
1582
|
+
"mock-fs": "5.5.0",
|
|
1583
|
+
msw: "2.7.0",
|
|
1584
|
+
"npm-run-all2": "7.0.2",
|
|
1585
|
+
publint: "0.3.3",
|
|
1990
1586
|
"remark-cli": "12.0.1",
|
|
1991
1587
|
rimraf: "6.0.1",
|
|
1992
|
-
rollup: "4.
|
|
1588
|
+
rollup: "4.34.4",
|
|
1993
1589
|
"rollup-plugin-auto-external": "2.0.0",
|
|
1994
1590
|
"rollup-plugin-executable": "1.6.3",
|
|
1995
1591
|
"rollup-plugin-json": "4.0.0",
|
|
1996
1592
|
testdouble: "3.20.2",
|
|
1997
1593
|
"unist-util-find": "3.0.0",
|
|
1998
|
-
vitest: "
|
|
1594
|
+
vitest: "3.0.5"
|
|
1999
1595
|
};
|
|
2000
1596
|
var pkg = {
|
|
2001
1597
|
name: name,
|