mdat 1.3.2 → 1.3.4
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/cli.js +200 -204
- package/dist/index.js +36 -38
- package/license.txt +1 -1
- package/package.json +13 -13
- package/readme.md +2 -2
package/bin/cli.js
CHANGED
|
@@ -30,10 +30,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
30
30
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
31
31
|
var __getProtoOf = Object.getPrototypeOf;
|
|
32
32
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
var __export = (all$2, symbols) => {
|
|
33
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __exportAll = (all$2, symbols) => {
|
|
37
35
|
let target = {};
|
|
38
36
|
for (var name in all$2) {
|
|
39
37
|
__defProp(target, name, {
|
|
@@ -68,9 +66,9 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
68
66
|
|
|
69
67
|
//#endregion
|
|
70
68
|
//#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
71
|
-
var require_picocolors = /* @__PURE__ */
|
|
72
|
-
let p = process || {}, argv = p.argv || [], env
|
|
73
|
-
let isColorSupported = !(!!env
|
|
69
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
70
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
71
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
74
72
|
let formatter = (open, close, replace$1 = open) => (input) => {
|
|
75
73
|
let string$2 = "" + input, index$2 = string$2.indexOf(close, open.length);
|
|
76
74
|
return ~index$2 ? open + replaceClose(string$2, close, replace$1, index$2) + close : open + string$2 + close;
|
|
@@ -133,11 +131,11 @@ var require_picocolors = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/picoco
|
|
|
133
131
|
};
|
|
134
132
|
module.exports = createColors();
|
|
135
133
|
module.exports.createColors = createColors;
|
|
136
|
-
})
|
|
134
|
+
}));
|
|
137
135
|
|
|
138
136
|
//#endregion
|
|
139
137
|
//#region node_modules/.pnpm/parse-ms@4.0.0/node_modules/parse-ms/index.js
|
|
140
|
-
var import_picocolors
|
|
138
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
141
139
|
const toZeroIfInfinity = (value) => Number.isFinite(value) ? value : 0;
|
|
142
140
|
function parseNumber(milliseconds) {
|
|
143
141
|
return {
|
|
@@ -976,7 +974,7 @@ var YargsParser = class {
|
|
|
976
974
|
let error = null;
|
|
977
975
|
checkConfiguration();
|
|
978
976
|
let notFlags = [];
|
|
979
|
-
const argv
|
|
977
|
+
const argv = Object.assign(Object.create(null), { _: [] });
|
|
980
978
|
const argvReturn = {};
|
|
981
979
|
for (let i = 0; i < args.length; i++) {
|
|
982
980
|
const arg = args[i];
|
|
@@ -1085,30 +1083,30 @@ var YargsParser = class {
|
|
|
1085
1083
|
break;
|
|
1086
1084
|
} else pushPositional(arg);
|
|
1087
1085
|
}
|
|
1088
|
-
applyEnvVars(argv
|
|
1089
|
-
applyEnvVars(argv
|
|
1090
|
-
setConfig(argv
|
|
1086
|
+
applyEnvVars(argv, true);
|
|
1087
|
+
applyEnvVars(argv, false);
|
|
1088
|
+
setConfig(argv);
|
|
1091
1089
|
setConfigObjects();
|
|
1092
|
-
applyDefaultsAndAliases(argv
|
|
1093
|
-
applyCoercions(argv
|
|
1094
|
-
if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv
|
|
1090
|
+
applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
|
|
1091
|
+
applyCoercions(argv);
|
|
1092
|
+
if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv);
|
|
1095
1093
|
Object.keys(flags.counts).forEach(function(key) {
|
|
1096
|
-
if (!hasKey(argv
|
|
1094
|
+
if (!hasKey(argv, key.split("."))) setArg(key, 0);
|
|
1097
1095
|
});
|
|
1098
|
-
if (notFlagsOption && notFlags.length) argv
|
|
1096
|
+
if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [];
|
|
1099
1097
|
notFlags.forEach(function(key) {
|
|
1100
|
-
argv
|
|
1098
|
+
argv[notFlagsArgv].push(key);
|
|
1101
1099
|
});
|
|
1102
|
-
if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) Object.keys(argv
|
|
1103
|
-
delete argv
|
|
1100
|
+
if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => {
|
|
1101
|
+
delete argv[key];
|
|
1104
1102
|
});
|
|
1105
1103
|
if (configuration["strip-aliased"]) [].concat(...Object.keys(aliases).map((k) => aliases[k])).forEach((alias) => {
|
|
1106
|
-
if (configuration["camel-case-expansion"] && alias.includes("-")) delete argv
|
|
1107
|
-
delete argv
|
|
1104
|
+
if (configuration["camel-case-expansion"] && alias.includes("-")) delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")];
|
|
1105
|
+
delete argv[alias];
|
|
1108
1106
|
});
|
|
1109
1107
|
function pushPositional(arg) {
|
|
1110
1108
|
const maybeCoercedNumber = maybeCoerceNumber("_", arg);
|
|
1111
|
-
if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") argv
|
|
1109
|
+
if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") argv._.push(maybeCoercedNumber);
|
|
1112
1110
|
}
|
|
1113
1111
|
function eatNargs(i, key, args$1, argAfterEqualSign) {
|
|
1114
1112
|
let ii;
|
|
@@ -1166,16 +1164,16 @@ var YargsParser = class {
|
|
|
1166
1164
|
}).join("."));
|
|
1167
1165
|
const value = processValue(key, val, shouldStripQuotes);
|
|
1168
1166
|
const splitKey = key.split(".");
|
|
1169
|
-
setKey(argv
|
|
1167
|
+
setKey(argv, splitKey, value);
|
|
1170
1168
|
if (flags.aliases[key]) flags.aliases[key].forEach(function(x) {
|
|
1171
|
-
setKey(argv
|
|
1169
|
+
setKey(argv, x.split("."), value);
|
|
1172
1170
|
});
|
|
1173
1171
|
if (splitKey.length > 1 && configuration["dot-notation"]) (flags.aliases[splitKey[0]] || []).forEach(function(x) {
|
|
1174
1172
|
let keyProperties = x.split(".");
|
|
1175
1173
|
const a = [].concat(splitKey);
|
|
1176
1174
|
a.shift();
|
|
1177
1175
|
keyProperties = keyProperties.concat(a);
|
|
1178
|
-
if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) setKey(argv
|
|
1176
|
+
if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) setKey(argv, keyProperties, value);
|
|
1179
1177
|
});
|
|
1180
1178
|
if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) [key].concat(flags.aliases[key] || []).forEach(function(key$1) {
|
|
1181
1179
|
Object.defineProperty(argvReturn, key$1, {
|
|
@@ -1218,11 +1216,11 @@ var YargsParser = class {
|
|
|
1218
1216
|
}
|
|
1219
1217
|
return value;
|
|
1220
1218
|
}
|
|
1221
|
-
function setConfig(argv$
|
|
1219
|
+
function setConfig(argv$1) {
|
|
1222
1220
|
const configLookup = Object.create(null);
|
|
1223
1221
|
applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
|
|
1224
1222
|
Object.keys(flags.configs).forEach(function(configKey) {
|
|
1225
|
-
const configPath = argv$
|
|
1223
|
+
const configPath = argv$1[configKey] || configLookup[configKey];
|
|
1226
1224
|
if (configPath) try {
|
|
1227
1225
|
let config$1 = null;
|
|
1228
1226
|
const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
|
|
@@ -1241,7 +1239,7 @@ var YargsParser = class {
|
|
|
1241
1239
|
setConfigObject(config$1);
|
|
1242
1240
|
} catch (ex) {
|
|
1243
1241
|
if (ex.name === "PermissionDenied") error = ex;
|
|
1244
|
-
else if (argv$
|
|
1242
|
+
else if (argv$1[configKey]) error = Error(__("Invalid JSON config file: %s", configPath));
|
|
1245
1243
|
}
|
|
1246
1244
|
});
|
|
1247
1245
|
}
|
|
@@ -1250,7 +1248,7 @@ var YargsParser = class {
|
|
|
1250
1248
|
const value = config$1[key];
|
|
1251
1249
|
const fullKey = prev ? prev + "." + key : key;
|
|
1252
1250
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) setConfigObject(value, fullKey);
|
|
1253
|
-
else if (!hasKey(argv
|
|
1251
|
+
else if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) setArg(fullKey, value);
|
|
1254
1252
|
});
|
|
1255
1253
|
}
|
|
1256
1254
|
function setConfigObjects() {
|
|
@@ -1258,31 +1256,31 @@ var YargsParser = class {
|
|
|
1258
1256
|
setConfigObject(configObject);
|
|
1259
1257
|
});
|
|
1260
1258
|
}
|
|
1261
|
-
function applyEnvVars(argv$
|
|
1259
|
+
function applyEnvVars(argv$1, configOnly) {
|
|
1262
1260
|
if (typeof envPrefix === "undefined") return;
|
|
1263
1261
|
const prefix = typeof envPrefix === "string" ? envPrefix : "";
|
|
1264
|
-
const env$
|
|
1265
|
-
Object.keys(env$
|
|
1262
|
+
const env$2 = mixin.env();
|
|
1263
|
+
Object.keys(env$2).forEach(function(envVar) {
|
|
1266
1264
|
if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
|
|
1267
1265
|
const keys$1 = envVar.split("__").map(function(key, i) {
|
|
1268
1266
|
if (i === 0) key = key.substring(prefix.length);
|
|
1269
1267
|
return camelCase(key);
|
|
1270
1268
|
});
|
|
1271
|
-
if ((configOnly && flags.configs[keys$1.join(".")] || !configOnly) && !hasKey(argv$
|
|
1269
|
+
if ((configOnly && flags.configs[keys$1.join(".")] || !configOnly) && !hasKey(argv$1, keys$1)) setArg(keys$1.join("."), env$2[envVar]);
|
|
1272
1270
|
}
|
|
1273
1271
|
});
|
|
1274
1272
|
}
|
|
1275
|
-
function applyCoercions(argv$
|
|
1273
|
+
function applyCoercions(argv$1) {
|
|
1276
1274
|
let coerce;
|
|
1277
1275
|
const applied = /* @__PURE__ */ new Set();
|
|
1278
|
-
Object.keys(argv$
|
|
1276
|
+
Object.keys(argv$1).forEach(function(key) {
|
|
1279
1277
|
if (!applied.has(key)) {
|
|
1280
1278
|
coerce = checkAllAliases(key, flags.coercions);
|
|
1281
1279
|
if (typeof coerce === "function") try {
|
|
1282
|
-
const value = maybeCoerceNumber(key, coerce(argv$
|
|
1280
|
+
const value = maybeCoerceNumber(key, coerce(argv$1[key]));
|
|
1283
1281
|
[].concat(flags.aliases[key] || [], key).forEach((ali) => {
|
|
1284
1282
|
applied.add(ali);
|
|
1285
|
-
argv$
|
|
1283
|
+
argv$1[ali] = value;
|
|
1286
1284
|
});
|
|
1287
1285
|
} catch (err) {
|
|
1288
1286
|
error = err;
|
|
@@ -1290,12 +1288,12 @@ var YargsParser = class {
|
|
|
1290
1288
|
}
|
|
1291
1289
|
});
|
|
1292
1290
|
}
|
|
1293
|
-
function setPlaceholderKeys(argv$
|
|
1291
|
+
function setPlaceholderKeys(argv$1) {
|
|
1294
1292
|
flags.keys.forEach((key) => {
|
|
1295
1293
|
if (~key.indexOf(".")) return;
|
|
1296
|
-
if (typeof argv$
|
|
1294
|
+
if (typeof argv$1[key] === "undefined") argv$1[key] = void 0;
|
|
1297
1295
|
});
|
|
1298
|
-
return argv$
|
|
1296
|
+
return argv$1;
|
|
1299
1297
|
}
|
|
1300
1298
|
function applyDefaultsAndAliases(obj, aliases$1, defaults$1, canLog = false) {
|
|
1301
1299
|
Object.keys(defaults$1).forEach(function(key) {
|
|
@@ -1457,7 +1455,7 @@ var YargsParser = class {
|
|
|
1457
1455
|
}
|
|
1458
1456
|
return {
|
|
1459
1457
|
aliases: Object.assign({}, flags.aliases),
|
|
1460
|
-
argv: Object.assign(argvReturn, argv
|
|
1458
|
+
argv: Object.assign(argvReturn, argv),
|
|
1461
1459
|
configuration,
|
|
1462
1460
|
defaulted: Object.assign({}, defaulted),
|
|
1463
1461
|
error,
|
|
@@ -1557,8 +1555,8 @@ function isBundledElectronApp() {
|
|
|
1557
1555
|
function isElectronApp() {
|
|
1558
1556
|
return !!process.versions.electron;
|
|
1559
1557
|
}
|
|
1560
|
-
function hideBin(argv
|
|
1561
|
-
return argv
|
|
1558
|
+
function hideBin(argv) {
|
|
1559
|
+
return argv.slice(getProcessArgvBinIndex() + 1);
|
|
1562
1560
|
}
|
|
1563
1561
|
function getProcessArgvBin() {
|
|
1564
1562
|
return process.argv[getProcessArgvBinIndex()];
|
|
@@ -1708,7 +1706,7 @@ var Y18N = class {
|
|
|
1708
1706
|
return shim$1.exists(file);
|
|
1709
1707
|
}
|
|
1710
1708
|
};
|
|
1711
|
-
function y18n(opts, _shim) {
|
|
1709
|
+
function y18n$1(opts, _shim) {
|
|
1712
1710
|
shim$1 = _shim;
|
|
1713
1711
|
const y18n$2 = new Y18N(opts);
|
|
1714
1712
|
return {
|
|
@@ -1723,10 +1721,10 @@ function y18n(opts, _shim) {
|
|
|
1723
1721
|
|
|
1724
1722
|
//#endregion
|
|
1725
1723
|
//#region node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs
|
|
1726
|
-
const y18n
|
|
1727
|
-
return y18n(opts, node_default);
|
|
1724
|
+
const y18n = (opts) => {
|
|
1725
|
+
return y18n$1(opts, node_default);
|
|
1728
1726
|
};
|
|
1729
|
-
var y18n_default = y18n
|
|
1727
|
+
var y18n_default = y18n;
|
|
1730
1728
|
|
|
1731
1729
|
//#endregion
|
|
1732
1730
|
//#region node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
@@ -1954,7 +1952,7 @@ function commandMiddlewareFactory(commandMiddleware) {
|
|
|
1954
1952
|
return middleware;
|
|
1955
1953
|
});
|
|
1956
1954
|
}
|
|
1957
|
-
function applyMiddleware(argv
|
|
1955
|
+
function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
|
|
1958
1956
|
return middlewares.reduce((acc, middleware) => {
|
|
1959
1957
|
if (middleware.applyBeforeValidation !== beforeValidation) return acc;
|
|
1960
1958
|
if (middleware.mutates) {
|
|
@@ -1966,7 +1964,7 @@ function applyMiddleware(argv$1, yargs, middlewares, beforeValidation) {
|
|
|
1966
1964
|
const result = middleware(acc, yargs);
|
|
1967
1965
|
return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result);
|
|
1968
1966
|
}
|
|
1969
|
-
}, argv
|
|
1967
|
+
}, argv);
|
|
1970
1968
|
}
|
|
1971
1969
|
|
|
1972
1970
|
//#endregion
|
|
@@ -2122,9 +2120,9 @@ var CommandInstance = class {
|
|
|
2122
2120
|
if (isDefaultCommand) innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
|
|
2123
2121
|
if (this.shouldUpdateUsage(innerYargs)) innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
|
|
2124
2122
|
const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly);
|
|
2125
|
-
return isPromise(innerArgv) ? innerArgv.then((argv
|
|
2123
|
+
return isPromise(innerArgv) ? innerArgv.then((argv) => ({
|
|
2126
2124
|
aliases: innerYargs.parsed.aliases,
|
|
2127
|
-
innerArgv: argv
|
|
2125
|
+
innerArgv: argv
|
|
2128
2126
|
})) : {
|
|
2129
2127
|
aliases: innerYargs.parsed.aliases,
|
|
2130
2128
|
innerArgv
|
|
@@ -2179,28 +2177,28 @@ var CommandInstance = class {
|
|
|
2179
2177
|
const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
|
|
2180
2178
|
return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
|
|
2181
2179
|
}
|
|
2182
|
-
populatePositionals(commandHandler, argv
|
|
2183
|
-
argv
|
|
2180
|
+
populatePositionals(commandHandler, argv, context, yargs) {
|
|
2181
|
+
argv._ = argv._.slice(context.commands.length);
|
|
2184
2182
|
const demanded = commandHandler.demanded.slice(0);
|
|
2185
2183
|
const optional = commandHandler.optional.slice(0);
|
|
2186
2184
|
const positionalMap = {};
|
|
2187
|
-
this.validation.positionalCount(demanded.length, argv
|
|
2185
|
+
this.validation.positionalCount(demanded.length, argv._.length);
|
|
2188
2186
|
while (demanded.length) {
|
|
2189
2187
|
const demand = demanded.shift();
|
|
2190
|
-
this.populatePositional(demand, argv
|
|
2188
|
+
this.populatePositional(demand, argv, positionalMap);
|
|
2191
2189
|
}
|
|
2192
2190
|
while (optional.length) {
|
|
2193
2191
|
const maybe = optional.shift();
|
|
2194
|
-
this.populatePositional(maybe, argv
|
|
2192
|
+
this.populatePositional(maybe, argv, positionalMap);
|
|
2195
2193
|
}
|
|
2196
|
-
argv
|
|
2197
|
-
this.postProcessPositionals(argv
|
|
2194
|
+
argv._ = context.commands.concat(argv._.map((a) => "" + a));
|
|
2195
|
+
this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
|
|
2198
2196
|
return positionalMap;
|
|
2199
2197
|
}
|
|
2200
|
-
populatePositional(positional, argv
|
|
2198
|
+
populatePositional(positional, argv, positionalMap) {
|
|
2201
2199
|
const cmd = positional.cmd[0];
|
|
2202
|
-
if (positional.variadic) positionalMap[cmd] = argv
|
|
2203
|
-
else if (argv
|
|
2200
|
+
if (positional.variadic) positionalMap[cmd] = argv._.splice(0).map(String);
|
|
2201
|
+
else if (argv._.length) positionalMap[cmd] = [String(argv._.shift())];
|
|
2204
2202
|
}
|
|
2205
2203
|
cmdToParseOptions(cmdString) {
|
|
2206
2204
|
const parseOptions = {
|
|
@@ -2229,7 +2227,7 @@ var CommandInstance = class {
|
|
|
2229
2227
|
});
|
|
2230
2228
|
return parseOptions;
|
|
2231
2229
|
}
|
|
2232
|
-
postProcessPositionals(argv
|
|
2230
|
+
postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
|
|
2233
2231
|
const options = Object.assign({}, yargs.getOptions());
|
|
2234
2232
|
options.default = Object.assign(parseOptions.default, options.default);
|
|
2235
2233
|
for (const key of Object.keys(parseOptions.alias)) options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
|
|
@@ -2255,8 +2253,8 @@ var CommandInstance = class {
|
|
|
2255
2253
|
Object.keys(parsed.argv).forEach((key) => {
|
|
2256
2254
|
if (positionalKeys.includes(key)) {
|
|
2257
2255
|
if (!positionalMap[key]) positionalMap[key] = parsed.argv[key];
|
|
2258
|
-
if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv
|
|
2259
|
-
else argv
|
|
2256
|
+
if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) argv[key] = [].concat(argv[key], parsed.argv[key]);
|
|
2257
|
+
else argv[key] = parsed.argv[key];
|
|
2260
2258
|
}
|
|
2261
2259
|
});
|
|
2262
2260
|
}
|
|
@@ -2906,7 +2904,7 @@ var Completion = class {
|
|
|
2906
2904
|
this.indexAfterLastReset = 0;
|
|
2907
2905
|
this.zshShell = (_c$1 = ((_a$1 = this.shim.getEnv("SHELL")) === null || _a$1 === void 0 ? void 0 : _a$1.includes("zsh")) || ((_b$1 = this.shim.getEnv("ZSH_NAME")) === null || _b$1 === void 0 ? void 0 : _b$1.includes("zsh"))) !== null && _c$1 !== void 0 ? _c$1 : false;
|
|
2908
2906
|
}
|
|
2909
|
-
defaultCompletion(args, argv
|
|
2907
|
+
defaultCompletion(args, argv, current, done) {
|
|
2910
2908
|
const handlers = this.command.getCommandHandlers();
|
|
2911
2909
|
for (let i = 0, ii = args.length; i < ii; ++i) if (handlers[args[i]] && handlers[args[i]].builder) {
|
|
2912
2910
|
const builder = handlers[args[i]].builder;
|
|
@@ -2919,9 +2917,9 @@ var Completion = class {
|
|
|
2919
2917
|
}
|
|
2920
2918
|
const completions = [];
|
|
2921
2919
|
this.commandCompletions(completions, args, current);
|
|
2922
|
-
this.optionCompletions(completions, args, argv
|
|
2923
|
-
this.choicesFromOptionsCompletions(completions, args, argv
|
|
2924
|
-
this.choicesFromPositionalsCompletions(completions, args, argv
|
|
2920
|
+
this.optionCompletions(completions, args, argv, current);
|
|
2921
|
+
this.choicesFromOptionsCompletions(completions, args, argv, current);
|
|
2922
|
+
this.choicesFromPositionalsCompletions(completions, args, argv, current);
|
|
2925
2923
|
done(null, completions);
|
|
2926
2924
|
}
|
|
2927
2925
|
commandCompletions(completions, args, current) {
|
|
@@ -2935,7 +2933,7 @@ var Completion = class {
|
|
|
2935
2933
|
}
|
|
2936
2934
|
});
|
|
2937
2935
|
}
|
|
2938
|
-
optionCompletions(completions, args, argv
|
|
2936
|
+
optionCompletions(completions, args, argv, current) {
|
|
2939
2937
|
if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) {
|
|
2940
2938
|
const options = this.yargs.getOptions();
|
|
2941
2939
|
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
|
@@ -2945,17 +2943,17 @@ var Completion = class {
|
|
|
2945
2943
|
});
|
|
2946
2944
|
}
|
|
2947
2945
|
}
|
|
2948
|
-
choicesFromOptionsCompletions(completions, args, argv
|
|
2946
|
+
choicesFromOptionsCompletions(completions, args, argv, current) {
|
|
2949
2947
|
if (this.previousArgHasChoices(args)) {
|
|
2950
2948
|
const choices = this.getPreviousArgChoices(args);
|
|
2951
2949
|
if (choices && choices.length > 0) completions.push(...choices.map((c) => c.replace(/:/g, "\\:")));
|
|
2952
2950
|
}
|
|
2953
2951
|
}
|
|
2954
|
-
choicesFromPositionalsCompletions(completions, args, argv
|
|
2952
|
+
choicesFromPositionalsCompletions(completions, args, argv, current) {
|
|
2955
2953
|
if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) return;
|
|
2956
2954
|
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
|
2957
2955
|
const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1);
|
|
2958
|
-
const positionalKey = positionalKeys[argv
|
|
2956
|
+
const positionalKey = positionalKeys[argv._.length - offset - 1];
|
|
2959
2957
|
if (!positionalKey) return;
|
|
2960
2958
|
const choices = this.yargs.getOptions().choices[positionalKey] || [];
|
|
2961
2959
|
for (const choice of choices) if (choice.startsWith(current)) completions.push(choice.replace(/:/g, "\\:"));
|
|
@@ -3011,10 +3009,10 @@ var Completion = class {
|
|
|
3011
3009
|
completions.push(dashes + keyWithDesc);
|
|
3012
3010
|
if (negable) completions.push(dashes + "no-" + keyWithDesc);
|
|
3013
3011
|
}
|
|
3014
|
-
customCompletion(args, argv
|
|
3012
|
+
customCompletion(args, argv, current, done) {
|
|
3015
3013
|
assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
|
|
3016
3014
|
if (isSyncCompletionFunction(this.customCompletionFunction)) {
|
|
3017
|
-
const result = this.customCompletionFunction(current, argv
|
|
3015
|
+
const result = this.customCompletionFunction(current, argv);
|
|
3018
3016
|
if (isPromise(result)) return result.then((list$3) => {
|
|
3019
3017
|
this.shim.process.nextTick(() => {
|
|
3020
3018
|
done(null, list$3);
|
|
@@ -3025,18 +3023,18 @@ var Completion = class {
|
|
|
3025
3023
|
});
|
|
3026
3024
|
});
|
|
3027
3025
|
return done(null, result);
|
|
3028
|
-
} else if (isFallbackCompletionFunction(this.customCompletionFunction)) return this.customCompletionFunction(current, argv
|
|
3026
|
+
} else if (isFallbackCompletionFunction(this.customCompletionFunction)) return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => {
|
|
3029
3027
|
done(null, completions);
|
|
3030
3028
|
});
|
|
3031
|
-
else return this.customCompletionFunction(current, argv
|
|
3029
|
+
else return this.customCompletionFunction(current, argv, (completions) => {
|
|
3032
3030
|
done(null, completions);
|
|
3033
3031
|
});
|
|
3034
3032
|
}
|
|
3035
3033
|
getCompletion(args, done) {
|
|
3036
3034
|
const current = args.length ? args[args.length - 1] : "";
|
|
3037
|
-
const argv
|
|
3038
|
-
const completionFunction = this.customCompletionFunction ? (argv$
|
|
3039
|
-
return isPromise(argv
|
|
3035
|
+
const argv = this.yargs.parse(args, true);
|
|
3036
|
+
const completionFunction = this.customCompletionFunction ? (argv$1) => this.customCompletion(args, argv$1, current, done) : (argv$1) => this.defaultCompletion(args, argv$1, current, done);
|
|
3037
|
+
return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv);
|
|
3040
3038
|
}
|
|
3041
3039
|
generateCompletionScript($0, cmd) {
|
|
3042
3040
|
let script = this.zshShell ? completionZshTemplate : completionShTemplate;
|
|
@@ -3090,9 +3088,9 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3090
3088
|
const __ = shim$2.y18n.__;
|
|
3091
3089
|
const __n = shim$2.y18n.__n;
|
|
3092
3090
|
const self$2 = {};
|
|
3093
|
-
self$2.nonOptionCount = function nonOptionCount(argv
|
|
3091
|
+
self$2.nonOptionCount = function nonOptionCount(argv) {
|
|
3094
3092
|
const demandedCommands = yargs.getDemandedCommands();
|
|
3095
|
-
const _s = argv
|
|
3093
|
+
const _s = argv._.length + (argv["--"] ? argv["--"].length : 0) - yargs.getInternalMethods().getContext().commands.length;
|
|
3096
3094
|
if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) {
|
|
3097
3095
|
if (_s < demandedCommands._.min) if (demandedCommands._.minMsg !== void 0) usage$1.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null);
|
|
3098
3096
|
else usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s, _s.toString(), demandedCommands._.min.toString()));
|
|
@@ -3103,9 +3101,9 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3103
3101
|
self$2.positionalCount = function positionalCount(required, observed) {
|
|
3104
3102
|
if (observed < required) usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + ""));
|
|
3105
3103
|
};
|
|
3106
|
-
self$2.requiredArguments = function requiredArguments(argv
|
|
3104
|
+
self$2.requiredArguments = function requiredArguments(argv, demandedOptions) {
|
|
3107
3105
|
let missing = null;
|
|
3108
|
-
for (const key of Object.keys(demandedOptions)) if (!Object.prototype.hasOwnProperty.call(argv
|
|
3106
|
+
for (const key of Object.keys(demandedOptions)) if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") {
|
|
3109
3107
|
missing = missing || {};
|
|
3110
3108
|
missing[key] = demandedOptions[key];
|
|
3111
3109
|
}
|
|
@@ -3119,32 +3117,32 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3119
3117
|
usage$1.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg));
|
|
3120
3118
|
}
|
|
3121
3119
|
};
|
|
3122
|
-
self$2.unknownArguments = function unknownArguments(argv
|
|
3120
|
+
self$2.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
|
|
3123
3121
|
var _a$1;
|
|
3124
3122
|
const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
|
|
3125
3123
|
const unknown$1 = [];
|
|
3126
3124
|
const currentContext = yargs.getInternalMethods().getContext();
|
|
3127
|
-
Object.keys(argv
|
|
3125
|
+
Object.keys(argv).forEach((key) => {
|
|
3128
3126
|
if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self$2.isValidAndSomeAliasIsNotNew(key, aliases)) unknown$1.push(key);
|
|
3129
3127
|
});
|
|
3130
|
-
if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) argv
|
|
3128
|
+
if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) argv._.slice(currentContext.commands.length).forEach((key) => {
|
|
3131
3129
|
if (!commandKeys.includes("" + key)) unknown$1.push("" + key);
|
|
3132
3130
|
});
|
|
3133
3131
|
if (checkPositionals) {
|
|
3134
3132
|
const maxNonOptDemanded = ((_a$1 = yargs.getDemandedCommands()._) === null || _a$1 === void 0 ? void 0 : _a$1.max) || 0;
|
|
3135
3133
|
const expected = currentContext.commands.length + maxNonOptDemanded;
|
|
3136
|
-
if (expected < argv
|
|
3134
|
+
if (expected < argv._.length) argv._.slice(expected).forEach((key) => {
|
|
3137
3135
|
key = String(key);
|
|
3138
3136
|
if (!currentContext.commands.includes(key) && !unknown$1.includes(key)) unknown$1.push(key);
|
|
3139
3137
|
});
|
|
3140
3138
|
}
|
|
3141
3139
|
if (unknown$1.length) usage$1.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown$1.length, unknown$1.map((s) => s.trim() ? s : `"${s}"`).join(", ")));
|
|
3142
3140
|
};
|
|
3143
|
-
self$2.unknownCommands = function unknownCommands(argv
|
|
3141
|
+
self$2.unknownCommands = function unknownCommands(argv) {
|
|
3144
3142
|
const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
|
|
3145
3143
|
const unknown$1 = [];
|
|
3146
3144
|
const currentContext = yargs.getInternalMethods().getContext();
|
|
3147
|
-
if (currentContext.commands.length > 0 || commandKeys.length > 0) argv
|
|
3145
|
+
if (currentContext.commands.length > 0 || commandKeys.length > 0) argv._.slice(currentContext.commands.length).forEach((key) => {
|
|
3148
3146
|
if (!commandKeys.includes("" + key)) unknown$1.push("" + key);
|
|
3149
3147
|
});
|
|
3150
3148
|
if (unknown$1.length > 0) {
|
|
@@ -3157,12 +3155,12 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3157
3155
|
const newAliases = yargs.parsed.newAliases;
|
|
3158
3156
|
return [key, ...aliases[key]].some((a) => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
|
|
3159
3157
|
};
|
|
3160
|
-
self$2.limitedChoices = function limitedChoices(argv
|
|
3158
|
+
self$2.limitedChoices = function limitedChoices(argv) {
|
|
3161
3159
|
const options = yargs.getOptions();
|
|
3162
3160
|
const invalid$1 = {};
|
|
3163
3161
|
if (!Object.keys(options.choices).length) return;
|
|
3164
|
-
Object.keys(argv
|
|
3165
|
-
if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) [].concat(argv
|
|
3162
|
+
Object.keys(argv).forEach((key) => {
|
|
3163
|
+
if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) [].concat(argv[key]).forEach((value) => {
|
|
3166
3164
|
if (options.choices[key].indexOf(value) === -1 && value !== void 0) invalid$1[key] = (invalid$1[key] || []).concat(value);
|
|
3167
3165
|
});
|
|
3168
3166
|
});
|
|
@@ -3193,25 +3191,25 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3193
3191
|
self$2.getImplied = function getImplied() {
|
|
3194
3192
|
return implied;
|
|
3195
3193
|
};
|
|
3196
|
-
function keyExists(argv
|
|
3194
|
+
function keyExists(argv, val) {
|
|
3197
3195
|
const num = Number(val);
|
|
3198
3196
|
val = isNaN(num) ? val : num;
|
|
3199
|
-
if (typeof val === "number") val = argv
|
|
3197
|
+
if (typeof val === "number") val = argv._.length >= val;
|
|
3200
3198
|
else if (val.match(/^--no-.+/)) {
|
|
3201
3199
|
val = val.match(/^--no-(.+)/)[1];
|
|
3202
|
-
val = !Object.prototype.hasOwnProperty.call(argv
|
|
3203
|
-
} else val = Object.prototype.hasOwnProperty.call(argv
|
|
3200
|
+
val = !Object.prototype.hasOwnProperty.call(argv, val);
|
|
3201
|
+
} else val = Object.prototype.hasOwnProperty.call(argv, val);
|
|
3204
3202
|
return val;
|
|
3205
3203
|
}
|
|
3206
|
-
self$2.implications = function implications(argv
|
|
3204
|
+
self$2.implications = function implications(argv) {
|
|
3207
3205
|
const implyFail = [];
|
|
3208
3206
|
Object.keys(implied).forEach((key) => {
|
|
3209
3207
|
const origKey = key;
|
|
3210
3208
|
(implied[key] || []).forEach((value) => {
|
|
3211
3209
|
let key$1 = origKey;
|
|
3212
3210
|
const origValue = value;
|
|
3213
|
-
key$1 = keyExists(argv
|
|
3214
|
-
value = keyExists(argv
|
|
3211
|
+
key$1 = keyExists(argv, key$1);
|
|
3212
|
+
value = keyExists(argv, value);
|
|
3215
3213
|
if (key$1 && !value) implyFail.push(` ${origKey} -> ${origValue}`);
|
|
3216
3214
|
});
|
|
3217
3215
|
});
|
|
@@ -3237,15 +3235,15 @@ function validation(yargs, usage$1, shim$2) {
|
|
|
3237
3235
|
}
|
|
3238
3236
|
};
|
|
3239
3237
|
self$2.getConflicting = () => conflicting;
|
|
3240
|
-
self$2.conflicting = function conflictingFn(argv
|
|
3241
|
-
Object.keys(argv
|
|
3238
|
+
self$2.conflicting = function conflictingFn(argv) {
|
|
3239
|
+
Object.keys(argv).forEach((key) => {
|
|
3242
3240
|
if (conflicting[key]) conflicting[key].forEach((value) => {
|
|
3243
|
-
if (value && argv
|
|
3241
|
+
if (value && argv[key] !== void 0 && argv[value] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
|
|
3244
3242
|
});
|
|
3245
3243
|
});
|
|
3246
3244
|
if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) Object.keys(conflicting).forEach((key) => {
|
|
3247
3245
|
conflicting[key].forEach((value) => {
|
|
3248
|
-
if (value && argv
|
|
3246
|
+
if (value && argv[shim$2.Parser.camelCase(key)] !== void 0 && argv[shim$2.Parser.camelCase(value)] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
|
|
3249
3247
|
});
|
|
3250
3248
|
});
|
|
3251
3249
|
};
|
|
@@ -3493,16 +3491,16 @@ var YargsInstance = class {
|
|
|
3493
3491
|
}
|
|
3494
3492
|
check(f, global) {
|
|
3495
3493
|
argsert("<function> [boolean]", [f, global], arguments.length);
|
|
3496
|
-
this.middleware((argv
|
|
3494
|
+
this.middleware((argv, _yargs) => {
|
|
3497
3495
|
return maybeAsyncResult(() => {
|
|
3498
|
-
return f(argv
|
|
3496
|
+
return f(argv, _yargs.getOptions());
|
|
3499
3497
|
}, (result) => {
|
|
3500
3498
|
if (!result) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f.toString()));
|
|
3501
3499
|
else if (typeof result === "string" || result instanceof Error) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result);
|
|
3502
|
-
return argv
|
|
3500
|
+
return argv;
|
|
3503
3501
|
}, (err) => {
|
|
3504
3502
|
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
|
|
3505
|
-
return argv
|
|
3503
|
+
return argv;
|
|
3506
3504
|
});
|
|
3507
3505
|
}, false, global);
|
|
3508
3506
|
return this;
|
|
@@ -3524,17 +3522,17 @@ var YargsInstance = class {
|
|
|
3524
3522
|
}
|
|
3525
3523
|
if (!value) throw new YError("coerce callback must be provided");
|
|
3526
3524
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys$1] = true;
|
|
3527
|
-
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv
|
|
3525
|
+
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
|
|
3528
3526
|
let aliases;
|
|
3529
|
-
if (!Object.prototype.hasOwnProperty.call(argv
|
|
3527
|
+
if (!Object.prototype.hasOwnProperty.call(argv, keys$1)) return argv;
|
|
3530
3528
|
return maybeAsyncResult(() => {
|
|
3531
3529
|
aliases = yargs.getAliases();
|
|
3532
|
-
return value(argv
|
|
3530
|
+
return value(argv[keys$1]);
|
|
3533
3531
|
}, (result) => {
|
|
3534
|
-
argv
|
|
3532
|
+
argv[keys$1] = result;
|
|
3535
3533
|
const stripAliased = yargs.getInternalMethods().getParserConfiguration()["strip-aliased"];
|
|
3536
|
-
if (aliases[keys$1] && stripAliased !== true) for (const alias of aliases[keys$1]) argv
|
|
3537
|
-
return argv
|
|
3534
|
+
if (aliases[keys$1] && stripAliased !== true) for (const alias of aliases[keys$1]) argv[alias] = result;
|
|
3535
|
+
return argv;
|
|
3538
3536
|
}, (err) => {
|
|
3539
3537
|
throw new YError(err.message);
|
|
3540
3538
|
});
|
|
@@ -3935,9 +3933,9 @@ var YargsInstance = class {
|
|
|
3935
3933
|
const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
|
|
3936
3934
|
const tmpParsed = this.parsed;
|
|
3937
3935
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed);
|
|
3938
|
-
if (isPromise(parsed)) return parsed.then((argv
|
|
3939
|
-
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv
|
|
3940
|
-
return argv
|
|
3936
|
+
if (isPromise(parsed)) return parsed.then((argv) => {
|
|
3937
|
+
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
|
|
3938
|
+
return argv;
|
|
3941
3939
|
}).catch((err) => {
|
|
3942
3940
|
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
|
|
3943
3941
|
throw err;
|
|
@@ -4173,13 +4171,13 @@ var YargsInstance = class {
|
|
|
4173
4171
|
__classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols);
|
|
4174
4172
|
return this;
|
|
4175
4173
|
}
|
|
4176
|
-
[(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv
|
|
4177
|
-
if (!argv
|
|
4178
|
-
argv
|
|
4174
|
+
[(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) {
|
|
4175
|
+
if (!argv._ || !argv["--"]) return argv;
|
|
4176
|
+
argv._.push.apply(argv._, argv["--"]);
|
|
4179
4177
|
try {
|
|
4180
|
-
delete argv
|
|
4178
|
+
delete argv["--"];
|
|
4181
4179
|
} catch (_err) {}
|
|
4182
|
-
return argv
|
|
4180
|
+
return argv;
|
|
4183
4181
|
}
|
|
4184
4182
|
[kCreateLogger]() {
|
|
4185
4183
|
return {
|
|
@@ -4261,10 +4259,10 @@ var YargsInstance = class {
|
|
|
4261
4259
|
[kGuessVersion]() {
|
|
4262
4260
|
return this[kPkgUp]().version || "unknown";
|
|
4263
4261
|
}
|
|
4264
|
-
[kParsePositionalNumbers](argv
|
|
4265
|
-
const args = argv
|
|
4262
|
+
[kParsePositionalNumbers](argv) {
|
|
4263
|
+
const args = argv["--"] ? argv["--"] : argv._;
|
|
4266
4264
|
for (let i = 0, arg; (arg = args[i]) !== void 0; i++) if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) args[i] = Number(arg);
|
|
4267
|
-
return argv
|
|
4265
|
+
return argv;
|
|
4268
4266
|
}
|
|
4269
4267
|
[kPkgUp](rootPath) {
|
|
4270
4268
|
const npath = rootPath || "*";
|
|
@@ -4351,8 +4349,8 @@ var YargsInstance = class {
|
|
|
4351
4349
|
__classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze();
|
|
4352
4350
|
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze();
|
|
4353
4351
|
}
|
|
4354
|
-
[kValidateAsync](validation$1, argv
|
|
4355
|
-
return maybeAsyncResult(argv
|
|
4352
|
+
[kValidateAsync](validation$1, argv) {
|
|
4353
|
+
return maybeAsyncResult(argv, (result) => {
|
|
4356
4354
|
validation$1(result);
|
|
4357
4355
|
return result;
|
|
4358
4356
|
});
|
|
@@ -4404,13 +4402,13 @@ var YargsInstance = class {
|
|
|
4404
4402
|
[kIsGlobalContext]() {
|
|
4405
4403
|
return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f");
|
|
4406
4404
|
}
|
|
4407
|
-
[kPostProcess](argv
|
|
4408
|
-
if (calledFromCommand) return argv
|
|
4409
|
-
if (isPromise(argv
|
|
4410
|
-
if (!populateDoubleDash) argv
|
|
4411
|
-
if (this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0) argv
|
|
4412
|
-
if (runGlobalMiddleware) argv
|
|
4413
|
-
return argv
|
|
4405
|
+
[kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
|
|
4406
|
+
if (calledFromCommand) return argv;
|
|
4407
|
+
if (isPromise(argv)) return argv;
|
|
4408
|
+
if (!populateDoubleDash) argv = this[kCopyDoubleDash](argv);
|
|
4409
|
+
if (this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0) argv = this[kParsePositionalNumbers](argv);
|
|
4410
|
+
if (runGlobalMiddleware) argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
|
|
4411
|
+
return argv;
|
|
4414
4412
|
}
|
|
4415
4413
|
[kReset](aliases = {}) {
|
|
4416
4414
|
__classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f");
|
|
@@ -4486,36 +4484,36 @@ var YargsInstance = class {
|
|
|
4486
4484
|
"parse-positional-numbers": false,
|
|
4487
4485
|
...config$1
|
|
4488
4486
|
} }));
|
|
4489
|
-
const argv
|
|
4487
|
+
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
4490
4488
|
let argvPromise = void 0;
|
|
4491
4489
|
const aliases = parsed.aliases;
|
|
4492
4490
|
let helpOptSet = false;
|
|
4493
4491
|
let versionOptSet = false;
|
|
4494
|
-
Object.keys(argv
|
|
4495
|
-
if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv
|
|
4496
|
-
else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv
|
|
4492
|
+
Object.keys(argv).forEach((key) => {
|
|
4493
|
+
if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) helpOptSet = true;
|
|
4494
|
+
else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) versionOptSet = true;
|
|
4497
4495
|
});
|
|
4498
|
-
argv
|
|
4496
|
+
argv.$0 = this.$0;
|
|
4499
4497
|
this.parsed = parsed;
|
|
4500
4498
|
if (commandIndex === 0) __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
|
|
4501
4499
|
try {
|
|
4502
4500
|
this[kGuessLocale]();
|
|
4503
|
-
if (shortCircuit) return this[kPostProcess](argv
|
|
4501
|
+
if (shortCircuit) return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
|
|
4504
4502
|
if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
|
|
4505
|
-
if ([__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k) => k.length > 1).includes("" + argv
|
|
4506
|
-
argv
|
|
4503
|
+
if ([__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k) => k.length > 1).includes("" + argv._[argv._.length - 1])) {
|
|
4504
|
+
argv._.pop();
|
|
4507
4505
|
helpOptSet = true;
|
|
4508
4506
|
}
|
|
4509
4507
|
}
|
|
4510
4508
|
__classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f");
|
|
4511
4509
|
const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands();
|
|
4512
|
-
const requestCompletions = __classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey in argv
|
|
4510
|
+
const requestCompletions = __classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey in argv;
|
|
4513
4511
|
const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
|
|
4514
|
-
if (argv
|
|
4512
|
+
if (argv._.length) {
|
|
4515
4513
|
if (handlerKeys.length) {
|
|
4516
4514
|
let firstUnknownCommand;
|
|
4517
|
-
for (let i = commandIndex || 0, cmd; argv
|
|
4518
|
-
cmd = String(argv
|
|
4515
|
+
for (let i = commandIndex || 0, cmd; argv._[i] !== void 0; i++) {
|
|
4516
|
+
cmd = String(argv._[i]);
|
|
4519
4517
|
if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
|
|
4520
4518
|
const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
|
|
4521
4519
|
return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
|
|
@@ -4526,7 +4524,7 @@ var YargsInstance = class {
|
|
|
4526
4524
|
}
|
|
4527
4525
|
if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
|
|
4528
4526
|
}
|
|
4529
|
-
if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv
|
|
4527
|
+
if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) {
|
|
4530
4528
|
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
|
|
4531
4529
|
this.showCompletionScript();
|
|
4532
4530
|
this.exit(0);
|
|
@@ -4547,7 +4545,7 @@ var YargsInstance = class {
|
|
|
4547
4545
|
});
|
|
4548
4546
|
this.exit(0);
|
|
4549
4547
|
});
|
|
4550
|
-
return this[kPostProcess](argv
|
|
4548
|
+
return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
|
|
4551
4549
|
}
|
|
4552
4550
|
if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) {
|
|
4553
4551
|
if (helpOptSet) {
|
|
@@ -4562,15 +4560,15 @@ var YargsInstance = class {
|
|
|
4562
4560
|
this.exit(0);
|
|
4563
4561
|
}
|
|
4564
4562
|
}
|
|
4565
|
-
if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) skipValidation = Object.keys(argv
|
|
4563
|
+
if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
|
|
4566
4564
|
if (!skipValidation) {
|
|
4567
4565
|
if (parsed.error) throw new YError(parsed.error.message);
|
|
4568
4566
|
if (!requestCompletions) {
|
|
4569
4567
|
const validation$1 = this[kRunValidation](aliases, {}, parsed.error);
|
|
4570
|
-
if (!calledFromCommand) argvPromise = applyMiddleware(argv
|
|
4571
|
-
argvPromise = this[kValidateAsync](validation$1, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv
|
|
4568
|
+
if (!calledFromCommand) argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
|
|
4569
|
+
argvPromise = this[kValidateAsync](validation$1, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
|
|
4572
4570
|
if (isPromise(argvPromise) && !calledFromCommand) argvPromise = argvPromise.then(() => {
|
|
4573
|
-
return applyMiddleware(argv
|
|
4571
|
+
return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
|
|
4574
4572
|
});
|
|
4575
4573
|
}
|
|
4576
4574
|
}
|
|
@@ -4578,21 +4576,21 @@ var YargsInstance = class {
|
|
|
4578
4576
|
if (err instanceof YError) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err);
|
|
4579
4577
|
else throw err;
|
|
4580
4578
|
}
|
|
4581
|
-
return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv
|
|
4579
|
+
return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
|
|
4582
4580
|
}
|
|
4583
4581
|
[kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
|
|
4584
4582
|
const demandedOptions = { ...this.getDemandedOptions() };
|
|
4585
|
-
return (argv
|
|
4583
|
+
return (argv) => {
|
|
4586
4584
|
if (parseErrors) throw new YError(parseErrors.message);
|
|
4587
|
-
__classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv
|
|
4588
|
-
__classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv
|
|
4585
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv);
|
|
4586
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
|
|
4589
4587
|
let failedStrictCommands = false;
|
|
4590
|
-
if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv
|
|
4591
|
-
if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv
|
|
4592
|
-
else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv
|
|
4593
|
-
__classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv
|
|
4594
|
-
__classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv
|
|
4595
|
-
__classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv
|
|
4588
|
+
if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv);
|
|
4589
|
+
if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
|
|
4590
|
+
else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false);
|
|
4591
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv);
|
|
4592
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv);
|
|
4593
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv);
|
|
4596
4594
|
};
|
|
4597
4595
|
}
|
|
4598
4596
|
[kSetHasOutput]() {
|
|
@@ -4614,7 +4612,7 @@ var yargs_default = Yargs;
|
|
|
4614
4612
|
|
|
4615
4613
|
//#endregion
|
|
4616
4614
|
//#region package.json
|
|
4617
|
-
var version = "1.3.
|
|
4615
|
+
var version = "1.3.4";
|
|
4618
4616
|
|
|
4619
4617
|
//#endregion
|
|
4620
4618
|
//#region node_modules/.pnpm/irregular-plurals@4.2.0/node_modules/irregular-plurals/irregular-plurals.json
|
|
@@ -8847,8 +8845,8 @@ async function loadConfig(options) {
|
|
|
8847
8845
|
}
|
|
8848
8846
|
}
|
|
8849
8847
|
if (finalConfig.rules) {
|
|
8850
|
-
const prettyRules = Object.keys(finalConfig.rules).toSorted().map((rule) => `"${import_picocolors
|
|
8851
|
-
log.info(`Loaded ${import_picocolors
|
|
8848
|
+
const prettyRules = Object.keys(finalConfig.rules).toSorted().map((rule) => `"${import_picocolors.default.green(import_picocolors.default.bold(rule))}"`);
|
|
8849
|
+
log.info(`Loaded ${import_picocolors.default.bold(prettyRules.length)} mdat comment expansion ${plur("rule", prettyRules.length)}:`);
|
|
8852
8850
|
for (const rule of prettyRules) log.info(`\t${rule}`);
|
|
8853
8851
|
} else log.error("No rules loaded from additional configurations or rules, using default.");
|
|
8854
8852
|
config = finalConfig;
|
|
@@ -11107,7 +11105,7 @@ const characterEntities = {
|
|
|
11107
11105
|
};
|
|
11108
11106
|
|
|
11109
11107
|
//#endregion
|
|
11110
|
-
//#region node_modules/.pnpm/decode-named-character-reference@1.
|
|
11108
|
+
//#region node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.js
|
|
11111
11109
|
const own$5 = {}.hasOwnProperty;
|
|
11112
11110
|
/**
|
|
11113
11111
|
* Decode a single character reference (without the `&` or `;`).
|
|
@@ -11615,7 +11613,7 @@ function factorySpace(effects, ok$2, type, max) {
|
|
|
11615
11613
|
* } from 'micromark-util-types'
|
|
11616
11614
|
*/
|
|
11617
11615
|
/** @type {InitialConstruct} */
|
|
11618
|
-
const content = { tokenize: initializeContent };
|
|
11616
|
+
const content$1 = { tokenize: initializeContent };
|
|
11619
11617
|
/**
|
|
11620
11618
|
* @this {TokenizeContext}
|
|
11621
11619
|
* Context.
|
|
@@ -11691,7 +11689,7 @@ function initializeContent(effects) {
|
|
|
11691
11689
|
* Construct and its state.
|
|
11692
11690
|
*/
|
|
11693
11691
|
/** @type {InitialConstruct} */
|
|
11694
|
-
const document = { tokenize: initializeDocument };
|
|
11692
|
+
const document$1 = { tokenize: initializeDocument };
|
|
11695
11693
|
/** @type {Construct} */
|
|
11696
11694
|
const containerConstruct = { tokenize: tokenizeContainer };
|
|
11697
11695
|
/**
|
|
@@ -13912,7 +13910,7 @@ function subcontent(events, eventIndex) {
|
|
|
13912
13910
|
* No name because it must not be turned off.
|
|
13913
13911
|
* @type {Construct}
|
|
13914
13912
|
*/
|
|
13915
|
-
const content
|
|
13913
|
+
const content = {
|
|
13916
13914
|
resolve: resolveContent,
|
|
13917
13915
|
tokenize: tokenizeContent
|
|
13918
13916
|
};
|
|
@@ -17562,7 +17560,7 @@ function tokenizeSetextUnderline(effects, ok$2, nok) {
|
|
|
17562
17560
|
* } from 'micromark-util-types'
|
|
17563
17561
|
*/
|
|
17564
17562
|
/** @type {InitialConstruct} */
|
|
17565
|
-
const flow = { tokenize: initializeFlow };
|
|
17563
|
+
const flow$1 = { tokenize: initializeFlow };
|
|
17566
17564
|
/**
|
|
17567
17565
|
* @this {TokenizeContext}
|
|
17568
17566
|
* Self.
|
|
@@ -17571,7 +17569,7 @@ const flow = { tokenize: initializeFlow };
|
|
|
17571
17569
|
*/
|
|
17572
17570
|
function initializeFlow(effects) {
|
|
17573
17571
|
const self$2 = this;
|
|
17574
|
-
const initial = effects.attempt(blankLine, atBlankEnding, effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content
|
|
17572
|
+
const initial = effects.attempt(blankLine, atBlankEnding, effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), "linePrefix")));
|
|
17575
17573
|
return initial;
|
|
17576
17574
|
/** @type {State} */
|
|
17577
17575
|
function atBlankEnding(code$2) {
|
|
@@ -17612,8 +17610,8 @@ function initializeFlow(effects) {
|
|
|
17612
17610
|
* } from 'micromark-util-types'
|
|
17613
17611
|
*/
|
|
17614
17612
|
const resolver = { resolveAll: createResolver() };
|
|
17615
|
-
const string = initializeFactory("string");
|
|
17616
|
-
const text$
|
|
17613
|
+
const string$1 = initializeFactory("string");
|
|
17614
|
+
const text$3 = initializeFactory("text");
|
|
17617
17615
|
/**
|
|
17618
17616
|
* @param {'string' | 'text'} field
|
|
17619
17617
|
* Field.
|
|
@@ -17782,19 +17780,19 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
17782
17780
|
/**
|
|
17783
17781
|
* @import {Extension} from 'micromark-util-types'
|
|
17784
17782
|
*/
|
|
17785
|
-
var constructs_exports = /* @__PURE__ */
|
|
17783
|
+
var constructs_exports = /* @__PURE__ */ __exportAll({
|
|
17786
17784
|
attentionMarkers: () => attentionMarkers,
|
|
17787
17785
|
contentInitial: () => contentInitial,
|
|
17788
17786
|
disable: () => disable,
|
|
17789
|
-
document: () => document
|
|
17790
|
-
flow: () => flow
|
|
17787
|
+
document: () => document,
|
|
17788
|
+
flow: () => flow,
|
|
17791
17789
|
flowInitial: () => flowInitial,
|
|
17792
17790
|
insideSpan: () => insideSpan,
|
|
17793
|
-
string: () => string
|
|
17794
|
-
text: () => text$
|
|
17791
|
+
string: () => string,
|
|
17792
|
+
text: () => text$2
|
|
17795
17793
|
});
|
|
17796
17794
|
/** @satisfies {Extension['document']} */
|
|
17797
|
-
const document
|
|
17795
|
+
const document = {
|
|
17798
17796
|
[42]: list$2,
|
|
17799
17797
|
[43]: list$2,
|
|
17800
17798
|
[45]: list$2,
|
|
@@ -17819,7 +17817,7 @@ const flowInitial = {
|
|
|
17819
17817
|
[32]: codeIndented
|
|
17820
17818
|
};
|
|
17821
17819
|
/** @satisfies {Extension['flow']} */
|
|
17822
|
-
const flow
|
|
17820
|
+
const flow = {
|
|
17823
17821
|
[35]: headingAtx,
|
|
17824
17822
|
[42]: thematicBreak$1,
|
|
17825
17823
|
[45]: [setextUnderline, thematicBreak$1],
|
|
@@ -17830,12 +17828,12 @@ const flow$1 = {
|
|
|
17830
17828
|
[126]: codeFenced
|
|
17831
17829
|
};
|
|
17832
17830
|
/** @satisfies {Extension['string']} */
|
|
17833
|
-
const string
|
|
17831
|
+
const string = {
|
|
17834
17832
|
[38]: characterReference,
|
|
17835
17833
|
[92]: characterEscape
|
|
17836
17834
|
};
|
|
17837
17835
|
/** @satisfies {Extension['text']} */
|
|
17838
|
-
const text$
|
|
17836
|
+
const text$2 = {
|
|
17839
17837
|
[-5]: lineEnding,
|
|
17840
17838
|
[-4]: lineEnding,
|
|
17841
17839
|
[-3]: lineEnding,
|
|
@@ -18347,13 +18345,13 @@ function parse(options) {
|
|
|
18347
18345
|
/** @type {ParseContext} */
|
|
18348
18346
|
const parser$1 = {
|
|
18349
18347
|
constructs: combineExtensions([constructs_exports, ...(options || {}).extensions || []]),
|
|
18350
|
-
content: create(content),
|
|
18348
|
+
content: create(content$1),
|
|
18351
18349
|
defined: [],
|
|
18352
|
-
document: create(document),
|
|
18353
|
-
flow: create(flow),
|
|
18350
|
+
document: create(document$1),
|
|
18351
|
+
flow: create(flow$1),
|
|
18354
18352
|
lazy: {},
|
|
18355
|
-
string: create(string),
|
|
18356
|
-
text: create(text$
|
|
18353
|
+
string: create(string$1),
|
|
18354
|
+
text: create(text$3)
|
|
18357
18355
|
};
|
|
18358
18356
|
return parser$1;
|
|
18359
18357
|
/**
|
|
@@ -22499,16 +22497,16 @@ function bail(error) {
|
|
|
22499
22497
|
|
|
22500
22498
|
//#endregion
|
|
22501
22499
|
//#region node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js
|
|
22502
|
-
var require_extend = /* @__PURE__ */
|
|
22500
|
+
var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
22503
22501
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
22504
22502
|
var toStr = Object.prototype.toString;
|
|
22505
22503
|
var defineProperty = Object.defineProperty;
|
|
22506
22504
|
var gOPD = Object.getOwnPropertyDescriptor;
|
|
22507
|
-
var isArray = function isArray
|
|
22505
|
+
var isArray = function isArray(arr) {
|
|
22508
22506
|
if (typeof Array.isArray === "function") return Array.isArray(arr);
|
|
22509
22507
|
return toStr.call(arr) === "[object Array]";
|
|
22510
22508
|
};
|
|
22511
|
-
var isPlainObject
|
|
22509
|
+
var isPlainObject = function isPlainObject$1(obj) {
|
|
22512
22510
|
if (!obj || toStr.call(obj) !== "[object Object]") return false;
|
|
22513
22511
|
var hasOwnConstructor = hasOwn.call(obj, "constructor");
|
|
22514
22512
|
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
|
|
@@ -22517,7 +22515,7 @@ var require_extend = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/extend@3.0
|
|
|
22517
22515
|
for (key in obj);
|
|
22518
22516
|
return typeof key === "undefined" || hasOwn.call(obj, key);
|
|
22519
22517
|
};
|
|
22520
|
-
var setProperty = function setProperty
|
|
22518
|
+
var setProperty = function setProperty(target, options) {
|
|
22521
22519
|
if (defineProperty && options.name === "__proto__") defineProperty(target, options.name, {
|
|
22522
22520
|
enumerable: true,
|
|
22523
22521
|
configurable: true,
|
|
@@ -22526,7 +22524,7 @@ var require_extend = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/extend@3.0
|
|
|
22526
22524
|
});
|
|
22527
22525
|
else target[options.name] = options.newValue;
|
|
22528
22526
|
};
|
|
22529
|
-
var getProperty = function getProperty
|
|
22527
|
+
var getProperty = function getProperty(obj, name) {
|
|
22530
22528
|
if (name === "__proto__") {
|
|
22531
22529
|
if (!hasOwn.call(obj, name)) return;
|
|
22532
22530
|
else if (gOPD) return gOPD(obj, name).value;
|
|
@@ -22551,11 +22549,11 @@ var require_extend = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/extend@3.0
|
|
|
22551
22549
|
src = getProperty(target, name);
|
|
22552
22550
|
copy = getProperty(options, name);
|
|
22553
22551
|
if (target !== copy) {
|
|
22554
|
-
if (deep && copy && (isPlainObject
|
|
22552
|
+
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
|
|
22555
22553
|
if (copyIsArray) {
|
|
22556
22554
|
copyIsArray = false;
|
|
22557
22555
|
clone = src && isArray(src) ? src : [];
|
|
22558
|
-
} else clone = src && isPlainObject
|
|
22556
|
+
} else clone = src && isPlainObject(src) ? src : {};
|
|
22559
22557
|
setProperty(target, {
|
|
22560
22558
|
name,
|
|
22561
22559
|
newValue: extend$1(deep, clone, copy)
|
|
@@ -22569,7 +22567,7 @@ var require_extend = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/extend@3.0
|
|
|
22569
22567
|
}
|
|
22570
22568
|
return target;
|
|
22571
22569
|
};
|
|
22572
|
-
})
|
|
22570
|
+
}));
|
|
22573
22571
|
|
|
22574
22572
|
//#endregion
|
|
22575
22573
|
//#region node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.js
|
|
@@ -29095,7 +29093,6 @@ var templates_default = {
|
|
|
29095
29093
|
|
|
29096
29094
|
//#endregion
|
|
29097
29095
|
//#region src/lib/readme/init.ts
|
|
29098
|
-
var import_picocolors$1 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
29099
29096
|
async function getPaths() {
|
|
29100
29097
|
const readmePath = await findReadme();
|
|
29101
29098
|
const packagePath = await findPackage();
|
|
@@ -29111,10 +29108,10 @@ async function getPaths() {
|
|
|
29111
29108
|
async function initReadmeInteractive() {
|
|
29112
29109
|
const { packageDirectory: packageDirectory$1, readmePath } = await getPaths();
|
|
29113
29110
|
const destination = path.resolve(process.cwd());
|
|
29114
|
-
intro(`Running ${import_picocolors
|
|
29111
|
+
intro(`Running ${import_picocolors.default.bold("mdat readme init")} interactively`);
|
|
29115
29112
|
const newReadmePath = await initReadme(await group({
|
|
29116
29113
|
overwrite: async () => readmePath === void 0 ? true : await confirm({
|
|
29117
|
-
message: `Found an existing readme at "${import_picocolors
|
|
29114
|
+
message: `Found an existing readme at "${import_picocolors.default.blue(readmePath)}". Do you want to overwrite it?`,
|
|
29118
29115
|
active: "Overwrite",
|
|
29119
29116
|
inactive: "Exit"
|
|
29120
29117
|
}) ? true : (() => {
|
|
@@ -29124,10 +29121,10 @@ async function initReadmeInteractive() {
|
|
|
29124
29121
|
initialValue: packageDirectory$1,
|
|
29125
29122
|
message: "There's a root package directory nearby, do you want to create the readme there instead of the current directory?",
|
|
29126
29123
|
options: [{
|
|
29127
|
-
label: `Create in the current package root: "${import_picocolors
|
|
29124
|
+
label: `Create in the current package root: "${import_picocolors.default.blue(packageDirectory$1)}"`,
|
|
29128
29125
|
value: packageDirectory$1
|
|
29129
29126
|
}, {
|
|
29130
|
-
label: `Create in current working directory: "${import_picocolors
|
|
29127
|
+
label: `Create in current working directory: "${import_picocolors.default.blue(destination)}"`,
|
|
29131
29128
|
value: destination
|
|
29132
29129
|
}]
|
|
29133
29130
|
}) : destination,
|
|
@@ -29138,7 +29135,7 @@ async function initReadmeInteractive() {
|
|
|
29138
29135
|
compound: async () => select({
|
|
29139
29136
|
message: "Do you want to use \"compound comments\" where possible, which combine several expansions into a single comment block?",
|
|
29140
29137
|
options: [{
|
|
29141
|
-
label: `Yes: Combine things like ${import_picocolors
|
|
29138
|
+
label: `Yes: Combine things like ${import_picocolors.default.green("<!-- title -->")} and ${import_picocolors.default.green("<!-- badges -->")} in a single ${import_picocolors.default.green("<!-- header -->")} comment.`,
|
|
29142
29139
|
value: true
|
|
29143
29140
|
}, {
|
|
29144
29141
|
label: "No: Use individual MDAT expansion comments for each section.",
|
|
@@ -29153,7 +29150,7 @@ async function initReadmeInteractive() {
|
|
|
29153
29150
|
throw new Error("`mdat readme init` was cancelled - no changes were made");
|
|
29154
29151
|
} }));
|
|
29155
29152
|
if (packageDirectory$1 === void 0) note("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json.");
|
|
29156
|
-
note(`Readme created: "${import_picocolors
|
|
29153
|
+
note(`Readme created: "${import_picocolors.default.blue(import_picocolors.default.bold(newReadmePath))}"`);
|
|
29157
29154
|
outro("Done!");
|
|
29158
29155
|
return newReadmePath;
|
|
29159
29156
|
}
|
|
@@ -29299,7 +29296,6 @@ const filesPositionalOptional = ["files", {
|
|
|
29299
29296
|
|
|
29300
29297
|
//#endregion
|
|
29301
29298
|
//#region src/cli/cli.ts
|
|
29302
|
-
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
29303
29299
|
const startTime = performance.now();
|
|
29304
29300
|
const yargsInstance = yargs_default(hideBin(process.argv));
|
|
29305
29301
|
try {
|