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