@fern-api/generator-cli 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +903 -1495
- package/package.json +21 -25
package/dist/cli.cjs
CHANGED
|
@@ -30,578 +30,205 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
mod
|
|
31
31
|
));
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/.pnpm/
|
|
34
|
-
var
|
|
35
|
-
"../../node_modules/.pnpm/
|
|
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) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var fs2 = require("fs");
|
|
38
|
-
var
|
|
38
|
+
var util = require("util");
|
|
39
39
|
var path4 = require("path");
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var FILE_MODE = 384;
|
|
51
|
-
var EXIT = "exit";
|
|
52
|
-
var _removeObjects = [];
|
|
53
|
-
var FN_RMDIR_SYNC = fs2.rmdirSync.bind(fs2);
|
|
54
|
-
var _gracefulCleanup = false;
|
|
55
|
-
function rimraf(dirPath, callback) {
|
|
56
|
-
return fs2.rm(dirPath, { recursive: true }, callback);
|
|
57
|
-
}
|
|
58
|
-
function FN_RIMRAF_SYNC(dirPath) {
|
|
59
|
-
return fs2.rmSync(dirPath, { recursive: true });
|
|
60
|
-
}
|
|
61
|
-
function tmpName(options, callback) {
|
|
62
|
-
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
63
|
-
try {
|
|
64
|
-
_assertAndSanitizeOptions(opts);
|
|
65
|
-
} catch (err) {
|
|
66
|
-
return cb(err);
|
|
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 = [];
|
|
67
50
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const name = _generateTmpName(opts);
|
|
72
|
-
fs2.stat(name, function(err) {
|
|
73
|
-
if (!err) {
|
|
74
|
-
if (tries-- > 0)
|
|
75
|
-
return _getUniqueName();
|
|
76
|
-
return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
|
|
77
|
-
}
|
|
78
|
-
cb(null, name);
|
|
79
|
-
});
|
|
80
|
-
} catch (err) {
|
|
81
|
-
cb(err);
|
|
51
|
+
__(...args) {
|
|
52
|
+
if (typeof arguments[0] !== "string") {
|
|
53
|
+
return this._taggedLiteral(arguments[0], ...arguments);
|
|
82
54
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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();
|
|
95
73
|
}
|
|
96
|
-
|
|
97
|
-
throw new Error("Could not get a unique tmp filename, max tries reached");
|
|
98
|
-
}
|
|
99
|
-
function file(options, callback) {
|
|
100
|
-
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
101
|
-
tmpName(opts, function _tmpNameCreated(err, name) {
|
|
102
|
-
if (err)
|
|
103
|
-
return cb(err);
|
|
104
|
-
fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
105
|
-
if (err2)
|
|
106
|
-
return cb(err2);
|
|
107
|
-
if (opts.discardDescriptor) {
|
|
108
|
-
return fs2.close(fd, function _discardCallback(possibleErr) {
|
|
109
|
-
return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false));
|
|
110
|
-
});
|
|
111
|
-
} else {
|
|
112
|
-
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
113
|
-
cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
function fileSync(options) {
|
|
119
|
-
const args = _parseArguments(options), opts = args[0];
|
|
120
|
-
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
121
|
-
const name = tmpNameSync(opts);
|
|
122
|
-
var fd = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
123
|
-
if (opts.discardDescriptor) {
|
|
124
|
-
fs2.closeSync(fd);
|
|
125
|
-
fd = void 0;
|
|
74
|
+
return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args));
|
|
126
75
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function dirSync(options) {
|
|
146
|
-
const args = _parseArguments(options), opts = args[0];
|
|
147
|
-
const name = tmpNameSync(opts);
|
|
148
|
-
fs2.mkdirSync(name, opts.mode || DIR_MODE);
|
|
149
|
-
return {
|
|
150
|
-
name,
|
|
151
|
-
removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function _removeFileAsync(fdPath, next) {
|
|
155
|
-
const _handler = function(err) {
|
|
156
|
-
if (err && !_isENOENT(err)) {
|
|
157
|
-
return next(err);
|
|
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"];
|
|
158
91
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (0 <= fdPath[0])
|
|
172
|
-
fs2.closeSync(fdPath[0]);
|
|
173
|
-
} catch (e) {
|
|
174
|
-
if (!_isEBADF(e) && !_isENOENT(e))
|
|
175
|
-
throw e;
|
|
176
|
-
} finally {
|
|
177
|
-
try {
|
|
178
|
-
fs2.unlinkSync(fdPath[1]);
|
|
179
|
-
} catch (e) {
|
|
180
|
-
if (!_isENOENT(e))
|
|
181
|
-
rethrownException = e;
|
|
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();
|
|
182
104
|
}
|
|
105
|
+
const values = [str];
|
|
106
|
+
if (~str.indexOf("%d"))
|
|
107
|
+
values.push(quantity);
|
|
108
|
+
return shim2.format.apply(shim2.format, values.concat(args));
|
|
183
109
|
}
|
|
184
|
-
|
|
185
|
-
|
|
110
|
+
setLocale(locale) {
|
|
111
|
+
this.locale = locale;
|
|
186
112
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const removeFunction = opts.unsafeCleanup ? rimraf : fs2.rmdir.bind(fs2);
|
|
197
|
-
const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
|
|
198
|
-
const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);
|
|
199
|
-
const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);
|
|
200
|
-
if (!opts.keep)
|
|
201
|
-
_removeObjects.unshift(removeCallbackSync);
|
|
202
|
-
return sync ? removeCallbackSync : removeCallback;
|
|
203
|
-
}
|
|
204
|
-
function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
|
|
205
|
-
let called = false;
|
|
206
|
-
return function _cleanupCallback(next) {
|
|
207
|
-
if (!called) {
|
|
208
|
-
const toRemove = cleanupCallbackSync || _cleanupCallback;
|
|
209
|
-
const index = _removeObjects.indexOf(toRemove);
|
|
210
|
-
if (index >= 0)
|
|
211
|
-
_removeObjects.splice(index, 1);
|
|
212
|
-
called = true;
|
|
213
|
-
if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
|
|
214
|
-
return removeFunction(fileOrDirName);
|
|
215
|
-
} else {
|
|
216
|
-
return removeFunction(fileOrDirName, next || function() {
|
|
217
|
-
});
|
|
113
|
+
getLocale() {
|
|
114
|
+
return this.locale;
|
|
115
|
+
}
|
|
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];
|
|
218
122
|
}
|
|
219
123
|
}
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function _garbageCollector() {
|
|
223
|
-
if (!_gracefulCleanup)
|
|
224
|
-
return;
|
|
225
|
-
while (_removeObjects.length) {
|
|
226
|
-
try {
|
|
227
|
-
_removeObjects[0]();
|
|
228
|
-
} catch (e) {
|
|
229
|
-
}
|
|
230
124
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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)));
|
|
238
135
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
function _isBlank(s) {
|
|
245
|
-
return s === null || _isUndefined(s) || !s.trim();
|
|
246
|
-
}
|
|
247
|
-
function _isUndefined(obj) {
|
|
248
|
-
return typeof obj === "undefined";
|
|
249
|
-
}
|
|
250
|
-
function _parseArguments(options, callback) {
|
|
251
|
-
if (typeof options === "function") {
|
|
252
|
-
return [{}, options];
|
|
136
|
+
_enqueueWrite(work) {
|
|
137
|
+
this.writeQueue.push(work);
|
|
138
|
+
if (this.writeQueue.length === 1)
|
|
139
|
+
this._processWriteQueue();
|
|
253
140
|
}
|
|
254
|
-
|
|
255
|
-
|
|
141
|
+
_processWriteQueue() {
|
|
142
|
+
const _this = this;
|
|
143
|
+
const work = this.writeQueue[0];
|
|
144
|
+
const directory = work.directory;
|
|
145
|
+
const locale = work.locale;
|
|
146
|
+
const cb = work.cb;
|
|
147
|
+
const languageFile = this._resolveLocaleFile(directory, locale);
|
|
148
|
+
const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
|
|
149
|
+
shim2.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
|
|
150
|
+
_this.writeQueue.shift();
|
|
151
|
+
if (_this.writeQueue.length > 0)
|
|
152
|
+
_this._processWriteQueue();
|
|
153
|
+
cb(err);
|
|
154
|
+
});
|
|
256
155
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
156
|
+
_readLocaleFile() {
|
|
157
|
+
let localeLookup = {};
|
|
158
|
+
const languageFile = this._resolveLocaleFile(this.directory, this.locale);
|
|
159
|
+
try {
|
|
160
|
+
if (shim2.fs.readFileSync) {
|
|
161
|
+
localeLookup = JSON.parse(shim2.fs.readFileSync(languageFile, "utf-8"));
|
|
162
|
+
}
|
|
163
|
+
} catch (err) {
|
|
164
|
+
if (err instanceof SyntaxError) {
|
|
165
|
+
err.message = "syntax error in " + languageFile;
|
|
166
|
+
}
|
|
167
|
+
if (err.code === "ENOENT")
|
|
168
|
+
localeLookup = {};
|
|
169
|
+
else
|
|
170
|
+
throw err;
|
|
171
|
+
}
|
|
172
|
+
this.cache[this.locale] = localeLookup;
|
|
260
173
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return
|
|
269
|
-
const name = [
|
|
270
|
-
opts.prefix ? opts.prefix : "tmp",
|
|
271
|
-
"-",
|
|
272
|
-
process.pid,
|
|
273
|
-
"-",
|
|
274
|
-
_randomChars(12),
|
|
275
|
-
opts.postfix ? "-" + opts.postfix : ""
|
|
276
|
-
].join("");
|
|
277
|
-
return path4.join(tmpDir, opts.dir, name);
|
|
278
|
-
}
|
|
279
|
-
function _assertAndSanitizeOptions(options) {
|
|
280
|
-
options.tmpdir = _getTmpDir(options);
|
|
281
|
-
const tmpDir = options.tmpdir;
|
|
282
|
-
if (!_isUndefined(options.name))
|
|
283
|
-
_assertIsRelative(options.name, "name", tmpDir);
|
|
284
|
-
if (!_isUndefined(options.dir))
|
|
285
|
-
_assertIsRelative(options.dir, "dir", tmpDir);
|
|
286
|
-
if (!_isUndefined(options.template)) {
|
|
287
|
-
_assertIsRelative(options.template, "template", tmpDir);
|
|
288
|
-
if (!options.template.match(TEMPLATE_PATTERN))
|
|
289
|
-
throw new Error(`Invalid template, found "${options.template}".`);
|
|
174
|
+
_resolveLocaleFile(directory, locale) {
|
|
175
|
+
let file = shim2.resolve(directory, "./", locale + ".json");
|
|
176
|
+
if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) {
|
|
177
|
+
const languageFile = shim2.resolve(directory, "./", locale.split("_")[0] + ".json");
|
|
178
|
+
if (this._fileExistsSync(languageFile))
|
|
179
|
+
file = languageFile;
|
|
180
|
+
}
|
|
181
|
+
return file;
|
|
290
182
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
|
|
294
|
-
options.keep = !!options.keep;
|
|
295
|
-
options.detachDescriptor = !!options.detachDescriptor;
|
|
296
|
-
options.discardDescriptor = !!options.discardDescriptor;
|
|
297
|
-
options.unsafeCleanup = !!options.unsafeCleanup;
|
|
298
|
-
options.dir = _isUndefined(options.dir) ? "" : path4.relative(tmpDir, _resolvePath(options.dir, tmpDir));
|
|
299
|
-
options.template = _isUndefined(options.template) ? void 0 : path4.relative(tmpDir, _resolvePath(options.template, tmpDir));
|
|
300
|
-
options.template = _isBlank(options.template) ? void 0 : path4.relative(options.dir, options.template);
|
|
301
|
-
options.name = _isUndefined(options.name) ? void 0 : options.name;
|
|
302
|
-
options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
|
|
303
|
-
options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
|
|
304
|
-
}
|
|
305
|
-
function _resolvePath(name, tmpDir) {
|
|
306
|
-
if (name.startsWith(tmpDir)) {
|
|
307
|
-
return path4.resolve(name);
|
|
308
|
-
} else {
|
|
309
|
-
return path4.resolve(path4.join(tmpDir, name));
|
|
183
|
+
_fileExistsSync(file) {
|
|
184
|
+
return shim2.exists(file);
|
|
310
185
|
}
|
|
186
|
+
};
|
|
187
|
+
function y18n$1(opts, _shim) {
|
|
188
|
+
shim2 = _shim;
|
|
189
|
+
const y18n4 = new Y18N2(opts);
|
|
190
|
+
return {
|
|
191
|
+
__: y18n4.__.bind(y18n4),
|
|
192
|
+
__n: y18n4.__n.bind(y18n4),
|
|
193
|
+
setLocale: y18n4.setLocale.bind(y18n4),
|
|
194
|
+
getLocale: y18n4.getLocale.bind(y18n4),
|
|
195
|
+
updateLocale: y18n4.updateLocale.bind(y18n4),
|
|
196
|
+
locale: y18n4.locale
|
|
197
|
+
};
|
|
311
198
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
199
|
+
var nodePlatformShim = {
|
|
200
|
+
fs: {
|
|
201
|
+
readFileSync: fs2.readFileSync,
|
|
202
|
+
writeFile: fs2.writeFile
|
|
203
|
+
},
|
|
204
|
+
format: util.format,
|
|
205
|
+
resolve: path4.resolve,
|
|
206
|
+
exists: (file) => {
|
|
207
|
+
try {
|
|
208
|
+
return fs2.statSync(file).isFile();
|
|
209
|
+
} catch (err) {
|
|
210
|
+
return false;
|
|
322
211
|
}
|
|
323
|
-
let resolvedPath = _resolvePath(name, tmpDir);
|
|
324
|
-
if (!resolvedPath.startsWith(tmpDir))
|
|
325
|
-
throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
function _isEBADF(error) {
|
|
329
|
-
return _isExpectedError(error, -EBADF, "EBADF");
|
|
330
|
-
}
|
|
331
|
-
function _isENOENT(error) {
|
|
332
|
-
return _isExpectedError(error, -ENOENT, "ENOENT");
|
|
333
|
-
}
|
|
334
|
-
function _isExpectedError(error, errno, code) {
|
|
335
|
-
return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;
|
|
336
|
-
}
|
|
337
|
-
function setGracefulCleanup() {
|
|
338
|
-
_gracefulCleanup = true;
|
|
339
|
-
}
|
|
340
|
-
function _getTmpDir(options) {
|
|
341
|
-
return path4.resolve(options && options.tmpdir || os.tmpdir());
|
|
342
|
-
}
|
|
343
|
-
process.addListener(EXIT, _garbageCollector);
|
|
344
|
-
Object.defineProperty(module2.exports, "tmpdir", {
|
|
345
|
-
enumerable: true,
|
|
346
|
-
configurable: false,
|
|
347
|
-
get: function() {
|
|
348
|
-
return _getTmpDir();
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
module2.exports.dir = dir;
|
|
352
|
-
module2.exports.dirSync = dirSync;
|
|
353
|
-
module2.exports.file = file;
|
|
354
|
-
module2.exports.fileSync = fileSync;
|
|
355
|
-
module2.exports.tmpName = tmpName;
|
|
356
|
-
module2.exports.tmpNameSync = tmpNameSync;
|
|
357
|
-
module2.exports.setGracefulCleanup = setGracefulCleanup;
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
// ../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js
|
|
362
|
-
var require_tmp_promise = __commonJS({
|
|
363
|
-
"../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js"(exports2, module2) {
|
|
364
|
-
"use strict";
|
|
365
|
-
var { promisify } = require("util");
|
|
366
|
-
var tmp2 = require_tmp();
|
|
367
|
-
module2.exports.fileSync = tmp2.fileSync;
|
|
368
|
-
var fileWithOptions = promisify(
|
|
369
|
-
(options, cb) => tmp2.file(
|
|
370
|
-
options,
|
|
371
|
-
(err, path4, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path4, fd, cleanup: promisify(cleanup) })
|
|
372
|
-
)
|
|
373
|
-
);
|
|
374
|
-
module2.exports.file = async (options) => fileWithOptions(options);
|
|
375
|
-
module2.exports.withFile = async function withFile(fn, options) {
|
|
376
|
-
const { path: path4, fd, cleanup } = await module2.exports.file(options);
|
|
377
|
-
try {
|
|
378
|
-
return await fn({ path: path4, fd });
|
|
379
|
-
} finally {
|
|
380
|
-
await cleanup();
|
|
381
212
|
}
|
|
382
213
|
};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
(options, cb) => tmp2.dir(
|
|
386
|
-
options,
|
|
387
|
-
(err, path4, cleanup) => err ? cb(err) : cb(void 0, { path: path4, cleanup: promisify(cleanup) })
|
|
388
|
-
)
|
|
389
|
-
);
|
|
390
|
-
module2.exports.dir = async (options) => dirWithOptions(options);
|
|
391
|
-
module2.exports.withDir = async function withDir(fn, options) {
|
|
392
|
-
const { path: path4, cleanup } = await module2.exports.dir(options);
|
|
393
|
-
try {
|
|
394
|
-
return await fn({ path: path4 });
|
|
395
|
-
} finally {
|
|
396
|
-
await cleanup();
|
|
397
|
-
}
|
|
214
|
+
var y18n3 = (opts) => {
|
|
215
|
+
return y18n$1(opts, nodePlatformShim);
|
|
398
216
|
};
|
|
399
|
-
module2.exports
|
|
400
|
-
module2.exports.tmpName = promisify(tmp2.tmpName);
|
|
401
|
-
module2.exports.tmpdir = tmp2.tmpdir;
|
|
402
|
-
module2.exports.setGracefulCleanup = tmp2.setGracefulCleanup;
|
|
217
|
+
module2.exports = y18n3;
|
|
403
218
|
}
|
|
404
219
|
});
|
|
405
220
|
|
|
406
|
-
// ../../node_modules/.pnpm/
|
|
407
|
-
var
|
|
408
|
-
"../../node_modules/.pnpm/
|
|
221
|
+
// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs
|
|
222
|
+
var require_build2 = __commonJS({
|
|
223
|
+
"../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs"(exports2, module2) {
|
|
409
224
|
"use strict";
|
|
410
|
-
var fs2 = require("fs");
|
|
411
225
|
var util = require("util");
|
|
412
226
|
var path4 = require("path");
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
|
|
419
|
-
this.locale = opts.locale || "en";
|
|
420
|
-
this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
|
|
421
|
-
this.cache = /* @__PURE__ */ Object.create(null);
|
|
422
|
-
this.writeQueue = [];
|
|
423
|
-
}
|
|
424
|
-
__(...args) {
|
|
425
|
-
if (typeof arguments[0] !== "string") {
|
|
426
|
-
return this._taggedLiteral(arguments[0], ...arguments);
|
|
427
|
-
}
|
|
428
|
-
const str = args.shift();
|
|
429
|
-
let cb = function() {
|
|
430
|
-
};
|
|
431
|
-
if (typeof args[args.length - 1] === "function")
|
|
432
|
-
cb = args.pop();
|
|
433
|
-
cb = cb || function() {
|
|
434
|
-
};
|
|
435
|
-
if (!this.cache[this.locale])
|
|
436
|
-
this._readLocaleFile();
|
|
437
|
-
if (!this.cache[this.locale][str] && this.updateFiles) {
|
|
438
|
-
this.cache[this.locale][str] = str;
|
|
439
|
-
this._enqueueWrite({
|
|
440
|
-
directory: this.directory,
|
|
441
|
-
locale: this.locale,
|
|
442
|
-
cb
|
|
443
|
-
});
|
|
444
|
-
} else {
|
|
445
|
-
cb();
|
|
446
|
-
}
|
|
447
|
-
return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args));
|
|
448
|
-
}
|
|
449
|
-
__n() {
|
|
450
|
-
const args = Array.prototype.slice.call(arguments);
|
|
451
|
-
const singular = args.shift();
|
|
452
|
-
const plural = args.shift();
|
|
453
|
-
const quantity = args.shift();
|
|
454
|
-
let cb = function() {
|
|
455
|
-
};
|
|
456
|
-
if (typeof args[args.length - 1] === "function")
|
|
457
|
-
cb = args.pop();
|
|
458
|
-
if (!this.cache[this.locale])
|
|
459
|
-
this._readLocaleFile();
|
|
460
|
-
let str = quantity === 1 ? singular : plural;
|
|
461
|
-
if (this.cache[this.locale][singular]) {
|
|
462
|
-
const entry = this.cache[this.locale][singular];
|
|
463
|
-
str = entry[quantity === 1 ? "one" : "other"];
|
|
464
|
-
}
|
|
465
|
-
if (!this.cache[this.locale][singular] && this.updateFiles) {
|
|
466
|
-
this.cache[this.locale][singular] = {
|
|
467
|
-
one: singular,
|
|
468
|
-
other: plural
|
|
469
|
-
};
|
|
470
|
-
this._enqueueWrite({
|
|
471
|
-
directory: this.directory,
|
|
472
|
-
locale: this.locale,
|
|
473
|
-
cb
|
|
474
|
-
});
|
|
475
|
-
} else {
|
|
476
|
-
cb();
|
|
477
|
-
}
|
|
478
|
-
const values = [str];
|
|
479
|
-
if (~str.indexOf("%d"))
|
|
480
|
-
values.push(quantity);
|
|
481
|
-
return shim2.format.apply(shim2.format, values.concat(args));
|
|
482
|
-
}
|
|
483
|
-
setLocale(locale) {
|
|
484
|
-
this.locale = locale;
|
|
485
|
-
}
|
|
486
|
-
getLocale() {
|
|
487
|
-
return this.locale;
|
|
488
|
-
}
|
|
489
|
-
updateLocale(obj) {
|
|
490
|
-
if (!this.cache[this.locale])
|
|
491
|
-
this._readLocaleFile();
|
|
492
|
-
for (const key in obj) {
|
|
493
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
494
|
-
this.cache[this.locale][key] = obj[key];
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
_taggedLiteral(parts, ...args) {
|
|
499
|
-
let str = "";
|
|
500
|
-
parts.forEach(function(part, i) {
|
|
501
|
-
const arg = args[i + 1];
|
|
502
|
-
str += part;
|
|
503
|
-
if (typeof arg !== "undefined") {
|
|
504
|
-
str += "%s";
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
return this.__.apply(this, [str].concat([].slice.call(args, 1)));
|
|
508
|
-
}
|
|
509
|
-
_enqueueWrite(work) {
|
|
510
|
-
this.writeQueue.push(work);
|
|
511
|
-
if (this.writeQueue.length === 1)
|
|
512
|
-
this._processWriteQueue();
|
|
513
|
-
}
|
|
514
|
-
_processWriteQueue() {
|
|
515
|
-
const _this = this;
|
|
516
|
-
const work = this.writeQueue[0];
|
|
517
|
-
const directory = work.directory;
|
|
518
|
-
const locale = work.locale;
|
|
519
|
-
const cb = work.cb;
|
|
520
|
-
const languageFile = this._resolveLocaleFile(directory, locale);
|
|
521
|
-
const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
|
|
522
|
-
shim2.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
|
|
523
|
-
_this.writeQueue.shift();
|
|
524
|
-
if (_this.writeQueue.length > 0)
|
|
525
|
-
_this._processWriteQueue();
|
|
526
|
-
cb(err);
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
_readLocaleFile() {
|
|
530
|
-
let localeLookup = {};
|
|
531
|
-
const languageFile = this._resolveLocaleFile(this.directory, this.locale);
|
|
532
|
-
try {
|
|
533
|
-
if (shim2.fs.readFileSync) {
|
|
534
|
-
localeLookup = JSON.parse(shim2.fs.readFileSync(languageFile, "utf-8"));
|
|
535
|
-
}
|
|
536
|
-
} catch (err) {
|
|
537
|
-
if (err instanceof SyntaxError) {
|
|
538
|
-
err.message = "syntax error in " + languageFile;
|
|
539
|
-
}
|
|
540
|
-
if (err.code === "ENOENT")
|
|
541
|
-
localeLookup = {};
|
|
542
|
-
else
|
|
543
|
-
throw err;
|
|
544
|
-
}
|
|
545
|
-
this.cache[this.locale] = localeLookup;
|
|
546
|
-
}
|
|
547
|
-
_resolveLocaleFile(directory, locale) {
|
|
548
|
-
let file = shim2.resolve(directory, "./", locale + ".json");
|
|
549
|
-
if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) {
|
|
550
|
-
const languageFile = shim2.resolve(directory, "./", locale.split("_")[0] + ".json");
|
|
551
|
-
if (this._fileExistsSync(languageFile))
|
|
552
|
-
file = languageFile;
|
|
553
|
-
}
|
|
554
|
-
return file;
|
|
555
|
-
}
|
|
556
|
-
_fileExistsSync(file) {
|
|
557
|
-
return shim2.exists(file);
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
function y18n$1(opts, _shim) {
|
|
561
|
-
shim2 = _shim;
|
|
562
|
-
const y18n4 = new Y18N2(opts);
|
|
563
|
-
return {
|
|
564
|
-
__: y18n4.__.bind(y18n4),
|
|
565
|
-
__n: y18n4.__n.bind(y18n4),
|
|
566
|
-
setLocale: y18n4.setLocale.bind(y18n4),
|
|
567
|
-
getLocale: y18n4.getLocale.bind(y18n4),
|
|
568
|
-
updateLocale: y18n4.updateLocale.bind(y18n4),
|
|
569
|
-
locale: y18n4.locale
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
var nodePlatformShim = {
|
|
573
|
-
fs: {
|
|
574
|
-
readFileSync: fs2.readFileSync,
|
|
575
|
-
writeFile: fs2.writeFile
|
|
576
|
-
},
|
|
577
|
-
format: util.format,
|
|
578
|
-
resolve: path4.resolve,
|
|
579
|
-
exists: (file) => {
|
|
580
|
-
try {
|
|
581
|
-
return fs2.statSync(file).isFile();
|
|
582
|
-
} catch (err) {
|
|
583
|
-
return false;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
|
-
var y18n3 = (opts) => {
|
|
588
|
-
return y18n$1(opts, nodePlatformShim);
|
|
589
|
-
};
|
|
590
|
-
module2.exports = y18n3;
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs
|
|
595
|
-
var require_build2 = __commonJS({
|
|
596
|
-
"../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs"(exports2, module2) {
|
|
597
|
-
"use strict";
|
|
598
|
-
var util = require("util");
|
|
599
|
-
var path4 = require("path");
|
|
600
|
-
var fs2 = require("fs");
|
|
601
|
-
function camelCase3(str) {
|
|
602
|
-
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
|
603
|
-
if (!isCamelCase) {
|
|
604
|
-
str = str.toLowerCase();
|
|
227
|
+
var fs2 = require("fs");
|
|
228
|
+
function camelCase3(str) {
|
|
229
|
+
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
|
230
|
+
if (!isCamelCase) {
|
|
231
|
+
str = str.toLowerCase();
|
|
605
232
|
}
|
|
606
233
|
if (str.indexOf("-") === -1 && str.indexOf("_") === -1) {
|
|
607
234
|
return str;
|
|
@@ -1501,8 +1128,8 @@ var require_build2 = __commonJS({
|
|
|
1501
1128
|
}
|
|
1502
1129
|
}
|
|
1503
1130
|
aliasArrays.forEach(function(aliasArray) {
|
|
1504
|
-
aliasArray = aliasArray.filter(function(v, i,
|
|
1505
|
-
return
|
|
1131
|
+
aliasArray = aliasArray.filter(function(v, i, self) {
|
|
1132
|
+
return self.indexOf(v) === i;
|
|
1506
1133
|
});
|
|
1507
1134
|
const lastAlias = aliasArray.pop();
|
|
1508
1135
|
if (lastAlias !== void 0 && typeof lastAlias === "string") {
|
|
@@ -2832,18 +2459,18 @@ var require_wrap_ansi = __commonJS({
|
|
|
2832
2459
|
}
|
|
2833
2460
|
};
|
|
2834
2461
|
var stringVisibleTrimSpacesRight = (string) => {
|
|
2835
|
-
const
|
|
2836
|
-
let last2 =
|
|
2462
|
+
const words = string.split(" ");
|
|
2463
|
+
let last2 = words.length;
|
|
2837
2464
|
while (last2 > 0) {
|
|
2838
|
-
if (stringWidth(
|
|
2465
|
+
if (stringWidth(words[last2 - 1]) > 0) {
|
|
2839
2466
|
break;
|
|
2840
2467
|
}
|
|
2841
2468
|
last2--;
|
|
2842
2469
|
}
|
|
2843
|
-
if (last2 ===
|
|
2470
|
+
if (last2 === words.length) {
|
|
2844
2471
|
return string;
|
|
2845
2472
|
}
|
|
2846
|
-
return
|
|
2473
|
+
return words.slice(0, last2).join(" ") + words.slice(last2).join("");
|
|
2847
2474
|
};
|
|
2848
2475
|
var exec = (string, columns, options = {}) => {
|
|
2849
2476
|
if (options.trim !== false && string.trim() === "") {
|
|
@@ -3218,11 +2845,9 @@ var require_sync = __commonJS({
|
|
|
3218
2845
|
}
|
|
3219
2846
|
while (true) {
|
|
3220
2847
|
tmp2 = callback(dir, readdirSync2(dir));
|
|
3221
|
-
if (tmp2)
|
|
3222
|
-
return resolve6(dir, tmp2);
|
|
2848
|
+
if (tmp2) return resolve6(dir, tmp2);
|
|
3223
2849
|
dir = dirname3(tmp2 = dir);
|
|
3224
|
-
if (tmp2 === dir)
|
|
3225
|
-
break;
|
|
2850
|
+
if (tmp2 === dir) break;
|
|
3226
2851
|
}
|
|
3227
2852
|
};
|
|
3228
2853
|
}
|
|
@@ -3331,23 +2956,19 @@ var require_build4 = __commonJS({
|
|
|
3331
2956
|
s = h2;
|
|
3332
2957
|
let l2 = {};
|
|
3333
2958
|
if (Object.prototype.hasOwnProperty.call(t2, "extends")) {
|
|
3334
|
-
if ("string" != typeof t2.extends)
|
|
3335
|
-
return l2;
|
|
2959
|
+
if ("string" != typeof t2.extends) return l2;
|
|
3336
2960
|
const r2 = /\.json|\..*rc$/.test(t2.extends);
|
|
3337
2961
|
let h3 = null;
|
|
3338
|
-
if (r2)
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
return t2;
|
|
3347
|
-
}
|
|
2962
|
+
if (r2) h3 = function(t3, e2) {
|
|
2963
|
+
return s.path.resolve(t3, e2);
|
|
2964
|
+
}(o2, t2.extends);
|
|
2965
|
+
else try {
|
|
2966
|
+
h3 = require.resolve(t2.extends);
|
|
2967
|
+
} catch (e2) {
|
|
2968
|
+
return t2;
|
|
2969
|
+
}
|
|
3348
2970
|
!function(t3) {
|
|
3349
|
-
if (i.indexOf(t3) > -1)
|
|
3350
|
-
throw new e(`Circular extended configurations: '${t3}'.`);
|
|
2971
|
+
if (i.indexOf(t3) > -1) throw new e(`Circular extended configurations: '${t3}'.`);
|
|
3351
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);
|
|
3352
2973
|
}
|
|
3353
2974
|
return i = [], a2 ? r(l2, t2) : Object.assign({}, l2, t2);
|
|
@@ -3358,14 +2979,12 @@ var require_build4 = __commonJS({
|
|
|
3358
2979
|
return t3 && "object" == typeof t3 && !Array.isArray(t3);
|
|
3359
2980
|
}
|
|
3360
2981
|
Object.assign(s2, t2);
|
|
3361
|
-
for (const n2 of Object.keys(e2))
|
|
3362
|
-
i2(e2[n2]) && i2(s2[n2]) ? s2[n2] = r(t2[n2], e2[n2]) : s2[n2] = e2[n2];
|
|
2982
|
+
for (const n2 of Object.keys(e2)) i2(e2[n2]) && i2(s2[n2]) ? s2[n2] = r(t2[n2], e2[n2]) : s2[n2] = e2[n2];
|
|
3363
2983
|
return s2;
|
|
3364
2984
|
}
|
|
3365
2985
|
function o(t2) {
|
|
3366
2986
|
const e2 = t2.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), s2 = /\.*[\][<>]/g, i2 = e2.shift();
|
|
3367
|
-
if (!i2)
|
|
3368
|
-
throw new Error(`No command found in: ${t2}`);
|
|
2987
|
+
if (!i2) throw new Error(`No command found in: ${t2}`);
|
|
3369
2988
|
const n2 = { cmd: i2.replace(s2, ""), demanded: [], optional: [] };
|
|
3370
2989
|
return e2.forEach((t3, i3) => {
|
|
3371
2990
|
let r2 = false;
|
|
@@ -3377,20 +2996,16 @@ var require_build4 = __commonJS({
|
|
|
3377
2996
|
try {
|
|
3378
2997
|
let n2 = 0;
|
|
3379
2998
|
const [r2, a2, h2] = "object" == typeof t2 ? [{ demanded: [], optional: [] }, t2, s2] : [o(`cmd ${t2}`), s2, i2], f2 = [].slice.call(a2);
|
|
3380
|
-
for (; f2.length && void 0 === f2[f2.length - 1]; )
|
|
3381
|
-
f2.pop();
|
|
2999
|
+
for (; f2.length && void 0 === f2[f2.length - 1]; ) f2.pop();
|
|
3382
3000
|
const d2 = h2 || f2.length;
|
|
3383
|
-
if (d2 < r2.demanded.length)
|
|
3384
|
-
throw new e(`Not enough arguments provided. Expected ${r2.demanded.length} but received ${f2.length}.`);
|
|
3001
|
+
if (d2 < r2.demanded.length) throw new e(`Not enough arguments provided. Expected ${r2.demanded.length} but received ${f2.length}.`);
|
|
3385
3002
|
const u2 = r2.demanded.length + r2.optional.length;
|
|
3386
|
-
if (d2 > u2)
|
|
3387
|
-
throw new e(`Too many arguments provided. Expected max ${u2} but received ${d2}.`);
|
|
3003
|
+
if (d2 > u2) throw new e(`Too many arguments provided. Expected max ${u2} but received ${d2}.`);
|
|
3388
3004
|
r2.demanded.forEach((t3) => {
|
|
3389
3005
|
const e2 = l(f2.shift());
|
|
3390
3006
|
0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1;
|
|
3391
3007
|
}), r2.optional.forEach((t3) => {
|
|
3392
|
-
if (0 === f2.length)
|
|
3393
|
-
return;
|
|
3008
|
+
if (0 === f2.length) return;
|
|
3394
3009
|
const e2 = l(f2.shift());
|
|
3395
3010
|
0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1;
|
|
3396
3011
|
});
|
|
@@ -3432,19 +3047,14 @@ var require_build4 = __commonJS({
|
|
|
3432
3047
|
return t2.slice(m() + 1);
|
|
3433
3048
|
}, getProcessArgvBin: y });
|
|
3434
3049
|
function v(t2, e2, s2, i2) {
|
|
3435
|
-
if ("a" === s2 && !i2)
|
|
3436
|
-
|
|
3437
|
-
if ("function" == typeof e2 ? t2 !== e2 || !i2 : !e2.has(t2))
|
|
3438
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3050
|
+
if ("a" === s2 && !i2) throw new TypeError("Private accessor was defined without a getter");
|
|
3051
|
+
if ("function" == typeof e2 ? t2 !== e2 || !i2 : !e2.has(t2)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3439
3052
|
return "m" === s2 ? i2 : "a" === s2 ? i2.call(t2) : i2 ? i2.value : e2.get(t2);
|
|
3440
3053
|
}
|
|
3441
3054
|
function O(t2, e2, s2, i2, n2) {
|
|
3442
|
-
if ("m" === i2)
|
|
3443
|
-
|
|
3444
|
-
if ("
|
|
3445
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
3446
|
-
if ("function" == typeof e2 ? t2 !== e2 || !n2 : !e2.has(t2))
|
|
3447
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3055
|
+
if ("m" === i2) throw new TypeError("Private method is not writable");
|
|
3056
|
+
if ("a" === i2 && !n2) throw new TypeError("Private accessor was defined without a setter");
|
|
3057
|
+
if ("function" == typeof e2 ? t2 !== e2 || !n2 : !e2.has(t2)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3448
3058
|
return "a" === i2 ? n2.call(t2, s2) : n2 ? n2.value = s2 : e2.set(t2, s2), s2;
|
|
3449
3059
|
}
|
|
3450
3060
|
var w = class {
|
|
@@ -3454,8 +3064,7 @@ var require_build4 = __commonJS({
|
|
|
3454
3064
|
addMiddleware(t2, e2, s2 = true, i2 = false) {
|
|
3455
3065
|
if (h("<array|function> [boolean] [boolean] [boolean]", [t2, e2, s2], arguments.length), Array.isArray(t2)) {
|
|
3456
3066
|
for (let i3 = 0; i3 < t2.length; i3++) {
|
|
3457
|
-
if ("function" != typeof t2[i3])
|
|
3458
|
-
throw Error("middleware must be a function");
|
|
3067
|
+
if ("function" != typeof t2[i3]) throw Error("middleware must be a function");
|
|
3459
3068
|
const n2 = t2[i3];
|
|
3460
3069
|
n2.applyBeforeValidation = e2, n2.global = s2;
|
|
3461
3070
|
}
|
|
@@ -3489,15 +3098,12 @@ var require_build4 = __commonJS({
|
|
|
3489
3098
|
};
|
|
3490
3099
|
function C(t2, e2, s2, i2) {
|
|
3491
3100
|
return s2.reduce((t3, s3) => {
|
|
3492
|
-
if (s3.applyBeforeValidation !== i2)
|
|
3493
|
-
return t3;
|
|
3101
|
+
if (s3.applyBeforeValidation !== i2) return t3;
|
|
3494
3102
|
if (s3.mutates) {
|
|
3495
|
-
if (s3.applied)
|
|
3496
|
-
return t3;
|
|
3103
|
+
if (s3.applied) return t3;
|
|
3497
3104
|
s3.applied = true;
|
|
3498
3105
|
}
|
|
3499
|
-
if (f(t3))
|
|
3500
|
-
return t3.then((t4) => Promise.all([t4, s3(t4, e2)])).then(([t4, e3]) => Object.assign(t4, e3));
|
|
3106
|
+
if (f(t3)) return t3.then((t4) => Promise.all([t4, s3(t4, e2)])).then(([t4, e3]) => Object.assign(t4, e3));
|
|
3501
3107
|
{
|
|
3502
3108
|
const i3 = s3(t3, e2);
|
|
3503
3109
|
return f(i3) ? i3.then((e3) => Object.assign(t3, e3)) : Object.assign(t3, i3);
|
|
@@ -3525,8 +3131,7 @@ var require_build4 = __commonJS({
|
|
|
3525
3131
|
i2.visit = (t3, e3, s3) => {
|
|
3526
3132
|
const i3 = n2(t3, e3, s3);
|
|
3527
3133
|
if (i3) {
|
|
3528
|
-
if (this.requireCache.has(e3))
|
|
3529
|
-
return i3;
|
|
3134
|
+
if (this.requireCache.has(e3)) return i3;
|
|
3530
3135
|
this.requireCache.add(e3), this.addHandler(i3);
|
|
3531
3136
|
}
|
|
3532
3137
|
return i3;
|
|
@@ -3538,14 +3143,10 @@ var require_build4 = __commonJS({
|
|
|
3538
3143
|
return t3 ? t3.map((t4) => (t4.applyBeforeValidation = false, t4)) : [];
|
|
3539
3144
|
}(n2);
|
|
3540
3145
|
if (i2 = i2 || (() => {
|
|
3541
|
-
}), Array.isArray(t2))
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
[t2, ...a2] = t2;
|
|
3546
|
-
else
|
|
3547
|
-
for (const e3 of t2)
|
|
3548
|
-
this.addHandler(e3);
|
|
3146
|
+
}), Array.isArray(t2)) if (function(t3) {
|
|
3147
|
+
return t3.every((t4) => "string" == typeof t4);
|
|
3148
|
+
}(t2)) [t2, ...a2] = t2;
|
|
3149
|
+
else for (const e3 of t2) this.addHandler(e3);
|
|
3549
3150
|
else {
|
|
3550
3151
|
if (function(t3) {
|
|
3551
3152
|
return "object" == typeof t3 && !Array.isArray(t3);
|
|
@@ -3553,8 +3154,7 @@ var require_build4 = __commonJS({
|
|
|
3553
3154
|
let e3 = Array.isArray(t2.command) || "string" == typeof t2.command ? t2.command : this.moduleName(t2);
|
|
3554
3155
|
return t2.aliases && (e3 = [].concat(e3).concat(t2.aliases)), void this.addHandler(e3, this.extractDesc(t2), t2.builder, t2.handler, t2.middlewares, t2.deprecated);
|
|
3555
3156
|
}
|
|
3556
|
-
if (k(s2))
|
|
3557
|
-
return void this.addHandler([t2].concat(a2), e2, s2.builder, s2.handler, s2.middlewares, s2.deprecated);
|
|
3157
|
+
if (k(s2)) return void this.addHandler([t2].concat(a2), e2, s2.builder, s2.handler, s2.middlewares, s2.deprecated);
|
|
3558
3158
|
}
|
|
3559
3159
|
if ("string" == typeof t2) {
|
|
3560
3160
|
const n3 = o(t2);
|
|
@@ -3587,17 +3187,15 @@ var require_build4 = __commonJS({
|
|
|
3587
3187
|
if (x(h2)) {
|
|
3588
3188
|
s2.getInternalMethods().getUsageInstance().freeze();
|
|
3589
3189
|
const c2 = h2(s2.getInternalMethods().reset(i2), a2);
|
|
3590
|
-
if (f(c2))
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
l2.option(t3, h2[t3]);
|
|
3600
|
-
}));
|
|
3190
|
+
if (f(c2)) return c2.then((i3) => {
|
|
3191
|
+
var a3;
|
|
3192
|
+
return l2 = (a3 = i3) && "function" == typeof a3.getInternalMethods ? i3 : s2, this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2);
|
|
3193
|
+
});
|
|
3194
|
+
} else /* @__PURE__ */ (function(t3) {
|
|
3195
|
+
return "object" == typeof t3;
|
|
3196
|
+
})(h2) && (s2.getInternalMethods().getUsageInstance().freeze(), l2 = s2.getInternalMethods().reset(i2), Object.keys(e2.builder).forEach((t3) => {
|
|
3197
|
+
l2.option(t3, h2[t3]);
|
|
3198
|
+
}));
|
|
3601
3199
|
return this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2);
|
|
3602
3200
|
}
|
|
3603
3201
|
parseAndUpdateUsage(t2, e2, s2, i2, n2, r2) {
|
|
@@ -3634,8 +3232,7 @@ var require_build4 = __commonJS({
|
|
|
3634
3232
|
}
|
|
3635
3233
|
applyMiddlewareAndGetResult(t2, e2, s2, i2, n2, r2, o2) {
|
|
3636
3234
|
let a2 = {};
|
|
3637
|
-
if (n2)
|
|
3638
|
-
return s2;
|
|
3235
|
+
if (n2) return s2;
|
|
3639
3236
|
o2.getInternalMethods().getHasOutput() || (a2 = this.populatePositionals(e2, s2, i2, o2));
|
|
3640
3237
|
const h2 = this.globalMiddleware.getMiddleware().slice(0).concat(e2.middlewares), l2 = C(s2, o2, h2, true);
|
|
3641
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);
|
|
@@ -3670,19 +3267,16 @@ var require_build4 = __commonJS({
|
|
|
3670
3267
|
postProcessPositionals(t2, e2, s2, i2) {
|
|
3671
3268
|
const n2 = Object.assign({}, i2.getOptions());
|
|
3672
3269
|
n2.default = Object.assign(s2.default, n2.default);
|
|
3673
|
-
for (const t3 of Object.keys(s2.alias))
|
|
3674
|
-
n2.alias[t3] = (n2.alias[t3] || []).concat(s2.alias[t3]);
|
|
3270
|
+
for (const t3 of Object.keys(s2.alias)) n2.alias[t3] = (n2.alias[t3] || []).concat(s2.alias[t3]);
|
|
3675
3271
|
n2.array = n2.array.concat(s2.array), n2.config = {};
|
|
3676
3272
|
const r2 = [];
|
|
3677
3273
|
if (Object.keys(e2).forEach((t3) => {
|
|
3678
3274
|
e2[t3].map((e3) => {
|
|
3679
3275
|
n2.configuration["unknown-options-as-args"] && (n2.key[t3] = true), r2.push(`--${t3}`), r2.push(e3);
|
|
3680
3276
|
});
|
|
3681
|
-
}), !r2.length)
|
|
3682
|
-
return;
|
|
3277
|
+
}), !r2.length) return;
|
|
3683
3278
|
const o2 = Object.assign({}, n2.configuration, { "populate--": false }), a2 = this.shim.Parser.detailed(r2, Object.assign({}, n2, { configuration: o2 }));
|
|
3684
|
-
if (a2.error)
|
|
3685
|
-
i2.getInternalMethods().getUsageInstance().fail(a2.error.message, a2.error);
|
|
3279
|
+
if (a2.error) i2.getInternalMethods().getUsageInstance().fail(a2.error.message, a2.error);
|
|
3686
3280
|
else {
|
|
3687
3281
|
const s3 = Object.keys(e2);
|
|
3688
3282
|
Object.keys(e2).forEach((t3) => {
|
|
@@ -3701,30 +3295,24 @@ var require_build4 = __commonJS({
|
|
|
3701
3295
|
return s2.some((t3) => Object.prototype.hasOwnProperty.call(t3, e2)) || s2.some((t3) => Object.prototype.hasOwnProperty.call(t3, this.shim.Parser.camelCase(e2)));
|
|
3702
3296
|
}
|
|
3703
3297
|
runDefaultBuilderOn(t2) {
|
|
3704
|
-
if (!this.defaultCommand)
|
|
3705
|
-
return;
|
|
3298
|
+
if (!this.defaultCommand) return;
|
|
3706
3299
|
if (this.shouldUpdateUsage(t2)) {
|
|
3707
3300
|
const e3 = M.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
|
|
3708
3301
|
t2.getInternalMethods().getUsageInstance().usage(e3, this.defaultCommand.description);
|
|
3709
3302
|
}
|
|
3710
3303
|
const e2 = this.defaultCommand.builder;
|
|
3711
|
-
if (x(e2))
|
|
3712
|
-
return e2(t2, true);
|
|
3304
|
+
if (x(e2)) return e2(t2, true);
|
|
3713
3305
|
k(e2) || Object.keys(e2).forEach((s2) => {
|
|
3714
3306
|
t2.option(s2, e2[s2]);
|
|
3715
3307
|
});
|
|
3716
3308
|
}
|
|
3717
3309
|
moduleName(t2) {
|
|
3718
3310
|
const e2 = function(t3) {
|
|
3719
|
-
if ("undefined" == typeof require)
|
|
3720
|
-
|
|
3721
|
-
for (let e3, s2 = 0, i2 = Object.keys(require.cache); s2 < i2.length; s2++)
|
|
3722
|
-
if (e3 = require.cache[i2[s2]], e3.exports === t3)
|
|
3723
|
-
return e3;
|
|
3311
|
+
if ("undefined" == typeof require) return null;
|
|
3312
|
+
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;
|
|
3724
3313
|
return null;
|
|
3725
3314
|
}(t2);
|
|
3726
|
-
if (!e2)
|
|
3727
|
-
throw new Error(`No command name given for module: ${this.shim.inspect(t2)}`);
|
|
3315
|
+
if (!e2) throw new Error(`No command name given for module: ${this.shim.inspect(t2)}`);
|
|
3728
3316
|
return this.commandFromFilename(e2.filename);
|
|
3729
3317
|
}
|
|
3730
3318
|
commandFromFilename(t2) {
|
|
@@ -3732,8 +3320,7 @@ var require_build4 = __commonJS({
|
|
|
3732
3320
|
}
|
|
3733
3321
|
extractDesc({ describe: t2, description: e2, desc: s2 }) {
|
|
3734
3322
|
for (const i2 of [t2, e2, s2]) {
|
|
3735
|
-
if ("string" == typeof i2 || false === i2)
|
|
3736
|
-
return i2;
|
|
3323
|
+
if ("string" == typeof i2 || false === i2) return i2;
|
|
3737
3324
|
d(i2, true, this.shim);
|
|
3738
3325
|
}
|
|
3739
3326
|
return false;
|
|
@@ -3783,21 +3370,16 @@ var require_build4 = __commonJS({
|
|
|
3783
3370
|
const e2 = o2 || a2;
|
|
3784
3371
|
e2 && ((s3 || i3) && c3.error(""), c3.error(e2));
|
|
3785
3372
|
}
|
|
3786
|
-
if (i3 = i3 || new e(s3), t2.getExitProcess())
|
|
3787
|
-
|
|
3788
|
-
if (t2.getInternalMethods().hasParseCallback())
|
|
3789
|
-
return t2.exit(1, i3);
|
|
3373
|
+
if (i3 = i3 || new e(s3), t2.getExitProcess()) return t2.exit(1);
|
|
3374
|
+
if (t2.getInternalMethods().hasParseCallback()) return t2.exit(1, i3);
|
|
3790
3375
|
throw i3;
|
|
3791
3376
|
}
|
|
3792
3377
|
for (let t3 = r2.length - 1; t3 >= 0; --t3) {
|
|
3793
3378
|
const e2 = r2[t3];
|
|
3794
3379
|
if (A(e2)) {
|
|
3795
|
-
if (i3)
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
throw Error(s3);
|
|
3799
|
-
} else
|
|
3800
|
-
e2(s3, i3, n2);
|
|
3380
|
+
if (i3) throw i3;
|
|
3381
|
+
if (s3) throw Error(s3);
|
|
3382
|
+
} else e2(s3, i3, n2);
|
|
3801
3383
|
}
|
|
3802
3384
|
};
|
|
3803
3385
|
let c2 = [], f2 = false;
|
|
@@ -3842,26 +3424,22 @@ var require_build4 = __commonJS({
|
|
|
3842
3424
|
}
|
|
3843
3425
|
function j2(t3, e2) {
|
|
3844
3426
|
let s3 = `[${i2("default:")} `;
|
|
3845
|
-
if (void 0 === t3 && !e2)
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
default:
|
|
3858
|
-
s3 += t3;
|
|
3859
|
-
}
|
|
3427
|
+
if (void 0 === t3 && !e2) return null;
|
|
3428
|
+
if (e2) s3 += e2;
|
|
3429
|
+
else switch (typeof t3) {
|
|
3430
|
+
case "string":
|
|
3431
|
+
s3 += `"${t3}"`;
|
|
3432
|
+
break;
|
|
3433
|
+
case "object":
|
|
3434
|
+
s3 += JSON.stringify(t3);
|
|
3435
|
+
break;
|
|
3436
|
+
default:
|
|
3437
|
+
s3 += t3;
|
|
3438
|
+
}
|
|
3860
3439
|
return `${s3}]`;
|
|
3861
3440
|
}
|
|
3862
3441
|
n2.deferY18nLookup = (t3) => v2 + t3, n2.help = function() {
|
|
3863
|
-
if (w2)
|
|
3864
|
-
return w2;
|
|
3442
|
+
if (w2) return w2;
|
|
3865
3443
|
!function() {
|
|
3866
3444
|
const e3 = t2.getDemandedOptions(), s3 = t2.getOptions();
|
|
3867
3445
|
(Object.keys(s3.alias) || []).forEach((i3) => {
|
|
@@ -3875,10 +3453,9 @@ var require_build4 = __commonJS({
|
|
|
3875
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), {}));
|
|
3876
3454
|
const y3 = n2.getWrap(), b3 = s2.cliui({ width: y3, wrap: !!y3 });
|
|
3877
3455
|
if (!f2) {
|
|
3878
|
-
if (c2.length)
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
}), b3.div();
|
|
3456
|
+
if (c2.length) c2.forEach((t3) => {
|
|
3457
|
+
b3.div({ text: `${t3[0].replace(/\$0/g, e2)}` }), t3[1] && b3.div({ text: `${t3[1]}`, padding: [1, 0, 0, 0] });
|
|
3458
|
+
}), b3.div();
|
|
3882
3459
|
else if (u2.length) {
|
|
3883
3460
|
let t3 = null;
|
|
3884
3461
|
t3 = o3._ ? `${e2} <${i2("command")}>
|
|
@@ -3910,11 +3487,8 @@ var require_build4 = __commonJS({
|
|
|
3910
3487
|
});
|
|
3911
3488
|
}(g2, l3.alias, h3, _3);
|
|
3912
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) => {
|
|
3913
|
-
if (M3.includes(t4))
|
|
3914
|
-
|
|
3915
|
-
for (let e3, s3 = 0; void 0 !== (e3 = M3[s3]); s3++)
|
|
3916
|
-
if ((l3.alias[e3] || []).includes(t4))
|
|
3917
|
-
return e3;
|
|
3490
|
+
if (M3.includes(t4)) return t4;
|
|
3491
|
+
for (let e3, s3 = 0; void 0 !== (e3 = M3[s3]); s3++) if ((l3.alias[e3] || []).includes(t4)) return e3;
|
|
3918
3492
|
return t4;
|
|
3919
3493
|
}) })).filter(({ normalizedKeys: t3 }) => t3.length > 0).map(({ groupName: t3, normalizedKeys: e3 }) => {
|
|
3920
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), {});
|
|
@@ -3997,15 +3571,14 @@ var require_build4 = __commonJS({
|
|
|
3997
3571
|
}
|
|
3998
3572
|
defaultCompletion(t2, e2, s2, i2) {
|
|
3999
3573
|
const n2 = this.command.getCommandHandlers();
|
|
4000
|
-
for (let e3 = 0, s3 = t2.length; e3 < s3; ++e3)
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
return s4(t3, true), t3.argv;
|
|
4007
|
-
}
|
|
3574
|
+
for (let e3 = 0, s3 = t2.length; e3 < s3; ++e3) if (n2[t2[e3]] && n2[t2[e3]].builder) {
|
|
3575
|
+
const s4 = n2[t2[e3]].builder;
|
|
3576
|
+
if (x(s4)) {
|
|
3577
|
+
this.indexAfterLastReset = e3 + 1;
|
|
3578
|
+
const t3 = this.yargs.getInternalMethods().reset();
|
|
3579
|
+
return s4(t3, true), t3.argv;
|
|
4008
3580
|
}
|
|
3581
|
+
}
|
|
4009
3582
|
const r2 = [];
|
|
4010
3583
|
this.commandCompletions(r2, t2, s2), this.optionCompletions(r2, t2, e2, s2), this.choicesFromOptionsCompletions(r2, t2, e2, s2), this.choicesFromPositionalsCompletions(r2, t2, e2, s2), i2(null, r2);
|
|
4011
3584
|
}
|
|
@@ -4013,12 +3586,10 @@ var require_build4 = __commonJS({
|
|
|
4013
3586
|
const i2 = this.yargs.getInternalMethods().getContext().commands;
|
|
4014
3587
|
s2.match(/^-/) || i2[i2.length - 1] === s2 || this.previousArgHasChoices(e2) || this.usage.getCommands().forEach((s3) => {
|
|
4015
3588
|
const i3 = o(s3[0]).cmd;
|
|
4016
|
-
if (-1 === e2.indexOf(i3))
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
} else
|
|
4021
|
-
t2.push(i3);
|
|
3589
|
+
if (-1 === e2.indexOf(i3)) if (this.zshShell) {
|
|
3590
|
+
const e3 = s3[1] || "";
|
|
3591
|
+
t2.push(i3.replace(/:/g, "\\:") + ":" + e3);
|
|
3592
|
+
} else t2.push(i3);
|
|
4022
3593
|
});
|
|
4023
3594
|
}
|
|
4024
3595
|
optionCompletions(t2, e2, s2, i2) {
|
|
@@ -4037,28 +3608,22 @@ var require_build4 = __commonJS({
|
|
|
4037
3608
|
}
|
|
4038
3609
|
}
|
|
4039
3610
|
choicesFromPositionalsCompletions(t2, e2, s2, i2) {
|
|
4040
|
-
if ("" === i2 && t2.length > 0 && this.previousArgHasChoices(e2))
|
|
4041
|
-
return;
|
|
3611
|
+
if ("" === i2 && t2.length > 0 && this.previousArgHasChoices(e2)) return;
|
|
4042
3612
|
const n2 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [], r2 = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1), o2 = n2[s2._.length - r2 - 1];
|
|
4043
|
-
if (!o2)
|
|
4044
|
-
return;
|
|
3613
|
+
if (!o2) return;
|
|
4045
3614
|
const a2 = this.yargs.getOptions().choices[o2] || [];
|
|
4046
|
-
for (const e3 of a2)
|
|
4047
|
-
e3.startsWith(i2) && t2.push(e3.replace(/:/g, "\\:"));
|
|
3615
|
+
for (const e3 of a2) e3.startsWith(i2) && t2.push(e3.replace(/:/g, "\\:"));
|
|
4048
3616
|
}
|
|
4049
3617
|
getPreviousArgChoices(t2) {
|
|
4050
|
-
if (t2.length < 1)
|
|
4051
|
-
return;
|
|
3618
|
+
if (t2.length < 1) return;
|
|
4052
3619
|
let e2 = t2[t2.length - 1], s2 = "";
|
|
4053
|
-
if (!e2.startsWith("-") && t2.length > 1 && (s2 = e2, e2 = t2[t2.length - 2]), !e2.startsWith("-"))
|
|
4054
|
-
return;
|
|
3620
|
+
if (!e2.startsWith("-") && t2.length > 1 && (s2 = e2, e2 = t2[t2.length - 2]), !e2.startsWith("-")) return;
|
|
4055
3621
|
const i2 = e2.replace(/^-+/, ""), n2 = this.yargs.getOptions(), r2 = [i2, ...this.yargs.getAliases()[i2] || []];
|
|
4056
3622
|
let o2;
|
|
4057
|
-
for (const t3 of r2)
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
}
|
|
3623
|
+
for (const t3 of r2) if (Object.prototype.hasOwnProperty.call(n2.key, t3) && Array.isArray(n2.choices[t3])) {
|
|
3624
|
+
o2 = n2.choices[t3];
|
|
3625
|
+
break;
|
|
3626
|
+
}
|
|
4062
3627
|
return o2 ? o2.filter((t3) => !s2 || t3.startsWith(s2)) : void 0;
|
|
4063
3628
|
}
|
|
4064
3629
|
previousArgHasChoices(t2) {
|
|
@@ -4067,14 +3632,10 @@ var require_build4 = __commonJS({
|
|
|
4067
3632
|
}
|
|
4068
3633
|
argsContainKey(t2, e2, s2) {
|
|
4069
3634
|
const i2 = (e3) => -1 !== t2.indexOf((/^[^0-9]$/.test(e3) ? "-" : "--") + e3);
|
|
4070
|
-
if (i2(e2))
|
|
4071
|
-
|
|
4072
|
-
if (s2 && i2(`no-${e2}`))
|
|
4073
|
-
return true;
|
|
3635
|
+
if (i2(e2)) return true;
|
|
3636
|
+
if (s2 && i2(`no-${e2}`)) return true;
|
|
4074
3637
|
if (this.aliases) {
|
|
4075
|
-
for (const t3 of this.aliases[e2])
|
|
4076
|
-
if (i2(t3))
|
|
4077
|
-
return true;
|
|
3638
|
+
for (const t3 of this.aliases[e2]) if (i2(t3)) return true;
|
|
4078
3639
|
}
|
|
4079
3640
|
return false;
|
|
4080
3641
|
}
|
|
@@ -4148,19 +3709,13 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4148
3709
|
}
|
|
4149
3710
|
};
|
|
4150
3711
|
function N(t2, e2) {
|
|
4151
|
-
if (0 === t2.length)
|
|
4152
|
-
|
|
4153
|
-
if (0 === e2.length)
|
|
4154
|
-
return t2.length;
|
|
3712
|
+
if (0 === t2.length) return e2.length;
|
|
3713
|
+
if (0 === e2.length) return t2.length;
|
|
4155
3714
|
const s2 = [];
|
|
4156
3715
|
let i2, n2;
|
|
4157
|
-
for (i2 = 0; i2 <= e2.length; i2++)
|
|
4158
|
-
|
|
4159
|
-
for (n2 =
|
|
4160
|
-
s2[0][n2] = n2;
|
|
4161
|
-
for (i2 = 1; i2 <= e2.length; i2++)
|
|
4162
|
-
for (n2 = 1; n2 <= t2.length; n2++)
|
|
4163
|
-
e2.charAt(i2 - 1) === t2.charAt(n2 - 1) ? s2[i2][n2] = s2[i2 - 1][n2 - 1] : i2 > 1 && n2 > 1 && e2.charAt(i2 - 2) === t2.charAt(n2 - 1) && e2.charAt(i2 - 1) === t2.charAt(n2 - 2) ? s2[i2][n2] = s2[i2 - 2][n2 - 2] + 1 : s2[i2][n2] = Math.min(s2[i2 - 1][n2 - 1] + 1, Math.min(s2[i2][n2 - 1] + 1, s2[i2 - 1][n2] + 1));
|
|
3716
|
+
for (i2 = 0; i2 <= e2.length; i2++) s2[i2] = [i2];
|
|
3717
|
+
for (n2 = 0; n2 <= t2.length; n2++) s2[0][n2] = n2;
|
|
3718
|
+
for (i2 = 1; i2 <= e2.length; i2++) for (n2 = 1; n2 <= t2.length; n2++) e2.charAt(i2 - 1) === t2.charAt(n2 - 1) ? s2[i2][n2] = s2[i2 - 1][n2 - 1] : i2 > 1 && n2 > 1 && e2.charAt(i2 - 2) === t2.charAt(n2 - 1) && e2.charAt(i2 - 1) === t2.charAt(n2 - 2) ? s2[i2][n2] = s2[i2 - 2][n2 - 2] + 1 : s2[i2][n2] = Math.min(s2[i2 - 1][n2 - 1] + 1, Math.min(s2[i2][n2 - 1] + 1, s2[i2 - 1][n2] + 1));
|
|
4164
3719
|
return s2[e2.length][t2.length];
|
|
4165
3720
|
}
|
|
4166
3721
|
var H = ["$0", "--", "_"];
|
|
@@ -4246,8 +3801,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4246
3801
|
return this.addHelpOpt(t2, e2);
|
|
4247
3802
|
}
|
|
4248
3803
|
addShowHiddenOpt(t2, e2) {
|
|
4249
|
-
if (h("[string|boolean] [string]", [t2, e2], arguments.length), false === t2 && void 0 === e2)
|
|
4250
|
-
return this;
|
|
3804
|
+
if (h("[string|boolean] [string]", [t2, e2], arguments.length), false === t2 && void 0 === e2) return this;
|
|
4251
3805
|
const s2 = "string" == typeof t2 ? t2 : v(this, L, "f");
|
|
4252
3806
|
return this.boolean(s2), this.describe(s2, e2 || v(this, pt, "f").deferY18nLookup("Show hidden options")), v(this, et, "f").showHiddenOpt = s2, this;
|
|
4253
3807
|
}
|
|
@@ -4271,27 +3825,21 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4271
3825
|
}
|
|
4272
3826
|
coerce(t2, s2) {
|
|
4273
3827
|
if (h("<object|string|array> [function]", [t2, s2], arguments.length), Array.isArray(t2)) {
|
|
4274
|
-
if (!s2)
|
|
4275
|
-
|
|
4276
|
-
for (const e2 of t2)
|
|
4277
|
-
this.coerce(e2, s2);
|
|
3828
|
+
if (!s2) throw new e("coerce callback must be provided");
|
|
3829
|
+
for (const e2 of t2) this.coerce(e2, s2);
|
|
4278
3830
|
return this;
|
|
4279
3831
|
}
|
|
4280
3832
|
if ("object" == typeof t2) {
|
|
4281
|
-
for (const e2 of Object.keys(t2))
|
|
4282
|
-
this.coerce(e2, t2[e2]);
|
|
3833
|
+
for (const e2 of Object.keys(t2)) this.coerce(e2, t2[e2]);
|
|
4283
3834
|
return this;
|
|
4284
3835
|
}
|
|
4285
|
-
if (!s2)
|
|
4286
|
-
throw new e("coerce callback must be provided");
|
|
3836
|
+
if (!s2) throw new e("coerce callback must be provided");
|
|
4287
3837
|
return v(this, et, "f").key[t2] = true, v(this, Y, "f").addCoerceMiddleware((i2, n2) => {
|
|
4288
3838
|
let r2;
|
|
4289
3839
|
return Object.prototype.hasOwnProperty.call(i2, t2) ? j(() => (r2 = n2.getAliases(), s2(i2[t2])), (e2) => {
|
|
4290
3840
|
i2[t2] = e2;
|
|
4291
3841
|
const s3 = n2.getInternalMethods().getParserConfiguration()["strip-aliased"];
|
|
4292
|
-
if (r2[t2] && true !== s3)
|
|
4293
|
-
for (const s4 of r2[t2])
|
|
4294
|
-
i2[s4] = e2;
|
|
3842
|
+
if (r2[t2] && true !== s3) for (const s4 of r2[t2]) i2[s4] = e2;
|
|
4295
3843
|
return i2;
|
|
4296
3844
|
}, (t3) => {
|
|
4297
3845
|
throw new e(t3.message);
|
|
@@ -4370,8 +3918,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4370
3918
|
return h("[boolean]", [t2], arguments.length), O(this, T, t2, "f"), this;
|
|
4371
3919
|
}
|
|
4372
3920
|
fail(t2) {
|
|
4373
|
-
if (h("<function|boolean>", [t2], arguments.length), "boolean" == typeof t2 && false !== t2)
|
|
4374
|
-
throw new e("Invalid first argument. Expected function or boolean 'false'");
|
|
3921
|
+
if (h("<function|boolean>", [t2], arguments.length), "boolean" == typeof t2 && false !== t2) throw new e("Invalid first argument. Expected function or boolean 'false'");
|
|
4375
3922
|
return v(this, pt, "f").failFn(t2), this;
|
|
4376
3923
|
}
|
|
4377
3924
|
getAliases() {
|
|
@@ -4406,12 +3953,10 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4406
3953
|
if (O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) {
|
|
4407
3954
|
if (!this.parsed) {
|
|
4408
3955
|
const t3 = this[Jt](v(this, ht, "f"), void 0, void 0, 0, true);
|
|
4409
|
-
if (f(t3))
|
|
4410
|
-
return t3.then(() => v(this, pt, "f").help());
|
|
3956
|
+
if (f(t3)) return t3.then(() => v(this, pt, "f").help());
|
|
4411
3957
|
}
|
|
4412
3958
|
const t2 = v(this, z, "f").runDefaultBuilderOn(this);
|
|
4413
|
-
if (f(t2))
|
|
4414
|
-
return t2.then(() => v(this, pt, "f").help());
|
|
3959
|
+
if (f(t2)) return t2.then(() => v(this, pt, "f").help());
|
|
4415
3960
|
}
|
|
4416
3961
|
return Promise.resolve(v(this, pt, "f").help());
|
|
4417
3962
|
}
|
|
@@ -4461,10 +4006,9 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4461
4006
|
return h("<array|string>", [t2], arguments.length), this[Pt]("number", t2), this[Qt](t2), this;
|
|
4462
4007
|
}
|
|
4463
4008
|
option(t2, e2) {
|
|
4464
|
-
if (h("<string|object> [object]", [t2, e2], arguments.length), "object" == typeof t2)
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
});
|
|
4009
|
+
if (h("<string|object> [object]", [t2, e2], arguments.length), "object" == typeof t2) Object.keys(t2).forEach((e3) => {
|
|
4010
|
+
this.options(e3, t2[e3]);
|
|
4011
|
+
});
|
|
4468
4012
|
else {
|
|
4469
4013
|
"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);
|
|
4470
4014
|
const s2 = e2.deprecate || e2.deprecated;
|
|
@@ -4494,8 +4038,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4494
4038
|
}
|
|
4495
4039
|
parseSync(t2, s2, i2) {
|
|
4496
4040
|
const n2 = this.parse(t2, s2, i2);
|
|
4497
|
-
if (f(n2))
|
|
4498
|
-
throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");
|
|
4041
|
+
if (f(n2)) throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");
|
|
4499
4042
|
return n2;
|
|
4500
4043
|
}
|
|
4501
4044
|
parserConfiguration(t2) {
|
|
@@ -4536,16 +4079,14 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4536
4079
|
if (h("[string|function]", [t2], arguments.length), O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) {
|
|
4537
4080
|
if (!this.parsed) {
|
|
4538
4081
|
const e3 = this[Jt](v(this, ht, "f"), void 0, void 0, 0, true);
|
|
4539
|
-
if (f(e3))
|
|
4540
|
-
return e3.then(() => {
|
|
4541
|
-
v(this, pt, "f").showHelp(t2);
|
|
4542
|
-
}), this;
|
|
4543
|
-
}
|
|
4544
|
-
const e2 = v(this, z, "f").runDefaultBuilderOn(this);
|
|
4545
|
-
if (f(e2))
|
|
4546
|
-
return e2.then(() => {
|
|
4082
|
+
if (f(e3)) return e3.then(() => {
|
|
4547
4083
|
v(this, pt, "f").showHelp(t2);
|
|
4548
4084
|
}), this;
|
|
4085
|
+
}
|
|
4086
|
+
const e2 = v(this, z, "f").runDefaultBuilderOn(this);
|
|
4087
|
+
if (f(e2)) return e2.then(() => {
|
|
4088
|
+
v(this, pt, "f").showHelp(t2);
|
|
4089
|
+
}), this;
|
|
4549
4090
|
}
|
|
4550
4091
|
return v(this, pt, "f").showHelp(t2), this;
|
|
4551
4092
|
}
|
|
@@ -4584,8 +4125,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4584
4125
|
}
|
|
4585
4126
|
usage(t2, s2, i2, n2) {
|
|
4586
4127
|
if (h("<string|null|undefined> [string|boolean] [function|object] [function]", [t2, s2, i2, n2], arguments.length), void 0 !== s2) {
|
|
4587
|
-
if (d(t2, null, v(this, ct, "f")), (t2 || "").match(/^\$0( |$)/))
|
|
4588
|
-
return this.command(t2, s2, i2, n2);
|
|
4128
|
+
if (d(t2, null, v(this, ct, "f")), (t2 || "").match(/^\$0( |$)/)) return this.command(t2, s2, i2, n2);
|
|
4589
4129
|
throw new e(".usage() description must start with $0 if being used as alias for .command()");
|
|
4590
4130
|
}
|
|
4591
4131
|
return v(this, pt, "f").usage(t2), this;
|
|
@@ -4595,22 +4135,18 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4595
4135
|
}
|
|
4596
4136
|
version(t2, e2, s2) {
|
|
4597
4137
|
const i2 = "version";
|
|
4598
|
-
if (h("[boolean|string] [string] [string]", [t2, e2, s2], arguments.length), v(this, mt, "f") && (this[Ot](v(this, mt, "f")), v(this, pt, "f").version(void 0), O(this, mt, null, "f")), 0 === arguments.length)
|
|
4599
|
-
s2 = this[xt](), t2 = i2;
|
|
4138
|
+
if (h("[boolean|string] [string] [string]", [t2, e2, s2], arguments.length), v(this, mt, "f") && (this[Ot](v(this, mt, "f")), v(this, pt, "f").version(void 0), O(this, mt, null, "f")), 0 === arguments.length) s2 = this[xt](), t2 = i2;
|
|
4600
4139
|
else if (1 === arguments.length) {
|
|
4601
|
-
if (false === t2)
|
|
4602
|
-
return this;
|
|
4140
|
+
if (false === t2) return this;
|
|
4603
4141
|
s2 = t2, t2 = i2;
|
|
4604
|
-
} else
|
|
4605
|
-
2 === arguments.length && (s2 = e2, e2 = void 0);
|
|
4142
|
+
} else 2 === arguments.length && (s2 = e2, e2 = void 0);
|
|
4606
4143
|
return O(this, mt, "string" == typeof t2 ? t2 : i2, "f"), e2 = e2 || v(this, pt, "f").deferY18nLookup("Show version number"), v(this, pt, "f").version(s2 || void 0), this.boolean(v(this, mt, "f")), this.describe(v(this, mt, "f"), e2), this;
|
|
4607
4144
|
}
|
|
4608
4145
|
wrap(t2) {
|
|
4609
4146
|
return h("<number|null|undefined>", [t2], arguments.length), v(this, pt, "f").wrap(t2), this;
|
|
4610
4147
|
}
|
|
4611
4148
|
[(z = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), bt)](t2) {
|
|
4612
|
-
if (!t2._ || !t2["--"])
|
|
4613
|
-
return t2;
|
|
4149
|
+
if (!t2._ || !t2["--"]) return t2;
|
|
4614
4150
|
t2._.push.apply(t2._, t2["--"]);
|
|
4615
4151
|
try {
|
|
4616
4152
|
delete t2["--"];
|
|
@@ -4627,8 +4163,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4627
4163
|
}
|
|
4628
4164
|
[Ot](t2) {
|
|
4629
4165
|
p(v(this, et, "f")).forEach((e2) => {
|
|
4630
|
-
if ("configObjects" === e2)
|
|
4631
|
-
return;
|
|
4166
|
+
if ("configObjects" === e2) return;
|
|
4632
4167
|
const s2 = v(this, et, "f")[e2];
|
|
4633
4168
|
Array.isArray(s2) ? s2.includes(t2) && s2.splice(s2.indexOf(t2), 1) : "object" == typeof s2 && delete s2[t2];
|
|
4634
4169
|
}), delete v(this, pt, "f").getDescriptions()[t2];
|
|
@@ -4653,8 +4188,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4653
4188
|
return v(this, gt, "f");
|
|
4654
4189
|
}
|
|
4655
4190
|
[kt]() {
|
|
4656
|
-
if (!v(this, G, "f"))
|
|
4657
|
-
return;
|
|
4191
|
+
if (!v(this, G, "f")) return;
|
|
4658
4192
|
const t2 = v(this, ct, "f").getEnv("LC_ALL") || v(this, ct, "f").getEnv("LC_MESSAGES") || v(this, ct, "f").getEnv("LANG") || v(this, ct, "f").getEnv("LANGUAGE") || "en_US";
|
|
4659
4193
|
this.locale(t2.replace(/[.:].*/, ""));
|
|
4660
4194
|
}
|
|
@@ -4663,14 +4197,12 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4663
4197
|
}
|
|
4664
4198
|
[Et](t2) {
|
|
4665
4199
|
const e2 = t2["--"] ? t2["--"] : t2._;
|
|
4666
|
-
for (let t3, s2 = 0; void 0 !== (t3 = e2[s2]); s2++)
|
|
4667
|
-
v(this, ct, "f").Parser.looksLikeNumber(t3) && Number.isSafeInteger(Math.floor(parseFloat(`${t3}`))) && (e2[s2] = Number(t3));
|
|
4200
|
+
for (let t3, s2 = 0; void 0 !== (t3 = e2[s2]); s2++) v(this, ct, "f").Parser.looksLikeNumber(t3) && Number.isSafeInteger(Math.floor(parseFloat(`${t3}`))) && (e2[s2] = Number(t3));
|
|
4668
4201
|
return t2;
|
|
4669
4202
|
}
|
|
4670
4203
|
[At](t2) {
|
|
4671
4204
|
const e2 = t2 || "*";
|
|
4672
|
-
if (v(this, ot, "f")[e2])
|
|
4673
|
-
return v(this, ot, "f")[e2];
|
|
4205
|
+
if (v(this, ot, "f")[e2]) return v(this, ot, "f")[e2];
|
|
4674
4206
|
let s2 = {};
|
|
4675
4207
|
try {
|
|
4676
4208
|
let e3 = t2 || v(this, ct, "f").mainFilename;
|
|
@@ -4697,15 +4229,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4697
4229
|
});
|
|
4698
4230
|
}
|
|
4699
4231
|
[It](t2, e2, s2, i2, n2) {
|
|
4700
|
-
if (Array.isArray(s2))
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
else
|
|
4705
|
-
for (const e3 of p(s2))
|
|
4706
|
-
t2(e3, s2[e3]);
|
|
4707
|
-
else
|
|
4708
|
-
n2(e2, this[Dt](s2), i2);
|
|
4232
|
+
if (Array.isArray(s2)) s2.forEach((e3) => {
|
|
4233
|
+
t2(e3, i2);
|
|
4234
|
+
});
|
|
4235
|
+
else if (/* @__PURE__ */ ((t3) => "object" == typeof t3)(s2)) for (const e3 of p(s2)) t2(e3, s2[e3]);
|
|
4236
|
+
else n2(e2, this[Dt](s2), i2);
|
|
4709
4237
|
}
|
|
4710
4238
|
[Dt](t2) {
|
|
4711
4239
|
return "__proto__" === t2 ? "___proto___" : t2;
|
|
@@ -4777,10 +4305,8 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4777
4305
|
return v(this, X, "f");
|
|
4778
4306
|
}
|
|
4779
4307
|
[Bt](t2, e2, s2, i2) {
|
|
4780
|
-
if (s2)
|
|
4781
|
-
|
|
4782
|
-
if (f(t2))
|
|
4783
|
-
return t2;
|
|
4308
|
+
if (s2) return t2;
|
|
4309
|
+
if (f(t2)) return t2;
|
|
4784
4310
|
e2 || (t2 = this[bt](t2));
|
|
4785
4311
|
return (this[Mt]()["parse-positional-numbers"] || void 0 === this[Mt]()["parse-positional-numbers"]) && (t2 = this[Et](t2)), i2 && (t2 = C(t2, this, v(this, Y, "f").getMiddleware(), false)), t2;
|
|
4786
4312
|
}
|
|
@@ -4809,8 +4335,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
4809
4335
|
s4 < t4 && 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", s4, s4 + "", t4 + ""));
|
|
4810
4336
|
}, requiredArguments: function(t4, s4) {
|
|
4811
4337
|
let i3 = null;
|
|
4812
|
-
for (const e4 of Object.keys(s4))
|
|
4813
|
-
Object.prototype.hasOwnProperty.call(t4, e4) && void 0 !== t4[e4] || (i3 = i3 || {}, i3[e4] = s4[e4]);
|
|
4338
|
+
for (const e4 of Object.keys(s4)) Object.prototype.hasOwnProperty.call(t4, e4) && void 0 !== t4[e4] || (i3 = i3 || {}, i3[e4] = s4[e4]);
|
|
4814
4339
|
if (i3) {
|
|
4815
4340
|
const t5 = [];
|
|
4816
4341
|
for (const e4 of Object.keys(i3)) {
|
|
@@ -4841,22 +4366,19 @@ ${t5.join("\n")}` : "";
|
|
|
4841
4366
|
i3.includes("" + t4) || r3.push("" + t4);
|
|
4842
4367
|
}), r3.length > 0 && (e3.fail(n2("Unknown command: %s", "Unknown commands: %s", r3.length, r3.join(", "))), true);
|
|
4843
4368
|
}, isValidAndSomeAliasIsNotNew: function(e4, s4) {
|
|
4844
|
-
if (!Object.prototype.hasOwnProperty.call(s4, e4))
|
|
4845
|
-
return false;
|
|
4369
|
+
if (!Object.prototype.hasOwnProperty.call(s4, e4)) return false;
|
|
4846
4370
|
const i3 = t3.parsed.newAliases;
|
|
4847
4371
|
return [e4, ...s4[e4]].some((t4) => !Object.prototype.hasOwnProperty.call(i3, t4) || !i3[e4]);
|
|
4848
4372
|
}, limitedChoices: function(s4) {
|
|
4849
4373
|
const n3 = t3.getOptions(), r3 = {};
|
|
4850
|
-
if (!Object.keys(n3.choices).length)
|
|
4851
|
-
return;
|
|
4374
|
+
if (!Object.keys(n3.choices).length) return;
|
|
4852
4375
|
Object.keys(s4).forEach((t4) => {
|
|
4853
4376
|
-1 === H.indexOf(t4) && Object.prototype.hasOwnProperty.call(n3.choices, t4) && [].concat(s4[t4]).forEach((e4) => {
|
|
4854
4377
|
-1 === n3.choices[t4].indexOf(e4) && void 0 !== e4 && (r3[t4] = (r3[t4] || []).concat(e4));
|
|
4855
4378
|
});
|
|
4856
4379
|
});
|
|
4857
4380
|
const o3 = Object.keys(r3);
|
|
4858
|
-
if (!o3.length)
|
|
4859
|
-
return;
|
|
4381
|
+
if (!o3.length) return;
|
|
4860
4382
|
let a3 = i2("Invalid values:");
|
|
4861
4383
|
o3.forEach((t4) => {
|
|
4862
4384
|
a3 += `
|
|
@@ -4944,8 +4466,7 @@ ${t5.join("\n")}` : "";
|
|
|
4944
4466
|
t3 === v(this, Z, "f") && c2[t3] ? p2 = true : t3 === v(this, mt, "f") && c2[t3] && (g2 = true);
|
|
4945
4467
|
}), c2.$0 = this.$0, this.parsed = l2, 0 === n2 && v(this, pt, "f").clearCachedHelpMessage();
|
|
4946
4468
|
try {
|
|
4947
|
-
if (this[kt](), s2)
|
|
4948
|
-
return this[Bt](c2, a2, !!i2, false);
|
|
4469
|
+
if (this[kt](), s2) return this[Bt](c2, a2, !!i2, false);
|
|
4949
4470
|
if (v(this, Z, "f")) {
|
|
4950
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);
|
|
4951
4472
|
}
|
|
@@ -4976,24 +4497,21 @@ ${t5.join("\n")}` : "";
|
|
|
4976
4497
|
v(this, T, "f") && E(true);
|
|
4977
4498
|
const s3 = (t2 = [].concat(t2)).slice(t2.indexOf(`--${v(this, U, "f").completionKey}`) + 1);
|
|
4978
4499
|
return v(this, U, "f").getCompletion(s3, (t3, s4) => {
|
|
4979
|
-
if (t3)
|
|
4980
|
-
throw new e(t3.message);
|
|
4500
|
+
if (t3) throw new e(t3.message);
|
|
4981
4501
|
(s4 || []).forEach((t4) => {
|
|
4982
4502
|
v(this, Q, "f").log(t4);
|
|
4983
4503
|
}), this.exit(0);
|
|
4984
4504
|
}), this[Bt](c2, !a2, !!i2, false);
|
|
4985
4505
|
}
|
|
4986
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) {
|
|
4987
|
-
if (l2.error)
|
|
4988
|
-
throw new e(l2.error.message);
|
|
4507
|
+
if (l2.error) throw new e(l2.error.message);
|
|
4989
4508
|
if (!m2) {
|
|
4990
4509
|
const t3 = this[Zt](u2, {}, l2.error);
|
|
4991
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)));
|
|
4992
4511
|
}
|
|
4993
4512
|
}
|
|
4994
4513
|
} catch (t3) {
|
|
4995
|
-
if (!(t3 instanceof e))
|
|
4996
|
-
throw t3;
|
|
4514
|
+
if (!(t3 instanceof e)) throw t3;
|
|
4997
4515
|
v(this, pt, "f").fail(t3.message, t3);
|
|
4998
4516
|
}
|
|
4999
4517
|
return this[Bt](null != d2 ? d2 : c2, a2, !!i2, true);
|
|
@@ -5001,8 +4519,7 @@ ${t5.join("\n")}` : "";
|
|
|
5001
4519
|
[Zt](t2, s2, i2, n2) {
|
|
5002
4520
|
const r2 = { ...this.getDemandedOptions() };
|
|
5003
4521
|
return (o2) => {
|
|
5004
|
-
if (i2)
|
|
5005
|
-
throw new e(i2.message);
|
|
4522
|
+
if (i2) throw new e(i2.message);
|
|
5006
4523
|
v(this, yt, "f").nonOptionCount(o2), v(this, yt, "f").requiredArguments(o2, r2);
|
|
5007
4524
|
let a2 = false;
|
|
5008
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);
|
|
@@ -5011,37 +4528,393 @@ ${t5.join("\n")}` : "";
|
|
|
5011
4528
|
[Xt]() {
|
|
5012
4529
|
O(this, J, true, "f");
|
|
5013
4530
|
}
|
|
5014
|
-
[Qt](t2) {
|
|
5015
|
-
if ("string" == typeof t2)
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
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 fs2 = require("fs");
|
|
4566
|
+
var os = require("os");
|
|
4567
|
+
var path4 = require("path");
|
|
4568
|
+
var crypto = require("crypto");
|
|
4569
|
+
var _c2 = { fs: fs2.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 = fs2.rmdirSync.bind(fs2);
|
|
4582
|
+
var _gracefulCleanup = false;
|
|
4583
|
+
function rimraf(dirPath, callback) {
|
|
4584
|
+
return fs2.rm(dirPath, { recursive: true }, callback);
|
|
4585
|
+
}
|
|
4586
|
+
function FN_RIMRAF_SYNC(dirPath) {
|
|
4587
|
+
return fs2.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
|
+
fs2.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
|
+
fs2.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
|
+
fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
4631
|
+
if (err2) return cb(err2);
|
|
4632
|
+
if (opts.discardDescriptor) {
|
|
4633
|
+
return fs2.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 = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
4648
|
+
if (opts.discardDescriptor) {
|
|
4649
|
+
fs2.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
|
+
fs2.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
|
+
fs2.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
|
+
fs2.close(fdPath[0], function() {
|
|
4686
|
+
fs2.unlink(fdPath[1], _handler);
|
|
4687
|
+
});
|
|
4688
|
+
else fs2.unlink(fdPath[1], _handler);
|
|
4689
|
+
}
|
|
4690
|
+
function _removeFileSync(fdPath) {
|
|
4691
|
+
let rethrownException = null;
|
|
4692
|
+
try {
|
|
4693
|
+
if (0 <= fdPath[0]) fs2.closeSync(fdPath[0]);
|
|
4694
|
+
} catch (e) {
|
|
4695
|
+
if (!_isEBADF(e) && !_isENOENT(e)) throw e;
|
|
4696
|
+
} finally {
|
|
4697
|
+
try {
|
|
4698
|
+
fs2.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 : fs2.rmdir.bind(fs2);
|
|
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
|
+
}
|
|
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();
|
|
5020
4912
|
}
|
|
5021
4913
|
};
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
var { resolve: re } = require("path");
|
|
5027
|
-
var oe = require_build();
|
|
5028
|
-
var ae = require_build2();
|
|
5029
|
-
var he;
|
|
5030
|
-
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) => {
|
|
5031
|
-
process.exit(t2);
|
|
5032
|
-
}, 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 }) };
|
|
5033
|
-
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;
|
|
5034
|
-
if (process && process.version) {
|
|
5035
|
-
if (Number(process.version.match(/v([^.]+)/)[1]) < ce)
|
|
5036
|
-
throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`);
|
|
5037
|
-
}
|
|
5038
|
-
var fe = require_build2();
|
|
5039
|
-
var de;
|
|
5040
|
-
var ue = { applyExtends: n, cjsPlatformShim: le, Yargs: (de = le, (t2 = [], e2 = de.process.cwd(), s2) => {
|
|
5041
|
-
const i2 = new te(t2, e2, s2, de);
|
|
5042
|
-
return Object.defineProperty(i2, "argv", { get: () => i2.parse(), enumerable: true }), i2.help(), i2.version(), i2;
|
|
5043
|
-
}), argsert: h, isPromise: f, objFilter: g, parseCommand: o, Parser: fe, processArgv: b, YError: e };
|
|
5044
|
-
module2.exports = ue;
|
|
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;
|
|
5045
4918
|
}
|
|
5046
4919
|
});
|
|
5047
4920
|
|
|
@@ -5199,12 +5072,12 @@ var require_common = __commonJS({
|
|
|
5199
5072
|
if (!debug2.enabled) {
|
|
5200
5073
|
return;
|
|
5201
5074
|
}
|
|
5202
|
-
const
|
|
5075
|
+
const self = debug2;
|
|
5203
5076
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
5204
5077
|
const ms = curr - (prevTime || curr);
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5078
|
+
self.diff = ms;
|
|
5079
|
+
self.prev = prevTime;
|
|
5080
|
+
self.curr = curr;
|
|
5208
5081
|
prevTime = curr;
|
|
5209
5082
|
args[0] = createDebug.coerce(args[0]);
|
|
5210
5083
|
if (typeof args[0] !== "string") {
|
|
@@ -5219,15 +5092,15 @@ var require_common = __commonJS({
|
|
|
5219
5092
|
const formatter = createDebug.formatters[format3];
|
|
5220
5093
|
if (typeof formatter === "function") {
|
|
5221
5094
|
const val = args[index];
|
|
5222
|
-
match = formatter.call(
|
|
5095
|
+
match = formatter.call(self, val);
|
|
5223
5096
|
args.splice(index, 1);
|
|
5224
5097
|
index--;
|
|
5225
5098
|
}
|
|
5226
5099
|
return match;
|
|
5227
5100
|
});
|
|
5228
|
-
createDebug.formatArgs.call(
|
|
5229
|
-
const logFn =
|
|
5230
|
-
logFn.apply(
|
|
5101
|
+
createDebug.formatArgs.call(self, args);
|
|
5102
|
+
const logFn = self.log || createDebug.log;
|
|
5103
|
+
logFn.apply(self, args);
|
|
5231
5104
|
}
|
|
5232
5105
|
debug2.namespace = namespace;
|
|
5233
5106
|
debug2.useColors = createDebug.useColors();
|
|
@@ -5841,9 +5714,7 @@ var require_dist = __commonJS({
|
|
|
5841
5714
|
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
|
|
5842
5715
|
"use strict";
|
|
5843
5716
|
function __export3(m) {
|
|
5844
|
-
for (var p in m)
|
|
5845
|
-
if (!exports2.hasOwnProperty(p))
|
|
5846
|
-
exports2[p] = m[p];
|
|
5717
|
+
for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
|
|
5847
5718
|
}
|
|
5848
5719
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5849
5720
|
__export3(require_src2());
|
|
@@ -5892,28 +5763,6 @@ var require_dist2 = __commonJS({
|
|
|
5892
5763
|
}
|
|
5893
5764
|
});
|
|
5894
5765
|
|
|
5895
|
-
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/cwd.js
|
|
5896
|
-
function cwd() {
|
|
5897
|
-
return process.cwd();
|
|
5898
|
-
}
|
|
5899
|
-
|
|
5900
|
-
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/doesPathExist.js
|
|
5901
|
-
var import_promises = require("fs/promises");
|
|
5902
|
-
async function doesPathExist(filepath) {
|
|
5903
|
-
try {
|
|
5904
|
-
await (0, import_promises.lstat)(filepath);
|
|
5905
|
-
return true;
|
|
5906
|
-
} catch {
|
|
5907
|
-
return false;
|
|
5908
|
-
}
|
|
5909
|
-
}
|
|
5910
|
-
|
|
5911
|
-
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/resolve.js
|
|
5912
|
-
var import_path = __toESM(require("path"), 1);
|
|
5913
|
-
function resolve(...paths) {
|
|
5914
|
-
return import_path.default.resolve(...paths);
|
|
5915
|
-
}
|
|
5916
|
-
|
|
5917
5766
|
// src/cli.ts
|
|
5918
5767
|
var import_fs5 = __toESM(require("fs"), 1);
|
|
5919
5768
|
var import_promises5 = require("fs/promises");
|
|
@@ -5951,7 +5800,7 @@ function getProcessArgvBin() {
|
|
|
5951
5800
|
|
|
5952
5801
|
// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js
|
|
5953
5802
|
var import_util = require("util");
|
|
5954
|
-
var
|
|
5803
|
+
var import_path = require("path");
|
|
5955
5804
|
|
|
5956
5805
|
// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/string-utils.js
|
|
5957
5806
|
function camelCase(str) {
|
|
@@ -6866,8 +6715,8 @@ function combineAliases(aliases) {
|
|
|
6866
6715
|
}
|
|
6867
6716
|
}
|
|
6868
6717
|
aliasArrays.forEach(function(aliasArray) {
|
|
6869
|
-
aliasArray = aliasArray.filter(function(v, i,
|
|
6870
|
-
return
|
|
6718
|
+
aliasArray = aliasArray.filter(function(v, i, self) {
|
|
6719
|
+
return self.indexOf(v) === i;
|
|
6871
6720
|
});
|
|
6872
6721
|
const lastAlias = aliasArray.pop();
|
|
6873
6722
|
if (lastAlias !== void 0 && typeof lastAlias === "string") {
|
|
@@ -6908,8 +6757,8 @@ var parser = new YargsParser({
|
|
|
6908
6757
|
return env;
|
|
6909
6758
|
},
|
|
6910
6759
|
format: import_util.format,
|
|
6911
|
-
normalize:
|
|
6912
|
-
resolve:
|
|
6760
|
+
normalize: import_path.normalize,
|
|
6761
|
+
resolve: import_path.resolve,
|
|
6913
6762
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
6914
6763
|
// we can exercise all the lines below:
|
|
6915
6764
|
require: (path4) => {
|
|
@@ -7226,21 +7075,19 @@ function ui(opts) {
|
|
|
7226
7075
|
}
|
|
7227
7076
|
|
|
7228
7077
|
// ../../node_modules/.pnpm/escalade@3.1.2/node_modules/escalade/sync/index.mjs
|
|
7229
|
-
var
|
|
7078
|
+
var import_path2 = require("path");
|
|
7230
7079
|
var import_fs2 = require("fs");
|
|
7231
7080
|
function sync_default(start, callback) {
|
|
7232
|
-
let dir = (0,
|
|
7081
|
+
let dir = (0, import_path2.resolve)(".", start);
|
|
7233
7082
|
let tmp2, stats = (0, import_fs2.statSync)(dir);
|
|
7234
7083
|
if (!stats.isDirectory()) {
|
|
7235
|
-
dir = (0,
|
|
7084
|
+
dir = (0, import_path2.dirname)(dir);
|
|
7236
7085
|
}
|
|
7237
7086
|
while (true) {
|
|
7238
7087
|
tmp2 = callback(dir, (0, import_fs2.readdirSync)(dir));
|
|
7239
|
-
if (tmp2)
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
if (tmp2 === dir)
|
|
7243
|
-
break;
|
|
7088
|
+
if (tmp2) return (0, import_path2.resolve)(dir, tmp2);
|
|
7089
|
+
dir = (0, import_path2.dirname)(tmp2 = dir);
|
|
7090
|
+
if (tmp2 === dir) break;
|
|
7244
7091
|
}
|
|
7245
7092
|
}
|
|
7246
7093
|
|
|
@@ -7248,19 +7095,19 @@ function sync_default(start, callback) {
|
|
|
7248
7095
|
var import_util3 = require("util");
|
|
7249
7096
|
var import_fs4 = require("fs");
|
|
7250
7097
|
var import_url = require("url");
|
|
7251
|
-
var
|
|
7098
|
+
var import_path4 = require("path");
|
|
7252
7099
|
|
|
7253
7100
|
// ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
|
|
7254
7101
|
var import_fs3 = require("fs");
|
|
7255
7102
|
var import_util2 = require("util");
|
|
7256
|
-
var
|
|
7103
|
+
var import_path3 = require("path");
|
|
7257
7104
|
var node_default = {
|
|
7258
7105
|
fs: {
|
|
7259
7106
|
readFileSync: import_fs3.readFileSync,
|
|
7260
7107
|
writeFile: import_fs3.writeFile
|
|
7261
7108
|
},
|
|
7262
7109
|
format: import_util2.format,
|
|
7263
|
-
resolve:
|
|
7110
|
+
resolve: import_path3.resolve,
|
|
7264
7111
|
exists: (file) => {
|
|
7265
7112
|
try {
|
|
7266
7113
|
return (0, import_fs3.statSync)(file).isFile();
|
|
@@ -7466,11 +7313,11 @@ var esm_default = {
|
|
|
7466
7313
|
mainFilename: mainFilename || process.cwd(),
|
|
7467
7314
|
Parser: lib_default,
|
|
7468
7315
|
path: {
|
|
7469
|
-
basename:
|
|
7470
|
-
dirname:
|
|
7471
|
-
extname:
|
|
7472
|
-
relative:
|
|
7473
|
-
resolve:
|
|
7316
|
+
basename: import_path4.basename,
|
|
7317
|
+
dirname: import_path4.dirname,
|
|
7318
|
+
extname: import_path4.extname,
|
|
7319
|
+
relative: import_path4.relative,
|
|
7320
|
+
resolve: import_path4.resolve
|
|
7474
7321
|
},
|
|
7475
7322
|
process: {
|
|
7476
7323
|
argv: () => process.argv,
|
|
@@ -7492,7 +7339,7 @@ var esm_default = {
|
|
|
7492
7339
|
return [...str].length;
|
|
7493
7340
|
},
|
|
7494
7341
|
y18n: y18n_default({
|
|
7495
|
-
directory: (0,
|
|
7342
|
+
directory: (0, import_path4.resolve)(__dirname2, "../../../locales"),
|
|
7496
7343
|
updateFiles: false
|
|
7497
7344
|
})
|
|
7498
7345
|
};
|
|
@@ -7507,6 +7354,28 @@ Yargs.hideBin = processArgv.hideBin;
|
|
|
7507
7354
|
Yargs.Parser = Parser2;
|
|
7508
7355
|
var yargs_default = Yargs;
|
|
7509
7356
|
|
|
7357
|
+
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/cwd.js
|
|
7358
|
+
function cwd() {
|
|
7359
|
+
return process.cwd();
|
|
7360
|
+
}
|
|
7361
|
+
|
|
7362
|
+
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/doesPathExist.js
|
|
7363
|
+
var import_promises = require("fs/promises");
|
|
7364
|
+
async function doesPathExist(filepath) {
|
|
7365
|
+
try {
|
|
7366
|
+
await (0, import_promises.lstat)(filepath);
|
|
7367
|
+
return true;
|
|
7368
|
+
} catch {
|
|
7369
|
+
return false;
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
|
|
7373
|
+
// ../../node_modules/.pnpm/@fern-api+fs-utils@0.15.0-rc63/node_modules/@fern-api/fs-utils/lib/resolve.js
|
|
7374
|
+
var import_path5 = __toESM(require("path"), 1);
|
|
7375
|
+
function resolve5(...paths) {
|
|
7376
|
+
return import_path5.default.resolve(...paths);
|
|
7377
|
+
}
|
|
7378
|
+
|
|
7510
7379
|
// src/configuration/loadReadmeConfig.ts
|
|
7511
7380
|
var import_promises2 = require("fs/promises");
|
|
7512
7381
|
async function loadReadmeConfig({
|
|
@@ -7525,6 +7394,9 @@ async function loadReferenceConfig({
|
|
|
7525
7394
|
return JSON.parse(rawContents);
|
|
7526
7395
|
}
|
|
7527
7396
|
|
|
7397
|
+
// src/readme/ReadmeGenerator.ts
|
|
7398
|
+
var import_string = require("es-toolkit/string");
|
|
7399
|
+
|
|
7528
7400
|
// ../../node_modules/.pnpm/simple-git@3.24.0/node_modules/simple-git/dist/esm/index.js
|
|
7529
7401
|
var import_file_exists = __toESM(require_dist(), 1);
|
|
7530
7402
|
var import_debug = __toESM(require_src(), 1);
|
|
@@ -9050,12 +8922,12 @@ var init_task_callback = __esm({
|
|
|
9050
8922
|
init_utils();
|
|
9051
8923
|
}
|
|
9052
8924
|
});
|
|
9053
|
-
function changeWorkingDirectoryTask(directory,
|
|
8925
|
+
function changeWorkingDirectoryTask(directory, root) {
|
|
9054
8926
|
return adhocExecTask((instance) => {
|
|
9055
8927
|
if (!folderExists(directory)) {
|
|
9056
8928
|
throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`);
|
|
9057
8929
|
}
|
|
9058
|
-
return (
|
|
8930
|
+
return (root || instance).cwd = directory;
|
|
9059
8931
|
});
|
|
9060
8932
|
}
|
|
9061
8933
|
var init_change_working_directory = __esm({
|
|
@@ -9121,10 +8993,10 @@ var init_parse_commit = __esm({
|
|
|
9121
8993
|
"use strict";
|
|
9122
8994
|
init_utils();
|
|
9123
8995
|
parsers = [
|
|
9124
|
-
new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch,
|
|
8996
|
+
new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch, root, commit]) => {
|
|
9125
8997
|
result.branch = branch;
|
|
9126
8998
|
result.commit = commit;
|
|
9127
|
-
result.root = !!
|
|
8999
|
+
result.root = !!root;
|
|
9128
9000
|
}),
|
|
9129
9001
|
new LineParser(/\s*Author:\s(.+)/i, (result, [author]) => {
|
|
9130
9002
|
const parts = author.split("<");
|
|
@@ -12120,553 +11992,6 @@ async function cloneRepository({ githubRepository, installationToken }) {
|
|
|
12120
11992
|
});
|
|
12121
11993
|
}
|
|
12122
11994
|
|
|
12123
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
|
|
12124
|
-
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
12125
|
-
var freeGlobal_default = freeGlobal;
|
|
12126
|
-
|
|
12127
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
|
|
12128
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
12129
|
-
var root = freeGlobal_default || freeSelf || Function("return this")();
|
|
12130
|
-
var root_default = root;
|
|
12131
|
-
|
|
12132
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
|
|
12133
|
-
var Symbol2 = root_default.Symbol;
|
|
12134
|
-
var Symbol_default = Symbol2;
|
|
12135
|
-
|
|
12136
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
|
|
12137
|
-
var objectProto = Object.prototype;
|
|
12138
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
12139
|
-
var nativeObjectToString = objectProto.toString;
|
|
12140
|
-
var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
12141
|
-
function getRawTag(value) {
|
|
12142
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
12143
|
-
try {
|
|
12144
|
-
value[symToStringTag] = void 0;
|
|
12145
|
-
var unmasked = true;
|
|
12146
|
-
} catch (e) {
|
|
12147
|
-
}
|
|
12148
|
-
var result = nativeObjectToString.call(value);
|
|
12149
|
-
if (unmasked) {
|
|
12150
|
-
if (isOwn) {
|
|
12151
|
-
value[symToStringTag] = tag;
|
|
12152
|
-
} else {
|
|
12153
|
-
delete value[symToStringTag];
|
|
12154
|
-
}
|
|
12155
|
-
}
|
|
12156
|
-
return result;
|
|
12157
|
-
}
|
|
12158
|
-
var getRawTag_default = getRawTag;
|
|
12159
|
-
|
|
12160
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
|
|
12161
|
-
var objectProto2 = Object.prototype;
|
|
12162
|
-
var nativeObjectToString2 = objectProto2.toString;
|
|
12163
|
-
function objectToString2(value) {
|
|
12164
|
-
return nativeObjectToString2.call(value);
|
|
12165
|
-
}
|
|
12166
|
-
var objectToString_default = objectToString2;
|
|
12167
|
-
|
|
12168
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
|
|
12169
|
-
var nullTag = "[object Null]";
|
|
12170
|
-
var undefinedTag = "[object Undefined]";
|
|
12171
|
-
var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
12172
|
-
function baseGetTag(value) {
|
|
12173
|
-
if (value == null) {
|
|
12174
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
12175
|
-
}
|
|
12176
|
-
return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
|
|
12177
|
-
}
|
|
12178
|
-
var baseGetTag_default = baseGetTag;
|
|
12179
|
-
|
|
12180
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
|
|
12181
|
-
function isObjectLike(value) {
|
|
12182
|
-
return value != null && typeof value == "object";
|
|
12183
|
-
}
|
|
12184
|
-
var isObjectLike_default = isObjectLike;
|
|
12185
|
-
|
|
12186
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
|
|
12187
|
-
var symbolTag = "[object Symbol]";
|
|
12188
|
-
function isSymbol(value) {
|
|
12189
|
-
return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
|
|
12190
|
-
}
|
|
12191
|
-
var isSymbol_default = isSymbol;
|
|
12192
|
-
|
|
12193
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
|
|
12194
|
-
function arrayMap(array, iteratee) {
|
|
12195
|
-
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
12196
|
-
while (++index < length) {
|
|
12197
|
-
result[index] = iteratee(array[index], index, array);
|
|
12198
|
-
}
|
|
12199
|
-
return result;
|
|
12200
|
-
}
|
|
12201
|
-
var arrayMap_default = arrayMap;
|
|
12202
|
-
|
|
12203
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
|
|
12204
|
-
var isArray = Array.isArray;
|
|
12205
|
-
var isArray_default = isArray;
|
|
12206
|
-
|
|
12207
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js
|
|
12208
|
-
var INFINITY = 1 / 0;
|
|
12209
|
-
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
|
|
12210
|
-
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
12211
|
-
function baseToString(value) {
|
|
12212
|
-
if (typeof value == "string") {
|
|
12213
|
-
return value;
|
|
12214
|
-
}
|
|
12215
|
-
if (isArray_default(value)) {
|
|
12216
|
-
return arrayMap_default(value, baseToString) + "";
|
|
12217
|
-
}
|
|
12218
|
-
if (isSymbol_default(value)) {
|
|
12219
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
12220
|
-
}
|
|
12221
|
-
var result = value + "";
|
|
12222
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
12223
|
-
}
|
|
12224
|
-
var baseToString_default = baseToString;
|
|
12225
|
-
|
|
12226
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
|
|
12227
|
-
function toString(value) {
|
|
12228
|
-
return value == null ? "" : baseToString_default(value);
|
|
12229
|
-
}
|
|
12230
|
-
var toString_default = toString;
|
|
12231
|
-
|
|
12232
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
|
|
12233
|
-
function baseSlice(array, start, end) {
|
|
12234
|
-
var index = -1, length = array.length;
|
|
12235
|
-
if (start < 0) {
|
|
12236
|
-
start = -start > length ? 0 : length + start;
|
|
12237
|
-
}
|
|
12238
|
-
end = end > length ? length : end;
|
|
12239
|
-
if (end < 0) {
|
|
12240
|
-
end += length;
|
|
12241
|
-
}
|
|
12242
|
-
length = start > end ? 0 : end - start >>> 0;
|
|
12243
|
-
start >>>= 0;
|
|
12244
|
-
var result = Array(length);
|
|
12245
|
-
while (++index < length) {
|
|
12246
|
-
result[index] = array[index + start];
|
|
12247
|
-
}
|
|
12248
|
-
return result;
|
|
12249
|
-
}
|
|
12250
|
-
var baseSlice_default = baseSlice;
|
|
12251
|
-
|
|
12252
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castSlice.js
|
|
12253
|
-
function castSlice(array, start, end) {
|
|
12254
|
-
var length = array.length;
|
|
12255
|
-
end = end === void 0 ? length : end;
|
|
12256
|
-
return !start && end >= length ? array : baseSlice_default(array, start, end);
|
|
12257
|
-
}
|
|
12258
|
-
var castSlice_default = castSlice;
|
|
12259
|
-
|
|
12260
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js
|
|
12261
|
-
var rsAstralRange = "\\ud800-\\udfff";
|
|
12262
|
-
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
12263
|
-
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
12264
|
-
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
12265
|
-
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
12266
|
-
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
12267
|
-
var rsZWJ = "\\u200d";
|
|
12268
|
-
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
12269
|
-
function hasUnicode(string) {
|
|
12270
|
-
return reHasUnicode.test(string);
|
|
12271
|
-
}
|
|
12272
|
-
var hasUnicode_default = hasUnicode;
|
|
12273
|
-
|
|
12274
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiToArray.js
|
|
12275
|
-
function asciiToArray(string) {
|
|
12276
|
-
return string.split("");
|
|
12277
|
-
}
|
|
12278
|
-
var asciiToArray_default = asciiToArray;
|
|
12279
|
-
|
|
12280
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeToArray.js
|
|
12281
|
-
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
12282
|
-
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
12283
|
-
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
12284
|
-
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
12285
|
-
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
12286
|
-
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
12287
|
-
var rsAstral = "[" + rsAstralRange2 + "]";
|
|
12288
|
-
var rsCombo = "[" + rsComboRange2 + "]";
|
|
12289
|
-
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
12290
|
-
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
12291
|
-
var rsNonAstral = "[^" + rsAstralRange2 + "]";
|
|
12292
|
-
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
12293
|
-
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
12294
|
-
var rsZWJ2 = "\\u200d";
|
|
12295
|
-
var reOptMod = rsModifier + "?";
|
|
12296
|
-
var rsOptVar = "[" + rsVarRange2 + "]?";
|
|
12297
|
-
var rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
12298
|
-
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
12299
|
-
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
12300
|
-
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
12301
|
-
function unicodeToArray(string) {
|
|
12302
|
-
return string.match(reUnicode) || [];
|
|
12303
|
-
}
|
|
12304
|
-
var unicodeToArray_default = unicodeToArray;
|
|
12305
|
-
|
|
12306
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToArray.js
|
|
12307
|
-
function stringToArray(string) {
|
|
12308
|
-
return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
|
|
12309
|
-
}
|
|
12310
|
-
var stringToArray_default = stringToArray;
|
|
12311
|
-
|
|
12312
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCaseFirst.js
|
|
12313
|
-
function createCaseFirst(methodName) {
|
|
12314
|
-
return function(string) {
|
|
12315
|
-
string = toString_default(string);
|
|
12316
|
-
var strSymbols = hasUnicode_default(string) ? stringToArray_default(string) : void 0;
|
|
12317
|
-
var chr = strSymbols ? strSymbols[0] : string.charAt(0);
|
|
12318
|
-
var trailing = strSymbols ? castSlice_default(strSymbols, 1).join("") : string.slice(1);
|
|
12319
|
-
return chr[methodName]() + trailing;
|
|
12320
|
-
};
|
|
12321
|
-
}
|
|
12322
|
-
var createCaseFirst_default = createCaseFirst;
|
|
12323
|
-
|
|
12324
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/upperFirst.js
|
|
12325
|
-
var upperFirst = createCaseFirst_default("toUpperCase");
|
|
12326
|
-
var upperFirst_default = upperFirst;
|
|
12327
|
-
|
|
12328
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/capitalize.js
|
|
12329
|
-
function capitalize(string) {
|
|
12330
|
-
return upperFirst_default(toString_default(string).toLowerCase());
|
|
12331
|
-
}
|
|
12332
|
-
var capitalize_default = capitalize;
|
|
12333
|
-
|
|
12334
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js
|
|
12335
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
12336
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
12337
|
-
if (initAccum && length) {
|
|
12338
|
-
accumulator = array[++index];
|
|
12339
|
-
}
|
|
12340
|
-
while (++index < length) {
|
|
12341
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
12342
|
-
}
|
|
12343
|
-
return accumulator;
|
|
12344
|
-
}
|
|
12345
|
-
var arrayReduce_default = arrayReduce;
|
|
12346
|
-
|
|
12347
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyOf.js
|
|
12348
|
-
function basePropertyOf(object) {
|
|
12349
|
-
return function(key) {
|
|
12350
|
-
return object == null ? void 0 : object[key];
|
|
12351
|
-
};
|
|
12352
|
-
}
|
|
12353
|
-
var basePropertyOf_default = basePropertyOf;
|
|
12354
|
-
|
|
12355
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_deburrLetter.js
|
|
12356
|
-
var deburredLetters = {
|
|
12357
|
-
// Latin-1 Supplement block.
|
|
12358
|
-
"\xC0": "A",
|
|
12359
|
-
"\xC1": "A",
|
|
12360
|
-
"\xC2": "A",
|
|
12361
|
-
"\xC3": "A",
|
|
12362
|
-
"\xC4": "A",
|
|
12363
|
-
"\xC5": "A",
|
|
12364
|
-
"\xE0": "a",
|
|
12365
|
-
"\xE1": "a",
|
|
12366
|
-
"\xE2": "a",
|
|
12367
|
-
"\xE3": "a",
|
|
12368
|
-
"\xE4": "a",
|
|
12369
|
-
"\xE5": "a",
|
|
12370
|
-
"\xC7": "C",
|
|
12371
|
-
"\xE7": "c",
|
|
12372
|
-
"\xD0": "D",
|
|
12373
|
-
"\xF0": "d",
|
|
12374
|
-
"\xC8": "E",
|
|
12375
|
-
"\xC9": "E",
|
|
12376
|
-
"\xCA": "E",
|
|
12377
|
-
"\xCB": "E",
|
|
12378
|
-
"\xE8": "e",
|
|
12379
|
-
"\xE9": "e",
|
|
12380
|
-
"\xEA": "e",
|
|
12381
|
-
"\xEB": "e",
|
|
12382
|
-
"\xCC": "I",
|
|
12383
|
-
"\xCD": "I",
|
|
12384
|
-
"\xCE": "I",
|
|
12385
|
-
"\xCF": "I",
|
|
12386
|
-
"\xEC": "i",
|
|
12387
|
-
"\xED": "i",
|
|
12388
|
-
"\xEE": "i",
|
|
12389
|
-
"\xEF": "i",
|
|
12390
|
-
"\xD1": "N",
|
|
12391
|
-
"\xF1": "n",
|
|
12392
|
-
"\xD2": "O",
|
|
12393
|
-
"\xD3": "O",
|
|
12394
|
-
"\xD4": "O",
|
|
12395
|
-
"\xD5": "O",
|
|
12396
|
-
"\xD6": "O",
|
|
12397
|
-
"\xD8": "O",
|
|
12398
|
-
"\xF2": "o",
|
|
12399
|
-
"\xF3": "o",
|
|
12400
|
-
"\xF4": "o",
|
|
12401
|
-
"\xF5": "o",
|
|
12402
|
-
"\xF6": "o",
|
|
12403
|
-
"\xF8": "o",
|
|
12404
|
-
"\xD9": "U",
|
|
12405
|
-
"\xDA": "U",
|
|
12406
|
-
"\xDB": "U",
|
|
12407
|
-
"\xDC": "U",
|
|
12408
|
-
"\xF9": "u",
|
|
12409
|
-
"\xFA": "u",
|
|
12410
|
-
"\xFB": "u",
|
|
12411
|
-
"\xFC": "u",
|
|
12412
|
-
"\xDD": "Y",
|
|
12413
|
-
"\xFD": "y",
|
|
12414
|
-
"\xFF": "y",
|
|
12415
|
-
"\xC6": "Ae",
|
|
12416
|
-
"\xE6": "ae",
|
|
12417
|
-
"\xDE": "Th",
|
|
12418
|
-
"\xFE": "th",
|
|
12419
|
-
"\xDF": "ss",
|
|
12420
|
-
// Latin Extended-A block.
|
|
12421
|
-
"\u0100": "A",
|
|
12422
|
-
"\u0102": "A",
|
|
12423
|
-
"\u0104": "A",
|
|
12424
|
-
"\u0101": "a",
|
|
12425
|
-
"\u0103": "a",
|
|
12426
|
-
"\u0105": "a",
|
|
12427
|
-
"\u0106": "C",
|
|
12428
|
-
"\u0108": "C",
|
|
12429
|
-
"\u010A": "C",
|
|
12430
|
-
"\u010C": "C",
|
|
12431
|
-
"\u0107": "c",
|
|
12432
|
-
"\u0109": "c",
|
|
12433
|
-
"\u010B": "c",
|
|
12434
|
-
"\u010D": "c",
|
|
12435
|
-
"\u010E": "D",
|
|
12436
|
-
"\u0110": "D",
|
|
12437
|
-
"\u010F": "d",
|
|
12438
|
-
"\u0111": "d",
|
|
12439
|
-
"\u0112": "E",
|
|
12440
|
-
"\u0114": "E",
|
|
12441
|
-
"\u0116": "E",
|
|
12442
|
-
"\u0118": "E",
|
|
12443
|
-
"\u011A": "E",
|
|
12444
|
-
"\u0113": "e",
|
|
12445
|
-
"\u0115": "e",
|
|
12446
|
-
"\u0117": "e",
|
|
12447
|
-
"\u0119": "e",
|
|
12448
|
-
"\u011B": "e",
|
|
12449
|
-
"\u011C": "G",
|
|
12450
|
-
"\u011E": "G",
|
|
12451
|
-
"\u0120": "G",
|
|
12452
|
-
"\u0122": "G",
|
|
12453
|
-
"\u011D": "g",
|
|
12454
|
-
"\u011F": "g",
|
|
12455
|
-
"\u0121": "g",
|
|
12456
|
-
"\u0123": "g",
|
|
12457
|
-
"\u0124": "H",
|
|
12458
|
-
"\u0126": "H",
|
|
12459
|
-
"\u0125": "h",
|
|
12460
|
-
"\u0127": "h",
|
|
12461
|
-
"\u0128": "I",
|
|
12462
|
-
"\u012A": "I",
|
|
12463
|
-
"\u012C": "I",
|
|
12464
|
-
"\u012E": "I",
|
|
12465
|
-
"\u0130": "I",
|
|
12466
|
-
"\u0129": "i",
|
|
12467
|
-
"\u012B": "i",
|
|
12468
|
-
"\u012D": "i",
|
|
12469
|
-
"\u012F": "i",
|
|
12470
|
-
"\u0131": "i",
|
|
12471
|
-
"\u0134": "J",
|
|
12472
|
-
"\u0135": "j",
|
|
12473
|
-
"\u0136": "K",
|
|
12474
|
-
"\u0137": "k",
|
|
12475
|
-
"\u0138": "k",
|
|
12476
|
-
"\u0139": "L",
|
|
12477
|
-
"\u013B": "L",
|
|
12478
|
-
"\u013D": "L",
|
|
12479
|
-
"\u013F": "L",
|
|
12480
|
-
"\u0141": "L",
|
|
12481
|
-
"\u013A": "l",
|
|
12482
|
-
"\u013C": "l",
|
|
12483
|
-
"\u013E": "l",
|
|
12484
|
-
"\u0140": "l",
|
|
12485
|
-
"\u0142": "l",
|
|
12486
|
-
"\u0143": "N",
|
|
12487
|
-
"\u0145": "N",
|
|
12488
|
-
"\u0147": "N",
|
|
12489
|
-
"\u014A": "N",
|
|
12490
|
-
"\u0144": "n",
|
|
12491
|
-
"\u0146": "n",
|
|
12492
|
-
"\u0148": "n",
|
|
12493
|
-
"\u014B": "n",
|
|
12494
|
-
"\u014C": "O",
|
|
12495
|
-
"\u014E": "O",
|
|
12496
|
-
"\u0150": "O",
|
|
12497
|
-
"\u014D": "o",
|
|
12498
|
-
"\u014F": "o",
|
|
12499
|
-
"\u0151": "o",
|
|
12500
|
-
"\u0154": "R",
|
|
12501
|
-
"\u0156": "R",
|
|
12502
|
-
"\u0158": "R",
|
|
12503
|
-
"\u0155": "r",
|
|
12504
|
-
"\u0157": "r",
|
|
12505
|
-
"\u0159": "r",
|
|
12506
|
-
"\u015A": "S",
|
|
12507
|
-
"\u015C": "S",
|
|
12508
|
-
"\u015E": "S",
|
|
12509
|
-
"\u0160": "S",
|
|
12510
|
-
"\u015B": "s",
|
|
12511
|
-
"\u015D": "s",
|
|
12512
|
-
"\u015F": "s",
|
|
12513
|
-
"\u0161": "s",
|
|
12514
|
-
"\u0162": "T",
|
|
12515
|
-
"\u0164": "T",
|
|
12516
|
-
"\u0166": "T",
|
|
12517
|
-
"\u0163": "t",
|
|
12518
|
-
"\u0165": "t",
|
|
12519
|
-
"\u0167": "t",
|
|
12520
|
-
"\u0168": "U",
|
|
12521
|
-
"\u016A": "U",
|
|
12522
|
-
"\u016C": "U",
|
|
12523
|
-
"\u016E": "U",
|
|
12524
|
-
"\u0170": "U",
|
|
12525
|
-
"\u0172": "U",
|
|
12526
|
-
"\u0169": "u",
|
|
12527
|
-
"\u016B": "u",
|
|
12528
|
-
"\u016D": "u",
|
|
12529
|
-
"\u016F": "u",
|
|
12530
|
-
"\u0171": "u",
|
|
12531
|
-
"\u0173": "u",
|
|
12532
|
-
"\u0174": "W",
|
|
12533
|
-
"\u0175": "w",
|
|
12534
|
-
"\u0176": "Y",
|
|
12535
|
-
"\u0177": "y",
|
|
12536
|
-
"\u0178": "Y",
|
|
12537
|
-
"\u0179": "Z",
|
|
12538
|
-
"\u017B": "Z",
|
|
12539
|
-
"\u017D": "Z",
|
|
12540
|
-
"\u017A": "z",
|
|
12541
|
-
"\u017C": "z",
|
|
12542
|
-
"\u017E": "z",
|
|
12543
|
-
"\u0132": "IJ",
|
|
12544
|
-
"\u0133": "ij",
|
|
12545
|
-
"\u0152": "Oe",
|
|
12546
|
-
"\u0153": "oe",
|
|
12547
|
-
"\u0149": "'n",
|
|
12548
|
-
"\u017F": "s"
|
|
12549
|
-
};
|
|
12550
|
-
var deburrLetter = basePropertyOf_default(deburredLetters);
|
|
12551
|
-
var deburrLetter_default = deburrLetter;
|
|
12552
|
-
|
|
12553
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/deburr.js
|
|
12554
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
12555
|
-
var rsComboMarksRange3 = "\\u0300-\\u036f";
|
|
12556
|
-
var reComboHalfMarksRange3 = "\\ufe20-\\ufe2f";
|
|
12557
|
-
var rsComboSymbolsRange3 = "\\u20d0-\\u20ff";
|
|
12558
|
-
var rsComboRange3 = rsComboMarksRange3 + reComboHalfMarksRange3 + rsComboSymbolsRange3;
|
|
12559
|
-
var rsCombo2 = "[" + rsComboRange3 + "]";
|
|
12560
|
-
var reComboMark = RegExp(rsCombo2, "g");
|
|
12561
|
-
function deburr(string) {
|
|
12562
|
-
string = toString_default(string);
|
|
12563
|
-
return string && string.replace(reLatin, deburrLetter_default).replace(reComboMark, "");
|
|
12564
|
-
}
|
|
12565
|
-
var deburr_default = deburr;
|
|
12566
|
-
|
|
12567
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiWords.js
|
|
12568
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
12569
|
-
function asciiWords(string) {
|
|
12570
|
-
return string.match(reAsciiWord) || [];
|
|
12571
|
-
}
|
|
12572
|
-
var asciiWords_default = asciiWords;
|
|
12573
|
-
|
|
12574
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicodeWord.js
|
|
12575
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
12576
|
-
function hasUnicodeWord(string) {
|
|
12577
|
-
return reHasUnicodeWord.test(string);
|
|
12578
|
-
}
|
|
12579
|
-
var hasUnicodeWord_default = hasUnicodeWord;
|
|
12580
|
-
|
|
12581
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeWords.js
|
|
12582
|
-
var rsAstralRange3 = "\\ud800-\\udfff";
|
|
12583
|
-
var rsComboMarksRange4 = "\\u0300-\\u036f";
|
|
12584
|
-
var reComboHalfMarksRange4 = "\\ufe20-\\ufe2f";
|
|
12585
|
-
var rsComboSymbolsRange4 = "\\u20d0-\\u20ff";
|
|
12586
|
-
var rsComboRange4 = rsComboMarksRange4 + reComboHalfMarksRange4 + rsComboSymbolsRange4;
|
|
12587
|
-
var rsDingbatRange = "\\u2700-\\u27bf";
|
|
12588
|
-
var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
|
|
12589
|
-
var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
|
|
12590
|
-
var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
|
|
12591
|
-
var rsPunctuationRange = "\\u2000-\\u206f";
|
|
12592
|
-
var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
|
|
12593
|
-
var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
|
|
12594
|
-
var rsVarRange3 = "\\ufe0e\\ufe0f";
|
|
12595
|
-
var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
12596
|
-
var rsApos = "['\u2019]";
|
|
12597
|
-
var rsBreak = "[" + rsBreakRange + "]";
|
|
12598
|
-
var rsCombo3 = "[" + rsComboRange4 + "]";
|
|
12599
|
-
var rsDigits = "\\d+";
|
|
12600
|
-
var rsDingbat = "[" + rsDingbatRange + "]";
|
|
12601
|
-
var rsLower = "[" + rsLowerRange + "]";
|
|
12602
|
-
var rsMisc = "[^" + rsAstralRange3 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
|
|
12603
|
-
var rsFitz2 = "\\ud83c[\\udffb-\\udfff]";
|
|
12604
|
-
var rsModifier2 = "(?:" + rsCombo3 + "|" + rsFitz2 + ")";
|
|
12605
|
-
var rsNonAstral2 = "[^" + rsAstralRange3 + "]";
|
|
12606
|
-
var rsRegional2 = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
12607
|
-
var rsSurrPair2 = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
12608
|
-
var rsUpper = "[" + rsUpperRange + "]";
|
|
12609
|
-
var rsZWJ3 = "\\u200d";
|
|
12610
|
-
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
|
|
12611
|
-
var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
|
|
12612
|
-
var rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
|
|
12613
|
-
var rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
|
|
12614
|
-
var reOptMod2 = rsModifier2 + "?";
|
|
12615
|
-
var rsOptVar2 = "[" + rsVarRange3 + "]?";
|
|
12616
|
-
var rsOptJoin2 = "(?:" + rsZWJ3 + "(?:" + [rsNonAstral2, rsRegional2, rsSurrPair2].join("|") + ")" + rsOptVar2 + reOptMod2 + ")*";
|
|
12617
|
-
var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
|
|
12618
|
-
var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
|
|
12619
|
-
var rsSeq2 = rsOptVar2 + reOptMod2 + rsOptJoin2;
|
|
12620
|
-
var rsEmoji = "(?:" + [rsDingbat, rsRegional2, rsSurrPair2].join("|") + ")" + rsSeq2;
|
|
12621
|
-
var reUnicodeWord = RegExp([
|
|
12622
|
-
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
12623
|
-
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
12624
|
-
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
12625
|
-
rsUpper + "+" + rsOptContrUpper,
|
|
12626
|
-
rsOrdUpper,
|
|
12627
|
-
rsOrdLower,
|
|
12628
|
-
rsDigits,
|
|
12629
|
-
rsEmoji
|
|
12630
|
-
].join("|"), "g");
|
|
12631
|
-
function unicodeWords(string) {
|
|
12632
|
-
return string.match(reUnicodeWord) || [];
|
|
12633
|
-
}
|
|
12634
|
-
var unicodeWords_default = unicodeWords;
|
|
12635
|
-
|
|
12636
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/words.js
|
|
12637
|
-
function words(string, pattern, guard) {
|
|
12638
|
-
string = toString_default(string);
|
|
12639
|
-
pattern = guard ? void 0 : pattern;
|
|
12640
|
-
if (pattern === void 0) {
|
|
12641
|
-
return hasUnicodeWord_default(string) ? unicodeWords_default(string) : asciiWords_default(string);
|
|
12642
|
-
}
|
|
12643
|
-
return string.match(pattern) || [];
|
|
12644
|
-
}
|
|
12645
|
-
var words_default = words;
|
|
12646
|
-
|
|
12647
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCompounder.js
|
|
12648
|
-
var rsApos2 = "['\u2019]";
|
|
12649
|
-
var reApos = RegExp(rsApos2, "g");
|
|
12650
|
-
function createCompounder(callback) {
|
|
12651
|
-
return function(string) {
|
|
12652
|
-
return arrayReduce_default(words_default(deburr_default(string).replace(reApos, "")), callback, "");
|
|
12653
|
-
};
|
|
12654
|
-
}
|
|
12655
|
-
var createCompounder_default = createCompounder;
|
|
12656
|
-
|
|
12657
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/camelCase.js
|
|
12658
|
-
var camelCase2 = createCompounder_default(function(result, word, index) {
|
|
12659
|
-
word = word.toLowerCase();
|
|
12660
|
-
return result + (index ? capitalize_default(word) : word);
|
|
12661
|
-
});
|
|
12662
|
-
var camelCase_default = camelCase2;
|
|
12663
|
-
|
|
12664
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/snakeCase.js
|
|
12665
|
-
var snakeCase = createCompounder_default(function(result, word, index) {
|
|
12666
|
-
return result + (index ? "_" : "") + word.toLowerCase();
|
|
12667
|
-
});
|
|
12668
|
-
var snakeCase_default = snakeCase;
|
|
12669
|
-
|
|
12670
11995
|
// src/configuration/generated/api/index.ts
|
|
12671
11996
|
var api_exports = {};
|
|
12672
11997
|
__export(api_exports, {
|
|
@@ -13042,7 +12367,9 @@ var ReadmeGenerator = class {
|
|
|
13042
12367
|
this.languageTitle = languageToTitle(this.readmeConfig.language);
|
|
13043
12368
|
this.organizationPascalCase = pascalCase(this.readmeConfig.organization);
|
|
13044
12369
|
}
|
|
13045
|
-
async generateReadme({
|
|
12370
|
+
async generateReadme({
|
|
12371
|
+
output
|
|
12372
|
+
}) {
|
|
13046
12373
|
const blocks = this.generateBlocks();
|
|
13047
12374
|
const writer = new StreamWriter(output);
|
|
13048
12375
|
this.writeHeader({ writer });
|
|
@@ -13056,16 +12383,32 @@ var ReadmeGenerator = class {
|
|
|
13056
12383
|
generateBlocks() {
|
|
13057
12384
|
const blocks = [];
|
|
13058
12385
|
if (this.readmeConfig.apiReferenceLink != null) {
|
|
13059
|
-
blocks.push(
|
|
12386
|
+
blocks.push(
|
|
12387
|
+
this.generateDocumentation({
|
|
12388
|
+
docsLink: this.readmeConfig.apiReferenceLink
|
|
12389
|
+
})
|
|
12390
|
+
);
|
|
13060
12391
|
}
|
|
13061
12392
|
if (this.readmeConfig.requirements != null) {
|
|
13062
|
-
blocks.push(
|
|
12393
|
+
blocks.push(
|
|
12394
|
+
this.generateRequirements({
|
|
12395
|
+
requirements: this.readmeConfig.requirements
|
|
12396
|
+
})
|
|
12397
|
+
);
|
|
13063
12398
|
}
|
|
13064
|
-
if (this.readmeConfig.language
|
|
13065
|
-
blocks.push(
|
|
12399
|
+
if (this.readmeConfig.language?.publishInfo != null) {
|
|
12400
|
+
blocks.push(
|
|
12401
|
+
this.generateInstallation({
|
|
12402
|
+
language: this.readmeConfig.language
|
|
12403
|
+
})
|
|
12404
|
+
);
|
|
13066
12405
|
}
|
|
13067
12406
|
if (this.readmeConfig.referenceMarkdownPath != null) {
|
|
13068
|
-
blocks.push(
|
|
12407
|
+
blocks.push(
|
|
12408
|
+
this.generateReference({
|
|
12409
|
+
referenceFile: this.readmeConfig.referenceMarkdownPath
|
|
12410
|
+
})
|
|
12411
|
+
);
|
|
13069
12412
|
}
|
|
13070
12413
|
const coreFeatures = this.readmeConfig.features?.filter((feat) => !this.isAdvanced(feat)) ?? [];
|
|
13071
12414
|
const advancedFeatures = this.readmeConfig.features?.filter((feat) => this.isAdvanced(feat)) ?? [];
|
|
@@ -13151,7 +12494,9 @@ var ReadmeGenerator = class {
|
|
|
13151
12494
|
if (originalReadmeContent == null) {
|
|
13152
12495
|
return blocks;
|
|
13153
12496
|
}
|
|
13154
|
-
const parsed = this.readmeParser.parse({
|
|
12497
|
+
const parsed = this.readmeParser.parse({
|
|
12498
|
+
content: originalReadmeContent
|
|
12499
|
+
});
|
|
13155
12500
|
const merger = new BlockMerger({
|
|
13156
12501
|
original: parsed.blocks,
|
|
13157
12502
|
updated: blocks
|
|
@@ -13171,16 +12516,24 @@ var ReadmeGenerator = class {
|
|
|
13171
12516
|
}
|
|
13172
12517
|
return void 0;
|
|
13173
12518
|
}
|
|
13174
|
-
writeBlocks({
|
|
12519
|
+
writeBlocks({
|
|
12520
|
+
writer,
|
|
12521
|
+
blocks
|
|
12522
|
+
}) {
|
|
13175
12523
|
for (const block of blocks) {
|
|
13176
12524
|
block.write(writer);
|
|
13177
12525
|
}
|
|
13178
12526
|
}
|
|
13179
12527
|
writeHeader({ writer }) {
|
|
13180
|
-
writer.writeLine(
|
|
12528
|
+
writer.writeLine(
|
|
12529
|
+
`# ${this.organizationPascalCase} ${this.languageTitle} Library`
|
|
12530
|
+
);
|
|
13181
12531
|
writer.writeLine();
|
|
13182
12532
|
if (this.readmeConfig.bannerLink != null) {
|
|
13183
|
-
this.writeBanner({
|
|
12533
|
+
this.writeBanner({
|
|
12534
|
+
writer,
|
|
12535
|
+
bannerLink: this.readmeConfig.bannerLink
|
|
12536
|
+
});
|
|
13184
12537
|
}
|
|
13185
12538
|
this.writeFernShield({ writer });
|
|
13186
12539
|
if (this.readmeConfig.language != null) {
|
|
@@ -13192,7 +12545,10 @@ var ReadmeGenerator = class {
|
|
|
13192
12545
|
writer.writeLine();
|
|
13193
12546
|
this.writeIntroudction({ writer });
|
|
13194
12547
|
}
|
|
13195
|
-
writeBanner({
|
|
12548
|
+
writeBanner({
|
|
12549
|
+
writer,
|
|
12550
|
+
bannerLink
|
|
12551
|
+
}) {
|
|
13196
12552
|
writer.writeLine(``);
|
|
13197
12553
|
writer.writeLine();
|
|
13198
12554
|
}
|
|
@@ -13212,25 +12568,33 @@ var ReadmeGenerator = class {
|
|
|
13212
12568
|
const writer = new StringWriter();
|
|
13213
12569
|
writer.writeLine("## Documentation");
|
|
13214
12570
|
writer.writeLine();
|
|
13215
|
-
writer.writeLine(
|
|
12571
|
+
writer.writeLine(
|
|
12572
|
+
`API reference documentation is available [here](${docsLink}).`
|
|
12573
|
+
);
|
|
13216
12574
|
writer.writeLine();
|
|
13217
12575
|
return new Block({
|
|
13218
12576
|
id: "DOCUMENTATION",
|
|
13219
12577
|
content: writer.toString()
|
|
13220
12578
|
});
|
|
13221
12579
|
}
|
|
13222
|
-
generateReference({
|
|
12580
|
+
generateReference({
|
|
12581
|
+
referenceFile
|
|
12582
|
+
}) {
|
|
13223
12583
|
const writer = new StringWriter();
|
|
13224
12584
|
writer.writeLine("## Reference");
|
|
13225
12585
|
writer.writeLine();
|
|
13226
|
-
writer.writeLine(
|
|
12586
|
+
writer.writeLine(
|
|
12587
|
+
`A full reference for this library is available [here](${referenceFile}).`
|
|
12588
|
+
);
|
|
13227
12589
|
writer.writeLine();
|
|
13228
12590
|
return new Block({
|
|
13229
12591
|
id: "REFERENCE",
|
|
13230
12592
|
content: writer.toString()
|
|
13231
12593
|
});
|
|
13232
12594
|
}
|
|
13233
|
-
generateRequirements({
|
|
12595
|
+
generateRequirements({
|
|
12596
|
+
requirements
|
|
12597
|
+
}) {
|
|
13234
12598
|
const writer = new StringWriter();
|
|
13235
12599
|
writer.writeLine("## Requirements");
|
|
13236
12600
|
writer.writeLine();
|
|
@@ -13248,7 +12612,9 @@ var ReadmeGenerator = class {
|
|
|
13248
12612
|
content: writer.toString()
|
|
13249
12613
|
});
|
|
13250
12614
|
}
|
|
13251
|
-
generateInstallation({
|
|
12615
|
+
generateInstallation({
|
|
12616
|
+
language
|
|
12617
|
+
}) {
|
|
13252
12618
|
if (language.publishInfo == null) {
|
|
13253
12619
|
throw new Error("publish information is required for installation block");
|
|
13254
12620
|
}
|
|
@@ -13300,7 +12666,10 @@ var ReadmeGenerator = class {
|
|
|
13300
12666
|
content: writer.toString()
|
|
13301
12667
|
});
|
|
13302
12668
|
}
|
|
13303
|
-
writeInstallationForNPM({
|
|
12669
|
+
writeInstallationForNPM({
|
|
12670
|
+
writer,
|
|
12671
|
+
npm
|
|
12672
|
+
}) {
|
|
13304
12673
|
writer.writeLine("```sh");
|
|
13305
12674
|
writer.writeLine(`npm i -s ${npm.packageName}`);
|
|
13306
12675
|
writer.writeLine("```");
|
|
@@ -13342,7 +12711,10 @@ var ReadmeGenerator = class {
|
|
|
13342
12711
|
writer.writeLine("```");
|
|
13343
12712
|
writer.writeLine();
|
|
13344
12713
|
}
|
|
13345
|
-
writeInstallationForGo({
|
|
12714
|
+
writeInstallationForGo({
|
|
12715
|
+
writer,
|
|
12716
|
+
go
|
|
12717
|
+
}) {
|
|
13346
12718
|
writer.writeLine("```sh");
|
|
13347
12719
|
writer.write(`go get github.com/${go.owner}/${go.repo}`);
|
|
13348
12720
|
const majorVersion = getMajorVersion(go.version);
|
|
@@ -13367,11 +12739,14 @@ var ReadmeGenerator = class {
|
|
|
13367
12739
|
nuget
|
|
13368
12740
|
}) {
|
|
13369
12741
|
writer.writeLine("```sh");
|
|
13370
|
-
writer.writeLine(`
|
|
12742
|
+
writer.writeLine(`dotnet add package ${nuget.packageName}`);
|
|
13371
12743
|
writer.writeLine("```");
|
|
13372
12744
|
writer.writeLine();
|
|
13373
12745
|
}
|
|
13374
|
-
writeShield({
|
|
12746
|
+
writeShield({
|
|
12747
|
+
writer,
|
|
12748
|
+
language
|
|
12749
|
+
}) {
|
|
13375
12750
|
switch (language.type) {
|
|
13376
12751
|
case "typescript": {
|
|
13377
12752
|
const npm = language.publishInfo;
|
|
@@ -13443,22 +12818,36 @@ var ReadmeGenerator = class {
|
|
|
13443
12818
|
assertNever(language);
|
|
13444
12819
|
}
|
|
13445
12820
|
}
|
|
13446
|
-
writeShieldForNPM({
|
|
12821
|
+
writeShieldForNPM({
|
|
12822
|
+
writer,
|
|
12823
|
+
npm
|
|
12824
|
+
}) {
|
|
13447
12825
|
writer.write("[![npm shield]");
|
|
13448
12826
|
writer.write(`(https://img.shields.io/npm/v/${npm.packageName})]`);
|
|
13449
12827
|
writer.writeLine(`(https://www.npmjs.com/package/${npm.packageName})`);
|
|
13450
12828
|
}
|
|
13451
|
-
writeShieldForPyPi({
|
|
12829
|
+
writeShieldForPyPi({
|
|
12830
|
+
writer,
|
|
12831
|
+
pypi
|
|
12832
|
+
}) {
|
|
13452
12833
|
writer.write("[![pypi]");
|
|
13453
12834
|
writer.write(`(https://img.shields.io/pypi/v/${pypi.packageName})]`);
|
|
13454
12835
|
writer.writeLine(`(https://pypi.python.org/pypi/${pypi.packageName})`);
|
|
13455
12836
|
}
|
|
13456
|
-
writeShieldForMaven({
|
|
12837
|
+
writeShieldForMaven({
|
|
12838
|
+
writer,
|
|
12839
|
+
maven
|
|
12840
|
+
}) {
|
|
13457
12841
|
writer.write("[![Maven Central]");
|
|
13458
12842
|
writer.write(`(https://img.shields.io/maven-central/v/${maven.artifact})]`);
|
|
13459
|
-
writer.writeLine(
|
|
12843
|
+
writer.writeLine(
|
|
12844
|
+
`(https://central.sonatype.com/artifact/${maven.group}/${maven.artifact})`
|
|
12845
|
+
);
|
|
13460
12846
|
}
|
|
13461
|
-
writeShieldForGo({
|
|
12847
|
+
writeShieldForGo({
|
|
12848
|
+
writer,
|
|
12849
|
+
go
|
|
12850
|
+
}) {
|
|
13462
12851
|
writer.write("[![go shield]");
|
|
13463
12852
|
writer.write("(https://img.shields.io/badge/go-docs-blue)]");
|
|
13464
12853
|
writer.writeLine(`(https://pkg.go.dev/github.com/${go.owner}/${go.repo})`);
|
|
@@ -13471,7 +12860,10 @@ var ReadmeGenerator = class {
|
|
|
13471
12860
|
writer.write(`(https://img.shields.io/gem/v/${rubyGems.packageName})]`);
|
|
13472
12861
|
writer.writeLine(`(https://rubygems.org/gems/${rubyGems.packageName})`);
|
|
13473
12862
|
}
|
|
13474
|
-
writeShieldForNuget({
|
|
12863
|
+
writeShieldForNuget({
|
|
12864
|
+
writer,
|
|
12865
|
+
nuget
|
|
12866
|
+
}) {
|
|
13475
12867
|
writer.write("[![nuget shield]");
|
|
13476
12868
|
writer.write(`(https://img.shields.io/nuget/v/${nuget.packageName})]`);
|
|
13477
12869
|
writer.writeLine(`(https://nuget.org/packages/${nuget.packageName})`);
|
|
@@ -13491,10 +12883,14 @@ On the other hand, contributions to the README are always very welcome!
|
|
|
13491
12883
|
`
|
|
13492
12884
|
});
|
|
13493
12885
|
}
|
|
13494
|
-
shouldSkipFeature({
|
|
12886
|
+
shouldSkipFeature({
|
|
12887
|
+
feature
|
|
12888
|
+
}) {
|
|
13495
12889
|
return !feature.snippetsAreOptional && (feature.snippets == null || feature.snippets.length === 0);
|
|
13496
12890
|
}
|
|
13497
|
-
shouldGenerateFeatures({
|
|
12891
|
+
shouldGenerateFeatures({
|
|
12892
|
+
features
|
|
12893
|
+
}) {
|
|
13498
12894
|
return features.some((feature) => !this.shouldSkipFeature({ feature }));
|
|
13499
12895
|
}
|
|
13500
12896
|
};
|
|
@@ -13520,7 +12916,7 @@ function featureIDToTitle(featureID) {
|
|
|
13520
12916
|
return featureID.split("_").map((s) => pascalCase(s)).join(" ");
|
|
13521
12917
|
}
|
|
13522
12918
|
function pascalCase(s) {
|
|
13523
|
-
return
|
|
12919
|
+
return (0, import_string.upperFirst)((0, import_string.camelCase)(s));
|
|
13524
12920
|
}
|
|
13525
12921
|
function getMajorVersion(version) {
|
|
13526
12922
|
return version.split(".")[0] ?? "0";
|
|
@@ -13530,6 +12926,7 @@ function assertNever(x) {
|
|
|
13530
12926
|
}
|
|
13531
12927
|
|
|
13532
12928
|
// src/readme/ReadmeParser.ts
|
|
12929
|
+
var import_string2 = require("es-toolkit/string");
|
|
13533
12930
|
var ReadmeParser = class {
|
|
13534
12931
|
parse({ content }) {
|
|
13535
12932
|
let header = "";
|
|
@@ -13560,7 +12957,7 @@ var ReadmeParser = class {
|
|
|
13560
12957
|
}
|
|
13561
12958
|
};
|
|
13562
12959
|
function sectionNameToID(sectionName) {
|
|
13563
|
-
return
|
|
12960
|
+
return (0, import_string2.snakeCase)(
|
|
13564
12961
|
sectionName.split(" ").map((word, index) => {
|
|
13565
12962
|
if (index === 0) {
|
|
13566
12963
|
return word;
|
|
@@ -13573,38 +12970,52 @@ function sectionNameToID(sectionName) {
|
|
|
13573
12970
|
// src/reference/ReferenceGenerator.ts
|
|
13574
12971
|
var ReferenceGenerator = class {
|
|
13575
12972
|
referenceConfig;
|
|
13576
|
-
constructor({
|
|
12973
|
+
constructor({
|
|
12974
|
+
referenceConfig
|
|
12975
|
+
}) {
|
|
13577
12976
|
this.referenceConfig = referenceConfig;
|
|
13578
12977
|
}
|
|
13579
12978
|
async generate({ output }) {
|
|
13580
12979
|
const writer = new StreamWriter(output);
|
|
13581
12980
|
writer.writeLine("# Reference");
|
|
13582
12981
|
if (this.referenceConfig.rootSection != null) {
|
|
13583
|
-
this.writeRootSection({
|
|
12982
|
+
this.writeRootSection({
|
|
12983
|
+
section: this.referenceConfig.rootSection,
|
|
12984
|
+
writer
|
|
12985
|
+
});
|
|
13584
12986
|
}
|
|
13585
12987
|
for (const section of this.referenceConfig.sections) {
|
|
13586
12988
|
this.writeSection({ section, writer });
|
|
13587
12989
|
}
|
|
13588
12990
|
writer.end();
|
|
13589
12991
|
}
|
|
13590
|
-
writeRootSection({
|
|
12992
|
+
writeRootSection({
|
|
12993
|
+
section,
|
|
12994
|
+
writer
|
|
12995
|
+
}) {
|
|
13591
12996
|
if (section.description != null) {
|
|
13592
|
-
writer.writeLine(
|
|
12997
|
+
writer.writeLine(section.description);
|
|
13593
12998
|
}
|
|
13594
12999
|
for (const endpoint of section.endpoints) {
|
|
13595
13000
|
this.writeEndpoint({ endpoint, writer });
|
|
13596
13001
|
}
|
|
13597
13002
|
}
|
|
13598
|
-
writeSection({
|
|
13003
|
+
writeSection({
|
|
13004
|
+
section,
|
|
13005
|
+
writer
|
|
13006
|
+
}) {
|
|
13599
13007
|
writer.writeLine(`## ${section.title}`);
|
|
13600
13008
|
if (section.description != null) {
|
|
13601
|
-
writer.writeLine(
|
|
13009
|
+
writer.writeLine(section.description);
|
|
13602
13010
|
}
|
|
13603
13011
|
for (const endpoint of section.endpoints) {
|
|
13604
13012
|
this.writeEndpoint({ endpoint, writer });
|
|
13605
13013
|
}
|
|
13606
13014
|
}
|
|
13607
|
-
writeEndpoint({
|
|
13015
|
+
writeEndpoint({
|
|
13016
|
+
endpoint,
|
|
13017
|
+
writer
|
|
13018
|
+
}) {
|
|
13608
13019
|
const stringWriter = new StringWriter();
|
|
13609
13020
|
if (endpoint.description != null) {
|
|
13610
13021
|
stringWriter.writeLine(
|
|
@@ -13629,7 +13040,9 @@ ${this.writeIndentedBlock(
|
|
|
13629
13040
|
`#### \u2699\uFE0F Parameters
|
|
13630
13041
|
|
|
13631
13042
|
${this.writeIndentedBlock(
|
|
13632
|
-
endpoint.parameters.map(
|
|
13043
|
+
endpoint.parameters.map(
|
|
13044
|
+
(parameter) => this.writeIndentedBlock(this.writeParameter(parameter))
|
|
13045
|
+
).join("\n\n")
|
|
13633
13046
|
)}
|
|
13634
13047
|
`
|
|
13635
13048
|
);
|
|
@@ -13638,7 +13051,9 @@ ${this.writeIndentedBlock(
|
|
|
13638
13051
|
if (endpoint.title.returnValue != null) {
|
|
13639
13052
|
linkedSnippet += ` -> ${this.wrapInLink(endpoint.title.returnValue.text, endpoint.title.returnValue.location)}`;
|
|
13640
13053
|
}
|
|
13641
|
-
writer.writeLine(
|
|
13054
|
+
writer.writeLine(
|
|
13055
|
+
`<details><summary><code>${linkedSnippet}</code></summary>`
|
|
13056
|
+
);
|
|
13642
13057
|
writer.writeLine(this.writeIndentedBlock(stringWriter.toString()));
|
|
13643
13058
|
writer.writeLine("</details>\n");
|
|
13644
13059
|
}
|
|
@@ -13680,12 +13095,14 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
13680
13095
|
}),
|
|
13681
13096
|
async (argv) => {
|
|
13682
13097
|
if (argv.config == null) {
|
|
13683
|
-
process.stderr.write(
|
|
13098
|
+
process.stderr.write(
|
|
13099
|
+
"missing required arguments; please specify the --config flag\n"
|
|
13100
|
+
);
|
|
13684
13101
|
process.exit(1);
|
|
13685
13102
|
}
|
|
13686
13103
|
const wd = cwd();
|
|
13687
13104
|
const readmeConfig = await loadReadmeConfig({
|
|
13688
|
-
absolutePathToConfig:
|
|
13105
|
+
absolutePathToConfig: resolve5(wd, argv.config)
|
|
13689
13106
|
});
|
|
13690
13107
|
const generator = new ReadmeGenerator({
|
|
13691
13108
|
readmeParser: new ReadmeParser(),
|
|
@@ -13709,12 +13126,14 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
13709
13126
|
}),
|
|
13710
13127
|
async (argv) => {
|
|
13711
13128
|
if (argv.config == null) {
|
|
13712
|
-
process.stderr.write(
|
|
13129
|
+
process.stderr.write(
|
|
13130
|
+
"missing required arguments; please specify the --config flag\n"
|
|
13131
|
+
);
|
|
13713
13132
|
process.exit(1);
|
|
13714
13133
|
}
|
|
13715
13134
|
const wd = cwd();
|
|
13716
13135
|
const referenceConfig = await loadReferenceConfig({
|
|
13717
|
-
absolutePathToConfig:
|
|
13136
|
+
absolutePathToConfig: resolve5(wd, argv.config)
|
|
13718
13137
|
});
|
|
13719
13138
|
const generator = new ReferenceGenerator({
|
|
13720
13139
|
referenceConfig
|
|
@@ -13726,7 +13145,7 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
13726
13145
|
}
|
|
13727
13146
|
).demandCommand().showHelpOnFail(true).parse();
|
|
13728
13147
|
async function createWriteStream(outputPath) {
|
|
13729
|
-
return outputPath != null ? await createWriteStreamFromFile(
|
|
13148
|
+
return outputPath != null ? await createWriteStreamFromFile(resolve5(cwd(), outputPath)) : process.stdout;
|
|
13730
13149
|
}
|
|
13731
13150
|
async function createWriteStreamFromFile(filepath) {
|
|
13732
13151
|
if (!doesPathExist(filepath)) {
|
|
@@ -13782,15 +13201,4 @@ yargs-parser/build/lib/index.js:
|
|
|
13782
13201
|
* Copyright (c) 2016, Contributors
|
|
13783
13202
|
* SPDX-License-Identifier: ISC
|
|
13784
13203
|
*)
|
|
13785
|
-
|
|
13786
|
-
lodash-es/lodash.js:
|
|
13787
|
-
(**
|
|
13788
|
-
* @license
|
|
13789
|
-
* Lodash (Custom Build) <https://lodash.com/>
|
|
13790
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
13791
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
13792
|
-
* Released under MIT license <https://lodash.com/license>
|
|
13793
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13794
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13795
|
-
*)
|
|
13796
13204
|
*/
|