@oclif/plugin-test-esbuild 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +276 -1
- package/dist/chunk-CKYVUCCZ.js +63 -0
- package/dist/{chunk-5PYTI2PW.js → chunk-G3X4TLKI.js} +5 -3
- package/dist/{chunk-VXI4PM45.js → chunk-L5EKG6PO.js} +5 -3
- package/dist/{chunk-WOI45AUT.js → chunk-OPAM43C4.js} +5 -3
- package/dist/{chunk-6MP3HI3C.js → chunk-SP5LIBJJ.js} +1236 -1280
- package/dist/{chunk-KIJSKMIE.js → chunk-UY7CILNM.js} +5 -3
- package/dist/commands/esbuild.js +3 -2
- package/dist/commands/hello/index.js +3 -2
- package/dist/commands/hello/world.js +3 -2
- package/dist/hooks/init/init.js +3 -2
- package/dist/index.js +4325 -19
- package/dist/shell-FHVZNOYW.js +4899 -0
- package/oclif.manifest.json +294 -1
- package/package.json +8 -3
package/dist/index.js
CHANGED
|
@@ -1,47 +1,4350 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ESBuild
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G3X4TLKI.js";
|
|
4
4
|
import {
|
|
5
5
|
Hello
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OPAM43C4.js";
|
|
7
7
|
import {
|
|
8
8
|
World
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UY7CILNM.js";
|
|
10
10
|
import {
|
|
11
11
|
init_default
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L5EKG6PO.js";
|
|
13
13
|
import {
|
|
14
|
+
require_lib,
|
|
15
|
+
require_src
|
|
16
|
+
} from "./chunk-SP5LIBJJ.js";
|
|
17
|
+
import {
|
|
18
|
+
__commonJS,
|
|
14
19
|
__toESM,
|
|
15
|
-
init_cjs_shims
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
init_cjs_shims
|
|
21
|
+
} from "./chunk-CKYVUCCZ.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/semver/internal/constants.js
|
|
24
|
+
var require_constants = __commonJS({
|
|
25
|
+
"node_modules/semver/internal/constants.js"(exports, module) {
|
|
26
|
+
init_cjs_shims();
|
|
27
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
28
|
+
var MAX_LENGTH = 256;
|
|
29
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
30
|
+
9007199254740991;
|
|
31
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
32
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
33
|
+
var RELEASE_TYPES = [
|
|
34
|
+
"major",
|
|
35
|
+
"premajor",
|
|
36
|
+
"minor",
|
|
37
|
+
"preminor",
|
|
38
|
+
"patch",
|
|
39
|
+
"prepatch",
|
|
40
|
+
"prerelease"
|
|
41
|
+
];
|
|
42
|
+
module.exports = {
|
|
43
|
+
MAX_LENGTH,
|
|
44
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
45
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
46
|
+
MAX_SAFE_INTEGER,
|
|
47
|
+
RELEASE_TYPES,
|
|
48
|
+
SEMVER_SPEC_VERSION,
|
|
49
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
50
|
+
FLAG_LOOSE: 2
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// node_modules/semver/internal/debug.js
|
|
56
|
+
var require_debug = __commonJS({
|
|
57
|
+
"node_modules/semver/internal/debug.js"(exports, module) {
|
|
58
|
+
init_cjs_shims();
|
|
59
|
+
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
60
|
+
};
|
|
61
|
+
module.exports = debug2;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// node_modules/semver/internal/re.js
|
|
66
|
+
var require_re = __commonJS({
|
|
67
|
+
"node_modules/semver/internal/re.js"(exports, module) {
|
|
68
|
+
init_cjs_shims();
|
|
69
|
+
var {
|
|
70
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
71
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
72
|
+
MAX_LENGTH
|
|
73
|
+
} = require_constants();
|
|
74
|
+
var debug2 = require_debug();
|
|
75
|
+
exports = module.exports = {};
|
|
76
|
+
var re = exports.re = [];
|
|
77
|
+
var safeRe = exports.safeRe = [];
|
|
78
|
+
var src = exports.src = [];
|
|
79
|
+
var t = exports.t = {};
|
|
80
|
+
var R = 0;
|
|
81
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
82
|
+
var safeRegexReplacements = [
|
|
83
|
+
["\\s", 1],
|
|
84
|
+
["\\d", MAX_LENGTH],
|
|
85
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
86
|
+
];
|
|
87
|
+
var makeSafeRegex = (value) => {
|
|
88
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
89
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
};
|
|
93
|
+
var createToken = (name, value, isGlobal) => {
|
|
94
|
+
const safe = makeSafeRegex(value);
|
|
95
|
+
const index = R++;
|
|
96
|
+
debug2(name, index, value);
|
|
97
|
+
t[name] = index;
|
|
98
|
+
src[index] = value;
|
|
99
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
100
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
101
|
+
};
|
|
102
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
103
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
104
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
105
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
106
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
107
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
108
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
109
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
110
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
111
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
112
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
113
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
114
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
115
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
116
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
117
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
118
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
119
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
120
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
121
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
122
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
123
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
124
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
125
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
126
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
127
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
128
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
129
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
130
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
131
|
+
exports.tildeTrimReplace = "$1~";
|
|
132
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
133
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
134
|
+
createToken("LONECARET", "(?:\\^)");
|
|
135
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
136
|
+
exports.caretTrimReplace = "$1^";
|
|
137
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
138
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
139
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
140
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
141
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
142
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
143
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
144
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
145
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
146
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
147
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// node_modules/semver/internal/parse-options.js
|
|
152
|
+
var require_parse_options = __commonJS({
|
|
153
|
+
"node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
154
|
+
init_cjs_shims();
|
|
155
|
+
var looseOption = Object.freeze({ loose: true });
|
|
156
|
+
var emptyOpts = Object.freeze({});
|
|
157
|
+
var parseOptions = (options) => {
|
|
158
|
+
if (!options) {
|
|
159
|
+
return emptyOpts;
|
|
160
|
+
}
|
|
161
|
+
if (typeof options !== "object") {
|
|
162
|
+
return looseOption;
|
|
163
|
+
}
|
|
164
|
+
return options;
|
|
165
|
+
};
|
|
166
|
+
module.exports = parseOptions;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// node_modules/semver/internal/identifiers.js
|
|
171
|
+
var require_identifiers = __commonJS({
|
|
172
|
+
"node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
173
|
+
init_cjs_shims();
|
|
174
|
+
var numeric = /^[0-9]+$/;
|
|
175
|
+
var compareIdentifiers = (a, b) => {
|
|
176
|
+
const anum = numeric.test(a);
|
|
177
|
+
const bnum = numeric.test(b);
|
|
178
|
+
if (anum && bnum) {
|
|
179
|
+
a = +a;
|
|
180
|
+
b = +b;
|
|
181
|
+
}
|
|
182
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
183
|
+
};
|
|
184
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
185
|
+
module.exports = {
|
|
186
|
+
compareIdentifiers,
|
|
187
|
+
rcompareIdentifiers
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// node_modules/semver/classes/semver.js
|
|
193
|
+
var require_semver = __commonJS({
|
|
194
|
+
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
195
|
+
init_cjs_shims();
|
|
196
|
+
var debug2 = require_debug();
|
|
197
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
198
|
+
var { safeRe: re, t } = require_re();
|
|
199
|
+
var parseOptions = require_parse_options();
|
|
200
|
+
var { compareIdentifiers } = require_identifiers();
|
|
201
|
+
var SemVer = class _SemVer {
|
|
202
|
+
constructor(version, options) {
|
|
203
|
+
options = parseOptions(options);
|
|
204
|
+
if (version instanceof _SemVer) {
|
|
205
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
206
|
+
return version;
|
|
207
|
+
} else {
|
|
208
|
+
version = version.version;
|
|
209
|
+
}
|
|
210
|
+
} else if (typeof version !== "string") {
|
|
211
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
212
|
+
}
|
|
213
|
+
if (version.length > MAX_LENGTH) {
|
|
214
|
+
throw new TypeError(
|
|
215
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
debug2("SemVer", version, options);
|
|
219
|
+
this.options = options;
|
|
220
|
+
this.loose = !!options.loose;
|
|
221
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
222
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
223
|
+
if (!m) {
|
|
224
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
225
|
+
}
|
|
226
|
+
this.raw = version;
|
|
227
|
+
this.major = +m[1];
|
|
228
|
+
this.minor = +m[2];
|
|
229
|
+
this.patch = +m[3];
|
|
230
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
231
|
+
throw new TypeError("Invalid major version");
|
|
232
|
+
}
|
|
233
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
234
|
+
throw new TypeError("Invalid minor version");
|
|
235
|
+
}
|
|
236
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
237
|
+
throw new TypeError("Invalid patch version");
|
|
238
|
+
}
|
|
239
|
+
if (!m[4]) {
|
|
240
|
+
this.prerelease = [];
|
|
241
|
+
} else {
|
|
242
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
243
|
+
if (/^[0-9]+$/.test(id)) {
|
|
244
|
+
const num = +id;
|
|
245
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
246
|
+
return num;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return id;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
253
|
+
this.format();
|
|
254
|
+
}
|
|
255
|
+
format() {
|
|
256
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
257
|
+
if (this.prerelease.length) {
|
|
258
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
259
|
+
}
|
|
260
|
+
return this.version;
|
|
261
|
+
}
|
|
262
|
+
toString() {
|
|
263
|
+
return this.version;
|
|
264
|
+
}
|
|
265
|
+
compare(other) {
|
|
266
|
+
debug2("SemVer.compare", this.version, this.options, other);
|
|
267
|
+
if (!(other instanceof _SemVer)) {
|
|
268
|
+
if (typeof other === "string" && other === this.version) {
|
|
269
|
+
return 0;
|
|
270
|
+
}
|
|
271
|
+
other = new _SemVer(other, this.options);
|
|
272
|
+
}
|
|
273
|
+
if (other.version === this.version) {
|
|
274
|
+
return 0;
|
|
275
|
+
}
|
|
276
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
277
|
+
}
|
|
278
|
+
compareMain(other) {
|
|
279
|
+
if (!(other instanceof _SemVer)) {
|
|
280
|
+
other = new _SemVer(other, this.options);
|
|
281
|
+
}
|
|
282
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
283
|
+
}
|
|
284
|
+
comparePre(other) {
|
|
285
|
+
if (!(other instanceof _SemVer)) {
|
|
286
|
+
other = new _SemVer(other, this.options);
|
|
287
|
+
}
|
|
288
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
289
|
+
return -1;
|
|
290
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
291
|
+
return 1;
|
|
292
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
293
|
+
return 0;
|
|
294
|
+
}
|
|
295
|
+
let i = 0;
|
|
296
|
+
do {
|
|
297
|
+
const a = this.prerelease[i];
|
|
298
|
+
const b = other.prerelease[i];
|
|
299
|
+
debug2("prerelease compare", i, a, b);
|
|
300
|
+
if (a === void 0 && b === void 0) {
|
|
301
|
+
return 0;
|
|
302
|
+
} else if (b === void 0) {
|
|
303
|
+
return 1;
|
|
304
|
+
} else if (a === void 0) {
|
|
305
|
+
return -1;
|
|
306
|
+
} else if (a === b) {
|
|
307
|
+
continue;
|
|
308
|
+
} else {
|
|
309
|
+
return compareIdentifiers(a, b);
|
|
310
|
+
}
|
|
311
|
+
} while (++i);
|
|
312
|
+
}
|
|
313
|
+
compareBuild(other) {
|
|
314
|
+
if (!(other instanceof _SemVer)) {
|
|
315
|
+
other = new _SemVer(other, this.options);
|
|
316
|
+
}
|
|
317
|
+
let i = 0;
|
|
318
|
+
do {
|
|
319
|
+
const a = this.build[i];
|
|
320
|
+
const b = other.build[i];
|
|
321
|
+
debug2("prerelease compare", i, a, b);
|
|
322
|
+
if (a === void 0 && b === void 0) {
|
|
323
|
+
return 0;
|
|
324
|
+
} else if (b === void 0) {
|
|
325
|
+
return 1;
|
|
326
|
+
} else if (a === void 0) {
|
|
327
|
+
return -1;
|
|
328
|
+
} else if (a === b) {
|
|
329
|
+
continue;
|
|
330
|
+
} else {
|
|
331
|
+
return compareIdentifiers(a, b);
|
|
332
|
+
}
|
|
333
|
+
} while (++i);
|
|
334
|
+
}
|
|
335
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
336
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
337
|
+
inc(release, identifier, identifierBase) {
|
|
338
|
+
switch (release) {
|
|
339
|
+
case "premajor":
|
|
340
|
+
this.prerelease.length = 0;
|
|
341
|
+
this.patch = 0;
|
|
342
|
+
this.minor = 0;
|
|
343
|
+
this.major++;
|
|
344
|
+
this.inc("pre", identifier, identifierBase);
|
|
345
|
+
break;
|
|
346
|
+
case "preminor":
|
|
347
|
+
this.prerelease.length = 0;
|
|
348
|
+
this.patch = 0;
|
|
349
|
+
this.minor++;
|
|
350
|
+
this.inc("pre", identifier, identifierBase);
|
|
351
|
+
break;
|
|
352
|
+
case "prepatch":
|
|
353
|
+
this.prerelease.length = 0;
|
|
354
|
+
this.inc("patch", identifier, identifierBase);
|
|
355
|
+
this.inc("pre", identifier, identifierBase);
|
|
356
|
+
break;
|
|
357
|
+
case "prerelease":
|
|
358
|
+
if (this.prerelease.length === 0) {
|
|
359
|
+
this.inc("patch", identifier, identifierBase);
|
|
360
|
+
}
|
|
361
|
+
this.inc("pre", identifier, identifierBase);
|
|
362
|
+
break;
|
|
363
|
+
case "major":
|
|
364
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
365
|
+
this.major++;
|
|
366
|
+
}
|
|
367
|
+
this.minor = 0;
|
|
368
|
+
this.patch = 0;
|
|
369
|
+
this.prerelease = [];
|
|
370
|
+
break;
|
|
371
|
+
case "minor":
|
|
372
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
373
|
+
this.minor++;
|
|
374
|
+
}
|
|
375
|
+
this.patch = 0;
|
|
376
|
+
this.prerelease = [];
|
|
377
|
+
break;
|
|
378
|
+
case "patch":
|
|
379
|
+
if (this.prerelease.length === 0) {
|
|
380
|
+
this.patch++;
|
|
381
|
+
}
|
|
382
|
+
this.prerelease = [];
|
|
383
|
+
break;
|
|
384
|
+
case "pre": {
|
|
385
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
386
|
+
if (!identifier && identifierBase === false) {
|
|
387
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
388
|
+
}
|
|
389
|
+
if (this.prerelease.length === 0) {
|
|
390
|
+
this.prerelease = [base];
|
|
391
|
+
} else {
|
|
392
|
+
let i = this.prerelease.length;
|
|
393
|
+
while (--i >= 0) {
|
|
394
|
+
if (typeof this.prerelease[i] === "number") {
|
|
395
|
+
this.prerelease[i]++;
|
|
396
|
+
i = -2;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (i === -1) {
|
|
400
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
401
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
402
|
+
}
|
|
403
|
+
this.prerelease.push(base);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (identifier) {
|
|
407
|
+
let prerelease = [identifier, base];
|
|
408
|
+
if (identifierBase === false) {
|
|
409
|
+
prerelease = [identifier];
|
|
410
|
+
}
|
|
411
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
412
|
+
if (isNaN(this.prerelease[1])) {
|
|
413
|
+
this.prerelease = prerelease;
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
this.prerelease = prerelease;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
default:
|
|
422
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
423
|
+
}
|
|
424
|
+
this.raw = this.format();
|
|
425
|
+
if (this.build.length) {
|
|
426
|
+
this.raw += `+${this.build.join(".")}`;
|
|
427
|
+
}
|
|
428
|
+
return this;
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
module.exports = SemVer;
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
// node_modules/semver/functions/parse.js
|
|
436
|
+
var require_parse = __commonJS({
|
|
437
|
+
"node_modules/semver/functions/parse.js"(exports, module) {
|
|
438
|
+
init_cjs_shims();
|
|
439
|
+
var SemVer = require_semver();
|
|
440
|
+
var parse = (version, options, throwErrors = false) => {
|
|
441
|
+
if (version instanceof SemVer) {
|
|
442
|
+
return version;
|
|
443
|
+
}
|
|
444
|
+
try {
|
|
445
|
+
return new SemVer(version, options);
|
|
446
|
+
} catch (er) {
|
|
447
|
+
if (!throwErrors) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
throw er;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
module.exports = parse;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
// node_modules/semver/functions/valid.js
|
|
458
|
+
var require_valid = __commonJS({
|
|
459
|
+
"node_modules/semver/functions/valid.js"(exports, module) {
|
|
460
|
+
init_cjs_shims();
|
|
461
|
+
var parse = require_parse();
|
|
462
|
+
var valid2 = (version, options) => {
|
|
463
|
+
const v = parse(version, options);
|
|
464
|
+
return v ? v.version : null;
|
|
465
|
+
};
|
|
466
|
+
module.exports = valid2;
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
// node_modules/semver/functions/clean.js
|
|
471
|
+
var require_clean = __commonJS({
|
|
472
|
+
"node_modules/semver/functions/clean.js"(exports, module) {
|
|
473
|
+
init_cjs_shims();
|
|
474
|
+
var parse = require_parse();
|
|
475
|
+
var clean = (version, options) => {
|
|
476
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
477
|
+
return s ? s.version : null;
|
|
478
|
+
};
|
|
479
|
+
module.exports = clean;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// node_modules/semver/functions/inc.js
|
|
484
|
+
var require_inc = __commonJS({
|
|
485
|
+
"node_modules/semver/functions/inc.js"(exports, module) {
|
|
486
|
+
init_cjs_shims();
|
|
487
|
+
var SemVer = require_semver();
|
|
488
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
489
|
+
if (typeof options === "string") {
|
|
490
|
+
identifierBase = identifier;
|
|
491
|
+
identifier = options;
|
|
492
|
+
options = void 0;
|
|
493
|
+
}
|
|
494
|
+
try {
|
|
495
|
+
return new SemVer(
|
|
496
|
+
version instanceof SemVer ? version.version : version,
|
|
497
|
+
options
|
|
498
|
+
).inc(release, identifier, identifierBase).version;
|
|
499
|
+
} catch (er) {
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
module.exports = inc;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
// node_modules/semver/functions/diff.js
|
|
508
|
+
var require_diff = __commonJS({
|
|
509
|
+
"node_modules/semver/functions/diff.js"(exports, module) {
|
|
510
|
+
init_cjs_shims();
|
|
511
|
+
var parse = require_parse();
|
|
512
|
+
var diff = (version1, version2) => {
|
|
513
|
+
const v1 = parse(version1, null, true);
|
|
514
|
+
const v2 = parse(version2, null, true);
|
|
515
|
+
const comparison = v1.compare(v2);
|
|
516
|
+
if (comparison === 0) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
const v1Higher = comparison > 0;
|
|
520
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
521
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
522
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
523
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
524
|
+
if (lowHasPre && !highHasPre) {
|
|
525
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
526
|
+
return "major";
|
|
527
|
+
}
|
|
528
|
+
if (highVersion.patch) {
|
|
529
|
+
return "patch";
|
|
530
|
+
}
|
|
531
|
+
if (highVersion.minor) {
|
|
532
|
+
return "minor";
|
|
533
|
+
}
|
|
534
|
+
return "major";
|
|
535
|
+
}
|
|
536
|
+
const prefix = highHasPre ? "pre" : "";
|
|
537
|
+
if (v1.major !== v2.major) {
|
|
538
|
+
return prefix + "major";
|
|
539
|
+
}
|
|
540
|
+
if (v1.minor !== v2.minor) {
|
|
541
|
+
return prefix + "minor";
|
|
542
|
+
}
|
|
543
|
+
if (v1.patch !== v2.patch) {
|
|
544
|
+
return prefix + "patch";
|
|
545
|
+
}
|
|
546
|
+
return "prerelease";
|
|
547
|
+
};
|
|
548
|
+
module.exports = diff;
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
// node_modules/semver/functions/major.js
|
|
553
|
+
var require_major = __commonJS({
|
|
554
|
+
"node_modules/semver/functions/major.js"(exports, module) {
|
|
555
|
+
init_cjs_shims();
|
|
556
|
+
var SemVer = require_semver();
|
|
557
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
558
|
+
module.exports = major;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// node_modules/semver/functions/minor.js
|
|
563
|
+
var require_minor = __commonJS({
|
|
564
|
+
"node_modules/semver/functions/minor.js"(exports, module) {
|
|
565
|
+
init_cjs_shims();
|
|
566
|
+
var SemVer = require_semver();
|
|
567
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
568
|
+
module.exports = minor;
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// node_modules/semver/functions/patch.js
|
|
573
|
+
var require_patch = __commonJS({
|
|
574
|
+
"node_modules/semver/functions/patch.js"(exports, module) {
|
|
575
|
+
init_cjs_shims();
|
|
576
|
+
var SemVer = require_semver();
|
|
577
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
578
|
+
module.exports = patch;
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
// node_modules/semver/functions/prerelease.js
|
|
583
|
+
var require_prerelease = __commonJS({
|
|
584
|
+
"node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
585
|
+
init_cjs_shims();
|
|
586
|
+
var parse = require_parse();
|
|
587
|
+
var prerelease = (version, options) => {
|
|
588
|
+
const parsed = parse(version, options);
|
|
589
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
590
|
+
};
|
|
591
|
+
module.exports = prerelease;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
// node_modules/semver/functions/compare.js
|
|
596
|
+
var require_compare = __commonJS({
|
|
597
|
+
"node_modules/semver/functions/compare.js"(exports, module) {
|
|
598
|
+
init_cjs_shims();
|
|
599
|
+
var SemVer = require_semver();
|
|
600
|
+
var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
601
|
+
module.exports = compare2;
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
// node_modules/semver/functions/rcompare.js
|
|
606
|
+
var require_rcompare = __commonJS({
|
|
607
|
+
"node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
608
|
+
init_cjs_shims();
|
|
609
|
+
var compare2 = require_compare();
|
|
610
|
+
var rcompare = (a, b, loose) => compare2(b, a, loose);
|
|
611
|
+
module.exports = rcompare;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// node_modules/semver/functions/compare-loose.js
|
|
616
|
+
var require_compare_loose = __commonJS({
|
|
617
|
+
"node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
618
|
+
init_cjs_shims();
|
|
619
|
+
var compare2 = require_compare();
|
|
620
|
+
var compareLoose = (a, b) => compare2(a, b, true);
|
|
621
|
+
module.exports = compareLoose;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// node_modules/semver/functions/compare-build.js
|
|
626
|
+
var require_compare_build = __commonJS({
|
|
627
|
+
"node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
628
|
+
init_cjs_shims();
|
|
629
|
+
var SemVer = require_semver();
|
|
630
|
+
var compareBuild = (a, b, loose) => {
|
|
631
|
+
const versionA = new SemVer(a, loose);
|
|
632
|
+
const versionB = new SemVer(b, loose);
|
|
633
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
634
|
+
};
|
|
635
|
+
module.exports = compareBuild;
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// node_modules/semver/functions/sort.js
|
|
640
|
+
var require_sort = __commonJS({
|
|
641
|
+
"node_modules/semver/functions/sort.js"(exports, module) {
|
|
642
|
+
init_cjs_shims();
|
|
643
|
+
var compareBuild = require_compare_build();
|
|
644
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
645
|
+
module.exports = sort;
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
// node_modules/semver/functions/rsort.js
|
|
650
|
+
var require_rsort = __commonJS({
|
|
651
|
+
"node_modules/semver/functions/rsort.js"(exports, module) {
|
|
652
|
+
init_cjs_shims();
|
|
653
|
+
var compareBuild = require_compare_build();
|
|
654
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
655
|
+
module.exports = rsort;
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
// node_modules/semver/functions/gt.js
|
|
660
|
+
var require_gt = __commonJS({
|
|
661
|
+
"node_modules/semver/functions/gt.js"(exports, module) {
|
|
662
|
+
init_cjs_shims();
|
|
663
|
+
var compare2 = require_compare();
|
|
664
|
+
var gt2 = (a, b, loose) => compare2(a, b, loose) > 0;
|
|
665
|
+
module.exports = gt2;
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// node_modules/semver/functions/lt.js
|
|
670
|
+
var require_lt = __commonJS({
|
|
671
|
+
"node_modules/semver/functions/lt.js"(exports, module) {
|
|
672
|
+
init_cjs_shims();
|
|
673
|
+
var compare2 = require_compare();
|
|
674
|
+
var lt = (a, b, loose) => compare2(a, b, loose) < 0;
|
|
675
|
+
module.exports = lt;
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
// node_modules/semver/functions/eq.js
|
|
680
|
+
var require_eq = __commonJS({
|
|
681
|
+
"node_modules/semver/functions/eq.js"(exports, module) {
|
|
682
|
+
init_cjs_shims();
|
|
683
|
+
var compare2 = require_compare();
|
|
684
|
+
var eq = (a, b, loose) => compare2(a, b, loose) === 0;
|
|
685
|
+
module.exports = eq;
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
// node_modules/semver/functions/neq.js
|
|
690
|
+
var require_neq = __commonJS({
|
|
691
|
+
"node_modules/semver/functions/neq.js"(exports, module) {
|
|
692
|
+
init_cjs_shims();
|
|
693
|
+
var compare2 = require_compare();
|
|
694
|
+
var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
|
|
695
|
+
module.exports = neq;
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
// node_modules/semver/functions/gte.js
|
|
700
|
+
var require_gte = __commonJS({
|
|
701
|
+
"node_modules/semver/functions/gte.js"(exports, module) {
|
|
702
|
+
init_cjs_shims();
|
|
703
|
+
var compare2 = require_compare();
|
|
704
|
+
var gte = (a, b, loose) => compare2(a, b, loose) >= 0;
|
|
705
|
+
module.exports = gte;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
// node_modules/semver/functions/lte.js
|
|
710
|
+
var require_lte = __commonJS({
|
|
711
|
+
"node_modules/semver/functions/lte.js"(exports, module) {
|
|
712
|
+
init_cjs_shims();
|
|
713
|
+
var compare2 = require_compare();
|
|
714
|
+
var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
|
|
715
|
+
module.exports = lte;
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// node_modules/semver/functions/cmp.js
|
|
720
|
+
var require_cmp = __commonJS({
|
|
721
|
+
"node_modules/semver/functions/cmp.js"(exports, module) {
|
|
722
|
+
init_cjs_shims();
|
|
723
|
+
var eq = require_eq();
|
|
724
|
+
var neq = require_neq();
|
|
725
|
+
var gt2 = require_gt();
|
|
726
|
+
var gte = require_gte();
|
|
727
|
+
var lt = require_lt();
|
|
728
|
+
var lte = require_lte();
|
|
729
|
+
var cmp = (a, op, b, loose) => {
|
|
730
|
+
switch (op) {
|
|
731
|
+
case "===":
|
|
732
|
+
if (typeof a === "object") {
|
|
733
|
+
a = a.version;
|
|
734
|
+
}
|
|
735
|
+
if (typeof b === "object") {
|
|
736
|
+
b = b.version;
|
|
737
|
+
}
|
|
738
|
+
return a === b;
|
|
739
|
+
case "!==":
|
|
740
|
+
if (typeof a === "object") {
|
|
741
|
+
a = a.version;
|
|
742
|
+
}
|
|
743
|
+
if (typeof b === "object") {
|
|
744
|
+
b = b.version;
|
|
745
|
+
}
|
|
746
|
+
return a !== b;
|
|
747
|
+
case "":
|
|
748
|
+
case "=":
|
|
749
|
+
case "==":
|
|
750
|
+
return eq(a, b, loose);
|
|
751
|
+
case "!=":
|
|
752
|
+
return neq(a, b, loose);
|
|
753
|
+
case ">":
|
|
754
|
+
return gt2(a, b, loose);
|
|
755
|
+
case ">=":
|
|
756
|
+
return gte(a, b, loose);
|
|
757
|
+
case "<":
|
|
758
|
+
return lt(a, b, loose);
|
|
759
|
+
case "<=":
|
|
760
|
+
return lte(a, b, loose);
|
|
761
|
+
default:
|
|
762
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
module.exports = cmp;
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
// node_modules/semver/functions/coerce.js
|
|
770
|
+
var require_coerce = __commonJS({
|
|
771
|
+
"node_modules/semver/functions/coerce.js"(exports, module) {
|
|
772
|
+
init_cjs_shims();
|
|
773
|
+
var SemVer = require_semver();
|
|
774
|
+
var parse = require_parse();
|
|
775
|
+
var { safeRe: re, t } = require_re();
|
|
776
|
+
var coerce = (version, options) => {
|
|
777
|
+
if (version instanceof SemVer) {
|
|
778
|
+
return version;
|
|
779
|
+
}
|
|
780
|
+
if (typeof version === "number") {
|
|
781
|
+
version = String(version);
|
|
782
|
+
}
|
|
783
|
+
if (typeof version !== "string") {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
options = options || {};
|
|
787
|
+
let match = null;
|
|
788
|
+
if (!options.rtl) {
|
|
789
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
790
|
+
} else {
|
|
791
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
792
|
+
let next;
|
|
793
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
794
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
795
|
+
match = next;
|
|
796
|
+
}
|
|
797
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
798
|
+
}
|
|
799
|
+
coerceRtlRegex.lastIndex = -1;
|
|
800
|
+
}
|
|
801
|
+
if (match === null) {
|
|
802
|
+
return null;
|
|
803
|
+
}
|
|
804
|
+
const major = match[2];
|
|
805
|
+
const minor = match[3] || "0";
|
|
806
|
+
const patch = match[4] || "0";
|
|
807
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
808
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
809
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
810
|
+
};
|
|
811
|
+
module.exports = coerce;
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
// node_modules/yallist/iterator.js
|
|
816
|
+
var require_iterator = __commonJS({
|
|
817
|
+
"node_modules/yallist/iterator.js"(exports, module) {
|
|
818
|
+
"use strict";
|
|
819
|
+
init_cjs_shims();
|
|
820
|
+
module.exports = function(Yallist) {
|
|
821
|
+
Yallist.prototype[Symbol.iterator] = function* () {
|
|
822
|
+
for (let walker = this.head; walker; walker = walker.next) {
|
|
823
|
+
yield walker.value;
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
// node_modules/yallist/yallist.js
|
|
831
|
+
var require_yallist = __commonJS({
|
|
832
|
+
"node_modules/yallist/yallist.js"(exports, module) {
|
|
833
|
+
"use strict";
|
|
834
|
+
init_cjs_shims();
|
|
835
|
+
module.exports = Yallist;
|
|
836
|
+
Yallist.Node = Node;
|
|
837
|
+
Yallist.create = Yallist;
|
|
838
|
+
function Yallist(list) {
|
|
839
|
+
var self = this;
|
|
840
|
+
if (!(self instanceof Yallist)) {
|
|
841
|
+
self = new Yallist();
|
|
842
|
+
}
|
|
843
|
+
self.tail = null;
|
|
844
|
+
self.head = null;
|
|
845
|
+
self.length = 0;
|
|
846
|
+
if (list && typeof list.forEach === "function") {
|
|
847
|
+
list.forEach(function(item) {
|
|
848
|
+
self.push(item);
|
|
849
|
+
});
|
|
850
|
+
} else if (arguments.length > 0) {
|
|
851
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
852
|
+
self.push(arguments[i]);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return self;
|
|
856
|
+
}
|
|
857
|
+
Yallist.prototype.removeNode = function(node) {
|
|
858
|
+
if (node.list !== this) {
|
|
859
|
+
throw new Error("removing node which does not belong to this list");
|
|
860
|
+
}
|
|
861
|
+
var next = node.next;
|
|
862
|
+
var prev = node.prev;
|
|
863
|
+
if (next) {
|
|
864
|
+
next.prev = prev;
|
|
865
|
+
}
|
|
866
|
+
if (prev) {
|
|
867
|
+
prev.next = next;
|
|
868
|
+
}
|
|
869
|
+
if (node === this.head) {
|
|
870
|
+
this.head = next;
|
|
871
|
+
}
|
|
872
|
+
if (node === this.tail) {
|
|
873
|
+
this.tail = prev;
|
|
874
|
+
}
|
|
875
|
+
node.list.length--;
|
|
876
|
+
node.next = null;
|
|
877
|
+
node.prev = null;
|
|
878
|
+
node.list = null;
|
|
879
|
+
return next;
|
|
880
|
+
};
|
|
881
|
+
Yallist.prototype.unshiftNode = function(node) {
|
|
882
|
+
if (node === this.head) {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
if (node.list) {
|
|
886
|
+
node.list.removeNode(node);
|
|
887
|
+
}
|
|
888
|
+
var head = this.head;
|
|
889
|
+
node.list = this;
|
|
890
|
+
node.next = head;
|
|
891
|
+
if (head) {
|
|
892
|
+
head.prev = node;
|
|
893
|
+
}
|
|
894
|
+
this.head = node;
|
|
895
|
+
if (!this.tail) {
|
|
896
|
+
this.tail = node;
|
|
897
|
+
}
|
|
898
|
+
this.length++;
|
|
899
|
+
};
|
|
900
|
+
Yallist.prototype.pushNode = function(node) {
|
|
901
|
+
if (node === this.tail) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
if (node.list) {
|
|
905
|
+
node.list.removeNode(node);
|
|
906
|
+
}
|
|
907
|
+
var tail = this.tail;
|
|
908
|
+
node.list = this;
|
|
909
|
+
node.prev = tail;
|
|
910
|
+
if (tail) {
|
|
911
|
+
tail.next = node;
|
|
912
|
+
}
|
|
913
|
+
this.tail = node;
|
|
914
|
+
if (!this.head) {
|
|
915
|
+
this.head = node;
|
|
916
|
+
}
|
|
917
|
+
this.length++;
|
|
918
|
+
};
|
|
919
|
+
Yallist.prototype.push = function() {
|
|
920
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
921
|
+
push(this, arguments[i]);
|
|
922
|
+
}
|
|
923
|
+
return this.length;
|
|
924
|
+
};
|
|
925
|
+
Yallist.prototype.unshift = function() {
|
|
926
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
927
|
+
unshift(this, arguments[i]);
|
|
928
|
+
}
|
|
929
|
+
return this.length;
|
|
930
|
+
};
|
|
931
|
+
Yallist.prototype.pop = function() {
|
|
932
|
+
if (!this.tail) {
|
|
933
|
+
return void 0;
|
|
934
|
+
}
|
|
935
|
+
var res = this.tail.value;
|
|
936
|
+
this.tail = this.tail.prev;
|
|
937
|
+
if (this.tail) {
|
|
938
|
+
this.tail.next = null;
|
|
939
|
+
} else {
|
|
940
|
+
this.head = null;
|
|
941
|
+
}
|
|
942
|
+
this.length--;
|
|
943
|
+
return res;
|
|
944
|
+
};
|
|
945
|
+
Yallist.prototype.shift = function() {
|
|
946
|
+
if (!this.head) {
|
|
947
|
+
return void 0;
|
|
948
|
+
}
|
|
949
|
+
var res = this.head.value;
|
|
950
|
+
this.head = this.head.next;
|
|
951
|
+
if (this.head) {
|
|
952
|
+
this.head.prev = null;
|
|
953
|
+
} else {
|
|
954
|
+
this.tail = null;
|
|
955
|
+
}
|
|
956
|
+
this.length--;
|
|
957
|
+
return res;
|
|
958
|
+
};
|
|
959
|
+
Yallist.prototype.forEach = function(fn, thisp) {
|
|
960
|
+
thisp = thisp || this;
|
|
961
|
+
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
962
|
+
fn.call(thisp, walker.value, i, this);
|
|
963
|
+
walker = walker.next;
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
Yallist.prototype.forEachReverse = function(fn, thisp) {
|
|
967
|
+
thisp = thisp || this;
|
|
968
|
+
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
969
|
+
fn.call(thisp, walker.value, i, this);
|
|
970
|
+
walker = walker.prev;
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
Yallist.prototype.get = function(n) {
|
|
974
|
+
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
975
|
+
walker = walker.next;
|
|
976
|
+
}
|
|
977
|
+
if (i === n && walker !== null) {
|
|
978
|
+
return walker.value;
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
Yallist.prototype.getReverse = function(n) {
|
|
982
|
+
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
983
|
+
walker = walker.prev;
|
|
984
|
+
}
|
|
985
|
+
if (i === n && walker !== null) {
|
|
986
|
+
return walker.value;
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
Yallist.prototype.map = function(fn, thisp) {
|
|
990
|
+
thisp = thisp || this;
|
|
991
|
+
var res = new Yallist();
|
|
992
|
+
for (var walker = this.head; walker !== null; ) {
|
|
993
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
994
|
+
walker = walker.next;
|
|
995
|
+
}
|
|
996
|
+
return res;
|
|
997
|
+
};
|
|
998
|
+
Yallist.prototype.mapReverse = function(fn, thisp) {
|
|
999
|
+
thisp = thisp || this;
|
|
1000
|
+
var res = new Yallist();
|
|
1001
|
+
for (var walker = this.tail; walker !== null; ) {
|
|
1002
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
1003
|
+
walker = walker.prev;
|
|
1004
|
+
}
|
|
1005
|
+
return res;
|
|
1006
|
+
};
|
|
1007
|
+
Yallist.prototype.reduce = function(fn, initial) {
|
|
1008
|
+
var acc;
|
|
1009
|
+
var walker = this.head;
|
|
1010
|
+
if (arguments.length > 1) {
|
|
1011
|
+
acc = initial;
|
|
1012
|
+
} else if (this.head) {
|
|
1013
|
+
walker = this.head.next;
|
|
1014
|
+
acc = this.head.value;
|
|
1015
|
+
} else {
|
|
1016
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
1017
|
+
}
|
|
1018
|
+
for (var i = 0; walker !== null; i++) {
|
|
1019
|
+
acc = fn(acc, walker.value, i);
|
|
1020
|
+
walker = walker.next;
|
|
1021
|
+
}
|
|
1022
|
+
return acc;
|
|
1023
|
+
};
|
|
1024
|
+
Yallist.prototype.reduceReverse = function(fn, initial) {
|
|
1025
|
+
var acc;
|
|
1026
|
+
var walker = this.tail;
|
|
1027
|
+
if (arguments.length > 1) {
|
|
1028
|
+
acc = initial;
|
|
1029
|
+
} else if (this.tail) {
|
|
1030
|
+
walker = this.tail.prev;
|
|
1031
|
+
acc = this.tail.value;
|
|
1032
|
+
} else {
|
|
1033
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
1034
|
+
}
|
|
1035
|
+
for (var i = this.length - 1; walker !== null; i--) {
|
|
1036
|
+
acc = fn(acc, walker.value, i);
|
|
1037
|
+
walker = walker.prev;
|
|
1038
|
+
}
|
|
1039
|
+
return acc;
|
|
1040
|
+
};
|
|
1041
|
+
Yallist.prototype.toArray = function() {
|
|
1042
|
+
var arr = new Array(this.length);
|
|
1043
|
+
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
1044
|
+
arr[i] = walker.value;
|
|
1045
|
+
walker = walker.next;
|
|
1046
|
+
}
|
|
1047
|
+
return arr;
|
|
1048
|
+
};
|
|
1049
|
+
Yallist.prototype.toArrayReverse = function() {
|
|
1050
|
+
var arr = new Array(this.length);
|
|
1051
|
+
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
1052
|
+
arr[i] = walker.value;
|
|
1053
|
+
walker = walker.prev;
|
|
1054
|
+
}
|
|
1055
|
+
return arr;
|
|
1056
|
+
};
|
|
1057
|
+
Yallist.prototype.slice = function(from, to) {
|
|
1058
|
+
to = to || this.length;
|
|
1059
|
+
if (to < 0) {
|
|
1060
|
+
to += this.length;
|
|
1061
|
+
}
|
|
1062
|
+
from = from || 0;
|
|
1063
|
+
if (from < 0) {
|
|
1064
|
+
from += this.length;
|
|
1065
|
+
}
|
|
1066
|
+
var ret = new Yallist();
|
|
1067
|
+
if (to < from || to < 0) {
|
|
1068
|
+
return ret;
|
|
1069
|
+
}
|
|
1070
|
+
if (from < 0) {
|
|
1071
|
+
from = 0;
|
|
1072
|
+
}
|
|
1073
|
+
if (to > this.length) {
|
|
1074
|
+
to = this.length;
|
|
1075
|
+
}
|
|
1076
|
+
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
1077
|
+
walker = walker.next;
|
|
1078
|
+
}
|
|
1079
|
+
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
1080
|
+
ret.push(walker.value);
|
|
1081
|
+
}
|
|
1082
|
+
return ret;
|
|
1083
|
+
};
|
|
1084
|
+
Yallist.prototype.sliceReverse = function(from, to) {
|
|
1085
|
+
to = to || this.length;
|
|
1086
|
+
if (to < 0) {
|
|
1087
|
+
to += this.length;
|
|
1088
|
+
}
|
|
1089
|
+
from = from || 0;
|
|
1090
|
+
if (from < 0) {
|
|
1091
|
+
from += this.length;
|
|
1092
|
+
}
|
|
1093
|
+
var ret = new Yallist();
|
|
1094
|
+
if (to < from || to < 0) {
|
|
1095
|
+
return ret;
|
|
1096
|
+
}
|
|
1097
|
+
if (from < 0) {
|
|
1098
|
+
from = 0;
|
|
1099
|
+
}
|
|
1100
|
+
if (to > this.length) {
|
|
1101
|
+
to = this.length;
|
|
1102
|
+
}
|
|
1103
|
+
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
1104
|
+
walker = walker.prev;
|
|
1105
|
+
}
|
|
1106
|
+
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
1107
|
+
ret.push(walker.value);
|
|
1108
|
+
}
|
|
1109
|
+
return ret;
|
|
1110
|
+
};
|
|
1111
|
+
Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
|
|
1112
|
+
if (start > this.length) {
|
|
1113
|
+
start = this.length - 1;
|
|
1114
|
+
}
|
|
1115
|
+
if (start < 0) {
|
|
1116
|
+
start = this.length + start;
|
|
1117
|
+
}
|
|
1118
|
+
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
1119
|
+
walker = walker.next;
|
|
1120
|
+
}
|
|
1121
|
+
var ret = [];
|
|
1122
|
+
for (var i = 0; walker && i < deleteCount; i++) {
|
|
1123
|
+
ret.push(walker.value);
|
|
1124
|
+
walker = this.removeNode(walker);
|
|
1125
|
+
}
|
|
1126
|
+
if (walker === null) {
|
|
1127
|
+
walker = this.tail;
|
|
1128
|
+
}
|
|
1129
|
+
if (walker !== this.head && walker !== this.tail) {
|
|
1130
|
+
walker = walker.prev;
|
|
1131
|
+
}
|
|
1132
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
1133
|
+
walker = insert(this, walker, nodes[i]);
|
|
1134
|
+
}
|
|
1135
|
+
return ret;
|
|
1136
|
+
};
|
|
1137
|
+
Yallist.prototype.reverse = function() {
|
|
1138
|
+
var head = this.head;
|
|
1139
|
+
var tail = this.tail;
|
|
1140
|
+
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
1141
|
+
var p = walker.prev;
|
|
1142
|
+
walker.prev = walker.next;
|
|
1143
|
+
walker.next = p;
|
|
1144
|
+
}
|
|
1145
|
+
this.head = tail;
|
|
1146
|
+
this.tail = head;
|
|
1147
|
+
return this;
|
|
1148
|
+
};
|
|
1149
|
+
function insert(self, node, value) {
|
|
1150
|
+
var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
|
|
1151
|
+
if (inserted.next === null) {
|
|
1152
|
+
self.tail = inserted;
|
|
1153
|
+
}
|
|
1154
|
+
if (inserted.prev === null) {
|
|
1155
|
+
self.head = inserted;
|
|
1156
|
+
}
|
|
1157
|
+
self.length++;
|
|
1158
|
+
return inserted;
|
|
1159
|
+
}
|
|
1160
|
+
function push(self, item) {
|
|
1161
|
+
self.tail = new Node(item, self.tail, null, self);
|
|
1162
|
+
if (!self.head) {
|
|
1163
|
+
self.head = self.tail;
|
|
1164
|
+
}
|
|
1165
|
+
self.length++;
|
|
1166
|
+
}
|
|
1167
|
+
function unshift(self, item) {
|
|
1168
|
+
self.head = new Node(item, null, self.head, self);
|
|
1169
|
+
if (!self.tail) {
|
|
1170
|
+
self.tail = self.head;
|
|
1171
|
+
}
|
|
1172
|
+
self.length++;
|
|
1173
|
+
}
|
|
1174
|
+
function Node(value, prev, next, list) {
|
|
1175
|
+
if (!(this instanceof Node)) {
|
|
1176
|
+
return new Node(value, prev, next, list);
|
|
1177
|
+
}
|
|
1178
|
+
this.list = list;
|
|
1179
|
+
this.value = value;
|
|
1180
|
+
if (prev) {
|
|
1181
|
+
prev.next = this;
|
|
1182
|
+
this.prev = prev;
|
|
1183
|
+
} else {
|
|
1184
|
+
this.prev = null;
|
|
1185
|
+
}
|
|
1186
|
+
if (next) {
|
|
1187
|
+
next.prev = this;
|
|
1188
|
+
this.next = next;
|
|
1189
|
+
} else {
|
|
1190
|
+
this.next = null;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
try {
|
|
1194
|
+
require_iterator()(Yallist);
|
|
1195
|
+
} catch (er) {
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
|
|
1200
|
+
// node_modules/lru-cache/index.js
|
|
1201
|
+
var require_lru_cache = __commonJS({
|
|
1202
|
+
"node_modules/lru-cache/index.js"(exports, module) {
|
|
1203
|
+
"use strict";
|
|
1204
|
+
init_cjs_shims();
|
|
1205
|
+
var Yallist = require_yallist();
|
|
1206
|
+
var MAX = Symbol("max");
|
|
1207
|
+
var LENGTH = Symbol("length");
|
|
1208
|
+
var LENGTH_CALCULATOR = Symbol("lengthCalculator");
|
|
1209
|
+
var ALLOW_STALE = Symbol("allowStale");
|
|
1210
|
+
var MAX_AGE = Symbol("maxAge");
|
|
1211
|
+
var DISPOSE = Symbol("dispose");
|
|
1212
|
+
var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
|
|
1213
|
+
var LRU_LIST = Symbol("lruList");
|
|
1214
|
+
var CACHE = Symbol("cache");
|
|
1215
|
+
var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
|
|
1216
|
+
var naiveLength = () => 1;
|
|
1217
|
+
var LRUCache = class {
|
|
1218
|
+
constructor(options) {
|
|
1219
|
+
if (typeof options === "number")
|
|
1220
|
+
options = { max: options };
|
|
1221
|
+
if (!options)
|
|
1222
|
+
options = {};
|
|
1223
|
+
if (options.max && (typeof options.max !== "number" || options.max < 0))
|
|
1224
|
+
throw new TypeError("max must be a non-negative number");
|
|
1225
|
+
const max = this[MAX] = options.max || Infinity;
|
|
1226
|
+
const lc = options.length || naiveLength;
|
|
1227
|
+
this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
|
|
1228
|
+
this[ALLOW_STALE] = options.stale || false;
|
|
1229
|
+
if (options.maxAge && typeof options.maxAge !== "number")
|
|
1230
|
+
throw new TypeError("maxAge must be a number");
|
|
1231
|
+
this[MAX_AGE] = options.maxAge || 0;
|
|
1232
|
+
this[DISPOSE] = options.dispose;
|
|
1233
|
+
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
1234
|
+
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
1235
|
+
this.reset();
|
|
1236
|
+
}
|
|
1237
|
+
// resize the cache when the max changes.
|
|
1238
|
+
set max(mL) {
|
|
1239
|
+
if (typeof mL !== "number" || mL < 0)
|
|
1240
|
+
throw new TypeError("max must be a non-negative number");
|
|
1241
|
+
this[MAX] = mL || Infinity;
|
|
1242
|
+
trim(this);
|
|
1243
|
+
}
|
|
1244
|
+
get max() {
|
|
1245
|
+
return this[MAX];
|
|
1246
|
+
}
|
|
1247
|
+
set allowStale(allowStale) {
|
|
1248
|
+
this[ALLOW_STALE] = !!allowStale;
|
|
1249
|
+
}
|
|
1250
|
+
get allowStale() {
|
|
1251
|
+
return this[ALLOW_STALE];
|
|
1252
|
+
}
|
|
1253
|
+
set maxAge(mA) {
|
|
1254
|
+
if (typeof mA !== "number")
|
|
1255
|
+
throw new TypeError("maxAge must be a non-negative number");
|
|
1256
|
+
this[MAX_AGE] = mA;
|
|
1257
|
+
trim(this);
|
|
1258
|
+
}
|
|
1259
|
+
get maxAge() {
|
|
1260
|
+
return this[MAX_AGE];
|
|
1261
|
+
}
|
|
1262
|
+
// resize the cache when the lengthCalculator changes.
|
|
1263
|
+
set lengthCalculator(lC) {
|
|
1264
|
+
if (typeof lC !== "function")
|
|
1265
|
+
lC = naiveLength;
|
|
1266
|
+
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
1267
|
+
this[LENGTH_CALCULATOR] = lC;
|
|
1268
|
+
this[LENGTH] = 0;
|
|
1269
|
+
this[LRU_LIST].forEach((hit) => {
|
|
1270
|
+
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
1271
|
+
this[LENGTH] += hit.length;
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
trim(this);
|
|
1275
|
+
}
|
|
1276
|
+
get lengthCalculator() {
|
|
1277
|
+
return this[LENGTH_CALCULATOR];
|
|
1278
|
+
}
|
|
1279
|
+
get length() {
|
|
1280
|
+
return this[LENGTH];
|
|
1281
|
+
}
|
|
1282
|
+
get itemCount() {
|
|
1283
|
+
return this[LRU_LIST].length;
|
|
1284
|
+
}
|
|
1285
|
+
rforEach(fn, thisp) {
|
|
1286
|
+
thisp = thisp || this;
|
|
1287
|
+
for (let walker = this[LRU_LIST].tail; walker !== null; ) {
|
|
1288
|
+
const prev = walker.prev;
|
|
1289
|
+
forEachStep(this, fn, walker, thisp);
|
|
1290
|
+
walker = prev;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
forEach(fn, thisp) {
|
|
1294
|
+
thisp = thisp || this;
|
|
1295
|
+
for (let walker = this[LRU_LIST].head; walker !== null; ) {
|
|
1296
|
+
const next = walker.next;
|
|
1297
|
+
forEachStep(this, fn, walker, thisp);
|
|
1298
|
+
walker = next;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
keys() {
|
|
1302
|
+
return this[LRU_LIST].toArray().map((k) => k.key);
|
|
1303
|
+
}
|
|
1304
|
+
values() {
|
|
1305
|
+
return this[LRU_LIST].toArray().map((k) => k.value);
|
|
1306
|
+
}
|
|
1307
|
+
reset() {
|
|
1308
|
+
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
1309
|
+
this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
|
|
1310
|
+
}
|
|
1311
|
+
this[CACHE] = /* @__PURE__ */ new Map();
|
|
1312
|
+
this[LRU_LIST] = new Yallist();
|
|
1313
|
+
this[LENGTH] = 0;
|
|
1314
|
+
}
|
|
1315
|
+
dump() {
|
|
1316
|
+
return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
|
|
1317
|
+
k: hit.key,
|
|
1318
|
+
v: hit.value,
|
|
1319
|
+
e: hit.now + (hit.maxAge || 0)
|
|
1320
|
+
}).toArray().filter((h) => h);
|
|
1321
|
+
}
|
|
1322
|
+
dumpLru() {
|
|
1323
|
+
return this[LRU_LIST];
|
|
1324
|
+
}
|
|
1325
|
+
set(key, value, maxAge) {
|
|
1326
|
+
maxAge = maxAge || this[MAX_AGE];
|
|
1327
|
+
if (maxAge && typeof maxAge !== "number")
|
|
1328
|
+
throw new TypeError("maxAge must be a number");
|
|
1329
|
+
const now = maxAge ? Date.now() : 0;
|
|
1330
|
+
const len = this[LENGTH_CALCULATOR](value, key);
|
|
1331
|
+
if (this[CACHE].has(key)) {
|
|
1332
|
+
if (len > this[MAX]) {
|
|
1333
|
+
del(this, this[CACHE].get(key));
|
|
1334
|
+
return false;
|
|
1335
|
+
}
|
|
1336
|
+
const node = this[CACHE].get(key);
|
|
1337
|
+
const item = node.value;
|
|
1338
|
+
if (this[DISPOSE]) {
|
|
1339
|
+
if (!this[NO_DISPOSE_ON_SET])
|
|
1340
|
+
this[DISPOSE](key, item.value);
|
|
1341
|
+
}
|
|
1342
|
+
item.now = now;
|
|
1343
|
+
item.maxAge = maxAge;
|
|
1344
|
+
item.value = value;
|
|
1345
|
+
this[LENGTH] += len - item.length;
|
|
1346
|
+
item.length = len;
|
|
1347
|
+
this.get(key);
|
|
1348
|
+
trim(this);
|
|
1349
|
+
return true;
|
|
1350
|
+
}
|
|
1351
|
+
const hit = new Entry(key, value, len, now, maxAge);
|
|
1352
|
+
if (hit.length > this[MAX]) {
|
|
1353
|
+
if (this[DISPOSE])
|
|
1354
|
+
this[DISPOSE](key, value);
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
this[LENGTH] += hit.length;
|
|
1358
|
+
this[LRU_LIST].unshift(hit);
|
|
1359
|
+
this[CACHE].set(key, this[LRU_LIST].head);
|
|
1360
|
+
trim(this);
|
|
1361
|
+
return true;
|
|
1362
|
+
}
|
|
1363
|
+
has(key) {
|
|
1364
|
+
if (!this[CACHE].has(key))
|
|
1365
|
+
return false;
|
|
1366
|
+
const hit = this[CACHE].get(key).value;
|
|
1367
|
+
return !isStale(this, hit);
|
|
1368
|
+
}
|
|
1369
|
+
get(key) {
|
|
1370
|
+
return get(this, key, true);
|
|
1371
|
+
}
|
|
1372
|
+
peek(key) {
|
|
1373
|
+
return get(this, key, false);
|
|
1374
|
+
}
|
|
1375
|
+
pop() {
|
|
1376
|
+
const node = this[LRU_LIST].tail;
|
|
1377
|
+
if (!node)
|
|
1378
|
+
return null;
|
|
1379
|
+
del(this, node);
|
|
1380
|
+
return node.value;
|
|
1381
|
+
}
|
|
1382
|
+
del(key) {
|
|
1383
|
+
del(this, this[CACHE].get(key));
|
|
1384
|
+
}
|
|
1385
|
+
load(arr) {
|
|
1386
|
+
this.reset();
|
|
1387
|
+
const now = Date.now();
|
|
1388
|
+
for (let l = arr.length - 1; l >= 0; l--) {
|
|
1389
|
+
const hit = arr[l];
|
|
1390
|
+
const expiresAt = hit.e || 0;
|
|
1391
|
+
if (expiresAt === 0)
|
|
1392
|
+
this.set(hit.k, hit.v);
|
|
1393
|
+
else {
|
|
1394
|
+
const maxAge = expiresAt - now;
|
|
1395
|
+
if (maxAge > 0) {
|
|
1396
|
+
this.set(hit.k, hit.v, maxAge);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
prune() {
|
|
1402
|
+
this[CACHE].forEach((value, key) => get(this, key, false));
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
var get = (self, key, doUse) => {
|
|
1406
|
+
const node = self[CACHE].get(key);
|
|
1407
|
+
if (node) {
|
|
1408
|
+
const hit = node.value;
|
|
1409
|
+
if (isStale(self, hit)) {
|
|
1410
|
+
del(self, node);
|
|
1411
|
+
if (!self[ALLOW_STALE])
|
|
1412
|
+
return void 0;
|
|
1413
|
+
} else {
|
|
1414
|
+
if (doUse) {
|
|
1415
|
+
if (self[UPDATE_AGE_ON_GET])
|
|
1416
|
+
node.value.now = Date.now();
|
|
1417
|
+
self[LRU_LIST].unshiftNode(node);
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return hit.value;
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
var isStale = (self, hit) => {
|
|
1424
|
+
if (!hit || !hit.maxAge && !self[MAX_AGE])
|
|
1425
|
+
return false;
|
|
1426
|
+
const diff = Date.now() - hit.now;
|
|
1427
|
+
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
|
|
1428
|
+
};
|
|
1429
|
+
var trim = (self) => {
|
|
1430
|
+
if (self[LENGTH] > self[MAX]) {
|
|
1431
|
+
for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
|
|
1432
|
+
const prev = walker.prev;
|
|
1433
|
+
del(self, walker);
|
|
1434
|
+
walker = prev;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
var del = (self, node) => {
|
|
1439
|
+
if (node) {
|
|
1440
|
+
const hit = node.value;
|
|
1441
|
+
if (self[DISPOSE])
|
|
1442
|
+
self[DISPOSE](hit.key, hit.value);
|
|
1443
|
+
self[LENGTH] -= hit.length;
|
|
1444
|
+
self[CACHE].delete(hit.key);
|
|
1445
|
+
self[LRU_LIST].removeNode(node);
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
var Entry = class {
|
|
1449
|
+
constructor(key, value, length, now, maxAge) {
|
|
1450
|
+
this.key = key;
|
|
1451
|
+
this.value = value;
|
|
1452
|
+
this.length = length;
|
|
1453
|
+
this.now = now;
|
|
1454
|
+
this.maxAge = maxAge || 0;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
var forEachStep = (self, fn, node, thisp) => {
|
|
1458
|
+
let hit = node.value;
|
|
1459
|
+
if (isStale(self, hit)) {
|
|
1460
|
+
del(self, node);
|
|
1461
|
+
if (!self[ALLOW_STALE])
|
|
1462
|
+
hit = void 0;
|
|
1463
|
+
}
|
|
1464
|
+
if (hit)
|
|
1465
|
+
fn.call(thisp, hit.value, hit.key, self);
|
|
1466
|
+
};
|
|
1467
|
+
module.exports = LRUCache;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
|
|
1471
|
+
// node_modules/semver/classes/range.js
|
|
1472
|
+
var require_range = __commonJS({
|
|
1473
|
+
"node_modules/semver/classes/range.js"(exports, module) {
|
|
1474
|
+
init_cjs_shims();
|
|
1475
|
+
var Range = class _Range {
|
|
1476
|
+
constructor(range, options) {
|
|
1477
|
+
options = parseOptions(options);
|
|
1478
|
+
if (range instanceof _Range) {
|
|
1479
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
1480
|
+
return range;
|
|
1481
|
+
} else {
|
|
1482
|
+
return new _Range(range.raw, options);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
if (range instanceof Comparator) {
|
|
1486
|
+
this.raw = range.value;
|
|
1487
|
+
this.set = [[range]];
|
|
1488
|
+
this.format();
|
|
1489
|
+
return this;
|
|
1490
|
+
}
|
|
1491
|
+
this.options = options;
|
|
1492
|
+
this.loose = !!options.loose;
|
|
1493
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
1494
|
+
this.raw = range.trim().split(/\s+/).join(" ");
|
|
1495
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
1496
|
+
if (!this.set.length) {
|
|
1497
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1498
|
+
}
|
|
1499
|
+
if (this.set.length > 1) {
|
|
1500
|
+
const first = this.set[0];
|
|
1501
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
1502
|
+
if (this.set.length === 0) {
|
|
1503
|
+
this.set = [first];
|
|
1504
|
+
} else if (this.set.length > 1) {
|
|
1505
|
+
for (const c of this.set) {
|
|
1506
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
1507
|
+
this.set = [c];
|
|
1508
|
+
break;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
this.format();
|
|
1514
|
+
}
|
|
1515
|
+
format() {
|
|
1516
|
+
this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
|
|
1517
|
+
return this.range;
|
|
1518
|
+
}
|
|
1519
|
+
toString() {
|
|
1520
|
+
return this.range;
|
|
1521
|
+
}
|
|
1522
|
+
parseRange(range) {
|
|
1523
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1524
|
+
const memoKey = memoOpts + ":" + range;
|
|
1525
|
+
const cached = cache.get(memoKey);
|
|
1526
|
+
if (cached) {
|
|
1527
|
+
return cached;
|
|
1528
|
+
}
|
|
1529
|
+
const loose = this.options.loose;
|
|
1530
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1531
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1532
|
+
debug2("hyphen replace", range);
|
|
1533
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1534
|
+
debug2("comparator trim", range);
|
|
1535
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1536
|
+
debug2("tilde trim", range);
|
|
1537
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1538
|
+
debug2("caret trim", range);
|
|
1539
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1540
|
+
if (loose) {
|
|
1541
|
+
rangeList = rangeList.filter((comp) => {
|
|
1542
|
+
debug2("loose invalid filter", comp, this.options);
|
|
1543
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
debug2("range list", rangeList);
|
|
1547
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
1548
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
1549
|
+
for (const comp of comparators) {
|
|
1550
|
+
if (isNullSet(comp)) {
|
|
1551
|
+
return [comp];
|
|
1552
|
+
}
|
|
1553
|
+
rangeMap.set(comp.value, comp);
|
|
1554
|
+
}
|
|
1555
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
1556
|
+
rangeMap.delete("");
|
|
1557
|
+
}
|
|
1558
|
+
const result = [...rangeMap.values()];
|
|
1559
|
+
cache.set(memoKey, result);
|
|
1560
|
+
return result;
|
|
1561
|
+
}
|
|
1562
|
+
intersects(range, options) {
|
|
1563
|
+
if (!(range instanceof _Range)) {
|
|
1564
|
+
throw new TypeError("a Range is required");
|
|
1565
|
+
}
|
|
1566
|
+
return this.set.some((thisComparators) => {
|
|
1567
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1568
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1569
|
+
return rangeComparators.every((rangeComparator) => {
|
|
1570
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
1571
|
+
});
|
|
1572
|
+
});
|
|
1573
|
+
});
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1577
|
+
test(version) {
|
|
1578
|
+
if (!version) {
|
|
1579
|
+
return false;
|
|
1580
|
+
}
|
|
1581
|
+
if (typeof version === "string") {
|
|
1582
|
+
try {
|
|
1583
|
+
version = new SemVer(version, this.options);
|
|
1584
|
+
} catch (er) {
|
|
1585
|
+
return false;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1589
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
1590
|
+
return true;
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
return false;
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1596
|
+
module.exports = Range;
|
|
1597
|
+
var LRU = require_lru_cache();
|
|
1598
|
+
var cache = new LRU({ max: 1e3 });
|
|
1599
|
+
var parseOptions = require_parse_options();
|
|
1600
|
+
var Comparator = require_comparator();
|
|
1601
|
+
var debug2 = require_debug();
|
|
1602
|
+
var SemVer = require_semver();
|
|
1603
|
+
var {
|
|
1604
|
+
safeRe: re,
|
|
1605
|
+
t,
|
|
1606
|
+
comparatorTrimReplace,
|
|
1607
|
+
tildeTrimReplace,
|
|
1608
|
+
caretTrimReplace
|
|
1609
|
+
} = require_re();
|
|
1610
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1611
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1612
|
+
var isAny = (c) => c.value === "";
|
|
1613
|
+
var isSatisfiable = (comparators, options) => {
|
|
1614
|
+
let result = true;
|
|
1615
|
+
const remainingComparators = comparators.slice();
|
|
1616
|
+
let testComparator = remainingComparators.pop();
|
|
1617
|
+
while (result && remainingComparators.length) {
|
|
1618
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1619
|
+
return testComparator.intersects(otherComparator, options);
|
|
1620
|
+
});
|
|
1621
|
+
testComparator = remainingComparators.pop();
|
|
1622
|
+
}
|
|
1623
|
+
return result;
|
|
1624
|
+
};
|
|
1625
|
+
var parseComparator = (comp, options) => {
|
|
1626
|
+
debug2("comp", comp, options);
|
|
1627
|
+
comp = replaceCarets(comp, options);
|
|
1628
|
+
debug2("caret", comp);
|
|
1629
|
+
comp = replaceTildes(comp, options);
|
|
1630
|
+
debug2("tildes", comp);
|
|
1631
|
+
comp = replaceXRanges(comp, options);
|
|
1632
|
+
debug2("xrange", comp);
|
|
1633
|
+
comp = replaceStars(comp, options);
|
|
1634
|
+
debug2("stars", comp);
|
|
1635
|
+
return comp;
|
|
1636
|
+
};
|
|
1637
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1638
|
+
var replaceTildes = (comp, options) => {
|
|
1639
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1640
|
+
};
|
|
1641
|
+
var replaceTilde = (comp, options) => {
|
|
1642
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1643
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1644
|
+
debug2("tilde", comp, _, M, m, p, pr);
|
|
1645
|
+
let ret;
|
|
1646
|
+
if (isX(M)) {
|
|
1647
|
+
ret = "";
|
|
1648
|
+
} else if (isX(m)) {
|
|
1649
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1650
|
+
} else if (isX(p)) {
|
|
1651
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1652
|
+
} else if (pr) {
|
|
1653
|
+
debug2("replaceTilde pr", pr);
|
|
1654
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1655
|
+
} else {
|
|
1656
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1657
|
+
}
|
|
1658
|
+
debug2("tilde return", ret);
|
|
1659
|
+
return ret;
|
|
1660
|
+
});
|
|
1661
|
+
};
|
|
1662
|
+
var replaceCarets = (comp, options) => {
|
|
1663
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1664
|
+
};
|
|
1665
|
+
var replaceCaret = (comp, options) => {
|
|
1666
|
+
debug2("caret", comp, options);
|
|
1667
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1668
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1669
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1670
|
+
debug2("caret", comp, _, M, m, p, pr);
|
|
1671
|
+
let ret;
|
|
1672
|
+
if (isX(M)) {
|
|
1673
|
+
ret = "";
|
|
1674
|
+
} else if (isX(m)) {
|
|
1675
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1676
|
+
} else if (isX(p)) {
|
|
1677
|
+
if (M === "0") {
|
|
1678
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1679
|
+
} else {
|
|
1680
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1681
|
+
}
|
|
1682
|
+
} else if (pr) {
|
|
1683
|
+
debug2("replaceCaret pr", pr);
|
|
1684
|
+
if (M === "0") {
|
|
1685
|
+
if (m === "0") {
|
|
1686
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1687
|
+
} else {
|
|
1688
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1689
|
+
}
|
|
1690
|
+
} else {
|
|
1691
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1692
|
+
}
|
|
1693
|
+
} else {
|
|
1694
|
+
debug2("no pr");
|
|
1695
|
+
if (M === "0") {
|
|
1696
|
+
if (m === "0") {
|
|
1697
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1698
|
+
} else {
|
|
1699
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1700
|
+
}
|
|
1701
|
+
} else {
|
|
1702
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
debug2("caret return", ret);
|
|
1706
|
+
return ret;
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
var replaceXRanges = (comp, options) => {
|
|
1710
|
+
debug2("replaceXRanges", comp, options);
|
|
1711
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1712
|
+
};
|
|
1713
|
+
var replaceXRange = (comp, options) => {
|
|
1714
|
+
comp = comp.trim();
|
|
1715
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1716
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1717
|
+
debug2("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1718
|
+
const xM = isX(M);
|
|
1719
|
+
const xm = xM || isX(m);
|
|
1720
|
+
const xp = xm || isX(p);
|
|
1721
|
+
const anyX = xp;
|
|
1722
|
+
if (gtlt === "=" && anyX) {
|
|
1723
|
+
gtlt = "";
|
|
1724
|
+
}
|
|
1725
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1726
|
+
if (xM) {
|
|
1727
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1728
|
+
ret = "<0.0.0-0";
|
|
1729
|
+
} else {
|
|
1730
|
+
ret = "*";
|
|
1731
|
+
}
|
|
1732
|
+
} else if (gtlt && anyX) {
|
|
1733
|
+
if (xm) {
|
|
1734
|
+
m = 0;
|
|
1735
|
+
}
|
|
1736
|
+
p = 0;
|
|
1737
|
+
if (gtlt === ">") {
|
|
1738
|
+
gtlt = ">=";
|
|
1739
|
+
if (xm) {
|
|
1740
|
+
M = +M + 1;
|
|
1741
|
+
m = 0;
|
|
1742
|
+
p = 0;
|
|
1743
|
+
} else {
|
|
1744
|
+
m = +m + 1;
|
|
1745
|
+
p = 0;
|
|
1746
|
+
}
|
|
1747
|
+
} else if (gtlt === "<=") {
|
|
1748
|
+
gtlt = "<";
|
|
1749
|
+
if (xm) {
|
|
1750
|
+
M = +M + 1;
|
|
1751
|
+
} else {
|
|
1752
|
+
m = +m + 1;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
if (gtlt === "<") {
|
|
1756
|
+
pr = "-0";
|
|
1757
|
+
}
|
|
1758
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1759
|
+
} else if (xm) {
|
|
1760
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1761
|
+
} else if (xp) {
|
|
1762
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1763
|
+
}
|
|
1764
|
+
debug2("xRange return", ret);
|
|
1765
|
+
return ret;
|
|
1766
|
+
});
|
|
1767
|
+
};
|
|
1768
|
+
var replaceStars = (comp, options) => {
|
|
1769
|
+
debug2("replaceStars", comp, options);
|
|
1770
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1771
|
+
};
|
|
1772
|
+
var replaceGTE0 = (comp, options) => {
|
|
1773
|
+
debug2("replaceGTE0", comp, options);
|
|
1774
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1775
|
+
};
|
|
1776
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
|
|
1777
|
+
if (isX(fM)) {
|
|
1778
|
+
from = "";
|
|
1779
|
+
} else if (isX(fm)) {
|
|
1780
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1781
|
+
} else if (isX(fp)) {
|
|
1782
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1783
|
+
} else if (fpr) {
|
|
1784
|
+
from = `>=${from}`;
|
|
1785
|
+
} else {
|
|
1786
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1787
|
+
}
|
|
1788
|
+
if (isX(tM)) {
|
|
1789
|
+
to = "";
|
|
1790
|
+
} else if (isX(tm)) {
|
|
1791
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1792
|
+
} else if (isX(tp)) {
|
|
1793
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1794
|
+
} else if (tpr) {
|
|
1795
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1796
|
+
} else if (incPr) {
|
|
1797
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1798
|
+
} else {
|
|
1799
|
+
to = `<=${to}`;
|
|
1800
|
+
}
|
|
1801
|
+
return `${from} ${to}`.trim();
|
|
1802
|
+
};
|
|
1803
|
+
var testSet = (set, version, options) => {
|
|
1804
|
+
for (let i = 0; i < set.length; i++) {
|
|
1805
|
+
if (!set[i].test(version)) {
|
|
1806
|
+
return false;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1810
|
+
for (let i = 0; i < set.length; i++) {
|
|
1811
|
+
debug2(set[i].semver);
|
|
1812
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1813
|
+
continue;
|
|
1814
|
+
}
|
|
1815
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1816
|
+
const allowed = set[i].semver;
|
|
1817
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1818
|
+
return true;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
return true;
|
|
1825
|
+
};
|
|
1826
|
+
}
|
|
1827
|
+
});
|
|
1828
|
+
|
|
1829
|
+
// node_modules/semver/classes/comparator.js
|
|
1830
|
+
var require_comparator = __commonJS({
|
|
1831
|
+
"node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1832
|
+
init_cjs_shims();
|
|
1833
|
+
var ANY = Symbol("SemVer ANY");
|
|
1834
|
+
var Comparator = class _Comparator {
|
|
1835
|
+
static get ANY() {
|
|
1836
|
+
return ANY;
|
|
1837
|
+
}
|
|
1838
|
+
constructor(comp, options) {
|
|
1839
|
+
options = parseOptions(options);
|
|
1840
|
+
if (comp instanceof _Comparator) {
|
|
1841
|
+
if (comp.loose === !!options.loose) {
|
|
1842
|
+
return comp;
|
|
1843
|
+
} else {
|
|
1844
|
+
comp = comp.value;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1848
|
+
debug2("comparator", comp, options);
|
|
1849
|
+
this.options = options;
|
|
1850
|
+
this.loose = !!options.loose;
|
|
1851
|
+
this.parse(comp);
|
|
1852
|
+
if (this.semver === ANY) {
|
|
1853
|
+
this.value = "";
|
|
1854
|
+
} else {
|
|
1855
|
+
this.value = this.operator + this.semver.version;
|
|
1856
|
+
}
|
|
1857
|
+
debug2("comp", this);
|
|
1858
|
+
}
|
|
1859
|
+
parse(comp) {
|
|
1860
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1861
|
+
const m = comp.match(r);
|
|
1862
|
+
if (!m) {
|
|
1863
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1864
|
+
}
|
|
1865
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1866
|
+
if (this.operator === "=") {
|
|
1867
|
+
this.operator = "";
|
|
1868
|
+
}
|
|
1869
|
+
if (!m[2]) {
|
|
1870
|
+
this.semver = ANY;
|
|
1871
|
+
} else {
|
|
1872
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
toString() {
|
|
1876
|
+
return this.value;
|
|
1877
|
+
}
|
|
1878
|
+
test(version) {
|
|
1879
|
+
debug2("Comparator.test", version, this.options.loose);
|
|
1880
|
+
if (this.semver === ANY || version === ANY) {
|
|
1881
|
+
return true;
|
|
1882
|
+
}
|
|
1883
|
+
if (typeof version === "string") {
|
|
1884
|
+
try {
|
|
1885
|
+
version = new SemVer(version, this.options);
|
|
1886
|
+
} catch (er) {
|
|
1887
|
+
return false;
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1891
|
+
}
|
|
1892
|
+
intersects(comp, options) {
|
|
1893
|
+
if (!(comp instanceof _Comparator)) {
|
|
1894
|
+
throw new TypeError("a Comparator is required");
|
|
1895
|
+
}
|
|
1896
|
+
if (this.operator === "") {
|
|
1897
|
+
if (this.value === "") {
|
|
1898
|
+
return true;
|
|
1899
|
+
}
|
|
1900
|
+
return new Range(comp.value, options).test(this.value);
|
|
1901
|
+
} else if (comp.operator === "") {
|
|
1902
|
+
if (comp.value === "") {
|
|
1903
|
+
return true;
|
|
1904
|
+
}
|
|
1905
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1906
|
+
}
|
|
1907
|
+
options = parseOptions(options);
|
|
1908
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1909
|
+
return false;
|
|
1910
|
+
}
|
|
1911
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1912
|
+
return false;
|
|
1913
|
+
}
|
|
1914
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1915
|
+
return true;
|
|
1916
|
+
}
|
|
1917
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1918
|
+
return true;
|
|
1919
|
+
}
|
|
1920
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1921
|
+
return true;
|
|
1922
|
+
}
|
|
1923
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1924
|
+
return true;
|
|
1925
|
+
}
|
|
1926
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1927
|
+
return true;
|
|
1928
|
+
}
|
|
1929
|
+
return false;
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
module.exports = Comparator;
|
|
1933
|
+
var parseOptions = require_parse_options();
|
|
1934
|
+
var { safeRe: re, t } = require_re();
|
|
1935
|
+
var cmp = require_cmp();
|
|
1936
|
+
var debug2 = require_debug();
|
|
1937
|
+
var SemVer = require_semver();
|
|
1938
|
+
var Range = require_range();
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
|
|
1942
|
+
// node_modules/semver/functions/satisfies.js
|
|
1943
|
+
var require_satisfies = __commonJS({
|
|
1944
|
+
"node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1945
|
+
init_cjs_shims();
|
|
1946
|
+
var Range = require_range();
|
|
1947
|
+
var satisfies = (version, range, options) => {
|
|
1948
|
+
try {
|
|
1949
|
+
range = new Range(range, options);
|
|
1950
|
+
} catch (er) {
|
|
1951
|
+
return false;
|
|
1952
|
+
}
|
|
1953
|
+
return range.test(version);
|
|
1954
|
+
};
|
|
1955
|
+
module.exports = satisfies;
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
|
|
1959
|
+
// node_modules/semver/ranges/to-comparators.js
|
|
1960
|
+
var require_to_comparators = __commonJS({
|
|
1961
|
+
"node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1962
|
+
init_cjs_shims();
|
|
1963
|
+
var Range = require_range();
|
|
1964
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1965
|
+
module.exports = toComparators;
|
|
1966
|
+
}
|
|
1967
|
+
});
|
|
1968
|
+
|
|
1969
|
+
// node_modules/semver/ranges/max-satisfying.js
|
|
1970
|
+
var require_max_satisfying = __commonJS({
|
|
1971
|
+
"node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1972
|
+
init_cjs_shims();
|
|
1973
|
+
var SemVer = require_semver();
|
|
1974
|
+
var Range = require_range();
|
|
1975
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1976
|
+
let max = null;
|
|
1977
|
+
let maxSV = null;
|
|
1978
|
+
let rangeObj = null;
|
|
1979
|
+
try {
|
|
1980
|
+
rangeObj = new Range(range, options);
|
|
1981
|
+
} catch (er) {
|
|
1982
|
+
return null;
|
|
1983
|
+
}
|
|
1984
|
+
versions.forEach((v) => {
|
|
1985
|
+
if (rangeObj.test(v)) {
|
|
1986
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1987
|
+
max = v;
|
|
1988
|
+
maxSV = new SemVer(max, options);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
return max;
|
|
1993
|
+
};
|
|
1994
|
+
module.exports = maxSatisfying;
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1997
|
+
|
|
1998
|
+
// node_modules/semver/ranges/min-satisfying.js
|
|
1999
|
+
var require_min_satisfying = __commonJS({
|
|
2000
|
+
"node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
2001
|
+
init_cjs_shims();
|
|
2002
|
+
var SemVer = require_semver();
|
|
2003
|
+
var Range = require_range();
|
|
2004
|
+
var minSatisfying = (versions, range, options) => {
|
|
2005
|
+
let min = null;
|
|
2006
|
+
let minSV = null;
|
|
2007
|
+
let rangeObj = null;
|
|
2008
|
+
try {
|
|
2009
|
+
rangeObj = new Range(range, options);
|
|
2010
|
+
} catch (er) {
|
|
2011
|
+
return null;
|
|
2012
|
+
}
|
|
2013
|
+
versions.forEach((v) => {
|
|
2014
|
+
if (rangeObj.test(v)) {
|
|
2015
|
+
if (!min || minSV.compare(v) === 1) {
|
|
2016
|
+
min = v;
|
|
2017
|
+
minSV = new SemVer(min, options);
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
});
|
|
2021
|
+
return min;
|
|
2022
|
+
};
|
|
2023
|
+
module.exports = minSatisfying;
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
|
|
2027
|
+
// node_modules/semver/ranges/min-version.js
|
|
2028
|
+
var require_min_version = __commonJS({
|
|
2029
|
+
"node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
2030
|
+
init_cjs_shims();
|
|
2031
|
+
var SemVer = require_semver();
|
|
2032
|
+
var Range = require_range();
|
|
2033
|
+
var gt2 = require_gt();
|
|
2034
|
+
var minVersion = (range, loose) => {
|
|
2035
|
+
range = new Range(range, loose);
|
|
2036
|
+
let minver = new SemVer("0.0.0");
|
|
2037
|
+
if (range.test(minver)) {
|
|
2038
|
+
return minver;
|
|
2039
|
+
}
|
|
2040
|
+
minver = new SemVer("0.0.0-0");
|
|
2041
|
+
if (range.test(minver)) {
|
|
2042
|
+
return minver;
|
|
2043
|
+
}
|
|
2044
|
+
minver = null;
|
|
2045
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
2046
|
+
const comparators = range.set[i];
|
|
2047
|
+
let setMin = null;
|
|
2048
|
+
comparators.forEach((comparator) => {
|
|
2049
|
+
const compver = new SemVer(comparator.semver.version);
|
|
2050
|
+
switch (comparator.operator) {
|
|
2051
|
+
case ">":
|
|
2052
|
+
if (compver.prerelease.length === 0) {
|
|
2053
|
+
compver.patch++;
|
|
2054
|
+
} else {
|
|
2055
|
+
compver.prerelease.push(0);
|
|
2056
|
+
}
|
|
2057
|
+
compver.raw = compver.format();
|
|
2058
|
+
case "":
|
|
2059
|
+
case ">=":
|
|
2060
|
+
if (!setMin || gt2(compver, setMin)) {
|
|
2061
|
+
setMin = compver;
|
|
2062
|
+
}
|
|
2063
|
+
break;
|
|
2064
|
+
case "<":
|
|
2065
|
+
case "<=":
|
|
2066
|
+
break;
|
|
2067
|
+
default:
|
|
2068
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
2069
|
+
}
|
|
2070
|
+
});
|
|
2071
|
+
if (setMin && (!minver || gt2(minver, setMin))) {
|
|
2072
|
+
minver = setMin;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
if (minver && range.test(minver)) {
|
|
2076
|
+
return minver;
|
|
2077
|
+
}
|
|
2078
|
+
return null;
|
|
2079
|
+
};
|
|
2080
|
+
module.exports = minVersion;
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
|
|
2084
|
+
// node_modules/semver/ranges/valid.js
|
|
2085
|
+
var require_valid2 = __commonJS({
|
|
2086
|
+
"node_modules/semver/ranges/valid.js"(exports, module) {
|
|
2087
|
+
init_cjs_shims();
|
|
2088
|
+
var Range = require_range();
|
|
2089
|
+
var validRange2 = (range, options) => {
|
|
2090
|
+
try {
|
|
2091
|
+
return new Range(range, options).range || "*";
|
|
2092
|
+
} catch (er) {
|
|
2093
|
+
return null;
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
2096
|
+
module.exports = validRange2;
|
|
2097
|
+
}
|
|
2098
|
+
});
|
|
2099
|
+
|
|
2100
|
+
// node_modules/semver/ranges/outside.js
|
|
2101
|
+
var require_outside = __commonJS({
|
|
2102
|
+
"node_modules/semver/ranges/outside.js"(exports, module) {
|
|
2103
|
+
init_cjs_shims();
|
|
2104
|
+
var SemVer = require_semver();
|
|
2105
|
+
var Comparator = require_comparator();
|
|
2106
|
+
var { ANY } = Comparator;
|
|
2107
|
+
var Range = require_range();
|
|
2108
|
+
var satisfies = require_satisfies();
|
|
2109
|
+
var gt2 = require_gt();
|
|
2110
|
+
var lt = require_lt();
|
|
2111
|
+
var lte = require_lte();
|
|
2112
|
+
var gte = require_gte();
|
|
2113
|
+
var outside = (version, range, hilo, options) => {
|
|
2114
|
+
version = new SemVer(version, options);
|
|
2115
|
+
range = new Range(range, options);
|
|
2116
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2117
|
+
switch (hilo) {
|
|
2118
|
+
case ">":
|
|
2119
|
+
gtfn = gt2;
|
|
2120
|
+
ltefn = lte;
|
|
2121
|
+
ltfn = lt;
|
|
2122
|
+
comp = ">";
|
|
2123
|
+
ecomp = ">=";
|
|
2124
|
+
break;
|
|
2125
|
+
case "<":
|
|
2126
|
+
gtfn = lt;
|
|
2127
|
+
ltefn = gte;
|
|
2128
|
+
ltfn = gt2;
|
|
2129
|
+
comp = "<";
|
|
2130
|
+
ecomp = "<=";
|
|
2131
|
+
break;
|
|
2132
|
+
default:
|
|
2133
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
2134
|
+
}
|
|
2135
|
+
if (satisfies(version, range, options)) {
|
|
2136
|
+
return false;
|
|
2137
|
+
}
|
|
2138
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
2139
|
+
const comparators = range.set[i];
|
|
2140
|
+
let high = null;
|
|
2141
|
+
let low = null;
|
|
2142
|
+
comparators.forEach((comparator) => {
|
|
2143
|
+
if (comparator.semver === ANY) {
|
|
2144
|
+
comparator = new Comparator(">=0.0.0");
|
|
2145
|
+
}
|
|
2146
|
+
high = high || comparator;
|
|
2147
|
+
low = low || comparator;
|
|
2148
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
2149
|
+
high = comparator;
|
|
2150
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
2151
|
+
low = comparator;
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
2154
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
2155
|
+
return false;
|
|
2156
|
+
}
|
|
2157
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
2158
|
+
return false;
|
|
2159
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
2160
|
+
return false;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
return true;
|
|
2164
|
+
};
|
|
2165
|
+
module.exports = outside;
|
|
2166
|
+
}
|
|
2167
|
+
});
|
|
2168
|
+
|
|
2169
|
+
// node_modules/semver/ranges/gtr.js
|
|
2170
|
+
var require_gtr = __commonJS({
|
|
2171
|
+
"node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
2172
|
+
init_cjs_shims();
|
|
2173
|
+
var outside = require_outside();
|
|
2174
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
2175
|
+
module.exports = gtr;
|
|
2176
|
+
}
|
|
2177
|
+
});
|
|
2178
|
+
|
|
2179
|
+
// node_modules/semver/ranges/ltr.js
|
|
2180
|
+
var require_ltr = __commonJS({
|
|
2181
|
+
"node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
2182
|
+
init_cjs_shims();
|
|
2183
|
+
var outside = require_outside();
|
|
2184
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
2185
|
+
module.exports = ltr;
|
|
2186
|
+
}
|
|
2187
|
+
});
|
|
2188
|
+
|
|
2189
|
+
// node_modules/semver/ranges/intersects.js
|
|
2190
|
+
var require_intersects = __commonJS({
|
|
2191
|
+
"node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
2192
|
+
init_cjs_shims();
|
|
2193
|
+
var Range = require_range();
|
|
2194
|
+
var intersects = (r1, r2, options) => {
|
|
2195
|
+
r1 = new Range(r1, options);
|
|
2196
|
+
r2 = new Range(r2, options);
|
|
2197
|
+
return r1.intersects(r2, options);
|
|
2198
|
+
};
|
|
2199
|
+
module.exports = intersects;
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
|
|
2203
|
+
// node_modules/semver/ranges/simplify.js
|
|
2204
|
+
var require_simplify = __commonJS({
|
|
2205
|
+
"node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
2206
|
+
init_cjs_shims();
|
|
2207
|
+
var satisfies = require_satisfies();
|
|
2208
|
+
var compare2 = require_compare();
|
|
2209
|
+
module.exports = (versions, range, options) => {
|
|
2210
|
+
const set = [];
|
|
2211
|
+
let first = null;
|
|
2212
|
+
let prev = null;
|
|
2213
|
+
const v = versions.sort((a, b) => compare2(a, b, options));
|
|
2214
|
+
for (const version of v) {
|
|
2215
|
+
const included = satisfies(version, range, options);
|
|
2216
|
+
if (included) {
|
|
2217
|
+
prev = version;
|
|
2218
|
+
if (!first) {
|
|
2219
|
+
first = version;
|
|
2220
|
+
}
|
|
2221
|
+
} else {
|
|
2222
|
+
if (prev) {
|
|
2223
|
+
set.push([first, prev]);
|
|
2224
|
+
}
|
|
2225
|
+
prev = null;
|
|
2226
|
+
first = null;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (first) {
|
|
2230
|
+
set.push([first, null]);
|
|
2231
|
+
}
|
|
2232
|
+
const ranges = [];
|
|
2233
|
+
for (const [min, max] of set) {
|
|
2234
|
+
if (min === max) {
|
|
2235
|
+
ranges.push(min);
|
|
2236
|
+
} else if (!max && min === v[0]) {
|
|
2237
|
+
ranges.push("*");
|
|
2238
|
+
} else if (!max) {
|
|
2239
|
+
ranges.push(`>=${min}`);
|
|
2240
|
+
} else if (min === v[0]) {
|
|
2241
|
+
ranges.push(`<=${max}`);
|
|
2242
|
+
} else {
|
|
2243
|
+
ranges.push(`${min} - ${max}`);
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
const simplified = ranges.join(" || ");
|
|
2247
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
2248
|
+
return simplified.length < original.length ? simplified : range;
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
});
|
|
2252
|
+
|
|
2253
|
+
// node_modules/semver/ranges/subset.js
|
|
2254
|
+
var require_subset = __commonJS({
|
|
2255
|
+
"node_modules/semver/ranges/subset.js"(exports, module) {
|
|
2256
|
+
init_cjs_shims();
|
|
2257
|
+
var Range = require_range();
|
|
2258
|
+
var Comparator = require_comparator();
|
|
2259
|
+
var { ANY } = Comparator;
|
|
2260
|
+
var satisfies = require_satisfies();
|
|
2261
|
+
var compare2 = require_compare();
|
|
2262
|
+
var subset = (sub, dom, options = {}) => {
|
|
2263
|
+
if (sub === dom) {
|
|
2264
|
+
return true;
|
|
2265
|
+
}
|
|
2266
|
+
sub = new Range(sub, options);
|
|
2267
|
+
dom = new Range(dom, options);
|
|
2268
|
+
let sawNonNull = false;
|
|
2269
|
+
OUTER:
|
|
2270
|
+
for (const simpleSub of sub.set) {
|
|
2271
|
+
for (const simpleDom of dom.set) {
|
|
2272
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
2273
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
2274
|
+
if (isSub) {
|
|
2275
|
+
continue OUTER;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
if (sawNonNull) {
|
|
2279
|
+
return false;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
return true;
|
|
2283
|
+
};
|
|
2284
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
2285
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
2286
|
+
var simpleSubset = (sub, dom, options) => {
|
|
2287
|
+
if (sub === dom) {
|
|
2288
|
+
return true;
|
|
2289
|
+
}
|
|
2290
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
2291
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
2292
|
+
return true;
|
|
2293
|
+
} else if (options.includePrerelease) {
|
|
2294
|
+
sub = minimumVersionWithPreRelease;
|
|
2295
|
+
} else {
|
|
2296
|
+
sub = minimumVersion;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
2300
|
+
if (options.includePrerelease) {
|
|
2301
|
+
return true;
|
|
2302
|
+
} else {
|
|
2303
|
+
dom = minimumVersion;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
2307
|
+
let gt2, lt;
|
|
2308
|
+
for (const c of sub) {
|
|
2309
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
2310
|
+
gt2 = higherGT(gt2, c, options);
|
|
2311
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
2312
|
+
lt = lowerLT(lt, c, options);
|
|
2313
|
+
} else {
|
|
2314
|
+
eqSet.add(c.semver);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
if (eqSet.size > 1) {
|
|
2318
|
+
return null;
|
|
2319
|
+
}
|
|
2320
|
+
let gtltComp;
|
|
2321
|
+
if (gt2 && lt) {
|
|
2322
|
+
gtltComp = compare2(gt2.semver, lt.semver, options);
|
|
2323
|
+
if (gtltComp > 0) {
|
|
2324
|
+
return null;
|
|
2325
|
+
} else if (gtltComp === 0 && (gt2.operator !== ">=" || lt.operator !== "<=")) {
|
|
2326
|
+
return null;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
for (const eq of eqSet) {
|
|
2330
|
+
if (gt2 && !satisfies(eq, String(gt2), options)) {
|
|
2331
|
+
return null;
|
|
2332
|
+
}
|
|
2333
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
2334
|
+
return null;
|
|
2335
|
+
}
|
|
2336
|
+
for (const c of dom) {
|
|
2337
|
+
if (!satisfies(eq, String(c), options)) {
|
|
2338
|
+
return false;
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
return true;
|
|
2342
|
+
}
|
|
2343
|
+
let higher, lower;
|
|
2344
|
+
let hasDomLT, hasDomGT;
|
|
2345
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
2346
|
+
let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false;
|
|
2347
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
2348
|
+
needDomLTPre = false;
|
|
2349
|
+
}
|
|
2350
|
+
for (const c of dom) {
|
|
2351
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
2352
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
2353
|
+
if (gt2) {
|
|
2354
|
+
if (needDomGTPre) {
|
|
2355
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
2356
|
+
needDomGTPre = false;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
2360
|
+
higher = higherGT(gt2, c, options);
|
|
2361
|
+
if (higher === c && higher !== gt2) {
|
|
2362
|
+
return false;
|
|
2363
|
+
}
|
|
2364
|
+
} else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c), options)) {
|
|
2365
|
+
return false;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
if (lt) {
|
|
2369
|
+
if (needDomLTPre) {
|
|
2370
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
2371
|
+
needDomLTPre = false;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
2375
|
+
lower = lowerLT(lt, c, options);
|
|
2376
|
+
if (lower === c && lower !== lt) {
|
|
2377
|
+
return false;
|
|
2378
|
+
}
|
|
2379
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
2380
|
+
return false;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
if (!c.operator && (lt || gt2) && gtltComp !== 0) {
|
|
2384
|
+
return false;
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
if (gt2 && hasDomLT && !lt && gtltComp !== 0) {
|
|
2388
|
+
return false;
|
|
2389
|
+
}
|
|
2390
|
+
if (lt && hasDomGT && !gt2 && gtltComp !== 0) {
|
|
2391
|
+
return false;
|
|
2392
|
+
}
|
|
2393
|
+
if (needDomGTPre || needDomLTPre) {
|
|
2394
|
+
return false;
|
|
2395
|
+
}
|
|
2396
|
+
return true;
|
|
2397
|
+
};
|
|
2398
|
+
var higherGT = (a, b, options) => {
|
|
2399
|
+
if (!a) {
|
|
2400
|
+
return b;
|
|
2401
|
+
}
|
|
2402
|
+
const comp = compare2(a.semver, b.semver, options);
|
|
2403
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
2404
|
+
};
|
|
2405
|
+
var lowerLT = (a, b, options) => {
|
|
2406
|
+
if (!a) {
|
|
2407
|
+
return b;
|
|
2408
|
+
}
|
|
2409
|
+
const comp = compare2(a.semver, b.semver, options);
|
|
2410
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
2411
|
+
};
|
|
2412
|
+
module.exports = subset;
|
|
2413
|
+
}
|
|
2414
|
+
});
|
|
2415
|
+
|
|
2416
|
+
// node_modules/semver/index.js
|
|
2417
|
+
var require_semver2 = __commonJS({
|
|
2418
|
+
"node_modules/semver/index.js"(exports, module) {
|
|
2419
|
+
init_cjs_shims();
|
|
2420
|
+
var internalRe = require_re();
|
|
2421
|
+
var constants2 = require_constants();
|
|
2422
|
+
var SemVer = require_semver();
|
|
2423
|
+
var identifiers = require_identifiers();
|
|
2424
|
+
var parse = require_parse();
|
|
2425
|
+
var valid2 = require_valid();
|
|
2426
|
+
var clean = require_clean();
|
|
2427
|
+
var inc = require_inc();
|
|
2428
|
+
var diff = require_diff();
|
|
2429
|
+
var major = require_major();
|
|
2430
|
+
var minor = require_minor();
|
|
2431
|
+
var patch = require_patch();
|
|
2432
|
+
var prerelease = require_prerelease();
|
|
2433
|
+
var compare2 = require_compare();
|
|
2434
|
+
var rcompare = require_rcompare();
|
|
2435
|
+
var compareLoose = require_compare_loose();
|
|
2436
|
+
var compareBuild = require_compare_build();
|
|
2437
|
+
var sort = require_sort();
|
|
2438
|
+
var rsort = require_rsort();
|
|
2439
|
+
var gt2 = require_gt();
|
|
2440
|
+
var lt = require_lt();
|
|
2441
|
+
var eq = require_eq();
|
|
2442
|
+
var neq = require_neq();
|
|
2443
|
+
var gte = require_gte();
|
|
2444
|
+
var lte = require_lte();
|
|
2445
|
+
var cmp = require_cmp();
|
|
2446
|
+
var coerce = require_coerce();
|
|
2447
|
+
var Comparator = require_comparator();
|
|
2448
|
+
var Range = require_range();
|
|
2449
|
+
var satisfies = require_satisfies();
|
|
2450
|
+
var toComparators = require_to_comparators();
|
|
2451
|
+
var maxSatisfying = require_max_satisfying();
|
|
2452
|
+
var minSatisfying = require_min_satisfying();
|
|
2453
|
+
var minVersion = require_min_version();
|
|
2454
|
+
var validRange2 = require_valid2();
|
|
2455
|
+
var outside = require_outside();
|
|
2456
|
+
var gtr = require_gtr();
|
|
2457
|
+
var ltr = require_ltr();
|
|
2458
|
+
var intersects = require_intersects();
|
|
2459
|
+
var simplifyRange = require_simplify();
|
|
2460
|
+
var subset = require_subset();
|
|
2461
|
+
module.exports = {
|
|
2462
|
+
parse,
|
|
2463
|
+
valid: valid2,
|
|
2464
|
+
clean,
|
|
2465
|
+
inc,
|
|
2466
|
+
diff,
|
|
2467
|
+
major,
|
|
2468
|
+
minor,
|
|
2469
|
+
patch,
|
|
2470
|
+
prerelease,
|
|
2471
|
+
compare: compare2,
|
|
2472
|
+
rcompare,
|
|
2473
|
+
compareLoose,
|
|
2474
|
+
compareBuild,
|
|
2475
|
+
sort,
|
|
2476
|
+
rsort,
|
|
2477
|
+
gt: gt2,
|
|
2478
|
+
lt,
|
|
2479
|
+
eq,
|
|
2480
|
+
neq,
|
|
2481
|
+
gte,
|
|
2482
|
+
lte,
|
|
2483
|
+
cmp,
|
|
2484
|
+
coerce,
|
|
2485
|
+
Comparator,
|
|
2486
|
+
Range,
|
|
2487
|
+
satisfies,
|
|
2488
|
+
toComparators,
|
|
2489
|
+
maxSatisfying,
|
|
2490
|
+
minSatisfying,
|
|
2491
|
+
minVersion,
|
|
2492
|
+
validRange: validRange2,
|
|
2493
|
+
outside,
|
|
2494
|
+
gtr,
|
|
2495
|
+
ltr,
|
|
2496
|
+
intersects,
|
|
2497
|
+
simplifyRange,
|
|
2498
|
+
subset,
|
|
2499
|
+
SemVer,
|
|
2500
|
+
re: internalRe.re,
|
|
2501
|
+
src: internalRe.src,
|
|
2502
|
+
tokens: internalRe.t,
|
|
2503
|
+
SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
|
|
2504
|
+
RELEASE_TYPES: constants2.RELEASE_TYPES,
|
|
2505
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2506
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
});
|
|
2510
|
+
|
|
2511
|
+
// node_modules/builtins/index.js
|
|
2512
|
+
var require_builtins = __commonJS({
|
|
2513
|
+
"node_modules/builtins/index.js"(exports, module) {
|
|
2514
|
+
"use strict";
|
|
2515
|
+
init_cjs_shims();
|
|
2516
|
+
var semver = require_semver2();
|
|
2517
|
+
var permanentModules = [
|
|
2518
|
+
"assert",
|
|
2519
|
+
"buffer",
|
|
2520
|
+
"child_process",
|
|
2521
|
+
"cluster",
|
|
2522
|
+
"console",
|
|
2523
|
+
"constants",
|
|
2524
|
+
"crypto",
|
|
2525
|
+
"dgram",
|
|
2526
|
+
"dns",
|
|
2527
|
+
"domain",
|
|
2528
|
+
"events",
|
|
2529
|
+
"fs",
|
|
2530
|
+
"http",
|
|
2531
|
+
"https",
|
|
2532
|
+
"module",
|
|
2533
|
+
"net",
|
|
2534
|
+
"os",
|
|
2535
|
+
"path",
|
|
2536
|
+
"punycode",
|
|
2537
|
+
"querystring",
|
|
2538
|
+
"readline",
|
|
2539
|
+
"repl",
|
|
2540
|
+
"stream",
|
|
2541
|
+
"string_decoder",
|
|
2542
|
+
"sys",
|
|
2543
|
+
"timers",
|
|
2544
|
+
"tls",
|
|
2545
|
+
"tty",
|
|
2546
|
+
"url",
|
|
2547
|
+
"util",
|
|
2548
|
+
"vm",
|
|
2549
|
+
"zlib"
|
|
2550
|
+
];
|
|
2551
|
+
var versionLockedModules = {
|
|
2552
|
+
freelist: "<6.0.0",
|
|
2553
|
+
v8: ">=1.0.0",
|
|
2554
|
+
process: ">=1.1.0",
|
|
2555
|
+
inspector: ">=8.0.0",
|
|
2556
|
+
async_hooks: ">=8.1.0",
|
|
2557
|
+
http2: ">=8.4.0",
|
|
2558
|
+
perf_hooks: ">=8.5.0",
|
|
2559
|
+
trace_events: ">=10.0.0",
|
|
2560
|
+
worker_threads: ">=12.0.0",
|
|
2561
|
+
"node:test": ">=18.0.0"
|
|
2562
|
+
};
|
|
2563
|
+
var experimentalModules = {
|
|
2564
|
+
worker_threads: ">=10.5.0",
|
|
2565
|
+
wasi: ">=12.16.0",
|
|
2566
|
+
diagnostics_channel: "^14.17.0 || >=15.1.0"
|
|
2567
|
+
};
|
|
2568
|
+
module.exports = ({ version = process.version, experimental = false } = {}) => {
|
|
2569
|
+
const builtins = [...permanentModules];
|
|
2570
|
+
for (const [name, semverRange] of Object.entries(versionLockedModules)) {
|
|
2571
|
+
if (version === "*" || semver.satisfies(version, semverRange)) {
|
|
2572
|
+
builtins.push(name);
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
if (experimental) {
|
|
2576
|
+
for (const [name, semverRange] of Object.entries(experimentalModules)) {
|
|
2577
|
+
if (!builtins.includes(name) && (version === "*" || semver.satisfies(version, semverRange))) {
|
|
2578
|
+
builtins.push(name);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
return builtins;
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
});
|
|
2586
|
+
|
|
2587
|
+
// node_modules/validate-npm-package-name/lib/index.js
|
|
2588
|
+
var require_lib2 = __commonJS({
|
|
2589
|
+
"node_modules/validate-npm-package-name/lib/index.js"(exports, module) {
|
|
2590
|
+
"use strict";
|
|
2591
|
+
init_cjs_shims();
|
|
2592
|
+
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
2593
|
+
var builtins = require_builtins();
|
|
2594
|
+
var blacklist = [
|
|
2595
|
+
"node_modules",
|
|
2596
|
+
"favicon.ico"
|
|
2597
|
+
];
|
|
2598
|
+
function validate2(name) {
|
|
2599
|
+
var warnings = [];
|
|
2600
|
+
var errors = [];
|
|
2601
|
+
if (name === null) {
|
|
2602
|
+
errors.push("name cannot be null");
|
|
2603
|
+
return done(warnings, errors);
|
|
2604
|
+
}
|
|
2605
|
+
if (name === void 0) {
|
|
2606
|
+
errors.push("name cannot be undefined");
|
|
2607
|
+
return done(warnings, errors);
|
|
2608
|
+
}
|
|
2609
|
+
if (typeof name !== "string") {
|
|
2610
|
+
errors.push("name must be a string");
|
|
2611
|
+
return done(warnings, errors);
|
|
2612
|
+
}
|
|
2613
|
+
if (!name.length) {
|
|
2614
|
+
errors.push("name length must be greater than zero");
|
|
2615
|
+
}
|
|
2616
|
+
if (name.match(/^\./)) {
|
|
2617
|
+
errors.push("name cannot start with a period");
|
|
2618
|
+
}
|
|
2619
|
+
if (name.match(/^_/)) {
|
|
2620
|
+
errors.push("name cannot start with an underscore");
|
|
2621
|
+
}
|
|
2622
|
+
if (name.trim() !== name) {
|
|
2623
|
+
errors.push("name cannot contain leading or trailing spaces");
|
|
2624
|
+
}
|
|
2625
|
+
blacklist.forEach(function(blacklistedName) {
|
|
2626
|
+
if (name.toLowerCase() === blacklistedName) {
|
|
2627
|
+
errors.push(blacklistedName + " is a blacklisted name");
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2630
|
+
builtins({ version: "*" }).forEach(function(builtin) {
|
|
2631
|
+
if (name.toLowerCase() === builtin) {
|
|
2632
|
+
warnings.push(builtin + " is a core module name");
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2635
|
+
if (name.length > 214) {
|
|
2636
|
+
warnings.push("name can no longer contain more than 214 characters");
|
|
2637
|
+
}
|
|
2638
|
+
if (name.toLowerCase() !== name) {
|
|
2639
|
+
warnings.push("name can no longer contain capital letters");
|
|
2640
|
+
}
|
|
2641
|
+
if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
|
|
2642
|
+
warnings.push(`name can no longer contain special characters ("~'!()*")`);
|
|
2643
|
+
}
|
|
2644
|
+
if (encodeURIComponent(name) !== name) {
|
|
2645
|
+
var nameMatch = name.match(scopedPackagePattern);
|
|
2646
|
+
if (nameMatch) {
|
|
2647
|
+
var user = nameMatch[1];
|
|
2648
|
+
var pkg = nameMatch[2];
|
|
2649
|
+
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
|
2650
|
+
return done(warnings, errors);
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
errors.push("name can only contain URL-friendly characters");
|
|
2654
|
+
}
|
|
2655
|
+
return done(warnings, errors);
|
|
2656
|
+
}
|
|
2657
|
+
var done = function(warnings, errors) {
|
|
2658
|
+
var result = {
|
|
2659
|
+
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
|
2660
|
+
validForOldPackages: errors.length === 0,
|
|
2661
|
+
warnings,
|
|
2662
|
+
errors
|
|
2663
|
+
};
|
|
2664
|
+
if (!result.warnings.length) {
|
|
2665
|
+
delete result.warnings;
|
|
2666
|
+
}
|
|
2667
|
+
if (!result.errors.length) {
|
|
2668
|
+
delete result.errors;
|
|
2669
|
+
}
|
|
2670
|
+
return result;
|
|
2671
|
+
};
|
|
2672
|
+
module.exports = validate2;
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
18
2675
|
|
|
19
2676
|
// src/index.ts
|
|
20
2677
|
init_cjs_shims();
|
|
2678
|
+
var import_core12 = __toESM(require_lib(), 1);
|
|
2679
|
+
|
|
2680
|
+
// node_modules/@oclif/plugin-plugins/lib/index.js
|
|
2681
|
+
init_cjs_shims();
|
|
2682
|
+
|
|
2683
|
+
// node_modules/@oclif/plugin-plugins/lib/plugins.js
|
|
2684
|
+
init_cjs_shims();
|
|
2685
|
+
var import_core3 = __toESM(require_lib(), 1);
|
|
2686
|
+
var import_debug2 = __toESM(require_src(), 1);
|
|
2687
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
2688
|
+
import { access, mkdir, readFile as readFile2, rename, writeFile } from "node:fs/promises";
|
|
2689
|
+
import { dirname, join as join3, resolve } from "node:path";
|
|
2690
|
+
|
|
2691
|
+
// node_modules/@oclif/plugin-plugins/lib/util.js
|
|
2692
|
+
init_cjs_shims();
|
|
2693
|
+
var import_core = __toESM(require_lib(), 1);
|
|
2694
|
+
import * as fs from "node:fs";
|
|
2695
|
+
import * as fsPromises from "node:fs/promises";
|
|
2696
|
+
import { createRequire } from "node:module";
|
|
2697
|
+
import { type } from "node:os";
|
|
2698
|
+
import * as path from "node:path";
|
|
2699
|
+
function compare(a, b) {
|
|
2700
|
+
const itemA = a === void 0 ? 0 : a;
|
|
2701
|
+
const itemB = b === void 0 ? 0 : b;
|
|
2702
|
+
if (Array.isArray(itemA) && Array.isArray(itemB)) {
|
|
2703
|
+
if (itemA.length === 0 && itemB.length === 0)
|
|
2704
|
+
return 0;
|
|
2705
|
+
const diff = compare(itemA[0], itemB[0]);
|
|
2706
|
+
if (diff !== 0)
|
|
2707
|
+
return diff;
|
|
2708
|
+
return compare(itemA.slice(1), itemB.slice(1));
|
|
2709
|
+
}
|
|
2710
|
+
if (itemA < itemB)
|
|
2711
|
+
return -1;
|
|
2712
|
+
if (itemA > itemB)
|
|
2713
|
+
return 1;
|
|
2714
|
+
return 0;
|
|
2715
|
+
}
|
|
2716
|
+
function sortBy(arr, fn) {
|
|
2717
|
+
return arr.sort((a, b) => compare(fn(a), fn(b)));
|
|
2718
|
+
}
|
|
2719
|
+
function uniq(arr) {
|
|
2720
|
+
return arr.filter((a, i) => arr.indexOf(a) === i);
|
|
2721
|
+
}
|
|
2722
|
+
function uniqWith(arr, fn) {
|
|
2723
|
+
return arr.filter((a, i) => !arr.some((b, j) => j > i && fn(a, b)));
|
|
2724
|
+
}
|
|
2725
|
+
var isExecutable = (filepath) => {
|
|
2726
|
+
if (type() === "Windows_NT")
|
|
2727
|
+
return filepath.endsWith("node.exe");
|
|
2728
|
+
try {
|
|
2729
|
+
if (filepath.endsWith("node")) {
|
|
2730
|
+
fs.accessSync(filepath, fs.constants.X_OK);
|
|
2731
|
+
return true;
|
|
2732
|
+
}
|
|
2733
|
+
} catch {
|
|
2734
|
+
return false;
|
|
2735
|
+
}
|
|
2736
|
+
return false;
|
|
2737
|
+
};
|
|
2738
|
+
async function findNode(root) {
|
|
2739
|
+
const cliBinDirs = [path.join(root, "bin"), path.join(root, "client", "bin")].filter((p) => fs.existsSync(p));
|
|
2740
|
+
const { default: shelljs } = await import("./shell-FHVZNOYW.js");
|
|
2741
|
+
if (cliBinDirs.length > 0) {
|
|
2742
|
+
const node = shelljs.find(cliBinDirs).find((file) => isExecutable(file));
|
|
2743
|
+
if (node) {
|
|
2744
|
+
return fs.realpathSync(node);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
const nodeShellString = shelljs.which("node");
|
|
2748
|
+
if (nodeShellString?.code === 0 && nodeShellString?.stdout) {
|
|
2749
|
+
return `${nodeShellString.stdout}`;
|
|
2750
|
+
}
|
|
2751
|
+
const err = new Error("Cannot locate node executable.");
|
|
2752
|
+
err.name = "CannotFindNodeExecutable";
|
|
2753
|
+
throw err;
|
|
2754
|
+
}
|
|
2755
|
+
async function findNpm() {
|
|
2756
|
+
const require3 = createRequire(import.meta.url);
|
|
2757
|
+
const npmPjsonPath = require3.resolve("npm/package.json");
|
|
2758
|
+
const npmPjson = JSON.parse(await fsPromises.readFile(npmPjsonPath, { encoding: "utf8" }));
|
|
2759
|
+
const npmPath = npmPjsonPath.slice(0, Math.max(0, npmPjsonPath.lastIndexOf(path.sep)));
|
|
2760
|
+
return path.join(npmPath, npmPjson.bin.npm);
|
|
2761
|
+
}
|
|
2762
|
+
var YarnMessagesCache = class _YarnMessagesCache {
|
|
2763
|
+
static errors = /* @__PURE__ */ new Set();
|
|
2764
|
+
static instance;
|
|
2765
|
+
static warnings = /* @__PURE__ */ new Set();
|
|
2766
|
+
static getInstance() {
|
|
2767
|
+
if (!_YarnMessagesCache.instance) {
|
|
2768
|
+
_YarnMessagesCache.instance = new _YarnMessagesCache();
|
|
2769
|
+
}
|
|
2770
|
+
return _YarnMessagesCache.instance;
|
|
2771
|
+
}
|
|
2772
|
+
addErrors(...errors) {
|
|
2773
|
+
for (const err of errors) {
|
|
2774
|
+
_YarnMessagesCache.errors.add(err);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
addWarnings(...warnings) {
|
|
2778
|
+
for (const warning of warnings) {
|
|
2779
|
+
if (warning.includes("Workspaces can only be enabled in private projects."))
|
|
2780
|
+
continue;
|
|
2781
|
+
_YarnMessagesCache.warnings.add(warning);
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
flush(plugin) {
|
|
2785
|
+
if (_YarnMessagesCache.warnings.size === 0)
|
|
2786
|
+
return;
|
|
2787
|
+
let count = 0;
|
|
2788
|
+
for (const warning of _YarnMessagesCache.warnings) {
|
|
2789
|
+
if (!plugin) {
|
|
2790
|
+
import_core.ux.warn(warning);
|
|
2791
|
+
count += 1;
|
|
2792
|
+
return;
|
|
2793
|
+
}
|
|
2794
|
+
if (warning.startsWith(plugin.name) || warning.startsWith(`"${plugin.name}`)) {
|
|
2795
|
+
count += 1;
|
|
2796
|
+
import_core.ux.warn(warning);
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
if (plugin && count > 0) {
|
|
2800
|
+
import_core.ux.logToStderr(`
|
|
2801
|
+
These warnings can only be addressed by the owner(s) of ${plugin.name}.`);
|
|
2802
|
+
if (plugin.pjson.bugs || plugin.pjson.repository) {
|
|
2803
|
+
import_core.ux.logToStderr(`We suggest that you create an issue at ${extractIssuesLocation(plugin.pjson.bugs, plugin.pjson.repository)} and ask the plugin owners to address them.
|
|
2804
|
+
`);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
if (_YarnMessagesCache.errors.size === 0)
|
|
2808
|
+
return;
|
|
2809
|
+
import_core.ux.logToStderr("\nThe following errors occurred:");
|
|
2810
|
+
for (const err of _YarnMessagesCache.errors) {
|
|
2811
|
+
import_core.ux.error(err, { exit: false });
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
function extractIssuesLocation(bugs, repository) {
|
|
2816
|
+
if (bugs) {
|
|
2817
|
+
return typeof bugs === "string" ? bugs : bugs.url;
|
|
2818
|
+
}
|
|
2819
|
+
if (repository) {
|
|
2820
|
+
return typeof repository === "string" ? repository : repository.url.replace("git+", "").replace(".git", "");
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
// node_modules/@oclif/plugin-plugins/lib/yarn.js
|
|
2825
|
+
init_cjs_shims();
|
|
21
2826
|
var import_core2 = __toESM(require_lib(), 1);
|
|
2827
|
+
var import_debug = __toESM(require_src(), 1);
|
|
2828
|
+
import { fork } from "node:child_process";
|
|
2829
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
2830
|
+
import { join as join2 } from "node:path";
|
|
2831
|
+
import { fileURLToPath } from "node:url";
|
|
2832
|
+
var debug = (0, import_debug.default)("cli:yarn");
|
|
2833
|
+
var require2 = createRequire2(import.meta.url);
|
|
2834
|
+
var Yarn = class {
|
|
2835
|
+
config;
|
|
2836
|
+
constructor({ config }) {
|
|
2837
|
+
this.config = config;
|
|
2838
|
+
}
|
|
2839
|
+
async exec(args = [], opts) {
|
|
2840
|
+
const bin = require2.resolve("yarn/bin/yarn.js", { paths: [this.config.root, fileURLToPath(import.meta.url)] });
|
|
2841
|
+
debug("yarn binary path", bin);
|
|
2842
|
+
const { cwd, silent, verbose } = opts;
|
|
2843
|
+
if (args[0] !== "run") {
|
|
2844
|
+
const port = this.config.scopedEnvVar("NETWORK_MUTEX_PORT");
|
|
2845
|
+
const optionalPort = port ? `:${port}` : "";
|
|
2846
|
+
const mutex = this.config.scopedEnvVar("USE_NETWORK_MUTEX") ? `network${optionalPort}` : `file:${join2(cwd, "yarn.lock")}`;
|
|
2847
|
+
const cacheDir = join2(this.config.cacheDir, "yarn");
|
|
2848
|
+
args = [...args, "--non-interactive", `--mutex=${mutex}`, `--preferred-cache-folder=${cacheDir}`, "--check-files"];
|
|
2849
|
+
const networkTimeout = this.config.scopedEnvVar("NETWORK_TIMEOUT");
|
|
2850
|
+
if (networkTimeout)
|
|
2851
|
+
args.push(`--network-timeout=${networkTimeout}`);
|
|
2852
|
+
if (verbose && !silent)
|
|
2853
|
+
args.push("--verbose");
|
|
2854
|
+
if (silent && !verbose)
|
|
2855
|
+
args.push("--silent");
|
|
2856
|
+
if (this.config.npmRegistry)
|
|
2857
|
+
args.push(`--registry=${this.config.npmRegistry}`);
|
|
2858
|
+
}
|
|
2859
|
+
const npmRunPath = require2("npm-run-path");
|
|
2860
|
+
const options = {
|
|
2861
|
+
...opts,
|
|
2862
|
+
cwd,
|
|
2863
|
+
env: npmRunPath.env({ cwd, env: process.env }),
|
|
2864
|
+
// The ts-node/esm loader isn't need to execute yarn commands anyways.
|
|
2865
|
+
execArgv: process.execArgv.join(" ").replace("--loader ts-node/esm", "").replace("--loader=ts-node/esm", "").split(" ").filter(Boolean),
|
|
2866
|
+
stdio: [0, null, null, "ipc"]
|
|
2867
|
+
};
|
|
2868
|
+
if (verbose) {
|
|
2869
|
+
process.stderr.write(`${cwd}: ${bin} ${args.join(" ")}`);
|
|
2870
|
+
}
|
|
2871
|
+
debug(`${cwd}: ${bin} ${args.join(" ")}`);
|
|
2872
|
+
try {
|
|
2873
|
+
await this.fork(bin, args, options);
|
|
2874
|
+
debug("yarn done");
|
|
2875
|
+
} catch (error) {
|
|
2876
|
+
const { message } = error;
|
|
2877
|
+
debug("yarn error", error);
|
|
2878
|
+
const networkConcurrency = "--network-concurrency=1";
|
|
2879
|
+
if (message.includes("EAI_AGAIN") && !args.includes(networkConcurrency)) {
|
|
2880
|
+
debug("EAI_AGAIN");
|
|
2881
|
+
return this.exec([...args, networkConcurrency], opts);
|
|
2882
|
+
}
|
|
2883
|
+
throw error;
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
fork(modulePath, args = [], options) {
|
|
2887
|
+
const cache = YarnMessagesCache.getInstance();
|
|
2888
|
+
return new Promise((resolve2, reject) => {
|
|
2889
|
+
const forked = fork(modulePath, args, {
|
|
2890
|
+
...options,
|
|
2891
|
+
env: {
|
|
2892
|
+
...process.env,
|
|
2893
|
+
// Disable husky hooks because a plugin might be trying to install them, which will
|
|
2894
|
+
// break the install since the install location isn't a .git directory.
|
|
2895
|
+
HUSKY: "0",
|
|
2896
|
+
// YARN_IGNORE_PATH=1 prevents yarn from resolving to the globally configured yarn binary.
|
|
2897
|
+
// In other words, it ensures that it resolves to the yarn binary that is available in the node_modules directory.
|
|
2898
|
+
YARN_IGNORE_PATH: "1"
|
|
2899
|
+
}
|
|
2900
|
+
});
|
|
2901
|
+
forked.stderr?.on("data", (d) => {
|
|
2902
|
+
if (!options.silent) {
|
|
2903
|
+
const str = d.toString();
|
|
2904
|
+
if (str.startsWith("error"))
|
|
2905
|
+
cache.addErrors(str);
|
|
2906
|
+
else
|
|
2907
|
+
cache.addWarnings(...str.split("\n").map((i) => i.trim().replace(/^warning/, "").trim()).filter(Boolean));
|
|
2908
|
+
}
|
|
2909
|
+
});
|
|
2910
|
+
forked.stdout?.setEncoding("utf8");
|
|
2911
|
+
forked.stdout?.on("data", (d) => {
|
|
2912
|
+
if (options.verbose)
|
|
2913
|
+
process.stdout.write(d);
|
|
2914
|
+
else if (!options.noSpinner)
|
|
2915
|
+
import_core2.ux.action.status = d.replace(/\n$/, "").split("\n").pop();
|
|
2916
|
+
});
|
|
2917
|
+
forked.on("error", reject);
|
|
2918
|
+
forked.on("exit", (code) => {
|
|
2919
|
+
if (code === 0) {
|
|
2920
|
+
resolve2();
|
|
2921
|
+
} else {
|
|
2922
|
+
reject(new Error(`${modulePath} ${args.join(" ")} exited with code ${code}`));
|
|
2923
|
+
}
|
|
2924
|
+
});
|
|
2925
|
+
});
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
|
|
2929
|
+
// node_modules/@oclif/plugin-plugins/lib/plugins.js
|
|
2930
|
+
var initPJSON = {
|
|
2931
|
+
dependencies: {},
|
|
2932
|
+
oclif: { plugins: [], schema: 1 },
|
|
2933
|
+
private: true
|
|
2934
|
+
};
|
|
2935
|
+
async function fileExists(filePath) {
|
|
2936
|
+
try {
|
|
2937
|
+
await access(filePath);
|
|
2938
|
+
return true;
|
|
2939
|
+
} catch {
|
|
2940
|
+
return false;
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
var Plugins = class {
|
|
2944
|
+
config;
|
|
2945
|
+
silent = false;
|
|
2946
|
+
verbose = false;
|
|
2947
|
+
yarn;
|
|
2948
|
+
debug;
|
|
2949
|
+
constructor(config) {
|
|
2950
|
+
this.config = config;
|
|
2951
|
+
this.yarn = new Yarn({ config });
|
|
2952
|
+
this.debug = (0, import_debug2.default)("@oclif/plugins");
|
|
2953
|
+
}
|
|
2954
|
+
async add(...plugins) {
|
|
2955
|
+
const pjson = await this.pjson();
|
|
2956
|
+
await this.savePJSON({
|
|
2957
|
+
...pjson,
|
|
2958
|
+
oclif: {
|
|
2959
|
+
...pjson.oclif,
|
|
2960
|
+
plugins: uniq([...pjson.oclif.plugins || [], ...plugins])
|
|
2961
|
+
}
|
|
2962
|
+
});
|
|
2963
|
+
}
|
|
2964
|
+
friendlyName(name) {
|
|
2965
|
+
const { pluginPrefix, scope } = this.config.pjson.oclif;
|
|
2966
|
+
if (!scope)
|
|
2967
|
+
return name;
|
|
2968
|
+
const match = name.match(`@${scope}/${pluginPrefix ?? "plugin"}-(.+)`);
|
|
2969
|
+
return match?.[1] ?? name;
|
|
2970
|
+
}
|
|
2971
|
+
async hasPlugin(name) {
|
|
2972
|
+
const list = await this.list();
|
|
2973
|
+
return list.find((p) => this.friendlyName(p.name) === this.friendlyName(name)) ?? // friendly
|
|
2974
|
+
list.find((p) => this.unfriendlyName(p.name) === this.unfriendlyName(name)) ?? // unfriendly
|
|
2975
|
+
list.find((p) => p.type === "link" && resolve(p.root) === resolve(name)) ?? // link
|
|
2976
|
+
false;
|
|
2977
|
+
}
|
|
2978
|
+
async install(name, { force = false, tag = "latest" } = {}) {
|
|
2979
|
+
try {
|
|
2980
|
+
this.debug(`installing plugin ${name}`);
|
|
2981
|
+
const yarnOpts = { cwd: this.config.dataDir, silent: this.silent, verbose: this.verbose };
|
|
2982
|
+
await this.createPJSON();
|
|
2983
|
+
let plugin;
|
|
2984
|
+
const add = force ? ["add", "--force"] : ["add"];
|
|
2985
|
+
if (name.includes(":")) {
|
|
2986
|
+
const url = name;
|
|
2987
|
+
await this.yarn.exec([...add, url], yarnOpts);
|
|
2988
|
+
const { dependencies } = await this.pjson();
|
|
2989
|
+
name = Object.entries(dependencies ?? {}).find(([, u]) => u === url)[0];
|
|
2990
|
+
const root = join3(this.config.dataDir, "node_modules", name);
|
|
2991
|
+
plugin = await import_core3.Config.load({
|
|
2992
|
+
devPlugins: false,
|
|
2993
|
+
name,
|
|
2994
|
+
root,
|
|
2995
|
+
userPlugins: false
|
|
2996
|
+
});
|
|
2997
|
+
await this.refresh({ all: true, prod: true }, plugin.root);
|
|
2998
|
+
this.isValidPlugin(plugin);
|
|
2999
|
+
await this.add({ name, type: "user", url });
|
|
3000
|
+
if (plugin.getPluginsList().find((p) => p.root === root)?.moduleType === "module" && await fileExists(join3(plugin.root, "tsconfig.json"))) {
|
|
3001
|
+
try {
|
|
3002
|
+
await this.yarn.exec(["run", "tsc"], { ...yarnOpts, cwd: plugin.root });
|
|
3003
|
+
} catch (error) {
|
|
3004
|
+
this.debug(error);
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
} else {
|
|
3008
|
+
const range = (0, import_semver.validRange)(tag);
|
|
3009
|
+
const unfriendly = this.unfriendlyName(name);
|
|
3010
|
+
if (unfriendly && await this.npmHasPackage(unfriendly)) {
|
|
3011
|
+
name = unfriendly;
|
|
3012
|
+
}
|
|
3013
|
+
await this.npmHasPackage(name, true);
|
|
3014
|
+
await this.yarn.exec([...add, `${name}@${tag}`], yarnOpts);
|
|
3015
|
+
this.debug(`loading plugin ${name}...`);
|
|
3016
|
+
plugin = await import_core3.Config.load({
|
|
3017
|
+
devPlugins: false,
|
|
3018
|
+
name,
|
|
3019
|
+
root: join3(this.config.dataDir, "node_modules", name),
|
|
3020
|
+
userPlugins: false
|
|
3021
|
+
});
|
|
3022
|
+
this.debug(`finished loading plugin ${name} at root ${plugin.root}`);
|
|
3023
|
+
this.isValidPlugin(plugin);
|
|
3024
|
+
await this.refresh({ all: true, prod: true }, plugin.root);
|
|
3025
|
+
await this.add({ name, tag: range || tag, type: "user" });
|
|
3026
|
+
}
|
|
3027
|
+
return plugin;
|
|
3028
|
+
} catch (error) {
|
|
3029
|
+
this.debug("error installing plugin:", error);
|
|
3030
|
+
await this.uninstall(name).catch((error2) => this.debug(error2));
|
|
3031
|
+
if (String(error).includes("EACCES")) {
|
|
3032
|
+
throw new import_core3.Errors.CLIError(error, {
|
|
3033
|
+
suggestions: [
|
|
3034
|
+
`Plugin failed to install because of a permissions error.
|
|
3035
|
+
Does your current user own the directory ${this.config.dataDir}?`
|
|
3036
|
+
]
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
throw error;
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
async link(p, { install }) {
|
|
3043
|
+
const c = await import_core3.Config.load(resolve(p));
|
|
3044
|
+
this.isValidPlugin(c);
|
|
3045
|
+
if (install)
|
|
3046
|
+
await this.refresh({ all: false, prod: false }, c.root);
|
|
3047
|
+
await this.add({ name: c.name, root: c.root, type: "link" });
|
|
3048
|
+
return c;
|
|
3049
|
+
}
|
|
3050
|
+
async list() {
|
|
3051
|
+
const pjson = await this.pjson();
|
|
3052
|
+
return pjson.oclif.plugins;
|
|
3053
|
+
}
|
|
3054
|
+
async maybeUnfriendlyName(name) {
|
|
3055
|
+
const unfriendly = this.unfriendlyName(name);
|
|
3056
|
+
this.debug(`checking registry for expanded package name ${unfriendly}`);
|
|
3057
|
+
if (unfriendly && await this.npmHasPackage(unfriendly)) {
|
|
3058
|
+
return unfriendly;
|
|
3059
|
+
}
|
|
3060
|
+
this.debug(`expanded package name ${unfriendly} not found, using given package name ${name}`);
|
|
3061
|
+
return name;
|
|
3062
|
+
}
|
|
3063
|
+
async pjson() {
|
|
3064
|
+
const pjson = await this.readPJSON();
|
|
3065
|
+
const plugins = pjson ? this.normalizePlugins(pjson.oclif.plugins) : [];
|
|
3066
|
+
return {
|
|
3067
|
+
...initPJSON,
|
|
3068
|
+
...pjson,
|
|
3069
|
+
oclif: {
|
|
3070
|
+
...initPJSON.oclif,
|
|
3071
|
+
...pjson?.oclif,
|
|
3072
|
+
plugins
|
|
3073
|
+
}
|
|
3074
|
+
};
|
|
3075
|
+
}
|
|
3076
|
+
/**
|
|
3077
|
+
* If a yarn.lock or oclif.lock exists at the root, refresh dependencies by
|
|
3078
|
+
* rerunning yarn. If options.prod is true, only install production dependencies.
|
|
3079
|
+
*
|
|
3080
|
+
* As of v9 npm will always ignore the yarn.lock during `npm pack`]
|
|
3081
|
+
* (see https://github.com/npm/cli/issues/6738). To get around this plugins can
|
|
3082
|
+
* rename yarn.lock to oclif.lock before running `npm pack` using `oclif lock`.
|
|
3083
|
+
*
|
|
3084
|
+
* We still check for the existence of yarn.lock since it could be included if a plugin was
|
|
3085
|
+
* packed using yarn or v8 of npm. Plugins installed directly from a git url will also
|
|
3086
|
+
* have a yarn.lock.
|
|
3087
|
+
*
|
|
3088
|
+
* @param options {prod: boolean, all: boolean}
|
|
3089
|
+
* @param roots string[]
|
|
3090
|
+
* @returns Promise<void>
|
|
3091
|
+
*/
|
|
3092
|
+
async refresh(options, ...roots) {
|
|
3093
|
+
import_core3.ux.action.status = "Refreshing user plugins...";
|
|
3094
|
+
const doRefresh = async (root) => {
|
|
3095
|
+
await this.yarn.exec(options.prod ? ["--prod"] : [], {
|
|
3096
|
+
cwd: root,
|
|
3097
|
+
noSpinner: true,
|
|
3098
|
+
silent: true,
|
|
3099
|
+
verbose: false
|
|
3100
|
+
});
|
|
3101
|
+
};
|
|
3102
|
+
const pluginRoots = [...roots];
|
|
3103
|
+
if (options.all) {
|
|
3104
|
+
const userPluginsRoots = this.config.getPluginsList().filter((p) => p.type === "user").map((p) => p.root);
|
|
3105
|
+
pluginRoots.push(...userPluginsRoots);
|
|
3106
|
+
}
|
|
3107
|
+
const deduped = [...new Set(pluginRoots)];
|
|
3108
|
+
await Promise.all(deduped.map(async (r) => {
|
|
3109
|
+
if (await fileExists(join3(r, "yarn.lock"))) {
|
|
3110
|
+
this.debug(`yarn.lock exists at ${r}. Installing prod dependencies`);
|
|
3111
|
+
await doRefresh(r);
|
|
3112
|
+
} else if (await fileExists(join3(r, "oclif.lock"))) {
|
|
3113
|
+
this.debug(`oclif.lock exists at ${r}. Installing prod dependencies`);
|
|
3114
|
+
await rename(join3(r, "oclif.lock"), join3(r, "yarn.lock"));
|
|
3115
|
+
await doRefresh(r);
|
|
3116
|
+
} else {
|
|
3117
|
+
this.debug(`no yarn.lock or oclif.lock exists at ${r}. Skipping dependency refresh`);
|
|
3118
|
+
}
|
|
3119
|
+
}));
|
|
3120
|
+
}
|
|
3121
|
+
async remove(name) {
|
|
3122
|
+
const pjson = await this.pjson();
|
|
3123
|
+
if (pjson.dependencies)
|
|
3124
|
+
delete pjson.dependencies[name];
|
|
3125
|
+
await this.savePJSON({
|
|
3126
|
+
...pjson,
|
|
3127
|
+
oclif: {
|
|
3128
|
+
...pjson.oclif,
|
|
3129
|
+
plugins: pjson.oclif.plugins.filter((p) => p.name !== name)
|
|
3130
|
+
}
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
unfriendlyName(name) {
|
|
3134
|
+
if (name.includes("@"))
|
|
3135
|
+
return;
|
|
3136
|
+
const { pluginPrefix, scope } = this.config.pjson.oclif;
|
|
3137
|
+
if (!scope)
|
|
3138
|
+
return;
|
|
3139
|
+
return `@${scope}/${pluginPrefix ?? "plugin"}-${name}`;
|
|
3140
|
+
}
|
|
3141
|
+
async uninstall(name) {
|
|
3142
|
+
try {
|
|
3143
|
+
const pjson = await this.pjson();
|
|
3144
|
+
if ((pjson.oclif.plugins ?? []).some((p) => typeof p === "object" && p.type === "user" && p.name === name)) {
|
|
3145
|
+
await this.yarn.exec(["remove", name], {
|
|
3146
|
+
cwd: this.config.dataDir,
|
|
3147
|
+
silent: this.silent,
|
|
3148
|
+
verbose: this.verbose
|
|
3149
|
+
});
|
|
3150
|
+
}
|
|
3151
|
+
} catch (error) {
|
|
3152
|
+
import_core3.ux.warn(error);
|
|
3153
|
+
} finally {
|
|
3154
|
+
await this.remove(name);
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
async update() {
|
|
3158
|
+
let plugins = (await this.list()).filter((p) => p.type === "user");
|
|
3159
|
+
if (plugins.length === 0)
|
|
3160
|
+
return;
|
|
3161
|
+
const aliases = this.config.pjson.oclif.aliases || {};
|
|
3162
|
+
for (const [name, to] of Object.entries(aliases)) {
|
|
3163
|
+
const plugin = plugins.find((p) => p.name === name);
|
|
3164
|
+
if (!plugin)
|
|
3165
|
+
continue;
|
|
3166
|
+
if (to)
|
|
3167
|
+
await this.install(to);
|
|
3168
|
+
await this.uninstall(name);
|
|
3169
|
+
plugins = plugins.filter((p) => p.name !== name);
|
|
3170
|
+
}
|
|
3171
|
+
if (plugins.some((p) => Boolean(p.url))) {
|
|
3172
|
+
await this.yarn.exec(["upgrade"], {
|
|
3173
|
+
cwd: this.config.dataDir,
|
|
3174
|
+
silent: this.silent,
|
|
3175
|
+
verbose: this.verbose
|
|
3176
|
+
});
|
|
3177
|
+
}
|
|
3178
|
+
const npmPlugins = plugins.filter((p) => !p.url);
|
|
3179
|
+
const jitPlugins = this.config.pjson.oclif.jitPlugins ?? {};
|
|
3180
|
+
const modifiedPlugins = [];
|
|
3181
|
+
if (npmPlugins.length > 0) {
|
|
3182
|
+
await this.yarn.exec([
|
|
3183
|
+
"add",
|
|
3184
|
+
...npmPlugins.map((p) => {
|
|
3185
|
+
if (!(0, import_semver.valid)(p.tag))
|
|
3186
|
+
return `${p.name}@${p.tag}`;
|
|
3187
|
+
if (p.tag && (0, import_semver.valid)(p.tag) && jitPlugins[p.name] && (0, import_semver.gt)(p.tag, jitPlugins[p.name])) {
|
|
3188
|
+
return `${p.name}@${p.tag}`;
|
|
3189
|
+
}
|
|
3190
|
+
const tag = jitPlugins[p.name] ?? p.tag;
|
|
3191
|
+
modifiedPlugins.push({ ...p, tag });
|
|
3192
|
+
return `${p.name}@${tag}`;
|
|
3193
|
+
})
|
|
3194
|
+
], { cwd: this.config.dataDir, silent: this.silent, verbose: this.verbose });
|
|
3195
|
+
}
|
|
3196
|
+
await this.refresh({ all: true, prod: true });
|
|
3197
|
+
await this.add(...modifiedPlugins);
|
|
3198
|
+
}
|
|
3199
|
+
async createPJSON() {
|
|
3200
|
+
if (!await fileExists(this.pjsonPath)) {
|
|
3201
|
+
this.debug(`creating ${this.pjsonPath} with pjson: ${JSON.stringify(initPJSON, null, 2)}`);
|
|
3202
|
+
await this.savePJSON(initPJSON);
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
isValidPlugin(p) {
|
|
3206
|
+
if (p.valid)
|
|
3207
|
+
return true;
|
|
3208
|
+
if (this.config.plugins.get("@oclif/plugin-legacy") || // @ts-expect-error because _base is private
|
|
3209
|
+
p._base.includes("@oclif/plugin-legacy")) {
|
|
3210
|
+
return true;
|
|
3211
|
+
}
|
|
3212
|
+
throw new import_core3.Errors.CLIError("plugin is invalid", {
|
|
3213
|
+
suggestions: [
|
|
3214
|
+
"Plugin failed to install because it does not appear to be a valid CLI plugin.\nIf you are sure it is, contact the CLI developer noting this error."
|
|
3215
|
+
]
|
|
3216
|
+
});
|
|
3217
|
+
}
|
|
3218
|
+
normalizePlugins(input) {
|
|
3219
|
+
const plugins = (input ?? []).map((p) => {
|
|
3220
|
+
if (typeof p === "string") {
|
|
3221
|
+
return {
|
|
3222
|
+
name: p,
|
|
3223
|
+
tag: "latest",
|
|
3224
|
+
type: "user"
|
|
3225
|
+
};
|
|
3226
|
+
}
|
|
3227
|
+
return p;
|
|
3228
|
+
});
|
|
3229
|
+
return uniqWith(
|
|
3230
|
+
plugins,
|
|
3231
|
+
// @ts-expect-error because typescript doesn't think it's possible for a plugin to have the `link` type here
|
|
3232
|
+
(a, b) => a.name === b.name || a.type === "link" && b.type === "link" && a.root === b.root
|
|
3233
|
+
);
|
|
3234
|
+
}
|
|
3235
|
+
async npmHasPackage(name, throwOnNotFound = false) {
|
|
3236
|
+
const nodeExecutable = await findNode(this.config.root);
|
|
3237
|
+
const npmCli = await findNpm();
|
|
3238
|
+
this.debug(`Using node executable located at: ${nodeExecutable}`);
|
|
3239
|
+
this.debug(`Using npm executable located at: ${npmCli}`);
|
|
3240
|
+
const registry = this.config.scopedEnvVar("NPM_REGISTRY");
|
|
3241
|
+
const registryFlag = registry ? `--registry=${registry}` : "";
|
|
3242
|
+
const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags ${registryFlag}`;
|
|
3243
|
+
let npmShowResult;
|
|
3244
|
+
try {
|
|
3245
|
+
const { default: shelljs } = await import("./shell-FHVZNOYW.js");
|
|
3246
|
+
npmShowResult = shelljs.exec(command, { silent: true });
|
|
3247
|
+
} catch {
|
|
3248
|
+
throw new import_core3.Errors.CLIError(`Could not run npm show for ${name}`);
|
|
3249
|
+
}
|
|
3250
|
+
if (npmShowResult?.code !== 0) {
|
|
3251
|
+
this.debug(npmShowResult?.stderr);
|
|
3252
|
+
if (throwOnNotFound)
|
|
3253
|
+
throw new import_core3.Errors.CLIError(`${name} does not exist in the registry.`);
|
|
3254
|
+
return false;
|
|
3255
|
+
}
|
|
3256
|
+
this.debug(`Found ${name} in the registry.`);
|
|
3257
|
+
return true;
|
|
3258
|
+
}
|
|
3259
|
+
get pjsonPath() {
|
|
3260
|
+
return join3(this.config.dataDir, "package.json");
|
|
3261
|
+
}
|
|
3262
|
+
async readPJSON() {
|
|
3263
|
+
try {
|
|
3264
|
+
return JSON.parse(await readFile2(this.pjsonPath, "utf8"));
|
|
3265
|
+
} catch (error) {
|
|
3266
|
+
this.debug(error);
|
|
3267
|
+
const err = error;
|
|
3268
|
+
if (err.code !== "ENOENT")
|
|
3269
|
+
process.emitWarning(err);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
async savePJSON(pjson) {
|
|
3273
|
+
this.debug(`saving pjson at ${this.pjsonPath}`, JSON.stringify(pjson, null, 2));
|
|
3274
|
+
await mkdir(dirname(this.pjsonPath), { recursive: true });
|
|
3275
|
+
await writeFile(this.pjsonPath, JSON.stringify(pjson, null, 2));
|
|
3276
|
+
}
|
|
3277
|
+
};
|
|
3278
|
+
|
|
3279
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
|
|
3280
|
+
init_cjs_shims();
|
|
3281
|
+
var import_core4 = __toESM(require_lib(), 1);
|
|
3282
|
+
|
|
3283
|
+
// node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
|
|
3284
|
+
init_cjs_shims();
|
|
3285
|
+
|
|
3286
|
+
// node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
3287
|
+
init_cjs_shims();
|
|
3288
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
3289
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
3290
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
3291
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
3292
|
+
var styles = {
|
|
3293
|
+
modifier: {
|
|
3294
|
+
reset: [0, 0],
|
|
3295
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
3296
|
+
bold: [1, 22],
|
|
3297
|
+
dim: [2, 22],
|
|
3298
|
+
italic: [3, 23],
|
|
3299
|
+
underline: [4, 24],
|
|
3300
|
+
overline: [53, 55],
|
|
3301
|
+
inverse: [7, 27],
|
|
3302
|
+
hidden: [8, 28],
|
|
3303
|
+
strikethrough: [9, 29]
|
|
3304
|
+
},
|
|
3305
|
+
color: {
|
|
3306
|
+
black: [30, 39],
|
|
3307
|
+
red: [31, 39],
|
|
3308
|
+
green: [32, 39],
|
|
3309
|
+
yellow: [33, 39],
|
|
3310
|
+
blue: [34, 39],
|
|
3311
|
+
magenta: [35, 39],
|
|
3312
|
+
cyan: [36, 39],
|
|
3313
|
+
white: [37, 39],
|
|
3314
|
+
// Bright color
|
|
3315
|
+
blackBright: [90, 39],
|
|
3316
|
+
gray: [90, 39],
|
|
3317
|
+
// Alias of `blackBright`
|
|
3318
|
+
grey: [90, 39],
|
|
3319
|
+
// Alias of `blackBright`
|
|
3320
|
+
redBright: [91, 39],
|
|
3321
|
+
greenBright: [92, 39],
|
|
3322
|
+
yellowBright: [93, 39],
|
|
3323
|
+
blueBright: [94, 39],
|
|
3324
|
+
magentaBright: [95, 39],
|
|
3325
|
+
cyanBright: [96, 39],
|
|
3326
|
+
whiteBright: [97, 39]
|
|
3327
|
+
},
|
|
3328
|
+
bgColor: {
|
|
3329
|
+
bgBlack: [40, 49],
|
|
3330
|
+
bgRed: [41, 49],
|
|
3331
|
+
bgGreen: [42, 49],
|
|
3332
|
+
bgYellow: [43, 49],
|
|
3333
|
+
bgBlue: [44, 49],
|
|
3334
|
+
bgMagenta: [45, 49],
|
|
3335
|
+
bgCyan: [46, 49],
|
|
3336
|
+
bgWhite: [47, 49],
|
|
3337
|
+
// Bright color
|
|
3338
|
+
bgBlackBright: [100, 49],
|
|
3339
|
+
bgGray: [100, 49],
|
|
3340
|
+
// Alias of `bgBlackBright`
|
|
3341
|
+
bgGrey: [100, 49],
|
|
3342
|
+
// Alias of `bgBlackBright`
|
|
3343
|
+
bgRedBright: [101, 49],
|
|
3344
|
+
bgGreenBright: [102, 49],
|
|
3345
|
+
bgYellowBright: [103, 49],
|
|
3346
|
+
bgBlueBright: [104, 49],
|
|
3347
|
+
bgMagentaBright: [105, 49],
|
|
3348
|
+
bgCyanBright: [106, 49],
|
|
3349
|
+
bgWhiteBright: [107, 49]
|
|
3350
|
+
}
|
|
3351
|
+
};
|
|
3352
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
3353
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
3354
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
3355
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
3356
|
+
function assembleStyles() {
|
|
3357
|
+
const codes = /* @__PURE__ */ new Map();
|
|
3358
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
3359
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
3360
|
+
styles[styleName] = {
|
|
3361
|
+
open: `\x1B[${style[0]}m`,
|
|
3362
|
+
close: `\x1B[${style[1]}m`
|
|
3363
|
+
};
|
|
3364
|
+
group[styleName] = styles[styleName];
|
|
3365
|
+
codes.set(style[0], style[1]);
|
|
3366
|
+
}
|
|
3367
|
+
Object.defineProperty(styles, groupName, {
|
|
3368
|
+
value: group,
|
|
3369
|
+
enumerable: false
|
|
3370
|
+
});
|
|
3371
|
+
}
|
|
3372
|
+
Object.defineProperty(styles, "codes", {
|
|
3373
|
+
value: codes,
|
|
3374
|
+
enumerable: false
|
|
3375
|
+
});
|
|
3376
|
+
styles.color.close = "\x1B[39m";
|
|
3377
|
+
styles.bgColor.close = "\x1B[49m";
|
|
3378
|
+
styles.color.ansi = wrapAnsi16();
|
|
3379
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
3380
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
3381
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
3382
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
3383
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
3384
|
+
Object.defineProperties(styles, {
|
|
3385
|
+
rgbToAnsi256: {
|
|
3386
|
+
value(red, green, blue) {
|
|
3387
|
+
if (red === green && green === blue) {
|
|
3388
|
+
if (red < 8) {
|
|
3389
|
+
return 16;
|
|
3390
|
+
}
|
|
3391
|
+
if (red > 248) {
|
|
3392
|
+
return 231;
|
|
3393
|
+
}
|
|
3394
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
3395
|
+
}
|
|
3396
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
3397
|
+
},
|
|
3398
|
+
enumerable: false
|
|
3399
|
+
},
|
|
3400
|
+
hexToRgb: {
|
|
3401
|
+
value(hex) {
|
|
3402
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
3403
|
+
if (!matches) {
|
|
3404
|
+
return [0, 0, 0];
|
|
3405
|
+
}
|
|
3406
|
+
let [colorString] = matches;
|
|
3407
|
+
if (colorString.length === 3) {
|
|
3408
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
3409
|
+
}
|
|
3410
|
+
const integer = Number.parseInt(colorString, 16);
|
|
3411
|
+
return [
|
|
3412
|
+
/* eslint-disable no-bitwise */
|
|
3413
|
+
integer >> 16 & 255,
|
|
3414
|
+
integer >> 8 & 255,
|
|
3415
|
+
integer & 255
|
|
3416
|
+
/* eslint-enable no-bitwise */
|
|
3417
|
+
];
|
|
3418
|
+
},
|
|
3419
|
+
enumerable: false
|
|
3420
|
+
},
|
|
3421
|
+
hexToAnsi256: {
|
|
3422
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
3423
|
+
enumerable: false
|
|
3424
|
+
},
|
|
3425
|
+
ansi256ToAnsi: {
|
|
3426
|
+
value(code) {
|
|
3427
|
+
if (code < 8) {
|
|
3428
|
+
return 30 + code;
|
|
3429
|
+
}
|
|
3430
|
+
if (code < 16) {
|
|
3431
|
+
return 90 + (code - 8);
|
|
3432
|
+
}
|
|
3433
|
+
let red;
|
|
3434
|
+
let green;
|
|
3435
|
+
let blue;
|
|
3436
|
+
if (code >= 232) {
|
|
3437
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
3438
|
+
green = red;
|
|
3439
|
+
blue = red;
|
|
3440
|
+
} else {
|
|
3441
|
+
code -= 16;
|
|
3442
|
+
const remainder = code % 36;
|
|
3443
|
+
red = Math.floor(code / 36) / 5;
|
|
3444
|
+
green = Math.floor(remainder / 6) / 5;
|
|
3445
|
+
blue = remainder % 6 / 5;
|
|
3446
|
+
}
|
|
3447
|
+
const value = Math.max(red, green, blue) * 2;
|
|
3448
|
+
if (value === 0) {
|
|
3449
|
+
return 30;
|
|
3450
|
+
}
|
|
3451
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
3452
|
+
if (value === 2) {
|
|
3453
|
+
result += 60;
|
|
3454
|
+
}
|
|
3455
|
+
return result;
|
|
3456
|
+
},
|
|
3457
|
+
enumerable: false
|
|
3458
|
+
},
|
|
3459
|
+
rgbToAnsi: {
|
|
3460
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
3461
|
+
enumerable: false
|
|
3462
|
+
},
|
|
3463
|
+
hexToAnsi: {
|
|
3464
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
3465
|
+
enumerable: false
|
|
3466
|
+
}
|
|
3467
|
+
});
|
|
3468
|
+
return styles;
|
|
3469
|
+
}
|
|
3470
|
+
var ansiStyles = assembleStyles();
|
|
3471
|
+
var ansi_styles_default = ansiStyles;
|
|
3472
|
+
|
|
3473
|
+
// node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/supports-color/index.js
|
|
3474
|
+
init_cjs_shims();
|
|
3475
|
+
import process2 from "node:process";
|
|
3476
|
+
import os from "node:os";
|
|
3477
|
+
import tty from "node:tty";
|
|
3478
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
3479
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
3480
|
+
const position = argv.indexOf(prefix + flag);
|
|
3481
|
+
const terminatorPosition = argv.indexOf("--");
|
|
3482
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
3483
|
+
}
|
|
3484
|
+
var { env } = process2;
|
|
3485
|
+
var flagForceColor;
|
|
3486
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
3487
|
+
flagForceColor = 0;
|
|
3488
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
3489
|
+
flagForceColor = 1;
|
|
3490
|
+
}
|
|
3491
|
+
function envForceColor() {
|
|
3492
|
+
if ("FORCE_COLOR" in env) {
|
|
3493
|
+
if (env.FORCE_COLOR === "true") {
|
|
3494
|
+
return 1;
|
|
3495
|
+
}
|
|
3496
|
+
if (env.FORCE_COLOR === "false") {
|
|
3497
|
+
return 0;
|
|
3498
|
+
}
|
|
3499
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
function translateLevel(level) {
|
|
3503
|
+
if (level === 0) {
|
|
3504
|
+
return false;
|
|
3505
|
+
}
|
|
3506
|
+
return {
|
|
3507
|
+
level,
|
|
3508
|
+
hasBasic: true,
|
|
3509
|
+
has256: level >= 2,
|
|
3510
|
+
has16m: level >= 3
|
|
3511
|
+
};
|
|
3512
|
+
}
|
|
3513
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
3514
|
+
const noFlagForceColor = envForceColor();
|
|
3515
|
+
if (noFlagForceColor !== void 0) {
|
|
3516
|
+
flagForceColor = noFlagForceColor;
|
|
3517
|
+
}
|
|
3518
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
3519
|
+
if (forceColor === 0) {
|
|
3520
|
+
return 0;
|
|
3521
|
+
}
|
|
3522
|
+
if (sniffFlags) {
|
|
3523
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
3524
|
+
return 3;
|
|
3525
|
+
}
|
|
3526
|
+
if (hasFlag("color=256")) {
|
|
3527
|
+
return 2;
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
3531
|
+
return 1;
|
|
3532
|
+
}
|
|
3533
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
3534
|
+
return 0;
|
|
3535
|
+
}
|
|
3536
|
+
const min = forceColor || 0;
|
|
3537
|
+
if (env.TERM === "dumb") {
|
|
3538
|
+
return min;
|
|
3539
|
+
}
|
|
3540
|
+
if (process2.platform === "win32") {
|
|
3541
|
+
const osRelease = os.release().split(".");
|
|
3542
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
3543
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
3544
|
+
}
|
|
3545
|
+
return 1;
|
|
3546
|
+
}
|
|
3547
|
+
if ("CI" in env) {
|
|
3548
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
3549
|
+
return 3;
|
|
3550
|
+
}
|
|
3551
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
3552
|
+
return 1;
|
|
3553
|
+
}
|
|
3554
|
+
return min;
|
|
3555
|
+
}
|
|
3556
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
3557
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
3558
|
+
}
|
|
3559
|
+
if (env.COLORTERM === "truecolor") {
|
|
3560
|
+
return 3;
|
|
3561
|
+
}
|
|
3562
|
+
if (env.TERM === "xterm-kitty") {
|
|
3563
|
+
return 3;
|
|
3564
|
+
}
|
|
3565
|
+
if ("TERM_PROGRAM" in env) {
|
|
3566
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
3567
|
+
switch (env.TERM_PROGRAM) {
|
|
3568
|
+
case "iTerm.app": {
|
|
3569
|
+
return version >= 3 ? 3 : 2;
|
|
3570
|
+
}
|
|
3571
|
+
case "Apple_Terminal": {
|
|
3572
|
+
return 2;
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
3577
|
+
return 2;
|
|
3578
|
+
}
|
|
3579
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
3580
|
+
return 1;
|
|
3581
|
+
}
|
|
3582
|
+
if ("COLORTERM" in env) {
|
|
3583
|
+
return 1;
|
|
3584
|
+
}
|
|
3585
|
+
return min;
|
|
3586
|
+
}
|
|
3587
|
+
function createSupportsColor(stream, options = {}) {
|
|
3588
|
+
const level = _supportsColor(stream, {
|
|
3589
|
+
streamIsTTY: stream && stream.isTTY,
|
|
3590
|
+
...options
|
|
3591
|
+
});
|
|
3592
|
+
return translateLevel(level);
|
|
3593
|
+
}
|
|
3594
|
+
var supportsColor = {
|
|
3595
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
3596
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
3597
|
+
};
|
|
3598
|
+
var supports_color_default = supportsColor;
|
|
3599
|
+
|
|
3600
|
+
// node_modules/@oclif/plugin-plugins/node_modules/chalk/source/utilities.js
|
|
3601
|
+
init_cjs_shims();
|
|
3602
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
3603
|
+
let index = string.indexOf(substring);
|
|
3604
|
+
if (index === -1) {
|
|
3605
|
+
return string;
|
|
3606
|
+
}
|
|
3607
|
+
const substringLength = substring.length;
|
|
3608
|
+
let endIndex = 0;
|
|
3609
|
+
let returnValue = "";
|
|
3610
|
+
do {
|
|
3611
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
3612
|
+
endIndex = index + substringLength;
|
|
3613
|
+
index = string.indexOf(substring, endIndex);
|
|
3614
|
+
} while (index !== -1);
|
|
3615
|
+
returnValue += string.slice(endIndex);
|
|
3616
|
+
return returnValue;
|
|
3617
|
+
}
|
|
3618
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
3619
|
+
let endIndex = 0;
|
|
3620
|
+
let returnValue = "";
|
|
3621
|
+
do {
|
|
3622
|
+
const gotCR = string[index - 1] === "\r";
|
|
3623
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
3624
|
+
endIndex = index + 1;
|
|
3625
|
+
index = string.indexOf("\n", endIndex);
|
|
3626
|
+
} while (index !== -1);
|
|
3627
|
+
returnValue += string.slice(endIndex);
|
|
3628
|
+
return returnValue;
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
// node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
|
|
3632
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
3633
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
3634
|
+
var STYLER = Symbol("STYLER");
|
|
3635
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
3636
|
+
var levelMapping = [
|
|
3637
|
+
"ansi",
|
|
3638
|
+
"ansi",
|
|
3639
|
+
"ansi256",
|
|
3640
|
+
"ansi16m"
|
|
3641
|
+
];
|
|
3642
|
+
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
3643
|
+
var applyOptions = (object, options = {}) => {
|
|
3644
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
3645
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
3646
|
+
}
|
|
3647
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
3648
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
3649
|
+
};
|
|
3650
|
+
var chalkFactory = (options) => {
|
|
3651
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
3652
|
+
applyOptions(chalk2, options);
|
|
3653
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
3654
|
+
return chalk2;
|
|
3655
|
+
};
|
|
3656
|
+
function createChalk(options) {
|
|
3657
|
+
return chalkFactory(options);
|
|
3658
|
+
}
|
|
3659
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
3660
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
3661
|
+
styles2[styleName] = {
|
|
3662
|
+
get() {
|
|
3663
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
3664
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
3665
|
+
return builder;
|
|
3666
|
+
}
|
|
3667
|
+
};
|
|
3668
|
+
}
|
|
3669
|
+
styles2.visible = {
|
|
3670
|
+
get() {
|
|
3671
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
3672
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
3673
|
+
return builder;
|
|
3674
|
+
}
|
|
3675
|
+
};
|
|
3676
|
+
var getModelAnsi = (model, level, type2, ...arguments_) => {
|
|
3677
|
+
if (model === "rgb") {
|
|
3678
|
+
if (level === "ansi16m") {
|
|
3679
|
+
return ansi_styles_default[type2].ansi16m(...arguments_);
|
|
3680
|
+
}
|
|
3681
|
+
if (level === "ansi256") {
|
|
3682
|
+
return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
3683
|
+
}
|
|
3684
|
+
return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
3685
|
+
}
|
|
3686
|
+
if (model === "hex") {
|
|
3687
|
+
return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
3688
|
+
}
|
|
3689
|
+
return ansi_styles_default[type2][model](...arguments_);
|
|
3690
|
+
};
|
|
3691
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
3692
|
+
for (const model of usedModels) {
|
|
3693
|
+
styles2[model] = {
|
|
3694
|
+
get() {
|
|
3695
|
+
const { level } = this;
|
|
3696
|
+
return function(...arguments_) {
|
|
3697
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
3698
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
3699
|
+
};
|
|
3700
|
+
}
|
|
3701
|
+
};
|
|
3702
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
3703
|
+
styles2[bgModel] = {
|
|
3704
|
+
get() {
|
|
3705
|
+
const { level } = this;
|
|
3706
|
+
return function(...arguments_) {
|
|
3707
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
3708
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
3709
|
+
};
|
|
3710
|
+
}
|
|
3711
|
+
};
|
|
3712
|
+
}
|
|
3713
|
+
var proto = Object.defineProperties(() => {
|
|
3714
|
+
}, {
|
|
3715
|
+
...styles2,
|
|
3716
|
+
level: {
|
|
3717
|
+
enumerable: true,
|
|
3718
|
+
get() {
|
|
3719
|
+
return this[GENERATOR].level;
|
|
3720
|
+
},
|
|
3721
|
+
set(level) {
|
|
3722
|
+
this[GENERATOR].level = level;
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3725
|
+
});
|
|
3726
|
+
var createStyler = (open, close, parent) => {
|
|
3727
|
+
let openAll;
|
|
3728
|
+
let closeAll;
|
|
3729
|
+
if (parent === void 0) {
|
|
3730
|
+
openAll = open;
|
|
3731
|
+
closeAll = close;
|
|
3732
|
+
} else {
|
|
3733
|
+
openAll = parent.openAll + open;
|
|
3734
|
+
closeAll = close + parent.closeAll;
|
|
3735
|
+
}
|
|
3736
|
+
return {
|
|
3737
|
+
open,
|
|
3738
|
+
close,
|
|
3739
|
+
openAll,
|
|
3740
|
+
closeAll,
|
|
3741
|
+
parent
|
|
3742
|
+
};
|
|
3743
|
+
};
|
|
3744
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
3745
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
3746
|
+
Object.setPrototypeOf(builder, proto);
|
|
3747
|
+
builder[GENERATOR] = self;
|
|
3748
|
+
builder[STYLER] = _styler;
|
|
3749
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
3750
|
+
return builder;
|
|
3751
|
+
};
|
|
3752
|
+
var applyStyle = (self, string) => {
|
|
3753
|
+
if (self.level <= 0 || !string) {
|
|
3754
|
+
return self[IS_EMPTY] ? "" : string;
|
|
3755
|
+
}
|
|
3756
|
+
let styler = self[STYLER];
|
|
3757
|
+
if (styler === void 0) {
|
|
3758
|
+
return string;
|
|
3759
|
+
}
|
|
3760
|
+
const { openAll, closeAll } = styler;
|
|
3761
|
+
if (string.includes("\x1B")) {
|
|
3762
|
+
while (styler !== void 0) {
|
|
3763
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
3764
|
+
styler = styler.parent;
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
const lfIndex = string.indexOf("\n");
|
|
3768
|
+
if (lfIndex !== -1) {
|
|
3769
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
3770
|
+
}
|
|
3771
|
+
return openAll + string + closeAll;
|
|
3772
|
+
};
|
|
3773
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
3774
|
+
var chalk = createChalk();
|
|
3775
|
+
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
3776
|
+
var source_default = chalk;
|
|
3777
|
+
|
|
3778
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
|
|
3779
|
+
var PluginsIndex = class _PluginsIndex extends import_core4.Command {
|
|
3780
|
+
static description = "List installed plugins.";
|
|
3781
|
+
static enableJsonFlag = true;
|
|
3782
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
3783
|
+
static flags = {
|
|
3784
|
+
core: import_core4.Flags.boolean({ description: "Show core plugins." })
|
|
3785
|
+
};
|
|
3786
|
+
plugins = new Plugins(this.config);
|
|
3787
|
+
async run() {
|
|
3788
|
+
const { flags } = await this.parse(_PluginsIndex);
|
|
3789
|
+
let plugins = this.config.getPluginsList();
|
|
3790
|
+
sortBy(plugins, (p) => this.plugins.friendlyName(p.name));
|
|
3791
|
+
if (!flags.core) {
|
|
3792
|
+
plugins = plugins.filter((p) => p.type !== "core" && p.type !== "dev");
|
|
3793
|
+
}
|
|
3794
|
+
if (plugins.length === 0)
|
|
3795
|
+
this.log("No plugins installed.");
|
|
3796
|
+
const results = this.config.getPluginsList();
|
|
3797
|
+
const userAndLinkedPlugins = new Set(results.filter((p) => p.type === "user" || p.type === "link").map((p) => p.name));
|
|
3798
|
+
const jitPluginsConfig = this.config.pjson.oclif.jitPlugins ?? {};
|
|
3799
|
+
const jitPlugins = Object.entries(jitPluginsConfig).map(([name, version]) => ({ name, type: "jit", version })).filter((p) => !userAndLinkedPlugins.has(p.name));
|
|
3800
|
+
sortBy(jitPlugins, (p) => p.name);
|
|
3801
|
+
if (!this.jsonEnabled()) {
|
|
3802
|
+
this.display(plugins);
|
|
3803
|
+
this.displayJitPlugins(jitPlugins);
|
|
3804
|
+
}
|
|
3805
|
+
return [...results.filter((p) => !p.parent), ...jitPlugins];
|
|
3806
|
+
}
|
|
3807
|
+
createTree(plugin) {
|
|
3808
|
+
const tree = import_core4.ux.tree();
|
|
3809
|
+
for (const p of plugin.children) {
|
|
3810
|
+
const name = this.formatPlugin(p);
|
|
3811
|
+
tree.insert(name, this.createTree(p));
|
|
3812
|
+
}
|
|
3813
|
+
return tree;
|
|
3814
|
+
}
|
|
3815
|
+
display(plugins) {
|
|
3816
|
+
for (const plugin of plugins.filter((p) => !p.parent)) {
|
|
3817
|
+
this.log(this.formatPlugin(plugin));
|
|
3818
|
+
if (plugin.children && plugin.children.length > 0) {
|
|
3819
|
+
const tree = this.createTree(plugin);
|
|
3820
|
+
tree.display();
|
|
3821
|
+
}
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3824
|
+
displayJitPlugins(jitPlugins) {
|
|
3825
|
+
if (jitPlugins.length === 0)
|
|
3826
|
+
return;
|
|
3827
|
+
this.log(source_default.dim("\nUninstalled JIT Plugins:"));
|
|
3828
|
+
for (const { name, version } of jitPlugins) {
|
|
3829
|
+
this.log(`${this.plugins.friendlyName(name)} ${source_default.dim(version)}`);
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
formatPlugin(plugin) {
|
|
3833
|
+
let output = `${this.plugins.friendlyName(plugin.name)} ${source_default.dim(plugin.version)}`;
|
|
3834
|
+
if (plugin.type !== "user")
|
|
3835
|
+
output += source_default.dim(` (${plugin.type})`);
|
|
3836
|
+
if (plugin.type === "link")
|
|
3837
|
+
output += ` ${plugin.root}`;
|
|
3838
|
+
else if (plugin.tag && plugin.tag !== "latest")
|
|
3839
|
+
output += source_default.dim(` (${String(plugin.tag)})`);
|
|
3840
|
+
return output;
|
|
3841
|
+
}
|
|
3842
|
+
};
|
|
3843
|
+
|
|
3844
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/inspect.js
|
|
3845
|
+
init_cjs_shims();
|
|
3846
|
+
var import_core5 = __toESM(require_lib(), 1);
|
|
3847
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
3848
|
+
import { dirname as dirname2, join as join4, sep as sep2 } from "node:path";
|
|
3849
|
+
function trimUntil(fsPath, part) {
|
|
3850
|
+
const parts = fsPath.split(sep2);
|
|
3851
|
+
const indices = parts.reduce((result, current, index) => current === part ? [...result, index] : result, []);
|
|
3852
|
+
const partIndex = Math.max(...indices);
|
|
3853
|
+
if (partIndex === -1)
|
|
3854
|
+
return fsPath;
|
|
3855
|
+
return parts.slice(0, partIndex + 1).join(sep2);
|
|
3856
|
+
}
|
|
3857
|
+
var PluginsInspect = class _PluginsInspect extends import_core5.Command {
|
|
3858
|
+
static args = {
|
|
3859
|
+
plugin: import_core5.Args.string({
|
|
3860
|
+
default: ".",
|
|
3861
|
+
description: "Plugin to inspect.",
|
|
3862
|
+
required: true
|
|
3863
|
+
})
|
|
3864
|
+
};
|
|
3865
|
+
static description = "Displays installation properties of a plugin.";
|
|
3866
|
+
static enableJsonFlag = true;
|
|
3867
|
+
static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];
|
|
3868
|
+
static flags = {
|
|
3869
|
+
help: import_core5.Flags.help({ char: "h" }),
|
|
3870
|
+
verbose: import_core5.Flags.boolean({ char: "v" })
|
|
3871
|
+
};
|
|
3872
|
+
static strict = false;
|
|
3873
|
+
static usage = "plugins:inspect PLUGIN...";
|
|
3874
|
+
plugins = new Plugins(this.config);
|
|
3875
|
+
async findDep(plugin, dependency) {
|
|
3876
|
+
const dependencyPath = join4(...dependency.split("/"));
|
|
3877
|
+
let start = join4(plugin.root, "node_modules");
|
|
3878
|
+
const paths = [start];
|
|
3879
|
+
while ((start.match(/node_modules/g) ?? []).length > 1) {
|
|
3880
|
+
start = trimUntil(dirname2(start), "node_modules");
|
|
3881
|
+
paths.push(start);
|
|
3882
|
+
}
|
|
3883
|
+
for (const p of paths) {
|
|
3884
|
+
try {
|
|
3885
|
+
const fullPath = join4(p, dependencyPath);
|
|
3886
|
+
const pkgJsonPath = join4(fullPath, "package.json");
|
|
3887
|
+
const pkgJson = JSON.parse(await readFile3(pkgJsonPath, "utf8"));
|
|
3888
|
+
return { pkgPath: fullPath, version: pkgJson.version };
|
|
3889
|
+
} catch {
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
return { pkgPath: null, version: null };
|
|
3893
|
+
}
|
|
3894
|
+
findPlugin(pluginName) {
|
|
3895
|
+
const pluginConfig = this.config.getPluginsList().find((plg) => plg.name === pluginName);
|
|
3896
|
+
if (pluginConfig)
|
|
3897
|
+
return pluginConfig;
|
|
3898
|
+
if (this.config.pjson.oclif.jitPlugins?.[pluginName]) {
|
|
3899
|
+
this.warn(`Plugin ${pluginName} is a JIT plugin. It will be installed the first time you run one of it's commands.`);
|
|
3900
|
+
}
|
|
3901
|
+
throw new Error(`${pluginName} not installed`);
|
|
3902
|
+
}
|
|
3903
|
+
async inspect(pluginName, verbose = false) {
|
|
3904
|
+
const plugin = this.findPlugin(pluginName);
|
|
3905
|
+
const tree = import_core5.ux.tree();
|
|
3906
|
+
const pluginHeader = source_default.bold.cyan(plugin.name);
|
|
3907
|
+
tree.insert(pluginHeader);
|
|
3908
|
+
tree.nodes[pluginHeader].insert(`version ${plugin.version}`);
|
|
3909
|
+
if (plugin.tag)
|
|
3910
|
+
tree.nodes[pluginHeader].insert(`tag ${plugin.tag}`);
|
|
3911
|
+
if (plugin.pjson.homepage)
|
|
3912
|
+
tree.nodes[pluginHeader].insert(`homepage ${plugin.pjson.homepage}`);
|
|
3913
|
+
tree.nodes[pluginHeader].insert(`location ${plugin.root}`);
|
|
3914
|
+
tree.nodes[pluginHeader].insert("commands");
|
|
3915
|
+
const commands3 = sortBy(plugin.commandIDs, (c) => c);
|
|
3916
|
+
for (const cmd of commands3)
|
|
3917
|
+
tree.nodes[pluginHeader].nodes.commands.insert(cmd);
|
|
3918
|
+
const dependencies = { ...plugin.pjson.dependencies };
|
|
3919
|
+
tree.nodes[pluginHeader].insert("dependencies");
|
|
3920
|
+
const deps = sortBy(Object.keys(dependencies), (d) => d);
|
|
3921
|
+
const depsJson = {};
|
|
3922
|
+
for (const dep of deps) {
|
|
3923
|
+
const { pkgPath, version } = await this.findDep(plugin, dep);
|
|
3924
|
+
if (!version)
|
|
3925
|
+
continue;
|
|
3926
|
+
const from = dependencies[dep] ?? null;
|
|
3927
|
+
const versionMsg = source_default.dim(from ? `${from} => ${version}` : version);
|
|
3928
|
+
const msg = verbose ? `${dep} ${versionMsg} ${pkgPath}` : `${dep} ${versionMsg}`;
|
|
3929
|
+
tree.nodes[pluginHeader].nodes.dependencies.insert(msg);
|
|
3930
|
+
depsJson[dep] = { from, version };
|
|
3931
|
+
}
|
|
3932
|
+
if (!this.jsonEnabled())
|
|
3933
|
+
tree.display();
|
|
3934
|
+
return { ...plugin, deps: depsJson };
|
|
3935
|
+
}
|
|
3936
|
+
/* eslint-disable no-await-in-loop */
|
|
3937
|
+
async run() {
|
|
3938
|
+
const { argv, flags } = await this.parse(_PluginsInspect);
|
|
3939
|
+
if (flags.verbose)
|
|
3940
|
+
this.plugins.verbose = true;
|
|
3941
|
+
const aliases = this.config.pjson.oclif.aliases ?? {};
|
|
3942
|
+
const plugins = [];
|
|
3943
|
+
for (let name of argv) {
|
|
3944
|
+
if (name === ".") {
|
|
3945
|
+
const pkgJson = JSON.parse(await readFile3("package.json", "utf8"));
|
|
3946
|
+
name = pkgJson.name;
|
|
3947
|
+
}
|
|
3948
|
+
if (aliases[name] === null)
|
|
3949
|
+
this.error(`${name} is blocked`);
|
|
3950
|
+
name = aliases[name] ?? name;
|
|
3951
|
+
const pluginName = await this.plugins.maybeUnfriendlyName(name) ?? name;
|
|
3952
|
+
try {
|
|
3953
|
+
plugins.push(await this.inspect(pluginName, flags.verbose));
|
|
3954
|
+
} catch (error) {
|
|
3955
|
+
this.log(source_default.bold.red("failed"));
|
|
3956
|
+
throw error;
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
return plugins;
|
|
3960
|
+
}
|
|
3961
|
+
};
|
|
3962
|
+
|
|
3963
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/install.js
|
|
3964
|
+
init_cjs_shims();
|
|
3965
|
+
var import_core6 = __toESM(require_lib(), 1);
|
|
3966
|
+
var import_validate_npm_package_name = __toESM(require_lib2(), 1);
|
|
3967
|
+
var PluginsInstall = class _PluginsInstall extends import_core6.Command {
|
|
3968
|
+
static aliases = ["plugins:add"];
|
|
3969
|
+
static args = {
|
|
3970
|
+
plugin: import_core6.Args.string({ description: "Plugin to install.", required: true })
|
|
3971
|
+
};
|
|
3972
|
+
static description = `Installs a plugin into the CLI.
|
|
3973
|
+
Can be installed from npm or a git url.
|
|
3974
|
+
|
|
3975
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
3976
|
+
|
|
3977
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in the CLI without the need to patch and update the whole CLI.
|
|
3978
|
+
`;
|
|
3979
|
+
static enableJsonFlag = true;
|
|
3980
|
+
static examples = [
|
|
3981
|
+
'<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',
|
|
3982
|
+
"<%= config.bin %> <%= command.id %> https://github.com/someuser/someplugin",
|
|
3983
|
+
"<%= config.bin %> <%= command.id %> someuser/someplugin"
|
|
3984
|
+
];
|
|
3985
|
+
static flags = {
|
|
3986
|
+
force: import_core6.Flags.boolean({
|
|
3987
|
+
char: "f",
|
|
3988
|
+
description: "Run yarn install with force flag."
|
|
3989
|
+
}),
|
|
3990
|
+
help: import_core6.Flags.help({ char: "h" }),
|
|
3991
|
+
jit: import_core6.Flags.boolean({
|
|
3992
|
+
hidden: true,
|
|
3993
|
+
async parse(input, ctx) {
|
|
3994
|
+
if (input === false || input === void 0)
|
|
3995
|
+
return input;
|
|
3996
|
+
const requestedPlugins = ctx.argv.filter((a) => !a.startsWith("-"));
|
|
3997
|
+
if (requestedPlugins.length === 0)
|
|
3998
|
+
return input;
|
|
3999
|
+
const jitPluginsConfig = ctx.config.pjson.oclif.jitPlugins ?? {};
|
|
4000
|
+
if (Object.keys(jitPluginsConfig).length === 0)
|
|
4001
|
+
return input;
|
|
4002
|
+
const plugins = new Plugins(ctx.config);
|
|
4003
|
+
const nonJitPlugins = await Promise.all(requestedPlugins.map(async (plugin) => {
|
|
4004
|
+
const name = await plugins.maybeUnfriendlyName(plugin);
|
|
4005
|
+
return { jit: Boolean(jitPluginsConfig[name]), name };
|
|
4006
|
+
}));
|
|
4007
|
+
const nonJitPluginsNames = nonJitPlugins.filter((p) => !p.jit).map((p) => p.name);
|
|
4008
|
+
if (nonJitPluginsNames.length > 0) {
|
|
4009
|
+
throw new import_core6.Errors.CLIError(`The following plugins are not JIT plugins: ${nonJitPluginsNames.join(", ")}`);
|
|
4010
|
+
}
|
|
4011
|
+
return input;
|
|
4012
|
+
}
|
|
4013
|
+
}),
|
|
4014
|
+
silent: import_core6.Flags.boolean({
|
|
4015
|
+
char: "s",
|
|
4016
|
+
description: "Silences yarn output.",
|
|
4017
|
+
exclusive: ["verbose"]
|
|
4018
|
+
}),
|
|
4019
|
+
verbose: import_core6.Flags.boolean({
|
|
4020
|
+
char: "v",
|
|
4021
|
+
description: "Show verbose yarn output.",
|
|
4022
|
+
exclusive: ["silent"]
|
|
4023
|
+
})
|
|
4024
|
+
};
|
|
4025
|
+
static strict = false;
|
|
4026
|
+
static usage = "plugins:install PLUGIN...";
|
|
4027
|
+
flags;
|
|
4028
|
+
plugins = new Plugins(this.config);
|
|
4029
|
+
// In this case we want these operations to happen
|
|
4030
|
+
// sequentially so the `no-await-in-loop` rule is ignored
|
|
4031
|
+
async parsePlugin(input) {
|
|
4032
|
+
if (input.startsWith("git+ssh://") || input.endsWith(".git")) {
|
|
4033
|
+
return { type: "repo", url: input };
|
|
4034
|
+
}
|
|
4035
|
+
const getNameAndTag = async (input2) => {
|
|
4036
|
+
const regexAtSymbolNotAtBeginning = /(?<!^)@/;
|
|
4037
|
+
const [splitName, tag2 = "latest"] = input2.split(regexAtSymbolNotAtBeginning);
|
|
4038
|
+
const name2 = splitName.startsWith("@") ? splitName : await this.plugins.maybeUnfriendlyName(splitName);
|
|
4039
|
+
validateNpmPkgName(name2);
|
|
4040
|
+
if (this.flags.jit) {
|
|
4041
|
+
const jitVersion = this.config.pjson.oclif?.jitPlugins?.[name2];
|
|
4042
|
+
if (jitVersion) {
|
|
4043
|
+
if (regexAtSymbolNotAtBeginning.test(input2))
|
|
4044
|
+
this.warn(`--jit flag is present along side a tag. Ignoring tag ${tag2} and using the version specified in package.json (${jitVersion}).`);
|
|
4045
|
+
return { name: name2, tag: jitVersion };
|
|
4046
|
+
}
|
|
4047
|
+
this.warn(`--jit flag is present but ${name2} is not a JIT plugin. Installing ${tag2} instead.`);
|
|
4048
|
+
return { name: name2, tag: tag2 };
|
|
4049
|
+
}
|
|
4050
|
+
return { name: name2, tag: tag2 };
|
|
4051
|
+
};
|
|
4052
|
+
if (input.startsWith("@") && input.includes("/")) {
|
|
4053
|
+
const { name: name2, tag: tag2 } = await getNameAndTag(input);
|
|
4054
|
+
return { name: name2, tag: tag2, type: "npm" };
|
|
4055
|
+
}
|
|
4056
|
+
if (input.includes("/")) {
|
|
4057
|
+
if (input.includes(":"))
|
|
4058
|
+
return { type: "repo", url: input };
|
|
4059
|
+
return { type: "repo", url: `https://github.com/${input}` };
|
|
4060
|
+
}
|
|
4061
|
+
const { name, tag } = await getNameAndTag(input);
|
|
4062
|
+
return { name, tag, type: "npm" };
|
|
4063
|
+
}
|
|
4064
|
+
async run() {
|
|
4065
|
+
const { argv, flags } = await this.parse(_PluginsInstall);
|
|
4066
|
+
this.flags = flags;
|
|
4067
|
+
if (flags.verbose && !flags.silent)
|
|
4068
|
+
this.plugins.verbose = true;
|
|
4069
|
+
if (flags.silent && !flags.verbose)
|
|
4070
|
+
this.plugins.silent = true;
|
|
4071
|
+
const aliases = this.config.pjson.oclif.aliases || {};
|
|
4072
|
+
for (let name of argv) {
|
|
4073
|
+
if (aliases[name] === null)
|
|
4074
|
+
this.error(`${name} is blocked`);
|
|
4075
|
+
name = aliases[name] || name;
|
|
4076
|
+
const p = await this.parsePlugin(name);
|
|
4077
|
+
let plugin;
|
|
4078
|
+
await this.config.runHook("plugins:preinstall", {
|
|
4079
|
+
plugin: p
|
|
4080
|
+
});
|
|
4081
|
+
try {
|
|
4082
|
+
if (p.type === "npm") {
|
|
4083
|
+
import_core6.ux.action.start(`Installing plugin ${source_default.cyan(this.plugins.friendlyName(p.name) + "@" + p.tag)}`);
|
|
4084
|
+
plugin = await this.plugins.install(p.name, {
|
|
4085
|
+
force: flags.force,
|
|
4086
|
+
tag: p.tag
|
|
4087
|
+
});
|
|
4088
|
+
} else {
|
|
4089
|
+
import_core6.ux.action.start(`Installing plugin ${source_default.cyan(p.url)}`);
|
|
4090
|
+
plugin = await this.plugins.install(p.url, { force: flags.force });
|
|
4091
|
+
}
|
|
4092
|
+
} catch (error) {
|
|
4093
|
+
import_core6.ux.action.stop(source_default.bold.red("failed"));
|
|
4094
|
+
YarnMessagesCache.getInstance().flush(plugin);
|
|
4095
|
+
throw error;
|
|
4096
|
+
}
|
|
4097
|
+
import_core6.ux.action.stop(`installed v${plugin.version}`);
|
|
4098
|
+
YarnMessagesCache.getInstance().flush(plugin);
|
|
4099
|
+
this.log(source_default.green(`
|
|
4100
|
+
Successfully installed ${plugin.name} v${plugin.version}`));
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
};
|
|
4104
|
+
function validateNpmPkgName(name) {
|
|
4105
|
+
if (!(0, import_validate_npm_package_name.default)(name).validForNewPackages) {
|
|
4106
|
+
throw new import_core6.Errors.CLIError("Invalid npm package name.");
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/link.js
|
|
4111
|
+
init_cjs_shims();
|
|
4112
|
+
var import_core7 = __toESM(require_lib(), 1);
|
|
4113
|
+
var PluginsLink = class _PluginsLink extends import_core7.Command {
|
|
4114
|
+
static args = {
|
|
4115
|
+
path: import_core7.Args.string({ default: ".", description: "path to plugin", name: "path", required: true })
|
|
4116
|
+
};
|
|
4117
|
+
static description = `Links a plugin into the CLI for development.
|
|
4118
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
4119
|
+
|
|
4120
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
4121
|
+
`;
|
|
4122
|
+
static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];
|
|
4123
|
+
static flags = {
|
|
4124
|
+
help: import_core7.Flags.help({ char: "h" }),
|
|
4125
|
+
install: import_core7.Flags.boolean({
|
|
4126
|
+
allowNo: true,
|
|
4127
|
+
default: true,
|
|
4128
|
+
description: "Install dependencies after linking the plugin."
|
|
4129
|
+
}),
|
|
4130
|
+
verbose: import_core7.Flags.boolean({ char: "v" })
|
|
4131
|
+
};
|
|
4132
|
+
static usage = "plugins:link PLUGIN";
|
|
4133
|
+
plugins = new Plugins(this.config);
|
|
4134
|
+
async run() {
|
|
4135
|
+
const { args, flags } = await this.parse(_PluginsLink);
|
|
4136
|
+
this.plugins.verbose = flags.verbose;
|
|
4137
|
+
import_core7.ux.action.start(`Linking plugin ${source_default.cyan(args.path)}`);
|
|
4138
|
+
await this.plugins.link(args.path, { install: flags.install });
|
|
4139
|
+
import_core7.ux.action.stop();
|
|
4140
|
+
YarnMessagesCache.getInstance().flush();
|
|
4141
|
+
}
|
|
4142
|
+
};
|
|
4143
|
+
|
|
4144
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/reset.js
|
|
4145
|
+
init_cjs_shims();
|
|
4146
|
+
var import_core8 = __toESM(require_lib(), 1);
|
|
4147
|
+
import { rm } from "node:fs/promises";
|
|
4148
|
+
import { join as join5 } from "node:path";
|
|
4149
|
+
var Reset = class _Reset extends import_core8.Command {
|
|
4150
|
+
static flags = {
|
|
4151
|
+
hard: import_core8.Flags.boolean({
|
|
4152
|
+
summary: "Delete node_modules and package manager related files in addition to uninstalling plugins."
|
|
4153
|
+
}),
|
|
4154
|
+
reinstall: import_core8.Flags.boolean({
|
|
4155
|
+
summary: "Reinstall all plugins after uninstalling."
|
|
4156
|
+
})
|
|
4157
|
+
};
|
|
4158
|
+
static summary = "Remove all user-installed and linked plugins.";
|
|
4159
|
+
async run() {
|
|
4160
|
+
const { flags } = await this.parse(_Reset);
|
|
4161
|
+
const plugins = new Plugins(this.config);
|
|
4162
|
+
const userPlugins = await plugins.list();
|
|
4163
|
+
this.log(`Found ${userPlugins.length} plugin${userPlugins.length === 0 ? "" : "s"}:`);
|
|
4164
|
+
for (const plugin of userPlugins) {
|
|
4165
|
+
this.log(`- ${plugin.name} ${source_default.dim(this.config.plugins.get(plugin.name)?.version)} ${source_default.dim(`(${plugin.type})`)}`);
|
|
4166
|
+
}
|
|
4167
|
+
if (flags.hard) {
|
|
4168
|
+
const filesToDelete = [
|
|
4169
|
+
join5(this.config.dataDir, "node_modules"),
|
|
4170
|
+
join5(this.config.dataDir, "package.json"),
|
|
4171
|
+
join5(this.config.dataDir, "yarn.lock"),
|
|
4172
|
+
join5(this.config.dataDir, "package-lock.json")
|
|
4173
|
+
];
|
|
4174
|
+
this.log("\u2705 Removed the following files:");
|
|
4175
|
+
for (const file of filesToDelete) {
|
|
4176
|
+
this.log(`- ${file}`);
|
|
4177
|
+
}
|
|
4178
|
+
await Promise.all(filesToDelete.map((file) => rm(file, { force: true, recursive: true })));
|
|
4179
|
+
for (const plugin of userPlugins) {
|
|
4180
|
+
this.log(`\u2705 ${plugin.type === "link" ? "Unlinked" : "Uninstalled"} ${plugin.name}`);
|
|
4181
|
+
}
|
|
4182
|
+
} else {
|
|
4183
|
+
for (const plugin of userPlugins) {
|
|
4184
|
+
try {
|
|
4185
|
+
await plugins.uninstall(plugin.name);
|
|
4186
|
+
this.log(`\u2705 ${plugin.type === "link" ? "Unlinked" : "Uninstalled"} ${plugin.name}`);
|
|
4187
|
+
} catch {
|
|
4188
|
+
this.warn(`Failed to uninstall ${plugin.name}`);
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
if (flags.reinstall) {
|
|
4193
|
+
this.log("Reinstall flag passed:");
|
|
4194
|
+
for (const plugin of userPlugins) {
|
|
4195
|
+
if (plugin.type === "link") {
|
|
4196
|
+
try {
|
|
4197
|
+
const newPlugin = await plugins.link(plugin.root, { install: false });
|
|
4198
|
+
const newVersion = source_default.dim(`-> ${newPlugin.version}`);
|
|
4199
|
+
this.log(`\u2705 Relinked ${plugin.name} ${newVersion}`);
|
|
4200
|
+
} catch {
|
|
4201
|
+
this.warn(`Failed to relink ${plugin.name}`);
|
|
4202
|
+
}
|
|
4203
|
+
}
|
|
4204
|
+
if (plugin.type === "user") {
|
|
4205
|
+
try {
|
|
4206
|
+
const newPlugin = await plugins.install(plugin.name, { tag: plugin.tag });
|
|
4207
|
+
const newVersion = source_default.dim(`-> ${newPlugin.version}`);
|
|
4208
|
+
const tag = plugin.tag ? `@${plugin.tag}` : plugin.url ? ` (${plugin.url})` : "";
|
|
4209
|
+
this.log(`\u2705 Reinstalled ${plugin.name}${tag} ${newVersion}`);
|
|
4210
|
+
} catch {
|
|
4211
|
+
this.warn(`Failed to reinstall ${plugin.name}`);
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
}
|
|
4215
|
+
}
|
|
4216
|
+
}
|
|
4217
|
+
};
|
|
4218
|
+
|
|
4219
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/uninstall.js
|
|
4220
|
+
init_cjs_shims();
|
|
4221
|
+
var import_core9 = __toESM(require_lib(), 1);
|
|
4222
|
+
function removeTags(plugin) {
|
|
4223
|
+
if (plugin.includes("@")) {
|
|
4224
|
+
const chunked = plugin.split("@");
|
|
4225
|
+
const last = chunked.at(-1);
|
|
4226
|
+
if (!last?.includes("/") && chunked.length > 1) {
|
|
4227
|
+
chunked.pop();
|
|
4228
|
+
}
|
|
4229
|
+
return chunked.join("@");
|
|
4230
|
+
}
|
|
4231
|
+
return plugin;
|
|
4232
|
+
}
|
|
4233
|
+
var PluginsUninstall = class _PluginsUninstall extends import_core9.Command {
|
|
4234
|
+
static aliases = ["plugins:unlink", "plugins:remove"];
|
|
4235
|
+
static args = {
|
|
4236
|
+
plugin: import_core9.Args.string({ description: "plugin to uninstall" })
|
|
4237
|
+
};
|
|
4238
|
+
static description = "Removes a plugin from the CLI.";
|
|
4239
|
+
static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %>'];
|
|
4240
|
+
static flags = {
|
|
4241
|
+
help: import_core9.Flags.help({ char: "h" }),
|
|
4242
|
+
verbose: import_core9.Flags.boolean({ char: "v" })
|
|
4243
|
+
};
|
|
4244
|
+
static strict = false;
|
|
4245
|
+
static usage = "plugins:uninstall PLUGIN...";
|
|
4246
|
+
plugins = new Plugins(this.config);
|
|
4247
|
+
// In this case we want these operations to happen
|
|
4248
|
+
// sequentially so the `no-await-in-loop` rule is ignored
|
|
4249
|
+
async run() {
|
|
4250
|
+
const { argv, flags } = await this.parse(_PluginsUninstall);
|
|
4251
|
+
this.plugins = new Plugins(this.config);
|
|
4252
|
+
if (flags.verbose)
|
|
4253
|
+
this.plugins.verbose = true;
|
|
4254
|
+
if (argv.length === 0)
|
|
4255
|
+
argv.push(".");
|
|
4256
|
+
for (const plugin of argv) {
|
|
4257
|
+
const friendly = removeTags(this.plugins.friendlyName(plugin));
|
|
4258
|
+
import_core9.ux.action.start(`Uninstalling ${friendly}`);
|
|
4259
|
+
const unfriendly = await this.plugins.hasPlugin(removeTags(plugin));
|
|
4260
|
+
if (!unfriendly) {
|
|
4261
|
+
const p = this.config.getPluginsList().find((p2) => p2.name === plugin);
|
|
4262
|
+
if (p?.parent)
|
|
4263
|
+
return this.error(`${friendly} is installed via plugin ${p.parent.name}, uninstall ${p.parent.name} instead`);
|
|
4264
|
+
return this.error(`${friendly} is not installed`);
|
|
4265
|
+
}
|
|
4266
|
+
try {
|
|
4267
|
+
const { name } = unfriendly;
|
|
4268
|
+
await this.plugins.uninstall(name);
|
|
4269
|
+
} catch (error) {
|
|
4270
|
+
import_core9.ux.action.stop(source_default.bold.red("failed"));
|
|
4271
|
+
throw error;
|
|
4272
|
+
}
|
|
4273
|
+
import_core9.ux.action.stop();
|
|
4274
|
+
YarnMessagesCache.getInstance().flush();
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
};
|
|
4278
|
+
|
|
4279
|
+
// node_modules/@oclif/plugin-plugins/lib/commands/plugins/update.js
|
|
4280
|
+
init_cjs_shims();
|
|
4281
|
+
var import_core10 = __toESM(require_lib(), 1);
|
|
4282
|
+
var PluginsUpdate = class _PluginsUpdate extends import_core10.Command {
|
|
4283
|
+
static description = "Update installed plugins.";
|
|
4284
|
+
static flags = {
|
|
4285
|
+
help: import_core10.Flags.help({ char: "h" }),
|
|
4286
|
+
verbose: import_core10.Flags.boolean({ char: "v" })
|
|
4287
|
+
};
|
|
4288
|
+
plugins = new Plugins(this.config);
|
|
4289
|
+
async run() {
|
|
4290
|
+
const { flags } = await this.parse(_PluginsUpdate);
|
|
4291
|
+
this.plugins.verbose = flags.verbose;
|
|
4292
|
+
import_core10.ux.action.start(`${this.config.name}: Updating plugins`);
|
|
4293
|
+
await this.plugins.update();
|
|
4294
|
+
import_core10.ux.action.stop();
|
|
4295
|
+
YarnMessagesCache.getInstance().flush();
|
|
4296
|
+
}
|
|
4297
|
+
};
|
|
4298
|
+
|
|
4299
|
+
// node_modules/@oclif/plugin-plugins/lib/hooks/update.js
|
|
4300
|
+
init_cjs_shims();
|
|
4301
|
+
var update = async function() {
|
|
4302
|
+
const plugins = new Plugins(this.config);
|
|
4303
|
+
try {
|
|
4304
|
+
await plugins.update();
|
|
4305
|
+
} catch (error) {
|
|
4306
|
+
if (error instanceof Error) {
|
|
4307
|
+
this.error(error.message);
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
};
|
|
4311
|
+
|
|
4312
|
+
// node_modules/@oclif/plugin-plugins/lib/index.js
|
|
4313
|
+
var commands = {
|
|
4314
|
+
plugins: PluginsIndex,
|
|
4315
|
+
"plugins:inspect": PluginsInspect,
|
|
4316
|
+
"plugins:install": PluginsInstall,
|
|
4317
|
+
"plugins:link": PluginsLink,
|
|
4318
|
+
"plugins:reset": Reset,
|
|
4319
|
+
"plugins:uninstall": PluginsUninstall,
|
|
4320
|
+
"plugins:update": PluginsUpdate
|
|
4321
|
+
};
|
|
4322
|
+
var hooks = {
|
|
4323
|
+
update
|
|
4324
|
+
};
|
|
22
4325
|
|
|
23
4326
|
// node_modules/@oclif/plugin-test-esm-1/dist/index.js
|
|
24
4327
|
init_cjs_shims();
|
|
25
4328
|
|
|
26
4329
|
// node_modules/@oclif/plugin-test-esm-1/dist/commands/esm1.js
|
|
27
4330
|
init_cjs_shims();
|
|
28
|
-
var
|
|
29
|
-
var ESM1 = class _ESM1 extends
|
|
4331
|
+
var import_core11 = __toESM(require_lib(), 1);
|
|
4332
|
+
var ESM1 = class _ESM1 extends import_core11.Command {
|
|
30
4333
|
static flags = {
|
|
31
|
-
optionalString:
|
|
32
|
-
defaultString:
|
|
4334
|
+
optionalString: import_core11.Flags.string(),
|
|
4335
|
+
defaultString: import_core11.Flags.string({
|
|
33
4336
|
default: "simple string default"
|
|
34
4337
|
}),
|
|
35
|
-
defaultFnString:
|
|
4338
|
+
defaultFnString: import_core11.Flags.string({
|
|
36
4339
|
default: async () => "async fn default"
|
|
37
4340
|
})
|
|
38
4341
|
};
|
|
39
4342
|
static args = {
|
|
40
|
-
optionalArg:
|
|
41
|
-
defaultArg:
|
|
4343
|
+
optionalArg: import_core11.Args.string(),
|
|
4344
|
+
defaultArg: import_core11.Args.string({
|
|
42
4345
|
default: "simple string default"
|
|
43
4346
|
}),
|
|
44
|
-
defaultFnArg:
|
|
4347
|
+
defaultFnArg: import_core11.Args.string({
|
|
45
4348
|
default: async () => "async fn default"
|
|
46
4349
|
})
|
|
47
4350
|
};
|
|
@@ -61,16 +4364,18 @@ var hook = async function() {
|
|
|
61
4364
|
var init_default2 = hook;
|
|
62
4365
|
|
|
63
4366
|
// node_modules/@oclif/plugin-test-esm-1/dist/index.js
|
|
64
|
-
var
|
|
4367
|
+
var hooks2 = {
|
|
65
4368
|
init: init_default2
|
|
66
4369
|
};
|
|
67
|
-
var
|
|
4370
|
+
var commands2 = {
|
|
68
4371
|
esm1: ESM1
|
|
69
4372
|
};
|
|
70
4373
|
|
|
71
4374
|
// src/index.ts
|
|
72
|
-
var ESM1_INIT_HOOK =
|
|
4375
|
+
var ESM1_INIT_HOOK = hooks2.init;
|
|
4376
|
+
var UPDATE_HOOK = hooks.update;
|
|
73
4377
|
var COMMANDS = {
|
|
4378
|
+
...commands2,
|
|
74
4379
|
...commands,
|
|
75
4380
|
esbuild: ESBuild,
|
|
76
4381
|
hello: Hello,
|
|
@@ -78,11 +4383,12 @@ var COMMANDS = {
|
|
|
78
4383
|
"hello:world": World
|
|
79
4384
|
};
|
|
80
4385
|
async function run() {
|
|
81
|
-
await (0,
|
|
4386
|
+
await (0, import_core12.execute)({ dir: import.meta.url });
|
|
82
4387
|
}
|
|
83
4388
|
export {
|
|
84
4389
|
COMMANDS,
|
|
85
4390
|
ESM1_INIT_HOOK,
|
|
86
4391
|
init_default as INIT_HOOK,
|
|
4392
|
+
UPDATE_HOOK,
|
|
87
4393
|
run
|
|
88
4394
|
};
|