@fern-api/generator-cli 0.1.5 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +952 -963
  2. package/package.json +10 -8
package/dist/cli.cjs CHANGED
@@ -30,115 +30,519 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs
34
- var require_build = __commonJS({
35
- "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"(exports2, module2) {
33
+ // ../../node_modules/.pnpm/tmp@0.2.5/node_modules/tmp/lib/tmp.js
34
+ var require_tmp = __commonJS({
35
+ "../../node_modules/.pnpm/tmp@0.2.5/node_modules/tmp/lib/tmp.js"(exports2, module2) {
36
36
  "use strict";
37
37
  var fs3 = require("fs");
38
- var util = require("util");
38
+ var os = require("os");
39
39
  var path4 = require("path");
40
- var shim2;
41
- var Y18N2 = class {
42
- constructor(opts) {
43
- opts = opts || {};
44
- this.directory = opts.directory || "./locales";
45
- this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
46
- this.locale = opts.locale || "en";
47
- this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
48
- this.cache = /* @__PURE__ */ Object.create(null);
49
- this.writeQueue = [];
50
- }
51
- __(...args) {
52
- if (typeof arguments[0] !== "string") {
53
- return this._taggedLiteral(arguments[0], ...arguments);
54
- }
55
- const str = args.shift();
56
- let cb = function() {
57
- };
58
- if (typeof args[args.length - 1] === "function")
59
- cb = args.pop();
60
- cb = cb || function() {
61
- };
62
- if (!this.cache[this.locale])
63
- this._readLocaleFile();
64
- if (!this.cache[this.locale][str] && this.updateFiles) {
65
- this.cache[this.locale][str] = str;
66
- this._enqueueWrite({
67
- directory: this.directory,
68
- locale: this.locale,
69
- cb
70
- });
71
- } else {
72
- cb();
40
+ var crypto = require("crypto");
41
+ var _c2 = { fs: fs3.constants, os: os.constants };
42
+ var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
43
+ var TEMPLATE_PATTERN = /XXXXXX/;
44
+ var DEFAULT_TRIES = 3;
45
+ var CREATE_FLAGS = (_c2.O_CREAT || _c2.fs.O_CREAT) | (_c2.O_EXCL || _c2.fs.O_EXCL) | (_c2.O_RDWR || _c2.fs.O_RDWR);
46
+ var IS_WIN32 = os.platform() === "win32";
47
+ var EBADF = _c2.EBADF || _c2.os.errno.EBADF;
48
+ var ENOENT = _c2.ENOENT || _c2.os.errno.ENOENT;
49
+ var DIR_MODE = 448;
50
+ var FILE_MODE = 384;
51
+ var EXIT = "exit";
52
+ var _removeObjects = [];
53
+ var FN_RMDIR_SYNC = fs3.rmdirSync.bind(fs3);
54
+ var _gracefulCleanup = false;
55
+ function rimraf(dirPath, callback) {
56
+ return fs3.rm(dirPath, { recursive: true }, callback);
57
+ }
58
+ function FN_RIMRAF_SYNC(dirPath) {
59
+ return fs3.rmSync(dirPath, { recursive: true });
60
+ }
61
+ function tmpName(options, callback) {
62
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
63
+ _assertAndSanitizeOptions(opts, function(err, sanitizedOptions) {
64
+ if (err) return cb(err);
65
+ let tries = sanitizedOptions.tries;
66
+ (function _getUniqueName() {
67
+ try {
68
+ const name = _generateTmpName(sanitizedOptions);
69
+ fs3.stat(name, function(err2) {
70
+ if (!err2) {
71
+ if (tries-- > 0) return _getUniqueName();
72
+ return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
73
+ }
74
+ cb(null, name);
75
+ });
76
+ } catch (err2) {
77
+ cb(err2);
78
+ }
79
+ })();
80
+ });
81
+ }
82
+ function tmpNameSync(options) {
83
+ const args = _parseArguments(options), opts = args[0];
84
+ const sanitizedOptions = _assertAndSanitizeOptionsSync(opts);
85
+ let tries = sanitizedOptions.tries;
86
+ do {
87
+ const name = _generateTmpName(sanitizedOptions);
88
+ try {
89
+ fs3.statSync(name);
90
+ } catch (e) {
91
+ return name;
73
92
  }
74
- return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args));
93
+ } while (tries-- > 0);
94
+ throw new Error("Could not get a unique tmp filename, max tries reached");
95
+ }
96
+ function file(options, callback) {
97
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
98
+ tmpName(opts, function _tmpNameCreated(err, name) {
99
+ if (err) return cb(err);
100
+ fs3.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
101
+ if (err2) return cb(err2);
102
+ if (opts.discardDescriptor) {
103
+ return fs3.close(fd, function _discardCallback(possibleErr) {
104
+ return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false));
105
+ });
106
+ } else {
107
+ const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
108
+ cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));
109
+ }
110
+ });
111
+ });
112
+ }
113
+ function fileSync(options) {
114
+ const args = _parseArguments(options), opts = args[0];
115
+ const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
116
+ const name = tmpNameSync(opts);
117
+ let fd = fs3.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
118
+ if (opts.discardDescriptor) {
119
+ fs3.closeSync(fd);
120
+ fd = void 0;
75
121
  }
76
- __n() {
77
- const args = Array.prototype.slice.call(arguments);
78
- const singular = args.shift();
79
- const plural = args.shift();
80
- const quantity = args.shift();
81
- let cb = function() {
82
- };
83
- if (typeof args[args.length - 1] === "function")
84
- cb = args.pop();
85
- if (!this.cache[this.locale])
86
- this._readLocaleFile();
87
- let str = quantity === 1 ? singular : plural;
88
- if (this.cache[this.locale][singular]) {
89
- const entry = this.cache[this.locale][singular];
90
- str = entry[quantity === 1 ? "one" : "other"];
122
+ return {
123
+ name,
124
+ fd,
125
+ removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true)
126
+ };
127
+ }
128
+ function dir(options, callback) {
129
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
130
+ tmpName(opts, function _tmpNameCreated(err, name) {
131
+ if (err) return cb(err);
132
+ fs3.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) {
133
+ if (err2) return cb(err2);
134
+ cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false));
135
+ });
136
+ });
137
+ }
138
+ function dirSync(options) {
139
+ const args = _parseArguments(options), opts = args[0];
140
+ const name = tmpNameSync(opts);
141
+ fs3.mkdirSync(name, opts.mode || DIR_MODE);
142
+ return {
143
+ name,
144
+ removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)
145
+ };
146
+ }
147
+ function _removeFileAsync(fdPath, next) {
148
+ const _handler = function(err) {
149
+ if (err && !_isENOENT(err)) {
150
+ return next(err);
91
151
  }
92
- if (!this.cache[this.locale][singular] && this.updateFiles) {
93
- this.cache[this.locale][singular] = {
94
- one: singular,
95
- other: plural
96
- };
97
- this._enqueueWrite({
98
- directory: this.directory,
99
- locale: this.locale,
100
- cb
101
- });
102
- } else {
103
- cb();
152
+ next();
153
+ };
154
+ if (0 <= fdPath[0])
155
+ fs3.close(fdPath[0], function() {
156
+ fs3.unlink(fdPath[1], _handler);
157
+ });
158
+ else fs3.unlink(fdPath[1], _handler);
159
+ }
160
+ function _removeFileSync(fdPath) {
161
+ let rethrownException = null;
162
+ try {
163
+ if (0 <= fdPath[0]) fs3.closeSync(fdPath[0]);
164
+ } catch (e) {
165
+ if (!_isEBADF(e) && !_isENOENT(e)) throw e;
166
+ } finally {
167
+ try {
168
+ fs3.unlinkSync(fdPath[1]);
169
+ } catch (e) {
170
+ if (!_isENOENT(e)) rethrownException = e;
104
171
  }
105
- const values = [str];
106
- if (~str.indexOf("%d"))
107
- values.push(quantity);
108
- return shim2.format.apply(shim2.format, values.concat(args));
109
- }
110
- setLocale(locale) {
111
- this.locale = locale;
112
172
  }
113
- getLocale() {
114
- return this.locale;
173
+ if (rethrownException !== null) {
174
+ throw rethrownException;
115
175
  }
116
- updateLocale(obj) {
117
- if (!this.cache[this.locale])
118
- this._readLocaleFile();
119
- for (const key in obj) {
120
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
121
- this.cache[this.locale][key] = obj[key];
176
+ }
177
+ function _prepareTmpFileRemoveCallback(name, fd, opts, sync) {
178
+ const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);
179
+ const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);
180
+ if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
181
+ return sync ? removeCallbackSync : removeCallback;
182
+ }
183
+ function _prepareTmpDirRemoveCallback(name, opts, sync) {
184
+ const removeFunction = opts.unsafeCleanup ? rimraf : fs3.rmdir.bind(fs3);
185
+ const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
186
+ const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);
187
+ const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);
188
+ if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
189
+ return sync ? removeCallbackSync : removeCallback;
190
+ }
191
+ function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
192
+ let called = false;
193
+ return function _cleanupCallback(next) {
194
+ if (!called) {
195
+ const toRemove = cleanupCallbackSync || _cleanupCallback;
196
+ const index = _removeObjects.indexOf(toRemove);
197
+ if (index >= 0) _removeObjects.splice(index, 1);
198
+ called = true;
199
+ if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
200
+ return removeFunction(fileOrDirName);
201
+ } else {
202
+ return removeFunction(fileOrDirName, next || function() {
203
+ });
122
204
  }
123
205
  }
206
+ };
207
+ }
208
+ function _garbageCollector() {
209
+ if (!_gracefulCleanup) return;
210
+ while (_removeObjects.length) {
211
+ try {
212
+ _removeObjects[0]();
213
+ } catch (e) {
214
+ }
124
215
  }
125
- _taggedLiteral(parts, ...args) {
126
- let str = "";
127
- parts.forEach(function(part, i) {
128
- const arg = args[i + 1];
129
- str += part;
130
- if (typeof arg !== "undefined") {
131
- str += "%s";
132
- }
133
- });
134
- return this.__.apply(this, [str].concat([].slice.call(args, 1)));
216
+ }
217
+ function _randomChars(howMany) {
218
+ let value = [], rnd = null;
219
+ try {
220
+ rnd = crypto.randomBytes(howMany);
221
+ } catch (e) {
222
+ rnd = crypto.pseudoRandomBytes(howMany);
135
223
  }
136
- _enqueueWrite(work) {
137
- this.writeQueue.push(work);
138
- if (this.writeQueue.length === 1)
139
- this._processWriteQueue();
224
+ for (let i = 0; i < howMany; i++) {
225
+ value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
140
226
  }
141
- _processWriteQueue() {
227
+ return value.join("");
228
+ }
229
+ function _isUndefined(obj) {
230
+ return typeof obj === "undefined";
231
+ }
232
+ function _parseArguments(options, callback) {
233
+ if (typeof options === "function") {
234
+ return [{}, options];
235
+ }
236
+ if (_isUndefined(options)) {
237
+ return [{}, callback];
238
+ }
239
+ const actualOptions = {};
240
+ for (const key of Object.getOwnPropertyNames(options)) {
241
+ actualOptions[key] = options[key];
242
+ }
243
+ return [actualOptions, callback];
244
+ }
245
+ function _resolvePath(name, tmpDir, cb) {
246
+ const pathToResolve = path4.isAbsolute(name) ? name : path4.join(tmpDir, name);
247
+ fs3.stat(pathToResolve, function(err) {
248
+ if (err) {
249
+ fs3.realpath(path4.dirname(pathToResolve), function(err2, parentDir) {
250
+ if (err2) return cb(err2);
251
+ cb(null, path4.join(parentDir, path4.basename(pathToResolve)));
252
+ });
253
+ } else {
254
+ fs3.realpath(pathToResolve, cb);
255
+ }
256
+ });
257
+ }
258
+ function _resolvePathSync(name, tmpDir) {
259
+ const pathToResolve = path4.isAbsolute(name) ? name : path4.join(tmpDir, name);
260
+ try {
261
+ fs3.statSync(pathToResolve);
262
+ return fs3.realpathSync(pathToResolve);
263
+ } catch (_err) {
264
+ const parentDir = fs3.realpathSync(path4.dirname(pathToResolve));
265
+ return path4.join(parentDir, path4.basename(pathToResolve));
266
+ }
267
+ }
268
+ function _generateTmpName(opts) {
269
+ const tmpDir = opts.tmpdir;
270
+ if (!_isUndefined(opts.name)) {
271
+ return path4.join(tmpDir, opts.dir, opts.name);
272
+ }
273
+ if (!_isUndefined(opts.template)) {
274
+ return path4.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
275
+ }
276
+ const name = [
277
+ opts.prefix ? opts.prefix : "tmp",
278
+ "-",
279
+ process.pid,
280
+ "-",
281
+ _randomChars(12),
282
+ opts.postfix ? "-" + opts.postfix : ""
283
+ ].join("");
284
+ return path4.join(tmpDir, opts.dir, name);
285
+ }
286
+ function _assertOptionsBase(options) {
287
+ if (!_isUndefined(options.name)) {
288
+ const name = options.name;
289
+ if (path4.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`);
290
+ const basename2 = path4.basename(name);
291
+ if (basename2 === ".." || basename2 === "." || basename2 !== name)
292
+ throw new Error(`name option must not contain a path, found "${name}".`);
293
+ }
294
+ if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) {
295
+ throw new Error(`Invalid template, found "${options.template}".`);
296
+ }
297
+ if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) {
298
+ throw new Error(`Invalid tries, found "${options.tries}".`);
299
+ }
300
+ options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
301
+ options.keep = !!options.keep;
302
+ options.detachDescriptor = !!options.detachDescriptor;
303
+ options.discardDescriptor = !!options.discardDescriptor;
304
+ options.unsafeCleanup = !!options.unsafeCleanup;
305
+ options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
306
+ options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
307
+ }
308
+ function _getRelativePath(option, name, tmpDir, cb) {
309
+ if (_isUndefined(name)) return cb(null);
310
+ _resolvePath(name, tmpDir, function(err, resolvedPath) {
311
+ if (err) return cb(err);
312
+ const relativePath = path4.relative(tmpDir, resolvedPath);
313
+ if (!resolvedPath.startsWith(tmpDir)) {
314
+ return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`));
315
+ }
316
+ cb(null, relativePath);
317
+ });
318
+ }
319
+ function _getRelativePathSync(option, name, tmpDir) {
320
+ if (_isUndefined(name)) return;
321
+ const resolvedPath = _resolvePathSync(name, tmpDir);
322
+ const relativePath = path4.relative(tmpDir, resolvedPath);
323
+ if (!resolvedPath.startsWith(tmpDir)) {
324
+ throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`);
325
+ }
326
+ return relativePath;
327
+ }
328
+ function _assertAndSanitizeOptions(options, cb) {
329
+ _getTmpDir(options, function(err, tmpDir) {
330
+ if (err) return cb(err);
331
+ options.tmpdir = tmpDir;
332
+ try {
333
+ _assertOptionsBase(options, tmpDir);
334
+ } catch (err2) {
335
+ return cb(err2);
336
+ }
337
+ _getRelativePath("dir", options.dir, tmpDir, function(err2, dir2) {
338
+ if (err2) return cb(err2);
339
+ options.dir = _isUndefined(dir2) ? "" : dir2;
340
+ _getRelativePath("template", options.template, tmpDir, function(err3, template2) {
341
+ if (err3) return cb(err3);
342
+ options.template = template2;
343
+ cb(null, options);
344
+ });
345
+ });
346
+ });
347
+ }
348
+ function _assertAndSanitizeOptionsSync(options) {
349
+ const tmpDir = options.tmpdir = _getTmpDirSync(options);
350
+ _assertOptionsBase(options, tmpDir);
351
+ const dir2 = _getRelativePathSync("dir", options.dir, tmpDir);
352
+ options.dir = _isUndefined(dir2) ? "" : dir2;
353
+ options.template = _getRelativePathSync("template", options.template, tmpDir);
354
+ return options;
355
+ }
356
+ function _isEBADF(error) {
357
+ return _isExpectedError(error, -EBADF, "EBADF");
358
+ }
359
+ function _isENOENT(error) {
360
+ return _isExpectedError(error, -ENOENT, "ENOENT");
361
+ }
362
+ function _isExpectedError(error, errno, code) {
363
+ return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;
364
+ }
365
+ function setGracefulCleanup() {
366
+ _gracefulCleanup = true;
367
+ }
368
+ function _getTmpDir(options, cb) {
369
+ return fs3.realpath(options && options.tmpdir || os.tmpdir(), cb);
370
+ }
371
+ function _getTmpDirSync(options) {
372
+ return fs3.realpathSync(options && options.tmpdir || os.tmpdir());
373
+ }
374
+ process.addListener(EXIT, _garbageCollector);
375
+ Object.defineProperty(module2.exports, "tmpdir", {
376
+ enumerable: true,
377
+ configurable: false,
378
+ get: function() {
379
+ return _getTmpDirSync();
380
+ }
381
+ });
382
+ module2.exports.dir = dir;
383
+ module2.exports.dirSync = dirSync;
384
+ module2.exports.file = file;
385
+ module2.exports.fileSync = fileSync;
386
+ module2.exports.tmpName = tmpName;
387
+ module2.exports.tmpNameSync = tmpNameSync;
388
+ module2.exports.setGracefulCleanup = setGracefulCleanup;
389
+ }
390
+ });
391
+
392
+ // ../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js
393
+ var require_tmp_promise = __commonJS({
394
+ "../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js"(exports2, module2) {
395
+ "use strict";
396
+ var { promisify } = require("util");
397
+ var tmp2 = require_tmp();
398
+ module2.exports.fileSync = tmp2.fileSync;
399
+ var fileWithOptions = promisify(
400
+ (options, cb) => tmp2.file(
401
+ options,
402
+ (err, path4, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path4, fd, cleanup: promisify(cleanup) })
403
+ )
404
+ );
405
+ module2.exports.file = async (options) => fileWithOptions(options);
406
+ module2.exports.withFile = async function withFile(fn, options) {
407
+ const { path: path4, fd, cleanup } = await module2.exports.file(options);
408
+ try {
409
+ return await fn({ path: path4, fd });
410
+ } finally {
411
+ await cleanup();
412
+ }
413
+ };
414
+ module2.exports.dirSync = tmp2.dirSync;
415
+ var dirWithOptions = promisify(
416
+ (options, cb) => tmp2.dir(
417
+ options,
418
+ (err, path4, cleanup) => err ? cb(err) : cb(void 0, { path: path4, cleanup: promisify(cleanup) })
419
+ )
420
+ );
421
+ module2.exports.dir = async (options) => dirWithOptions(options);
422
+ module2.exports.withDir = async function withDir(fn, options) {
423
+ const { path: path4, cleanup } = await module2.exports.dir(options);
424
+ try {
425
+ return await fn({ path: path4 });
426
+ } finally {
427
+ await cleanup();
428
+ }
429
+ };
430
+ module2.exports.tmpNameSync = tmp2.tmpNameSync;
431
+ module2.exports.tmpName = promisify(tmp2.tmpName);
432
+ module2.exports.tmpdir = tmp2.tmpdir;
433
+ module2.exports.setGracefulCleanup = tmp2.setGracefulCleanup;
434
+ }
435
+ });
436
+
437
+ // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs
438
+ var require_build = __commonJS({
439
+ "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"(exports2, module2) {
440
+ "use strict";
441
+ var fs3 = require("fs");
442
+ var util = require("util");
443
+ var path4 = require("path");
444
+ var shim2;
445
+ var Y18N2 = class {
446
+ constructor(opts) {
447
+ opts = opts || {};
448
+ this.directory = opts.directory || "./locales";
449
+ this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
450
+ this.locale = opts.locale || "en";
451
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
452
+ this.cache = /* @__PURE__ */ Object.create(null);
453
+ this.writeQueue = [];
454
+ }
455
+ __(...args) {
456
+ if (typeof arguments[0] !== "string") {
457
+ return this._taggedLiteral(arguments[0], ...arguments);
458
+ }
459
+ const str = args.shift();
460
+ let cb = function() {
461
+ };
462
+ if (typeof args[args.length - 1] === "function")
463
+ cb = args.pop();
464
+ cb = cb || function() {
465
+ };
466
+ if (!this.cache[this.locale])
467
+ this._readLocaleFile();
468
+ if (!this.cache[this.locale][str] && this.updateFiles) {
469
+ this.cache[this.locale][str] = str;
470
+ this._enqueueWrite({
471
+ directory: this.directory,
472
+ locale: this.locale,
473
+ cb
474
+ });
475
+ } else {
476
+ cb();
477
+ }
478
+ return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args));
479
+ }
480
+ __n() {
481
+ const args = Array.prototype.slice.call(arguments);
482
+ const singular = args.shift();
483
+ const plural = args.shift();
484
+ const quantity = args.shift();
485
+ let cb = function() {
486
+ };
487
+ if (typeof args[args.length - 1] === "function")
488
+ cb = args.pop();
489
+ if (!this.cache[this.locale])
490
+ this._readLocaleFile();
491
+ let str = quantity === 1 ? singular : plural;
492
+ if (this.cache[this.locale][singular]) {
493
+ const entry = this.cache[this.locale][singular];
494
+ str = entry[quantity === 1 ? "one" : "other"];
495
+ }
496
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
497
+ this.cache[this.locale][singular] = {
498
+ one: singular,
499
+ other: plural
500
+ };
501
+ this._enqueueWrite({
502
+ directory: this.directory,
503
+ locale: this.locale,
504
+ cb
505
+ });
506
+ } else {
507
+ cb();
508
+ }
509
+ const values = [str];
510
+ if (~str.indexOf("%d"))
511
+ values.push(quantity);
512
+ return shim2.format.apply(shim2.format, values.concat(args));
513
+ }
514
+ setLocale(locale) {
515
+ this.locale = locale;
516
+ }
517
+ getLocale() {
518
+ return this.locale;
519
+ }
520
+ updateLocale(obj) {
521
+ if (!this.cache[this.locale])
522
+ this._readLocaleFile();
523
+ for (const key in obj) {
524
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
525
+ this.cache[this.locale][key] = obj[key];
526
+ }
527
+ }
528
+ }
529
+ _taggedLiteral(parts, ...args) {
530
+ let str = "";
531
+ parts.forEach(function(part, i) {
532
+ const arg = args[i + 1];
533
+ str += part;
534
+ if (typeof arg !== "undefined") {
535
+ str += "%s";
536
+ }
537
+ });
538
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
539
+ }
540
+ _enqueueWrite(work) {
541
+ this.writeQueue.push(work);
542
+ if (this.writeQueue.length === 1)
543
+ this._processWriteQueue();
544
+ }
545
+ _processWriteQueue() {
142
546
  const _this = this;
143
547
  const work = this.writeQueue[0];
144
548
  const directory = work.directory;
@@ -2959,17 +3363,17 @@ var require_build4 = __commonJS({
2959
3363
  if ("string" != typeof t2.extends) return l2;
2960
3364
  const r2 = /\.json|\..*rc$/.test(t2.extends);
2961
3365
  let h3 = null;
2962
- if (r2) h3 = function(t3, e2) {
3366
+ if (r2) h3 = (function(t3, e2) {
2963
3367
  return s.path.resolve(t3, e2);
2964
- }(o2, t2.extends);
3368
+ })(o2, t2.extends);
2965
3369
  else try {
2966
3370
  h3 = require.resolve(t2.extends);
2967
3371
  } catch (e2) {
2968
3372
  return t2;
2969
3373
  }
2970
- !function(t3) {
3374
+ !(function(t3) {
2971
3375
  if (i.indexOf(t3) > -1) throw new e(`Circular extended configurations: '${t3}'.`);
2972
- }(h3), i.push(h3), l2 = r2 ? JSON.parse(s.readFileSync(h3, "utf8")) : require(t2.extends), delete t2.extends, l2 = n(l2, s.path.dirname(h3), a2, s);
3376
+ })(h3), i.push(h3), l2 = r2 ? JSON.parse(s.readFileSync(h3, "utf8")) : require(t2.extends), delete t2.extends, l2 = n(l2, s.path.dirname(h3), a2, s);
2973
3377
  }
2974
3378
  return i = [], a2 ? r(l2, t2) : Object.assign({}, l2, t2);
2975
3379
  }
@@ -2986,10 +3390,10 @@ var require_build4 = __commonJS({
2986
3390
  const e2 = t2.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), s2 = /\.*[\][<>]/g, i2 = e2.shift();
2987
3391
  if (!i2) throw new Error(`No command found in: ${t2}`);
2988
3392
  const n2 = { cmd: i2.replace(s2, ""), demanded: [], optional: [] };
2989
- return e2.forEach((t3, i3) => {
3393
+ return e2.forEach(((t3, i3) => {
2990
3394
  let r2 = false;
2991
3395
  t3 = t3.replace(/\s/g, ""), /\.+[\]>]/.test(t3) && i3 === e2.length - 1 && (r2 = true), /^\[/.test(t3) ? n2.optional.push({ cmd: t3.replace(s2, "").split("|"), variadic: r2 }) : n2.demanded.push({ cmd: t3.replace(s2, "").split("|"), variadic: r2 });
2992
- }), n2;
3396
+ })), n2;
2993
3397
  }
2994
3398
  var a = ["first", "second", "third", "fourth", "fifth", "sixth"];
2995
3399
  function h(t2, s2, i2) {
@@ -3001,14 +3405,14 @@ var require_build4 = __commonJS({
3001
3405
  if (d2 < r2.demanded.length) throw new e(`Not enough arguments provided. Expected ${r2.demanded.length} but received ${f2.length}.`);
3002
3406
  const u2 = r2.demanded.length + r2.optional.length;
3003
3407
  if (d2 > u2) throw new e(`Too many arguments provided. Expected max ${u2} but received ${d2}.`);
3004
- r2.demanded.forEach((t3) => {
3408
+ r2.demanded.forEach(((t3) => {
3005
3409
  const e2 = l(f2.shift());
3006
- 0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1;
3007
- }), r2.optional.forEach((t3) => {
3410
+ 0 === t3.cmd.filter(((t4) => t4 === e2 || "*" === t4)).length && c(e2, t3.cmd, n2), n2 += 1;
3411
+ })), r2.optional.forEach(((t3) => {
3008
3412
  if (0 === f2.length) return;
3009
3413
  const e2 = l(f2.shift());
3010
- 0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1;
3011
- });
3414
+ 0 === t3.cmd.filter(((t4) => t4 === e2 || "*" === t4)).length && c(e2, t3.cmd, n2), n2 += 1;
3415
+ }));
3012
3416
  } catch (t3) {
3013
3417
  console.warn(t3.stack);
3014
3418
  }
@@ -3031,11 +3435,11 @@ var require_build4 = __commonJS({
3031
3435
  function p(t2) {
3032
3436
  return Object.keys(t2);
3033
3437
  }
3034
- function g(t2 = {}, e2 = () => true) {
3438
+ function g(t2 = {}, e2 = (() => true)) {
3035
3439
  const s2 = {};
3036
- return p(t2).forEach((i2) => {
3440
+ return p(t2).forEach(((i2) => {
3037
3441
  e2(i2, t2[i2]) && (s2[i2] = t2[i2]);
3038
- }), s2;
3442
+ })), s2;
3039
3443
  }
3040
3444
  function m() {
3041
3445
  return process.versions.electron && !process.defaultApp ? 0 : 1;
@@ -3077,10 +3481,10 @@ var require_build4 = __commonJS({
3077
3481
  }
3078
3482
  addCoerceMiddleware(t2, e2) {
3079
3483
  const s2 = this.yargs.getAliases();
3080
- return this.globalMiddleware = this.globalMiddleware.filter((t3) => {
3484
+ return this.globalMiddleware = this.globalMiddleware.filter(((t3) => {
3081
3485
  const i2 = [...s2[e2] || [], e2];
3082
3486
  return !t3.option || !i2.includes(t3.option);
3083
- }), t2.option = e2, this.addMiddleware(t2, true, true, true);
3487
+ })), t2.option = e2, this.addMiddleware(t2, true, true, true);
3084
3488
  }
3085
3489
  getMiddleware() {
3086
3490
  return this.globalMiddleware;
@@ -3093,29 +3497,29 @@ var require_build4 = __commonJS({
3093
3497
  void 0 !== t2 && (this.globalMiddleware = t2);
3094
3498
  }
3095
3499
  reset() {
3096
- this.globalMiddleware = this.globalMiddleware.filter((t2) => t2.global);
3500
+ this.globalMiddleware = this.globalMiddleware.filter(((t2) => t2.global));
3097
3501
  }
3098
3502
  };
3099
3503
  function C(t2, e2, s2, i2) {
3100
- return s2.reduce((t3, s3) => {
3504
+ return s2.reduce(((t3, s3) => {
3101
3505
  if (s3.applyBeforeValidation !== i2) return t3;
3102
3506
  if (s3.mutates) {
3103
3507
  if (s3.applied) return t3;
3104
3508
  s3.applied = true;
3105
3509
  }
3106
- if (f(t3)) return t3.then((t4) => Promise.all([t4, s3(t4, e2)])).then(([t4, e3]) => Object.assign(t4, e3));
3510
+ if (f(t3)) return t3.then(((t4) => Promise.all([t4, s3(t4, e2)]))).then((([t4, e3]) => Object.assign(t4, e3)));
3107
3511
  {
3108
3512
  const i3 = s3(t3, e2);
3109
- return f(i3) ? i3.then((e3) => Object.assign(t3, e3)) : Object.assign(t3, i3);
3513
+ return f(i3) ? i3.then(((e3) => Object.assign(t3, e3))) : Object.assign(t3, i3);
3110
3514
  }
3111
- }, t2);
3515
+ }), t2);
3112
3516
  }
3113
- function j(t2, e2, s2 = (t3) => {
3517
+ function j(t2, e2, s2 = ((t3) => {
3114
3518
  throw t3;
3115
- }) {
3519
+ })) {
3116
3520
  try {
3117
3521
  const s3 = "function" == typeof t2 ? t2() : t2;
3118
- return f(s3) ? s3.then((t3) => e2(t3)) : e2(s3);
3522
+ return f(s3) ? s3.then(((t3) => e2(t3))) : e2(s3);
3119
3523
  } catch (t3) {
3120
3524
  return s2(t3);
3121
3525
  }
@@ -3139,18 +3543,18 @@ var require_build4 = __commonJS({
3139
3543
  }
3140
3544
  addHandler(t2, e2, s2, i2, n2, r2) {
3141
3545
  let a2 = [];
3142
- const h2 = function(t3) {
3143
- return t3 ? t3.map((t4) => (t4.applyBeforeValidation = false, t4)) : [];
3144
- }(n2);
3546
+ const h2 = (function(t3) {
3547
+ return t3 ? t3.map(((t4) => (t4.applyBeforeValidation = false, t4))) : [];
3548
+ })(n2);
3145
3549
  if (i2 = i2 || (() => {
3146
- }), Array.isArray(t2)) if (function(t3) {
3147
- return t3.every((t4) => "string" == typeof t4);
3148
- }(t2)) [t2, ...a2] = t2;
3550
+ }), Array.isArray(t2)) if ((function(t3) {
3551
+ return t3.every(((t4) => "string" == typeof t4));
3552
+ })(t2)) [t2, ...a2] = t2;
3149
3553
  else for (const e3 of t2) this.addHandler(e3);
3150
3554
  else {
3151
- if (function(t3) {
3555
+ if ((function(t3) {
3152
3556
  return "object" == typeof t3 && !Array.isArray(t3);
3153
- }(t2)) {
3557
+ })(t2)) {
3154
3558
  let e3 = Array.isArray(t2.command) || "string" == typeof t2.command ? t2.command : this.moduleName(t2);
3155
3559
  return t2.aliases && (e3 = [].concat(e3).concat(t2.aliases)), void this.addHandler(e3, this.extractDesc(t2), t2.builder, t2.handler, t2.middlewares, t2.deprecated);
3156
3560
  }
@@ -3158,12 +3562,12 @@ var require_build4 = __commonJS({
3158
3562
  }
3159
3563
  if ("string" == typeof t2) {
3160
3564
  const n3 = o(t2);
3161
- a2 = a2.map((t3) => o(t3).cmd);
3565
+ a2 = a2.map(((t3) => o(t3).cmd));
3162
3566
  let l2 = false;
3163
- const c2 = [n3.cmd].concat(a2).filter((t3) => !M.test(t3) || (l2 = true, false));
3164
- 0 === c2.length && l2 && c2.push("$0"), l2 && (n3.cmd = c2[0], a2 = c2.slice(1), t2 = t2.replace(M, n3.cmd)), a2.forEach((t3) => {
3567
+ const c2 = [n3.cmd].concat(a2).filter(((t3) => !M.test(t3) || (l2 = true, false)));
3568
+ 0 === c2.length && l2 && c2.push("$0"), l2 && (n3.cmd = c2[0], a2 = c2.slice(1), t2 = t2.replace(M, n3.cmd)), a2.forEach(((t3) => {
3165
3569
  this.aliasMap[t3] = n3.cmd;
3166
- }), false !== e2 && this.usage.command(t2, e2, l2, a2, r2), this.handlers[n3.cmd] = { original: t2, description: e2, handler: i2, builder: s2 || {}, middlewares: h2, deprecated: r2, demanded: n3.demanded, optional: n3.optional }, l2 && (this.defaultCommand = this.handlers[n3.cmd]);
3570
+ })), false !== e2 && this.usage.command(t2, e2, l2, a2, r2), this.handlers[n3.cmd] = { original: t2, description: e2, handler: i2, builder: s2 || {}, middlewares: h2, deprecated: r2, demanded: n3.demanded, optional: n3.optional }, l2 && (this.defaultCommand = this.handlers[n3.cmd]);
3167
3571
  }
3168
3572
  }
3169
3573
  getCommandHandlers() {
@@ -3179,7 +3583,7 @@ var require_build4 = __commonJS({
3179
3583
  const o2 = this.handlers[t2] || this.handlers[this.aliasMap[t2]] || this.defaultCommand, a2 = e2.getInternalMethods().getContext(), h2 = a2.commands.slice(), l2 = !t2;
3180
3584
  t2 && (a2.commands.push(t2), a2.fullCommands.push(o2.original));
3181
3585
  const c2 = this.applyBuilderUpdateUsageAndParse(l2, o2, e2, s2.aliases, h2, i2, n2, r2);
3182
- return f(c2) ? c2.then((t3) => this.applyMiddlewareAndGetResult(l2, o2, t3.innerArgv, a2, n2, t3.aliases, e2)) : this.applyMiddlewareAndGetResult(l2, o2, c2.innerArgv, a2, n2, c2.aliases, e2);
3586
+ return f(c2) ? c2.then(((t3) => this.applyMiddlewareAndGetResult(l2, o2, t3.innerArgv, a2, n2, t3.aliases, e2))) : this.applyMiddlewareAndGetResult(l2, o2, c2.innerArgv, a2, n2, c2.aliases, e2);
3183
3587
  }
3184
3588
  applyBuilderUpdateUsageAndParse(t2, e2, s2, i2, n2, r2, o2, a2) {
3185
3589
  const h2 = e2.builder;
@@ -3187,46 +3591,46 @@ var require_build4 = __commonJS({
3187
3591
  if (x(h2)) {
3188
3592
  s2.getInternalMethods().getUsageInstance().freeze();
3189
3593
  const c2 = h2(s2.getInternalMethods().reset(i2), a2);
3190
- if (f(c2)) return c2.then((i3) => {
3594
+ if (f(c2)) return c2.then(((i3) => {
3191
3595
  var a3;
3192
3596
  return l2 = (a3 = i3) && "function" == typeof a3.getInternalMethods ? i3 : s2, this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2);
3193
- });
3597
+ }));
3194
3598
  } else /* @__PURE__ */ (function(t3) {
3195
3599
  return "object" == typeof t3;
3196
- })(h2) && (s2.getInternalMethods().getUsageInstance().freeze(), l2 = s2.getInternalMethods().reset(i2), Object.keys(e2.builder).forEach((t3) => {
3600
+ })(h2) && (s2.getInternalMethods().getUsageInstance().freeze(), l2 = s2.getInternalMethods().reset(i2), Object.keys(e2.builder).forEach(((t3) => {
3197
3601
  l2.option(t3, h2[t3]);
3198
- }));
3602
+ })));
3199
3603
  return this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2);
3200
3604
  }
3201
3605
  parseAndUpdateUsage(t2, e2, s2, i2, n2, r2) {
3202
3606
  t2 && s2.getInternalMethods().getUsageInstance().unfreeze(true), this.shouldUpdateUsage(s2) && s2.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i2, e2), e2.description);
3203
3607
  const o2 = s2.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, n2, r2);
3204
- return f(o2) ? o2.then((t3) => ({ aliases: s2.parsed.aliases, innerArgv: t3 })) : { aliases: s2.parsed.aliases, innerArgv: o2 };
3608
+ return f(o2) ? o2.then(((t3) => ({ aliases: s2.parsed.aliases, innerArgv: t3 }))) : { aliases: s2.parsed.aliases, innerArgv: o2 };
3205
3609
  }
3206
3610
  shouldUpdateUsage(t2) {
3207
3611
  return !t2.getInternalMethods().getUsageInstance().getUsageDisabled() && 0 === t2.getInternalMethods().getUsageInstance().getUsage().length;
3208
3612
  }
3209
3613
  usageFromParentCommandsCommandHandler(t2, e2) {
3210
- const s2 = M.test(e2.original) ? e2.original.replace(M, "").trim() : e2.original, i2 = t2.filter((t3) => !M.test(t3));
3614
+ const s2 = M.test(e2.original) ? e2.original.replace(M, "").trim() : e2.original, i2 = t2.filter(((t3) => !M.test(t3)));
3211
3615
  return i2.push(s2), `$0 ${i2.join(" ")}`;
3212
3616
  }
3213
3617
  handleValidationAndGetResult(t2, e2, s2, i2, n2, r2, o2, a2) {
3214
3618
  if (!r2.getInternalMethods().getHasOutput()) {
3215
3619
  const e3 = r2.getInternalMethods().runValidation(n2, a2, r2.parsed.error, t2);
3216
- s2 = j(s2, (t3) => (e3(t3), t3));
3620
+ s2 = j(s2, ((t3) => (e3(t3), t3)));
3217
3621
  }
3218
3622
  if (e2.handler && !r2.getInternalMethods().getHasOutput()) {
3219
3623
  r2.getInternalMethods().setHasOutput();
3220
3624
  const i3 = !!r2.getOptions().configuration["populate--"];
3221
- r2.getInternalMethods().postProcess(s2, i3, false, false), s2 = j(s2 = C(s2, r2, o2, false), (t3) => {
3625
+ r2.getInternalMethods().postProcess(s2, i3, false, false), s2 = j(s2 = C(s2, r2, o2, false), ((t3) => {
3222
3626
  const s3 = e2.handler(t3);
3223
- return f(s3) ? s3.then(() => t3) : t3;
3224
- }), t2 || r2.getInternalMethods().getUsageInstance().cacheHelpMessage(), f(s2) && !r2.getInternalMethods().hasParseCallback() && s2.catch((t3) => {
3627
+ return f(s3) ? s3.then((() => t3)) : t3;
3628
+ })), t2 || r2.getInternalMethods().getUsageInstance().cacheHelpMessage(), f(s2) && !r2.getInternalMethods().hasParseCallback() && s2.catch(((t3) => {
3225
3629
  try {
3226
3630
  r2.getInternalMethods().getUsageInstance().fail(null, t3);
3227
3631
  } catch (t4) {
3228
3632
  }
3229
- });
3633
+ }));
3230
3634
  }
3231
3635
  return t2 || (i2.commands.pop(), i2.fullCommands.pop()), s2;
3232
3636
  }
@@ -3235,7 +3639,7 @@ var require_build4 = __commonJS({
3235
3639
  if (n2) return s2;
3236
3640
  o2.getInternalMethods().getHasOutput() || (a2 = this.populatePositionals(e2, s2, i2, o2));
3237
3641
  const h2 = this.globalMiddleware.getMiddleware().slice(0).concat(e2.middlewares), l2 = C(s2, o2, h2, true);
3238
- return f(l2) ? l2.then((s3) => this.handleValidationAndGetResult(t2, e2, s3, i2, r2, o2, h2, a2)) : this.handleValidationAndGetResult(t2, e2, l2, i2, r2, o2, h2, a2);
3642
+ return f(l2) ? l2.then(((s3) => this.handleValidationAndGetResult(t2, e2, s3, i2, r2, o2, h2, a2))) : this.handleValidationAndGetResult(t2, e2, l2, i2, r2, o2, h2, a2);
3239
3643
  }
3240
3644
  populatePositionals(t2, e2, s2, i2) {
3241
3645
  e2._ = e2._.slice(s2.commands.length);
@@ -3248,7 +3652,7 @@ var require_build4 = __commonJS({
3248
3652
  const t3 = r2.shift();
3249
3653
  this.populatePositional(t3, e2, o2);
3250
3654
  }
3251
- return e2._ = s2.commands.concat(e2._.map((t3) => "" + t3)), this.postProcessPositionals(e2, o2, this.cmdToParseOptions(t2.original), i2), o2;
3655
+ return e2._ = s2.commands.concat(e2._.map(((t3) => "" + t3))), this.postProcessPositionals(e2, o2, this.cmdToParseOptions(t2.original), i2), o2;
3252
3656
  }
3253
3657
  populatePositional(t2, e2, s2) {
3254
3658
  const i2 = t2.cmd[0];
@@ -3256,13 +3660,13 @@ var require_build4 = __commonJS({
3256
3660
  }
3257
3661
  cmdToParseOptions(t2) {
3258
3662
  const e2 = { array: [], default: {}, alias: {}, demand: {} }, s2 = o(t2);
3259
- return s2.demanded.forEach((t3) => {
3663
+ return s2.demanded.forEach(((t3) => {
3260
3664
  const [s3, ...i2] = t3.cmd;
3261
3665
  t3.variadic && (e2.array.push(s3), e2.default[s3] = []), e2.alias[s3] = i2, e2.demand[s3] = true;
3262
- }), s2.optional.forEach((t3) => {
3666
+ })), s2.optional.forEach(((t3) => {
3263
3667
  const [s3, ...i2] = t3.cmd;
3264
3668
  t3.variadic && (e2.array.push(s3), e2.default[s3] = []), e2.alias[s3] = i2;
3265
- }), e2;
3669
+ })), e2;
3266
3670
  }
3267
3671
  postProcessPositionals(t2, e2, s2, i2) {
3268
3672
  const n2 = Object.assign({}, i2.getOptions());
@@ -3270,20 +3674,20 @@ var require_build4 = __commonJS({
3270
3674
  for (const t3 of Object.keys(s2.alias)) n2.alias[t3] = (n2.alias[t3] || []).concat(s2.alias[t3]);
3271
3675
  n2.array = n2.array.concat(s2.array), n2.config = {};
3272
3676
  const r2 = [];
3273
- if (Object.keys(e2).forEach((t3) => {
3274
- e2[t3].map((e3) => {
3677
+ if (Object.keys(e2).forEach(((t3) => {
3678
+ e2[t3].map(((e3) => {
3275
3679
  n2.configuration["unknown-options-as-args"] && (n2.key[t3] = true), r2.push(`--${t3}`), r2.push(e3);
3276
- });
3277
- }), !r2.length) return;
3680
+ }));
3681
+ })), !r2.length) return;
3278
3682
  const o2 = Object.assign({}, n2.configuration, { "populate--": false }), a2 = this.shim.Parser.detailed(r2, Object.assign({}, n2, { configuration: o2 }));
3279
3683
  if (a2.error) i2.getInternalMethods().getUsageInstance().fail(a2.error.message, a2.error);
3280
3684
  else {
3281
3685
  const s3 = Object.keys(e2);
3282
- Object.keys(e2).forEach((t3) => {
3686
+ Object.keys(e2).forEach(((t3) => {
3283
3687
  s3.push(...a2.aliases[t3]);
3284
- }), Object.keys(a2.argv).forEach((n3) => {
3688
+ })), Object.keys(a2.argv).forEach(((n3) => {
3285
3689
  s3.includes(n3) && (e2[n3] || (e2[n3] = a2.argv[n3]), !this.isInConfigs(i2, n3) && !this.isDefaulted(i2, n3) && Object.prototype.hasOwnProperty.call(t2, n3) && Object.prototype.hasOwnProperty.call(a2.argv, n3) && (Array.isArray(t2[n3]) || Array.isArray(a2.argv[n3])) ? t2[n3] = [].concat(t2[n3], a2.argv[n3]) : t2[n3] = a2.argv[n3]);
3286
- });
3690
+ }));
3287
3691
  }
3288
3692
  }
3289
3693
  isDefaulted(t2, e2) {
@@ -3292,7 +3696,7 @@ var require_build4 = __commonJS({
3292
3696
  }
3293
3697
  isInConfigs(t2, e2) {
3294
3698
  const { configObjects: s2 } = t2.getOptions();
3295
- return s2.some((t3) => Object.prototype.hasOwnProperty.call(t3, e2)) || s2.some((t3) => Object.prototype.hasOwnProperty.call(t3, this.shim.Parser.camelCase(e2)));
3699
+ return s2.some(((t3) => Object.prototype.hasOwnProperty.call(t3, e2))) || s2.some(((t3) => Object.prototype.hasOwnProperty.call(t3, this.shim.Parser.camelCase(e2))));
3296
3700
  }
3297
3701
  runDefaultBuilderOn(t2) {
3298
3702
  if (!this.defaultCommand) return;
@@ -3302,16 +3706,16 @@ var require_build4 = __commonJS({
3302
3706
  }
3303
3707
  const e2 = this.defaultCommand.builder;
3304
3708
  if (x(e2)) return e2(t2, true);
3305
- k(e2) || Object.keys(e2).forEach((s2) => {
3709
+ k(e2) || Object.keys(e2).forEach(((s2) => {
3306
3710
  t2.option(s2, e2[s2]);
3307
- });
3711
+ }));
3308
3712
  }
3309
3713
  moduleName(t2) {
3310
- const e2 = function(t3) {
3714
+ const e2 = (function(t3) {
3311
3715
  if ("undefined" == typeof require) return null;
3312
3716
  for (let e3, s2 = 0, i2 = Object.keys(require.cache); s2 < i2.length; s2++) if (e3 = require.cache[i2[s2]], e3.exports === t3) return e3;
3313
3717
  return null;
3314
- }(t2);
3718
+ })(t2);
3315
3719
  if (!e2) throw new Error(`No command name given for module: ${this.shim.inspect(t2)}`);
3316
3720
  return this.commandFromFilename(e2.filename);
3317
3721
  }
@@ -3343,10 +3747,10 @@ var require_build4 = __commonJS({
3343
3747
  return "function" == typeof t2;
3344
3748
  }
3345
3749
  function E(t2) {
3346
- "undefined" != typeof process && [process.stdout, process.stderr].forEach((e2) => {
3750
+ "undefined" != typeof process && [process.stdout, process.stderr].forEach(((e2) => {
3347
3751
  const s2 = e2;
3348
3752
  s2._handle && s2.isTTY && "function" == typeof s2._handle.setBlocking && s2._handle.setBlocking(t2);
3349
- });
3753
+ }));
3350
3754
  }
3351
3755
  function A(t2) {
3352
3756
  return "boolean" == typeof t2;
@@ -3390,15 +3794,15 @@ var require_build4 = __commonJS({
3390
3794
  };
3391
3795
  let u2 = [];
3392
3796
  n2.command = function(t3, e2, s3, i3, n3 = false) {
3393
- s3 && (u2 = u2.map((t4) => (t4[2] = false, t4))), u2.push([t3, e2 || "", s3, i3, n3]);
3797
+ s3 && (u2 = u2.map(((t4) => (t4[2] = false, t4)))), u2.push([t3, e2 || "", s3, i3, n3]);
3394
3798
  }, n2.getCommands = () => u2;
3395
3799
  let p2 = {};
3396
3800
  n2.describe = function(t3, e2) {
3397
- Array.isArray(t3) ? t3.forEach((t4) => {
3801
+ Array.isArray(t3) ? t3.forEach(((t4) => {
3398
3802
  n2.describe(t4, e2);
3399
- }) : "object" == typeof t3 ? Object.keys(t3).forEach((e3) => {
3803
+ })) : "object" == typeof t3 ? Object.keys(t3).forEach(((e3) => {
3400
3804
  n2.describe(e3, t3[e3]);
3401
- }) : p2[t3] = e2;
3805
+ })) : p2[t3] = e2;
3402
3806
  }, n2.getDescriptions = () => p2;
3403
3807
  let m2 = [];
3404
3808
  n2.epilog = (t3) => {
@@ -3407,16 +3811,16 @@ var require_build4 = __commonJS({
3407
3811
  let y2, b2 = false;
3408
3812
  n2.wrap = (t3) => {
3409
3813
  b2 = true, y2 = t3;
3410
- }, n2.getWrap = () => s2.getEnv("YARGS_DISABLE_WRAP") ? null : (b2 || (y2 = function() {
3814
+ }, n2.getWrap = () => s2.getEnv("YARGS_DISABLE_WRAP") ? null : (b2 || (y2 = (function() {
3411
3815
  const t3 = 80;
3412
3816
  return s2.process.stdColumns ? Math.min(t3, s2.process.stdColumns) : t3;
3413
- }(), b2 = true), y2);
3817
+ })(), b2 = true), y2);
3414
3818
  const v2 = "__yargsString__:";
3415
3819
  function O2(t3, e2, i3) {
3416
3820
  let n3 = 0;
3417
- return Array.isArray(t3) || (t3 = Object.values(t3).map((t4) => [t4])), t3.forEach((t4) => {
3821
+ return Array.isArray(t3) || (t3 = Object.values(t3).map(((t4) => [t4]))), t3.forEach(((t4) => {
3418
3822
  n3 = Math.max(s2.stringWidth(i3 ? `${i3} ${I(t4[0])}` : I(t4[0])) + $(t4[0]), n3);
3419
- }), e2 && (n3 = Math.min(n3, parseInt((0.5 * e2).toString(), 10))), n3;
3823
+ })), e2 && (n3 = Math.min(n3, parseInt((0.5 * e2).toString(), 10))), n3;
3420
3824
  }
3421
3825
  let w2;
3422
3826
  function C2(e2) {
@@ -3440,22 +3844,22 @@ var require_build4 = __commonJS({
3440
3844
  }
3441
3845
  n2.deferY18nLookup = (t3) => v2 + t3, n2.help = function() {
3442
3846
  if (w2) return w2;
3443
- !function() {
3847
+ !(function() {
3444
3848
  const e3 = t2.getDemandedOptions(), s3 = t2.getOptions();
3445
- (Object.keys(s3.alias) || []).forEach((i3) => {
3446
- s3.alias[i3].forEach((r4) => {
3849
+ (Object.keys(s3.alias) || []).forEach(((i3) => {
3850
+ s3.alias[i3].forEach(((r4) => {
3447
3851
  p2[r4] && n2.describe(i3, p2[r4]), r4 in e3 && t2.demandOption(i3, e3[r4]), s3.boolean.includes(r4) && t2.boolean(i3), s3.count.includes(r4) && t2.count(i3), s3.string.includes(r4) && t2.string(i3), s3.normalize.includes(r4) && t2.normalize(i3), s3.array.includes(r4) && t2.array(i3), s3.number.includes(r4) && t2.number(i3);
3448
- });
3449
- });
3450
- }();
3852
+ }));
3853
+ }));
3854
+ })();
3451
3855
  const e2 = t2.customScriptName ? t2.$0 : s2.path.basename(t2.$0), r3 = t2.getDemandedOptions(), o3 = t2.getDemandedCommands(), a3 = t2.getDeprecatedOptions(), h3 = t2.getGroups(), l3 = t2.getOptions();
3452
3856
  let g2 = [];
3453
- g2 = g2.concat(Object.keys(p2)), g2 = g2.concat(Object.keys(r3)), g2 = g2.concat(Object.keys(o3)), g2 = g2.concat(Object.keys(l3.default)), g2 = g2.filter(C2), g2 = Object.keys(g2.reduce((t3, e3) => ("_" !== e3 && (t3[e3] = true), t3), {}));
3857
+ g2 = g2.concat(Object.keys(p2)), g2 = g2.concat(Object.keys(r3)), g2 = g2.concat(Object.keys(o3)), g2 = g2.concat(Object.keys(l3.default)), g2 = g2.filter(C2), g2 = Object.keys(g2.reduce(((t3, e3) => ("_" !== e3 && (t3[e3] = true), t3)), {}));
3454
3858
  const y3 = n2.getWrap(), b3 = s2.cliui({ width: y3, wrap: !!y3 });
3455
3859
  if (!f2) {
3456
- if (c2.length) c2.forEach((t3) => {
3860
+ if (c2.length) c2.forEach(((t3) => {
3457
3861
  b3.div({ text: `${t3[0].replace(/\$0/g, e2)}` }), t3[1] && b3.div({ text: `${t3[1]}`, padding: [1, 0, 0, 0] });
3458
- }), b3.div();
3862
+ })), b3.div();
3459
3863
  else if (u2.length) {
3460
3864
  let t3 = null;
3461
3865
  t3 = o3._ ? `${e2} <${i2("command")}>
@@ -3466,41 +3870,41 @@ var require_build4 = __commonJS({
3466
3870
  if (u2.length > 1 || 1 === u2.length && !u2[0][2]) {
3467
3871
  b3.div(i2("Commands:"));
3468
3872
  const s3 = t2.getInternalMethods().getContext(), n3 = s3.commands.length ? `${s3.commands.join(" ")} ` : "";
3469
- true === t2.getInternalMethods().getParserConfiguration()["sort-commands"] && (u2 = u2.sort((t3, e3) => t3[0].localeCompare(e3[0])));
3873
+ true === t2.getInternalMethods().getParserConfiguration()["sort-commands"] && (u2 = u2.sort(((t3, e3) => t3[0].localeCompare(e3[0]))));
3470
3874
  const r4 = e2 ? `${e2} ` : "";
3471
- u2.forEach((t3) => {
3875
+ u2.forEach(((t3) => {
3472
3876
  const s4 = `${r4}${n3}${t3[0].replace(/^\$0 ?/, "")}`;
3473
3877
  b3.span({ text: s4, padding: [0, 2, 0, 2], width: O2(u2, y3, `${e2}${n3}`) + 4 }, { text: t3[1] });
3474
3878
  const o4 = [];
3475
3879
  t3[2] && o4.push(`[${i2("default")}]`), t3[3] && t3[3].length && o4.push(`[${i2("aliases:")} ${t3[3].join(", ")}]`), t3[4] && ("string" == typeof t3[4] ? o4.push(`[${i2("deprecated: %s", t3[4])}]`) : o4.push(`[${i2("deprecated")}]`)), o4.length ? b3.div({ text: o4.join(" "), padding: [0, 0, 0, 2], align: "right" }) : b3.div();
3476
- }), b3.div();
3880
+ })), b3.div();
3477
3881
  }
3478
3882
  const M3 = (Object.keys(l3.alias) || []).concat(Object.keys(t2.parsed.newAliases) || []);
3479
- g2 = g2.filter((e3) => !t2.parsed.newAliases[e3] && M3.every((t3) => -1 === (l3.alias[t3] || []).indexOf(e3)));
3883
+ g2 = g2.filter(((e3) => !t2.parsed.newAliases[e3] && M3.every(((t3) => -1 === (l3.alias[t3] || []).indexOf(e3)))));
3480
3884
  const _3 = i2("Options:");
3481
- h3[_3] || (h3[_3] = []), function(t3, e3, s3, i3) {
3885
+ h3[_3] || (h3[_3] = []), (function(t3, e3, s3, i3) {
3482
3886
  let n3 = [], r4 = null;
3483
- Object.keys(s3).forEach((t4) => {
3887
+ Object.keys(s3).forEach(((t4) => {
3484
3888
  n3 = n3.concat(s3[t4]);
3485
- }), t3.forEach((t4) => {
3486
- r4 = [t4].concat(e3[t4]), r4.some((t5) => -1 !== n3.indexOf(t5)) || s3[i3].push(t4);
3487
- });
3488
- }(g2, l3.alias, h3, _3);
3489
- const k2 = (t3) => /^--/.test(I(t3)), x2 = Object.keys(h3).filter((t3) => h3[t3].length > 0).map((t3) => ({ groupName: t3, normalizedKeys: h3[t3].filter(C2).map((t4) => {
3889
+ })), t3.forEach(((t4) => {
3890
+ r4 = [t4].concat(e3[t4]), r4.some(((t5) => -1 !== n3.indexOf(t5))) || s3[i3].push(t4);
3891
+ }));
3892
+ })(g2, l3.alias, h3, _3);
3893
+ const k2 = (t3) => /^--/.test(I(t3)), x2 = Object.keys(h3).filter(((t3) => h3[t3].length > 0)).map(((t3) => ({ groupName: t3, normalizedKeys: h3[t3].filter(C2).map(((t4) => {
3490
3894
  if (M3.includes(t4)) return t4;
3491
3895
  for (let e3, s3 = 0; void 0 !== (e3 = M3[s3]); s3++) if ((l3.alias[e3] || []).includes(t4)) return e3;
3492
3896
  return t4;
3493
- }) })).filter(({ normalizedKeys: t3 }) => t3.length > 0).map(({ groupName: t3, normalizedKeys: e3 }) => {
3494
- const s3 = e3.reduce((e4, s4) => (e4[s4] = [s4].concat(l3.alias[s4] || []).map((e5) => t3 === n2.getPositionalGroupName() ? e5 : (/^[0-9]$/.test(e5) ? l3.boolean.includes(s4) ? "-" : "--" : e5.length > 1 ? "--" : "-") + e5).sort((t4, e5) => k2(t4) === k2(e5) ? 0 : k2(t4) ? 1 : -1).join(", "), e4), {});
3897
+ })) }))).filter((({ normalizedKeys: t3 }) => t3.length > 0)).map((({ groupName: t3, normalizedKeys: e3 }) => {
3898
+ const s3 = e3.reduce(((e4, s4) => (e4[s4] = [s4].concat(l3.alias[s4] || []).map(((e5) => t3 === n2.getPositionalGroupName() ? e5 : (/^[0-9]$/.test(e5) ? l3.boolean.includes(s4) ? "-" : "--" : e5.length > 1 ? "--" : "-") + e5)).sort(((t4, e5) => k2(t4) === k2(e5) ? 0 : k2(t4) ? 1 : -1)).join(", "), e4)), {});
3495
3899
  return { groupName: t3, normalizedKeys: e3, switches: s3 };
3496
- });
3497
- if (x2.filter(({ groupName: t3 }) => t3 !== n2.getPositionalGroupName()).some(({ normalizedKeys: t3, switches: e3 }) => !t3.every((t4) => k2(e3[t4]))) && x2.filter(({ groupName: t3 }) => t3 !== n2.getPositionalGroupName()).forEach(({ normalizedKeys: t3, switches: e3 }) => {
3498
- t3.forEach((t4) => {
3900
+ }));
3901
+ if (x2.filter((({ groupName: t3 }) => t3 !== n2.getPositionalGroupName())).some((({ normalizedKeys: t3, switches: e3 }) => !t3.every(((t4) => k2(e3[t4]))))) && x2.filter((({ groupName: t3 }) => t3 !== n2.getPositionalGroupName())).forEach((({ normalizedKeys: t3, switches: e3 }) => {
3902
+ t3.forEach(((t4) => {
3499
3903
  var s3, i3;
3500
3904
  k2(e3[t4]) && (e3[t4] = (s3 = e3[t4], i3 = 4, S(s3) ? { text: s3.text, indentation: s3.indentation + i3 } : { text: s3, indentation: i3 }));
3501
- });
3502
- }), x2.forEach(({ groupName: e3, normalizedKeys: s3, switches: o4 }) => {
3503
- b3.div(e3), s3.forEach((e4) => {
3905
+ }));
3906
+ })), x2.forEach((({ groupName: e3, normalizedKeys: s3, switches: o4 }) => {
3907
+ b3.div(e3), s3.forEach(((e4) => {
3504
3908
  const s4 = o4[e4];
3505
3909
  let h4 = p2[e4] || "", c3 = null;
3506
3910
  h4.includes(v2) && (h4 = i2(h4.substring(16))), l3.boolean.includes(e4) && (c3 = `[${i2("boolean")}]`), l3.count.includes(e4) && (c3 = `[${i2("count")}]`), l3.string.includes(e4) && (c3 = `[${i2("string")}]`), l3.normalize.includes(e4) && (c3 = `[${i2("string")}]`), l3.array.includes(e4) && (c3 = `[${i2("array")}]`), l3.number.includes(e4) && (c3 = `[${i2("number")}]`);
@@ -3509,13 +3913,13 @@ var require_build4 = __commonJS({
3509
3913
  b3.span({ text: I(s4), padding: [0, 2, 0, 2 + $(s4)], width: O2(o4, y3) + 4 }, h4);
3510
3914
  const u3 = true === t2.getInternalMethods().getUsageConfiguration()["hide-types"];
3511
3915
  f3 && !u3 ? b3.div({ text: f3, padding: [0, 0, 0, 2], align: "right" }) : b3.div();
3512
- }), b3.div();
3513
- }), d2.length && (b3.div(i2("Examples:")), d2.forEach((t3) => {
3916
+ })), b3.div();
3917
+ })), d2.length && (b3.div(i2("Examples:")), d2.forEach(((t3) => {
3514
3918
  t3[0] = t3[0].replace(/\$0/g, e2);
3515
- }), d2.forEach((t3) => {
3919
+ })), d2.forEach(((t3) => {
3516
3920
  "" === t3[1] ? b3.div({ text: t3[0], padding: [0, 2, 0, 2] }) : b3.div({ text: t3[0], padding: [0, 2, 0, 2], width: O2(d2, y3) + 4 }, { text: t3[1] });
3517
- }), b3.div()), m2.length > 0) {
3518
- const t3 = m2.map((t4) => t4.replace(/\$0/g, e2)).join("\n");
3921
+ })), b3.div()), m2.length > 0) {
3922
+ const t3 = m2.map(((t4) => t4.replace(/\$0/g, e2))).join("\n");
3519
3923
  b3.div(`${t3}
3520
3924
  `);
3521
3925
  }
@@ -3533,9 +3937,9 @@ var require_build4 = __commonJS({
3533
3937
  }, n2.functionDescription = (t3) => ["(", t3.name ? s2.Parser.decamelize(t3.name, "-") : i2("generated-value"), ")"].join(""), n2.stringifiedValues = function(t3, e2) {
3534
3938
  let s3 = "";
3535
3939
  const i3 = e2 || ", ", n3 = [].concat(t3);
3536
- return t3 && n3.length ? (n3.forEach((t4) => {
3940
+ return t3 && n3.length ? (n3.forEach(((t4) => {
3537
3941
  s3.length && (s3 += i3), s3 += JSON.stringify(t4);
3538
- }), s3) : s3;
3942
+ })), s3) : s3;
3539
3943
  };
3540
3944
  let M2 = null;
3541
3945
  n2.version = (t3) => {
@@ -3545,7 +3949,7 @@ var require_build4 = __commonJS({
3545
3949
  e2 || (e2 = "error");
3546
3950
  ("function" == typeof e2 ? e2 : s3[e2])(M2);
3547
3951
  }, n2.reset = function(t3) {
3548
- return o2 = null, l2 = false, c2 = [], f2 = false, m2 = [], d2 = [], u2 = [], p2 = g(p2, (e2) => !t3[e2]), n2;
3952
+ return o2 = null, l2 = false, c2 = [], f2 = false, m2 = [], d2 = [], u2 = [], p2 = g(p2, ((e2) => !t3[e2])), n2;
3549
3953
  };
3550
3954
  const _2 = [];
3551
3955
  return n2.freeze = function() {
@@ -3584,27 +3988,27 @@ var require_build4 = __commonJS({
3584
3988
  }
3585
3989
  commandCompletions(t2, e2, s2) {
3586
3990
  const i2 = this.yargs.getInternalMethods().getContext().commands;
3587
- s2.match(/^-/) || i2[i2.length - 1] === s2 || this.previousArgHasChoices(e2) || this.usage.getCommands().forEach((s3) => {
3991
+ s2.match(/^-/) || i2[i2.length - 1] === s2 || this.previousArgHasChoices(e2) || this.usage.getCommands().forEach(((s3) => {
3588
3992
  const i3 = o(s3[0]).cmd;
3589
3993
  if (-1 === e2.indexOf(i3)) if (this.zshShell) {
3590
3994
  const e3 = s3[1] || "";
3591
3995
  t2.push(i3.replace(/:/g, "\\:") + ":" + e3);
3592
3996
  } else t2.push(i3);
3593
- });
3997
+ }));
3594
3998
  }
3595
3999
  optionCompletions(t2, e2, s2, i2) {
3596
4000
  if ((i2.match(/^-/) || "" === i2 && 0 === t2.length) && !this.previousArgHasChoices(e2)) {
3597
4001
  const s3 = this.yargs.getOptions(), n2 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
3598
- Object.keys(s3.key).forEach((r2) => {
4002
+ Object.keys(s3.key).forEach(((r2) => {
3599
4003
  const o2 = !!s3.configuration["boolean-negation"] && s3.boolean.includes(r2);
3600
4004
  n2.includes(r2) || s3.hiddenOptions.includes(r2) || this.argsContainKey(e2, r2, o2) || this.completeOptionKey(r2, t2, i2, o2 && !!s3.default[r2]);
3601
- });
4005
+ }));
3602
4006
  }
3603
4007
  }
3604
4008
  choicesFromOptionsCompletions(t2, e2, s2, i2) {
3605
4009
  if (this.previousArgHasChoices(e2)) {
3606
4010
  const s3 = this.getPreviousArgChoices(e2);
3607
- s3 && s3.length > 0 && t2.push(...s3.map((t3) => t3.replace(/:/g, "\\:")));
4011
+ s3 && s3.length > 0 && t2.push(...s3.map(((t3) => t3.replace(/:/g, "\\:"))));
3608
4012
  }
3609
4013
  }
3610
4014
  choicesFromPositionalsCompletions(t2, e2, s2, i2) {
@@ -3624,7 +4028,7 @@ var require_build4 = __commonJS({
3624
4028
  o2 = n2.choices[t3];
3625
4029
  break;
3626
4030
  }
3627
- return o2 ? o2.filter((t3) => !s2 || t3.startsWith(s2)) : void 0;
4031
+ return o2 ? o2.filter(((t3) => !s2 || t3.startsWith(s2))) : void 0;
3628
4032
  }
3629
4033
  previousArgHasChoices(t2) {
3630
4034
  const e2 = this.getPreviousArgChoices(t2);
@@ -3643,10 +4047,10 @@ var require_build4 = __commonJS({
3643
4047
  var n2, r2, o2, a2;
3644
4048
  let h2 = t2;
3645
4049
  if (this.zshShell) {
3646
- const e3 = this.usage.getDescriptions(), s3 = null === (r2 = null === (n2 = null == this ? void 0 : this.aliases) || void 0 === n2 ? void 0 : n2[t2]) || void 0 === r2 ? void 0 : r2.find((t3) => {
4050
+ const e3 = this.usage.getDescriptions(), s3 = null === (r2 = null === (n2 = null == this ? void 0 : this.aliases) || void 0 === n2 ? void 0 : n2[t2]) || void 0 === r2 ? void 0 : r2.find(((t3) => {
3647
4051
  const s4 = e3[t3];
3648
4052
  return "string" == typeof s4 && s4.length > 0;
3649
- }), i3 = s3 ? e3[s3] : void 0, l3 = null !== (a2 = null !== (o2 = e3[t2]) && void 0 !== o2 ? o2 : i3) && void 0 !== a2 ? a2 : "";
4053
+ })), i3 = s3 ? e3[s3] : void 0, l3 = null !== (a2 = null !== (o2 = e3[t2]) && void 0 !== o2 ? o2 : i3) && void 0 !== a2 ? a2 : "";
3650
4054
  h2 = `${t2.replace(/:/g, "\\:")}:${l3.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
3651
4055
  }
3652
4056
  const l2 = !/^--/.test(s2) && ((t3) => /^[^0-9]$/.test(t3))(t2) ? "-" : "--";
@@ -3655,23 +4059,23 @@ var require_build4 = __commonJS({
3655
4059
  customCompletion(t2, e2, s2, i2) {
3656
4060
  if (d(this.customCompletionFunction, null, this.shim), this.customCompletionFunction.length < 3) {
3657
4061
  const t3 = this.customCompletionFunction(s2, e2);
3658
- return f(t3) ? t3.then((t4) => {
3659
- this.shim.process.nextTick(() => {
4062
+ return f(t3) ? t3.then(((t4) => {
4063
+ this.shim.process.nextTick((() => {
3660
4064
  i2(null, t4);
3661
- });
3662
- }).catch((t4) => {
3663
- this.shim.process.nextTick(() => {
4065
+ }));
4066
+ })).catch(((t4) => {
4067
+ this.shim.process.nextTick((() => {
3664
4068
  i2(t4, void 0);
3665
- });
3666
- }) : i2(null, t3);
4069
+ }));
4070
+ })) : i2(null, t3);
3667
4071
  }
3668
- return function(t3) {
4072
+ return (function(t3) {
3669
4073
  return t3.length > 3;
3670
- }(this.customCompletionFunction) ? this.customCompletionFunction(s2, e2, (n2 = i2) => this.defaultCompletion(t2, e2, s2, n2), (t3) => {
4074
+ })(this.customCompletionFunction) ? this.customCompletionFunction(s2, e2, ((n2 = i2) => this.defaultCompletion(t2, e2, s2, n2)), ((t3) => {
3671
4075
  i2(null, t3);
3672
- }) : this.customCompletionFunction(s2, e2, (t3) => {
4076
+ })) : this.customCompletionFunction(s2, e2, ((t3) => {
3673
4077
  i2(null, t3);
3674
- });
4078
+ }));
3675
4079
  }
3676
4080
  getCompletion(t2, e2) {
3677
4081
  const s2 = t2.length ? t2[t2.length - 1] : "", i2 = this.yargs.parse(t2, true), n2 = this.customCompletionFunction ? (i3) => this.customCompletion(t2, i3, s2, e2) : (i3) => this.defaultCompletion(t2, i3, s2, e2);
@@ -3818,7 +4222,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3818
4222
  return h("<array|string>", [t2], arguments.length), this[Pt]("boolean", t2), this[Qt](t2), this;
3819
4223
  }
3820
4224
  check(t2, e2) {
3821
- return h("<function> [boolean]", [t2, e2], arguments.length), this.middleware((e3, s2) => j(() => t2(e3, s2.getOptions()), (s3) => (s3 ? ("string" == typeof s3 || s3 instanceof Error) && v(this, pt, "f").fail(s3.toString(), s3) : v(this, pt, "f").fail(v(this, ct, "f").y18n.__("Argument check failed: %s", t2.toString())), e3), (t3) => (v(this, pt, "f").fail(t3.message ? t3.message : t3.toString(), t3), e3)), false, e2), this;
4225
+ return h("<function> [boolean]", [t2, e2], arguments.length), this.middleware(((e3, s2) => j((() => t2(e3, s2.getOptions())), ((s3) => (s3 ? ("string" == typeof s3 || s3 instanceof Error) && v(this, pt, "f").fail(s3.toString(), s3) : v(this, pt, "f").fail(v(this, ct, "f").y18n.__("Argument check failed: %s", t2.toString())), e3)), ((t3) => (v(this, pt, "f").fail(t3.message ? t3.message : t3.toString(), t3), e3)))), false, e2), this;
3822
4226
  }
3823
4227
  choices(t2, e2) {
3824
4228
  return h("<object|string|array> [string|array]", [t2, e2], arguments.length), this[$t](this.choices.bind(this), "choices", t2, e2), this;
@@ -3834,25 +4238,25 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3834
4238
  return this;
3835
4239
  }
3836
4240
  if (!s2) throw new e("coerce callback must be provided");
3837
- return v(this, et, "f").key[t2] = true, v(this, Y, "f").addCoerceMiddleware((i2, n2) => {
4241
+ return v(this, et, "f").key[t2] = true, v(this, Y, "f").addCoerceMiddleware(((i2, n2) => {
3838
4242
  let r2;
3839
- return Object.prototype.hasOwnProperty.call(i2, t2) ? j(() => (r2 = n2.getAliases(), s2(i2[t2])), (e2) => {
4243
+ return Object.prototype.hasOwnProperty.call(i2, t2) ? j((() => (r2 = n2.getAliases(), s2(i2[t2]))), ((e2) => {
3840
4244
  i2[t2] = e2;
3841
4245
  const s3 = n2.getInternalMethods().getParserConfiguration()["strip-aliased"];
3842
4246
  if (r2[t2] && true !== s3) for (const s4 of r2[t2]) i2[s4] = e2;
3843
4247
  return i2;
3844
- }, (t3) => {
4248
+ }), ((t3) => {
3845
4249
  throw new e(t3.message);
3846
- }) : i2;
3847
- }, t2), this;
4250
+ })) : i2;
4251
+ }), t2), this;
3848
4252
  }
3849
4253
  conflicts(t2, e2) {
3850
4254
  return h("<string|object> [string|array]", [t2, e2], arguments.length), v(this, yt, "f").conflicts(t2, e2), this;
3851
4255
  }
3852
4256
  config(t2 = "config", e2, s2) {
3853
- return h("[object|string] [string|function] [function]", [t2, e2, s2], arguments.length), "object" != typeof t2 || Array.isArray(t2) ? ("function" == typeof e2 && (s2 = e2, e2 = void 0), this.describe(t2, e2 || v(this, pt, "f").deferY18nLookup("Path to JSON config file")), (Array.isArray(t2) ? t2 : [t2]).forEach((t3) => {
4257
+ return h("[object|string] [string|function] [function]", [t2, e2, s2], arguments.length), "object" != typeof t2 || Array.isArray(t2) ? ("function" == typeof e2 && (s2 = e2, e2 = void 0), this.describe(t2, e2 || v(this, pt, "f").deferY18nLookup("Path to JSON config file")), (Array.isArray(t2) ? t2 : [t2]).forEach(((t3) => {
3854
4258
  v(this, et, "f").config[t3] = s2 || true;
3855
- }), this) : (t2 = n(t2, v(this, W, "f"), this[Mt]()["deep-merge-config"] || false, v(this, ct, "f")), v(this, et, "f").configObjects = (v(this, et, "f").configObjects || []).concat(t2), this);
4259
+ })), this) : (t2 = n(t2, v(this, W, "f"), this[Mt]()["deep-merge-config"] || false, v(this, ct, "f")), v(this, et, "f").configObjects = (v(this, et, "f").configObjects || []).concat(t2), this);
3856
4260
  }
3857
4261
  completion(t2, e2, s2) {
3858
4262
  return h("[string] [string|boolean|function] [function]", [t2, e2, s2], arguments.length), "function" == typeof e2 && (s2 = e2, e2 = void 0), O(this, F, t2 || v(this, F, "f") || "completion", "f"), e2 || false === e2 || (e2 = "generate completion script"), this.command(v(this, F, "f"), e2), s2 && v(this, U, "f").registerFunction(s2), this;
@@ -3881,11 +4285,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3881
4285
  return h("[number] [number|string] [string|null|undefined] [string|null|undefined]", [t2, e2, s2, i2], arguments.length), "number" != typeof e2 && (s2 = e2, e2 = 1 / 0), this.global("_", false), v(this, et, "f").demandedCommands._ = { min: t2, max: e2, minMsg: s2, maxMsg: i2 }, this;
3882
4286
  }
3883
4287
  demand(t2, e2, s2) {
3884
- return Array.isArray(e2) ? (e2.forEach((t3) => {
4288
+ return Array.isArray(e2) ? (e2.forEach(((t3) => {
3885
4289
  d(s2, true, v(this, ct, "f")), this.demandOption(t3, s2);
3886
- }), e2 = 1 / 0) : "number" != typeof e2 && (s2 = e2, e2 = 1 / 0), "number" == typeof t2 ? (d(s2, true, v(this, ct, "f")), this.demandCommand(t2, e2, s2, s2)) : Array.isArray(t2) ? t2.forEach((t3) => {
4290
+ })), e2 = 1 / 0) : "number" != typeof e2 && (s2 = e2, e2 = 1 / 0), "number" == typeof t2 ? (d(s2, true, v(this, ct, "f")), this.demandCommand(t2, e2, s2, s2)) : Array.isArray(t2) ? t2.forEach(((t3) => {
3887
4291
  d(s2, true, v(this, ct, "f")), this.demandOption(t3, s2);
3888
- }) : "string" == typeof s2 ? this.demandOption(t2, s2) : true !== s2 && void 0 !== s2 || this.demandOption(t2), this;
4292
+ })) : "string" == typeof s2 ? this.demandOption(t2, s2) : true !== s2 && void 0 !== s2 || this.demandOption(t2), this;
3889
4293
  }
3890
4294
  demandOption(t2, e2) {
3891
4295
  return h("<object|string|array> [string]", [t2, e2], arguments.length), this[St](this.demandOption.bind(this), "demandedOptions", t2, e2), this;
@@ -3909,7 +4313,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3909
4313
  return this.epilogue(t2);
3910
4314
  }
3911
4315
  example(t2, e2) {
3912
- return h("<string|array> [string]", [t2, e2], arguments.length), Array.isArray(t2) ? t2.forEach((t3) => this.example(...t3)) : v(this, pt, "f").example(t2, e2), this;
4316
+ return h("<string|array> [string]", [t2, e2], arguments.length), Array.isArray(t2) ? t2.forEach(((t3) => this.example(...t3))) : v(this, pt, "f").example(t2, e2), this;
3913
4317
  }
3914
4318
  exit(t2, e2) {
3915
4319
  O(this, J, true, "f"), O(this, V, e2, "f"), v(this, T, "f") && v(this, ct, "f").process.exit(t2);
@@ -3925,11 +4329,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3925
4329
  return this.parsed ? this.parsed.aliases : {};
3926
4330
  }
3927
4331
  async getCompletion(t2, e2) {
3928
- return h("<array> [function]", [t2, e2], arguments.length), e2 ? v(this, U, "f").getCompletion(t2, e2) : new Promise((e3, s2) => {
3929
- v(this, U, "f").getCompletion(t2, (t3, i2) => {
4332
+ return h("<array> [function]", [t2, e2], arguments.length), e2 ? v(this, U, "f").getCompletion(t2, e2) : new Promise(((e3, s2) => {
4333
+ v(this, U, "f").getCompletion(t2, ((t3, i2) => {
3930
4334
  t3 ? s2(t3) : e3(i2);
3931
- });
3932
- });
4335
+ }));
4336
+ }));
3933
4337
  }
3934
4338
  getDemandedOptions() {
3935
4339
  return h([], 0), v(this, et, "f").demandedOptions;
@@ -3953,10 +4357,10 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3953
4357
  if (O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) {
3954
4358
  if (!this.parsed) {
3955
4359
  const t3 = this[Jt](v(this, ht, "f"), void 0, void 0, 0, true);
3956
- if (f(t3)) return t3.then(() => v(this, pt, "f").help());
4360
+ if (f(t3)) return t3.then((() => v(this, pt, "f").help()));
3957
4361
  }
3958
4362
  const t2 = v(this, z, "f").runDefaultBuilderOn(this);
3959
- if (f(t2)) return t2.then(() => v(this, pt, "f").help());
4363
+ if (f(t2)) return t2.then((() => v(this, pt, "f").help()));
3960
4364
  }
3961
4365
  return Promise.resolve(v(this, pt, "f").help());
3962
4366
  }
@@ -3973,16 +4377,16 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
3973
4377
  return v(this, ut, "f");
3974
4378
  }
3975
4379
  global(t2, e2) {
3976
- return h("<string|array> [boolean]", [t2, e2], arguments.length), t2 = [].concat(t2), false !== e2 ? v(this, et, "f").local = v(this, et, "f").local.filter((e3) => -1 === t2.indexOf(e3)) : t2.forEach((t3) => {
4380
+ return h("<string|array> [boolean]", [t2, e2], arguments.length), t2 = [].concat(t2), false !== e2 ? v(this, et, "f").local = v(this, et, "f").local.filter(((e3) => -1 === t2.indexOf(e3))) : t2.forEach(((t3) => {
3977
4381
  v(this, et, "f").local.includes(t3) || v(this, et, "f").local.push(t3);
3978
- }), this;
4382
+ })), this;
3979
4383
  }
3980
4384
  group(t2, e2) {
3981
4385
  h("<string|array> <string>", [t2, e2], arguments.length);
3982
4386
  const s2 = v(this, at, "f")[e2] || v(this, K, "f")[e2];
3983
4387
  v(this, at, "f")[e2] && delete v(this, at, "f")[e2];
3984
4388
  const i2 = {};
3985
- return v(this, K, "f")[e2] = (s2 || []).concat(t2).filter((t3) => !i2[t3] && (i2[t3] = true)), this;
4389
+ return v(this, K, "f")[e2] = (s2 || []).concat(t2).filter(((t3) => !i2[t3] && (i2[t3] = true))), this;
3986
4390
  }
3987
4391
  hide(t2) {
3988
4392
  return h("<string>", [t2], arguments.length), v(this, et, "f").hiddenOptions.push(t2), this;
@@ -4006,9 +4410,9 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4006
4410
  return h("<array|string>", [t2], arguments.length), this[Pt]("number", t2), this[Qt](t2), this;
4007
4411
  }
4008
4412
  option(t2, e2) {
4009
- if (h("<string|object> [object]", [t2, e2], arguments.length), "object" == typeof t2) Object.keys(t2).forEach((e3) => {
4413
+ if (h("<string|object> [object]", [t2, e2], arguments.length), "object" == typeof t2) Object.keys(t2).forEach(((e3) => {
4010
4414
  this.options(e3, t2[e3]);
4011
- });
4415
+ }));
4012
4416
  else {
4013
4417
  "object" != typeof e2 && (e2 = {}), this[Qt](t2), !v(this, mt, "f") || "version" !== t2 && "version" !== (null == e2 ? void 0 : e2.alias) || this[wt](['"version" is a reserved word.', "Please do one of the following:", '- Disable version with `yargs.version(false)` if using "version" as an option', "- Use the built-in `yargs.version` method instead (if applicable)", "- Use a different option key", "https://yargs.js.org/docs/#api-reference-version"].join("\n"), void 0, "versionWarning"), v(this, et, "f").key[t2] = true, e2.alias && this.alias(t2, e2.alias);
4014
4418
  const s2 = e2.deprecate || e2.deprecated;
@@ -4026,11 +4430,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4026
4430
  parse(t2, e2, s2) {
4027
4431
  h("[string|array] [function|boolean|object] [function]", [t2, e2, s2], arguments.length), this[Ct](), void 0 === t2 && (t2 = v(this, ht, "f")), "object" == typeof e2 && (O(this, rt, e2, "f"), e2 = s2), "function" == typeof e2 && (O(this, nt, e2, "f"), e2 = false), e2 || O(this, ht, t2, "f"), v(this, nt, "f") && O(this, T, false, "f");
4028
4432
  const i2 = this[Jt](t2, !!e2), n2 = this.parsed;
4029
- return v(this, U, "f").setParsed(this.parsed), f(i2) ? i2.then((t3) => (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), t3, v(this, tt, "f")), t3)).catch((t3) => {
4433
+ return v(this, U, "f").setParsed(this.parsed), f(i2) ? i2.then(((t3) => (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), t3, v(this, tt, "f")), t3))).catch(((t3) => {
4030
4434
  throw v(this, nt, "f") && v(this, nt, "f")(t3, this.parsed.argv, v(this, tt, "f")), t3;
4031
- }).finally(() => {
4435
+ })).finally((() => {
4032
4436
  this[Ht](), this.parsed = n2;
4033
- }) : (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), i2, v(this, tt, "f")), this[Ht](), this.parsed = n2, i2);
4437
+ })) : (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), i2, v(this, tt, "f")), this[Ht](), this.parsed = n2, i2);
4034
4438
  }
4035
4439
  parseAsync(t2, e2, s2) {
4036
4440
  const i2 = this.parse(t2, e2, s2);
@@ -4053,12 +4457,12 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4053
4457
  positional(t2, e2) {
4054
4458
  h("<string> <object>", [t2, e2], arguments.length);
4055
4459
  const s2 = ["default", "defaultDescription", "implies", "normalize", "choices", "conflicts", "coerce", "type", "describe", "desc", "description", "alias"];
4056
- e2 = g(e2, (t3, e3) => !("type" === t3 && !["string", "number", "boolean"].includes(e3)) && s2.includes(t3));
4460
+ e2 = g(e2, ((t3, e3) => !("type" === t3 && !["string", "number", "boolean"].includes(e3)) && s2.includes(t3)));
4057
4461
  const i2 = v(this, q, "f").fullCommands[v(this, q, "f").fullCommands.length - 1], n2 = i2 ? v(this, z, "f").cmdToParseOptions(i2) : { array: [], alias: {}, default: {}, demand: {} };
4058
- return p(n2).forEach((s3) => {
4462
+ return p(n2).forEach(((s3) => {
4059
4463
  const i3 = n2[s3];
4060
4464
  Array.isArray(i3) ? -1 !== i3.indexOf(t2) && (e2[s3] = true) : i3[t2] && !(s3 in e2) && (e2[s3] = i3[t2]);
4061
- }), this.group(t2, v(this, pt, "f").getPositionalGroupName()), this.option(t2, e2);
4465
+ })), this.group(t2, v(this, pt, "f").getPositionalGroupName()), this.option(t2, e2);
4062
4466
  }
4063
4467
  recommendCommands(t2 = true) {
4064
4468
  return h("[boolean]", [t2], arguments.length), O(this, lt, t2, "f"), this;
@@ -4079,14 +4483,14 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4079
4483
  if (h("[string|function]", [t2], arguments.length), O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) {
4080
4484
  if (!this.parsed) {
4081
4485
  const e3 = this[Jt](v(this, ht, "f"), void 0, void 0, 0, true);
4082
- if (f(e3)) return e3.then(() => {
4486
+ if (f(e3)) return e3.then((() => {
4083
4487
  v(this, pt, "f").showHelp(t2);
4084
- }), this;
4488
+ })), this;
4085
4489
  }
4086
4490
  const e2 = v(this, z, "f").runDefaultBuilderOn(this);
4087
- if (f(e2)) return e2.then(() => {
4491
+ if (f(e2)) return e2.then((() => {
4088
4492
  v(this, pt, "f").showHelp(t2);
4089
- }), this;
4493
+ })), this;
4090
4494
  }
4091
4495
  return v(this, pt, "f").showHelp(t2), this;
4092
4496
  }
@@ -4162,11 +4566,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4162
4566
  } };
4163
4567
  }
4164
4568
  [Ot](t2) {
4165
- p(v(this, et, "f")).forEach((e2) => {
4569
+ p(v(this, et, "f")).forEach(((e2) => {
4166
4570
  if ("configObjects" === e2) return;
4167
4571
  const s2 = v(this, et, "f")[e2];
4168
4572
  Array.isArray(s2) ? s2.includes(t2) && s2.splice(s2.indexOf(t2), 1) : "object" == typeof s2 && delete s2[t2];
4169
- }), delete v(this, pt, "f").getDescriptions()[t2];
4573
+ })), delete v(this, pt, "f").getDescriptions()[t2];
4170
4574
  }
4171
4575
  [wt](t2, e2, s2) {
4172
4576
  v(this, R, "f")[s2] || (v(this, ct, "f").process.emitWarning(t2, e2), v(this, R, "f")[s2] = true);
@@ -4176,10 +4580,10 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4176
4580
  }
4177
4581
  [jt]() {
4178
4582
  let t2, e2 = "";
4179
- return t2 = /\b(node|iojs|electron)(\.exe)?$/.test(v(this, ct, "f").process.argv()[0]) ? v(this, ct, "f").process.argv().slice(1, 2) : v(this, ct, "f").process.argv().slice(0, 1), e2 = t2.map((t3) => {
4583
+ return t2 = /\b(node|iojs|electron)(\.exe)?$/.test(v(this, ct, "f").process.argv()[0]) ? v(this, ct, "f").process.argv().slice(1, 2) : v(this, ct, "f").process.argv().slice(0, 1), e2 = t2.map(((t3) => {
4180
4584
  const e3 = this[Yt](v(this, W, "f"), t3);
4181
4585
  return t3.match(/^(\/|([a-zA-Z]:)?\\)/) && e3.length < t3.length ? e3 : t3;
4182
- }).join(" ").trim(), v(this, ct, "f").getEnv("_") && v(this, ct, "f").getProcessArgvBin() === v(this, ct, "f").getEnv("_") && (e2 = v(this, ct, "f").getEnv("_").replace(`${v(this, ct, "f").path.dirname(v(this, ct, "f").process.execPath())}/`, "")), e2;
4586
+ })).join(" ").trim(), v(this, ct, "f").getEnv("_") && v(this, ct, "f").getProcessArgvBin() === v(this, ct, "f").getEnv("_") && (e2 = v(this, ct, "f").getEnv("_").replace(`${v(this, ct, "f").path.dirname(v(this, ct, "f").process.execPath())}/`, "")), e2;
4183
4587
  }
4184
4588
  [Mt]() {
4185
4589
  return v(this, it, "f");
@@ -4207,31 +4611,31 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4207
4611
  try {
4208
4612
  let e3 = t2 || v(this, ct, "f").mainFilename;
4209
4613
  !t2 && v(this, ct, "f").path.extname(e3) && (e3 = v(this, ct, "f").path.dirname(e3));
4210
- const i2 = v(this, ct, "f").findUp(e3, (t3, e4) => e4.includes("package.json") ? "package.json" : void 0);
4614
+ const i2 = v(this, ct, "f").findUp(e3, ((t3, e4) => e4.includes("package.json") ? "package.json" : void 0));
4211
4615
  d(i2, void 0, v(this, ct, "f")), s2 = JSON.parse(v(this, ct, "f").readFileSync(i2, "utf8"));
4212
4616
  } catch (t3) {
4213
4617
  }
4214
4618
  return v(this, ot, "f")[e2] = s2 || {}, v(this, ot, "f")[e2];
4215
4619
  }
4216
4620
  [Pt](t2, e2) {
4217
- (e2 = [].concat(e2)).forEach((e3) => {
4621
+ (e2 = [].concat(e2)).forEach(((e3) => {
4218
4622
  e3 = this[Dt](e3), v(this, et, "f")[t2].push(e3);
4219
- });
4623
+ }));
4220
4624
  }
4221
4625
  [St](t2, e2, s2, i2) {
4222
- this[It](t2, e2, s2, i2, (t3, e3, s3) => {
4626
+ this[It](t2, e2, s2, i2, ((t3, e3, s3) => {
4223
4627
  v(this, et, "f")[t3][e3] = s3;
4224
- });
4628
+ }));
4225
4629
  }
4226
4630
  [$t](t2, e2, s2, i2) {
4227
- this[It](t2, e2, s2, i2, (t3, e3, s3) => {
4631
+ this[It](t2, e2, s2, i2, ((t3, e3, s3) => {
4228
4632
  v(this, et, "f")[t3][e3] = (v(this, et, "f")[t3][e3] || []).concat(s3);
4229
- });
4633
+ }));
4230
4634
  }
4231
4635
  [It](t2, e2, s2, i2, n2) {
4232
- if (Array.isArray(s2)) s2.forEach((e3) => {
4636
+ if (Array.isArray(s2)) s2.forEach(((e3) => {
4233
4637
  t2(e3, i2);
4234
- });
4638
+ }));
4235
4639
  else if (/* @__PURE__ */ ((t3) => "object" == typeof t3)(s2)) for (const e3 of p(s2)) t2(e3, s2[e3]);
4236
4640
  else n2(e2, this[Dt](s2), i2);
4237
4641
  }
@@ -4272,7 +4676,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4272
4676
  } }.value } = u2, v(this, et, "f").configObjects = p2, v(this, pt, "f").unfreeze(), v(this, yt, "f").unfreeze(), v(this, z, "f").unfreeze(), v(this, Y, "f").unfreeze();
4273
4677
  }
4274
4678
  [zt](t2, e2) {
4275
- return j(e2, (e3) => (t2(e3), e3));
4679
+ return j(e2, ((e3) => (t2(e3), e3)));
4276
4680
  }
4277
4681
  getInternalMethods() {
4278
4682
  return { getCommandInstance: this[Wt].bind(this), getContext: this[qt].bind(this), getHasOutput: this[Ut].bind(this), getLoggerInstance: this[Ft].bind(this), getParseContext: this[Lt].bind(this), getParserConfiguration: this[Mt].bind(this), getUsageConfiguration: this[_t].bind(this), getUsageInstance: this[Vt].bind(this), getValidationInstance: this[Gt].bind(this), hasParseCallback: this[Rt].bind(this), isGlobalContext: this[Tt].bind(this), postProcess: this[Bt].bind(this), reset: this[Kt].bind(this), runValidation: this[Zt].bind(this), runYargsParserAndExecuteCommands: this[Jt].bind(this), setHasOutput: this[Xt].bind(this) };
@@ -4315,19 +4719,19 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
4315
4719
  const e2 = {};
4316
4720
  e2.local = v(this, et, "f").local || [], e2.configObjects = v(this, et, "f").configObjects || [];
4317
4721
  const s2 = {};
4318
- e2.local.forEach((e3) => {
4319
- s2[e3] = true, (t2[e3] || []).forEach((t3) => {
4722
+ e2.local.forEach(((e3) => {
4723
+ s2[e3] = true, (t2[e3] || []).forEach(((t3) => {
4320
4724
  s2[t3] = true;
4321
- });
4322
- }), Object.assign(v(this, at, "f"), Object.keys(v(this, K, "f")).reduce((t3, e3) => {
4323
- const i2 = v(this, K, "f")[e3].filter((t4) => !(t4 in s2));
4725
+ }));
4726
+ })), Object.assign(v(this, at, "f"), Object.keys(v(this, K, "f")).reduce(((t3, e3) => {
4727
+ const i2 = v(this, K, "f")[e3].filter(((t4) => !(t4 in s2)));
4324
4728
  return i2.length > 0 && (t3[e3] = i2), t3;
4325
- }, {})), O(this, K, {}, "f");
4326
- return ["array", "boolean", "string", "skipValidation", "count", "normalize", "number", "hiddenOptions"].forEach((t3) => {
4327
- e2[t3] = (v(this, et, "f")[t3] || []).filter((t4) => !s2[t4]);
4328
- }), ["narg", "key", "alias", "default", "defaultDescription", "config", "choices", "demandedOptions", "demandedCommands", "deprecatedOptions"].forEach((t3) => {
4329
- e2[t3] = g(v(this, et, "f")[t3], (t4) => !s2[t4]);
4330
- }), e2.envPrefix = v(this, et, "f").envPrefix, O(this, et, e2, "f"), O(this, pt, v(this, pt, "f") ? v(this, pt, "f").reset(s2) : P(this, v(this, ct, "f")), "f"), O(this, yt, v(this, yt, "f") ? v(this, yt, "f").reset(s2) : function(t3, e3, s3) {
4729
+ }), {})), O(this, K, {}, "f");
4730
+ return ["array", "boolean", "string", "skipValidation", "count", "normalize", "number", "hiddenOptions"].forEach(((t3) => {
4731
+ e2[t3] = (v(this, et, "f")[t3] || []).filter(((t4) => !s2[t4]));
4732
+ })), ["narg", "key", "alias", "default", "defaultDescription", "config", "choices", "demandedOptions", "demandedCommands", "deprecatedOptions"].forEach(((t3) => {
4733
+ e2[t3] = g(v(this, et, "f")[t3], ((t4) => !s2[t4]));
4734
+ })), e2.envPrefix = v(this, et, "f").envPrefix, O(this, et, e2, "f"), O(this, pt, v(this, pt, "f") ? v(this, pt, "f").reset(s2) : P(this, v(this, ct, "f")), "f"), O(this, yt, v(this, yt, "f") ? v(this, yt, "f").reset(s2) : (function(t3, e3, s3) {
4331
4735
  const i2 = s3.y18n.__, n2 = s3.y18n.__n, r2 = { nonOptionCount: function(s4) {
4332
4736
  const i3 = t3.getDemandedCommands(), r3 = s4._.length + (s4["--"] ? s4["--"].length : 0) - t3.getInternalMethods().getContext().commands.length;
4333
4737
  i3._ && (r3 < i3._.min || r3 > i3._.max) && (r3 < i3._.min ? void 0 !== i3._.minMsg ? e3.fail(i3._.minMsg ? i3._.minMsg.replace(/\$0/g, r3.toString()).replace(/\$1/, i3._.min.toString()) : null) : e3.fail(n2("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", r3, r3.toString(), i3._.min.toString())) : r3 > i3._.max && (void 0 !== i3._.maxMsg ? e3.fail(i3._.maxMsg ? i3._.maxMsg.replace(/\$0/g, r3.toString()).replace(/\$1/, i3._.max.toString()) : null) : e3.fail(n2("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", r3, r3.toString(), i3._.max.toString()))));
@@ -4349,41 +4753,41 @@ ${t5.join("\n")}` : "";
4349
4753
  }, unknownArguments: function(s4, i3, o3, a3, h2 = true) {
4350
4754
  var l3;
4351
4755
  const c3 = t3.getInternalMethods().getCommandInstance().getCommands(), f2 = [], d2 = t3.getInternalMethods().getContext();
4352
- if (Object.keys(s4).forEach((e4) => {
4756
+ if (Object.keys(s4).forEach(((e4) => {
4353
4757
  H.includes(e4) || Object.prototype.hasOwnProperty.call(o3, e4) || Object.prototype.hasOwnProperty.call(t3.getInternalMethods().getParseContext(), e4) || r2.isValidAndSomeAliasIsNotNew(e4, i3) || f2.push(e4);
4354
- }), h2 && (d2.commands.length > 0 || c3.length > 0 || a3) && s4._.slice(d2.commands.length).forEach((t4) => {
4758
+ })), h2 && (d2.commands.length > 0 || c3.length > 0 || a3) && s4._.slice(d2.commands.length).forEach(((t4) => {
4355
4759
  c3.includes("" + t4) || f2.push("" + t4);
4356
- }), h2) {
4760
+ })), h2) {
4357
4761
  const e4 = (null === (l3 = t3.getDemandedCommands()._) || void 0 === l3 ? void 0 : l3.max) || 0, i4 = d2.commands.length + e4;
4358
- i4 < s4._.length && s4._.slice(i4).forEach((t4) => {
4762
+ i4 < s4._.length && s4._.slice(i4).forEach(((t4) => {
4359
4763
  t4 = String(t4), d2.commands.includes(t4) || f2.includes(t4) || f2.push(t4);
4360
- });
4764
+ }));
4361
4765
  }
4362
- f2.length && e3.fail(n2("Unknown argument: %s", "Unknown arguments: %s", f2.length, f2.map((t4) => t4.trim() ? t4 : `"${t4}"`).join(", ")));
4766
+ f2.length && e3.fail(n2("Unknown argument: %s", "Unknown arguments: %s", f2.length, f2.map(((t4) => t4.trim() ? t4 : `"${t4}"`)).join(", ")));
4363
4767
  }, unknownCommands: function(s4) {
4364
4768
  const i3 = t3.getInternalMethods().getCommandInstance().getCommands(), r3 = [], o3 = t3.getInternalMethods().getContext();
4365
- return (o3.commands.length > 0 || i3.length > 0) && s4._.slice(o3.commands.length).forEach((t4) => {
4769
+ return (o3.commands.length > 0 || i3.length > 0) && s4._.slice(o3.commands.length).forEach(((t4) => {
4366
4770
  i3.includes("" + t4) || r3.push("" + t4);
4367
- }), r3.length > 0 && (e3.fail(n2("Unknown command: %s", "Unknown commands: %s", r3.length, r3.join(", "))), true);
4771
+ })), r3.length > 0 && (e3.fail(n2("Unknown command: %s", "Unknown commands: %s", r3.length, r3.join(", "))), true);
4368
4772
  }, isValidAndSomeAliasIsNotNew: function(e4, s4) {
4369
4773
  if (!Object.prototype.hasOwnProperty.call(s4, e4)) return false;
4370
4774
  const i3 = t3.parsed.newAliases;
4371
- return [e4, ...s4[e4]].some((t4) => !Object.prototype.hasOwnProperty.call(i3, t4) || !i3[e4]);
4775
+ return [e4, ...s4[e4]].some(((t4) => !Object.prototype.hasOwnProperty.call(i3, t4) || !i3[e4]));
4372
4776
  }, limitedChoices: function(s4) {
4373
4777
  const n3 = t3.getOptions(), r3 = {};
4374
4778
  if (!Object.keys(n3.choices).length) return;
4375
- Object.keys(s4).forEach((t4) => {
4376
- -1 === H.indexOf(t4) && Object.prototype.hasOwnProperty.call(n3.choices, t4) && [].concat(s4[t4]).forEach((e4) => {
4779
+ Object.keys(s4).forEach(((t4) => {
4780
+ -1 === H.indexOf(t4) && Object.prototype.hasOwnProperty.call(n3.choices, t4) && [].concat(s4[t4]).forEach(((e4) => {
4377
4781
  -1 === n3.choices[t4].indexOf(e4) && void 0 !== e4 && (r3[t4] = (r3[t4] || []).concat(e4));
4378
- });
4379
- });
4782
+ }));
4783
+ }));
4380
4784
  const o3 = Object.keys(r3);
4381
4785
  if (!o3.length) return;
4382
4786
  let a3 = i2("Invalid values:");
4383
- o3.forEach((t4) => {
4787
+ o3.forEach(((t4) => {
4384
4788
  a3 += `
4385
4789
  ${i2("Argument: %s, Given: %s, Choices: %s", t4, e3.stringifiedValues(r3[t4]), e3.stringifiedValues(n3.choices[t4]))}`;
4386
- }), e3.fail(a3);
4790
+ })), e3.fail(a3);
4387
4791
  } };
4388
4792
  let o2 = {};
4389
4793
  function a2(t4, e4) {
@@ -4391,45 +4795,45 @@ ${t5.join("\n")}` : "";
4391
4795
  return "number" == typeof (e4 = isNaN(s4) ? e4 : s4) ? e4 = t4._.length >= e4 : e4.match(/^--no-.+/) ? (e4 = e4.match(/^--no-(.+)/)[1], e4 = !Object.prototype.hasOwnProperty.call(t4, e4)) : e4 = Object.prototype.hasOwnProperty.call(t4, e4), e4;
4392
4796
  }
4393
4797
  r2.implies = function(e4, i3) {
4394
- h("<string|object> [array|number|string]", [e4, i3], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach((t4) => {
4798
+ h("<string|object> [array|number|string]", [e4, i3], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach(((t4) => {
4395
4799
  r2.implies(t4, e4[t4]);
4396
- }) : (t3.global(e4), o2[e4] || (o2[e4] = []), Array.isArray(i3) ? i3.forEach((t4) => r2.implies(e4, t4)) : (d(i3, void 0, s3), o2[e4].push(i3)));
4800
+ })) : (t3.global(e4), o2[e4] || (o2[e4] = []), Array.isArray(i3) ? i3.forEach(((t4) => r2.implies(e4, t4))) : (d(i3, void 0, s3), o2[e4].push(i3)));
4397
4801
  }, r2.getImplied = function() {
4398
4802
  return o2;
4399
4803
  }, r2.implications = function(t4) {
4400
4804
  const s4 = [];
4401
- if (Object.keys(o2).forEach((e4) => {
4805
+ if (Object.keys(o2).forEach(((e4) => {
4402
4806
  const i3 = e4;
4403
- (o2[e4] || []).forEach((e5) => {
4807
+ (o2[e4] || []).forEach(((e5) => {
4404
4808
  let n3 = i3;
4405
4809
  const r3 = e5;
4406
4810
  n3 = a2(t4, n3), e5 = a2(t4, e5), n3 && !e5 && s4.push(` ${i3} -> ${r3}`);
4407
- });
4408
- }), s4.length) {
4811
+ }));
4812
+ })), s4.length) {
4409
4813
  let t5 = `${i2("Implications failed:")}
4410
4814
  `;
4411
- s4.forEach((e4) => {
4815
+ s4.forEach(((e4) => {
4412
4816
  t5 += e4;
4413
- }), e3.fail(t5);
4817
+ })), e3.fail(t5);
4414
4818
  }
4415
4819
  };
4416
4820
  let l2 = {};
4417
4821
  r2.conflicts = function(e4, s4) {
4418
- h("<string|object> [array|string]", [e4, s4], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach((t4) => {
4822
+ h("<string|object> [array|string]", [e4, s4], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach(((t4) => {
4419
4823
  r2.conflicts(t4, e4[t4]);
4420
- }) : (t3.global(e4), l2[e4] || (l2[e4] = []), Array.isArray(s4) ? s4.forEach((t4) => r2.conflicts(e4, t4)) : l2[e4].push(s4));
4824
+ })) : (t3.global(e4), l2[e4] || (l2[e4] = []), Array.isArray(s4) ? s4.forEach(((t4) => r2.conflicts(e4, t4))) : l2[e4].push(s4));
4421
4825
  }, r2.getConflicting = () => l2, r2.conflicting = function(n3) {
4422
- Object.keys(n3).forEach((t4) => {
4423
- l2[t4] && l2[t4].forEach((s4) => {
4826
+ Object.keys(n3).forEach(((t4) => {
4827
+ l2[t4] && l2[t4].forEach(((s4) => {
4424
4828
  s4 && void 0 !== n3[t4] && void 0 !== n3[s4] && e3.fail(i2("Arguments %s and %s are mutually exclusive", t4, s4));
4425
- });
4426
- }), t3.getInternalMethods().getParserConfiguration()["strip-dashed"] && Object.keys(l2).forEach((t4) => {
4427
- l2[t4].forEach((r3) => {
4829
+ }));
4830
+ })), t3.getInternalMethods().getParserConfiguration()["strip-dashed"] && Object.keys(l2).forEach(((t4) => {
4831
+ l2[t4].forEach(((r3) => {
4428
4832
  r3 && void 0 !== n3[s3.Parser.camelCase(t4)] && void 0 !== n3[s3.Parser.camelCase(r3)] && e3.fail(i2("Arguments %s and %s are mutually exclusive", t4, r3));
4429
- });
4430
- });
4833
+ }));
4834
+ }));
4431
4835
  }, r2.recommendCommands = function(t4, s4) {
4432
- s4 = s4.sort((t5, e4) => e4.length - t5.length);
4836
+ s4 = s4.sort(((t5, e4) => e4.length - t5.length));
4433
4837
  let n3 = null, r3 = 1 / 0;
4434
4838
  for (let e4, i3 = 0; void 0 !== (e4 = s4[i3]); i3++) {
4435
4839
  const s5 = N(t4, e4);
@@ -4437,7 +4841,7 @@ ${t5.join("\n")}` : "";
4437
4841
  }
4438
4842
  n3 && e3.fail(i2("Did you mean %s?", n3));
4439
4843
  }, r2.reset = function(t4) {
4440
- return o2 = g(o2, (e4) => !t4[e4]), l2 = g(l2, (e4) => !t4[e4]), r2;
4844
+ return o2 = g(o2, ((e4) => !t4[e4])), l2 = g(l2, ((e4) => !t4[e4])), r2;
4441
4845
  };
4442
4846
  const c2 = [];
4443
4847
  return r2.freeze = function() {
@@ -4446,11 +4850,11 @@ ${t5.join("\n")}` : "";
4446
4850
  const t4 = c2.pop();
4447
4851
  d(t4, void 0, s3), { implied: o2, conflicting: l2 } = t4;
4448
4852
  }, r2;
4449
- }(this, v(this, pt, "f"), v(this, ct, "f")), "f"), O(this, z, v(this, z, "f") ? v(this, z, "f").reset() : function(t3, e3, s3, i2) {
4853
+ })(this, v(this, pt, "f"), v(this, ct, "f")), "f"), O(this, z, v(this, z, "f") ? v(this, z, "f").reset() : (function(t3, e3, s3, i2) {
4450
4854
  return new _(t3, e3, s3, i2);
4451
- }(v(this, pt, "f"), v(this, yt, "f"), v(this, Y, "f"), v(this, ct, "f")), "f"), v(this, U, "f") || O(this, U, function(t3, e3, s3, i2) {
4855
+ })(v(this, pt, "f"), v(this, yt, "f"), v(this, Y, "f"), v(this, ct, "f")), "f"), v(this, U, "f") || O(this, U, (function(t3, e3, s3, i2) {
4452
4856
  return new D(t3, e3, s3, i2);
4453
- }(this, v(this, pt, "f"), v(this, z, "f"), v(this, ct, "f")), "f"), v(this, Y, "f").reset(), O(this, F, null, "f"), O(this, tt, "", "f"), O(this, V, null, "f"), O(this, J, false, "f"), this.parsed = false, this;
4857
+ })(this, v(this, pt, "f"), v(this, z, "f"), v(this, ct, "f")), "f"), v(this, Y, "f").reset(), O(this, F, null, "f"), O(this, tt, "", "f"), O(this, V, null, "f"), O(this, J, false, "f"), this.parsed = false, this;
4454
4858
  }
4455
4859
  [Yt](t2, e2) {
4456
4860
  return v(this, ct, "f").path.relative(t2, e2);
@@ -4462,13 +4866,13 @@ ${t5.join("\n")}` : "";
4462
4866
  let d2;
4463
4867
  const u2 = l2.aliases;
4464
4868
  let p2 = false, g2 = false;
4465
- Object.keys(c2).forEach((t3) => {
4869
+ Object.keys(c2).forEach(((t3) => {
4466
4870
  t3 === v(this, Z, "f") && c2[t3] ? p2 = true : t3 === v(this, mt, "f") && c2[t3] && (g2 = true);
4467
- }), c2.$0 = this.$0, this.parsed = l2, 0 === n2 && v(this, pt, "f").clearCachedHelpMessage();
4871
+ })), c2.$0 = this.$0, this.parsed = l2, 0 === n2 && v(this, pt, "f").clearCachedHelpMessage();
4468
4872
  try {
4469
4873
  if (this[kt](), s2) return this[Bt](c2, a2, !!i2, false);
4470
4874
  if (v(this, Z, "f")) {
4471
- [v(this, Z, "f")].concat(u2[v(this, Z, "f")] || []).filter((t3) => t3.length > 1).includes("" + c2._[c2._.length - 1]) && (c2._.pop(), p2 = true);
4875
+ [v(this, Z, "f")].concat(u2[v(this, Z, "f")] || []).filter(((t3) => t3.length > 1)).includes("" + c2._[c2._.length - 1]) && (c2._.pop(), p2 = true);
4472
4876
  }
4473
4877
  O(this, X, false, "f");
4474
4878
  const h3 = v(this, z, "f").getCommands(), m2 = v(this, U, "f").completionKey in c2, y2 = p2 || m2 || r2;
@@ -4489,432 +4893,72 @@ ${t5.join("\n")}` : "";
4489
4893
  }
4490
4894
  v(this, F, "f") && c2._.includes(v(this, F, "f")) && !m2 && (v(this, T, "f") && E(true), this.showCompletionScript(), this.exit(0));
4491
4895
  }
4492
- if (v(this, z, "f").hasDefaultCommand() && !y2) {
4493
- const t3 = v(this, z, "f").runCommand(null, this, l2, 0, r2, p2 || g2 || r2);
4494
- return this[Bt](t3, a2, !!i2, false);
4495
- }
4496
- if (m2) {
4497
- v(this, T, "f") && E(true);
4498
- const s3 = (t2 = [].concat(t2)).slice(t2.indexOf(`--${v(this, U, "f").completionKey}`) + 1);
4499
- return v(this, U, "f").getCompletion(s3, (t3, s4) => {
4500
- if (t3) throw new e(t3.message);
4501
- (s4 || []).forEach((t4) => {
4502
- v(this, Q, "f").log(t4);
4503
- }), this.exit(0);
4504
- }), this[Bt](c2, !a2, !!i2, false);
4505
- }
4506
- if (v(this, J, "f") || (p2 ? (v(this, T, "f") && E(true), o2 = true, this.showHelp("log"), this.exit(0)) : g2 && (v(this, T, "f") && E(true), o2 = true, v(this, pt, "f").showVersion("log"), this.exit(0))), !o2 && v(this, et, "f").skipValidation.length > 0 && (o2 = Object.keys(c2).some((t3) => v(this, et, "f").skipValidation.indexOf(t3) >= 0 && true === c2[t3])), !o2) {
4507
- if (l2.error) throw new e(l2.error.message);
4508
- if (!m2) {
4509
- const t3 = this[Zt](u2, {}, l2.error);
4510
- i2 || (d2 = C(c2, this, v(this, Y, "f").getMiddleware(), true)), d2 = this[zt](t3, null != d2 ? d2 : c2), f(d2) && !i2 && (d2 = d2.then(() => C(c2, this, v(this, Y, "f").getMiddleware(), false)));
4511
- }
4512
- }
4513
- } catch (t3) {
4514
- if (!(t3 instanceof e)) throw t3;
4515
- v(this, pt, "f").fail(t3.message, t3);
4516
- }
4517
- return this[Bt](null != d2 ? d2 : c2, a2, !!i2, true);
4518
- }
4519
- [Zt](t2, s2, i2, n2) {
4520
- const r2 = { ...this.getDemandedOptions() };
4521
- return (o2) => {
4522
- if (i2) throw new e(i2.message);
4523
- v(this, yt, "f").nonOptionCount(o2), v(this, yt, "f").requiredArguments(o2, r2);
4524
- let a2 = false;
4525
- v(this, dt, "f") && (a2 = v(this, yt, "f").unknownCommands(o2)), v(this, ft, "f") && !a2 ? v(this, yt, "f").unknownArguments(o2, t2, s2, !!n2) : v(this, ut, "f") && v(this, yt, "f").unknownArguments(o2, t2, {}, false, false), v(this, yt, "f").limitedChoices(o2), v(this, yt, "f").implications(o2), v(this, yt, "f").conflicting(o2);
4526
- };
4527
- }
4528
- [Xt]() {
4529
- O(this, J, true, "f");
4530
- }
4531
- [Qt](t2) {
4532
- if ("string" == typeof t2) v(this, et, "f").key[t2] = true;
4533
- else for (const e2 of t2) v(this, et, "f").key[e2] = true;
4534
- }
4535
- };
4536
- var ee;
4537
- var se;
4538
- var { readFileSync: ie } = require("fs");
4539
- var { inspect: ne } = require("util");
4540
- var { resolve: re } = require("path");
4541
- var oe = require_build();
4542
- var ae = require_build2();
4543
- var he;
4544
- var le = { assert: { notStrictEqual: t.notStrictEqual, strictEqual: t.strictEqual }, cliui: require_build3(), findUp: require_sync(), getEnv: (t2) => process.env[t2], getCallerFile: require_get_caller_file(), getProcessArgvBin: y, inspect: ne, mainFilename: null !== (se = null === (ee = null === require || void 0 === require ? void 0 : require.main) || void 0 === ee ? void 0 : ee.filename) && void 0 !== se ? se : process.cwd(), Parser: ae, path: require("path"), process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (t2, e2) => process.emitWarning(t2, e2), execPath: () => process.execPath, exit: (t2) => {
4545
- process.exit(t2);
4546
- }, nextTick: process.nextTick, stdColumns: void 0 !== process.stdout.columns ? process.stdout.columns : null }, readFileSync: ie, require, requireDirectory: require_require_directory(), stringWidth: require_string_width(), y18n: oe({ directory: re(__dirname, "../locales"), updateFiles: false }) };
4547
- var ce = (null === (he = null === process || void 0 === process ? void 0 : process.env) || void 0 === he ? void 0 : he.YARGS_MIN_NODE_VERSION) ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
4548
- if (process && process.version) {
4549
- if (Number(process.version.match(/v([^.]+)/)[1]) < ce) throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`);
4550
- }
4551
- var fe = require_build2();
4552
- var de;
4553
- var ue = { applyExtends: n, cjsPlatformShim: le, Yargs: (de = le, (t2 = [], e2 = de.process.cwd(), s2) => {
4554
- const i2 = new te(t2, e2, s2, de);
4555
- return Object.defineProperty(i2, "argv", { get: () => i2.parse(), enumerable: true }), i2.help(), i2.version(), i2;
4556
- }), argsert: h, isPromise: f, objFilter: g, parseCommand: o, Parser: fe, processArgv: b, YError: e };
4557
- module2.exports = ue;
4558
- }
4559
- });
4560
-
4561
- // ../../node_modules/.pnpm/tmp@0.2.3/node_modules/tmp/lib/tmp.js
4562
- var require_tmp = __commonJS({
4563
- "../../node_modules/.pnpm/tmp@0.2.3/node_modules/tmp/lib/tmp.js"(exports2, module2) {
4564
- "use strict";
4565
- var fs3 = require("fs");
4566
- var os = require("os");
4567
- var path4 = require("path");
4568
- var crypto = require("crypto");
4569
- var _c2 = { fs: fs3.constants, os: os.constants };
4570
- var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
4571
- var TEMPLATE_PATTERN = /XXXXXX/;
4572
- var DEFAULT_TRIES = 3;
4573
- var CREATE_FLAGS = (_c2.O_CREAT || _c2.fs.O_CREAT) | (_c2.O_EXCL || _c2.fs.O_EXCL) | (_c2.O_RDWR || _c2.fs.O_RDWR);
4574
- var IS_WIN32 = os.platform() === "win32";
4575
- var EBADF = _c2.EBADF || _c2.os.errno.EBADF;
4576
- var ENOENT = _c2.ENOENT || _c2.os.errno.ENOENT;
4577
- var DIR_MODE = 448;
4578
- var FILE_MODE = 384;
4579
- var EXIT = "exit";
4580
- var _removeObjects = [];
4581
- var FN_RMDIR_SYNC = fs3.rmdirSync.bind(fs3);
4582
- var _gracefulCleanup = false;
4583
- function rimraf(dirPath, callback) {
4584
- return fs3.rm(dirPath, { recursive: true }, callback);
4585
- }
4586
- function FN_RIMRAF_SYNC(dirPath) {
4587
- return fs3.rmSync(dirPath, { recursive: true });
4588
- }
4589
- function tmpName(options, callback) {
4590
- const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
4591
- try {
4592
- _assertAndSanitizeOptions(opts);
4593
- } catch (err) {
4594
- return cb(err);
4595
- }
4596
- let tries = opts.tries;
4597
- (function _getUniqueName() {
4598
- try {
4599
- const name = _generateTmpName(opts);
4600
- fs3.stat(name, function(err) {
4601
- if (!err) {
4602
- if (tries-- > 0) return _getUniqueName();
4603
- return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
4604
- }
4605
- cb(null, name);
4606
- });
4607
- } catch (err) {
4608
- cb(err);
4609
- }
4610
- })();
4611
- }
4612
- function tmpNameSync(options) {
4613
- const args = _parseArguments(options), opts = args[0];
4614
- _assertAndSanitizeOptions(opts);
4615
- let tries = opts.tries;
4616
- do {
4617
- const name = _generateTmpName(opts);
4618
- try {
4619
- fs3.statSync(name);
4620
- } catch (e) {
4621
- return name;
4622
- }
4623
- } while (tries-- > 0);
4624
- throw new Error("Could not get a unique tmp filename, max tries reached");
4625
- }
4626
- function file(options, callback) {
4627
- const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
4628
- tmpName(opts, function _tmpNameCreated(err, name) {
4629
- if (err) return cb(err);
4630
- fs3.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
4631
- if (err2) return cb(err2);
4632
- if (opts.discardDescriptor) {
4633
- return fs3.close(fd, function _discardCallback(possibleErr) {
4634
- return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false));
4635
- });
4636
- } else {
4637
- const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
4638
- cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));
4639
- }
4640
- });
4641
- });
4642
- }
4643
- function fileSync(options) {
4644
- const args = _parseArguments(options), opts = args[0];
4645
- const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
4646
- const name = tmpNameSync(opts);
4647
- var fd = fs3.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
4648
- if (opts.discardDescriptor) {
4649
- fs3.closeSync(fd);
4650
- fd = void 0;
4651
- }
4652
- return {
4653
- name,
4654
- fd,
4655
- removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true)
4656
- };
4657
- }
4658
- function dir(options, callback) {
4659
- const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
4660
- tmpName(opts, function _tmpNameCreated(err, name) {
4661
- if (err) return cb(err);
4662
- fs3.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) {
4663
- if (err2) return cb(err2);
4664
- cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false));
4665
- });
4666
- });
4667
- }
4668
- function dirSync(options) {
4669
- const args = _parseArguments(options), opts = args[0];
4670
- const name = tmpNameSync(opts);
4671
- fs3.mkdirSync(name, opts.mode || DIR_MODE);
4672
- return {
4673
- name,
4674
- removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)
4675
- };
4676
- }
4677
- function _removeFileAsync(fdPath, next) {
4678
- const _handler = function(err) {
4679
- if (err && !_isENOENT(err)) {
4680
- return next(err);
4681
- }
4682
- next();
4683
- };
4684
- if (0 <= fdPath[0])
4685
- fs3.close(fdPath[0], function() {
4686
- fs3.unlink(fdPath[1], _handler);
4687
- });
4688
- else fs3.unlink(fdPath[1], _handler);
4689
- }
4690
- function _removeFileSync(fdPath) {
4691
- let rethrownException = null;
4692
- try {
4693
- if (0 <= fdPath[0]) fs3.closeSync(fdPath[0]);
4694
- } catch (e) {
4695
- if (!_isEBADF(e) && !_isENOENT(e)) throw e;
4696
- } finally {
4697
- try {
4698
- fs3.unlinkSync(fdPath[1]);
4699
- } catch (e) {
4700
- if (!_isENOENT(e)) rethrownException = e;
4701
- }
4702
- }
4703
- if (rethrownException !== null) {
4704
- throw rethrownException;
4705
- }
4706
- }
4707
- function _prepareTmpFileRemoveCallback(name, fd, opts, sync) {
4708
- const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);
4709
- const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);
4710
- if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
4711
- return sync ? removeCallbackSync : removeCallback;
4712
- }
4713
- function _prepareTmpDirRemoveCallback(name, opts, sync) {
4714
- const removeFunction = opts.unsafeCleanup ? rimraf : fs3.rmdir.bind(fs3);
4715
- const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
4716
- const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);
4717
- const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);
4718
- if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
4719
- return sync ? removeCallbackSync : removeCallback;
4720
- }
4721
- function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
4722
- let called = false;
4723
- return function _cleanupCallback(next) {
4724
- if (!called) {
4725
- const toRemove = cleanupCallbackSync || _cleanupCallback;
4726
- const index = _removeObjects.indexOf(toRemove);
4727
- if (index >= 0) _removeObjects.splice(index, 1);
4728
- called = true;
4729
- if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
4730
- return removeFunction(fileOrDirName);
4731
- } else {
4732
- return removeFunction(fileOrDirName, next || function() {
4733
- });
4734
- }
4735
- }
4736
- };
4737
- }
4738
- function _garbageCollector() {
4739
- if (!_gracefulCleanup) return;
4740
- while (_removeObjects.length) {
4741
- try {
4742
- _removeObjects[0]();
4743
- } catch (e) {
4744
- }
4745
- }
4746
- }
4747
- function _randomChars(howMany) {
4748
- let value = [], rnd = null;
4749
- try {
4750
- rnd = crypto.randomBytes(howMany);
4751
- } catch (e) {
4752
- rnd = crypto.pseudoRandomBytes(howMany);
4753
- }
4754
- for (var i = 0; i < howMany; i++) {
4755
- value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
4756
- }
4757
- return value.join("");
4758
- }
4759
- function _isBlank(s) {
4760
- return s === null || _isUndefined(s) || !s.trim();
4761
- }
4762
- function _isUndefined(obj) {
4763
- return typeof obj === "undefined";
4764
- }
4765
- function _parseArguments(options, callback) {
4766
- if (typeof options === "function") {
4767
- return [{}, options];
4768
- }
4769
- if (_isUndefined(options)) {
4770
- return [{}, callback];
4771
- }
4772
- const actualOptions = {};
4773
- for (const key of Object.getOwnPropertyNames(options)) {
4774
- actualOptions[key] = options[key];
4775
- }
4776
- return [actualOptions, callback];
4777
- }
4778
- function _generateTmpName(opts) {
4779
- const tmpDir = opts.tmpdir;
4780
- if (!_isUndefined(opts.name))
4781
- return path4.join(tmpDir, opts.dir, opts.name);
4782
- if (!_isUndefined(opts.template))
4783
- return path4.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
4784
- const name = [
4785
- opts.prefix ? opts.prefix : "tmp",
4786
- "-",
4787
- process.pid,
4788
- "-",
4789
- _randomChars(12),
4790
- opts.postfix ? "-" + opts.postfix : ""
4791
- ].join("");
4792
- return path4.join(tmpDir, opts.dir, name);
4793
- }
4794
- function _assertAndSanitizeOptions(options) {
4795
- options.tmpdir = _getTmpDir(options);
4796
- const tmpDir = options.tmpdir;
4797
- if (!_isUndefined(options.name))
4798
- _assertIsRelative(options.name, "name", tmpDir);
4799
- if (!_isUndefined(options.dir))
4800
- _assertIsRelative(options.dir, "dir", tmpDir);
4801
- if (!_isUndefined(options.template)) {
4802
- _assertIsRelative(options.template, "template", tmpDir);
4803
- if (!options.template.match(TEMPLATE_PATTERN))
4804
- throw new Error(`Invalid template, found "${options.template}".`);
4805
- }
4806
- if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0)
4807
- throw new Error(`Invalid tries, found "${options.tries}".`);
4808
- options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
4809
- options.keep = !!options.keep;
4810
- options.detachDescriptor = !!options.detachDescriptor;
4811
- options.discardDescriptor = !!options.discardDescriptor;
4812
- options.unsafeCleanup = !!options.unsafeCleanup;
4813
- options.dir = _isUndefined(options.dir) ? "" : path4.relative(tmpDir, _resolvePath(options.dir, tmpDir));
4814
- options.template = _isUndefined(options.template) ? void 0 : path4.relative(tmpDir, _resolvePath(options.template, tmpDir));
4815
- options.template = _isBlank(options.template) ? void 0 : path4.relative(options.dir, options.template);
4816
- options.name = _isUndefined(options.name) ? void 0 : options.name;
4817
- options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
4818
- options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
4819
- }
4820
- function _resolvePath(name, tmpDir) {
4821
- if (name.startsWith(tmpDir)) {
4822
- return path4.resolve(name);
4823
- } else {
4824
- return path4.resolve(path4.join(tmpDir, name));
4825
- }
4826
- }
4827
- function _assertIsRelative(name, option, tmpDir) {
4828
- if (option === "name") {
4829
- if (path4.isAbsolute(name))
4830
- throw new Error(`${option} option must not contain an absolute path, found "${name}".`);
4831
- let basename2 = path4.basename(name);
4832
- if (basename2 === ".." || basename2 === "." || basename2 !== name)
4833
- throw new Error(`${option} option must not contain a path, found "${name}".`);
4834
- } else {
4835
- if (path4.isAbsolute(name) && !name.startsWith(tmpDir)) {
4836
- throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`);
4837
- }
4838
- let resolvedPath = _resolvePath(name, tmpDir);
4839
- if (!resolvedPath.startsWith(tmpDir))
4840
- throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`);
4841
- }
4842
- }
4843
- function _isEBADF(error) {
4844
- return _isExpectedError(error, -EBADF, "EBADF");
4845
- }
4846
- function _isENOENT(error) {
4847
- return _isExpectedError(error, -ENOENT, "ENOENT");
4848
- }
4849
- function _isExpectedError(error, errno, code) {
4850
- return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;
4851
- }
4852
- function setGracefulCleanup() {
4853
- _gracefulCleanup = true;
4854
- }
4855
- function _getTmpDir(options) {
4856
- return path4.resolve(options && options.tmpdir || os.tmpdir());
4857
- }
4858
- process.addListener(EXIT, _garbageCollector);
4859
- Object.defineProperty(module2.exports, "tmpdir", {
4860
- enumerable: true,
4861
- configurable: false,
4862
- get: function() {
4863
- return _getTmpDir();
4864
- }
4865
- });
4866
- module2.exports.dir = dir;
4867
- module2.exports.dirSync = dirSync;
4868
- module2.exports.file = file;
4869
- module2.exports.fileSync = fileSync;
4870
- module2.exports.tmpName = tmpName;
4871
- module2.exports.tmpNameSync = tmpNameSync;
4872
- module2.exports.setGracefulCleanup = setGracefulCleanup;
4873
- }
4874
- });
4875
-
4876
- // ../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js
4877
- var require_tmp_promise = __commonJS({
4878
- "../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js"(exports2, module2) {
4879
- "use strict";
4880
- var { promisify } = require("util");
4881
- var tmp2 = require_tmp();
4882
- module2.exports.fileSync = tmp2.fileSync;
4883
- var fileWithOptions = promisify(
4884
- (options, cb) => tmp2.file(
4885
- options,
4886
- (err, path4, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path4, fd, cleanup: promisify(cleanup) })
4887
- )
4888
- );
4889
- module2.exports.file = async (options) => fileWithOptions(options);
4890
- module2.exports.withFile = async function withFile(fn, options) {
4891
- const { path: path4, fd, cleanup } = await module2.exports.file(options);
4892
- try {
4893
- return await fn({ path: path4, fd });
4894
- } finally {
4895
- await cleanup();
4896
+ if (v(this, z, "f").hasDefaultCommand() && !y2) {
4897
+ const t3 = v(this, z, "f").runCommand(null, this, l2, 0, r2, p2 || g2 || r2);
4898
+ return this[Bt](t3, a2, !!i2, false);
4899
+ }
4900
+ if (m2) {
4901
+ v(this, T, "f") && E(true);
4902
+ const s3 = (t2 = [].concat(t2)).slice(t2.indexOf(`--${v(this, U, "f").completionKey}`) + 1);
4903
+ return v(this, U, "f").getCompletion(s3, ((t3, s4) => {
4904
+ if (t3) throw new e(t3.message);
4905
+ (s4 || []).forEach(((t4) => {
4906
+ v(this, Q, "f").log(t4);
4907
+ })), this.exit(0);
4908
+ })), this[Bt](c2, !a2, !!i2, false);
4909
+ }
4910
+ if (v(this, J, "f") || (p2 ? (v(this, T, "f") && E(true), o2 = true, this.showHelp("log"), this.exit(0)) : g2 && (v(this, T, "f") && E(true), o2 = true, v(this, pt, "f").showVersion("log"), this.exit(0))), !o2 && v(this, et, "f").skipValidation.length > 0 && (o2 = Object.keys(c2).some(((t3) => v(this, et, "f").skipValidation.indexOf(t3) >= 0 && true === c2[t3]))), !o2) {
4911
+ if (l2.error) throw new e(l2.error.message);
4912
+ if (!m2) {
4913
+ const t3 = this[Zt](u2, {}, l2.error);
4914
+ i2 || (d2 = C(c2, this, v(this, Y, "f").getMiddleware(), true)), d2 = this[zt](t3, null != d2 ? d2 : c2), f(d2) && !i2 && (d2 = d2.then((() => C(c2, this, v(this, Y, "f").getMiddleware(), false))));
4915
+ }
4916
+ }
4917
+ } catch (t3) {
4918
+ if (!(t3 instanceof e)) throw t3;
4919
+ v(this, pt, "f").fail(t3.message, t3);
4920
+ }
4921
+ return this[Bt](null != d2 ? d2 : c2, a2, !!i2, true);
4896
4922
  }
4897
- };
4898
- module2.exports.dirSync = tmp2.dirSync;
4899
- var dirWithOptions = promisify(
4900
- (options, cb) => tmp2.dir(
4901
- options,
4902
- (err, path4, cleanup) => err ? cb(err) : cb(void 0, { path: path4, cleanup: promisify(cleanup) })
4903
- )
4904
- );
4905
- module2.exports.dir = async (options) => dirWithOptions(options);
4906
- module2.exports.withDir = async function withDir(fn, options) {
4907
- const { path: path4, cleanup } = await module2.exports.dir(options);
4908
- try {
4909
- return await fn({ path: path4 });
4910
- } finally {
4911
- await cleanup();
4923
+ [Zt](t2, s2, i2, n2) {
4924
+ const r2 = { ...this.getDemandedOptions() };
4925
+ return (o2) => {
4926
+ if (i2) throw new e(i2.message);
4927
+ v(this, yt, "f").nonOptionCount(o2), v(this, yt, "f").requiredArguments(o2, r2);
4928
+ let a2 = false;
4929
+ v(this, dt, "f") && (a2 = v(this, yt, "f").unknownCommands(o2)), v(this, ft, "f") && !a2 ? v(this, yt, "f").unknownArguments(o2, t2, s2, !!n2) : v(this, ut, "f") && v(this, yt, "f").unknownArguments(o2, t2, {}, false, false), v(this, yt, "f").limitedChoices(o2), v(this, yt, "f").implications(o2), v(this, yt, "f").conflicting(o2);
4930
+ };
4931
+ }
4932
+ [Xt]() {
4933
+ O(this, J, true, "f");
4934
+ }
4935
+ [Qt](t2) {
4936
+ if ("string" == typeof t2) v(this, et, "f").key[t2] = true;
4937
+ else for (const e2 of t2) v(this, et, "f").key[e2] = true;
4912
4938
  }
4913
4939
  };
4914
- module2.exports.tmpNameSync = tmp2.tmpNameSync;
4915
- module2.exports.tmpName = promisify(tmp2.tmpName);
4916
- module2.exports.tmpdir = tmp2.tmpdir;
4917
- module2.exports.setGracefulCleanup = tmp2.setGracefulCleanup;
4940
+ var ee;
4941
+ var se;
4942
+ var { readFileSync: ie } = require("fs");
4943
+ var { inspect: ne } = require("util");
4944
+ var { resolve: re } = require("path");
4945
+ var oe = require_build();
4946
+ var ae = require_build2();
4947
+ var he;
4948
+ var le = { assert: { notStrictEqual: t.notStrictEqual, strictEqual: t.strictEqual }, cliui: require_build3(), findUp: require_sync(), getEnv: (t2) => process.env[t2], getCallerFile: require_get_caller_file(), getProcessArgvBin: y, inspect: ne, mainFilename: null !== (se = null === (ee = null === require || void 0 === require ? void 0 : require.main) || void 0 === ee ? void 0 : ee.filename) && void 0 !== se ? se : process.cwd(), Parser: ae, path: require("path"), process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (t2, e2) => process.emitWarning(t2, e2), execPath: () => process.execPath, exit: (t2) => {
4949
+ process.exit(t2);
4950
+ }, nextTick: process.nextTick, stdColumns: void 0 !== process.stdout.columns ? process.stdout.columns : null }, readFileSync: ie, require, requireDirectory: require_require_directory(), stringWidth: require_string_width(), y18n: oe({ directory: re(__dirname, "../locales"), updateFiles: false }) };
4951
+ var ce = (null === (he = null === process || void 0 === process ? void 0 : process.env) || void 0 === he ? void 0 : he.YARGS_MIN_NODE_VERSION) ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
4952
+ if (process && process.version) {
4953
+ if (Number(process.version.match(/v([^.]+)/)[1]) < ce) throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`);
4954
+ }
4955
+ var fe = require_build2();
4956
+ var de;
4957
+ var ue = { applyExtends: n, cjsPlatformShim: le, Yargs: (de = le, (t2 = [], e2 = de.process.cwd(), s2) => {
4958
+ const i2 = new te(t2, e2, s2, de);
4959
+ return Object.defineProperty(i2, "argv", { get: () => i2.parse(), enumerable: true }), i2.help(), i2.version(), i2;
4960
+ }), argsert: h, isPromise: f, objFilter: g, parseCommand: o, Parser: fe, processArgv: b, YError: e };
4961
+ module2.exports = ue;
4918
4962
  }
4919
4963
  });
4920
4964
 
@@ -5778,9 +5822,31 @@ var require_dist2 = __commonJS({
5778
5822
  }
5779
5823
  });
5780
5824
 
5825
+ // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/cwd.js
5826
+ function cwd() {
5827
+ return process.cwd();
5828
+ }
5829
+
5830
+ // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/doesPathExist.js
5831
+ var import_promises = require("fs/promises");
5832
+ async function doesPathExist(filepath) {
5833
+ try {
5834
+ await (0, import_promises.lstat)(filepath);
5835
+ return true;
5836
+ } catch {
5837
+ return false;
5838
+ }
5839
+ }
5840
+
5841
+ // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/resolve.js
5842
+ var import_path = __toESM(require("path"), 1);
5843
+ function resolve(...paths) {
5844
+ return import_path.default.resolve(...paths);
5845
+ }
5846
+
5781
5847
  // src/cli.ts
5782
5848
  var import_fs6 = __toESM(require("fs"), 1);
5783
- var import_promises6 = require("fs/promises");
5849
+ var import_promises7 = require("fs/promises");
5784
5850
  var import_path7 = __toESM(require("path"), 1);
5785
5851
 
5786
5852
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
@@ -5815,7 +5881,7 @@ function getProcessArgvBin() {
5815
5881
 
5816
5882
  // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js
5817
5883
  var import_util = require("util");
5818
- var import_path = require("path");
5884
+ var import_path2 = require("path");
5819
5885
 
5820
5886
  // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/string-utils.js
5821
5887
  function camelCase(str) {
@@ -6772,8 +6838,8 @@ var parser = new YargsParser({
6772
6838
  return env;
6773
6839
  },
6774
6840
  format: import_util.format,
6775
- normalize: import_path.normalize,
6776
- resolve: import_path.resolve,
6841
+ normalize: import_path2.normalize,
6842
+ resolve: import_path2.resolve,
6777
6843
  // TODO: figure out a way to combine ESM and CJS coverage, such that
6778
6844
  // we can exercise all the lines below:
6779
6845
  require: (path4) => {
@@ -7090,18 +7156,18 @@ function ui(opts) {
7090
7156
  }
7091
7157
 
7092
7158
  // ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
7093
- var import_path2 = require("path");
7159
+ var import_path3 = require("path");
7094
7160
  var import_fs2 = require("fs");
7095
7161
  function sync_default(start, callback) {
7096
- let dir = (0, import_path2.resolve)(".", start);
7162
+ let dir = (0, import_path3.resolve)(".", start);
7097
7163
  let tmp2, stats = (0, import_fs2.statSync)(dir);
7098
7164
  if (!stats.isDirectory()) {
7099
- dir = (0, import_path2.dirname)(dir);
7165
+ dir = (0, import_path3.dirname)(dir);
7100
7166
  }
7101
7167
  while (true) {
7102
7168
  tmp2 = callback(dir, (0, import_fs2.readdirSync)(dir));
7103
- if (tmp2) return (0, import_path2.resolve)(dir, tmp2);
7104
- dir = (0, import_path2.dirname)(tmp2 = dir);
7169
+ if (tmp2) return (0, import_path3.resolve)(dir, tmp2);
7170
+ dir = (0, import_path3.dirname)(tmp2 = dir);
7105
7171
  if (tmp2 === dir) break;
7106
7172
  }
7107
7173
  }
@@ -7110,19 +7176,19 @@ function sync_default(start, callback) {
7110
7176
  var import_util3 = require("util");
7111
7177
  var import_fs4 = require("fs");
7112
7178
  var import_url = require("url");
7113
- var import_path4 = require("path");
7179
+ var import_path5 = require("path");
7114
7180
 
7115
7181
  // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
7116
7182
  var import_fs3 = require("fs");
7117
7183
  var import_util2 = require("util");
7118
- var import_path3 = require("path");
7184
+ var import_path4 = require("path");
7119
7185
  var node_default = {
7120
7186
  fs: {
7121
7187
  readFileSync: import_fs3.readFileSync,
7122
7188
  writeFile: import_fs3.writeFile
7123
7189
  },
7124
7190
  format: import_util2.format,
7125
- resolve: import_path3.resolve,
7191
+ resolve: import_path4.resolve,
7126
7192
  exists: (file) => {
7127
7193
  try {
7128
7194
  return (0, import_fs3.statSync)(file).isFile();
@@ -7328,11 +7394,11 @@ var esm_default = {
7328
7394
  mainFilename: mainFilename || process.cwd(),
7329
7395
  Parser: lib_default,
7330
7396
  path: {
7331
- basename: import_path4.basename,
7332
- dirname: import_path4.dirname,
7333
- extname: import_path4.extname,
7334
- relative: import_path4.relative,
7335
- resolve: import_path4.resolve
7397
+ basename: import_path5.basename,
7398
+ dirname: import_path5.dirname,
7399
+ extname: import_path5.extname,
7400
+ relative: import_path5.relative,
7401
+ resolve: import_path5.resolve
7336
7402
  },
7337
7403
  process: {
7338
7404
  argv: () => process.argv,
@@ -7354,7 +7420,7 @@ var esm_default = {
7354
7420
  return [...str].length;
7355
7421
  },
7356
7422
  y18n: y18n_default({
7357
- directory: (0, import_path4.resolve)(__dirname2, "../../../locales"),
7423
+ directory: (0, import_path5.resolve)(__dirname2, "../../../locales"),
7358
7424
  updateFiles: false
7359
7425
  })
7360
7426
  };
@@ -7369,28 +7435,6 @@ Yargs.hideBin = processArgv.hideBin;
7369
7435
  Yargs.Parser = Parser2;
7370
7436
  var yargs_default = Yargs;
7371
7437
 
7372
- // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/cwd.js
7373
- function cwd() {
7374
- return process.cwd();
7375
- }
7376
-
7377
- // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/doesPathExist.js
7378
- var import_promises = require("fs/promises");
7379
- async function doesPathExist(filepath) {
7380
- try {
7381
- await (0, import_promises.lstat)(filepath);
7382
- return true;
7383
- } catch {
7384
- return false;
7385
- }
7386
- }
7387
-
7388
- // ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/resolve.js
7389
- var import_path5 = __toESM(require("path"), 1);
7390
- function resolve5(...paths) {
7391
- return import_path5.default.resolve(...paths);
7392
- }
7393
-
7394
7438
  // src/configuration/loadGitHubConfig.ts
7395
7439
  var import_promises2 = require("fs/promises");
7396
7440
  async function loadGitHubConfig({
@@ -7400,26 +7444,32 @@ async function loadGitHubConfig({
7400
7444
  return JSON.parse(rawContents);
7401
7445
  }
7402
7446
 
7403
- // src/configuration/loadReadmeConfig.ts
7447
+ // src/configuration/loadMetadataConfig.ts
7404
7448
  var import_promises3 = require("fs/promises");
7405
- async function loadReadmeConfig({
7449
+ async function loadMetadataConfig({
7406
7450
  absolutePathToConfig
7407
7451
  }) {
7408
7452
  const rawContents = await (0, import_promises3.readFile)(absolutePathToConfig, "utf8");
7409
7453
  return JSON.parse(rawContents);
7410
7454
  }
7411
7455
 
7412
- // src/configuration/loadReferenceConfig.ts
7456
+ // src/configuration/loadReadmeConfig.ts
7413
7457
  var import_promises4 = require("fs/promises");
7414
- async function loadReferenceConfig({
7458
+ async function loadReadmeConfig({
7415
7459
  absolutePathToConfig
7416
7460
  }) {
7417
7461
  const rawContents = await (0, import_promises4.readFile)(absolutePathToConfig, "utf8");
7418
7462
  return JSON.parse(rawContents);
7419
7463
  }
7420
7464
 
7421
- // src/github/GitHub.ts
7422
- var import_rest = require("@octokit/rest");
7465
+ // src/configuration/loadReferenceConfig.ts
7466
+ var import_promises5 = require("fs/promises");
7467
+ async function loadReferenceConfig({
7468
+ absolutePathToConfig
7469
+ }) {
7470
+ const rawContents = await (0, import_promises5.readFile)(absolutePathToConfig, "utf8");
7471
+ return JSON.parse(rawContents);
7472
+ }
7423
7473
 
7424
7474
  // ../../node_modules/.pnpm/simple-git@3.24.0/node_modules/simple-git/dist/esm/index.js
7425
7475
  var import_file_exists = __toESM(require_dist(), 1);
@@ -11928,7 +11978,7 @@ var esm_default2 = gitInstanceFactory;
11928
11978
  var import_tmp_promise = __toESM(require_tmp_promise(), 1);
11929
11979
 
11930
11980
  // ../commons/github/dist/ClonedRepository.js
11931
- var import_promises5 = require("fs/promises");
11981
+ var import_promises6 = require("fs/promises");
11932
11982
  var import_path6 = __toESM(require("path"), 1);
11933
11983
 
11934
11984
  // ../commons/github/dist/constants.js
@@ -12005,18 +12055,18 @@ var ClonedRepository = class {
12005
12055
  }
12006
12056
  async overwriteLocalContents(sourceDirectoryPath) {
12007
12057
  const [sourceContents, destContents] = await Promise.all([
12008
- (0, import_promises5.readdir)(sourceDirectoryPath),
12009
- (0, import_promises5.readdir)(this.clonePath)
12058
+ (0, import_promises6.readdir)(sourceDirectoryPath),
12059
+ (0, import_promises6.readdir)(this.clonePath)
12010
12060
  ]);
12011
12061
  await Promise.all(destContents.filter((content) => !DEFAULT_IGNORED_FILES.includes(content)).map(async (content) => {
12012
- await (0, import_promises5.rm)((0, import_path6.resolve)(this.clonePath, content), {
12062
+ await (0, import_promises6.rm)((0, import_path6.resolve)(this.clonePath, content), {
12013
12063
  recursive: true,
12014
12064
  force: true
12015
12065
  });
12016
12066
  }));
12017
12067
  await Promise.all(sourceContents.filter((content) => !DEFAULT_IGNORED_FILES.includes(content)).map(async (content) => {
12018
12068
  const path4 = (0, import_path6.resolve)(sourceDirectoryPath, content);
12019
- await (0, import_promises5.cp)(path4, (0, import_path6.resolve)(this.clonePath, content), { recursive: true });
12069
+ await (0, import_promises6.cp)(path4, (0, import_path6.resolve)(this.clonePath, content), { recursive: true });
12020
12070
  }));
12021
12071
  }
12022
12072
  async readFile({ relativeFilePath }) {
@@ -12024,12 +12074,12 @@ var ClonedRepository = class {
12024
12074
  if (!await doesPathExist2(absoluteFilePath)) {
12025
12075
  return void 0;
12026
12076
  }
12027
- return await (0, import_promises5.readFile)(absoluteFilePath, "utf-8");
12077
+ return await (0, import_promises6.readFile)(absoluteFilePath, "utf-8");
12028
12078
  }
12029
12079
  };
12030
12080
  async function doesPathExist2(filepath) {
12031
12081
  try {
12032
- await (0, import_promises5.lstat)(filepath);
12082
+ await (0, import_promises6.lstat)(filepath);
12033
12083
  return true;
12034
12084
  } catch {
12035
12085
  return false;
@@ -12093,6 +12143,7 @@ async function cloneRepository({ githubRepository, installationToken }) {
12093
12143
  }
12094
12144
 
12095
12145
  // src/github/GitHub.ts
12146
+ var import_rest = require("@octokit/rest");
12096
12147
  var GitHub = class {
12097
12148
  githubConfig;
12098
12149
  constructor({
@@ -12103,7 +12154,7 @@ var GitHub = class {
12103
12154
  async push() {
12104
12155
  try {
12105
12156
  const wd = cwd();
12106
- const sourceDirectory = resolve5(wd, this.githubConfig.sourceDirectory);
12157
+ const sourceDirectory = resolve(wd, this.githubConfig.sourceDirectory);
12107
12158
  const repository = await cloneRepository({
12108
12159
  githubRepository: this.githubConfig.uri,
12109
12160
  installationToken: this.githubConfig.token
@@ -12125,7 +12176,7 @@ var GitHub = class {
12125
12176
  async pr() {
12126
12177
  try {
12127
12178
  const wd = cwd();
12128
- const sourceDirectory = resolve5(wd, this.githubConfig.sourceDirectory);
12179
+ const sourceDirectory = resolve(wd, this.githubConfig.sourceDirectory);
12129
12180
  const repository = await cloneRepository({
12130
12181
  githubRepository: this.githubConfig.uri,
12131
12182
  installationToken: this.githubConfig.token
@@ -12207,6 +12258,7 @@ var import_string = require("es-toolkit/string");
12207
12258
  // src/configuration/generated/api/index.ts
12208
12259
  var api_exports = {};
12209
12260
  __export(api_exports, {
12261
+ ExampleStyle: () => ExampleStyle,
12210
12262
  Language: () => Language,
12211
12263
  LanguageInfo: () => LanguageInfo,
12212
12264
  Remote: () => Remote,
@@ -12269,6 +12321,7 @@ var github_exports = {};
12269
12321
  // src/configuration/generated/api/resources/readme/index.ts
12270
12322
  var readme_exports = {};
12271
12323
  __export(readme_exports, {
12324
+ ExampleStyle: () => ExampleStyle,
12272
12325
  LanguageInfo: () => LanguageInfo,
12273
12326
  Remote: () => Remote
12274
12327
  });
@@ -12403,6 +12456,22 @@ var LanguageInfo = {
12403
12456
  }
12404
12457
  };
12405
12458
 
12459
+ // src/configuration/generated/api/resources/readme/types/ExampleStyle.ts
12460
+ var ExampleStyle = {
12461
+ Minimal: "minimal",
12462
+ Comprehensive: "comprehensive",
12463
+ _visit: (value, visitor) => {
12464
+ switch (value) {
12465
+ case ExampleStyle.Minimal:
12466
+ return visitor.minimal();
12467
+ case ExampleStyle.Comprehensive:
12468
+ return visitor.comprehensive();
12469
+ default:
12470
+ return visitor._other();
12471
+ }
12472
+ }
12473
+ };
12474
+
12406
12475
  // src/configuration/generated/api/resources/reference/index.ts
12407
12476
  var reference_exports = {};
12408
12477
  __export(reference_exports, {
@@ -12476,17 +12545,14 @@ var StreamWriter = class extends Writer {
12476
12545
  reject(err);
12477
12546
  };
12478
12547
  if (this.stream instanceof import_fs5.default.WriteStream) {
12479
- const canWrite = this.stream.write(
12480
- content,
12481
- (error) => {
12482
- this.stream.removeListener("error", handleError);
12483
- if (error) {
12484
- reject(error);
12485
- } else {
12486
- resolve7();
12487
- }
12548
+ const canWrite = this.stream.write(content, (error) => {
12549
+ this.stream.removeListener("error", handleError);
12550
+ if (error) {
12551
+ reject(error);
12552
+ } else {
12553
+ resolve7();
12488
12554
  }
12489
- );
12555
+ });
12490
12556
  this.stream.once("error", handleError);
12491
12557
  if (!canWrite) {
12492
12558
  this.stream.once("drain", resolve7);
@@ -12626,9 +12692,7 @@ var BlockList = class {
12626
12692
  return;
12627
12693
  }
12628
12694
  if (!this.hasBlock(precedingBlockId)) {
12629
- throw new Error(
12630
- `preceding block with id "${precedingBlockId}" does not exist`
12631
- );
12695
+ throw new Error(`preceding block with id "${precedingBlockId}" does not exist`);
12632
12696
  }
12633
12697
  this.ids.add(block.id);
12634
12698
  this.blocks.splice(
@@ -12671,9 +12735,7 @@ var ReadmeGenerator = class {
12671
12735
  this.organizationPascalCase = pascalCase(this.readmeConfig.organization);
12672
12736
  this.apiName = this.readmeConfig.apiName ?? this.organizationPascalCase;
12673
12737
  }
12674
- async generateReadme({
12675
- output
12676
- }) {
12738
+ async generateReadme({ output }) {
12677
12739
  const blocks = await this.generateBlocks();
12678
12740
  const writer = new StreamWriter(output);
12679
12741
  await this.writeHeader({ writer });
@@ -12839,10 +12901,7 @@ var ReadmeGenerator = class {
12839
12901
  }
12840
12902
  return void 0;
12841
12903
  }
12842
- async writeBlocks({
12843
- writer,
12844
- blocks
12845
- }) {
12904
+ async writeBlocks({ writer, blocks }) {
12846
12905
  for (const block of blocks) {
12847
12906
  await block.write(writer);
12848
12907
  }
@@ -12871,10 +12930,7 @@ var ReadmeGenerator = class {
12871
12930
  isWhiteLabel() {
12872
12931
  return this.readmeConfig.whiteLabel ?? false;
12873
12932
  }
12874
- async writeBanner({
12875
- writer,
12876
- bannerLink
12877
- }) {
12933
+ async writeBanner({ writer, bannerLink }) {
12878
12934
  await writer.writeLine(`![](${bannerLink})`);
12879
12935
  await writer.writeLine();
12880
12936
  }
@@ -12890,24 +12946,18 @@ var ReadmeGenerator = class {
12890
12946
  );
12891
12947
  await writer.writeLine();
12892
12948
  }
12893
- async generateDocumentation({
12894
- docsLink
12895
- }) {
12949
+ async generateDocumentation({ docsLink }) {
12896
12950
  const writer = new StringWriter();
12897
12951
  await writer.writeLine("## Documentation");
12898
12952
  await writer.writeLine();
12899
- await writer.writeLine(
12900
- `API reference documentation is available [here](${docsLink}).`
12901
- );
12953
+ await writer.writeLine(`API reference documentation is available [here](${docsLink}).`);
12902
12954
  await writer.writeLine();
12903
12955
  return new Block({
12904
12956
  id: "DOCUMENTATION",
12905
12957
  content: writer.toString()
12906
12958
  });
12907
12959
  }
12908
- async generateReference({
12909
- referenceFile
12910
- }) {
12960
+ async generateReference({ referenceFile }) {
12911
12961
  const writer = new StringWriter();
12912
12962
  await writer.writeLine("## Reference");
12913
12963
  await writer.writeLine();
@@ -12947,18 +12997,14 @@ var ReadmeGenerator = class {
12947
12997
  const writer = new StringWriter();
12948
12998
  await writer.writeLine(`## ${customSection.name}`);
12949
12999
  await writer.writeLine();
12950
- await writer.writeLine(
12951
- this.applyTemplateOptions(customSection.content, templateOptions)
12952
- );
13000
+ await writer.writeLine(this.applyTemplateOptions(customSection.content, templateOptions));
12953
13001
  await writer.writeLine();
12954
13002
  return new Block({
12955
13003
  id: toScreamingSnakeCase(customSection.name),
12956
13004
  content: writer.toString()
12957
13005
  });
12958
13006
  }
12959
- async generateRequirements({
12960
- requirements
12961
- }) {
13007
+ async generateRequirements({ requirements }) {
12962
13008
  const writer = new StringWriter();
12963
13009
  await writer.writeLine("## Requirements");
12964
13010
  await writer.writeLine();
@@ -12976,9 +13022,7 @@ var ReadmeGenerator = class {
12976
13022
  content: writer.toString()
12977
13023
  });
12978
13024
  }
12979
- async generateInstallation({
12980
- language
12981
- }) {
13025
+ async generateInstallation({ language }) {
12982
13026
  if (language.publishInfo == null) {
12983
13027
  throw new Error("publish information is required for installation block");
12984
13028
  }
@@ -13076,9 +13120,7 @@ var ReadmeGenerator = class {
13076
13120
  await writer.writeLine();
13077
13121
  await writer.writeLine("```groovy");
13078
13122
  await writer.writeLine("dependencies {");
13079
- await writer.writeLine(
13080
- ` implementation '${maven.group}:${maven.artifact}'`
13081
- );
13123
+ await writer.writeLine(` implementation '${maven.group}:${maven.artifact}'`);
13082
13124
  await writer.writeLine("}");
13083
13125
  await writer.writeLine("```");
13084
13126
  await writer.writeLine();
@@ -13144,17 +13186,13 @@ var ReadmeGenerator = class {
13144
13186
  await writer.writeLine();
13145
13187
  await writer.writeLine("```toml");
13146
13188
  await writer.writeLine("[dependencies]");
13147
- await writer.writeLine(
13148
- `${this.getCrateNameFromPackageName(cargo.packageName)} = "${cargo.version}"`
13149
- );
13189
+ await writer.writeLine(`${this.getCrateNameFromPackageName(cargo.packageName)} = "${cargo.version}"`);
13150
13190
  await writer.writeLine("```");
13151
13191
  await writer.writeLine();
13152
13192
  await writer.writeLine("Or install via cargo:");
13153
13193
  await writer.writeLine();
13154
13194
  await writer.writeLine("```sh");
13155
- await writer.writeLine(
13156
- `cargo add ${this.getCrateNameFromPackageName(cargo.packageName)}`
13157
- );
13195
+ await writer.writeLine(`cargo add ${this.getCrateNameFromPackageName(cargo.packageName)}`);
13158
13196
  await writer.writeLine("```");
13159
13197
  await writer.writeLine();
13160
13198
  }
@@ -13168,9 +13206,7 @@ var ReadmeGenerator = class {
13168
13206
  await writer.writeLine();
13169
13207
  await writer.writeLine("```swift");
13170
13208
  await writer.writeLine("dependencies: [");
13171
- await writer.writeLine(
13172
- ` .package(url: "${spm.gitUrl}", from: "${spm.minVersion}"),`
13173
- );
13209
+ await writer.writeLine(` .package(url: "${spm.gitUrl}", from: "${spm.minVersion}"),`);
13174
13210
  await writer.writeLine("]");
13175
13211
  await writer.writeLine("```");
13176
13212
  await writer.writeLine();
@@ -13292,9 +13328,7 @@ var ReadmeGenerator = class {
13292
13328
  }) {
13293
13329
  await writer.write("[![npm shield]");
13294
13330
  await writer.write(`(https://img.shields.io/npm/v/${npm.packageName})]`);
13295
- await writer.writeLine(
13296
- `(https://www.npmjs.com/package/${npm.packageName})`
13297
- );
13331
+ await writer.writeLine(`(https://www.npmjs.com/package/${npm.packageName})`);
13298
13332
  }
13299
13333
  async writeShieldForPyPi({
13300
13334
  writer,
@@ -13302,21 +13336,15 @@ var ReadmeGenerator = class {
13302
13336
  }) {
13303
13337
  await writer.write("[![pypi]");
13304
13338
  await writer.write(`(https://img.shields.io/pypi/v/${pypi.packageName})]`);
13305
- await writer.writeLine(
13306
- `(https://pypi.python.org/pypi/${pypi.packageName})`
13307
- );
13339
+ await writer.writeLine(`(https://pypi.python.org/pypi/${pypi.packageName})`);
13308
13340
  }
13309
13341
  async writeShieldForMaven({
13310
13342
  writer,
13311
13343
  maven
13312
13344
  }) {
13313
13345
  await writer.write("[![Maven Central]");
13314
- await writer.write(
13315
- `(https://img.shields.io/maven-central/v/${maven.group}/${maven.artifact})]`
13316
- );
13317
- await writer.writeLine(
13318
- `(https://central.sonatype.com/artifact/${maven.group}/${maven.artifact})`
13319
- );
13346
+ await writer.write(`(https://img.shields.io/maven-central/v/${maven.group}/${maven.artifact})]`);
13347
+ await writer.writeLine(`(https://central.sonatype.com/artifact/${maven.group}/${maven.artifact})`);
13320
13348
  }
13321
13349
  async writeShieldForGo({
13322
13350
  writer,
@@ -13324,30 +13352,22 @@ var ReadmeGenerator = class {
13324
13352
  }) {
13325
13353
  await writer.write("[![go shield]");
13326
13354
  await writer.write("(https://img.shields.io/badge/go-docs-blue)]");
13327
- await writer.writeLine(
13328
- `(https://pkg.go.dev/github.com/${go.owner}/${go.repo})`
13329
- );
13355
+ await writer.writeLine(`(https://pkg.go.dev/github.com/${go.owner}/${go.repo})`);
13330
13356
  }
13331
13357
  async writeShieldForRubyGems({
13332
13358
  writer,
13333
13359
  rubyGems
13334
13360
  }) {
13335
13361
  await writer.write("[![gems shield]");
13336
- await writer.write(
13337
- `(https://img.shields.io/gem/v/${rubyGems.packageName})]`
13338
- );
13339
- await writer.writeLine(
13340
- `(https://rubygems.org/gems/${rubyGems.packageName})`
13341
- );
13362
+ await writer.write(`(https://img.shields.io/gem/v/${rubyGems.packageName})]`);
13363
+ await writer.writeLine(`(https://rubygems.org/gems/${rubyGems.packageName})`);
13342
13364
  }
13343
13365
  async writeShieldForNuget({
13344
13366
  writer,
13345
13367
  nuget
13346
13368
  }) {
13347
13369
  await writer.write("[![nuget shield]");
13348
- await writer.write(
13349
- `(https://img.shields.io/nuget/v/${nuget.packageName})]`
13350
- );
13370
+ await writer.write(`(https://img.shields.io/nuget/v/${nuget.packageName})]`);
13351
13371
  await writer.writeLine(`(https://nuget.org/packages/${nuget.packageName})`);
13352
13372
  }
13353
13373
  async writeShieldForComposer({
@@ -13356,29 +13376,21 @@ var ReadmeGenerator = class {
13356
13376
  }) {
13357
13377
  await writer.write("[![php shield]");
13358
13378
  await writer.write("(https://img.shields.io/badge/php-packagist-pink)]");
13359
- await writer.writeLine(
13360
- `(https://packagist.org/packages/${composer.packageName})`
13361
- );
13379
+ await writer.writeLine(`(https://packagist.org/packages/${composer.packageName})`);
13362
13380
  }
13363
13381
  async writeShieldForCargo({
13364
13382
  writer,
13365
13383
  cargo
13366
13384
  }) {
13367
13385
  await writer.write("[![crates.io shield]");
13368
- await writer.write(
13369
- `(https://img.shields.io/crates/v/${this.getCrateNameFromPackageName(cargo.packageName)})]`
13370
- );
13371
- await writer.writeLine(
13372
- `(https://crates.io/crates/${this.getCrateNameFromPackageName(cargo.packageName)})`
13373
- );
13386
+ await writer.write(`(https://img.shields.io/crates/v/${this.getCrateNameFromPackageName(cargo.packageName)})]`);
13387
+ await writer.writeLine(`(https://crates.io/crates/${this.getCrateNameFromPackageName(cargo.packageName)})`);
13374
13388
  }
13375
13389
  async writeShieldForSwiftPackageManager({
13376
13390
  writer
13377
13391
  }) {
13378
13392
  await writer.write("![SwiftPM compatible]");
13379
- await writer.writeLine(
13380
- "(https://img.shields.io/badge/SwiftPM-compatible-orange.svg)"
13381
- );
13393
+ await writer.writeLine("(https://img.shields.io/badge/SwiftPM-compatible-orange.svg)");
13382
13394
  }
13383
13395
  generateContributing() {
13384
13396
  return new Block({
@@ -13395,14 +13407,10 @@ On the other hand, contributions to the README are always very welcome!
13395
13407
  `
13396
13408
  });
13397
13409
  }
13398
- shouldSkipFeature({
13399
- feature
13400
- }) {
13410
+ shouldSkipFeature({ feature }) {
13401
13411
  return this.featureDisabled(feature.id) || !feature.snippetsAreOptional && (feature.snippets == null || feature.snippets.length === 0);
13402
13412
  }
13403
- shouldGenerateFeatures({
13404
- features
13405
- }) {
13413
+ shouldGenerateFeatures({ features }) {
13406
13414
  return features.some((feature) => !this.shouldSkipFeature({ feature }));
13407
13415
  }
13408
13416
  };
@@ -13500,9 +13508,7 @@ var ReferenceGenerator = class {
13500
13508
  }) {
13501
13509
  this.referenceConfig = referenceConfig;
13502
13510
  }
13503
- async generate({
13504
- output
13505
- }) {
13511
+ async generate({ output }) {
13506
13512
  const writer = new StreamWriter(output);
13507
13513
  await writer.writeLine("# Reference");
13508
13514
  if (this.referenceConfig.rootSection != null) {
@@ -13527,10 +13533,7 @@ var ReferenceGenerator = class {
13527
13533
  await this.writeEndpoint({ endpoint, writer });
13528
13534
  }
13529
13535
  }
13530
- async writeSection({
13531
- section,
13532
- writer
13533
- }) {
13536
+ async writeSection({ section, writer }) {
13534
13537
  await writer.writeLine(`## ${section.title}`);
13535
13538
  if (section.description != null) {
13536
13539
  await writer.writeLine(section.description);
@@ -13539,10 +13542,7 @@ var ReferenceGenerator = class {
13539
13542
  await this.writeEndpoint({ endpoint, writer });
13540
13543
  }
13541
13544
  }
13542
- async writeEndpoint({
13543
- endpoint,
13544
- writer
13545
- }) {
13545
+ async writeEndpoint({ endpoint, writer }) {
13546
13546
  const stringWriter = new StringWriter();
13547
13547
  if (endpoint.description != null) {
13548
13548
  await stringWriter.writeLine(
@@ -13569,9 +13569,7 @@ ${endpoint.snippet}
13569
13569
  `#### \u2699\uFE0F Parameters
13570
13570
 
13571
13571
  ${this.generateIndentedBlock(
13572
- endpoint.parameters.map(
13573
- (parameter) => this.generateIndentedBlock(this.generateParameter(parameter))
13574
- ).join("\n\n")
13572
+ endpoint.parameters.map((parameter) => this.generateIndentedBlock(this.generateParameter(parameter))).join("\n\n")
13575
13573
  )}
13576
13574
  `
13577
13575
  );
@@ -13580,9 +13578,7 @@ ${this.generateIndentedBlock(
13580
13578
  if (endpoint.title.returnValue != null) {
13581
13579
  linkedSnippet += ` -> ${this.wrapInLink(endpoint.title.returnValue.text, endpoint.title.returnValue.location)}`;
13582
13580
  }
13583
- await writer.writeLine(
13584
- `<details><summary><code>${linkedSnippet}</code></summary>`
13585
- );
13581
+ await writer.writeLine(`<details><summary><code>${linkedSnippet}</code></summary>`);
13586
13582
  await writer.writeLine(this.generateIndentedBlock(stringWriter.toString()));
13587
13583
  await writer.writeLine("</details>\n");
13588
13584
  }
@@ -13624,19 +13620,17 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13624
13620
  }),
13625
13621
  async (argv) => {
13626
13622
  if (argv.config == null) {
13627
- process.stderr.write(
13628
- "missing required arguments; please specify the --config flag\n"
13629
- );
13623
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13630
13624
  process.exit(1);
13631
13625
  }
13632
13626
  const wd = cwd();
13633
13627
  const readmeConfig = await loadReadmeConfig({
13634
- absolutePathToConfig: resolve5(wd, argv.config)
13628
+ absolutePathToConfig: resolve(wd, argv.config)
13635
13629
  });
13636
13630
  const generator = new ReadmeGenerator({
13637
13631
  readmeParser: new ReadmeParser(),
13638
13632
  readmeConfig,
13639
- originalReadme: argv.originalReadme != null ? await (0, import_promises6.readFile)(argv.originalReadme, "utf8") : void 0
13633
+ originalReadme: argv.originalReadme != null ? await (0, import_promises7.readFile)(argv.originalReadme, "utf8") : void 0
13640
13634
  });
13641
13635
  await generator.generateReadme({
13642
13636
  output: await createWriteStream(argv.output)
@@ -13655,14 +13649,12 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13655
13649
  }),
13656
13650
  async (argv) => {
13657
13651
  if (argv.config == null) {
13658
- process.stderr.write(
13659
- "missing required arguments; please specify the --config flag\n"
13660
- );
13652
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13661
13653
  process.exit(1);
13662
13654
  }
13663
13655
  const wd = cwd();
13664
13656
  const referenceConfig = await loadReferenceConfig({
13665
- absolutePathToConfig: resolve5(wd, argv.config)
13657
+ absolutePathToConfig: resolve(wd, argv.config)
13666
13658
  });
13667
13659
  const generator = new ReferenceGenerator({
13668
13660
  referenceConfig
@@ -13672,6 +13664,31 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13672
13664
  });
13673
13665
  process.exit(0);
13674
13666
  }
13667
+ ).command(
13668
+ "write-metadata",
13669
+ "Write metadata to the output directory using the provided configuration file.",
13670
+ (argv) => argv.option("config", {
13671
+ string: true,
13672
+ required: true
13673
+ }).option("output", {
13674
+ string: true,
13675
+ required: false
13676
+ }),
13677
+ async (argv) => {
13678
+ if (argv.config == null) {
13679
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13680
+ process.exit(1);
13681
+ }
13682
+ const wd = cwd();
13683
+ const metadata = await loadMetadataConfig({
13684
+ absolutePathToConfig: resolve(wd, argv.config)
13685
+ });
13686
+ const outputPath = argv.output != null ? resolve(wd, argv.output) : resolve(wd, ".fern/metadata.json");
13687
+ const formattedMetadata = JSON.stringify(metadata, null, 2);
13688
+ await (0, import_promises7.mkdir)(import_path7.default.dirname(outputPath), { recursive: true });
13689
+ await (0, import_promises7.writeFile)(outputPath, formattedMetadata, "utf8");
13690
+ process.exit(0);
13691
+ }
13675
13692
  ).command("github", "GitHub operations", (yargs) => {
13676
13693
  return yargs.command(
13677
13694
  "push",
@@ -13685,14 +13702,12 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13685
13702
  },
13686
13703
  async (argv) => {
13687
13704
  if (argv.config == null) {
13688
- process.stderr.write(
13689
- "missing required arguments; please specify the --config flag\n"
13690
- );
13705
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13691
13706
  process.exit(1);
13692
13707
  }
13693
13708
  const wd = cwd();
13694
13709
  const githubConfig = await loadGitHubConfig({
13695
- absolutePathToConfig: resolve5(wd, argv.config)
13710
+ absolutePathToConfig: resolve(wd, argv.config)
13696
13711
  });
13697
13712
  const github = new GitHub({
13698
13713
  githubConfig
@@ -13712,23 +13727,19 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13712
13727
  },
13713
13728
  async (argv) => {
13714
13729
  if (argv.config == null) {
13715
- process.stderr.write(
13716
- "missing required arguments; please specify the --config flag\n"
13717
- );
13730
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13718
13731
  process.exit(1);
13719
13732
  }
13720
13733
  const wd = cwd();
13721
13734
  const githubConfig = await loadGitHubConfig({
13722
- absolutePathToConfig: resolve5(wd, argv.config)
13735
+ absolutePathToConfig: resolve(wd, argv.config)
13723
13736
  });
13724
13737
  const github = new GitHub({
13725
13738
  githubConfig
13726
13739
  });
13727
13740
  await github.pr();
13728
- process.stderr.write(
13729
- `Creating PR on GitHub with config: ${resolve5(wd, argv.config)}
13730
- `
13731
- );
13741
+ process.stderr.write(`Creating PR on GitHub with config: ${resolve(wd, argv.config)}
13742
+ `);
13732
13743
  process.exit(0);
13733
13744
  }
13734
13745
  ).command(
@@ -13743,12 +13754,10 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13743
13754
  },
13744
13755
  async (argv) => {
13745
13756
  if (argv.config == null) {
13746
- process.stderr.write(
13747
- "missing required arguments; please specify the --config flag\n"
13748
- );
13757
+ process.stderr.write("missing required arguments; please specify the --config flag\n");
13749
13758
  const wd2 = cwd();
13750
13759
  const githubConfig = await loadGitHubConfig({
13751
- absolutePathToConfig: resolve5(wd2, argv.config)
13760
+ absolutePathToConfig: resolve(wd2, argv.config)
13752
13761
  });
13753
13762
  const github = new GitHub({
13754
13763
  githubConfig
@@ -13757,20 +13766,18 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
13757
13766
  process.exit(1);
13758
13767
  }
13759
13768
  const wd = cwd();
13760
- process.stderr.write(
13761
- `Creating release on GitHub with config: ${resolve5(wd, argv.config)}
13762
- `
13763
- );
13769
+ process.stderr.write(`Creating release on GitHub with config: ${resolve(wd, argv.config)}
13770
+ `);
13764
13771
  process.exit(0);
13765
13772
  }
13766
13773
  ).demandCommand();
13767
13774
  }).demandCommand().showHelpOnFail(true).parse();
13768
13775
  async function createWriteStream(outputPath) {
13769
- return outputPath != null ? await createWriteStreamFromFile(resolve5(cwd(), outputPath)) : process.stdout;
13776
+ return outputPath != null ? await createWriteStreamFromFile(resolve(cwd(), outputPath)) : process.stdout;
13770
13777
  }
13771
13778
  async function createWriteStreamFromFile(filepath) {
13772
13779
  if (!await doesPathExist(filepath)) {
13773
- await (0, import_promises6.mkdir)(import_path7.default.dirname(filepath), { recursive: true });
13780
+ await (0, import_promises7.mkdir)(import_path7.default.dirname(filepath), { recursive: true });
13774
13781
  }
13775
13782
  return import_fs6.default.createWriteStream(filepath);
13776
13783
  }
@@ -13786,26 +13793,8 @@ tmp/lib/tmp.js:
13786
13793
  *)
13787
13794
 
13788
13795
  yargs-parser/build/lib/string-utils.js:
13789
- (**
13790
- * @license
13791
- * Copyright (c) 2016, Contributors
13792
- * SPDX-License-Identifier: ISC
13793
- *)
13794
-
13795
13796
  yargs-parser/build/lib/tokenize-arg-string.js:
13796
- (**
13797
- * @license
13798
- * Copyright (c) 2016, Contributors
13799
- * SPDX-License-Identifier: ISC
13800
- *)
13801
-
13802
13797
  yargs-parser/build/lib/yargs-parser-types.js:
13803
- (**
13804
- * @license
13805
- * Copyright (c) 2016, Contributors
13806
- * SPDX-License-Identifier: ISC
13807
- *)
13808
-
13809
13798
  yargs-parser/build/lib/yargs-parser.js:
13810
13799
  (**
13811
13800
  * @license